Skip to content

Commit

Permalink
Build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokechu22 committed Dec 29, 2024
1 parent 798c982 commit 612ed10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Source/Core/Core/HW/WII_IPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ void WiiIPC::Shutdown()
{
}

static u32 ReadGPIOIn(Core::System& system)
u32 WiiIPC::ReadGPIOIn()
{
Common::Flags<GPIO> 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;
Expand All @@ -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)
Expand Down Expand Up @@ -389,7 +389,8 @@ void WiiIPC::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
wii_ipc.GPIOOutChanged(old_out);
}));
mmio->Register(base | GPIOB_IN, MMIO::ComplexRead<u32>([](Core::System& system, u32) {
return ReadGPIOIn(system);
auto& wii_ipc = system.GetWiiIPC();
return wii_ipc.ReadGPIOIn();
}),
MMIO::Nop<u32>());
// Starlet GPIO registers, not normally accessible by PPC (but they can be depending on how
Expand Down Expand Up @@ -420,7 +421,8 @@ void WiiIPC::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
wii_ipc.GPIOOutChanged(old_out);
}));
mmio->Register(base | GPIO_IN, MMIO::ComplexRead<u32>([](Core::System& system, u32) {
return ReadGPIOIn(system);
auto& wii_ipc = system.GetWiiIPC();
return wii_ipc.ReadGPIOIn();
}),
MMIO::Nop<u32>());

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/HW/WII_IPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class WiiIPC

static void UpdateInterruptsCallback(Core::System& system, u64 userdata, s64 cycles_late);
void UpdateInterrupts();
u32 ReadGPIOIn();
u32 GetGPIOOut();
void GPIOOutChanged(u32 old_value_hex);

Expand Down

0 comments on commit 612ed10

Please sign in to comment.