mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-28 18:30:37 +00:00
Moved Atari boot disk-specific stuff out of base class
This commit is contained in:
parent
d23f1abda7
commit
e980019bf6
@ -653,12 +653,38 @@ class BootDiskImage(AtariDosDiskImage):
|
|||||||
if bload < 0x200 or bload > (0xc000 - (nsec * self.header.sector_size)):
|
if bload < 0x200 or bload > (0xc000 - (nsec * self.header.sector_size)):
|
||||||
raise InvalidDiskImage("Bad boot load address")
|
raise InvalidDiskImage("Bad boot load address")
|
||||||
|
|
||||||
|
def get_boot_sector_info(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def get_vtoc(self):
|
def get_vtoc(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_directory(self, directory=None):
|
def get_directory(self, directory=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
boot_record_type = np.dtype([
|
||||||
|
('BFLAG', 'u1'),
|
||||||
|
('BRCNT', 'u1'),
|
||||||
|
('BLDADR', '<u2'),
|
||||||
|
('BWTARR', '<u2'),
|
||||||
|
])
|
||||||
|
|
||||||
|
def get_boot_segments(self):
|
||||||
|
data, style = self.get_sectors(1)
|
||||||
|
values = data[0:6].view(dtype=self.boot_record_type)[0]
|
||||||
|
flag = int(values[0])
|
||||||
|
segments = []
|
||||||
|
if flag == 0:
|
||||||
|
num = int(values[1])
|
||||||
|
addr = int(values[2])
|
||||||
|
s = self.get_sector_slice(1, num)
|
||||||
|
r = self.rawdata[s]
|
||||||
|
header = ObjSegment(r[0:6], 0, 0, addr, addr + 6, name="Boot Header")
|
||||||
|
sectors = ObjSegment(r, 0, 0, addr, addr + len(r), name="Boot Sectors")
|
||||||
|
code = ObjSegment(r[6:], 0, 0, addr + 6, addr + len(r), name="Boot Code")
|
||||||
|
segments = [sectors, header, code]
|
||||||
|
return segments
|
||||||
|
|
||||||
def get_vtoc_segments(self):
|
def get_vtoc_segments(self):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -252,28 +252,8 @@ class DiskImageBase(object):
|
|||||||
self.segments.extend(self.get_directory_segments())
|
self.segments.extend(self.get_directory_segments())
|
||||||
self.segments.extend(self.get_file_segments())
|
self.segments.extend(self.get_file_segments())
|
||||||
|
|
||||||
boot_record_type = np.dtype([
|
|
||||||
('BFLAG', 'u1'),
|
|
||||||
('BRCNT', 'u1'),
|
|
||||||
('BLDADR', '<u2'),
|
|
||||||
('BWTARR', '<u2'),
|
|
||||||
])
|
|
||||||
|
|
||||||
def get_boot_segments(self):
|
def get_boot_segments(self):
|
||||||
data, style = self.get_sectors(1)
|
return []
|
||||||
values = data[0:6].view(dtype=self.boot_record_type)[0]
|
|
||||||
flag = int(values[0])
|
|
||||||
segments = []
|
|
||||||
if flag == 0:
|
|
||||||
num = int(values[1])
|
|
||||||
addr = int(values[2])
|
|
||||||
s = self.get_sector_slice(1, num)
|
|
||||||
r = self.rawdata[s]
|
|
||||||
header = ObjSegment(r[0:6], 0, 0, addr, addr + 6, name="Boot Header")
|
|
||||||
sectors = ObjSegment(r, 0, 0, addr, addr + len(r), name="Boot Sectors")
|
|
||||||
code = ObjSegment(r[6:], 0, 0, addr + 6, addr + len(r), name="Boot Code")
|
|
||||||
segments = [sectors, header, code]
|
|
||||||
return segments
|
|
||||||
|
|
||||||
def get_vtoc_segments(self):
|
def get_vtoc_segments(self):
|
||||||
return []
|
return []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user