From 9ff0033a0c5c49baefb50f10dbf7301d614e8692 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 25 Jul 2021 19:58:36 +0200 Subject: [PATCH] [Reverse-engineering] [th05] Bullets: Far wrapper for regular bullet spawning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only used for the revenge bullets fired from Stage 3 Alice's barrier. Not worth creating a separate translation unit, especially since the function above is undecompilable as well… Part of P0152, funded by -Tom- and [Anonymous]. --- th04/main/bullet/bullet.hpp | 3 +++ th05/bullet.asm | 9 +++++++++ th05_main.asm | 11 ++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/th04/main/bullet/bullet.hpp b/th04/main/bullet/bullet.hpp index deafdcca..dee156a3 100644 --- a/th04/main/bullet/bullet.hpp +++ b/th04/main/bullet/bullet.hpp @@ -241,6 +241,9 @@ extern nearfunc_t_near bullet_template_tune; #if (GAME == 5) void near bullets_add_regular(void); void near bullets_add_special(void); + + // Only used for the revenge bullets fired from Stage 3 Alice's barrier. + void far bullets_add_regular_far(void); #else // TH04 additionally uses pointless per-difficulty wrappers around these // spawn functions that don't actually do anything difficulty-specific. diff --git a/th05/bullet.asm b/th05/bullet.asm index 54cf29a1..0f8a2834 100644 --- a/th05/bullet.asm +++ b/th05/bullet.asm @@ -11,11 +11,20 @@ MAIN_03 group MAIN_031_TEXT extrn _bullet_template:bullet_template_t extrn _playperf:byte +_bullets_add_regular procdesc near + ; ---------------------------------------------------------------------------- MAIN_031_TEXT segment word public 'CODE' use16 assume cs:MAIN_03 +public _bullets_add_regular_far +_bullets_add_regular_far proc far + call _bullets_add_regular + retf +_bullets_add_regular_far endp + + tune proc public TUNE_FOR_EASY public TUNE_FOR_HARD diff --git a/th05_main.asm b/th05_main.asm index c7aa6e65..dd36fa12 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -9176,7 +9176,7 @@ loc_128D8: mov _bullet_template.BT_origin, eax call randring1_next16 mov _bullet_template.BT_angle, al - call sub_15DE2 + call _bullets_add_regular_far loc_128EA: call hitshot_from pascal, [si+shot_alive_t.SA_shot] @@ -10566,17 +10566,10 @@ loc_15DDF: pop si retn _bullets_add_raw endp - -; =============== S U B R O U T I N E ======================================= - - -sub_15DE2 proc far - call _bullets_add_regular - retf -sub_15DE2 endp main_031_TEXT ends main_032_TEXT segment byte public 'CODE' use16 + extern _bullets_add_regular_far:proc BULLET_TEMPLATE_TUNE_EASY procdesc near BULLET_TEMPLATE_TUNE_NORMAL procdesc near BULLET_TEMPLATE_TUNE_HARD procdesc near