This commit is contained in:
Pokechu22 2022-08-09 12:22:56 -07:00
parent 25e31d121b
commit 2ef84a46db

View File

@ -287,14 +287,9 @@ void WiiIPC::GPIOOutChanged(u32 old_value_hex)
}
// I²C logic for the audio/video encoder (AVE)
if (true || m_gpio_dir[GPIO::AVE_SCL])
{
if (old_value[GPIO::AVE_SCL] && new_value[GPIO::AVE_SCL])
{
// Check for changes to SDA while the clock is high. This only makes sense if the SDA pin is
// outbound.
if (true || m_gpio_dir[GPIO::AVE_SDA])
{
// Check for changes to SDA while the clock is high.
if (old_value[GPIO::AVE_SDA] && !new_value[GPIO::AVE_SDA])
{
DEBUG_LOG_FMT(WII_IPC, "AVE: Start I2C");
@ -314,7 +309,6 @@ void WiiIPC::GPIOOutChanged(u32 old_value_hex)
i2c_state.bit_counter = 0;
}
}
}
else if (!old_value[GPIO::AVE_SCL] && new_value[GPIO::AVE_SCL])
{
// Clock changed from low to high; transfer a new bit.
@ -385,14 +379,12 @@ void WiiIPC::GPIOOutChanged(u32 old_value_hex)
if (old_ave_value != i2c_state.current_byte)
{
INFO_LOG_FMT(WII_IPC, "AVE: Wrote {:02x} to {:02x} ({})", i2c_state.current_byte,
i2c_state.current_address,
GetAVERegisterName(i2c_state.current_address));
i2c_state.current_address, GetAVERegisterName(i2c_state.current_address));
}
else
{
DEBUG_LOG_FMT(WII_IPC, "AVE: Wrote {:02x} to {:02x} ({})", i2c_state.current_byte,
i2c_state.current_address,
GetAVERegisterName(i2c_state.current_address));
i2c_state.current_address, GetAVERegisterName(i2c_state.current_address));
}
i2c_state.current_address++;
}
@ -401,7 +393,6 @@ void WiiIPC::GPIOOutChanged(u32 old_value_hex)
i2c_state.bit_counter++;
}
}
}
// SENSOR_BAR is checked by WiimoteEmu::CameraLogic
// TODO: SLOT_LED