Add Galaxian and Alien Typhoon by the same author, run a2_load.py on them
authorNick Downing <nick@ndcode.org>
Mon, 27 Jun 2022 08:37:16 +0000 (18:37 +1000)
committerNick Downing <nick@ndcode.org>
Tue, 28 Jun 2022 03:21:38 +0000 (13:21 +1000)
.gitignore
loader/Makefile
loader/a2_load.py
loader/alien_typhoon_segments.txt [new file with mode: 0644]
loader/galaxian_segments.txt [new file with mode: 0644]
orig/Makefile

index 7cda1b6..8bcbf80 100644 (file)
@@ -29,7 +29,9 @@
 /emu_65c02/cg_default/*.png
 /emu_65c02/cg_default/*.ppm
 /orig/APPLE Computer and Peripheral Card Roms Collection.zip
+/orig/Alien_Typhoon_1981_Starcraft.do
 /orig/Apple_DOS_v3.3_1980_Apple.do
+/orig/Galaxian_1980_Starcraft.do
 /orig/Star_Blazer_1981_Star_Craft.do
 /shape/dhgr_pixel_shape_data_aux.inc
 /shape/dhgr_pixel_shape_data_main.inc
index e0ba312..0e23618 100755 (executable)
@@ -16,6 +16,8 @@ RECRACK_LOADER=0x9ded
 
 .PHONY: all
 all: \
+galaxian.ihx \
+alien_typhoon.ihx \
 star_blazer_pack_rev.a2bin \
 star_blazer_pack_fwd.a2bin \
 lzss_unpack_rev.bin \
@@ -28,6 +30,25 @@ star_blazer_dejunked0.a2bin \
 star_blazer_dejunked1.a2bin \
 star_blazer_recrack_lzss.a2bin
 
+galaxian.ihx: \
+galaxian.a2bin \
+galaxian_segments.txt \
+Apple\ II+\ -\ 341-0020\ -\ Applesoft\ BASIC\ Autostart\ Monitor\ F800\ -\ 2716.bin
+       ./a2_load.py \
+--f8_rom="Apple II+ - 341-0020 - Applesoft BASIC Autostart Monitor F800 - 2716.bin" \
+0x9707 $< $@ <galaxian_segments.txt
+
+galaxian.a2bin: ../orig/Galaxian_1980_Starcraft.do
+       ${DOS33} $< LOAD "GALAXIAN" $@
+
+alien_typhoon.ihx: \
+alien_typhoon.a2bin \
+alien_typhoon_segments.txt
+       ./a2_load.py 0x8f98 $< $@ <alien_typhoon_segments.txt
+
+alien_typhoon.a2bin: ../orig/Alien_Typhoon_1981_Starcraft.do
+       ${DOS33} $< LOAD "ALIEN TYPHOON" $@
+
 star_blazer_pack_rev.a2bin: lzss_unpack_rev.bin star_blazer.ihx
        ./a2_pack.py --rev ${LOAD_ADDR} $^ $@
 
@@ -80,7 +101,7 @@ star_blazer.ihx: star_blazer.a2bin star_blazer_segments.txt
        ./a2_load.py 0x17d1 $< $@ <star_blazer_segments.txt
 
 star_blazer.a2bin: ../orig/Star_Blazer_1981_Star_Craft.do
-       ${DOS33} ../orig/Star_Blazer_1981_Star_Craft.do LOAD "STAR BLAZER" $@
+       ${DOS33} $^ LOAD "STAR BLAZER" $@
 
 star_blazer_dejunked0.a2bin: star_blazer.a2bin
        ./dejunk.py $< $@ 0
@@ -112,6 +133,12 @@ recrack_loader.ihx: recrack_loader.rel
 recrack_loader.rel: recrack_loader.asm
        ${AS6500} -l -o $<
 
+Apple\ II+\ -\ 341-0020\ -\ Applesoft\ BASIC\ Autostart\ Monitor\ F800\ -\ 2716.bin: \
+../orig/APPLE\ Computer\ and\ Peripheral\ Card\ Roms\ Collection.zip
+       rm -f "$@"
+       unzip "$<" "$@"
+       touch "$@"
+
 clean:
        rm -f \
 *.a2bin \
index 1da1a1b..fc17817 100755 (executable)
@@ -7,8 +7,12 @@ from intelhex import IntelHex
 EXIT_SUCCESS = 0
 EXIT_FAILURE = 1
 
+in_f8_rom = None
+if len(sys.argv) >= 2 and sys.argv[1][:9] == '--f8_rom=':
+  in_f8_rom = sys.argv[1][9:]
+  del sys.argv[1]
 if len(sys.argv) < 4:
-  print(f'usage: {sys.argv[0]:s} entry_point in.a2bin out.ihx <segments.txt')
+  print(f'usage: {sys.argv[0]:s} [--f8_rom=rom.bin] entry_point in.a2bin out.ihx <segments.txt')
   sys.exit(EXIT_FAILURE)
 entry_point = int(sys.argv[1], 0)
 in_a2bin = sys.argv[2]
@@ -39,6 +43,12 @@ assert len(bin) == load_size
 mem = [0] * 0x10000
 mem_used = [False] * 0x10000
 
+if in_f8_rom is not None:
+  with open(in_f8_rom, 'rb') as fin:
+    f8_rom = list(fin.read())
+  assert len(f8_rom) == 0x800
+  mem[0xf800:] = f8_rom
+
 mem[load_addr:load_addr + load_size] = bin
 mem_used[load_addr:load_addr + load_size] = [True] * load_size
 
@@ -61,7 +71,7 @@ while mpu.pc != entry_point:
 if mpu.p & 8:
   print('warning: d = 1')
 if mpu.sp != 0xff:
-  print('warning: s = 0x{mpu.sp:02x}')
+  print(f'warning: s = 0x{mpu.sp:02x}')
 
 segments1 = []
 for i in range(0x10000):
diff --git a/loader/alien_typhoon_segments.txt b/loader/alien_typhoon_segments.txt
new file mode 100644 (file)
index 0000000..61bb66f
--- /dev/null
@@ -0,0 +1 @@
+[0x0400, 0xc000)
diff --git a/loader/galaxian_segments.txt b/loader/galaxian_segments.txt
new file mode 100644 (file)
index 0000000..55a0824
--- /dev/null
@@ -0,0 +1 @@
+[0x4000, 0xc000)
index efe8bc2..5730fe2 100644 (file)
@@ -1,7 +1,9 @@
 .PHONY: all
 all: \
 APPLE\ Computer\ and\ Peripheral\ Card\ Roms\ Collection.zip \
+Alien_Typhoon_1981_Starcraft.do \
 Apple_DOS_v3.3_1980_Apple.do \
+Galaxian_1980_Starcraft.do \
 Star_Blazer_1981_Star_Craft.do
 
 # Apple II+ - 341-0011 - Applesoft BASIC D000 - 2716.bin  
@@ -18,11 +20,19 @@ APPLE\ Computer\ and\ Peripheral\ Card\ Roms\ Collection.zip:
        rm -f $@
        wget https://mirrors.apple2.org.za/ftp.apple.asimov.net/emulators/rom_images/APPLE%20Computer%20and%20Peripheral%20Card%20Roms%20Collection.zip
 
+Alien_Typhoon_1981_Starcraft.do:
+       rm -f $@
+       wget https://archive.org/download/a2_Alien_Typhoon_1981_Starcraft/$@
+
 # really the 1983 release, which I use as DOS reference
 Apple_DOS_v3.3_1980_Apple.do:
        rm -f $@
        wget https://archive.org/download/a2_Apple_DOS_v3.3_1980_Apple/$@
 
+Galaxian_1980_Starcraft.do:
+       rm -f $@
+       wget https://archive.org/download/a2_Galaxian_1980_Starcraft/$@
+
 Star_Blazer_1981_Star_Craft.do:
        rm -f $@
        wget https://archive.org/download/a2_Star_Blazer_1981_Star_Craft/$@
@@ -33,5 +43,7 @@ clean:
 realclean:
        rm -f \
 APPLE\ Computer\ and\ Peripheral\ Card\ Roms\ Collection.zip \
+Alien_Typhoon_1981_Starcraft.do \
 Apple_DOS_v3.3_1980_Apple.do \
+Galaxian_1980_Starcraft.do \
 Star_Blazer_1981_Star_Craft.do