Skip to content

Commit

Permalink
[Decompilation] [th04/th05] snd_mmd_resident()
Browse files Browse the repository at this point in the history
Part of P0139, funded by [Anonymous].
  • Loading branch information
nmlgc committed May 11, 2021
1 parent 4c8a3cb commit 4c0e76a
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 42 deletions.
12 changes: 6 additions & 6 deletions Makefile.mak
Expand Up @@ -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 @&&|
$**
|
Expand All @@ -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 @&&|
$**
|
Expand Down
28 changes: 0 additions & 28 deletions th02/snd/mmd_res.asm

This file was deleted.

8 changes: 6 additions & 2 deletions th02/snd/mmd_res.c
Expand Up @@ -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"
1 change: 1 addition & 0 deletions th04/snd_mmdr.c
@@ -0,0 +1 @@
#include "th02/snd/mmd_res.c"
2 changes: 1 addition & 1 deletion th04_main.asm
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion th04_maine.asm
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion th04_op.asm
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion th05_main.asm
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion th05_maine.asm
Expand Up @@ -7517,14 +7517,14 @@ 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
assume cs:g_SHARED
;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
Expand Down
2 changes: 1 addition & 1 deletion th05_op.asm
Expand Up @@ -2516,14 +2516,14 @@ 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
assume cs:g_SHARED
; 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
Expand Down

0 comments on commit 4c0e76a

Please sign in to comment.