From 9d2cce16a267b14e8bff8beb2d31bfdb482ea8cc Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sat, 10 Apr 2021 17:56:06 +0200 Subject: [PATCH] [Translation unit catch-up] [th03] snd_determine_mode() Wow, it's -WX, and no workaround necessary! Part of P0138, funded by [Anonymous] and Blue Bolt. --- Makefile.mak | 6 +++--- th02/snd/detmode.asm | 20 -------------------- th02/snd/detmode.c | 3 +-- th03_main.asm | 3 +-- th03_mainl.asm | 3 +-- th03_op.asm | 2 +- 6 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 th02/snd/detmode.asm diff --git a/Makefile.mak b/Makefile.mak index 1f4708ef..bc795f2f 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -105,17 +105,17 @@ bin\th03\res_yume.com: th03\res_yume.cpp $** | masters.lib -bin\th03\op.exe: th03\op_01.cpp bin\th03\op.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th03\exit.obj bin\th03\vector1.obj bin\th03\cdg_put.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th03\pi_put.obj bin\th03\snd_kaja.obj bin\th03\initop.obj bin\th03\cdg_load.obj bin\th03\grppsafx.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj bin\frmdely2.obj +bin\th03\op.exe: th03\op_01.cpp bin\th03\op.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th03\exit.obj bin\th03\vector1.obj bin\th03\cdg_put.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th03\pi_put.obj bin\th03\snd_kaja.obj bin\th03\initop.obj bin\th03\cdg_load.obj bin\th03\grppsafx.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj bin\frmdely2.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=3 -nbin\th03\ -eOP.EXE @&&| $** | -bin\th03\main.exe: bin\th03\main.obj th03\main_01.cpp bin\th02\snd_pmdr.obj bin\th03\vector2.obj bin\th03\exit.obj bin\th03\vector1.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th02\snd_se_r.obj bin\th03\snd_se.obj bin\th03\snd_kaja.obj bin\th03\initmain.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\hfliplut.obj th03\mrs.cpp th03\sprite16.cpp +bin\th03\main.exe: bin\th03\main.obj th03\main_01.cpp bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th03\vector2.obj bin\th03\exit.obj bin\th03\vector1.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th02\snd_se_r.obj bin\th03\snd_se.obj bin\th03\snd_kaja.obj bin\th03\initmain.obj bin\th03\pi_load.obj bin\th03\inp_m_w.obj bin\hfliplut.obj th03\mrs.cpp th03\sprite16.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -Z -DGAME=3 -nbin\th03\ -eMAIN.EXE @&&| $** | -bin\th03\mainl.exe: bin\th03\mainl.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj bin\th03\vector2.obj bin\th03\exit.obj bin\th03\cdg_put.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th03\pi_put.obj bin\th03\pi_put_i.obj bin\th02\snd_se_r.obj bin\th03\snd_se.obj bin\th03\snd_kaja.obj bin\th03\initmain.obj bin\th03\cdg_load.obj th03\exitmain.cpp bin\th03\grppsafx.obj bin\th03\snd_dlym.obj bin\th03\inp_wait.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj +bin\th03\mainl.exe: bin\th03\mainl.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj bin\th03\vector2.obj bin\th03\exit.obj bin\th03\cdg_put.obj bin\frmdely1.obj bin\th03\input_s.obj bin\th03\pi_put.obj bin\th03\pi_put_i.obj bin\th02\snd_se_r.obj bin\th03\snd_se.obj bin\th03\snd_kaja.obj bin\th03\initmain.obj bin\th03\cdg_load.obj th03\exitmain.cpp bin\th03\grppsafx.obj bin\th03\snd_dlym.obj bin\th03\inp_wait.obj bin\th03\pi_load.obj bin\th03\pi_put_q.obj bin\th03\inp_m_w.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj $(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=3 -nbin\th03\ -eMAINL.EXE @&&| $** | diff --git a/th02/snd/detmode.asm b/th02/snd/detmode.asm deleted file mode 100644 index 5dbb26d3..00000000 --- a/th02/snd/detmode.asm +++ /dev/null @@ -1,20 +0,0 @@ -public _snd_determine_mode -_snd_determine_mode proc - mov ah, PMD_GET_DRIVER_VERSION - int 60h - xor bx, bx - cmp al, -1 - jz short @@set_to_MIDI_activity - inc bx - mov _snd_fm_possible, 1 - jmp short @@set_and_ret - -@@set_to_MIDI_activity: - mov bl, _snd_midi_active - -@@set_and_ret: - mov _snd_active, bl - mov ax, bx - ret -_snd_determine_mode endp - nop ; word alignment diff --git a/th02/snd/detmode.c b/th02/snd/detmode.c index ed31f57f..2cc0c8e3 100644 --- a/th02/snd/detmode.c +++ b/th02/snd/detmode.c @@ -1,4 +1,4 @@ -#pragma option -zCSHARED -k- +#pragma option -WX -zCSHARED -k- #include "platform.h" #include "x86real.h" @@ -19,5 +19,4 @@ bool16 snd_determine_mode(void) snd_active = _BL; return _BX; } - #pragma codestring "\x90" diff --git a/th03_main.asm b/th03_main.asm index fe10d30a..070a35b0 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -8877,8 +8877,7 @@ SHARED segment word public 'CODE' use16 assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing include th01/hardware/vram_planes_set.asm - db 0 -include th02/snd/detmode.asm + extern _snd_determine_mode:proc extern VECTOR2:proc extern VECTOR2_BETWEEN_PLUS:proc extern _game_exit:proc diff --git a/th03_mainl.asm b/th03_mainl.asm index fe35decc..c9561a9b 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -5514,8 +5514,7 @@ SHARED segment word public 'CODE' use16 assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing include th01/hardware/vram_planes_set.asm - db 0 -include th02/snd/detmode.asm + extern _snd_determine_mode:proc extern _snd_delay_until_volume:proc extern _snd_load:proc extern VECTOR2:proc diff --git a/th03_op.asm b/th03_op.asm index 54bb4341..e5c0fa13 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -3611,7 +3611,7 @@ SHARED segment word public 'CODE' use16 include th02/exit_dos.asm include th01/hardware/vram_planes_set.asm -include th02/snd/detmode.asm + extern _snd_determine_mode:proc extern _snd_load:proc extern _game_exit:proc extern _vector1_at:proc