Skip to content

Commit

Permalink
refs ignore SNESAPU.DLL
Browse files Browse the repository at this point in the history
* DSP_ALIGN を変数化
* 音量が 0x80 のとき、サラウンド関連オプションが正常に動作しない不具合修正
  • Loading branch information
dgrfactory committed Nov 29, 2024
1 parent e271ade commit 0600043
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 18 deletions.
66 changes: 50 additions & 16 deletions snesapu.dll/DSP.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1812,20 +1812,26 @@ USES ECX,EBX
XChg AL,DL
.NoReverse:

Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH
MovSX EAX,AL

Mov DH,DL
And DH,[surroff]
Test DL,[surroff]
SetZ DH
Dec DH
XOr DL,DH
Sub DL,DH
Mov DH,[surroff]
Cmp DX,8080h
SetE DH
Sub DL,DH
MovSX EDX,DL

LEA EBX,[EBX*8+mix]
Expand Down Expand Up @@ -2723,12 +2729,15 @@ ResetKON:

%if STEREO=0
RVolL:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand All @@ -2742,12 +2751,15 @@ RVolL:
Ret

RVolR:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand Down Expand Up @@ -2868,12 +2880,15 @@ RGain:
;Main volumes

RMVolL:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand All @@ -2887,14 +2902,22 @@ RMVolL:
Ret

RMVolR:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH

XOr AL,[surround]
Sub AL,[surround]
Cmp AL,80h
SetE AH
And AH,[surround]
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand All @@ -2908,12 +2931,15 @@ RMVolR:
Ret

REVolL:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand All @@ -2927,14 +2953,22 @@ REVolL:
Ret

REVolR:
Mov AH,AL
And AH,[surroff]
Test AL,[surroff]
SetZ AH
Dec AH
XOr AL,AH
Sub AL,AH
Mov AH,[surroff]
Cmp AX,8080h
SetE AH
Sub AL,AH

XOr AL,[surround]
Sub AL,[surround]
Cmp AL,80h
SetE AH
And AH,[surround]
Sub AL,AH
MovSX EAX,AL

Mov [ESP-4],EAX
Expand Down
2 changes: 1 addition & 1 deletion snesapu.dll/SNESAPU.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
; If it is not, the output audio will be noisy because occurred memory-leak and
; buffer-overflow.
; The value specified here is 0, 64, 128, or 192.
DSP_ALIGN EQU 0 ;DSP Object Locate Alignment
DSP_ALIGN EQU $DSP_ALIGN ;DSP Object Locate Alignment
2 changes: 1 addition & 1 deletion snesapu.dll/thirdparty/SNESAPU.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
; If it is not, the output audio will be noisy because occurred memory-leak and
; buffer-overflow.
; The value specified here is 0, 64, 128, or 192.
DSP_ALIGN EQU 0 ;DSP Object Locate Alignment
DSP_ALIGN EQU $DSP_ALIGN ;DSP Object Locate Alignment

0 comments on commit 0600043

Please sign in to comment.