diff --git a/th04/main/boss/reset.cpp b/th04/main/boss/reset.cpp index 7b02617d6..467c26992 100644 --- a/th04/main/boss/reset.cpp +++ b/th04/main/boss/reset.cpp @@ -2,7 +2,7 @@ char boss_phase_timed_out = 0; void pascal near boss_reset(void) { - boss_update = nullsub_1; + boss_update = nullfunc_far; boss_fg_render = nullfunc_near; #if GAME == 5 boss_custombullets_render = nullfunc_near; diff --git a/th04/main/null.asm b/th04/main/null.asm new file mode 100644 index 000000000..ee6e06709 --- /dev/null +++ b/th04/main/null.asm @@ -0,0 +1,12 @@ +public NULLFUNC_NEAR +nullfunc_near proc near + retn +nullfunc_near endp + even + + +public NULLFUNC_FAR +nullfunc_far proc far + retf +nullfunc_far endp + even diff --git a/th04/main/null.hpp b/th04/main/null.hpp new file mode 100644 index 000000000..b2dd5c485 --- /dev/null +++ b/th04/main/null.hpp @@ -0,0 +1,3 @@ +// Null functions for disabling callbacks +void pascal near nullfunc_near(void); +void pascal far nullfunc_far(void); diff --git a/th04_main.asm b/th04_main.asm index 609924338..964b051f4 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -1719,27 +1719,8 @@ include th04/main/scroll_y_1.asm MOTION_UPDATE_DEF 1 include th03/math/randring_fill.asm RANDRING_NEXT_DEF 1 - nop - -; =============== S U B R O U T I N E ======================================= - -public NULLFUNC_NEAR -nullfunc_near proc near - retn -nullfunc_near endp - -; --------------------------------------------------------------------------- - nop - -; =============== S U B R O U T I N E ======================================= - - -nullsub_2 proc far - retf -nullsub_2 endp - -; --------------------------------------------------------------------------- - nop + even +include th04/main/null.asm include th04/main/pointnum/inv_upd.asm include th04/main/pointnum/render.asm include th04/main/pointnum/num_put.asm @@ -18036,7 +18017,7 @@ var_2 = word ptr -2 loc_16638: cmp _boss_phase_frame, 0 jnz short loc_16651 - setfarfp _stage_vm, nullsub_2 + setfarfp _stage_vm, nullfunc_far mov _midboss_frames_until, 0 loc_16651: @@ -20771,7 +20752,7 @@ loc_17E18: les bx, _std_ip cmp word ptr es:[bx], 0 jnz short locret_17E3C - setfarfp _stage_vm, nullsub_2 + setfarfp _stage_vm, nullfunc_far locret_17E3C: leave @@ -21899,7 +21880,7 @@ loc_18706: loc_1872F: cmp _boss_phase_frame, 0 jnz short loc_1876B - setfarfp _stage_vm, nullsub_2 + setfarfp _stage_vm, nullfunc_far mov _midboss_frames_until, 0 mov fp_259E8, offset sub_180BB mov byte_259EF, 0 @@ -24474,7 +24455,7 @@ sub_19EBC proc far mov bp, sp mov _midboss_invalidate?, offset nullfunc_near mov _midboss_render, offset nullfunc_near - setfarfp _midboss_update, nullsub_2 + setfarfp _midboss_update, nullfunc_far mov _midboss_active, 0 mov _midboss_hp, 0 pop bp @@ -26621,7 +26602,7 @@ var_2 = word ptr -2 loc_1B497: cmp _boss_phase_frame, 0 jnz short loc_1B4BA - setfarfp _stage_vm, nullsub_2 + setfarfp _stage_vm, nullfunc_far mov _midboss_frames_until, 0 mov byte_25A08, 0 mov byte_25A1B, 0 @@ -31698,7 +31679,7 @@ items_update endp boss_reset proc near push bp mov bp, sp - setfarfp _boss_update, nullsub_2 + setfarfp _boss_update, nullfunc_far mov _boss_fg_render, offset nullfunc_near mov _boss_phase, 0 mov _boss_mode, 0 @@ -31941,7 +31922,7 @@ stage4_setup endp stage5_setup proc far push bp mov bp, sp - setfarfp _midboss_update_func, nullsub_2 + setfarfp _midboss_update_func, nullfunc_far mov _midboss_render_func, offset nullfunc_near mov _midboss_frames_until, 60000 call boss_reset @@ -31980,7 +31961,7 @@ stage5_setup endp stage6_setup proc far push bp mov bp, sp - setfarfp _midboss_update_func, nullsub_2 + setfarfp _midboss_update_func, nullfunc_far mov _midboss_render_func, offset nullfunc_near mov _midboss_frames_until, 60000 call boss_reset diff --git a/th05/main/stage/setup.cpp b/th05/main/stage/setup.cpp index 5e7bf6ee4..bb79a3f81 100644 --- a/th05/main/stage/setup.cpp +++ b/th05/main/stage/setup.cpp @@ -153,7 +153,7 @@ void pascal near stage5_setup(void) void pascal near stage6_setup(void) { - midboss_update_func = nullsub_1; + midboss_update_func = nullfunc_far; midboss_render_func = nullfunc_near; midboss.frames_until = 30000; diff --git a/th05/main012.cpp b/th05/main012.cpp index 1c2d8e172..af344c12d 100644 --- a/th05/main012.cpp +++ b/th05/main012.cpp @@ -7,12 +7,10 @@ extern "C" { #include "th05/th05.hpp" +#include "th04/main/null.hpp" #include "th04/main/rank.hpp" #include "th04/main/item/items.hpp" -void pascal far nullsub_1(void); -void pascal near nullfunc_near(void); - void pascal near playfield_fillm_32_0_320_192(void); void pascal near playfield_fillm_0_0_384_192__2(void); void pascal near playfield_fillm_0_205_384_163(void); diff --git a/th05_main.asm b/th05_main.asm index 0b853fecc..d0f4c6f34 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -1950,25 +1950,8 @@ include th04/main/scroll_y_1.asm MOTION_UPDATE_DEF 1 include th03/math/randring_fill.asm RANDRING_NEXT_DEF 1 - nop - -; =============== S U B R O U T I N E ======================================= - -public NULLFUNC_NEAR -nullfunc_near proc near - retn -nullfunc_near endp - nop - -; =============== S U B R O U T I N E ======================================= - - -public NULLSUB_1 -nullsub_1 proc far - retf -nullsub_1 endp - nop - + even +include th04/main/null.asm include th04/main/bullet/pellet_r.asm include th04/main/spark_render.asm include th04/main/sparks.asm @@ -13242,7 +13225,7 @@ loc_1603F: les bx, _std_ip cmp word ptr es:[bx], 0 jnz short locret_16063 - setfarfp _stage_vm, nullsub_1 + setfarfp _stage_vm, nullfunc_far locret_16063: leave @@ -14945,7 +14928,7 @@ sub_172FF proc far mov bp, sp mov _midboss_invalidate?, offset nullfunc_near mov _midboss_render, offset nullfunc_near - setfarfp _midboss_update, nullsub_1 + setfarfp _midboss_update, nullfunc_far mov _midboss_hp, 0 pop bp retf