From 9a1b9ca48eb5c2de389cf74509209136cab91f62 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 9 Jan 2023 17:06:00 +0000 Subject: Reformatted TAPLoad() --- source/snap.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/snap.c b/source/snap.c index db8c785..9ff0ae6 100644 --- a/source/snap.c +++ b/source/snap.c @@ -106,11 +106,11 @@ int TAPLoad(Z80Byte id, Z80Word *addr, Z80Word *len, SNAP_Poke poke) return FALSE; } - b=0; + b = 0; - blen=GetTAPLSBWord(); - type=GetTAPByte(); - csum=id; + blen = GetTAPLSBWord(); + type = GetTAPByte(); + csum = id; SPEC_DEBUG("Read block. len=%u type=%u\n", (unsigned)blen, (unsigned)type); SPEC_DEBUG("Requested block len=%u type=%u addr=%u\n", @@ -118,7 +118,7 @@ int TAPLoad(Z80Byte id, Z80Word *addr, Z80Word *len, SNAP_Poke poke) /* Have we found the requested block? */ - if (id==type) + if (id == type) { /* Knock of block type */ @@ -126,8 +126,8 @@ int TAPLoad(Z80Byte id, Z80Word *addr, Z80Word *len, SNAP_Poke poke) while(blen && *len) { - b=GetTAPByte(); - csum^=b; + b = GetTAPByte(); + csum ^= b; poke(*addr,b); @@ -157,14 +157,16 @@ int TAPLoad(Z80Byte id, Z80Word *addr, Z80Word *len, SNAP_Poke poke) /* Check the checksum */ - return csum==tape_csum; + return csum == tape_csum; } else { /* If it's the wrong type, skip it */ while(blen--) + { GetTAPByte(); + } return FALSE; } -- cgit v1.2.3