From a5e2a0d97307ef146879a6f46a86d728a3ac2e97 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Mon, 16 Aug 2021 22:15:19 -0700 Subject: [PATCH] dsp_rom: Remove illegal use of AX with SRS --- Data/Sys/GC/dsp_rom.bin | Bin 8192 -> 8192 bytes Source/Core/Core/DSP/DSPCore.cpp | 39 +++++++++++++---------- docs/DSP/free_dsp_rom/dsp_rom.ds | 18 +++++------ docs/DSP/free_dsp_rom/dsp_rom_readme.txt | 10 ++++++ 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/Data/Sys/GC/dsp_rom.bin b/Data/Sys/GC/dsp_rom.bin index 34a454df859619825d7269ea2c0f8a31a9edd9a7..a4895bd176a29dfabcbb1b10c95976ee24886648 100644 GIT binary patch delta 129 zcmZp0XmFU&%Xng9UxzTmum9&5e*8Z#c9MaS;rIWu3_t%*R%CRXoW;nie1eZb?<7nC zRPr>_{swpX<4g|!|1(W(xH)+eqX`Ss{>Go1uP}-*O@7AA$Hu@ZsL;f^`3Ex><7O7t acg!p@>N07Q1z5gp7T}Cw+3d!*OAr7@fi^<` delta 122 zcmZp0XmFU&%XnmBUx$#^IgRsTCm9&E&uX4#+TY;LbbsPPr^#82ywXSb81znpq+wF> z$C(`d|7V)oaCP!5Mw5vfIM|r>H~wVc+ known_roms = {{ + static const std::array known_roms = {{ // Official Nintendo ROM {0x66f334fe, 0xf3b93527}, @@ -52,6 +52,9 @@ static bool VerifyRoms(const SDSP& dsp) // above with fix to skip bootucode_ax when running from ROM entrypoint {0x128ea7a2, 0xa4a575f5}, + + // above with fixes for invalid use of SRS instruction + {0xe789b5a5, 0xa4a575f5}, }}; const u32 hash_irom = @@ -69,28 +72,30 @@ static bool VerifyRoms(const SDSP& dsp) if (rom_idx < 0) { - if (AskYesNoFmtT("Your DSP ROMs have incorrect hashes.\n" + if (AskYesNoFmtT("Your DSP ROMs have incorrect hashes.\n\n" + "Delete the dsp_rom.bin and dsp_coef.bin files in the GC folder in the Global " + "User Directory to use the free DSP ROM, or replace them with good dumps from " + "a real GameCube/Wii.\n\n" "Would you like to stop now to fix the problem?\n" "If you select \"No\", audio might be garbled.")) + { return false; + } } - if (rom_idx == 1) + if (rom_idx >= 1 && rom_idx <= 5) { - Host::OSD_AddMessage("You are using an old free DSP ROM made by the Dolphin Team.", 6000); - Host::OSD_AddMessage("Only games using the Zelda UCode will work correctly.", 6000); - } - else if (rom_idx == 2 || rom_idx == 3) - { - Host::OSD_AddMessage("You are using a free DSP ROM made by the Dolphin Team.", 8000); - Host::OSD_AddMessage("All Wii games will work correctly, and most GameCube games", 8000); - Host::OSD_AddMessage("should also work fine, but the GBA/CARD UCodes will not work.", 8000); - } - else if (rom_idx == 4) - { - Host::OSD_AddMessage("You are using a free DSP ROM made by the Dolphin Team.", 8000); - Host::OSD_AddMessage("All Wii games will work correctly, and most GameCube games", 8000); - Host::OSD_AddMessage("should also work fine, but the CARD UCode will not work.", 8000); + if (AskYesNoFmtT( + "You are using an old free DSP ROM made by the Dolphin Team.\n" + "Due to emulation accuracy improvements, this ROM no longer works correctly.\n\n" + "Delete the dsp_rom.bin and dsp_coef.bin files in the GC folder in the Global " + "User Directory to use the most recent free DSP ROM, or replace them with " + "good dumps from a real GameCube/Wii.\n\n" + "Would you like to stop now to fix the problem?\n" + "If you select \"No\", audio might be garbled.")) + { + return false; + } } return true; diff --git a/docs/DSP/free_dsp_rom/dsp_rom.ds b/docs/DSP/free_dsp_rom/dsp_rom.ds index 5106836658..7ee9b5c5d8 100644 --- a/docs/DSP/free_dsp_rom/dsp_rom.ds +++ b/docs/DSP/free_dsp_rom/dsp_rom.ds @@ -86,11 +86,11 @@ WARNPC 0x8b ORG 0x8b ; called by GBA ucode dram_to_cpu: - srs @DSMAH, $AX0.H - srs @DSMAL, $AX0.L + sr @DSMAH, $AX0.H + sr @DSMAL, $AX0.L si @DSCR, #0x1 - srs @DSPA, $AX1.H - srs @DSBL, $AX1.L + sr @DSPA, $AX1.H + sr @DSBL, $AX1.L call wait_dma+#IROM_BASE ret @@ -108,11 +108,11 @@ ORG 0xbc ; called by GBA ucode bootucode_ax: lris $AC0.M, #0 - srs @DSCR, $AC0.M - srs @DSMAH, $AX0.H - srs @DSMAL, $AX0.L - srs @DSPA, $AX1.H - srs @DSBL, $AX1.L + srs @DSCR, $AC0.M + sr @DSMAH, $AX0.H + sr @DSMAL, $AX0.L + sr @DSPA, $AX1.H + sr @DSBL, $AX1.L call wait_dma+#IROM_BASE bootucode_ix: diff --git a/docs/DSP/free_dsp_rom/dsp_rom_readme.txt b/docs/DSP/free_dsp_rom/dsp_rom_readme.txt index e43fa4084f..65eb69b274 100644 --- a/docs/DSP/free_dsp_rom/dsp_rom_readme.txt +++ b/docs/DSP/free_dsp_rom/dsp_rom_readme.txt @@ -1,3 +1,13 @@ +Legal GC/WII DSP IROM replacement (v0.4) +------------------------------------------------------- + +- irom: Minor accuracy and documentation improvements +- irom: Remove use of SRS instruction with AX registers, as those instructions + do not actually exist + +Tilka, Pokechu22 +17/aug/2021 + Legal GC/WII DSP IROM replacement (v0.3.1) -------------------------------------------------------