Move the a2_load.py step from /loader into the respective directories
authorNick Downing <nick@ndcode.org>
Wed, 29 Jun 2022 08:24:44 +0000 (18:24 +1000)
committerNick Downing <nick@ndcode.org>
Wed, 29 Jun 2022 08:48:13 +0000 (18:48 +1000)
galaxian/Makefile
galaxian/alien_typhoon0_segments.txt [moved from loader/alien_typhoon_segments.txt with 100% similarity]
galaxian/galaxian0_segments.txt [moved from loader/galaxian_segments.txt with 100% similarity]
loader/Makefile
star_blazer/Makefile
star_blazer/star_blazer0_segments.txt [new file with mode: 0644]

index 02ae9a5..7b8ca48 100644 (file)
@@ -3,8 +3,6 @@ DOS33=../dos33fsprogs/utils/dos33fs-utils/dos33
 AS6500=../asxv5pxx/asxmak/linux/exe/as6500
 ASLINK=../asxv5pxx/asxmak/linux/exe/aslink
 
-LOAD_ADDR=0x800
-
 .PHONY: all
 all: \
 galaxian_shape.png \
@@ -15,27 +13,52 @@ alien_typhoon.asm \
 galaxian_shape.png: galaxian_shape.json
        ./shape_extract_png.py $^ $@
 
-galaxian_shape.json: galaxian.txt ../loader/galaxian.ihx
+galaxian_shape.json: galaxian.txt galaxian0.ihx
        ./shape_extract.py $^ $@
 
 galaxian.asm: \
 galaxian_trace.txt \
 galaxian.txt \
-../loader/galaxian.ihx
+galaxian0.ihx
        ../utils/disasm.py --trace=$^ $@ </dev/null
 
+galaxian0.ihx: \
+galaxian0.a2bin \
+galaxian0_segments.txt \
+Apple\ II+\ -\ 341-0020\ -\ Applesoft\ BASIC\ Autostart\ Monitor\ F800\ -\ 2716.bin
+       ../utils/a2_load.py \
+--f8_rom="Apple II+ - 341-0020 - Applesoft BASIC Autostart Monitor F800 - 2716.bin" \
+0x9707 $< $@ <galaxian0_segments.txt
+
+galaxian0.a2bin: ../orig/Galaxian_1980_Starcraft.do
+       ${DOS33} $< LOAD "GALAXIAN" $@
+
 alien_typhoon_shape.png: alien_typhoon_shape.json
        ./shape_extract_png.py $^ $@
 
-alien_typhoon_shape.json: alien_typhoon.txt ../loader/alien_typhoon.ihx
+alien_typhoon_shape.json: alien_typhoon.txt alien_typhoon0.ihx
        ./shape_extract.py $^ $@
 
 alien_typhoon.asm: \
 alien_typhoon_trace.txt \
 alien_typhoon.txt \
-../loader/alien_typhoon.ihx
+alien_typhoon0.ihx
        ../utils/disasm.py --trace=$^ $@
 
+alien_typhoon0.ihx: \
+alien_typhoon0.a2bin \
+alien_typhoon0_segments.txt
+       ../utils/a2_load.py 0x8f98 $< $@ <alien_typhoon0_segments.txt
+
+alien_typhoon0.a2bin: ../orig/Alien_Typhoon_1981_Starcraft.do
+       ${DOS33} $< LOAD "ALIEN TYPHOON" $@
+
+Apple\ II+\ -\ 341-0020\ -\ Applesoft\ BASIC\ Autostart\ Monitor\ F800\ -\ 2716.bin: \
+../orig/APPLE\ Computer\ and\ Peripheral\ Card\ Roms\ Collection.zip
+       rm -f "$@"
+       unzip "$<" "$@"
+       touch "$@"
+
 .PHONY: clean
 clean:
        rm -f \
index 25fc95b..ce04df1 100755 (executable)
@@ -16,8 +16,6 @@ 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 \
@@ -30,25 +28,6 @@ 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
-       ../utils/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
-       ../utils/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
        ../utils/a2_pack.py --rev ${LOAD_ADDR} $^ $@
 
@@ -133,12 +112,6 @@ 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 ed9c624..4bcebce 100644 (file)
@@ -64,29 +64,29 @@ draw_misc_table.inc
 shape_index_pixel.inc shape_data_pixel.inc: star_blazer.txt shape_pixel.json
        ./shape_compile.py $^ shape_index_pixel.inc shape_data_pixel.inc
 
