all repos — mgba @ f34fa2b6af4f7cf196cc7ab76b6c10acff11b8b1

mGBA Game Boy Advance Emulator

GB Video: Fix deserializing negative LX state
Vicki Pfau vi@endrift.com
Tue, 23 Mar 2021 19:51:03 -0700
commit

f34fa2b6af4f7cf196cc7ab76b6c10acff11b8b1

parent

44f031d89b9e33338916aeefddb94c3b494a47af

2 files changed, 3 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -88,6 +88,7 @@ - GB: Fix loading model overrides

- GB Serialize: Fix crash when loading pre-0.7 SGB savestates - GB Video: Fix SGB video logs - GB Video: Discard SGB packets in non-SGB mVLs + - GB Video: Fix deserializing negative LX state - GBA: Fix loading multiboot ELF files (fixes mgba.io/i/1949) - GBA: Fix loading subsequent save files (fixes mgba.io/i/2067) - mGUI: Don't attempt to preload files larger than can fit in RAM
M src/gb/video.csrc/gb/video.c

@@ -867,6 +867,8 @@ LOAD_16LE(video->x, 0, &state->video.x);

LOAD_16LE(video->ly, 0, &state->video.ly); LOAD_32LE(video->frameCounter, 0, &state->video.frameCounter); LOAD_32LE(video->dotClock, 0, &state->video.dotCounter); + video->x = (int16_t) video->x; // Ensure proper sign extension--the LOAD_16 is unsigned + video->vramCurrentBank = state->video.vramCurrentBank; GBSerializedVideoFlags flags = state->video.flags;