Merge pull request #14563 from jordan-woyak/gbplayer-trigger-bits

HW/GBPlayer: Fix swapped L/R triggers.
This commit is contained in:
JMC47
2026-04-05 19:28:16 -04:00
committed by GitHub

View File

@@ -533,8 +533,9 @@ void CHSPDevice_GBPlayer::Write(u32 address, std::span<const u8, TRANSFER_SIZE>
}
case GBPRegister::Keypad:
{
const u16 value = Common::swap16(data.data() + 0x1e);
m_gbp->SetKeys(value & 0x3FF);
const u8 value_hi = data[0x1e]; // L/R triggers (need to be flipped).
const u8 value_lo = data[0x1f]; // All other buttons.
m_gbp->SetKeys(u16(((value_hi & 0x01u) << 9) | ((value_hi & 0x02u) << 7) | value_lo));
break;
}
default: