From 5a0a60ba6257742b28e54a47c8a3f0b5909c4fbd Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 28 Jul 2017 14:29:56 -0700 Subject: [PATCH] GB Core: Fix palette loading when loading a foreign config --- CHANGES | 1 + src/gb/core.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index da5f43c88..5a7a4a429 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Bugfixes: - GB Memory: Initialize peripheral pointers - GB MBC: Fix SRAM sizes 4 and 5 - GB Video: Fix 16-bit screenshots (fixes mgba.io/i/826) + - GB Core: Fix palette loading when loading a foreign config Misc: - Qt: Don't rebuild library view if style hasn't changed diff --git a/src/gb/core.c b/src/gb/core.c index 1b60361ee..35f9fbaec 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -167,17 +167,17 @@ static void _GBCoreLoadConfig(struct mCore* core, const struct mCoreConfig* conf gb->video.frameskip = core->opts.frameskip; int color; - if (mCoreConfigGetIntValue(&core->config, "gb.pal[0]", &color)) { - GBVideoSetPalette(&gb->video, 0, color); + if (mCoreConfigGetIntValue(config, "gb.pal[0]", &color)) { + GBVideoSetPalette(&gb->video, 0, color); } - if (mCoreConfigGetIntValue(&core->config, "gb.pal[1]", &color)) { - GBVideoSetPalette(&gb->video, 1, color); + if (mCoreConfigGetIntValue(config, "gb.pal[1]", &color)) { + GBVideoSetPalette(&gb->video, 1, color); } - if (mCoreConfigGetIntValue(&core->config, "gb.pal[2]", &color)) { - GBVideoSetPalette(&gb->video, 2, color); + if (mCoreConfigGetIntValue(config, "gb.pal[2]", &color)) { + GBVideoSetPalette(&gb->video, 2, color); } - if (mCoreConfigGetIntValue(&core->config, "gb.pal[3]", &color)) { - GBVideoSetPalette(&gb->video, 3, color); + if (mCoreConfigGetIntValue(config, "gb.pal[3]", &color)) { + GBVideoSetPalette(&gb->video, 3, color); } mCoreConfigCopyValue(&core->config, config, "gb.bios");