diff --git a/th02/gaiji/loadfree.asm b/th02/gaiji/loadfree.asm deleted file mode 100644 index 36a7af7f..00000000 --- a/th02/gaiji/loadfree.asm +++ /dev/null @@ -1,19 +0,0 @@ -public GAIJI_LOAD -gaiji_load proc near - push bp - mov bp, sp - call gaiji_backup - call gaiji_entry_bfnt pascal, ds, offset aMikoft_bft - pop bp - retn -gaiji_load endp - - -public GAIJI_FREE -gaiji_free proc near - push bp - mov bp, sp - call gaiji_restore - pop bp - retn -gaiji_free endp diff --git a/th02/gaiji/loadfree.cpp b/th02/gaiji/loadfree.cpp new file mode 100644 index 00000000..d62c418d --- /dev/null +++ b/th02/gaiji/loadfree.cpp @@ -0,0 +1,16 @@ +#include "th02/shiftjis/fns.hpp" +#include "th02/gaiji/loadfree.h" + +void near gaiji_load(void) +{ + #undef GAIJI_FN + extern const char GAIJI_FN[]; + + gaiji_backup(); + gaiji_entry_bfnt(GAIJI_FN); +} + +void near gaiji_free(void) +{ + gaiji_restore(); +} diff --git a/th02/gaiji/loadfree.h b/th02/gaiji/loadfree.h index a3c30a52..5e44f956 100644 --- a/th02/gaiji/loadfree.h +++ b/th02/gaiji/loadfree.h @@ -1,2 +1,6 @@ -void pascal near gaiji_load(void); -void pascal near gaiji_free(void); +// Backs up the contents of the PC-98 gaiji RAM, then replaces its contents +// with the TH02-specific gaiji. +void near gaiji_load(void); + +// Restores the backup made by gaiji_load(). +void near gaiji_free(void); diff --git a/th02/main/hud/hud.cpp b/th02/main/hud/hud.cpp index fd6fa99b..af5a12ed 100644 --- a/th02/main/hud/hud.cpp +++ b/th02/main/hud/hud.cpp @@ -32,6 +32,8 @@ static const tram_cell_amount_t gsHISCORE_W = (4 * GAIJI_TRAM_W); extern const gaiji_th02_t gRANKS[RANK_COUNT][8]; // ------------- +#include "th02/gaiji/loadfree.cpp" + // Coordinates // ----------- diff --git a/th02/shiftjis/fns.hpp b/th02/shiftjis/fns.hpp index 139e71a6..ae26082c 100644 --- a/th02/shiftjis/fns.hpp +++ b/th02/shiftjis/fns.hpp @@ -1,2 +1,3 @@ #define PF_FN "“Œ•û••–‚.˜^" #define MUSIC_CMT_FN "MUSIC.TXT" +#define SHIFTJIS_FN "MIKOFT.bft" diff --git a/th02_main.asm b/th02_main.asm index 2fa469de..ca1055f1 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -1125,7 +1125,7 @@ loc_B2EE: loc_B2F5: cmp si, 128 jl short loc_B2EE - call gaiji_load + call @gaiji_load$qv call sub_E178 les bx, _resident mov al, es:[bx+mikoconfig_t.reduce_effects] @@ -2643,7 +2643,7 @@ public @GameExecl$qnxc call super_free call graph_clear call text_clear - call gaiji_free + call @gaiji_free$qv call _game_exit call _execl c, large [bp+@@binary_fn], large [bp+@@binary_fn], large 0 pop bp @@ -5341,11 +5341,11 @@ loc_DC31: leave retn sub_DAF0 endp - -include th02/gaiji/loadfree.asm main_01__TEXT ends HUD_TEXT segment byte public 'CODE' use16 + @gaiji_load$qv procdesc near + @gaiji_free$qv procdesc near @score_extend_init$qv procdesc near extern @score_delta_commit$qv:proc @score_reset$qv procdesc near @@ -31640,8 +31640,8 @@ _gsHISCORE db gs_Hi, gs_Sc, gs_cor, gs_e, 0 _gsREIMU db gs_REIMU_REI, gs_REIMU_MU, 0, 0, 0 _gsREIGEKI db gs_REIGEKI_REI, gs_REIGEKI_GEKI, 0, 0, 0 _gsREIRYOKU db gs_REIRYOKU_REI, gs_REIRYOKU_RYOKU, 0, 0, 0 -aMikoft_bft db 'MIKOFT.bft',0 -public _POWER_TO_SHOT_LEVEL +public _GAIJI_FN, _POWER_TO_SHOT_LEVEL +_GAIJI_FN db 'MIKOFT.bft',0 _POWER_TO_SHOT_LEVEL db 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9 byte_1E64E db 0 db 0