[Separate translation units] [th02] key_delay()

Part of P0138, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2021-04-15 15:51:09 +02:00
parent aea5a20de9
commit 78b958f111
5 changed files with 32 additions and 38 deletions

View File

@ -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 @&&|
$**
|

View File

@ -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()) {}
}
}

1
th02/keydelay.cpp Normal file
View File

@ -0,0 +1 @@
#include "th02/hardware/keydelay.cpp"

View File

@ -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;

View File

@ -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"
}