diff --git a/Makefile.mak b/Makefile.mak index a7f317de..28642333 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -133,17 +133,17 @@ bin\th04\res_huma.com: th04\res_huma.cpp $** | masters.lib -bin\th04\op.exe: bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.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: bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th03\pi_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.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 @&&| $** | -bin\th04\main.exe: bin\th04\main.obj bin\th04\scoreupd.obj th04\main011.cpp bin\th01\vplanset.obj bin\th03\vector2.obj bin\frmdely1.obj bin\hfliplut.obj th04\mpn_free.cpp bin\th04\input_w.obj th04\mpn_l_i.cpp bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\cdg_p_na.obj bin\th04\cdg_p_pr.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\cdg_load.obj th04\main032.cpp +bin\th04\main.exe: bin\th04\main.obj bin\th04\scoreupd.obj th04\main011.cpp bin\th01\vplanset.obj bin\th03\vector2.obj bin\frmdely1.obj bin\hfliplut.obj th04\mpn_free.cpp bin\th04\input_w.obj th04\mpn_l_i.cpp bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\cdg_p_na.obj bin\th04\cdg_p_pr.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\cdg_load.obj th04\main032.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='M' -3 -Z -nbin\th04\ -eMAIN.EXE @&&| $** | -bin\th04\maine.exe: bin\th04\maine.obj th04\maine011.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th04\cdg_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj +bin\th04\maine.exe: bin\th04\maine.obj th04\maine011.cpp bin\th01\vplanset.obj bin\frmdely1.obj bin\th03\pi_put.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\bgimager.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th04\cdg_load.obj bin\hfliplut.obj bin\th04\input_w.obj bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='E' -Z -nbin\th04\ -eMAINE.EXE @&&| $** | @@ -156,17 +156,17 @@ bin\th05\res_kso.com: th05\res_kso.cpp $** | masters.lib -bin\th05\op.exe: th05\op010.cpp bin\th05\op.obj th05\op011.cpp th05\m_char.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\musicp_c.obj bin\th05\musicp_a.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initop.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj th05\cdg_p_nc.cpp bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj +bin\th05\op.exe: th05\op010.cpp bin\th05\op.obj th05\op011.cpp th05\m_char.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\musicp_c.obj bin\th05\musicp_a.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initop.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj th05\cdg_p_nc.cpp bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=5 -DBINARY='O' -3 -Z -nbin\th05\ -eOP.EXE @&&| $** | -bin\th05\main.exe: bin\th05\main.obj th05\main010.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main012.cpp th05\main013.cpp bin\th03\vector2.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj bin\th05\bullet.obj bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj th05\main031.cpp th05\main032.cpp th05\main033.cpp th05\main034.cpp +bin\th05\main.exe: bin\th05\main.obj th05\main010.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main012.cpp th05\main013.cpp bin\th03\vector2.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th05\bullet.obj bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj th05\main031.cpp th05\main032.cpp th05\main033.cpp th05\main034.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=5 -DBINARY='M' -nbin\th05\ -eMAIN.EXE @&&| $** | -bin\th05\maine.exe: bin\th05\maine.obj th05\maine011.cpp th05\regist.cpp th05\staff.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj +bin\th05\maine.exe: bin\th05\maine.obj th05\maine011.cpp th05\regist.cpp th05\staff.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\bgimage.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\bgimager.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\pi_cpp_1.obj bin\th05\pi_asm_1.obj bin\th05\pi_cpp_2.obj bin\th05\pi_asm_2.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\snd_dlym.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th05\egcrect.obj bin\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=5 -DBINARY='E' -Z -nbin\th05\ -eMAINE.EXE @&&| $** | diff --git a/th02/snd/mmd_res.asm b/th02/snd/mmd_res.asm deleted file mode 100644 index 1188fdaf..00000000 --- a/th02/snd/mmd_res.asm +++ /dev/null @@ -1,28 +0,0 @@ -public _snd_mmd_resident -_snd_mmd_resident proc - xor ax, ax - mov es, ax - les bx, dword ptr es:[MMD * 4] - assume es:nothing - cmp byte ptr es:[bx+2], 'M' - jnz short @@nope - cmp byte ptr es:[bx+3], 'M' - jnz short @@nope - cmp byte ptr es:[bx+4], 'D' - jnz short @@nope - mov _snd_interrupt_if_midi, MMD -if GAME le 3 - mov _snd_midi_active, 1 -endif - mov _snd_midi_possible, 1 - mov ax, 1 - ret - -@@nope: -if GAME le 3 - mov _snd_midi_possible, 0 -endif - xor ax, ax - ret -_snd_mmd_resident endp - even diff --git a/th02/snd/mmd_res.c b/th02/snd/mmd_res.c index adfe1af6..d1a40d41 100644 --- a/th02/snd/mmd_res.c +++ b/th02/snd/mmd_res.c @@ -11,14 +11,18 @@ bool16 snd_mmd_resident(void) __asm { les bx, dword ptr es:[MMD * 4]; } if(kaja_isr_magic_matches(MK_FP(_ES, _BX), 'M', 'M', 'D')) { snd_interrupt_if_midi = MMD; - snd_midi_active = true; + #if (GAME <= 3) + snd_midi_active = true; + #endif snd_midi_possible = true; // Enforced by the -WX code generation. Just replace these two lines // with `return true`. _AX = true; __asm retf; } - snd_midi_possible = false; + #if (GAME <= 3) + snd_midi_possible = false; + #endif return false; } #pragma codestring "\x90" diff --git a/th04/snd_mmdr.c b/th04/snd_mmdr.c new file mode 100644 index 00000000..fc04432e --- /dev/null +++ b/th04/snd_mmdr.c @@ -0,0 +1 @@ +#include "th02/snd/mmd_res.c" diff --git a/th04_main.asm b/th04_main.asm index 15ab9fae..0f369133 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -12979,10 +12979,10 @@ SHARED segment word public 'CODE' use16 extern VECTOR1_AT:proc extern VECTOR2_AT:proc extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 -include th02/snd/mmd_res.asm include th04/snd/kajaint.asm include th04/snd/detmodes.asm include th04/snd/load.asm diff --git a/th04_maine.asm b/th04_maine.asm index 14f762e8..7604a532 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -4589,13 +4589,13 @@ SHARED segment word public 'CODE' use16 extern INPUT_WAIT_FOR_CHANGE:proc extern VECTOR1_AT:proc extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 assume cs:g_SHARED assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing -include th02/snd/mmd_res.asm include th04/snd/kajaint.asm include th04/snd/detmodes.asm include th03/snd/delaymea.asm diff --git a/th04_op.asm b/th04_op.asm index aedeb7c5..625d040b 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -2640,13 +2640,13 @@ SHARED segment word public 'CODE' use16 extern INPUT_WAIT_FOR_CHANGE:proc extern VECTOR1_AT:proc extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 assume cs:g_SHARED assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing -include th02/snd/mmd_res.asm include th04/snd/kajaint.asm include th04/formats/cdg_put_nocolors.asm include th04/snd/detmodes.asm diff --git a/th05_main.asm b/th05_main.asm index 7baf6ded..996f0bd5 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -10544,10 +10544,10 @@ SHARED segment word public 'CODE' use16 extern VECTOR2:proc extern VECTOR2_BETWEEN_PLUS:proc extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 -include th02/snd/mmd_res.asm include th04/snd/detmodes.asm extern CDG_PUT_NOALPHA_8:proc extern SND_SE_PLAY:proc diff --git a/th05_maine.asm b/th05_maine.asm index 6475e79a..7f86cdfc 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -7517,6 +7517,7 @@ maine_01___TEXT ends ; Segment type: Pure code SHARED segment word public 'CODE' use16 extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 @@ -7524,7 +7525,6 @@ SHARED_ segment word public 'CODE' use16 ;org 0Ch assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing -include th02/snd/mmd_res.asm include th04/snd/detmodes.asm include th04/hardware/grppsafx.asm extern CDG_PUT_NOALPHA_8:proc diff --git a/th05_op.asm b/th05_op.asm index d064a512..01e352d6 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -2516,6 +2516,7 @@ op_01_TEXT ends ; Segment type: Pure code SHARED segment word public 'CODE' use16 extern _snd_pmd_resident:proc + extern _snd_mmd_resident:proc SHARED ends SHARED_ segment word public 'CODE' use16 @@ -2523,7 +2524,6 @@ SHARED_ segment word public 'CODE' use16 ; org 4 assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing -include th02/snd/mmd_res.asm include th04/snd/detmodes.asm include th02/exit_dos.asm db 0