jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974)

This PR adds detection of the `launch-particles` and `seconds-per-frame`
macros to the decompiler, removing a lot of bloat and hiding many
process register uses.

I also added `og:preserve-this` comments to as many manual patches and
comments as I could, which will soon be used in conjunction with CI to
hopefully catch any regressions in future big decomp update PRs.

I have some concerns about the `launch-particles` macro (more details in
`sparticle-launcher.gc`) , but thus far, I have not seen anything break
yet.

---------

Co-authored-by: water <awaterford111445@gmail.com>
This commit is contained in:
Hat Kid
2023-09-10 17:48:56 +02:00
committed by GitHub
parent 74250a22f7
commit 49e798f88c
525 changed files with 16710 additions and 20790 deletions
+6 -1
View File
@@ -78,11 +78,13 @@ struct LetRewriteStats {
int set_let = 0;
int with_dma_buf_add_bucket = 0;
int dma_buffer_add_gs_set = 0;
int launch_particles = 0;
int total() const {
return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else +
set_vector + set_vector2 + send_event + font_context_meth + proc_new + attack_info +
vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set;
vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set +
launch_particles;
}
std::string print() const {
@@ -108,6 +110,7 @@ struct LetRewriteStats {
out += fmt::format(" set_let: {}\n", set_let);
out += fmt::format(" with_dma_buf_add_bucket: {}\n", with_dma_buf_add_bucket);
out += fmt::format(" dma_buffer_add_gs_set: {}\n", dma_buffer_add_gs_set);
out += fmt::format(" launch_particles: {}\n", launch_particles);
return out;
}
@@ -131,6 +134,7 @@ struct LetRewriteStats {
result.rand_float_gen = rand_float_gen + other.rand_float_gen;
result.set_let = rand_float_gen + other.set_let;
result.with_dma_buf_add_bucket = rand_float_gen + other.with_dma_buf_add_bucket;
result.launch_particles = launch_particles + other.launch_particles;
return result;
}
@@ -153,6 +157,7 @@ struct LetRewriteStats {
rand_float_gen += other.rand_float_gen;
set_let += other.set_let;
with_dma_buf_add_bucket += other.with_dma_buf_add_bucket;
launch_particles += other.launch_particles;
return *this;
}
};