From 75155738a510c2c4f1a12a74ba6ac777b0862e04 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 18 Oct 2022 01:39:15 -0700 Subject: [PATCH] GB Serialize: Don't write BGP/OBP when loading SCGB state (fixes #2694) --- CHANGES | 2 ++ src/gb/io.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1cca99040..1545fbd30 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Features: - New unlicensed GB mappers: NT (older types 1 and 2), Li Cheng, GGB-81 - Debugger: Add range watchpoints +Emulation fixes: + - GB Serialize: Don't write BGP/OBP when loading SCGB state (fixes mgba.io/i/2694) Other fixes: - Qt: Manually split filename to avoid overzealous splitting (fixes mgba.io/i/2681) - Qt: Expand criteria for tag branch names (fixes mgba.io/i/2679) diff --git a/src/gb/io.c b/src/gb/io.c index c6ad66c36..06a7927cd 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -754,7 +754,7 @@ void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state) { gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_SCX, state->io[GB_REG_SCX]); gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_WY, state->io[GB_REG_WY]); gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_WX, state->io[GB_REG_WX]); - if (gb->model & GB_MODEL_SGB) { + if (gb->model == GB_MODEL_SGB) { gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_BGP, state->io[GB_REG_BGP]); gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_OBP0, state->io[GB_REG_OBP0]); gb->video.renderer->writeVideoRegister(gb->video.renderer, GB_REG_OBP1, state->io[GB_REG_OBP1]);