summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2026-04-01 11:39:08 -0400
committerGitHub <noreply@github.com>2026-04-01 11:39:08 -0400
commit900aa0cb785d5aab9581aed8a0db39365dc4a402 (patch)
tree4d4206bd0074124681f76eb0e5875816758eb963 /Source
parent9d78302f474238099d8671dd4e5add7605d13984 (diff)
parent6d38ccb9a66faf1b5891ecd8d0c18856c3f47658 (diff)
Merge pull request #14537 from jordan-woyak/gb-fixes
HW/GBACore: Fix integrated game boy clock speeds and enable colors.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/GBACore.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/Core/Core/HW/GBACore.cpp b/Source/Core/Core/HW/GBACore.cpp
index 2226610d35..2f83c14237 100644
--- a/Source/Core/Core/HW/GBACore.cpp
+++ b/Source/Core/Core/HW/GBACore.cpp
@@ -56,20 +56,7 @@ constexpr size_t AUDIO_BUFFER_SIZE = 512;
// libmGBA does not return the correct frequency for some GB models
static u32 GetCoreFrequency(mCore* core)
{
- if (core->platform(core) != mPLATFORM_GB)
- return static_cast<u32>(core->frequency(core));
-
- switch (static_cast<::GB*>(core->board)->model)
- {
- case GB_MODEL_CGB:
- case GB_MODEL_SCGB:
- case GB_MODEL_AGB:
- return CGB_SM83_FREQUENCY;
- case GB_MODEL_SGB:
- return SGB_SM83_FREQUENCY;
- default:
- return DMG_SM83_FREQUENCY;
- }
+ return (core->platform(core) == mPLATFORM_GBA) ? GBA_ARM7TDMI_FREQUENCY : CGB_SM83_FREQUENCY;
}
static VFile* OpenROM_Archive(const char* path)
@@ -222,6 +209,15 @@ bool Core::Start(u64 gc_ticks)
mCoreConfigSetIntValue(&m_core->config, "useBios", 0);
mCoreConfigSetIntValue(&m_core->config, "skipBios", 0);
+ // If we eventually load GBC BIOS, then these should potentially all be "CGB".
+ mCoreConfigSetValue(&m_core->config, "gb.model", "DMG");
+ mCoreConfigSetValue(&m_core->config, "sgb.model", "DMG");
+ mCoreConfigSetValue(&m_core->config, "cgb.model", "CGB");
+ mCoreConfigSetValue(&m_core->config, "cgb.hybridModel", "CGB");
+ mCoreConfigSetValue(&m_core->config, "cgb.sgbModel", "CGB");
+
+ mCoreConfigSetIntValue(&m_core->config, "gb.colors", GB_COLORS_CGB);
+
if (m_core->platform(m_core) == mPLATFORM_GBA)
{
LoadBIOS(File::GetUserPath(F_GBABIOS_IDX).c_str());