From 5c45fa678f29608308b249b3a751859afd0a2da1 Mon Sep 17 00:00:00 2001 From: arbee Date: Fri, 22 Nov 2019 20:45:08 -0500 Subject: [PATCH] apple2: fix recognition of .NIB images on the old diskii controller (MT #7496) [R. Belmont] --- src/lib/formats/ap2_dsk.cpp | 4 ++-- src/lib/formats/ap2_dsk.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp index b9685d8e40f..a2fa0ee188a 100644 --- a/src/lib/formats/ap2_dsk.cpp +++ b/src/lib/formats/ap2_dsk.cpp @@ -139,7 +139,7 @@ static FLOPPY_IDENTIFY(apple2_dsk_identify) size = floppy_image_size(floppy); expected_size = APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_SECTOR_SIZE; - if ((size == expected_size) || (size == 35 * APPLE2_SECTOR_COUNT * APPLE2_SECTOR_SIZE)) + if ((size == expected_size) || (size == APPLE2_STD_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_SECTOR_SIZE)) *vote = 100; else if ((size > expected_size) && ((size - expected_size) < 8)) *vote = 90; /* tolerate images with up to eight fewer/extra bytes (bug #638) */ @@ -249,7 +249,7 @@ static FLOPPY_IDENTIFY(apple2_nib_identify) { uint64_t size; size = floppy_image_size(floppy); - *vote = ((size == APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE) || (size == (APPLE2_TRACK_COUNT + 1) * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE)) ? 100 : 0; + *vote = ((size == APPLE2_STD_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE) || (size == (APPLE2_STD_TRACK_COUNT + 1) * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE)) ? 100 : 0; return FLOPPY_ERROR_SUCCESS; } diff --git a/src/lib/formats/ap2_dsk.h b/src/lib/formats/ap2_dsk.h index b5b08db663b..345ca3ea6c3 100644 --- a/src/lib/formats/ap2_dsk.h +++ b/src/lib/formats/ap2_dsk.h @@ -23,7 +23,7 @@ #define APPLE2_NIBBLE_SIZE 416 #define APPLE2_SMALL_NIBBLE_SIZE 374 -//#define APPLE2_TRACK_COUNT 35 +#define APPLE2_STD_TRACK_COUNT 35 #define APPLE2_TRACK_COUNT 40 #define APPLE2_SECTOR_COUNT 16 #define APPLE2_SECTOR_SIZE 256