diff --git a/Makefile.mak b/Makefile.mak index ce5445b9..49525237 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -53,7 +53,7 @@ bin\th01\reiiden.exe: bin\piloadc.obj bin\th01\reiiden.obj th01\main_010.cpp th0 $** | -bin\th01\fuuin.exe: bin\piloadc.obj bin\th01\fuuin.obj th01\fuuin_01.cpp bin\th01\input_mf.obj th01\fuuin_02.cpp th01\fuuin_03.cpp th01\fuuin_04.cpp bin\th01\vsync.obj bin\th01\ztext.obj bin\th01\initexit.obj bin\th01\graph.obj bin\th01\grppffx.obj th01\fuuin_10.cpp th01\f_imgd_f.cpp bin\th01\vplanset.obj th01\fuuin_11.cpp th01\2x_fuuin.cpp bin\th01\mdrv2.obj bin\th01\fuuinm.obj +bin\th01\fuuin.exe: bin\piloadc.obj th01\fuuinvar.cpp th01\fuuin_01.cpp bin\th01\fuuin.obj bin\th01\input_mf.obj th01\fuuin_02.cpp th01\fuuin_03.cpp th01\fuuin_04.cpp bin\th01\vsync.obj bin\th01\ztext.obj bin\th01\initexit.obj bin\th01\graph.obj bin\th01\grppffx.obj th01\fuuin_10.cpp th01\f_imgd_f.cpp bin\th01\vplanset.obj th01\fuuin_11.cpp th01\2x_fuuin.cpp bin\th01\mdrv2.obj bin\th01\fuuinm.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=1 -DBINARY='E' -nbin\th01\ -eFUUIN.EXE @&&| $** | diff --git a/th01/end/vars.cpp b/th01/end/vars.cpp new file mode 100644 index 00000000..568e2349 --- /dev/null +++ b/th01/end/vars.cpp @@ -0,0 +1,15 @@ +#include "platform.h" +#include "th01/common.h" +#include "th01/resident.hpp" + +long score = 100000; +long score_highest = 100000; +long continues_total; +long continues_per_scene[SCENE_COUNT]; + +// ZUN bloat: 308 unused bytes… for 77 extra scenes, maybe?! +static int8_t unused[308]; + +char start_lives_extra; +end_sequence_t end_flag; +unsigned char rank; diff --git a/th01/fuuin_01.cpp b/th01/fuuin_01.cpp index 2fdcbab9..e68932ec 100644 --- a/th01/fuuin_01.cpp +++ b/th01/fuuin_01.cpp @@ -18,15 +18,10 @@ extern "C" { #include "th01/snd/mdrv2.h" } -#undef RES_ID - bool16 end_init(void) { int i; - #define RES_ID RES_ID_0 - extern const char RES_ID[]; resident_t __seg *sgm = ResData::exist(RES_ID); - #undef RES_ID if(sgm) { resident_t* resident = sgm; if(resident->end_flag) { @@ -48,13 +43,11 @@ bool16 end_init(void) resident->continues_total = 0; resident->score_highest = 0; } else { - extern const char ERROR_END_FLAG[]; - puts(ERROR_END_FLAG); + puts("ERROR : end_flag is not ture !!"); return false; } } else { - extern const char ERROR_NO_RESDATA[]; - puts(ERROR_NO_RESDATA); + puts("ERROR : cfg_id is not alloc!!"); return false; } return true; @@ -63,10 +56,7 @@ bool16 end_init(void) bool16 end_resident_clear(void) { int i; - #define RES_ID RES_ID_1 - extern const char RES_ID[]; resident_t __seg *sgm = ResData::exist(RES_ID); - #undef RES_ID if(sgm) { resident_t* resident = sgm; resident->score = 0; @@ -83,9 +73,6 @@ bool16 end_resident_clear(void) void main(int argc, const char *argv[]) { - extern char OP_PATH[]; - extern char OP_ARG0[]; - if(!mdrv2_resident()) { return; } @@ -110,5 +97,5 @@ void main(int argc, const char *argv[]) game_init(); end_and_verdict_and_regist_animate(); game_switch_binary(); - execl(OP_PATH, OP_ARG0, nullptr, nullptr); + execl("op", "op", nullptr, nullptr); } diff --git a/th01/fuuinvar.cpp b/th01/fuuinvar.cpp new file mode 100644 index 00000000..75a70de2 --- /dev/null +++ b/th01/fuuinvar.cpp @@ -0,0 +1 @@ +#include "th01/end/vars.cpp" diff --git a/th01_fuuin.asm b/th01_fuuin.asm index f9157e94..54b84636 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -14,7 +14,7 @@ ; Application type: Executable 16bit .386 - .model use16 large _TEXT + .model use16 large include ReC98.inc include th01/th01.inc @@ -48,93 +48,8 @@ include libs/master.lib/gdc_outpw.asm include libs/master.lib/random.asm _TEXT ends -; =========================================================================== - -; Segment type: Pure code -fuuin_01_TEXT segment byte public 'CODE' use16 -fuuin_01_TEXT ends - -; =========================================================================== - -fuuin_02_TEXT segment byte public 'CODE' use16 -fuuin_02_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -fuuin_03_TEXT segment byte public 'CODE' use16 -fuuin_03_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -fuuin_04_TEXT segment byte public 'CODE' use16 -fuuin_04_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -vsync_TEXT segment byte public 'CODE' use16 -vsync_TEXT ends - -; =========================================================================== - -ztext_TEXT segment byte public 'CODE' use16 -ztext_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -initexit_TEXT segment byte public 'CODE' use16 -initexit_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -graph_TEXT segment byte public 'CODE' use16 -graph_TEXT ends - -; =========================================================================== - -grppffx_TEXT segment byte public 'CODE' use16 -grppffx_TEXT ends - -; =========================================================================== - -PTN_GRP_GRZ segment byte public 'CODE' use16 -PTN_GRP_GRZ ends - -; =========================================================================== - -SHARED segment byte public 'CODE' use16 -SHARED ends - -; =========================================================================== - -; Segment type: Pure code -GRAPH_EX_TEXT segment byte public 'CODE' use16 -GRAPH_EX_TEXT ends - -; =========================================================================== - -; Segment type: Pure code -mdrv2_TEXT segment byte public 'CODE' use16 -mdrv2_TEXT ends - .data -public _score, _score_highest -public _RES_ID_0, _RES_ID_1, _ERROR_END_FLAG, _ERROR_NO_RESDATA -public _OP_PATH, _OP_ARG0 -_score dd 100000 -_score_highest dd 100000 -_RES_ID_0 db 'ReiidenConfig',0 -_ERROR_END_FLAG db 'ERROR : end_flag is not ture !!',0 -_ERROR_NO_RESDATA db 'ERROR : cfg_id is not alloc!!',0 -_RES_ID_1 db 'ReiidenConfig',0 -_OP_PATH db 'op',0 -_OP_ARG0 db 'op',0 - ; libs/master.lib/grp[data].asm extern graph_VramSeg:word extern graph_VramWords:word @@ -171,17 +86,6 @@ IDLEN EQU 10 ; libs/master.lib/rand[data].asm extern random_seed:dword - .data? - -public _continues_total, _continues_per_scene -_continues_total dd ? -_continues_per_scene dd SCENE_COUNT dup(?) - db 308 dup(?) -public _start_lives_extra, _end_flag, _rank -_start_lives_extra db ? -_end_flag db ? ; ZUN symbol [Strings] -_rank db ? - ; libs/master.lib/pal[bss].asm extern Palettes:rgb_t:COLOR_COUNT