[Separate translation units] [th02] Sound effect playback (undecompilable)

Reason: Same as hflip_lut_generate() – wants to be word-aligned, and
the function before it has an odd length :(

Part of P0132, funded by [Anonymous].
This commit is contained in:
nmlgc 2020-12-20 18:47:43 +01:00
parent 52fdb33d1d
commit aac0108c63
8 changed files with 28 additions and 53 deletions

View File

@ -76,12 +76,12 @@ 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 bin\frmdely1.obj 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\th02\snd_se.obj 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 bin\frmdely1.obj 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 bin\th02\snd_se.obj th02\main_03.cpp
$(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eMAIN.EXE @&&|
$**
|

View File

@ -44,6 +44,7 @@ BMP2ARR = bin\\Pipeline\\bmp2arr.exe
: th05/sprites/piano_l.bmp |> !bmp2arr -sym _sPIANO_LABEL_FONT -of asm -sw 8 -sh 8 |> th05/sprites/piano_l.asp
!as = |> $(AS) %f %o |> bin\\%B.obj
!as2 = |> $(AS) /dGAME=2 th02\%b %o |> bin\\th02\\%B.obj
!as3 = |> $(AS) /dGAME=3 th03\%b %o |> bin\\th03\\%B.obj
!as4 = |> $(AS) /dGAME=4 th04\%b %o |> bin\\th04\\%B.obj
!as5 = |> $(AS) /dGAME=5 th05\%b %o |> bin\\th05\\%B.obj
@ -66,6 +67,7 @@ BMP2ARR = bin\\Pipeline\\bmp2arr.exe
: th01_fuuin.asm |> !as |> bin\\th01\\fuuin.obj
: th02_zuninit.asm |> !as |> bin\\th02\\zuninit.obj
: th02\\snd_se.asm |> !as2 |>
: th02_op.asm |> !as |> bin\\th02\\op.obj
: th02_main.asm | \
th02/sprites/pellet.asp \

View File

@ -24,6 +24,7 @@ tasm32 /m /mx /kh32768 /t th01_op.asm bin\th01\op.obj
tasm32 /m /mx /kh32768 /t th01_reiiden.asm bin\th01\reiiden.obj
tasm32 /m /mx /kh32768 /t th01_fuuin.asm bin\th01\fuuin.obj
tasm32 /m /mx /kh32768 /t th02_zuninit.asm bin\th02\zuninit.obj
tasm32 /m /mx /kh32768 /t /dGAME=2 th02\snd_se.asm bin\th02\snd_se.obj
tasm32 /m /mx /kh32768 /t th02_op.asm bin\th02\op.obj
tasm32 /m /mx /kh32768 /t th02_main.asm bin\th02\main.obj
tasm32 /m /mx /kh32768 /t th02_maine.asm bin\th02\maine.obj

View File

@ -61,5 +61,3 @@ int pascal mptn_load_inner(const char *fn)
#include "th02/formats/pi_put.c"
#include "th02/snd/kajaint.c"
#include "th02/snd/delaymea.c"
#pragma codestring "\x00"
#include "th02/snd/se.c"

View File

@ -31,4 +31,3 @@ const char pf_fn[] = PF_FN;
#include "th02/formats/pi_put.c"
#include "th02/snd/kajaint.c"
#include "th02/snd/delaymea.c"
#include "th02/snd/se.c"

View File

@ -1,5 +1,5 @@
public _snd_se_reset
_snd_se_reset proc
_snd_se_reset proc far
mov _snd_se_frame, 0
mov _snd_se_playing, -1
ret
@ -8,9 +8,9 @@ _snd_se_reset endp
retfunc macro
if GAME ge 3
ret 2
retf 2
else
ret
retf
endif
endm
proc_defconv snd_se_play, SND_SE_PLAY
@ -45,7 +45,7 @@ endp_defconv
even
public _snd_se_update
_snd_se_update proc
_snd_se_update proc far
cmp _snd_fm_possible, 0
jz short @@ret
cmp _snd_se_playing, -1
@ -54,7 +54,7 @@ _snd_se_update proc
jnz short @@unlock?
mov ah, PMD_SE_PLAY
mov al, _snd_se_playing
int 60h
int PMD
@@unlock?:
inc _snd_se_frame

View File

@ -1,43 +0,0 @@
extern unsigned char snd_se_playing;
extern unsigned char snd_se_priorities[];
extern unsigned char snd_se_priority_frames[];
extern unsigned char snd_se_frame;
#pragma option -k-
void snd_se_reset(void)
{
snd_se_frame = 0;
snd_se_playing = 0xFF;
}
#pragma codestring "\x90"
void snd_se_play(int new_se)
{
if(!snd_fm_possible) {
return;
}
if(snd_se_playing == 0xFF) {
snd_se_playing = new_se;
} else if(snd_se_priorities[snd_se_playing] <= snd_se_priorities[new_se]) {
snd_se_playing = new_se;
snd_se_frame = 0;
}
}
void snd_se_update(void)
{
if(snd_fm_possible && snd_se_playing != 0xFF) {
if(snd_se_frame == 0) __asm {
mov ah, PMD_SE_PLAY
mov al, snd_se_playing
int PMD
}
snd_se_frame++;
if(snd_se_priority_frames[snd_se_playing] < snd_se_frame) {
snd_se_frame = 0;
snd_se_playing = -1;
}
}
}

18
th02/snd_se.asm Normal file
View File

@ -0,0 +1,18 @@
.386
locals
include defconv.inc
include libs/kaja/kaja.inc
extrn _snd_se_playing:byte
extrn _snd_se_frame:byte
extrn _snd_se_priorities:byte
extrn _snd_se_priority_frames:byte
extrn _snd_fm_possible:byte
SHARED segment word public 'CODE' use16
assume cs:SHARED
include th02/snd/se.asm
SHARED ends
end