From 951a84833a87acb79bd39c141a98cb96d88604be Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Thu, 27 Feb 2025 21:38:59 +0000 Subject: [PATCH] EXI: fix AD16 The GameCube IPL is now able to detect this device. However, this triggers some memory clearing code that trips up Dolphin's I$. --- Source/Core/Core/HW/EXI/EXI_DeviceAD16.cpp | 4 +++- Source/Core/Core/HW/EXI/EXI_DeviceAD16.h | 2 +- Source/Core/Core/State.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceAD16.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceAD16.cpp index 9172df5041..397679bcb7 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceAD16.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceAD16.cpp @@ -6,6 +6,7 @@ #include "Common/Assert.h" #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" +#include "Common/Swap.h" namespace ExpansionInterface { @@ -36,7 +37,7 @@ void CEXIAD16::TransferByte(u8& byte) { case init: { - m_ad16_register.U32 = 0x04120000; + m_ad16_register.U32 = Common::swap32(0x04120000); switch (m_position) { case 1: @@ -73,6 +74,7 @@ void CEXIAD16::TransferByte(u8& byte) break; case 4: m_ad16_register.U8[3] = byte; + INFO_LOG_FMT(EXPANSIONINTERFACE, "AD16 received: 0x{:08X}", m_ad16_register.U32); break; } } diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceAD16.h b/Source/Core/Core/HW/EXI/EXI_DeviceAD16.h index 4e64c9519d..a1e088e6ab 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceAD16.h +++ b/Source/Core/Core/HW/EXI/EXI_DeviceAD16.h @@ -28,7 +28,7 @@ private: union AD16Reg { u32 U32 = 0; - u32 U8[4]; + u8 U8[4]; }; // STATE_TO_SAVE diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index a244fda1b6..bbbe71c71c 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -99,7 +99,7 @@ static size_t s_state_writes_in_queue; static std::condition_variable s_state_write_queue_is_empty; // Don't forget to increase this after doing changes on the savestate system -constexpr u32 STATE_VERSION = 171; // Last changed in PR 13416 +constexpr u32 STATE_VERSION = 172; // Last changed in PR 13385 // Increase this if the StateExtendedHeader definition changes constexpr u32 EXTENDED_HEADER_VERSION = 1; // Last changed in PR 12217