[Decompilation] [th02] Gaiji loading and freeing

Completes P0242, funded by Yanga.
This commit is contained in:
nmlgc 2023-06-02 20:24:11 +02:00
parent fefeb1859d
commit dfa758da89
6 changed files with 31 additions and 27 deletions

View File

@ -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

16
th02/gaiji/loadfree.cpp Normal file
View File

@ -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();
}

View File

@ -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);

View File

@ -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
// -----------

View File

@ -1,2 +1,3 @@
#define PF_FN "“Œ•û••–‚.˜^"
#define MUSIC_CMT_FN "MUSIC.TXT"
#define SHIFTJIS_FN "MIKOFT.bft"

View File

@ -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