summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Boot/Boot_BS2Emu.cpp7
-rw-r--r--Source/Core/Core/HW/DVD/DVDInterface.cpp9
2 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
index baf2079677..884a11bd87 100644
--- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp
+++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
@@ -227,6 +227,13 @@ bool CBoot::RunApploader(Core::System& system, const Core::CPUThreadGuard& guard
ppc_state.pc = ppc_state.gpr[3];
branch_watch.SetRecordingActive(guard, resume_branch_watch);
+ // Blank out session key (https://debugmo.de/2008/05/part-2-dumping-the-media-board/)
+ if (volume.GetVolumeType() == DiscIO::Platform::Triforce)
+ {
+ auto& memory = system.GetMemory();
+
+ memory.Memset(0, 0, 12);
+ }
return true;
}
diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp
index babb500902..f6e7954b02 100644
--- a/Source/Core/Core/HW/DVD/DVDInterface.cpp
+++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp
@@ -753,6 +753,15 @@ void DVDInterface::ExecuteCommand(ReplyType reply_type)
DIInterruptType interrupt_type = DIInterruptType::TCINT;
bool command_handled_by_thread = false;
+ // Swaps endian of Triforce DI commands, and zeroes out random bytes to prevent unknown read
+ // subcommand errors
+ auto& dvd_thread = m_system.GetDVDThread();
+ if (dvd_thread.GetDiscType() == DiscIO::Platform::Triforce)
+ {
+ // TODO(C++23): Use std::byteswap and a bitwise AND for increased clarity
+ m_DICMDBUF[0] <<= 24;
+ }
+
// DVDLowRequestError needs access to the error code set by the previous command
if (static_cast<DICommand>(m_DICMDBUF[0] >> 24) != DICommand::RequestError)
SetDriveError(DriveError::None);