From cfd30b7a95edf1dafaf5cfb6d691578d8b6554c5 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 8 Nov 2024 21:38:25 -0800 Subject: [PATCH] GBA Savedata: Fix erroneously setting the error bit --- src/gba/savedata.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gba/savedata.c b/src/gba/savedata.c index ca5d35cbb..ced279b7f 100644 --- a/src/gba/savedata.c +++ b/src/gba/savedata.c @@ -376,9 +376,10 @@ uint8_t GBASavedataReadFlash(struct GBASavedata* savedata, uint16_t address) { } } if (mTimingIsScheduled(savedata->timing, &savedata->dust) && (address >> 12) == savedata->settling) { - // This should read /Q7 ("data# polling") and Q6 flipping ("toggle bit") every read, - // but just data# polling is sufficient for games to figure it out - return savedata->currentBank[address] ^ 0x80; + // This should read /Q7 ("data# polling"), Q6 flipping ("toggle bit") + // every read, and /Q5 ("error bit" cleared), but just data# polling + // is sufficient for games to figure it out + return (savedata->currentBank[address] ^ 0x80) & 0x80; } return savedata->currentBank[address]; }