From 0d021407afb2a3857dae51966b8249c0e9d00f1e Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 26 Sep 2020 18:03:09 +0300 Subject: [PATCH] Disk rotation speed fix. --- disk.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/disk.cpp b/disk.cpp index 24e634b9..17c28f76 100644 --- a/disk.cpp +++ b/disk.cpp @@ -70,8 +70,8 @@ int floppy_writemode = 0; #define FLOPPY_WRITE_MAXLEN 0x3800 /* This works out to 350 */ #define FLOPPY_GAP_LEN (FLOPPY_WRITE_LEN - 11 * 544) -/* (cycles/bitcell) << 8, normal = ((2us/280ns)<<8) = ~1828.5714 */ -#define NORMAL_FLOPPY_SPEED (currprefs.ntscmode ? 1812 : 1829) +/* 7 CCK per bit */ +#define NORMAL_FLOPPY_SPEED (7 * 256) /* max supported floppy drives, for small memory systems */ #define MAX_FLOPPY_DRIVES 4 @@ -568,9 +568,11 @@ static int get_floppy_speed_from_image(drive *drv) { int l, m; - l = drv->tracklen; - m = get_floppy_speed () * l / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); - + m = get_floppy_speed(); + if (!drv->tracktiming[0]) { + l = drv->tracklen; + m = m * l / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); + } // 4us track? if (l < (FLOPPY_WRITE_LEN_PAL * 8) * 4 / 6) m *= 2; -- 2.47.3