[Reverse-engineering] Sound effect playback

This commit is contained in:
nmlgc 2015-02-13 12:56:51 +01:00
parent cc1a2987c4
commit 2cac434455
18 changed files with 956 additions and 2583 deletions

73
th02/hardware/snd_se.asm Normal file
View File

@ -0,0 +1,73 @@
; void snd_se_reset(void)
func snd_se_reset
mov snd_se_frame, 0
mov snd_se_playing, -1
ret
endfunc
; void DEFCONV snd_se_play(unsigned char se)
retfunc macro
if GAME ge 3
ret 2
else
ret
endif
endm
func snd_se_play
@@se = [bp+6]
push bp
mov bp, sp
mov dx, @@se
cmp snd_fm_possible, 0
jz short @@ret
cmp snd_se_playing, -1
jnz short @@priority?
mov snd_se_playing, dl
pop bp
retfunc
@@priority?:
mov al, snd_se_playing
mov ah, 0
mov bx, ax
mov al, snd_se_priorities[bx]
mov bx, dx
cmp al, snd_se_priorities[bx]
ja short @@ret
mov snd_se_playing, dl
mov snd_se_frame, 0
@@ret:
pop bp
retfunc
endfunc
; void snd_se_update(void)
func snd_se_update
cmp snd_fm_possible, 0
jz short @@ret
cmp snd_se_playing, -1
jz short @@ret
cmp snd_se_frame, 0
jnz short @@unlock?
mov ah, PMD_SE_PLAY
mov al, snd_se_playing
int 60h
@@unlock?:
inc snd_se_frame
mov al, snd_se_playing
mov ah, 0
mov bx, ax
mov al, snd_se_priority_frames[bx]
cmp al, snd_se_frame
jnb short @@ret
mov snd_se_frame, 0
mov snd_se_playing, -1
@@ret:
ret
endfunc

View File

@ -0,0 +1,68 @@
snd_se_playing db -1
snd_se_priorities db 0
db 0
db 32
db 9
db 2
db 16
db 5
db 6
db 48
db 8
db 9
db 5
db 16
db 10
db 17
db 12
db 32
db 32
db 16
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
snd_se_priority_frames db 0
db 0
db 36
db 16
db 4
db 16
db 8
db 10
db 48
db 80
db 24
db 17
db 11
db 4
db 80
db 16
db 48
db 74
db 32
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
snd_se_frame db 0

File diff suppressed because it is too large Load Diff

View File

@ -557,11 +557,10 @@ sub_9D5C endp
sub_9F37 proc near
push bp
mov bp, sp
call sub_B252
push 0Dh
call sub_B25E
call snd_se_reset
call snd_se_play stdcall, 13
pop cx
call sub_B296
call snd_se_update
push 14h
call frame_delay
les bx, dword_F3DC
@ -2580,89 +2579,10 @@ loc_B24B:
jb short loc_B232
pop bp
retf
; =============== S U B R O U T I N E =======================================
sub_B252 proc far
mov byte_DC33, 0
mov byte_DBF0, 0FFh
retf
sub_B252 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B25E proc far
arg_0 = word ptr 6
push bp
mov bp, sp
mov dx, [bp+arg_0]
cmp snd_fm_possible, 0
jz short loc_B294
cmp byte_DBF0, 0FFh
jnz short loc_B278
mov byte_DBF0, dl
pop bp
retf
; ---------------------------------------------------------------------------
loc_B278:
mov al, byte_DBF0
mov ah, 0
mov bx, ax
mov al, [bx+5C1h]
mov bx, dx
cmp al, [bx+5C1h]
ja short loc_B294
mov byte_DBF0, dl
mov byte_DC33, 0
loc_B294:
pop bp
retf
sub_B25E endp
; =============== S U B R O U T I N E =======================================
sub_B296 proc far
cmp snd_fm_possible, 0
jz short locret_B2D1
cmp byte_DBF0, 0FFh
jz short locret_B2D1
cmp byte_DC33, 0
jnz short loc_B2B2
mov ah, PMD_SE_PLAY
mov al, byte_DBF0
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
loc_B2B2:
inc byte_DC33
mov al, byte_DBF0
mov ah, 0
mov bx, ax
mov al, [bx+5E2h]
cmp al, byte_DC33
jnb short locret_B2D1
mov byte_DC33, 0
mov byte_DBF0, 0FFh
locret_B2D1:
retf
sub_B296 endp
include th02/hardware/snd_se.asm
include th02/frame_delay.asm
seg002 ends
; ===========================================================================
@ -2685,11 +2605,10 @@ var_2 = word ptr -2
enter 2, 0
push si
mov [bp+var_2], 1
call sub_B252
push 6
call sub_B25E
call snd_se_reset
call snd_se_play stdcall, 6
pop cx
call sub_B296
call snd_se_update
xor si, si
jmp short loc_B370
; ---------------------------------------------------------------------------
@ -5575,74 +5494,7 @@ include th02/formats/pfopen[data].asm
aUmx db '“Œ•û••–‚.˜^',0
snd_active db 0
db 0
byte_DBF0 db 0FFh
db 0
db 0
db 20h
db 9
db 2
db 10h
db 5
db 6
db 30h ; 0
db 8
db 9
db 5
db 10h
db 0Ah
db 11h
db 0Ch
db 20h
db 20h
db 10h
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 0Ah
db 30h ; 0
db 50h ; P
db 18h
db 11h
db 0Bh
db 4
db 50h ; P
db 10h
db 30h ; 0
db 4Ah ; J
db 20h
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
byte_DC33 db 0
include th02/hardware/snd_se[data].asm
byte_DC34 db 1
db 0
include th02/strings/hiscore[data].asm

View File

@ -0,0 +1,66 @@
snd_se_priorities db 0
db 0
db 32
db 16
db 2
db 18
db 18
db 18
db 64
db 16
db 17
db 2
db 17
db 32
db 18
db 18
db 18
db 18
db 32
db 32
db 18
db 18
db 14
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
snd_se_priority_frames db 0
db 0
db 36
db 16
db 4
db 16
db 8
db 10
db 48
db 80
db 24
db 17
db 11
db 4
db 80
db 16
db 48
db 74
db 50
db 32
db 24
db 68
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0

View File

@ -0,0 +1,2 @@
snd_se_playing db -1
snd_se_frame db 0

View File

