Skip to content

Commit 2885fff

Browse files
Per Mårtenssonkeirf
authored andcommitted
Added an extra drive on the shugart bus (index 3) this drive is select with pin 6 on the floppy header
1 parent e157ca3 commit 2885fff

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/floppy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static struct unit {
4343
bool_t initialised;
4444
bool_t is_flippy;
4545
bool_t motor;
46-
} unit[3];
46+
} unit[4];
4747

4848
static struct gw_delay delay_params;
4949
static const struct gw_delay factory_delay_params = {
@@ -197,6 +197,7 @@ static void drive_deselect(void)
197197
case 0: pin = 10; break;
198198
case 1: pin = 12; break;
199199
case 2: pin = 14; break;
200+
case 3: pin = 6; break;
200201
}
201202
break;
202203
}
@@ -230,6 +231,7 @@ static uint8_t drive_select(uint8_t nr)
230231
case 0: pin = 10; break;
231232
case 1: pin = 12; break;
232233
case 2: pin = 14; break;
234+
case 3: pin = 6; break;
233235
default: return ACK_BAD_UNIT;
234236
}
235237
break;
@@ -264,7 +266,7 @@ static uint8_t drive_motor(uint8_t nr, bool_t on)
264266
}
265267
break;
266268
case BUS_SHUGART:
267-
if (nr >= 3)
269+
if (nr >= 4)
268270
return ACK_BAD_UNIT;
269271
/* All shugart units share one motor line. Alias them all to unit 0. */
270272
nr = 0;
@@ -305,7 +307,7 @@ static uint8_t drive_get_info(int nr, struct gw_drive_info *d)
305307
return ACK_BAD_UNIT;
306308
break;
307309
case BUS_SHUGART:
308-
if (nr >= 3)
310+
if (nr >= 4)
309311
return ACK_BAD_UNIT;
310312
break;
311313
default:

0 commit comments

Comments
 (0)