summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2024-03-24 11:59:32 -0700
committerPokechu22 <Pokechu022@gmail.com>2024-03-24 11:59:32 -0700
commitcd5f6ddd9bb2fdb2a3e719340605372b966d5991 (patch)
treea3bebbda598783a8d3dd70763dac77bcbbe10232 /Source/Core
parentc85f5f802315d4de94efba1f6937eb9ed1709579 (diff)
DSPHLE: Implement 2024 libasnd uCodes
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/DSPHLE/UCodes/ASnd.cpp5
-rw-r--r--Source/Core/Core/HW/DSPHLE/UCodes/ASnd.h10
-rw-r--r--Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp2
3 files changed, 15 insertions, 2 deletions
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.cpp
index ee8345cb17..ad694e162c 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.cpp
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.cpp
@@ -64,7 +64,8 @@ bool ASndUCode::SwapLeftRight() const
bool ASndUCode::UseNewFlagMasks() const
{
return m_crc == HASH_2011 || m_crc == HASH_2020 || m_crc == HASH_2020_PAD ||
- m_crc == HASH_DESERT_BUS_2011 || m_crc == HASH_DESERT_BUS_2012;
+ m_crc == HASH_DESERT_BUS_2011 || m_crc == HASH_DESERT_BUS_2012 || m_crc == HASH_2024 ||
+ m_crc == HASH_2024_PAD;
}
ASndUCode::ASndUCode(DSPHLE* dsphle, u32 crc) : UCodeInterface(dsphle, crc)
@@ -403,7 +404,7 @@ void ASndUCode::DoMixing(u32 return_mail)
if (SwapLeftRight())
{
// Most versions of the ASnd ucode have the right channel come before the left channel.
- // The Desert Bus versions swapped the left and right input channels so that left
+ // The Desert Bus and 2024 versions swapped the left and right input channels so that left
// comes first, and then right, matching mp3/ogg files.
std::swap(new_r, new_l);
}
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.h b/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.h
index faec4c2151..159471d416 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.h
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/ASnd.h
@@ -60,6 +60,16 @@ public:
// instructions were added to the start, which do not change behavior in any way. Padded to 0x0620
// bytes.
static constexpr u32 HASH_DESERT_BUS_2012 = 0x614dd145;
+ // March 22, 2024 version (0x0606 bytes) - libogc fixed left and right channels being reversed,
+ // which apparently has been the case from the start but was not obvious in earlier testing
+ // because of the oggplayer sample using a mono sound file.
+ // https://github.com/devkitPro/libogc/commit/a0b4b5680944ee7c2ae1b7af63a721623c1a6b69
+ static constexpr u32 HASH_2024 = 0x5dbf8bf1;
+ // March 22, 2024 version (padded to 0x0620 bytes) - same as above, but padded as it's used by
+ // libogc2 and libogc-rice.
+ // https://github.com/extremscorner/libogc2/commit/f3fd10635d4b3fbc6ee03cec335eeb2a2237fd56
+ // https://github.com/extremscorner/libogc-rice/commit/5ebbf8b96d7433bc2af9e882f730e67a5eb20f00
+ static constexpr u32 HASH_2024_PAD = 0x373a950e;
private:
void DMAInVoiceData();
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
index 206624313e..7617c0088b 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp
@@ -293,6 +293,8 @@ std::unique_ptr<UCodeInterface> UCodeFactory(u32 crc, DSPHLE* dsphle, bool wii)
case ASndUCode::HASH_2020_PAD:
case ASndUCode::HASH_DESERT_BUS_2011:
case ASndUCode::HASH_DESERT_BUS_2012:
+ case ASndUCode::HASH_2024:
+ case ASndUCode::HASH_2024_PAD:
INFO_LOG_FMT(DSPHLE, "CRC {:08x}: ASnd chosen (Homebrew)", crc);
return std::make_unique<ASndUCode>(dsphle, crc);