From a00aeed7637aab109741b8f4c6e3a368814b0a77 Mon Sep 17 00:00:00 2001 From: April Ayres-Griffiths Date: Sat, 25 May 2024 09:42:33 -0700 Subject: [PATCH] fix(disk/diskimageappledos.go): fix for badly behaved sector size spec --- disk/diskimageappledos.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/disk/diskimageappledos.go b/disk/diskimageappledos.go index a57963d..6831783 100644 --- a/disk/diskimageappledos.go +++ b/disk/diskimageappledos.go @@ -257,7 +257,11 @@ func (fd *VTOC) GetTrackOrder() int { } func (fd *VTOC) BytesPerSector() int { - return int(fd.Data[0x36]) + 256*int(fd.Data[0x37]) + size := int(fd.Data[0x36]) + 256*int(fd.Data[0x37]) + if size < 256 { + size = 256 + } + return size } func (fd *VTOC) IsTSFree(t, s int) bool {