@ -486,7 +486,7 @@ loc_977E:
push word_1EFF8
push 6626h
call sub_DA43
call sub_EC76
call snd_se_update
test byte_1EFFB, 10h
jz short loc_9845
call sub_C7A5
@ -1131,7 +1131,7 @@ loc_9E24:
mov dx, 0A4h
mov al, 1
out dx, al
call sub_EC2E
call snd_se_reset
nopcall sub_B8F7
nopcall sub_BAE0
pushd 0
@ -1532,7 +1532,7 @@ sub_A21F proc near
call farfp_20F28
mov word_23B6A, 4110h
mov word_23BEA, 4110h
call sub_EC2E
call snd_se_reset
nopcall sub_B8F7
nopcall sub_A38E
nopcall sub_BAE0
@ -4307,8 +4307,7 @@ arg_0 = word ptr 4
add ax, 0FFF8h
mov word_20E40, ax
mov byte_20E3C, 1
push 0Eh
call sub_EC3A
call snd_se_play pascal, 14
mov al, byte ptr word_23AF0
mov ah, 0
mov bx, 1
@ -5284,10 +5283,9 @@ loc_C7C1:
; ---------------------------------------------------------------------------
loc_C7C8:
call sub_EC2E
push 15h
call sub_EC3A
call sub_EC76
call snd_se_reset
call snd_se_play pascal, 21
call snd_se_update
jmp short loc_C7E7
; ---------------------------------------------------------------------------
@ -5319,10 +5317,9 @@ loc_C80A:
loc_C816:
cmp word ptr unk_1EFFA, 0
jnz short loc_C80A
call sub_EC2E
push 15h
call sub_EC3A
call sub_EC76
call snd_se_reset
call snd_se_play pascal, 21
call snd_se_update
pop bp
retn
sub_C7A5 endp
@ -5633,10 +5630,9 @@ sub_CA3C proc far
jnz short loc_CAC8
loc_CA4E:
call sub_EC2E
push 13h
call sub_EC3A
call sub_EC76
call snd_se_reset
call snd_se_play pascal, 19
call snd_se_update
push 0
nopcall sub_BA91
push 1
@ -7035,8 +7031,7 @@ loc_D56B:
mov al, byte_220CA
cmp byte_220DC, al
jnb short locret_D5A0
push 8
call sub_EC3A
call snd_se_play pascal, 8
les bx, dword_1F2F0
assume es:nothing
inc byte ptr es:[bx+34h]
@ -8023,8 +8018,7 @@ loc_DBFE:
loc_DC34:
cmp word ptr [si+18h], 180h
jnz loc_DD3C
push 9
call sub_EC3A
call snd_se_play pascal, 9
jmp loc_DD3C
; ---------------------------------------------------------------------------
@ -8489,8 +8483,7 @@ arg_0 = word ptr 4
mov si, [bp+arg_0]
cmp byte ptr [si+10h], 40h
jnz short loc_E036
push 2
call sub_EC3A
call snd_se_play pascal, 2
push 3Fh ; '?'
call sub_A41E
mov [si+12h], al
@ -8599,8 +8592,7 @@ loc_E0BF:
mov ah, 0
mov bx, ax
mov byte ptr [bx+658Bh], 1
push 7
call sub_EC3A
call snd_se_play pascal, 7
mov al, [si+8]
mov [si+1Eh], al
push word ptr [si]
@ -9366,8 +9358,7 @@ loc_E7B3:
loc_E7C0:
mov di, 66A6h
push 1
call sub_EC3A
call snd_se_play pascal, 1
jmp short loc_E7D4
; ---------------------------------------------------------------------------
@ -9538,7 +9529,7 @@ seg001 ends
; ===========================================================================
; Segment type: Pure code
seg002 segment byte public 'CODE' use16
seg002 segment word public 'CODE' use16
assume cs:seg002
;org 8
assume es:nothing, ss:nothing, ds:dseg, fs:nothing, gs:nothing
@ -9872,87 +9863,7 @@ sub_EA8C endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_EC2E proc far
mov byte_1DB4B, 0
mov byte_1DB4A, 0FFh
retf
sub_EC2E endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_EC3A proc far
arg_0 = word ptr 6
push bp
mov bp, sp
mov dx, [bp+arg_0]
cmp snd_fm_possible, 0
jz short loc_EC72
cmp byte_1DB4A, 0FFh
jnz short loc_EC56
mov byte_1DB4A, dl
pop bp
retf 2
; ---------------------------------------------------------------------------
loc_EC56:
mov al, byte_1DB4A
mov ah, 0
mov bx, ax
mov al, [bx+5F2h]
mov bx, dx
cmp al, [bx+5F2h]
ja short loc_EC72
mov byte_1DB4A, dl
mov byte_1DB4B, 0
loc_EC72:
pop bp
retf 2
sub_EC3A endp
; =============== S U B R O U T I N E =======================================
sub_EC76 proc far
cmp snd_fm_possible, 0
jz short locret_ECB1
cmp byte_1DB4A, 0FFh
jz short locret_ECB1
cmp byte_1DB4B, 0
jnz short loc_EC92
mov ah, PMD_SE_PLAY
mov al, byte_1DB4A
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
loc_EC92:
inc byte_1DB4B
mov al, byte_1DB4A
mov ah, 0
mov bx, ax
mov al, [bx+613h]
cmp al, byte_1DB4B
jnb short locret_ECB1
mov byte_1DB4B, 0
mov byte_1DB4A, 0FFh
locret_ECB1:
retf
sub_EC76 endp
include th02/hardware/snd_se.asm
include th02/hardware/snd_kaja_func.asm
; =============== S U B R O U T I N E =======================================
@ -10779,8 +10690,7 @@ arg_4 = word ptr 8
mov di, [bp+arg_4]
cmp [bp+arg_0], 1
jnz short loc_F210
push 10h
call sub_EC3A
call snd_se_play pascal, 16
loc_F210:
push di
@ -11038,8 +10948,7 @@ loc_F42B:
mov ah, 0
mov bx, ax
mov byte ptr [bx+2D54h], 0
push 12h
call sub_EC3A
call snd_se_play pascal, 18
mov al, 1
sub al, byte ptr word_1FE88
push ax
@ -11934,8 +11843,7 @@ loc_FBB5:
jb loc_FC69
test byte ptr word_1F3B0, 1
jnz loc_FC51
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov al, byte_20E28
mov byte ptr word_23E42+1, al
mov byte ptr word_23E44+1, 22h ; '"'
@ -12077,8 +11985,7 @@ loc_FD12:
loc_FD47:
test byte ptr word_1F3B0, 1
jnz short loc_FD55
push 3
call sub_EC3A
call snd_se_play pascal, 3
loc_FD55:
cmp word_1F3B0, 80h
@ -12150,8 +12057,7 @@ loc_FDCB:
mov byte ptr word_23E44+1, 18h
loc_FDD0:
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov byte ptr word_23E42+1, 0
mov ax, word_1F33E
add ax, 180h
@ -12237,8 +12143,7 @@ loc_FE54:
mov al, byte_1F3A5
mov byte ptr word_23E42, al
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov al, byte_20E2A
add byte_20E2B, al
@ -12805,8 +12710,7 @@ loc_10376:
push ax
call sub_CDBD
mov byte_1F353, 2
push 5
call sub_EC3A
call snd_se_play pascal, 5
loc_103A5:
test byte ptr word_1F3B0, 3
@ -12909,8 +12813,7 @@ loc_1047F:
loc_104A7:
test byte ptr word_1F3B0, 1
jnz short loc_104F6
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov ax, word_20E50
mov word_23E3E, ax
mov ax, word_20E52
@ -13243,9 +13146,8 @@ loc_107B2:
jnz short loc_107CC
loc_107C0:
call sub_EC2E
push 5
call sub_EC3A
call snd_se_reset
call snd_se_play pascal, 5
loc_107CC:
cmp word_1F3B0, 60h
@ -14758,8 +14660,7 @@ loc_114D1:
loc_114E1:
cmp word_1F3B0, 24h ; '$'
jnz short loc_1150B
push 3
call sub_EC3A
call snd_se_play pascal, 3
xor si, si
jmp short loc_11504
; ---------------------------------------------------------------------------
@ -14785,8 +14686,7 @@ loc_1150B:
jnz short loc_1152D
loc_11519:
push 3
call sub_EC3A
call snd_se_play pascal, 3
call sub_17730
mov al, byte_23DE2
add al, 8
@ -14931,8 +14831,7 @@ sub_11620 proc near
div bx
cmp dx, 1
jnz short loc_116A2
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov byte ptr word_23E44+1, 0Eh
mov ax, word_1F33E
mov word_23E3E, ax
@ -15587,8 +15486,7 @@ loc_11B6B:
mov byte ptr word_23E42, al
push 1
call sub_11AC1
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov byte_1F353, 0
mov byte_1F34F, 1
mov word_1F3B0, 0
@ -15646,8 +15544,7 @@ loc_11BE5:
mov byte ptr word_23E42, al
push 0
call sub_11AC1
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov byte_1F353, 0
mov byte_1F34F, 1
mov word_1F3B0, 0
@ -15682,8 +15579,7 @@ sub_11C5F proc near
div bx
cmp dx, 1
jnz loc_11D06
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov byte_23E4E, 1
mov al, byte ptr word_1F3B0
mov byte ptr word_23E42+1, al
@ -15850,8 +15746,7 @@ loc_11E18:
mov ah, 0
cmp ax, di
jg loc_11D77
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov byte_1F353, 0
mov byte_1F34F, 1
mov word_1F3B0, 0
@ -17567,8 +17462,7 @@ loc_12C8B:
mov word_23E40, ax
mov byte ptr word_23E42, 30h ; '0'
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
pop bp
retn
; ---------------------------------------------------------------------------
@ -17656,8 +17550,7 @@ loc_12DC5:
mov al, byte_1F3A1
mov byte_23E47, al
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov byte_23E4E, 1
mov byte ptr word_23E42+1, 20h ; ' '
mov byte ptr word_23E42, 10h
@ -17697,8 +17590,7 @@ loc_12E2B:
loc_12E4D:
mov byte_23E47, al
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
jmp short loc_12E75
; ---------------------------------------------------------------------------
@ -17762,8 +17654,7 @@ loc_12EB0:
mov word_23E40, ax
mov byte ptr word_23E42, 30h ; '0'
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
loc_12EED:
cmp word_1F3B0, 64h ; 'd'
@ -17857,8 +17748,7 @@ loc_12F77:
mov al, byte_23DE6
mov byte ptr word_23E42+1, al
call sub_17730
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
loc_12FBF:
cmp word_1F3B0, 40h
@ -18442,8 +18332,7 @@ loc_13483:
mov ah, 0
cmp ax, si
jg short loc_13426
push 5
call sub_EC3A
call snd_se_play pascal, 5
jmp short loc_134A7
; ---------------------------------------------------------------------------
@ -18560,10 +18449,10 @@ loc_1356B:
loc_13581:
cmp si, 4
jl short loc_1356B
push 0Ah
push 10
loc_13588:
call sub_EC3A
call snd_se_play
jmp short loc_135A1
; ---------------------------------------------------------------------------
@ -18647,8 +18536,7 @@ loc_135F8:
jnz short loc_1364C
loc_13633:
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
call sub_17730
mov al, byte_23DE8
add al, 80h
@ -20406,8 +20294,7 @@ loc_1430F:
loc_1432F:
cmp si, 0Ch
jl short loc_1430F
push 6
call sub_EC3A
call snd_se_play pascal, 6
pop si
pop bp
retf 4
@ -20460,8 +20347,7 @@ loc_14362:
loc_14398:
cmp si, 0Ch
jl short loc_14362
push 6
call sub_EC3A
call snd_se_play pascal, 6
loc_143A4:
mov bx, word_1FE4E
@ -21129,8 +21015,7 @@ loc_14914:
jnb loc_149D1
test [bp+var_1], 1
jz short loc_14929
push 10h
call sub_EC3A
call snd_se_play pascal, 16
loc_14929:
mov al, [bp+var_1]
@ -22006,8 +21891,7 @@ sub_1501E proc far
mov ah, 0
mov bx, ax
mov byte ptr [bx+307Eh], 0
push 12h
call sub_EC3A
call snd_se_play pascal, 18
loc_1505C:
mov al, byte ptr word_1FE88
@ -22076,8 +21960,7 @@ loc_150CA:
loc_150E1:
cmp si, 20h ; ' '
jl short loc_150CA
push 12h
call sub_EC3A
call snd_se_play pascal, 18
loc_150ED:
mov al, byte ptr word_1FE88
@ -22288,8 +22171,7 @@ loc_152C2:
jnb loc_15360
test [bp+var_1], 1
jz short loc_152D7
push 10h
call sub_EC3A
call snd_se_play pascal, 16
loc_152D7:
cmp [bp+var_1], 60h
@ -22529,8 +22411,7 @@ arg_2 = byte ptr 6
mov ax, [bx+65A8h]
mov bx, word_20E22
mov [bx+4], ax
push 0Dh
call sub_EC3A
call snd_se_play pascal, 13
pop bp
retn 4
sub_1546C endp
@ -23376,8 +23257,7 @@ loc_15BB9:
jnb loc_15C57
test [bp+var_F], 7
jnz short loc_15BEC
push 5
call sub_EC3A
call snd_se_play pascal, 5
mov PaletteTone, 8Ch
call far ptr palette_show
push 9000B80h
@ -23886,8 +23766,7 @@ sub_15F9D proc near
cmp byte ptr [bx+1], 0Ah
jnz short loc_15FB6
mov byte ptr [bx], 0Ah
push 3
call sub_EC3A
call snd_se_play pascal, 3
pop bp
retn
; ---------------------------------------------------------------------------
@ -25232,8 +25111,7 @@ var_1 = byte ptr -1
loc_16AC4:
mov byte ptr [si], 2
mov byte ptr [si+1], 0
push 7
call sub_EC3A
call snd_se_play pascal, 7
jmp short loc_16AF9
; ---------------------------------------------------------------------------
@ -25247,8 +25125,7 @@ loc_16AD4:
idiv bx
or dx, dx
jnz short loc_16AF0
push 0Fh
call sub_EC3A
call snd_se_play pascal, 15
loc_16AF0:
cmp [bp+var_1], 40h
@ -25304,8 +25181,7 @@ yumemi_16B0C proc far
jl short loc_16BB0
mov byte ptr [si], 2
mov byte ptr [si+1], 0
push 7
call sub_EC3A
call snd_se_play pascal, 7
jmp short loc_16BB0
; ---------------------------------------------------------------------------
@ -25986,8 +25862,7 @@ loc_17081:
loc_17099:
cmp si, 8
jl short loc_17081
push 12h
call sub_EC3A
call snd_se_play pascal, 18
loc_170A5:
mov al, byte ptr word_1FE88
@ -26186,8 +26061,7 @@ loc_17255:
jnb loc_17332
test [bp+var_1], 1
jnz short loc_1727B
push 10h
call sub_EC3A
call snd_se_play pascal, 16
mov al, byte ptr word_1FE88
mov ah, 0
imul ax, 3
@ -28505,8 +28379,7 @@ loc_184A5:
idiv bx
or dx, dx
jnz short loc_18518
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov al, [bp+var_1]
mov ah, 0
add ax, 0FFC0h
@ -28653,8 +28526,7 @@ loc_185E9:
loc_18601:
cmp si, 8
jl short loc_185E9
push 11h
call sub_EC3A
call snd_se_play pascal, 17
loc_1860D:
mov al, byte ptr word_1FE88
@ -28879,8 +28751,7 @@ loc_18801:
jnb loc_18911
test [bp+var_3], 1
jz short loc_18845
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov al, byte ptr word_1FE88
mov ah, 0
imul ax, 3
@ -29102,8 +28973,7 @@ loc_18A10:
and ax, 3
cmp ax, 2
jge short loc_18A4E
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
push 0A0h
push word_1FE88
call sub_A3D2
@ -29360,8 +29230,7 @@ loc_18C95:
and ax, 3
cmp ax, 2
jge short loc_18CD2
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
mov PaletteTone, 0AAh ; 'ª'
mov byte_23B01, 1
mov al, byte ptr word_1FE88
@ -29661,8 +29530,7 @@ loc_18F71:
idiv bx
or dx, dx
jnz short loc_18FE2
push 5
call sub_EC3A
call snd_se_play pascal, 5
jmp short loc_18FE2
; ---------------------------------------------------------------------------
@ -30061,8 +29929,7 @@ loc_1928B:
loc_192CC:
cmp byte ptr [si+1], 10h
jnz short loc_192DB
push 14h
call sub_EC3A
call snd_se_play pascal, 20
jmp short loc_1930C
; ---------------------------------------------------------------------------
@ -30709,8 +30576,7 @@ loc_197CA:
mov byte ptr [bx+1], 0
mov bx, [di]
mov byte ptr [bx], 1
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
loc_197DC:
mov bx, [di]
@ -31475,8 +31341,7 @@ loc_19CEF:
loc_19D0E:
mov byte ptr [si+1], 0
mov byte ptr [si], 1
push 14h
call sub_EC3A
call snd_se_play pascal, 20
loc_19D1C:
inc byte ptr [si+1]
@ -31754,8 +31619,7 @@ sub_19E2A endp
sub_19EF9 proc near
push bp
mov bp, sp
push 3
call sub_EC3A
call snd_se_play pascal, 3
mov bx, word_2028A
push word ptr [bx+2]
push word ptr [bx+4]
@ -33088,8 +32952,7 @@ loc_1A8A6:
loc_1A8AF:
mov word ptr [si+0Eh], 0
mov byte ptr [si], 1
push 0Ah
call sub_EC3A
call snd_se_play pascal, 10
loc_1A8BE:
inc word ptr [si+0Eh]
@ -33907,8 +33770,7 @@ loc_1AF4D:
mov word ptr [si+14h], 10h
mov byte ptr [si+1], 0
mov byte ptr [si], 1
push 7
call sub_EC3A
call snd_se_play pascal, 7
loc_1AF60:
inc byte ptr [si+1]
@ -34476,8 +34338,7 @@ loc_1B2EF:
mov bx, ax
mov ax, [bx+65A8h]
mov [si+4], ax
push 0Fh
call sub_EC3A
call snd_se_play pascal, 15
jmp short loc_1B34F
; ---------------------------------------------------------------------------
@ -35176,8 +35037,7 @@ loc_1B871:
mov [bx], al
cmp al, 1
jnz short loc_1B886
push 1
call sub_EC3A
call snd_se_play pascal, 1
loc_1B886:
mov bx, word_1F868
@ -36356,8 +36216,7 @@ arg_2 = word ptr 8
mov ax, [bp+arg_0]
mov [bx+4], ax
mov word ptr [bx+6], 0FFF0h
push 6
call sub_EC3A
call snd_se_play pascal, 6
pop bp
retf 4
kotohime_1C167 endp
@ -37583,75 +37442,9 @@ snd_active db 0
db 0
include libs/master.lib/respal_exist[data].asm
include libs/master.lib/draw_trapezoid[data].asm
byte_1DB4A db 0FFh
byte_1DB4B db 0
include th03/hardware/snd_se_state[data].asm
include th02/formats/pfopen[data].asm
db 0
db 0
db 20h
db 10h
db 2
db 12h
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 11h
db 20h
db 12h
db 12h
db 12h
db 12h
db 20h
db 20h
db 12h
db 12h
db 0Eh
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 0Ah
db 30h ; 0
db 50h ; P
db 18h
db 11h
db 0Bh
db 4
db 50h ; P
db 10h
db 30h ; 0
db 4Ah ; J
db 32h ; 2
db 20h
db 18h
db 44h ; D
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
include th03/hardware/snd_se_priority[data].asm
aYume_cfg db 'YUME.CFG',0
db 0
byte_1DB9E db 0FFh

