summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
authorGravatarGravatar arbee <rb6502@users.noreply.github.com>2019-11-22 20:45:08 -0500
committerGravatarGravatar arbee <rb6502@users.noreply.github.com>2019-11-22 20:45:08 -0500
commit5c45fa678f29608308b249b3a751859afd0a2da1 (patch)
tree8cfe07fdf2b491588a7c66f04454d9b01686d447 /src/lib
parente09f2e49a63ad667513ed3800153e5f3e6722f82 (diff)
apple2: fix recognition of .NIB images on the old diskii controller (MT #7496) [R. Belmont]
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/ap2_dsk.cpp4
-rw-r--r--src/lib/formats/ap2_dsk.h2
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