From 404044f32bbc8615c84ae913b3a954e5dc52d8b5 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Tue, 3 Mar 2015 10:20:20 +0100 Subject: [PATCH] [C decompilation] [th02/op] [th03/op] [th04/op] Frame delay #1 --- Makefile.mak | 12 +++++++++++- th02/hardware/frame_delay_.asm | 5 +++-- th02/hardware/frmdely1.c | 5 +++++ th02/hardware/frmdely2.c | 5 +++++ th02/op_02.c | 8 ++++++++ th02/th02.h | 1 + th02_op.asm | 6 +++--- th03/op_02.c | 8 ++++++++ th03_op.asm | 5 ++--- th04/op_02.c | 8 ++++++++ th04_op.asm | 4 ++-- 11 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 th02/hardware/frmdely1.c create mode 100644 th02/hardware/frmdely2.c create mode 100644 th02/op_02.c create mode 100644 th03/op_02.c create mode 100644 th04/op_02.c diff --git a/Makefile.mak b/Makefile.mak index c58e8e06..f7d27575 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -39,7 +39,7 @@ bin\th01\fuuin.exe: bin\th01\fuuin.obj th01\fuuin_11.c th01\fuuin_13.c $** | -bin\th02\op.exe: bin\th02\op.obj th02\op_03.c th02\op_04.c th02\op_05.c th02\op_06.c +bin\th02\op.exe: bin\th02\op.obj th02\op_02.c th02\op_03.c th02\op_04.c th02\op_05.c th02\op_06.c $(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eOP.EXE @&&| $** | @@ -48,3 +48,13 @@ bin\th02\maine.exe: bin\th02\maine.obj th02\maine_03.c th02\maine_04.c th02\main $(CC) $(CFLAGS) -ml -3 -Z -DGAME=2 -nbin\th02\ -eMAINE.EXE @&&| $** | + +bin\th03\op.exe: bin\th03\op.obj th03\op_02.c + $(CC) $(CFLAGS) -ml -DGAME=3 -nbin\th03\ -eOP.EXE @&&| +$** +| + +bin\th04\op.exe: bin\th04\op.obj th04\op_02.c + $(CC) $(CFLAGS) -ml -DGAME=4 -nbin\th04\ -eOP.EXE @&&| +$** +| diff --git a/th02/hardware/frame_delay_.asm b/th02/hardware/frame_delay_.asm index 271aba7b..7d5f0da1 100644 --- a/th02/hardware/frame_delay_.asm +++ b/th02/hardware/frame_delay_.asm @@ -1,3 +1,4 @@ -frame_delay_ proc +public FRAME_DELAY_2 +frame_delay_2 proc frame_delay_macro -frame_delay_ endp +frame_delay_2 endp diff --git a/th02/hardware/frmdely1.c b/th02/hardware/frmdely1.c new file mode 100644 index 00000000..dfc484c8 --- /dev/null +++ b/th02/hardware/frmdely1.c @@ -0,0 +1,5 @@ +void pascal frame_delay(int frames) +{ + vsync_reset1(); + while(vsync_Count1 < frames) {} +} diff --git a/th02/hardware/frmdely2.c b/th02/hardware/frmdely2.c new file mode 100644 index 00000000..aff0b23f --- /dev/null +++ b/th02/hardware/frmdely2.c @@ -0,0 +1,5 @@ +void pascal frame_delay_2(int frames) +{ + vsync_reset1(); + while(vsync_Count1 < frames) {} +} diff --git a/th02/op_02.c b/th02/op_02.c new file mode 100644 index 00000000..3df7ab70 --- /dev/null +++ b/th02/op_02.c @@ -0,0 +1,8 @@ +/* ReC98 + * ----- + * Code segment #2 of TH02's OP.EXE + */ + +#include "th02/th02.h" + +#include "th02/hardware/frmdely1.c" diff --git a/th02/th02.h b/th02/th02.h index 8ee4b4a1..e1cb6bfc 100644 --- a/th02/th02.h +++ b/th02/th02.h @@ -115,6 +115,7 @@ extern input_t input; void input_sense(void); void pascal frame_delay(int frames); +void pascal frame_delay_2(int frames); // Sound #include "libs\kaja\kaja.h" diff --git a/th02_op.asm b/th02_op.asm index 3bb62a11..9eabecdf 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -2347,14 +2347,14 @@ include th02/hardware/snd_kaja_func.asm cmp _snd_active, 0 jnz short loc_B232 push 64h ; 'd' - nopcall frame_delay_ + nopcall frame_delay_2 pop bp retf ; --------------------------------------------------------------------------- loc_B232: push 1 - nopcall frame_delay_ + nopcall frame_delay_2 mov ah, KAJA_GET_SONG_MEASURE cmp _snd_midi_active, 1 jz short loc_B246 @@ -2377,7 +2377,7 @@ loc_B24B: ; --------------------------------------------------------------------------- include th02/hardware/snd_se.asm -include th02/hardware/frame_delay.asm + extern FRAME_DELAY:proc op_02_TEXT ends ; =========================================================================== diff --git a/th03/op_02.c b/th03/op_02.c new file mode 100644 index 00000000..d0c60dde --- /dev/null +++ b/th03/op_02.c @@ -0,0 +1,8 @@ +/* ReC98 + * ----- + * Code segment #2 of TH02's OP.EXE + */ + +#include + +#include "th02/hardware/frmdely2.c" diff --git a/th03_op.asm b/th03_op.asm index 553e6f45..2056ea1a 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -2166,7 +2166,7 @@ sub_A899 proc near mov dx, 0A6h ; '¦' out dx, al push 1 - call frame_delay_ + call frame_delay_2 pop bp retn sub_A899 endp @@ -6245,8 +6245,7 @@ loc_CB7D: retf sub_CB68 endp -include th02/hardware/frame_delay_.asm - db 0 + extern FRAME_DELAY_2:proc op_02_TEXT ends .data diff --git a/th04/op_02.c b/th04/op_02.c new file mode 100644 index 00000000..d0c60dde --- /dev/null +++ b/th04/op_02.c @@ -0,0 +1,8 @@ +/* ReC98 + * ----- + * Code segment #2 of TH02's OP.EXE + */ + +#include + +#include "th02/hardware/frmdely2.c" diff --git a/th04_op.asm b/th04_op.asm index d33e8b1c..de16c4e5 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -3438,7 +3438,7 @@ sub_C244 proc near mov dx, 0A6h ; '¦' out dx, al push 1 - call frame_delay_ + call frame_delay_2 pop bp retn sub_C244 endp @@ -7492,7 +7492,7 @@ loc_E6D4: retf sub_E6D0 endp -include th02/hardware/frame_delay_.asm + extern FRAME_DELAY_2:proc op_02_TEXT ends