View File

@ -1153,7 +1153,7 @@ loc_9DAD:
push offset aMikoft_bft ; "MIKOFT.bft"
call gaiji_entry_bfnt
call snd_load c, offset aYume_efc, ds, SND_LOAD_SE
call sub_CE3E
call snd_se_reset
call sub_D784
les bx, dword_105DA
cmp byte ptr es:[bx+35h], 0
@ -2793,10 +2793,9 @@ loc_ABFE:
lea ax, [bp+var_2]
push ax
call sub_A50A
call sub_CE3E
push [bp+var_2]
call sub_CE4A
call sub_CE86
call snd_se_reset
call snd_se_play pascal, [bp+var_2]
call snd_se_update
jmp short loc_AC1E ; default
; ---------------------------------------------------------------------------
@ -6724,87 +6723,7 @@ sub_CB68 endp
include th02/formats/pi_slot_palette_apply.asm
include th02/formats/pi_slot_put.asm
include th03/formats/pi_slot_put_interlace.asm
; =============== S U B R O U T I N E =======================================
sub_CE3E proc far
mov byte_EC7D, 0
mov byte_EC7C, 0FFh
retf
sub_CE3E endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_CE4A proc far
arg_0 = word ptr 6
push bp
mov bp, sp
mov dx, [bp+arg_0]
cmp snd_fm_possible, 0
jz short loc_CE82
cmp byte_EC7C, 0FFh
jnz short loc_CE66
mov byte_EC7C, dl
pop bp
retf 2
; ---------------------------------------------------------------------------
loc_CE66:
mov al, byte_EC7C
mov ah, 0
mov bx, ax
mov al, [bx+896h]
mov bx, dx
cmp al, [bx+896h]
ja short loc_CE82
mov byte_EC7C, dl
mov byte_EC7D, 0
loc_CE82:
pop bp
retf 2
sub_CE4A endp
; =============== S U B R O U T I N E =======================================
sub_CE86 proc far
cmp snd_fm_possible, 0
jz short locret_CEC1
cmp byte_EC7C, 0FFh
jz short locret_CEC1
cmp byte_EC7D, 0
jnz short loc_CEA2
mov ah, PMD_SE_PLAY
mov al, byte_EC7C
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
loc_CEA2:
inc byte_EC7D
mov al, byte_EC7C
mov ah, 0
mov bx, ax
mov al, [bx+8B7h]
cmp al, byte_EC7D
jnb short locret_CEC1
mov byte_EC7D, 0
mov byte_EC7C, 0FFh
locret_CEC1:
retf
sub_CE86 endp
include th02/hardware/snd_se.asm
include th02/hardware/snd_kaja_func.asm
; =============== S U B R O U T I N E =======================================
@ -8043,77 +7962,11 @@ include libs/master.lib/superpa[data].asm
snd_active db 0
db 0
include libs/master.lib/respal_exist[data].asm
byte_EC7C db 0FFh
byte_EC7D db 0
include th03/hardware/snd_se_state[data].asm
include th02/formats/pfopen[data].asm
byte_EC84 db 0
db 0
db 0
db 0
db 20h
db 10h
db 2
db 12h
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 11h
db 20h
db 12h
db 12h
db 12h
db 12h
db 20h
db 20h
db 12h
db 12h
db 0Eh
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 0Ah
db 30h ; 0
db 50h ; P
db 18h
db 11h
db 0Bh
db 4
db 50h ; P
db 10h
db 30h ; 0
db 4Ah ; J
db 32h ; 2
db 20h
db 18h
db 44h ; D
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
include th03/hardware/snd_se_priority[data].asm
db 30h ; 0
db 0
aOver_pi db 'over.pi',0

