From 415f8c1f8a599a4ee7d357c4b9cb655d4fed1a14 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 4 Apr 2026 12:25:44 -0500 Subject: [PATCH] HW/GBPlayer: Fix GBA cart detection in GBI. --- Source/Core/Core/HW/HSP/HSP_DeviceGBPlayer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/HSP/HSP_DeviceGBPlayer.cpp b/Source/Core/Core/HW/HSP/HSP_DeviceGBPlayer.cpp index 68af359028..2b55759c96 100644 --- a/Source/Core/Core/HW/HSP/HSP_DeviceGBPlayer.cpp +++ b/Source/Core/Core/HW/HSP/HSP_DeviceGBPlayer.cpp @@ -42,7 +42,7 @@ enum class GBPRegister : u8 constexpr u16 IRQ_ASSERTED = 0x8000; -constexpr u8 CONTROL_CART_DETECTED = 0x01; +constexpr u8 CONTROL_CART_IS_GB = 0x01; constexpr u8 CONTROL_CART_INSERTED = 0x02; constexpr u8 CONTROL_3V = 0x04; constexpr u8 CONTROL_5V = 0x08; @@ -412,14 +412,14 @@ void CHSPDevice_GBPlayer::Read(u32 address, std::span data) if (m_gbp->IsLoaded()) { m_control |= CONTROL_CART_INSERTED; - if ((m_control & CONTROL_3V) && (m_gbp->IsGBA() || (m_control & CONTROL_5V))) - m_control |= CONTROL_CART_DETECTED; + if (m_gbp->IsGBA()) + m_control &= ~CONTROL_CART_IS_GB; else - m_control &= ~CONTROL_CART_DETECTED; + m_control |= CONTROL_CART_IS_GB; } else { - m_control &= ~(CONTROL_CART_DETECTED | CONTROL_CART_INSERTED); + m_control &= ~(CONTROL_CART_IS_GB | CONTROL_CART_INSERTED); } std::ranges::fill(data, m_control);