do_disk_index ();
}
-static void disk_doupdate_write (drive * drv, int floppybits)
+static void disk_doupdate_write(int floppybits, int trackspeed)
{
int dr;
int drives[4];
drives[dr] = 1;
}
- while (floppybits >= drv->trackspeed) {
+ while (floppybits >= trackspeed) {
for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
if (drives[dr]) {
drive *drv2 = &floppy[dr];
}
if (disk_fifostatus () >= 0) {
uae_u16 w = DSKDATR ();
- for (dr = 0; dr < MAX_FLOPPY_DRIVES ; dr++) {
+ for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
drive *drv2 = &floppy[dr];
if (drives[dr]) {
drv2->bigmfmbuf[drv2->mfmpos >> 4] = w;
}
}
}
- floppybits -= drv->trackspeed;
+ floppybits -= trackspeed;
}
}
return 0;
}
-static void disk_doupdate_read_nothing (int floppybits)
+static void disk_doupdate_read_nothing(int floppybits)
{
while (floppybits >= get_floppy_speed ()) {
word <<= 1;
}
/* write dma and wordsync enabled: read until wordsync match found */
if (dskdmaen == DSKDMA_WRITE && dma_enable)
- disk_doupdate_write (drv, drv->floppybitcounter);
+ disk_doupdate_write(drv->floppybitcounter, drv->trackspeed);
else
- disk_doupdate_read (drv, drv->floppybitcounter);
+ disk_doupdate_read(drv, drv->floppybitcounter);
drv->floppybitcounter %= drv->trackspeed;
didaccess = 1;
}
- /* no floppy selected but read dma */
- if (!didaccess && dskdmaen == DSKDMA_READ) {
- disk_doupdate_read_nothing (cycles);
+ /* no floppy selected but dma active */
+ if (!didaccess) {
+ if (dskdmaen == DSKDMA_READ) {
+ disk_doupdate_read_nothing(cycles);
+ } else if (dskdmaen == DSKDMA_WRITE) {
+ disk_doupdate_write(cycles, get_floppy_speed());
+ }
}
/* instantly finish dma if dsklen==0 and wordsync detected */
for (i = 0; i < dsklength; i++) {
uae_u16 w = chipmem_wget_indirect (dskpt + i * 2);
drv->bigmfmbuf[pos >> 4] = w;
- #ifdef AMAX
+#ifdef AMAX
if (amax_enabled)
amax_diskwrite (w);
- #endif
+#endif
pos += 16;
pos %= drv->tracklen;
}