67
th04/hardware/snd_se.asm Normal file
View File

@ -0,0 +1,67 @@
; void snd_se_reset(void)
func snd_se_reset
mov snd_se_frame, 0
mov snd_se_playing, -1
ret
endfunc
; void DEFCONV snd_se_play(unsigned char se)
func snd_se_play
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short @@ret
cmp snd_se_playing, -1
jnz short @@priority?
mov snd_se_playing, dl
ret 2
@@priority?:
mov bl, snd_se_playing
xor bh, bh
mov al, snd_se_priorities[bx]
mov bx, dx
cmp al, snd_se_priorities[bx]
ja short @@ret
mov snd_se_playing, dl
mov snd_se_frame, 0
@@ret:
ret 2
endfunc
; void snd_se_update(void)
func snd_se_update
cmp snd_se_mode, SND_SE_OFF
jz short @@ret
cmp snd_se_playing, -1
jz short @@ret
cmp snd_se_frame, 0
jnz short @@unlock?
mov al, snd_se_playing
cmp snd_se_mode, SND_SE_BEEP
jz short @@beep
mov ah, PMD_SE_PLAY
int 60h
jmp short @@unlock?
@@beep:
xor ah, ah
push ax
call bgm_sound
@@unlock?:
inc snd_se_frame
mov bl, snd_se_playing
xor bh, bh
mov al, snd_se_priority_frames[bx]
cmp al, snd_se_frame
jnb short @@ret
mov snd_se_frame, 0
mov snd_se_playing, -1
@@ret:
ret
endfunc

