From 7acf18caa9af5692a2a92e5b5ce6bbab08e4678e Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 2 Mar 2019 10:55:32 -0500 Subject: [PATCH] ootw: intro: this might just work --- linker_scripts/apple2_9000.inc | 12 ++++++++++++ ootw/Makefile | 17 ++++++++++++++++- ootw/README | 3 +++ ootw/intro.s | 23 ++++++++++++++++++++++- ootw/zp.inc | 1 - 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 linker_scripts/apple2_9000.inc diff --git a/linker_scripts/apple2_9000.inc b/linker_scripts/apple2_9000.inc new file mode 100644 index 00000000..95d93f9b --- /dev/null +++ b/linker_scripts/apple2_9000.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $9000, size = $3000, file = %O; +} + +SEGMENTS { +CODE: load = RAM, type = ro, align=$100; +RODATA: load = RAM, type = ro; +DATA: load = RAM, type = rw; +BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = zp; +} diff --git a/ootw/Makefile b/ootw/Makefile index 35812137..4d6fdd5e 100644 --- a/ootw/Makefile +++ b/ootw/Makefile @@ -91,11 +91,26 @@ intro.o: intro.s \ intro_graphics/09_tunnel/intro_tunnel1.inc \ intro_graphics/09_tunnel/intro_tunnel2.inc \ intro_graphics/10_gone/intro_zappo.inc \ - intro_graphics/10_gone/intro_gone.inc + intro_graphics/10_gone/intro_gone.inc \ + intro_data_01.lz4 ca65 -o intro.o intro.s -l intro.lst #### + + +intro_data_01.lz4: intro_data_01 + lz4 -f -16 intro_data_01 + truncate -s-8 intro_data_01.lz4 + +intro_data_01: intro_data_01.o + ld65 -o intro_data_01 intro_data_01.o -C ../linker_scripts/apple2_9000.inc + +intro_data_01.o: intro_data_01.s + ca65 -o intro_data_01.o intro_data_01.s -l intro_data_01.lst + +#### + LOADER: loader.o ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1400.inc diff --git a/ootw/README b/ootw/README index 4156269c..361851dd 100644 --- a/ootw/README +++ b/ootw/README @@ -65,6 +65,9 @@ Memory squeeze! 20000+2000= +Let's take a 10k region of memory = $3000 + $C000 - $3000 = starting at $9000 + ID1 = 1461 2143\ ID2 = 1759 2687| diff --git a/ootw/intro.s b/ootw/intro.s index 6ef0b706..45ce9e78 100644 --- a/ootw/intro.s +++ b/ootw/intro.s @@ -32,6 +32,17 @@ intro: ;=============================== ;=============================== + ;================================== + ; Uncompress the data + ;================================== + lda #intro1_data_lz4 + sta LZ4_SRC+1 + + lda #$90 ; load to $9000 + + jsr lz4_decode ;================================== ; draw the car driving up @@ -1923,4 +1934,14 @@ plot_particle: .endif -.include "intro_data.s" +;.include "intro_data.s" + +DATA_LOCATION = $9000 + +; intro1 +building_sequence = $9840 + +intro1_data_lz4: + .word (intro1_data_lz4_end-intro1_data_lz4) + .incbin "intro_data_01.lz4",11 +intro1_data_lz4_end: diff --git a/ootw/zp.inc b/ootw/zp.inc index b4a3af0d..b8ce6275 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -3,7 +3,6 @@ ;; LZ4 addresses LZ4_SRC = $00 -;LZ4_SRC = $26 LZ4_DST = $02 LZ4_END = $04 WHICH_LOAD = $05