all repos — mgba @ a24bd073b41c64d4f1ee258e57584defa0f1c612

mGBA Game Boy Advance Emulator

GB: Fix savedata initialization (fixes #1473, fixes #1478)
Vicki Pfau vi@endrift.com
Wed, 03 Jul 2019 13:01:10 -0700
commit

a24bd073b41c64d4f1ee258e57584defa0f1c612

parent

a00a02b8c4ea640bee8ec14d59b229dace7bce90

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -32,6 +32,7 @@ - GB Video: Increment BCPS/OCPS even in mode 3 (fixes mgba.io/i/1462)

- GB Audio: Deschedule channel 3 when disabled (fixes mgba.io/i/1463) - GB Audio: Deschedule channel 1 when disabled by sweep (fixes mgba.io/i/1467) - GBA Memory: Fix STM/LDM to invalid VRAM + - GB: Fix savedata initialization (fixes mgba.io/i/1473, mgba.io/i/1478) Other fixes: - Qt: Fix some Qt display driver race conditions - Core: Improved lockstep driver reliability (Le Hoang Quyen)
M src/gb/gb.csrc/gb/gb.c

@@ -174,7 +174,7 @@ vf->seek(vf, size, SEEK_SET);

vf->write(vf, extdataBuffer, vfSize & 0xFF); } gb->memory.sram = vf->map(vf, size, MAP_WRITE); - memset(&gb->memory.sram[gb->sramSize], 0xFF, size - gb->sramSize); + memset(&gb->memory.sram[vfSize], 0xFF, size - vfSize); } else if (size > gb->sramSize || !gb->memory.sram) { if (gb->memory.sram) { vf->unmap(vf, gb->memory.sram, gb->sramSize);