diff options
-rw-r--r-- | source/snap.c | 18 |
1 files changed, 10 insertions, 8 deletions
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; } |