static int dma_enable, bitoffset, syncoffset;
static uae_u16 word, dsksync;
static bool dsksync_on;
-static evt_t dsksync_cycles;
-#define WORDSYNC_TIME 11
/* Always carried through to the next line. */
int disk_hpos;
static int disk_jitter;
static void wordsync_detected(bool startup)
{
- dsksync_cycles = get_cycles() + WORDSYNC_TIME * CYCLE_UNIT;
if (dskdmaen != DSKDMA_OFF) {
if (disk_debug_logging && dma_enable == 0) {
int pos = -1;
}
}
+static bool canloaddskbytr(void)
+{
+ return (bitoffset & 7) == 7 && (word & 0xff) != 0x00 && (word & 0xff) != 0xff;
+}
+
static void disk_doupdate_read_reallynothing(int floppybits, bool state)
{
while (floppybits >= get_floppy_speed()) {
skipbit = true;
}
}
- if (!skipbit && (bitoffset & 7) == 7 && !waszero) {
+ if (!skipbit && canloaddskbytr()) {
dskbytr_val = word & 0xff;
dskbytr_val |= 0x8000;
}
skipbit = true;
}
}
- if (!skipbit && (bitoffset & 7) == 7) {
+ if (!skipbit && canloaddskbytr()) {
dskbytr_val = word & 0xff;
dskbytr_val |= 0x8000;
}
}
}
- if (!skipbit && (bitoffset & 7) == 7) {
+ if (!skipbit && canloaddskbytr()) {
dskbytr_val = word & 0xff;
dskbytr_val |= 0x8000;
}
DISK_update(hpos);
v = dskbytr_val;
dskbytr_val &= ~0x8000;
- if (word == dsksync && cycles_in_range(dsksync_cycles)) {
+ if (word == dsksync) {
v |= 0x1000;
if (disk_debug_logging > 1) {
dumpdisk(_T("DSKBYTR SYNC"));