all repos — mgba @ 42b011a68ba30aa5720ef6601efc72e256a2de9a

mGBA Game Boy Advance Emulator

GBA: Check for cycle count being too high
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Oct 2015 19:24:06 -0700
commit

42b011a68ba30aa5720ef6601efc72e256a2de9a

parent

d8ab8d89999010965607e88ad6356b5e5b81f3fc

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

jump to
M CHANGESCHANGES

@@ -27,6 +27,7 @@ - Qt: Disable menu items in multiplayer that don't make sense to have enabled

- Qt: Dropping multiplayer windows works more cleanly now - GBA BIOS: Implement RegisterRamReset for SIO registers - GBA: Additional savestate sanity checks + - GBA: Check for cycle count being too high 0.3.0: (2015-08-16) Features:
M src/gba/serialize.csrc/gba/serialize.c

@@ -87,6 +87,10 @@ if (state->cpu.cycles < 0) {

GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: CPU cycles are negative"); error = true; } + if (state->cpu.cycles >= (int32_t) GBA_ARM7TDMI_FREQUENCY) { + GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: CPU cycles are too high"); + error = true; + } if (state->cpu.nextEvent < 0) { GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: Next event is negative"); error = true;