View File

@ -0,0 +1,34 @@
snd_se_priorities db 0
db 0
db 32
db 16
db 2
db 18
db 18
db 64
db 16
db 17
db 2
db 18
db 32
db 32
db 32
db 32
db 0
snd_se_priority_frames db 0
db 0
db 36
db 16
db 4
db 16
db 8
db 48
db 80
db 17
db 4
db 11
db 80
db 80
db 80
db 32
db 0

View File

@ -573,7 +573,7 @@ loc_AC7A:
out dx, al
mov byte_25A3D, al
xor byte_25A3C, 1
call sub_138EC
call snd_se_update
inc dword_266C6
mov ax, word_266CA
mov dx, ax
@ -6024,10 +6024,9 @@ loc_D47B:
lea ax, [bp+var_2]
push ax
call sub_D0CA
call sub_138A6
push [bp+var_2]
call sub_138B2
call sub_138EC
call snd_se_reset
call snd_se_play pascal, [bp+var_2]
call snd_se_update
jmp loc_D528 ; default
; ---------------------------------------------------------------------------
@ -9436,8 +9435,7 @@ loc_EE8C:
nopcall sub_EEE8
mov byte_259DB, 1
mov fp_259DE, offset sub_112D8
push 7
call sub_138B2
call snd_se_play pascal, 7
locret_EEA3:
leave
@ -11762,8 +11760,7 @@ loc_FFED:
mov ax, fp_255AC
mov fp_255AA, ax
mov byte_2CFFA, 0C0h
push 0Dh
call sub_138B2
call snd_se_play pascal, 13
mov byte_236E0, 1
les bx, dword_2CDC6
inc byte ptr es:[bx+32h]
@ -11866,8 +11863,7 @@ loc_10096:
push word_266DA
push word_266DC
nopcall sub_C64A
push 9
call sub_138B2
call snd_se_play pascal, 9
loc_100FE:
call sub_C156
@ -11975,8 +11971,7 @@ loc_101D7:
shl ax, 4
push ax
nopcall sub_C64A
push 9
call sub_138B2
call snd_se_play pascal, 9
loc_101F4:
call sub_C156
@ -12061,8 +12056,7 @@ loc_10288:
loc_1028E:
cmp byte_256A9, 0B0h ; '°'
jnz short loc_102A8
push 0Fh
call sub_138B2
call snd_se_play pascal, 15
mov byte_255BC, 1
mov byte_236E0, 0
jmp short loc_102AF
@ -13033,8 +13027,7 @@ loc_109E9:
mov word_2D00C, ax
nopcall sub_F07A
nopcall sub_11DE6
push 2
call sub_138B2
call snd_se_play pascal, 2
cmp byte_266D5, 16h
jb short loc_10A16
mov byte_266D5, 15h
@ -13205,8 +13198,7 @@ loc_10B97:
loc_10BB0:
call fp_257DA
push 1
call sub_138B2
call snd_se_play pascal, 1
jmp short loc_10BC7
; ---------------------------------------------------------------------------
@ -18049,11 +18041,10 @@ seg001 ends
; ===========================================================================
; Segment type: Pure code
seg002 segment byte public 'CODE' use16
seg002 segment word public 'CODE' use16
assume cs:seg002
;org 0Dh
assume es:nothing, ss:nothing, ds:dseg, fs:nothing, gs:nothing
db 0
include th01/hardware/vram_planes_set.asm
@ -18837,88 +18828,7 @@ sub_137A4 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_138A6 proc far
mov byte_21C55, 0
mov byte_21C54, 0FFh
retf
sub_138A6 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_138B2 proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_138E8
cmp byte_21C54, 0FFh
jnz short loc_138CD
mov byte_21C54, dl
retf 2
; ---------------------------------------------------------------------------
loc_138CD:
mov bl, byte_21C54
xor bh, bh
mov al, [bx+8D2h]
mov bx, dx
cmp al, [bx+8D2h]
ja short locret_138E8
mov byte_21C54, dl
mov byte_21C55, 0
locret_138E8:
retf 2
sub_138B2 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_138EC proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_13937
cmp byte_21C54, 0FFh
jz short locret_13937
cmp byte_21C55, 0
jnz short loc_13919
mov al, byte_21C54
cmp snd_se_mode, SND_SE_BEEP
jz short loc_13911
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_13919
; ---------------------------------------------------------------------------
loc_13911:
xor ah, ah
push ax
call bgm_sound
loc_13919:
inc byte_21C55
mov bl, byte_21C54
xor bh, bh
mov al, [bx+8E3h]
cmp al, byte_21C55
jnb short locret_13937
mov byte_21C55, 0
mov byte_21C54, 0FFh
locret_13937:
retf
sub_138EC endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -19226,44 +19136,11 @@ byte_21AF2 db 1
db 0
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
dw 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
include th04/hardware/snd_se_priority[data].asm
include th04/hardware/snd[data].asm
db 0
include th04/hardware/snd_load[data].asm
byte_21C54 db 0FFh
byte_21C55 db 0
include th03/hardware/snd_se_state[data].asm
byte_21C56 db 0
db 0
word_21C58 dw 0

