summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2023-01-09 17:06:00 +0000
committerIan C <ianc@noddybox.co.uk>2023-01-09 17:06:00 +0000
commit9a1b9ca48eb5c2de389cf74509209136cab91f62 (patch)
tree7e4e0675c702114ad5b3ef4d259d104ea8f96528 /source
parent2df835d00591d085de589ddf4d40ea3edc8f3fac (diff)
Reformatted TAPLoad()
Diffstat (limited to 'source')
-rw-r--r--source/snap.c18
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;
}