apple2: fix recognition of .NIB images on the old diskii controller (MT #7496) [R. Belmont]

This commit is contained in:
arbee 2019-11-22 20:45:08 -05:00
parent e09f2e49a6
commit 5c45fa678f
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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