From 52fdb33d1d31662ba171579f328780c31778280d Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sat, 19 Dec 2020 19:52:56 +0100 Subject: [PATCH] [Separate translation units] [th02] frame_delay() Part of P0132, funded by [Anonymous]. --- Makefile.mak | 9 +++-- th02/frmdely1.c | 2 + th02/hardware/frmdely1.c | 6 ++- th02/main02_1.cpp | 2 - th02/maine021.cpp | 1 - th02/op_02_2.c | 1 - th02_main.asm | 63 ++++++++++-------------------- th02_maine.asm | 84 ++++++++++++++-------------------------- 8 files changed, 62 insertions(+), 106 deletions(-) create mode 100644 th02/frmdely1.c diff --git a/Makefile.mak b/Makefile.mak index 308b2a79..3dbe1d93 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -39,6 +39,9 @@ bin\th01\zunsoft.com: th01\zunsoft.c bin\exit_dos.obj: th02\exit_dos.c $(CC) $(CFLAGS) -ml -n$(@D) -c $** +bin\frmdely1.obj: th02\frmdely1.c + $(CC) $(CFLAGS) -ml -n$(@D) -c $** + bin\frmdely2.obj: th02\frmdely2.c $(CC) $(CFLAGS) -ml -n$(@D) -c $** # ------------------------------ @@ -73,17 +76,17 @@ bin\th02\zun_res.com: th02\zun_res1.c th02\zun_res2.c th02\zun_res3.c $** | masters.lib -bin\th02\op.exe: th02\op_01.c bin\exit_dos.obj bin\th02\zunerror.obj bin\th02\grppsafx.obj bin\th02\op.obj th02\op_02_1.cpp bin\frmdely2.obj th02\op_02_2.c th02\op_03.c th02\op_04.c th02\op_05.cpp th02\op_06.cpp +bin\th02\op.exe: th02\op_01.c bin\exit_dos.obj bin\th02\zunerror.obj bin\th02\grppsafx.obj bin\th02\op.obj th02\op_02_1.cpp bin\frmdely2.obj th02\op_02_2.c bin\frmdely1.obj th02\op_03.c th02\op_04.c th02\op_05.cpp th02\op_06.cpp $(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eOP.EXE @&&| $** | -bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj th02\main02_1.cpp th02\main02_2.c th02\main_03.cpp +bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj th02\main02_1.cpp bin\frmdely1.obj th02\main02_2.c th02\main_03.cpp $(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eMAIN.EXE @&&| $** | -bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj th02\maine021.cpp th02\maine022.c th02\maine_03.c th02\maine_04.c th02\maine_05.cpp +bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj th02\maine021.cpp bin\frmdely1.obj th02\maine022.c th02\maine_03.c th02\maine_04.c th02\maine_05.cpp $(CC) $(CFLAGS) -ml -3 -Z -DGAME=2 -nbin\th02\ -eMAINE.EXE @&&| $** | diff --git a/th02/frmdely1.c b/th02/frmdely1.c new file mode 100644 index 00000000..263bbe18 --- /dev/null +++ b/th02/frmdely1.c @@ -0,0 +1,2 @@ +#include "th02/hardware/frmdely1.c" +#pragma codestring "\x00" diff --git a/th02/hardware/frmdely1.c b/th02/hardware/frmdely1.c index e088e358..3a5adcde 100644 --- a/th02/hardware/frmdely1.c +++ b/th02/hardware/frmdely1.c @@ -1,6 +1,10 @@ +#pragma codeseg SHARED + +#include "libs/master.lib/master.h" +#include "th02/hardware/frmdelay.h" + void pascal frame_delay(int frames) { vsync_reset1(); while(vsync_Count1 < frames) {} } -#pragma codestring "\x00" diff --git a/th02/main02_1.cpp b/th02/main02_1.cpp index 36d4757e..697c759c 100644 --- a/th02/main02_1.cpp +++ b/th02/main02_1.cpp @@ -36,6 +36,4 @@ void pascal mptn_free(void) #include "th01/hardware/vplanset.c" #include "th02/formats/pi_load.c" #include "th02/math/vector.cpp" -#include "th02/hardware/frmdely1.c" - } diff --git a/th02/maine021.cpp b/th02/maine021.cpp index b7936036..6443f203 100644 --- a/th02/maine021.cpp +++ b/th02/maine021.cpp @@ -13,5 +13,4 @@ extern "C" { #include "th02/hardware/keydelay.c" #include "th01/hardware/vplanset.c" #include "th02/formats/pi_load.c" -#include "th02/hardware/frmdely1.c" } diff --git a/th02/op_02_2.c b/th02/op_02_2.c index 3620ca69..f591d555 100644 --- a/th02/op_02_2.c +++ b/th02/op_02_2.c @@ -32,4 +32,3 @@ const char pf_fn[] = PF_FN; #include "th02/snd/kajaint.c" #include "th02/snd/delaymea.c" #include "th02/snd/se.c" -#include "th02/hardware/frmdely1.c" diff --git a/th02_main.asm b/th02_main.asm index 30610edd..c07732cf 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -2671,8 +2671,7 @@ loc_BCA0: mov [bp+var_1], 2 loc_BCA4: - push 1 - call frame_delay + call frame_delay pascal, 1 jmp loc_BA1D ; --------------------------------------------------------------------------- @@ -3367,15 +3366,13 @@ loc_C348: call text_putsa pascal, ax, 12, ds, offset asc_1E47E, TX_WHITE lea ax, [si+6] call gaiji_putsa pascal, ax, 12, ds, offset gGAMEOVER, TX_WHITE - push 1 - call frame_delay + call frame_delay pascal, 1 dec si loc_C3E5: cmp si, 0Ch jge loc_C348 - push 1Eh - call frame_delay + call frame_delay pascal, 30 mov _key_det, 0 jmp short loc_C400 ; --------------------------------------------------------------------------- @@ -3449,8 +3446,7 @@ loc_C4CA: jnz short loc_C4EE loc_C4E5: - push 1 - call frame_delay + call frame_delay pascal, 1 jmp short loc_C47A ; --------------------------------------------------------------------------- @@ -7099,8 +7095,7 @@ loc_E140: loc_E147: cmp si, 18h jl short loc_E103 - push 2 - call frame_delay + call frame_delay pascal, 2 inc [bp+var_4] loc_E156: @@ -15538,8 +15533,7 @@ loc_12E4F: sub [bp+var_4], 10h mov ax, [bp+var_4] mov [bp+var_2], ax - push 1 - call frame_delay + call frame_delay pascal, 1 call egc_start_copy_2 push 200140h push 1800050h @@ -15597,8 +15591,7 @@ loc_12EC5: sub [bp+var_4], 10h mov ax, [bp+var_4] mov [bp+var_2], ax - push 1 - call frame_delay + call frame_delay pascal, 1 call egc_start_copy_2 push 200140h push 1800050h @@ -15849,8 +15842,7 @@ loc_130CF: loc_130DE: mov [bp+var_2], 3 - push 1 - call frame_delay + call frame_delay pascal, 1 loc_130EA: mov ax, di @@ -16387,27 +16379,21 @@ sub_13439 proc near push 69h ; 'i' call sub_13055 call sub_13414 - push 0Ah - call frame_delay + call frame_delay pascal, 10 push 69h ; 'i' call sub_13055 - push 1Eh - call frame_delay + call frame_delay pascal, 30 call sub_13414 - push 14h - call frame_delay + call frame_delay pascal, 20 push 69h ; 'i' call sub_13055 - push 14h - call frame_delay + call frame_delay pascal, 20 push 69h ; 'i' call sub_13055 call sub_13414 - push 14h - call frame_delay + call frame_delay pascal, 20 call sub_13414 - push 14h - call frame_delay + call frame_delay pascal, 20 call sub_13414 push 3 call palette_white_out @@ -27769,8 +27755,7 @@ mima_init proc far call super_entry_bfnt pascal, ds, offset aMima_bft ; "mima.bft" call sub_13328 mov vsync_Count1, 0 - push 0Ah - call frame_delay + call frame_delay pascal, 10 call sub_1A529 call super_clean pascal, (128 shl 16) or 192 mov super_patnum, 80h @@ -28026,8 +28011,7 @@ sub_19C8D proc near pop cx push 0Ah call palette_white_out - push 32h ; '2' - call frame_delay + call frame_delay pascal, 50 add _score, 50000 call sub_19C1D mov ax, 1 @@ -28962,8 +28946,7 @@ loc_1A54E: imul dx, 7 push dx call grcg_circle - push 1 - call frame_delay + call frame_delay pascal, 1 call grcg_setcolor pascal, (GC_RMW shl 16) + 0 call grcg_circlefill pascal, (224 shl 16) or 144, si push (224 shl 16) or 144 @@ -29041,8 +29024,7 @@ loc_1A697: sub dx, ax mov PaletteTone, dx call far ptr palette_show - push 3 - call frame_delay + call frame_delay pascal, 3 inc si loc_1A6B2: @@ -29076,8 +29058,7 @@ sub_1A6C5 proc near graph_accesspage 1 call graph_clear mov vsync_Count1, 0 - push 1 - call frame_delay + call frame_delay pascal, 1 call graph_scrollup pascal, 0 graph_accesspage _page_front call super_roll_put pascal, point_205F6.x, point_205F6.y, 0 @@ -29161,8 +29142,7 @@ marisa_init proc far call super_entry_bfnt pascal, ds, offset aMima_bft_0 ; "mima.bft" call sub_1315B mov vsync_Count1, 0 - push 0Ah - call frame_delay + call frame_delay pascal, 10 call sub_1A529 push 0 call sub_1310B @@ -33399,8 +33379,7 @@ loc_1CCF7: jnz short loc_1CD2E loc_1CCFE: - push 1 - call frame_delay + call frame_delay pascal, 1 mov ax, _key_det mov [bp+var_A], ax cmp [bp+var_A], 0 diff --git a/th02_maine.asm b/th02_maine.asm index f1d4325a..60a4adce 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -479,8 +479,7 @@ loc_9810: loc_9830: cmp si, [bp+arg_4] jl short loc_9810 - push 0Ah - call frame_delay + call frame_delay pascal, 10 inc di loc_983D: @@ -901,8 +900,7 @@ sub_9AD4 proc near push ds push offset aEnd3_txt ; "end3.txt" call sub_95A3 - push 1Eh - call frame_delay + call frame_delay pascal, 30 push 1 call palette_white_out call _snd_load c, offset aEnding_m, ds, SND_LOAD_SONG @@ -934,8 +932,7 @@ loc_9B1B: push 299 call grcg_boxfill call grcg_off - push 1 - call frame_delay + call frame_delay pascal, 1 sub si, 4 loc_9B5C: @@ -971,8 +968,7 @@ sub_9B64 proc near freePISlotLarge 0 push 2 call palette_black_in - push 28h ; '(' - call frame_delay + call frame_delay pascal, 40 push 0 call sub_98B5 mov col_and_fx_F02A, (15 or FX_WEIGHT_BOLD) @@ -983,8 +979,7 @@ sub_9B64 proc near push offset end_buf push 6 call sub_9643 - push 14h - call frame_delay + call frame_delay pascal, 20 push 1 call palette_black_out push 1 @@ -1072,8 +1067,7 @@ loc_9C91: push offset end_buf + (END_LINE_LEN * 11) push 6 call sub_9643 - push 14h - call frame_delay + call frame_delay pascal, 20 push 90014Ch push 2Ch ; ',' push ds @@ -1095,8 +1089,7 @@ loc_9CDE: push dx push 2 call sub_99E4 - push 1 - call frame_delay + call frame_delay pascal, 1 inc si loc_9D10: @@ -1492,8 +1485,7 @@ sub_A09D proc near freePISlotLarge 0 push 2 call palette_black_in - push 28h ; '(' - call frame_delay + call frame_delay pascal, 40 push 0 call sub_98B5 mov col_and_fx_F02A, (15 or FX_WEIGHT_BOLD) @@ -1504,8 +1496,7 @@ sub_A09D proc near push offset end_buf push 6 call sub_9643 - push 14h - call frame_delay + call frame_delay pascal, 20 push 1 call palette_black_out graph_accesspage 1 @@ -1734,8 +1725,7 @@ loc_A353: push offset end_buf + (END_LINE_LEN * 26) push 6 call sub_9643 - push 0Ah - call frame_delay + call frame_delay pascal, 10 les bx, _resident cmp es:[bx+mikoconfig_t.shottype], 0 jnz loc_A4EC @@ -1745,8 +1735,7 @@ loc_A353: push offset end_buf + (END_LINE_LEN * 27) push 6 call sub_9643 - push 1Eh - call frame_delay + call frame_delay pascal, 30 push 2 call sub_98B5 mov col_and_fx_F02A, (15 or FX_WEIGHT_BOLD) @@ -1900,8 +1889,7 @@ loc_A4EC: push offset end_buf + (END_LINE_LEN * 51) push 6 call sub_9643 - push 1Eh - call frame_delay + call frame_delay pascal, 30 push 2 call sub_98B5 mov col_and_fx_F02A, (15 or FX_WEIGHT_BOLD) @@ -2053,8 +2041,7 @@ loc_A6B6: push offset end_buf + (END_LINE_LEN * 73) push 6 call sub_9643 - push 1Eh - call frame_delay + call frame_delay pascal, 30 push 2 call sub_98B5 mov col_and_fx_F02A, (15 or FX_WEIGHT_BOLD) @@ -2255,8 +2242,7 @@ arg_4 = word ptr 8 push 200064h push [bp+arg_2] call sub_9942 - push 4 - call frame_delay + call frame_delay pascal, 4 mov PaletteTone, 100 call far ptr palette_show pop bp @@ -2286,8 +2272,7 @@ loc_A90C: push 1B000B8h push si call sub_A874 - push 4 - call frame_delay + call frame_delay pascal, 4 add si, 5 loc_A920: @@ -2323,8 +2308,7 @@ loc_A947: push 528 call _graph_putsa_fx add sp, 0Ah - push 1 - call frame_delay + call frame_delay pascal, 1 add si, 4 loc_A992: @@ -2502,8 +2486,7 @@ loc_A992: call graph_copy_page pascal, 0 push 4 call palette_black_in - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 graph_accesspage 1 push ds push offset aVsvivbvovlb@vs @@ -2517,8 +2500,7 @@ loc_A992: push 18h call sub_97F1 add sp, 6 - push 0C8h ; 'ネ' - call frame_delay + call frame_delay pascal, 200 graph_accesspage 1 push ds push offset aB@nPiuU_ ; " 最終得点" @@ -2535,8 +2517,7 @@ loc_A992: push 40h call sub_97F1 add sp, 6 - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 graph_accesspage 1 push ds push offset aGrgugegbgjgeb ; "コンティニュー" @@ -2557,8 +2538,7 @@ loc_A992: push 40h call sub_97F1 add sp, 6 - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 graph_accesspage 1 push ds push offset aB@Gigugn ; "  ランク" @@ -2582,8 +2562,7 @@ loc_A992: push 40h call sub_97F1 add sp, 6 - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 graph_accesspage 1 push ds push offset aGvgmgcgdbPik ; "プレイヤー初期" @@ -2605,8 +2584,7 @@ loc_A992: push 40h call sub_97F1 add sp, 6 - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 graph_accesspage 1 push ds push offset aCMvpik ; " 霊撃初期数" @@ -2628,8 +2606,7 @@ loc_A992: push 40h call sub_97F1 add sp, 6 - push 96h - call frame_delay + call frame_delay pascal, 150 graph_accesspage 1 les bx, _resident mov di, es:[bx+mikoconfig_t.skill] @@ -2760,14 +2737,12 @@ loc_AF56: push 40h call sub_97F1 add sp, 6 - push 78h ; 'x' - call frame_delay + call frame_delay pascal, 120 push 180120h push 0C0h call sub_97F1 add sp, 6 - push 0C8h ; 'ネ' - call frame_delay + call frame_delay pascal, 200 graph_accesspage 1 push ds push offset aVpvxvxvvb@vyvt ; "1997 ZUN (Amusement Makers)" @@ -2813,8 +2788,7 @@ sub_AFE7 proc far freePISlotLarge 0 push 2 call palette_black_in - push 96h - call frame_delay + call frame_delay pascal, 150 call _pi_load c, 0, offset aBut_pi, ds call _pi_palette_apply stdcall, 0 pop cx @@ -2849,8 +2823,7 @@ sub_B07F proc far freePISlotLarge 0 push 2 call palette_black_in - push 96h - call frame_delay + call frame_delay pascal, 150 call _pi_load c, 0, offset aExtra_pi, ds call _pi_palette_apply stdcall, 0 pop cx @@ -2923,8 +2896,7 @@ loc_B189: mov dx, 164 ; Port 00A4h: Page display register out dx, al call super_entry_bfnt pascal, ds, offset aEndft_bft ; "endft.bft" - push 64h ; 'd' - call frame_delay + call frame_delay pascal, 100 les bx, _resident cmp es:[bx+mikoconfig_t.rank], 4 jz short loc_B1C2