dolphin/Source/Core/Core
smurf3tte c2da12ca75 DSP: Fix write masks on AUDIO_*/AR_* MMIO registers
https://bugs.dolphin-emu.org/issues/6749

This change fixes the scratchy audio in Teenage Mutant Ninja Turtles (SX7E52/SX7P52). The game starts an audio interface DMA with an unaligned address, and because Dolphin was not masking off the low 5 bits of AUDIO_DMA_START_LO, all future AI DMAs were misaligned. To understand why, it is instructive to refer to AUDIO_InitDMA() in libogc, which behaves the same as the official SDK:

_dspReg[25] = (_dspReg[25]&~0xffe0)|(startaddr&0xffff);

The implementation does not mask off the low bits of the passed in value before it ORs them with low bits of the current register value. Therefore, if they are not masked off by the hardware itself, they become permanently stuck once set.

Adding a write mask for AUDIO_DMA_START_LO is enough to fix the bug in TMNT, but I decided to run some tests on GC and Wii to find the correct write masks for the surrounding registers, as only a couple were already being masked. Dolphin has gotten away with not masking the rest because many are already A) masked on read (or never read) by the SDK and/or B) masked on use (or never used) in Dolphin.

This leaves just three registers where the difference may be observable: AR_DMA_CNT_H and AUDIO_DMA_START_HI/LO.
2020-12-30 01:34:48 -08:00
..
Boot Core: Convert missed log calls over to fmt 2020-11-23 12:20:02 -05:00
Config Store pointers in Config::SYSCONF_SETTINGS 2020-12-11 19:54:16 +01:00
ConfigLoaders Store pointers in Config::SYSCONF_SETTINGS 2020-12-11 19:54:16 +01:00
Debugger Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
DSP DSP: Fix one DEBUG_LOG call 2020-11-20 16:21:05 +01:00
FifoPlayer Core: Convert logging over to fmt pt.2 2020-11-20 10:05:44 -05:00
HLE Core: Convert logging over to fmt pt.2 2020-11-20 10:05:44 -05:00
HW DSP: Fix write masks on AUDIO_*/AR_* MMIO registers 2020-12-30 01:34:48 -08:00
IOS Add NetBSD support 2020-12-15 02:34:25 +01:00
PowerPC Jit64: Fix FPURegCache::GetRegUtilization 2020-12-21 18:02:43 +01:00
ActionReplay.cpp Core: Don't copy default _Enabled sections to user INIs 2020-12-11 15:38:11 +01:00
ActionReplay.h Core: Save the disabling of default enabled codes 2020-12-11 10:08:20 +01:00
Analytics.cpp Analytics: Add rarer OSes to analytics 2020-12-20 22:32:07 +00:00
Analytics.h Analytics: Add quirk for mismatched xf/bp texgens/colors 2020-04-02 12:52:16 +10:00
ARDecrypt.cpp Core: Convert missed log calls over to fmt 2020-11-23 12:20:02 -05:00
ARDecrypt.h Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
BootManager.cpp Store pointers in Config::SYSCONF_SETTINGS 2020-12-11 19:54:16 +01:00
BootManager.h Add /dev/dolphin for homebrew to get information about Dolphin 2019-11-09 15:31:51 +01:00
CheatCodes.h Core: Allow overriding the enabling of a code 2020-12-11 10:02:14 +01:00
CMakeLists.txt Core: Add initial System class 2020-12-19 23:22:06 -05:00
CommonTitles.h Include the Korean Wii Shop Channel when checking default credentials 2018-09-15 17:28:23 +02:00
ConfigManager.cpp Add Fallback Region to configuration menu 2020-11-28 15:40:21 -05:00
ConfigManager.h Android: Don't show game ID after game title 2020-10-21 20:02:52 +02:00
Core.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
Core.h Android: Fix rotating EmulationActivity after boot fails 2020-11-09 10:38:49 +01:00
Core.vcxproj Core: Add initial System class 2020-12-19 23:22:06 -05:00
Core.vcxproj.filters Core: Add initial System class 2020-12-19 23:22:06 -05:00
CoreTiming.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
CoreTiming.h Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
DSPEmulator.cpp DSPEmulator: Default destructor in the cpp file 2018-05-29 07:54:39 -04:00
DSPEmulator.h DSPEmulator: Make the IsLLE() member function const-qualified 2018-05-29 17:45:07 -04:00
GeckoCode.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
GeckoCode.h Core: Save the disabling of default enabled codes 2020-12-11 10:08:20 +01:00
GeckoCodeConfig.cpp Core: Don't copy default _Enabled sections to user INIs 2020-12-11 15:38:11 +01:00
GeckoCodeConfig.h Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Host.h Remove unused function Host_UpdateProgressDialog 2020-04-03 12:53:38 +02:00
HotkeyManager.cpp Add a Skip EFB Access from CPU Hotkey 2020-10-29 21:03:06 -03:00
HotkeyManager.h Add a Skip EFB Access from CPU Hotkey 2020-10-29 21:03:06 -03:00
LibusbUtils.cpp Use separate libusb contexts to avoid thread safety issues 2019-06-26 17:55:51 +02:00
LibusbUtils.h Use separate libusb contexts to avoid thread safety issues 2019-06-26 17:55:51 +02:00
MachineContext.h Add support for FreeBSD/arm64 2020-08-27 21:54:04 +01:00
MemoryWatcher.cpp MemoryWatcher: Do not follow invalid pointers 2020-08-30 10:29:40 +02:00
MemoryWatcher.h Step MemoryWatcher at end of each video frame. 2019-05-08 11:20:59 +01:00
MemTools.cpp Add NetBSD support 2020-12-15 02:34:25 +01:00
MemTools.h Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Movie.cpp Movie: Fix 83b9fef regressions 2020-11-28 23:35:55 +01:00
Movie.h Movie: Fix 83b9fef regressions 2020-11-28 23:35:55 +01:00
NetPlayClient.cpp Core: Allow overriding the enabling of a code 2020-12-11 10:02:14 +01:00
NetPlayClient.h Core/NetPlay: Fix Wii Remote syncing. 2020-09-27 13:10:19 -05:00
NetPlayProto.h Core/NetPlay: Fix Wii Remote syncing. 2020-09-27 13:10:19 -05:00
NetPlayServer.cpp Core: Convert missed log calls over to fmt 2020-11-23 12:20:02 -05:00
NetPlayServer.h Make netplay's "same game" check more robust 2020-08-02 22:46:53 +02:00
PatchEngine.cpp Core: Save the disabling of default enabled codes 2020-12-11 10:08:20 +01:00
PatchEngine.h Core: Save the disabling of default enabled codes 2020-12-11 10:08:20 +01:00
State.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
State.h Android: Show how long ago each savestate was created 2020-10-21 22:49:59 +02:00
SyncIdentifier.h Make netplay's "same game" check more robust 2020-08-02 22:46:53 +02:00
SysConf.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
SysConf.h Common/Core: Minor rvalue reference related cleanups. 2020-01-23 22:58:23 -06:00
System.cpp Core: Add initial System class 2020-12-19 23:22:06 -05:00
System.h Core: Add initial System class 2020-12-19 23:22:06 -05:00
TitleDatabase.cpp Core: Replace usages of StringFromFormat with fmt where applicable 2019-11-11 07:32:57 -05:00
TitleDatabase.h TitleDatabase: Don't merge multiple languages into same map 2019-02-25 19:55:46 +01:00
WiiRoot.cpp Core: Convert logging over to fmt pt. 1 2020-11-19 14:21:06 -05:00
WiiRoot.h Back up Wii setting.txt and SYSCONF while emulating 2020-03-16 21:04:19 +01:00
WiiUtils.cpp WiiUtils: Check hashes to determine if a title is installed and up-to-date 2020-12-06 01:53:55 +01:00
WiiUtils.h DiscIO: Merge WiiWAD into VolumeWAD 2019-07-18 22:29:04 +02:00