File diff suppressed because it is too large Load Diff

View File

@ -1888,10 +1888,9 @@ loc_AD95:
lea ax, [bp+var_2]
push ax
call sub_A64D
call sub_D594
push [bp+var_2]
call sub_D5A0
call sub_D5DA
call snd_se_reset
call snd_se_play pascal, [bp+var_2]
call snd_se_update
jmp short loc_ADB5 ; default
; ---------------------------------------------------------------------------
@ -6262,91 +6261,7 @@ locret_D592:
retf
sub_D492 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D594 proc far
mov byte_EB31, 0
mov byte_EB30, 0FFh
retf
sub_D594 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D5A0 proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_D5D6
cmp byte_EB30, 0FFh
jnz short loc_D5BB
mov byte_EB30, dl
retf 2
; ---------------------------------------------------------------------------
loc_D5BB:
mov bl, byte_EB30
xor bh, bh
mov al, [bx+55Eh]
mov bx, dx
cmp al, [bx+55Eh]
ja short locret_D5D6
mov byte_EB30, dl
mov byte_EB31, 0
locret_D5D6:
retf 2
sub_D5A0 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D5DA proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_D625
cmp byte_EB30, 0FFh
jz short locret_D625
cmp byte_EB31, 0
jnz short loc_D607
mov al, byte_EB30
cmp snd_se_mode, SND_SE_BEEP
jz short loc_D5FF
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_D607
; ---------------------------------------------------------------------------
loc_D5FF:
xor ah, ah
push ax
call bgm_sound
loc_D607:
inc byte_EB31
mov bl, byte_EB30
xor bh, bh
mov al, [bx+56Fh]
cmp al, byte_EB31
jnb short locret_D625
mov byte_EB31, 0
mov byte_EB30, 0FFh
locret_D625:
retf
sub_D5DA endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -6789,39 +6704,7 @@ include libs/master.lib/superpa[data].asm
include th02/formats/pfopen[data].asm
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
dw 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
include th04/hardware/snd_se_priority[data].asm
db 0FFh
db 0FFh
db 7Fh
@ -6919,8 +6802,7 @@ include th04/hardware/snd_load[data].asm
db 55h ; U
word_EB2C dw 2
word_EB2E dw 10h
byte_EB30 db 0FFh
byte_EB31 db 0
include th03/hardware/snd_se_state[data].asm
word_EB32 dw 0
word_EB34 dw 0
word_EB36 dw 0

View File

@ -1092,10 +1092,9 @@ loc_AE76:
push ax
push 8
call fp_10DAA
call sub_E2E6
push 1
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
pop bp
retn 4
sub_AE28 endp
@ -1173,10 +1172,9 @@ loc_AF1C:
jz loc_B02B
loc_AF2C:
call sub_E2E6
push 0Bh
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov al, byte_F3DB
cbw
mov bx, ax
@ -1376,10 +1374,9 @@ loc_B0F4:
; ---------------------------------------------------------------------------
loc_B14F:
call sub_E2E6
push 0Bh
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov byte_F447, 0
mov byte_F3DB, 4
mov byte_10DA8, 0
@ -2615,8 +2612,7 @@ loc_BB29:
jnb short loc_BB83
cmp byte ptr [si+1], 10h
jnz short loc_BB3C
push 0Fh
call sub_E2F2
call snd_se_play pascal, 15
loc_BB3C:
mov ax, [si+8]
@ -3011,7 +3007,7 @@ loc_BE66:
call far ptr palette_show
loc_BE81:
call sub_E32C
call snd_se_update
inc di
loc_BE87:
@ -5950,10 +5946,9 @@ loc_D7BB:
jz short loc_D84C
loc_D7D6:
call sub_E2E6
push 1
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
mov al, 1
sub al, byte_132B8
mov byte_132B8, al
@ -5999,10 +5994,9 @@ loc_D84C:
jz short loc_D8B2
loc_D85A:
call sub_E2E6
push 0Bh
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov al, byte_132B8
mov ah, 0
add ax, ax
@ -6110,10 +6104,9 @@ loc_D939:
mov dx, 0A4h ; '¤'
mov al, 0
out dx, al
call sub_E2E6
push 1
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
loc_D986:
test byte ptr word_11A50+1, 20h
@ -6122,10 +6115,9 @@ loc_D986:
jz short loc_D9D5
loc_D994:
call sub_E2E6
push 0Bh
call sub_E2F2
call sub_E32C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
les bx, dword_10DA4
mov al, byte_132B9
mov es:[bx+19h], al
@ -7047,91 +7039,7 @@ locret_E2E4:
retf
sub_E1E4 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_E2E6 proc far
mov byte_FD81, 0
mov byte_FD80, 0FFh
retf
sub_E2E6 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_E2F2 proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_E328
cmp byte_FD80, 0FFh
jnz short loc_E30D
mov byte_FD80, dl
retf 2
; ---------------------------------------------------------------------------
loc_E30D:
mov bl, byte_FD80
xor bh, bh
mov al, [bx+9BEh]
mov bx, dx
cmp al, [bx+9BEh]
ja short locret_E328
mov byte_FD80, dl
mov byte_FD81, 0
locret_E328:
retf 2
sub_E2F2 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_E32C proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_E377
cmp byte_FD80, 0FFh
jz short locret_E377
cmp byte_FD81, 0
jnz short loc_E359
mov al, byte_FD80
cmp snd_se_mode, SND_SE_BEEP
jz short loc_E351
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_E359
; ---------------------------------------------------------------------------
loc_E351:
xor ah, ah
push ax
call bgm_sound
loc_E359:
inc byte_FD81
mov bl, byte_FD80
xor bh, bh
mov al, [bx+9CFh]
cmp al, byte_FD81
jnb short locret_E377
mov byte_FD81, 0
mov byte_FD80, 0FFh
locret_E377:
retf
sub_E32C endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -7792,40 +7700,7 @@ include libs/master.lib/draw_trapezoid[data].asm
include th02/formats/pfopen[data].asm
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
db 0
db 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
include th04/hardware/snd_se_priority[data].asm
include th04/hardware/snd[data].asm
db 0
include th04/hardware/snd_load[data].asm
@ -7891,8 +7766,7 @@ include th04/hardware/snd_load[data].asm
db 55h ; U
word_FD7C dw 2
word_FD7E dw 10h
byte_FD80 db 0FFh
byte_FD81 db 0
include th03/hardware/snd_se_state[data].asm
word_FD82 dw 0
word_FD84 dw 0
word_FD86 dw 0

View File

