2015-02-13 11:56:51 +00:00
|
|
|
; void snd_se_reset(void)
|
2015-02-23 10:47:22 +00:00
|
|
|
proc_defconv snd_se_reset
|
|
|
|
mov _snd_se_frame, 0
|
|
|
|
mov _snd_se_playing, -1
|
2015-02-13 11:56:51 +00:00
|
|
|
ret
|
2015-02-23 10:47:22 +00:00
|
|
|
endp_defconv
|
|
|
|
even
|
2015-02-13 11:56:51 +00:00
|
|
|
|
|
|
|
; void DEFCONV snd_se_play(unsigned char se)
|
|
|
|
retfunc macro
|
|
|
|
if GAME ge 3
|
|
|
|
ret 2
|
|
|
|
else
|
|
|
|
ret
|
|
|
|
endif
|
|
|
|
endm
|
2015-02-23 10:47:22 +00:00
|
|
|
proc_defconv snd_se_play
|
2015-02-13 11:56:51 +00:00
|
|
|
@@se = [bp+6]
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
mov dx, @@se
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_fm_possible, 0
|
2015-02-13 11:56:51 +00:00
|
|
|
jz short @@ret
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_se_playing, -1
|
2015-02-13 11:56:51 +00:00
|
|
|
jnz short @@priority?
|
2015-02-23 10:47:22 +00:00
|
|
|
mov _snd_se_playing, dl
|
2015-02-13 11:56:51 +00:00
|
|
|
pop bp
|
|
|
|
retfunc
|
|
|
|
|
|
|
|
@@priority?:
|
2015-02-23 10:47:22 +00:00
|
|
|
mov al, _snd_se_playing
|
2015-02-13 11:56:51 +00:00
|
|
|
mov ah, 0
|
|
|
|
mov bx, ax
|
2015-02-23 10:47:22 +00:00
|
|
|
mov al, _snd_se_priorities[bx]
|
2015-02-13 11:56:51 +00:00
|
|
|
mov bx, dx
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp al, _snd_se_priorities[bx]
|
2015-02-13 11:56:51 +00:00
|
|
|
ja short @@ret
|
2015-02-23 10:47:22 +00:00
|
|
|
mov _snd_se_playing, dl
|
|
|
|
mov _snd_se_frame, 0
|
2015-02-13 11:56:51 +00:00
|
|
|
|
|
|
|
@@ret:
|
|
|
|
pop bp
|
|
|
|
retfunc
|
2015-02-23 10:47:22 +00:00
|
|
|
endp_defconv
|
|
|
|
even
|
2015-02-13 11:56:51 +00:00
|
|
|
|
|
|
|
; void snd_se_update(void)
|
2015-02-23 10:47:22 +00:00
|
|
|
proc_defconv snd_se_update
|
|
|
|
cmp _snd_fm_possible, 0
|
2015-02-13 11:56:51 +00:00
|
|
|
jz short @@ret
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_se_playing, -1
|
2015-02-13 11:56:51 +00:00
|
|
|
jz short @@ret
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_se_frame, 0
|
2015-02-13 11:56:51 +00:00
|
|
|
jnz short @@unlock?
|
|
|
|
mov ah, PMD_SE_PLAY
|
2015-02-23 10:47:22 +00:00
|
|
|
mov al, _snd_se_playing
|
2015-02-13 11:56:51 +00:00
|
|
|
int 60h
|
|
|
|
|
|
|
|
@@unlock?:
|
2015-02-23 10:47:22 +00:00
|
|
|
inc _snd_se_frame
|
|
|
|
mov al, _snd_se_playing
|
2015-02-13 11:56:51 +00:00
|
|
|
mov ah, 0
|
|
|
|
mov bx, ax
|
2015-02-23 10:47:22 +00:00
|
|
|
mov al, _snd_se_priority_frames[bx]
|
|
|
|
cmp al, _snd_se_frame
|
2015-02-13 11:56:51 +00:00
|
|
|
jnb short @@ret
|
2015-02-23 10:47:22 +00:00
|
|
|
mov _snd_se_frame, 0
|
|
|
|
mov _snd_se_playing, -1
|
2015-02-13 11:56:51 +00:00
|
|
|
|
|
|
|
@@ret:
|
|
|
|
ret
|
2015-02-23 10:47:22 +00:00
|
|
|
endp_defconv
|
|
|
|
even
|