From c89b89f9a7baba61a51e5d30b132eaa06c2d414f Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Wed, 20 Jul 2016 18:12:07 -0700 Subject: [PATCH] Fixed sector number offset for raw sector labels --- atrcopy/diskimages.py | 3 ++- atrcopy/dos33.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/atrcopy/diskimages.py b/atrcopy/diskimages.py index 9b28123..93fb176 100644 --- a/atrcopy/diskimages.py +++ b/atrcopy/diskimages.py @@ -24,6 +24,7 @@ class AtrHeader(object): self.unused = 0 self.flags = 0 self.header_offset = 0 + self.starting_sector_label = 1 self.initial_sector_size = sector_size self.num_initial_sectors = initial_sectors self.max_sectors = 0 @@ -280,7 +281,7 @@ class DiskImageBase(object): i = self.header.header_offset if self.header.image_size > 0: self.segments.append(ObjSegment(r[0:i], 0, 0, 0, i, name="%s Header" % self.header.file_format)) - self.segments.append(RawSectorsSegment(r[i:], 1, self.header.max_sectors, self.header.image_size, 128, 3, self.header.sector_size, name="Raw disk sectors")) + self.segments.append(RawSectorsSegment(r[i:], self.header.starting_sector_label, self.header.max_sectors, self.header.image_size, self.header.initial_sector_size, self.header.num_initial_sectors, self.header.sector_size, name="Raw disk sectors")) self.segments.extend(self.get_boot_segments()) self.segments.extend(self.get_vtoc_segments()) self.segments.extend(self.get_directory_segments()) diff --git a/atrcopy/dos33.py b/atrcopy/dos33.py index 262b1a3..2637af5 100644 --- a/atrcopy/dos33.py +++ b/atrcopy/dos33.py @@ -107,7 +107,7 @@ class Dos33Dirent(object): break sector_list.append(image.header.sector_from_track(t, s)) self.sector_map = sector_list - + def start_read(self, image): if not self.is_sane: raise InvalidDirent("Invalid directory entry '%s'" % str(self)) @@ -136,6 +136,7 @@ class Dos33Header(AtrHeader): def __init__(self): AtrHeader.__init__(self, None, 256, 0) + self.starting_sector_label = 0 self.header_offset = 0 self.sector_order = range(16) self.vtoc_sector = 17 * 16