summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2023-01-09 17:58:38 +0000
committerIan C <ianc@noddybox.co.uk>2023-01-09 17:58:38 +0000
commitf1e1f14c3de0015d1c21f8f8e226b91ba86e5e6d (patch)
tree9dd08966669267bacc30e213fc686df0d70be446 /source
parent51ed2a1a304361ee33c76b6bd0fc038ebb88f661 (diff)
Tried to fix TAP loading. Still dodgy on bad TAP files.
Diffstat (limited to 'source')
-rw-r--r--source/snap.c10
1 files changed, 8 insertions, 2 deletions
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)