From f1e1f14c3de0015d1c21f8f8e226b91ba86e5e6d Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 9 Jan 2023 17:58:38 +0000 Subject: Tried to fix TAP loading. Still dodgy on bad TAP files. --- source/snap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/snap.c') diff --git a/source/snap.c b/source/snap.c index 9ff0ae6..3ef3690 100644 --- a/source/snap.c +++ b/source/snap.c @@ -127,15 +127,21 @@ int TAPLoad(Z80Byte id, Z80Word *addr, Z80Word *len, SNAP_Poke poke) while(blen && *len) { b = GetTAPByte(); - csum ^= b; - poke(*addr,b); + if (blen > 1) + { + csum ^= b; + poke(*addr,b); + } (*addr)++; (*len)--; blen--; } + SPEC_DEBUG("Finished block. Remaining blen=%u len=%u\n", + (unsigned)blen, (unsigned)*len); + /* Get the checksum */ if (blen) -- cgit v1.2.3