diff --git a/Makefile.mak b/Makefile.mak index 392c2501..f02e383c 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -147,7 +147,7 @@ bin\th04\res_huma.com: th04\res_huma.cpp $** | masters.lib -bin\th04\op.exe: th04\cfg.cpp bin\th04\op.obj th04\op_main.cpp th04\m_char.cpp bin\th01\vplanset.obj bin\th02\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_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\cdg_p_nc.obj bin\th04\snd_mode.obj bin\th04\snd_dlym.obj bin\th02\exit_dos.obj bin\th04\snd_load.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initop.obj bin\th04\cdg_p_na.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\egcrect.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th04\cdg_load.obj th04\frmdely2.c +bin\th04\op.exe: th04\op_main.cpp bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\th02\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_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\cdg_p_nc.obj bin\th04\snd_mode.obj bin\th04\snd_dlym.obj bin\th02\exit_dos.obj bin\th04\snd_load.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initop.obj bin\th04\cdg_p_na.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\egcrect.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th04\cdg_load.obj th04\frmdely2.c $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='O' -3 -Z -d -nbin\th04\ -eOP.EXE @&&| $** | diff --git a/th04/cfg.cpp b/th04/cfg.cpp deleted file mode 100644 index beb99a9d..00000000 --- a/th04/cfg.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "th04/formats/cfg.cpp" diff --git a/th04/formats/cfg.cpp b/th04/formats/cfg.cpp index 819e85d2..d27c3b8e 100644 --- a/th04/formats/cfg.cpp +++ b/th04/formats/cfg.cpp @@ -1,5 +1,11 @@ #include #include "platform.h" +#if (GAME == 4) + // These are needed for the game startup code, which needs to be part of + // the same translation unit in this game... + #include "pc98.h" + #include "libs/kaja/kaja.h" +#endif #include "master.hpp" #include "th04/score.h" #if (GAME == 5) @@ -9,7 +15,9 @@ #include "th04/resident.hpp" #endif #include "th04/formats/cfg.hpp" +extern "C" { #include "th04/snd/snd.h" +} #undef CFG_FN extern const char CFG_FN[]; diff --git a/th04/op/m_main.cpp b/th04/op/m_main.cpp index 445c6710..67802bcf 100644 --- a/th04/op/m_main.cpp +++ b/th04/op/m_main.cpp @@ -1,4 +1,3 @@ -#pragma option -zPop_01 #if (GAME == 5) #include "th05/op/start.cpp" #else diff --git a/th04/op/start.cpp b/th04/op/start.cpp index cdbc14f1..cbe19b1f 100644 --- a/th04/op/start.cpp +++ b/th04/op/start.cpp @@ -1,12 +1,7 @@ -#include "platform.h" -#include "pc98.h" -#include "master.hpp" #include "th01/rank.h" #include "th02/formats/pi.h" #include "th04/common.h" #include "th04/playchar.h" -#include "th04/score.h" -#include "th04/resident.hpp" extern "C" { #include "th04/op/op.hpp" } diff --git a/th04/op/start.hpp b/th04/op/start.hpp index 4f8e3334..cd789845 100644 --- a/th04/op/start.hpp +++ b/th04/op/start.hpp @@ -1,12 +1,7 @@ // Startup code shared between TH04 and TH05 #include -#include "libs/kaja/kaja.h" #include "th02/core/initexit.h" -#include "th04/formats/cfg.hpp" -extern "C" { -#include "th04/snd/snd.h" -} extern char aMAIN[]; extern char aDEB[]; diff --git a/th04/op_main.cpp b/th04/op_main.cpp index ee41009c..4e250129 100644 --- a/th04/op_main.cpp +++ b/th04/op_main.cpp @@ -1 +1,3 @@ +#pragma option -zPop_01 +#include "th04/formats/cfg.cpp" #include "th04/op/m_main.cpp" diff --git a/th04_op.asm b/th04_op.asm index 753ac92d..f9cb3633 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -27,7 +27,7 @@ include th04/op/music.inc extern _getch:proc extern _strlen:proc -op_01 group CFG_TEXT, OP_MAIN_TEXT, OP_01_TEXT +op_01 group OP_MAIN_TEXT, OP_01_TEXT g_SHARED group SHARED, SHARED_ ; =========================================================================== @@ -153,13 +153,10 @@ _TEXT ends ; =========================================================================== -CFG_TEXT segment byte public 'CODE' use16 +OP_MAIN_TEXT segment byte public 'CODE' use16 @cfg_load$qv procdesc near @cfg_save$qv procdesc near @cfg_save_exit$qv procdesc near -CFG_TEXT ends - -OP_MAIN_TEXT segment byte public 'CODE' use16 _start_game procdesc near _start_extra procdesc near _start_demo procdesc near diff --git a/th05/op/start.cpp b/th05/op/start.cpp index aab24135..f49a36f7 100644 --- a/th05/op/start.cpp +++ b/th05/op/start.cpp @@ -1,15 +1,19 @@ #include "platform.h" +#include "pc98.h" #include "master.hpp" +#include "libs/kaja/kaja.h" #include "th01/rank.h" #include "th02/core/initexit.h" #include "th04/common.h" #include "th04/score.h" #include "th04/end/end.h" #include "th05/playchar.h" +#include "th05/resident.hpp" +#include "th04/formats/cfg.hpp" extern "C" { +#include "th04/snd/snd.h" #include "th05/op/op.hpp" } -#include "th05/resident.hpp" #include "th05/hardware/input.h" #include "th04/op/start.hpp" diff --git a/th05/op_main.cpp b/th05/op_main.cpp index ee41009c..6610926c 100644 --- a/th05/op_main.cpp +++ b/th05/op_main.cpp @@ -1 +1,2 @@ +#pragma option -zPop_01 #include "th04/op/m_main.cpp"