Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PC, mGBA 0.9.2] Audio clipping in Donkey Kong Country 3 (caused by misaligned 32-bit loading against SOUNDBIAS) #2307

Closed
gocha opened this issue Sep 14, 2021 · 2 comments

Comments

@gocha
Copy link

gocha commented Sep 14, 2021

Expected Behavior

dkc3-expected

Waveform of the song "Chase".

Tip: You can access the in-game music player by entering "MUSIC" in the Cheats screen.

Current Behavior

dkc3-actual

The upper part of the waveform is unnaturally compressed.

  • Version: 0.9.2

Additional Context

From the I/O Viewer, I can see that the SOUNDBIAS is set to 0x4300. Changing the Bias value from 768 to 512 will eliminate the problem. The SOUNDBIAS is modified by the following code.

LDR    R0, =(REG_SOUNDBIAS+1)
LDR    R1, [R0]  ; Misaligned 32-bit load, mGBA reads a meaningless value 0x91439143
MOVS   R2, #0xC0
BICS   R1, R2    ; Clear the resolution
MOVS   R2, #0x40
ORRS   R1, R2    ; Set the resolution to 1
STRB   R1, [R0]  ; Therefore, 0x43 is stored
@gocha gocha changed the title Audio clipping in Donkey Kong Country 3 (caused by misaligned 32-bit loading against SOUNDBIAS) [PC, mGBA 0.9.2] Audio clipping in Donkey Kong Country 3 (caused by misaligned 32-bit loading against SOUNDBIAS) Sep 14, 2021
@endrift
Copy link
Member

endrift commented Sep 14, 2021

Good catch, thanks.

@gocha
Copy link
Author

gocha commented Sep 14, 2021

@endrift Thank you. Maybe I should have mentioned that the output I expect is not come from real hardware. Please verify if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants