woz: Fix 2.0 format track length

This commit is contained in:
Olivier Galibert 2021-02-15 20:21:23 +01:00
parent aed9f93f39
commit ea3904bdf4
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ FLOPPY_FORMATS_END
FLOPPY_FORMATS_MEMBER(applefdintf_device::formats_35)
FLOPPY_DC42_FORMAT,
FLOPPY_WOZ_FORMAT,
FLOPPY_APPLE_GCR_FORMAT,
FLOPPY_APPLE_2MG_FORMAT,
FLOPPY_PC_FORMAT

View File

@ -1690,11 +1690,11 @@ bool a2_woz_format::load(io_generic *io, uint32_t form_factor, const std::vector
uint32_t boff = (uint32_t)r16(img, trks_off + 0) * 512;
if (r16(img, trks_off + 4) == 0)
if (r32(img, trks_off + 4) == 0)
return false;
// TODO: when write capability is added, use the WRIT chunk data if it's present
generate_track_from_bitstream(track, head, &img[boff], r16(img, trks_off + 4), image, subtrack, 0xffff);
generate_track_from_bitstream(track, head, &img[boff], r32(img, trks_off + 4), image, subtrack, 0xffff);
}
}
}