From a51bcfc77dfa08f8c1691d93de9c0f9ef16792ff Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 15 Mar 2018 00:25:59 +0100 Subject: [PATCH] The sector presence linked lists are no longer allocated for floppy drives not in turbo mode. --- src/floppy/fdd_86f.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index 3d5064a80..4c8f6c600 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -10,7 +10,7 @@ * data in the form of FM/MFM-encoded transitions) which also * forms the core of the emulator's floppy disk emulation. * - * Version: @(#)fdd_86f.c 1.0.16 2018/03/14 + * Version: @(#)fdd_86f.c 1.0.17 2018/03/14 * * Author: Miran Grca, * Copyright 2016-2018 Miran Grca. @@ -2676,15 +2676,17 @@ uint16_t d86f_prepare_sector(int drive, int side, int prev_pos, uint8_t *id_buf, uint16_t dataam_mfm = 0x4555; uint16_t datadam_mfm = 0x4A55; - s = (sector_t *) malloc(sizeof(sector_t)); - memset(s, 0, sizeof(sector_t)); - s->c = id_buf[0]; - s->h = id_buf[1]; - s->r = id_buf[2]; - s->n = id_buf[3]; - if (d86f[drive].last_side_sector[side]) - s->prev = d86f[drive].last_side_sector[side]; - d86f[drive].last_side_sector[side] = s; + if (fdd_get_turbo(drive) && (d86f[drive].version == 0x0063)) { + s = (sector_t *) malloc(sizeof(sector_t)); + memset(s, 0, sizeof(sector_t)); + s->c = id_buf[0]; + s->h = id_buf[1]; + s->r = id_buf[2]; + s->n = id_buf[3]; + if (d86f[drive].last_side_sector[side]) + s->prev = d86f[drive].last_side_sector[side]; + d86f[drive].last_side_sector[side] = s; + } mfm = d86f_is_mfm(drive);