diff --git a/Makefile.mak b/Makefile.mak index 1df9dd91..87ee99fb 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -157,7 +157,7 @@ bin\th04\main.exe: bin\th04\main.obj bin\th04\slowdown.obj th04\demo.cpp th04\em $** | -bin\th04\maine.exe: bin\th04\maine.obj bin\th04\cfg_lres.obj th04\cutscene.cpp th04\staff.cpp bin\th01\vplanset.obj bin\th02\frmdely1.obj bin\th03\pi_put.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th04\cdg_load.obj bin\th03\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\snd_mode.obj bin\th04\snd_dlym.obj bin\th04\cdg_p_pl.obj bin\th04\snd_load.obj +bin\th04\maine.exe: th04\maine_e.cpp bin\th04\maine.obj th04\cutscene.cpp th04\staff.cpp bin\th01\vplanset.obj bin\th02\frmdely1.obj bin\th03\pi_put.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th04\cdg_load.obj bin\th03\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\snd_mode.obj bin\th04\snd_dlym.obj bin\th04\cdg_p_pl.obj bin\th04\snd_load.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='E' -3 -Z -nbin\th04\ -eMAINE.EXE @&&| $** | @@ -180,7 +180,7 @@ bin\th05\main.exe: bin\th05\main.obj bin\th04\slowdown.obj th05\demo.cpp th05\em $** | -bin\th05\maine.exe: bin\th05\maine.obj th05\cutscene.cpp bin\th04\cfg_lres.obj th05\regist.cpp th05\staff.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj +bin\th05\maine.exe: th05\maine_e.cpp bin\th05\maine.obj th05\cutscene.cpp th05\regist.cpp th05\staff.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=5 -DBINARY='E' -3 -Z -nbin\th05\ -eMAINE.EXE @&&| $** | diff --git a/th04/end/entry.cpp b/th04/end/entry.cpp new file mode 100644 index 00000000..a09aec11 --- /dev/null +++ b/th04/end/entry.cpp @@ -0,0 +1,14 @@ +#include "platform.h" +#include "master.hpp" +#include "th03/formats/cfg_impl.hpp" + +resident_t far* resident; + +// ZUN bloat: Should be its own translation unit. +resident_t __seg* near cfg_load_resident_ptr(void) +{ + #undef CFG_FN + extern const char CFG_FN[]; + cfg_t cfg; + return cfg_load_and_set_resident(cfg, CFG_FN); +} diff --git a/th04/maine_e.cpp b/th04/maine_e.cpp new file mode 100644 index 00000000..39f484b2 --- /dev/null +++ b/th04/maine_e.cpp @@ -0,0 +1 @@ +#include "th04/end/entry.cpp" diff --git a/th04_maine.asm b/th04_maine.asm index bccc3897..6034e76d 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -26,7 +26,7 @@ include th04/hardware/grppsafx.inc extern _tolower:proc extern __ctype:byte -group_01 group CFG_LRES_TEXT, CUTSCENE_TEXT, maine_01_TEXT +group_01 group MAINE_E_TEXT, CUTSCENE_TEXT, maine_01_TEXT g_SHARED group SHARED, SHARED_ ; =========================================================================== @@ -147,9 +147,9 @@ _TEXT ends ; =========================================================================== -CFG_LRES_TEXT segment byte public 'CODE' use16 +MAINE_E_TEXT segment byte public 'CODE' use16 @cfg_load_resident_ptr$qv procdesc near -CFG_LRES_TEXT ends +MAINE_E_TEXT ends ; Segment type: Pure code CUTSCENE_TEXT segment byte public 'CODE' use16 @@ -3328,8 +3328,7 @@ aName db 'name',0 .data? -public _resident -_resident dd ? + extern _resident:dword include libs/master.lib/clip[bss].asm include libs/master.lib/fil[bss].asm include libs/master.lib/js[bss].asm diff --git a/th05/maine_e.cpp b/th05/maine_e.cpp new file mode 100644 index 00000000..39f484b2 --- /dev/null +++ b/th05/maine_e.cpp @@ -0,0 +1 @@ +#include "th04/end/entry.cpp" diff --git a/th05_maine.asm b/th05_maine.asm index cb0a3a87..f1629a3f 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -27,7 +27,7 @@ include th04/hardware/grppsafx.inc extern _tolower:proc extern __ctype:byte -group_01 group CFG_LRES_TEXT, CUTSCENE_TEXT, maine_01_TEXT, maine_01__TEXT +group_01 group MAINE_E_TEXT, CUTSCENE_TEXT, maine_01_TEXT, maine_01__TEXT g_SHARED group SHARED, SHARED_ ; =========================================================================== @@ -154,9 +154,9 @@ _TEXT ends ; =========================================================================== -CFG_LRES_TEXT segment byte public 'CODE' use16 +MAINE_E_TEXT segment byte public 'CODE' use16 @cfg_load_resident_ptr$qv procdesc near -CFG_LRES_TEXT ends +MAINE_E_TEXT ends ; Segment type: Pure code CUTSCENE_TEXT segment byte public 'CODE' use16 @@ -6648,8 +6648,7 @@ aStf00_bft db 'stf00.bft',0 .data? -public _resident -_resident dd ? + extern _resident:dword include libs/master.lib/clip[bss].asm include libs/master.lib/fil[bss].asm include libs/master.lib/js[bss].asm