From 24bdaf795d52c3f59d513065ba240e9e4c21fc3f Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 26 Jan 2020 12:55:29 -0500 Subject: [PATCH] title: hook up to the loader --- linker_scripts/apple2_d00.inc | 12 +++++++++++ ootw/Makefile | 13 ++++++------ ootw/README | 3 +++ ootw/loader.s | 12 +++++------ ootw/title.s | 38 +++++++++++++++++++++++------------ 5 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 linker_scripts/apple2_d00.inc diff --git a/linker_scripts/apple2_d00.inc b/linker_scripts/apple2_d00.inc new file mode 100644 index 00000000..8c314af4 --- /dev/null +++ b/linker_scripts/apple2_d00.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $D00, size = $8E00, 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 cd73eda6..31c01a7f 100644 --- a/ootw/Makefile +++ b/ootw/Makefile @@ -7,10 +7,10 @@ PNG2LZ4 = ../gr-utils/png2lz4 all: ootw.dsk ootw_side2.dsk -ootw.dsk: HELLO LOADER INTRO OOTW_C1 OOTW_C2 OOTW_C3 OOTW_C4 OOTW_C5 +ootw.dsk: HELLO TITLE INTRO OOTW_C1 OOTW_C2 OOTW_C3 OOTW_C4 OOTW_C5 cp empty.dsk ootw.dsk $(DOS33) -y ootw.dsk SAVE A HELLO - $(DOS33) -y ootw.dsk BSAVE -a 0x1400 LOADER + $(DOS33) -y ootw.dsk BSAVE -a 0xd00 TITLE $(DOS33) -y ootw.dsk BSAVE -a 0x1700 INTRO $(DOS33) -y ootw.dsk BSAVE -a 0x1700 OOTW_C1 $(DOS33) -y ootw.dsk BSAVE -a 0x1700 OOTW_C2 @@ -20,11 +20,10 @@ ootw.dsk: HELLO LOADER INTRO OOTW_C1 OOTW_C2 OOTW_C3 OOTW_C4 OOTW_C5 # $(DOS33) -y ootw.dsk BSAVE -a 0x1700 AUDIO_TEST # $(DOS33) -y ootw.dsk BSAVE -a 0x2000 COMPRESS-TEST -ootw_side2.dsk: HELLO TITLE LOADER2 ENDING OOTW_C15 +ootw_side2.dsk: HELLO TITLE ENDING OOTW_C15 cp empty.dsk ootw_side2.dsk $(DOS33) -y ootw_side2.dsk SAVE A HELLO HELLO - $(DOS33) -y ootw_side2.dsk BSAVE -a 0x1000 TITLE - $(DOS33) -y ootw_side2.dsk BSAVE -a 0x1400 LOADER2 LOADER + $(DOS33) -y ootw_side2.dsk BSAVE -a 0xd00 TITLE $(DOS33) -y ootw_side2.dsk BSAVE -a 0x1700 OOTW_C15 $(DOS33) -y ootw_side2.dsk BSAVE -a 0x1700 ENDING @@ -275,7 +274,7 @@ loader2.o: loader2.s #### TITLE: title.o - ld65 -o TITLE title.o -C ../linker_scripts/apple2_1000.inc + ld65 -o TITLE title.o -C ../linker_scripts/apple2_d00.inc title.o: title.s ca65 -o title.o title.s -l title.lst @@ -323,7 +322,7 @@ compress_test.o: compress_test.s lz4_decode.s compress_test.inc ##### clean: - rm -f *~ *.o *.lst *.lz4 HELLO \ + rm -f *~ *.o *.lst *.lz4 HELLO TITLE \ OOTW_C1 OOTW_C2 OOTW_C3 OOTW_C4 INTRO LOADER \ COMPRESS-TEST AUDIO_TEST \ intro_data_01 intro_data_04 intro_data_06 \ diff --git a/ootw/README b/ootw/README index 61b7ad64..643d133f 100644 --- a/ootw/README +++ b/ootw/README @@ -162,6 +162,9 @@ ootw2 memory squeeze: +LOADER=1400 TITLE=1.75k = 7 pages = load at $D00 + + L2 Memory map: 00 zero page diff --git a/ootw/loader.s b/ootw/loader.s index 622b1e10..91e740bd 100644 --- a/ootw/loader.s +++ b/ootw/loader.s @@ -14,7 +14,7 @@ filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86 ; added code to patch it to run from current disk slot -- vmw - WHICH_LOAD = $05 ; thing to load +; WHICH_LOAD = $05 ; thing to load adrlo = $26 ; constant from boot prom adrhi = $27 ; constant from boot prom tmpsec = $3c ; constant from boot prom @@ -22,14 +22,14 @@ filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86 sizelo = $44 sizehi = $45 secsize = $46 - TEMPY = $fa - namlo = $fb - namhi = $fc + namlo = $f8 + namhi = $f9 +; TEMPY = $fa step = $fd ; state for stepper motor tmptrk = $fe ; temporary copy of current track phase = $ff ; current phase for /seek - OUTL = $fe ; for picking filename - OUTH = $ff +; OUTL = $fe ; for picking filename +; OUTH = $ff dirbuf = $c00 ; note, don't put this immediately below diff --git a/ootw/title.s b/ootw/title.s index ce308f7d..43d4c1d8 100644 --- a/ootw/title.s +++ b/ootw/title.s @@ -10,6 +10,7 @@ title: bit TEXT bit PAGE0 + jsr HOME lda #directions_text + sta OUTH + jsr move_and_print_list + +ready_to_load: + jmp $1400 ; LOADER starts here .include "text_print.s" .include "gr_offsets.s" @@ -280,17 +291,18 @@ menu_items: ; 23 wide .byte 8,0,"ENDING ",0 -; 160 POKE 5,A +directions_text: +.byte 8, 0,"LOADING (BE PATIENT...)",0 +.byte 0, 5,"CONTROLS:",0 +.byte 3, 6, "A OR <- : MOVE LEFT",0 +.byte 3, 7, "D OR -> : MOVE RIGHT",0 +.byte 3, 8, "W OR UP : JUMP",0 +.byte 3, 9, "S OR DOWN : CROUCH / PICKUP",0 +.byte 3,10, "SPACEBAR : KICK / SHOOT",0 +.byte 3,11, "L : CHARGE GUN",0 +.byte 3,12, "ESC : QUITS",0 +.byte 255 +.align $100 -; 305 HTAB 8:PRINT "LOADING (BE PATIENT...)" -; 310 PRINT:PRINT:PRINT:PRINT -; 315 PRINT "CONTROLS:" -; 320 PRINT " A OR <- : MOVE LEFT" -; 325 PRINT " D OR -> : MOVE RIGHT" -; 340 PRINT " W OR UP : JUMP" -; 345 PRINT " S OR DOWN : CROUCH / PICKUP" -; 350 PRINT " SPACEBAR : KICK / SHOOT" -; 355 PRINT " L : CHARGE GUN" -; 360 PRINT " ESC : QUITS" - +.include "loader.s"