Fix for non-standard boot headers using a single sector instead of usual minimum of 3 sectors

This commit is contained in:
Rob McMullen 2016-10-01 18:42:02 -07:00
parent df38db492a
commit 7e51284cb1

View File

@ -362,7 +362,7 @@ class BootDiskImage(DiskImageBase):
max_ram = 0xc000
max_size = max_ram - bload
max_sectors = max_size / self.header.sector_size
if nsec > max_sectors or nsec < 3:
if nsec > max_sectors or nsec < 1:
raise InvalidDiskImage("Number of boot sectors out of range")
if bload < 0x200 or bload > (0xc000 - (nsec * self.header.sector_size)):
raise InvalidDiskImage("Bad boot load address")