Skip to content

Commit 9fad58a

Browse files
EricCarrGHmarkjfisher
authored andcommitted
CoCo - Fix data size in host/device slots routines. Format asm.
1 parent f76c7f6 commit 9fad58a

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

coco/src/bus/bus_get_response.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ uint8_t bus_get_response(uint8_t opcode, uint8_t *buf, int len)
4040
dwwrite((uint8_t *)&grc, z);
4141

4242
// Return 0 on a successful read (dwread returns 1)
43-
return !dwread((uint8_t *)buf, len);
43+
return !dwread(buf, len);
4444
}
4545
/*
4646
struct _getresponsecmd

coco/src/bus/dwread.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ byte dwread(byte *s, int l)
1414
asm
1515
{
1616
pshs x,y
17-
ldx :s
18-
ldy :l
19-
jsr [0xD93F]
20-
puls y,x
21-
tfr cc,b
22-
lsrb
23-
lsrb
24-
andb #$01
25-
}
17+
ldx :s
18+
ldy :l
19+
jsr [0xD93F]
20+
puls y,x
21+
tfr cc,b
22+
lsrb
23+
lsrb
24+
andb #$01
25+
}
2626
}

coco/src/bus/dwwrite.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ byte dwwrite(byte *s, int l)
1313
asm
1414
{
1515
pshs x,y
16-
ldx :s
17-
ldy :l
18-
jsr [0xD941]
19-
tfr cc,d
20-
puls y,x
21-
}
16+
ldx :s
17+
ldy :l
18+
jsr [0xD941]
19+
tfr cc,d
20+
puls y,x
21+
}
2222
}

coco/src/fn_fuji/fuji_get_device_slots.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bool fuji_get_device_slots(DeviceSlot *d, size_t size)
1818
bus_ready();
1919

2020
dwwrite((uint8_t *)&gds, sizeof(gds));
21-
bus_get_response(OP_FUJI,(uint8_t *)d, size);
21+
bus_get_response(OP_FUJI,(uint8_t *)d, sizeof(DeviceSlot) * size);
2222

2323
return bus_error(OP_FUJI) == BUS_SUCCESS;
2424
}

coco/src/fn_fuji/fuji_get_host_slots.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ bool fuji_get_host_slots(HostSlot *h, size_t size)
1616
ghs.cmd = FUJICMD_READ_HOST_SLOTS;
1717

1818
bus_ready();
19-
2019
dwwrite((uint8_t *)&ghs, sizeof(ghs));
21-
bus_get_response(OP_FUJI,(uint8_t *)h, size);
20+
21+
bus_get_response(OP_FUJI,(uint8_t *)h, sizeof(HostSlot) * size);
2222

2323
return bus_error(OP_FUJI) == BUS_SUCCESS;
2424
}

coco/src/fn_fuji/fuji_put_device_slots.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bool fuji_put_device_slots(DeviceSlot *d, size_t size)
1818
bus_ready();
1919

2020
dwwrite((uint8_t *)&pds, sizeof(pds));
21-
dwwrite((uint8_t *)d, size);
21+
dwwrite((uint8_t *)d, sizeof(DeviceSlot) * size);
2222

2323
return bus_error(OP_FUJI) == BUS_SUCCESS;
2424
}

coco/src/fn_fuji/fuji_put_host_slots.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bool fuji_put_host_slots(HostSlot *h, size_t size)
1717

1818
bus_ready();
1919
dwwrite((uint8_t *)&phs, sizeof(phs));
20-
dwwrite((uint8_t *)h, size);
20+
dwwrite((uint8_t *)h, sizeof(HostSlot) * size);
2121

2222
return bus_error(OP_FUJI) == BUS_SUCCESS;
2323
}

0 commit comments

Comments
 (0)