diff options
author | Adrien Plazas <kekun.plazas@laposte.net> | 2020-12-12 14:09:34 +0100 |
---|---|---|
committer | twinaphex <libretro@gmail.com> | 2021-03-12 08:42:23 +0100 |
commit | da869b41fbb3bfb2c31798abf01e648d6dc15221 (patch) | |
tree | c6ebbc4c2b5d3441032070c1b2051ab7d7cdbbbd /sms.c | |
parent | 556e1be14b3f1647f8e07d47694c971ba5ee296e (diff) |
Stop loading at the end of a file
When section 0 is found, assume we reached the end of the serialization,
so stop deserializing.
Diffstat (limited to 'sms.c')
-rw-r--r-- | sms.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -309,7 +309,8 @@ void sms_deserialize(deserialize_buffer *buf, sms_context *sms) //TODO: cart RAM while (buf->cur_pos < buf->size) { - load_section(buf); + if (!load_section(buf)) + break; } z80_invalidate_code_range(sms->z80, 0xC000, 0x10000); if (sms->bank_regs[0] & 8) { |