drv->drive_id = DRIVE_ID_525SD;
break;
case DRV_NONE:
- case DRV_PC_ONLY:
+ case DRV_PC_ONLY_40:
+ case DRV_PC_ONLY_80:
drv->drive_id = DRIVE_ID_NONE;
break;
}
drv->lastdataacesstrack = -1;
disabled &= ~(1 << num);
reserved &= ~(1 << num);
- if (currprefs.floppyslots[num].dfxtype < 0 || currprefs.floppyslots[num].dfxtype >= DRV_PC_ONLY)
+ if (currprefs.floppyslots[num].dfxtype < 0 || currprefs.floppyslots[num].dfxtype >= DRV_PC_ONLY_40)
disabled |= 1 << num;
- if (currprefs.floppyslots[num].dfxtype >= DRV_PC_ONLY)
+ if (currprefs.floppyslots[num].dfxtype >= DRV_PC_ONLY_40)
reserved |= 1 << num;
reset_drive_gui (num);
/* most internal Amiga floppy drives won't enable
canauto = 1;
if (!canauto && drv->diskfile && isrecognizedext (zfile_getname (drv->diskfile)))
canauto = 1;
+ // if PC-only drive, make sure PC-like floppies are alwayss detected
+ if (!canauto && currprefs.floppyslots[dnum].dfxtype >= DRV_PC_ONLY_40)
+ canauto = 1;
if (drv->catweasel) {
return floppy[0].mfmpos;
}
-void disk_reserved_setinfo(int num, int cyl, int head, int motor)
+static int get_reserved_id(int num)
{
for (int i = 0; i < MAX_FLOPPY_DRIVES; i++) {
if (reserved & (1 << i)) {
num--;
continue;
}
- drive *drv = &floppy[i];
- reserved_side = head;
- drv->cyl = cyl;
- drv->state = motor;
- update_drive_gui(i, false);
+ return i;
}
}
+ return -1;
+}
+
+void disk_reserved_setinfo(int num, int cyl, int head, int motor)
+{
+ int i = get_reserved_id(num);
+ if (i >= 0) {
+ drive *drv = &floppy[i];
+ reserved_side = head;
+ drv->cyl = cyl;
+ drv->state = motor;
+ update_drive_gui(i, false);
+ }
}
bool disk_reserved_getinfo(int num, struct floppy_reserved *fr)
{
- for (int i = 0; i < MAX_FLOPPY_DRIVES; i++) {
- if (reserved & (1 << i)) {
- if (num > 0) {
- num--;
- continue;
- }
- drive *drv = &floppy[i];
- fr->img = drv->diskfile;
- fr->wrprot = drv->wrprot;
- fr->cyl = drv->cyl;
- fr->cyls = drv->num_tracks / 2;
- fr->secs = drv->num_secs;
- fr->heads = 2;
- return true;
- }
+ int i = get_reserved_id(num);
+ if (i >= 0) {
+ drive *drv = &floppy[i];
+ fr->img = drv->diskfile;
+ fr->wrprot = drv->wrprot;
+ fr->cyl = drv->cyl;
+ fr->cyls = drv->num_tracks / 2;
+ fr->drive_cyls = currprefs.floppyslots[i].dfxtype == DRV_PC_ONLY_40 ? 40 : 80;
+ fr->secs = drv->num_secs;
+ fr->heads = 2;
+ fr->disk_changed = drv->dskchange || fr->img == NULL;
+ return true;
}
return false;
}
+
+void disk_reserved_reset_disk_change(int num)
+{
+ int i = get_reserved_id(num);
+ if (i >= 0) {
+ drive *drv = &floppy[i];
+ drv->dskchange = false;
+ }
+}
\ No newline at end of file
* (c) 1995 Bernd Schmidt
*/
-typedef enum { DRV_NONE = -1, DRV_35_DD = 0, DRV_35_HD, DRV_525_SD, DRV_35_DD_ESCOM, DRV_PC_ONLY } drive_type;
+typedef enum { DRV_NONE = -1, DRV_35_DD = 0, DRV_35_HD, DRV_525_SD, DRV_35_DD_ESCOM, DRV_PC_ONLY_40, DRV_PC_ONLY_80 } drive_type;
#define HISTORY_FLOPPY 0
#define HISTORY_CD 1
int cyls;
int heads;
int secs;
+ int drive_cyls;
+ bool disk_changed;
};
void disk_reserved_setinfo(int num, int cyl, int head, int motor);
bool disk_reserved_getinfo(int num, struct floppy_reserved *fr);
+void disk_reserved_reset_disk_change(int num);
extern void DISK_init (void);
extern void DISK_free (void);