summaryrefslogtreecommitdiff
path: root/sms.c
diff options
context:
space:
mode:
authorAdrien Plazas <kekun.plazas@laposte.net>2020-12-12 14:09:34 +0100
committertwinaphex <libretro@gmail.com>2021-03-12 08:42:23 +0100
commitda869b41fbb3bfb2c31798abf01e648d6dc15221 (patch)
treec6ebbc4c2b5d3441032070c1b2051ab7d7cdbbbd /sms.c
parent556e1be14b3f1647f8e07d47694c971ba5ee296e (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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sms.c b/sms.c
index a2e3d3b..94fd5aa 100644
--- a/sms.c
+++ b/sms.c
@@ -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) {