diff --git a/Makefile.mak b/Makefile.mak index 3ed3b9c2..3a5f7dd2 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -85,12 +85,12 @@ bin\th02\op.exe: th02\op_01.cpp bin\exit_dos.obj bin\th02\zunerror.obj bin\th02\ $** | -bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj th02\main02_1.cpp bin\th01\vplanset.obj bin\th02\pi_load.obj bin\th02\vector2.obj bin\frmdely1.obj bin\th02\input_s.obj bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj th02\mptn_i.cpp bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj bin\th02\snd_se_r.obj bin\th02\snd_se.obj th02\main_03.cpp +bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj bin\th02\keydelay.obj th02\main02_1.cpp bin\th01\vplanset.obj bin\th02\pi_load.obj bin\th02\vector2.obj bin\frmdely1.obj bin\th02\input_s.obj bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj th02\mptn_i.cpp bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj bin\th02\snd_se_r.obj bin\th02\snd_se.obj th02\main_03.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -Z -DGAME=2 -nbin\th02\ -eMAIN.EXE @&&| $** | -bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj th02\maine021.cpp bin\th01\vplanset.obj bin\th02\pi_load.obj bin\frmdely1.obj th02\maine022.cpp bin\th02\input_s.obj bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj th02\maine_03.c th02\maine_04.cpp th02\maine_05.cpp +bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj bin\th02\keydelay.obj bin\th01\vplanset.obj bin\th02\pi_load.obj bin\frmdely1.obj th02\maine022.cpp bin\th02\input_s.obj bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj th02\maine_03.c th02\maine_04.cpp th02\maine_05.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=2 -nbin\th02\ -eMAINE.EXE @&&| $** | diff --git a/th02/hardware/keydelay.c b/th02/hardware/keydelay.cpp similarity index 73% rename from th02/hardware/keydelay.c rename to th02/hardware/keydelay.cpp index e6a3af82..782672c7 100644 --- a/th02/hardware/keydelay.c +++ b/th02/hardware/keydelay.cpp @@ -1,19 +1,29 @@ -int key_delay_sense(void) -{ - extern char key_delay_groups[3]; - int ret; - ret = key_sense(key_delay_groups[0]); - ret |= key_sense(key_delay_groups[1]); - ret |= key_sense(key_delay_groups[2]); - frame_delay(2); - ret |= key_sense(key_delay_groups[0]); - ret |= key_sense(key_delay_groups[1]); - ret |= key_sense(key_delay_groups[2]); - return ret; -} - -void key_delay(void) -{ - while(key_delay_sense()) {} - while(!key_delay_sense()) {} -} +#pragma option -zCSHARED + +extern "C" { +#include "platform.h" +#include "master.hpp" +#include "th02/hardware/input.hpp" +#include "th02/hardware/frmdelay.h" + +int key_delay_sense(void) +{ + extern char key_delay_groups[3]; + int ret; + ret = key_sense(key_delay_groups[0]); + ret |= key_sense(key_delay_groups[1]); + ret |= key_sense(key_delay_groups[2]); + frame_delay(2); + ret |= key_sense(key_delay_groups[0]); + ret |= key_sense(key_delay_groups[1]); + ret |= key_sense(key_delay_groups[2]); + return ret; +} + +void key_delay(void) +{ + while(key_delay_sense()) {} + while(!key_delay_sense()) {} +} + +} diff --git a/th02/keydelay.cpp b/th02/keydelay.cpp new file mode 100644 index 00000000..f6b4a66c --- /dev/null +++ b/th02/keydelay.cpp @@ -0,0 +1 @@ +#include "th02/hardware/keydelay.cpp" diff --git a/th02/main02_1.cpp b/th02/main02_1.cpp index c342eeca..fdef7ff4 100644 --- a/th02/main02_1.cpp +++ b/th02/main02_1.cpp @@ -9,13 +9,9 @@ extern "C" { #include "platform.h" #include "x86real.h" #include "pc98.h" -#include "planar.h" #include "master.hpp" -#include "th02/hardware/frmdelay.h" #include "th02/formats/mptn.hpp" -#include "th02/hardware/keydelay.c" - int pascal mptn_load(const char *fn) { extern bool mptn_show_palette_on_load; diff --git a/th02/maine021.cpp b/th02/maine021.cpp deleted file mode 100644 index 4efb20d9..00000000 --- a/th02/maine021.cpp +++ /dev/null @@ -1,13 +0,0 @@ -/* ReC98 - * ----- - * 1st part of code segment #2 of TH02's MAINE.EXE - */ - -#pragma option -zCSHARED - -extern "C" { -#include "master.hpp" -#include "th02/hardware/frmdelay.h" - -#include "th02/hardware/keydelay.c" -}