@ -672,7 +672,7 @@ loc_B003:
out dx, al
mov byte_25353, al
xor byte_25352, 1
call sub_14D28
call snd_se_update
inc dword_25FDC
mov ax, word_25FE0
mov dx, ax
@ -3415,8 +3415,7 @@ loc_C4BC:
mov byte_2C979, al
mov ax, fp_23F5A
mov fp_23F58, ax
push 0Dh
call sub_14CEE
call snd_se_play pascal, 13
mov byte_2264E, 1
les bx, dword_23EF0
assume es:nothing
@ -3719,8 +3718,7 @@ loc_C777:
ja short loc_C78C
cmp byte_25FE3, 0
jnz short loc_C78C
push 9
call sub_14CEE
call snd_se_play pascal, 9
loc_C78C:
pop bp
@ -3773,8 +3771,7 @@ loc_C7D0:
loc_C7D8:
cmp byte_2429B, 80h
jnz short loc_C7F9
push 0Fh
call sub_14CEE
call snd_se_play pascal, 15
cmp byte_25FEA, 5
jz short loc_C7F2
mov byte_2CE00, 1
@ -3877,8 +3874,7 @@ loc_C87C:
mov ax, word ptr dword_2CEA0+2
mov [si+2], ax
mov word ptr [si+6], 18h
push 0Fh
call sub_14CEE
call snd_se_play pascal, 15
mov PaletteTone, 0AAh ; 'ª'
jmp short loc_C8D4
; ---------------------------------------------------------------------------
@ -4031,8 +4027,7 @@ loc_C9FD:
loc_CA05:
cmp byte_2429B, 50h ; 'P'
jnz short loc_CA26
push 0Fh
call sub_14CEE
call snd_se_play pascal, 15
cmp byte_25FEA, 5
jz short loc_CA1F
mov byte_2CE00, 1
@ -4265,8 +4260,7 @@ loc_CC20:
loc_CC28:
cmp byte_2429B, 40h
jnz short loc_CC49
push 0Fh
call sub_14CEE
call snd_se_play pascal, 15
cmp byte_25FEA, 5
jz short loc_CC42
mov byte_2CE00, 1
@ -4405,8 +4399,7 @@ loc_CD59:
idiv bx
or dx, dx
jnz short loc_CD77
push 9
call sub_14CEE
call snd_se_play pascal, 9
mov PaletteTone, 96h
jmp short loc_CD8D
; ---------------------------------------------------------------------------
@ -4475,8 +4468,7 @@ loc_CDD6:
loc_CDDE:
cmp byte_2429B, 0A0h
jnz short loc_CDFF
push 0Fh
call sub_14CEE
call snd_se_play pascal, 15
cmp byte_25FEA, 5
jz short loc_CDF8
mov byte_2CE00, 1
@ -11099,8 +11091,7 @@ loc_FC67:
cmp ax, [si+10h]
jl loc_FD13
inc byte ptr [si]
push 6
call sub_14CEE
call snd_se_play pascal, 6
jmp loc_FD13
; ---------------------------------------------------------------------------
@ -15614,8 +15605,7 @@ loc_12064:
mov al, [bp+var_1]
sub byte_2CEBE, al
nopcall sub_E4FC
push 2
call sub_14CEE
call snd_se_play pascal, 2
cmp byte_25FEC, 26h ; '&'
jbe short loc_12083
mov byte_25FEC, 26h ; '&'
@ -16743,8 +16733,7 @@ loc_1293E:
mov [bp+var_1], 5
loc_12942:
push 1
call sub_14CEE
call snd_se_play pascal, 1
jmp short loc_12955
; ---------------------------------------------------------------------------
@ -21133,11 +21122,10 @@ seg001 ends
; ===========================================================================
; Segment type: Pure code
seg002 segment byte public 'CODE' use16
seg002 segment word public 'CODE' use16
assume cs:seg002
;org 3
assume es:nothing, ss:nothing, ds:dseg, fs:nothing, gs:nothing
db 0
; =============== S U B R O U T I N E =======================================
@ -21327,91 +21315,7 @@ loc_14CDA:
retf 6
sub_14C7C endp ; sp-analysis failed
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_14CE2 proc far
mov byte_21215, 0
mov byte_21214, 0FFh
retf
sub_14CE2 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_14CEE proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_14D24
cmp byte_21214, 0FFh
jnz short loc_14D09
mov byte_21214, dl
retf 2
; ---------------------------------------------------------------------------
loc_14D09:
mov bl, byte_21214
xor bh, bh
mov al, [bx+812h]
mov bx, dx
cmp al, [bx+812h]
ja short locret_14D24
mov byte_21214, dl
mov byte_21215, 0
locret_14D24:
retf 2
sub_14CEE endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_14D28 proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_14D73
cmp byte_21214, 0FFh
jz short locret_14D73
cmp byte_21215, 0
jnz short loc_14D55
mov al, byte_21214
cmp snd_se_mode, SND_SE_BEEP
jz short loc_14D4D
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_14D55
; ---------------------------------------------------------------------------
loc_14D4D:
xor ah, ah
push ax
call bgm_sound
loc_14D55:
inc byte_21215
mov bl, byte_21214
xor bh, bh
mov al, [bx+823h]
cmp al, byte_21215
jnb short locret_14D73
mov byte_21215, 0
mov byte_21214, 0FFh
locret_14D73:
retf
sub_14D28 endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -22147,41 +22051,8 @@ include libs/master.lib/super_entry_bfnt[data].asm
include libs/master.lib/superpa[data].asm
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
dw 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
byte_21214 db 0FFh
byte_21215 db 0
include th04/hardware/snd_se_priority[data].asm
include th03/hardware/snd_se_state[data].asm
word_21216 dw 4E20h
include th05/hardware/snd_load[data].asm
include th04/hardware/snd[data].asm

File diff suppressed because it is too large Load Diff

View File

