[Maintenance] [th04/th05] Demo Play: Move OP return code into the header

Part of P0258, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2023-10-13 23:17:39 +02:00
parent 757ee718c4
commit 4c888ee4ad
4 changed files with 23 additions and 15 deletions

View File

@ -17,7 +17,9 @@
void near DemoPlay(void)
{
extern const char DEMO_OP[];
#undef BINARY_OP
#define BINARY_OP DEMOPLAY_BINARY_OP
extern const char BINARY_OP[];
#if (GAME == 5)
size_t shift_offset = (resident->demo_num <= 4) ? DEMO_N : DEMO_N_EXTRA;
@ -40,16 +42,5 @@ void near DemoPlay(void)
return;
}
}
HMem<uint8_t>::free(DemoBuf);
palette_black_out((GAME == 5) ? 8 : 10);
/* TODO: Replace with the decompiled call
* GameExecl(DEMO_OP);
* once that function is part of the same segment */
_asm {
push ds;
push offset DEMO_OP;
nop;
push cs;
call near ptr GameExecl;
}
demo_end();
}

View File

@ -15,5 +15,20 @@
// buffer.
extern uint8_t *DemoBuf; /* ZUN symbol [MAGNet2010] */
#define demo_end() { \
HMem<uint8_t>::free(DemoBuf); \
palette_black_out((GAME == 5) ? 8 : 10); \
/* TODO: Replace with the decompiled call \
* GameExecl(BINARY_OP); \
* once that function is only called from the same segment */ \
_asm { \
push ds; \
push offset BINARY_OP; \
nop; \
push cs; \
call near ptr GameExecl; \
} \
}
// Assigns the next frame out of [DemoBuf] to [key_det] and [shiftkey].
void near DemoPlay();

View File

@ -1,2 +1,2 @@
public _DEMO_OP
_DEMO_OP db 'op',0
public _DEMOPLAY_BINARY_OP
_DEMOPLAY_BINARY_OP db 'op',0

View File

@ -1,3 +1,5 @@
#define BINARY_OP "op"
#define EYECATCH_FN_FORMAT "eye0.cdg"
#define FACESET_REIMU_FN "KAO0.cd2"