From dc2224a191374da2e9b59a0889d63c1c8a876af7 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Wed, 10 May 2017 05:44:47 -0700 Subject: [PATCH] Added interesting load effect for first HGR screen --- atrcopy/standard_delivery.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/atrcopy/standard_delivery.py b/atrcopy/standard_delivery.py index 0e67f64..1ecacfe 100644 --- a/atrcopy/standard_delivery.py +++ b/atrcopy/standard_delivery.py @@ -98,7 +98,7 @@ class StandardDeliveryImage(DiskImageBase): count = 0 sector_list = [] - address_list = [0xd0] + address_list = [0xd1] boot_sector = dsk.header.create_sector() boot_sector.sector_num = 0 @@ -106,15 +106,21 @@ class StandardDeliveryImage(DiskImageBase): sector_list.append(boot_sector) for chunk_start, chunk_data in chunks: - i = 0 - hi = chunk_start - while i < len(chunk_data): + count = len(chunk_data) // 256 + if chunk_start == 0x20 and count == 32: + # Assume this is an HGR screen, use interesting load effect, + # not the usual venetian blind + chunk_hi = [0x20, 0x24, 0x28, 0x2c, 0x30, 0x34, 0x38, 0x3c, 0x21, 0x25, 0x29, 0x2d, 0x31, 0x35, 0x39, 0x3d, 0x22, 0x26, 0x2a, 0x2e, 0x32, 0x36, 0x3a, 0x3e, 0x23, 0x27, 0x2b, 0x2f, 0x33, 0x37, 0x3b, 0x3f] + else: + chunk_hi = range(chunk_start, chunk_start + count) + for n in range(count): + i = (chunk_hi[n] - chunk_start) * 256 sector = dsk.header.create_sector(chunk_data[i:i+256]) sector.sector_num = dsk.header.sector_from_track(track, sector_order[index]) count += 1 #sector.sector_num = count sector_list.append(sector) - address_list.append(hi) + address_list.append(chunk_hi[n]) # sector.data[0] = sector.sector_num # sector.data[1] = hi # sector.data[2:16] = 0xff @@ -123,9 +129,8 @@ class StandardDeliveryImage(DiskImageBase): if index >= len(sector_order): index = 0 track += 1 - i += 256 - hi += 1 - address_list.append(0xd0) + if chunk_start == 0x40: + address_list.append(0xd2) print("address list %s" % str(address_list)) boot_code = get_fstbt_code(boot_sector.data, address_list, run_addr)