@ -1604,10 +1604,9 @@ loc_AF18:
lea ax, [bp+var_2]
push ax
call sub_A738
call sub_EAD4
push [bp+var_2]
call sub_EAE0
call sub_EB1A
call snd_se_reset
call snd_se_play pascal, [bp+var_2]
call snd_se_update
jmp short loc_AF8F ; default
; ---------------------------------------------------------------------------
@ -3447,7 +3446,7 @@ sub_BCED endp
sub_BD1E proc near
push bp
mov bp, sp
call sub_EB1A
call snd_se_update
call sub_BE76
push 1
call frame_delay
@ -4002,8 +4001,7 @@ var_1 = byte ptr -1
push si
push di
mov [bp+var_1], 0
push 0Bh
call sub_EAE0
call snd_se_play pascal, 11
mov si, 4F7Ah
xor di, di
jmp short loc_C1AF
@ -4318,8 +4316,7 @@ loc_C429:
push di
push TX_GREEN + TX_REVERSE
call sub_BCED
push 1
call sub_EAE0
call snd_se_play pascal, 1
loc_C438:
test byte ptr word_12AFA, 20h
@ -4372,22 +4369,19 @@ loc_C4A1:
mov byte ptr [bx+4F7Ah], 5
loc_C4BB:
push 4
call sub_EAE0
call snd_se_play pascal, 4
jmp short loc_C516
; ---------------------------------------------------------------------------
loc_C4C4:
push 0Bh
call sub_EAE0
call snd_se_play pascal, 11
cmp word_11622, 7
jge short loc_C516
jmp short loc_C512
; ---------------------------------------------------------------------------
loc_C4D4:
push 0Bh
call sub_EAE0
call snd_se_play pascal, 11
push si
push di
mov al, byte_15176
@ -4448,8 +4442,7 @@ loc_C555:
mov byte ptr [bx+4F7Ah], 5
loc_C56F:
push 4
call sub_EAE0
call snd_se_play pascal, 4
loc_C576:
test byte ptr word_12AFA+1, 10h
@ -8795,88 +8788,7 @@ sub_EA6E endp ; sp-analysis failed
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_EAD4 proc far
mov byte_107C1, 0
mov byte_107C0, 0FFh
retf
sub_EAD4 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_EAE0 proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_EB16
cmp byte_107C0, 0FFh
jnz short loc_EAFB
mov byte_107C0, dl
retf 2
; ---------------------------------------------------------------------------
loc_EAFB:
mov bl, byte_107C0
xor bh, bh
mov al, [bx+65Eh]
mov bx, dx
cmp al, [bx+65Eh]
ja short locret_EB16
mov byte_107C0, dl
mov byte_107C1, 0
locret_EB16:
retf 2
sub_EAE0 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_EB1A proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_EB65
cmp byte_107C0, 0FFh
jz short locret_EB65
cmp byte_107C1, 0
jnz short loc_EB47
mov al, byte_107C0
cmp snd_se_mode, SND_SE_BEEP
jz short loc_EB3F
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_EB47
; ---------------------------------------------------------------------------
loc_EB3F:
xor ah, ah
push ax
call bgm_sound
loc_EB47:
inc byte_107C1
mov bl, byte_107C0
xor bh, bh
mov al, [bx+66Fh]
cmp al, byte_107C1
jnb short locret_EB65
mov byte_107C1, 0
mov byte_107C0, 0FFh
locret_EB65:
retf
sub_EB1A endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -9991,39 +9903,7 @@ include libs/master.lib/super_entry_bfnt[data].asm
include libs/master.lib/superpa[data].asm
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
dw 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
include th04/hardware/snd_se_priority[data].asm
word_10780 dw 71h
dw 6Bh
dw 78h
@ -10076,8 +9956,7 @@ word_1078C dw 19h
db 55h ; U
word_107BC dw 2
word_107BE dw 10h
byte_107C0 db 0FFh
byte_107C1 db 0
include th03/hardware/snd_se_state[data].asm
word_107C2 dw 0
word_107C4 dw 0
word_107C6 dw 0

View File

@ -996,10 +996,9 @@ loc_A9B6:
push ax
push 0Eh
call fp_11DD2
call sub_D5F6
push 1
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
pop bp
retn 4
sub_A968 endp
@ -1077,10 +1076,9 @@ loc_AA5C:
jz loc_ABA8
loc_AA6C:
call sub_D5F6
push 0Bh
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov al, byte_F071
cbw
mov bx, ax
@ -1293,10 +1291,9 @@ loc_AC71:
; ---------------------------------------------------------------------------
loc_ACD8:
call sub_D5F6
push 0Bh
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
mov byte_F0DD, 0
mov byte_F071, 4
mov byte_11DD0, 0
@ -2559,8 +2556,7 @@ loc_B6FA:
jnb short loc_B754
cmp byte ptr [si+1], 10h
jnz short loc_B70D
push 0Fh
call sub_D602
call snd_se_play pascal, 15
loc_B70D:
mov ax, [si+8]
@ -2953,7 +2949,7 @@ loc_BA26:
call far ptr palette_show
loc_BA41:
call sub_D63C
call snd_se_update
inc di
loc_BA47:
@ -5714,10 +5710,9 @@ loc_D1B5:
jz short loc_D223
loc_D1D0:
call sub_D5F6
push 1
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
mov dx, 0A6h ; '¦'
mov al, 1
out dx, al
@ -5748,10 +5743,9 @@ loc_D223:
jz short loc_D284
loc_D231:
call sub_D5F6
push 1
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 1
call snd_se_update
mov dx, 0A6h ; '¦'
mov al, 1
out dx, al
@ -5787,10 +5781,9 @@ loc_D292:
mov bx, ax
cmp byte ptr [bx+5143h], 0
jz short loc_D2CC
call sub_D5F6
push 0Bh
call sub_D602
call sub_D63C
call snd_se_reset
call snd_se_play pascal, 11
call snd_se_update
les bx, dword_11DCC
mov al, byte ptr word_14118
mov es:[bx+14h], al
@ -6187,91 +6180,7 @@ loc_D5EE:
retf 6
sub_D590 endp ; sp-analysis failed
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D5F6 proc far
mov byte_F9C3, 0
mov byte_F9C2, 0FFh
retf
sub_D5F6 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D602 proc far
mov bx, sp
mov dx, ss:[bx+4]
cmp snd_se_mode, SND_SE_OFF
jz short locret_D638
cmp byte_F9C2, 0FFh
jnz short loc_D61D
mov byte_F9C2, dl
retf 2
; ---------------------------------------------------------------------------
loc_D61D:
mov bl, byte_F9C2
xor bh, bh
mov al, [bx+980h]
mov bx, dx
cmp al, [bx+980h]
ja short locret_D638
mov byte_F9C2, dl
mov byte_F9C3, 0
locret_D638:
retf 2
sub_D602 endp
; ---------------------------------------------------------------------------
nop
; =============== S U B R O U T I N E =======================================
sub_D63C proc far
cmp snd_se_mode, SND_SE_OFF
jz short locret_D687
cmp byte_F9C2, 0FFh
jz short locret_D687
cmp byte_F9C3, 0
jnz short loc_D669
mov al, byte_F9C2
cmp snd_se_mode, SND_SE_BEEP
jz short loc_D661
mov ah, PMD_SE_PLAY
int 60h ; - Banyan VINES, 3com - GET STATION ADDRESS
; Return: AL = status, 00h successful, ES:SI -> 6-byte station address
; 02h semaphore service is unavailable
jmp short loc_D669
; ---------------------------------------------------------------------------
loc_D661:
xor ah, ah
push ax
call bgm_sound
loc_D669:
inc byte_F9C3
mov bl, byte_F9C2
xor bh, bh
mov al, [bx+991h]
cmp al, byte_F9C3
jnb short locret_D687
mov byte_F9C3, 0
mov byte_F9C2, 0FFh
locret_D687:
retf
sub_D63C endp
include th04/hardware/snd_se.asm
; =============== S U B R O U T I N E =======================================
@ -8022,40 +7931,7 @@ include libs/master.lib/respal_exist[data].asm
include libs/master.lib/draw_trapezoid[data].asm
include libs/master.lib/bgm_timerhook[data].asm
include libs/master.lib/bgm[data].asm
db 0
db 0
db 20h
db 10h
db 2
db 12h
db 12h
db 40h
db 10h
db 11h
db 2
db 12h
db 20h
db 20h
db 20h
db 20h
db 0
db 0
db 0
db 24h ; $
db 10h
db 4
db 10h
db 8
db 30h ; 0
db 50h ; P
db 11h
db 4
db 0Bh
db 50h ; P
db 50h ; P
db 50h ; P
db 20h
db 0
include th04/hardware/snd_se_priority[data].asm
db 71h ; q
db 0
db 6Bh ; k
@ -8118,8 +7994,7 @@ include libs/master.lib/bgm[data].asm
db 55h ; U
word_F9BE dw 2
word_F9C0 dw 10h
byte_F9C2 db 0FFh
byte_F9C3 db 0
include th03/hardware/snd_se_state[data].asm
word_F9C4 dw 0
word_F9C6 dw 0
word_F9C8 dw 0