-shape_pixel.json: star_blazer.txt ../loader/star_blazer.ihx
+shape_pixel.json: star_blazer.txt star_blazer0.ihx
        ./shape_extract.py --pixel $^ $@
 
 shape_index.inc shape_data.inc: star_blazer.txt shape.json
        ./shape_compile.py $^ shape_index.inc shape_data.inc
 
-shape.json: star_blazer.txt ../loader/star_blazer.ihx
+shape.json: star_blazer.txt star_blazer0.ihx
        ./shape_extract.py $^ $@
 
 object_index.inc object_data.inc: star_blazer.txt object.json
        ./object_compile.py 0x4800 $^ object_index.inc object_data.inc
 
-object.json: object_defs.inc star_blazer.txt ../loader/star_blazer.ihx
+object.json: object_defs.inc star_blazer.txt star_blazer0.ihx
        ./object_extract.py --disasm=$^ $@
 
 draw_misc_table.inc: star_blazer.txt draw_misc.json
        ./draw_misc_compile.py $^ $@
 
-draw_misc.json: star_blazer.txt ../loader/star_blazer.ihx
+draw_misc.json: star_blazer.txt star_blazer0.ihx
        ./draw_misc_extract.py $^ $@
 
 star_blazer.asm: \
-../loader/star_blazer.ihx \
+star_blazer0.ihx \
 star_blazer_trace.txt \
 star_blazer.txt \
 star_blazer.asm.patch
@@ -94,6 +94,12 @@ star_blazer.asm.patch
        cp $@ $@0
        patch $@ <$@.patch
 
+star_blazer0.ihx: star_blazer0.a2bin star_blazer0_segments.txt
+       ../utils/a2_load.py 0x17d1 $< $@ <star_blazer0_segments.txt
+
+star_blazer0.a2bin: ../orig/Star_Blazer_1981_Star_Craft.do
+       ${DOS33} $^ LOAD "STAR BLAZER" $@
+
 .PHONY: clean
 clean:
        rm -f \
diff --git a/star_blazer/star_blazer0_segments.txt b/star_blazer/star_blazer0_segments.txt
new file mode 100644 (file)
index 0000000..6b7d274
--- /dev/null
@@ -0,0 +1,36 @@
+# file was constructed from a memory dump after copy protected loader ran
+# after loading at 0x0300:
+#   [0x0300, 0x0303) is jump to crack loader
+#   [0x0303, 0x0a00) is junk
+#   [0x0a00, 0x2000) is program
+#   [0x2000, 0x4000) is hi-res screen 0 which is reused by the crack loader:
+#     [0x2000, 0x27ed) is end of program which is copied to 0x9600
+#     [0x27ed, 0x3200) is junk copied after end of program at 0x9ded
+#     [0x3200, 0x3c00) is junk copied to end of memory at 0xb600
+#     [0x3c00, 0x3f00) is junk copied to start of memory at 0x0000, except:
+#       [0x3c20, 0x3c22) is vec_start (duplicated in crack loader, not used)
+#       [0x3c22, 0x3c24) is vec_init_game
+#       [0x3c24, 0x3c26) is vec_start_game
+#       [0x3c28, 0x3c2a) is vec_calculate_object_shape
+#       [0x3c4e, 0x3c50) is vec_draw_misc_from_table
+#       [0x3e00, 0x3e02) is vec_restart
+#     [0x3f00, 0x3f79) is crack loader
+#     [0x3f79, 0x4000) is junk
+#   [0x4000, 0x8c08) is program
+#   [0x8c08, 0x8e00) is junk which I think is from the shape editor he used
+#   [0x8e00, 0x9600) is program
+[0x0022, 0x0024) # vec_init_game
+[0x0024, 0x0026) # vec_start_game
+[0x0028, 0x002a) # vec_calculate_object_shape
+[0x004e, 0x0050) # vec_draw_misc_from_table
+[0x0200, 0x0202) # vec_restart
+[0x0a00, 0x17f5)
+[0x1800, 0x1dc6)
+[0x1e00, 0x1f39)
+[0x1f80, 0x2000)
+[0x4000, 0x4a10)
+[0x4a80, 0x4a90)
+[0x4b00, 0x4dc0)
+[0x4ed0, 0x4f00)
+[0x4f40, 0x8c08)
+[0x8e00, 0x9ded)