From 6b99d319fb8f9784d9cc29ba436815ddcfbd42b1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 6 May 2021 13:22:04 -0700 Subject: [PATCH] GB Core: Fix GBC colors setting breaking default model overrides (fixes #2161) --- CHANGES | 1 + src/gb/core.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3012d014e..6e8463de3 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Emulation fixes: - GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149) Other fixes: - Core: Fix memory leak in opening games from the library + - GB Core: Fix GBC colors setting breaking default model overrides (fixes mgba.io/i/2161) - GBA: Fix out of bounds ROM accesses on patched ROMs smaller than 32 MiB - Qt: Fix infrequent deadlock when using sync to video - Qt: Fix applying savetype-only overrides diff --git a/src/gb/core.c b/src/gb/core.c index 24b622bcd..a76168b2b 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -491,7 +491,8 @@ static void _GBCoreReset(struct mCore* core) { bool modelOverride = GBOverrideFind(gbcore->overrides, &override) || (doColorOverride && GBOverrideColorFind(&override)); if (modelOverride) { GBOverrideApply(gb, &override); - } else { + } + if (!modelOverride || override.model == GB_MODEL_AUTODETECT) { const char* modelGB = mCoreConfigGetValue(&core->config, "gb.model"); const char* modelSGB = mCoreConfigGetValue(&core->config, "sgb.model"); const char* modelCGB = mCoreConfigGetValue(&core->config, "cgb.model");