From 612ed106cdab011b72228fcb7a0bb29bae607320 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 3 Sep 2023 16:01:01 -0700 Subject: [PATCH] Build fix --- Source/Core/Core/HW/WII_IPC.cpp | 12 +++++++----- Source/Core/Core/HW/WII_IPC.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/WII_IPC.cpp b/Source/Core/Core/HW/WII_IPC.cpp index ce6e8b9b89..15e0c25bd9 100644 --- a/Source/Core/Core/HW/WII_IPC.cpp +++ b/Source/Core/Core/HW/WII_IPC.cpp @@ -290,10 +290,10 @@ void WiiIPC::Shutdown() { } -static u32 ReadGPIOIn(Core::System& system) +u32 WiiIPC::ReadGPIOIn() { Common::Flags gpio_in; - gpio_in[GPIO::SLOT_IN] = system.GetDVDInterface().IsDiscInside(); + gpio_in[GPIO::SLOT_IN] = m_system.GetDVDInterface().IsDiscInside(); gpio_in[GPIO::AVE_SCL] = i2c_state.GetSCL(); gpio_in[GPIO::AVE_SDA] = i2c_state.GetSDA(); return gpio_in.m_hex; @@ -306,7 +306,7 @@ u32 WiiIPC::GetGPIOOut() // In practice this means that (at least for the AVE I²C pins) a 1 is output when the pin is an // input. (RVLoader depends on this.) // https://github.com/Aurelio92/RVLoader/blob/75732f248019f589deb1109bba7b5323a8afaadf/source/i2c.c#L101-L109 - return (m_gpio_out.m_hex | ~(m_gpio_dir.m_hex)) & (ReadGPIOIn(m_system) | m_gpio_dir.m_hex); + return (m_gpio_out.m_hex | ~(m_gpio_dir.m_hex)) & (ReadGPIOIn() | m_gpio_dir.m_hex); } void WiiIPC::GPIOOutChanged(u32 old_value_hex) @@ -389,7 +389,8 @@ void WiiIPC::RegisterMMIO(MMIO::Mapping* mmio, u32 base) wii_ipc.GPIOOutChanged(old_out); })); mmio->Register(base | GPIOB_IN, MMIO::ComplexRead([](Core::System& system, u32) { - return ReadGPIOIn(system); + auto& wii_ipc = system.GetWiiIPC(); + return wii_ipc.ReadGPIOIn(); }), MMIO::Nop()); // Starlet GPIO registers, not normally accessible by PPC (but they can be depending on how @@ -420,7 +421,8 @@ void WiiIPC::RegisterMMIO(MMIO::Mapping* mmio, u32 base) wii_ipc.GPIOOutChanged(old_out); })); mmio->Register(base | GPIO_IN, MMIO::ComplexRead([](Core::System& system, u32) { - return ReadGPIOIn(system); + auto& wii_ipc = system.GetWiiIPC(); + return wii_ipc.ReadGPIOIn(); }), MMIO::Nop()); diff --git a/Source/Core/Core/HW/WII_IPC.h b/Source/Core/Core/HW/WII_IPC.h index e3e4ee5575..23a67e0eb5 100644 --- a/Source/Core/Core/HW/WII_IPC.h +++ b/Source/Core/Core/HW/WII_IPC.h @@ -140,6 +140,7 @@ private: static void UpdateInterruptsCallback(Core::System& system, u64 userdata, s64 cycles_late); void UpdateInterrupts(); + u32 ReadGPIOIn(); u32 GetGPIOOut(); void GPIOOutChanged(u32 old_value_hex);