keen: work on hooking up story

This commit is contained in:
Vince Weaver 2024-05-07 01:24:37 -04:00
parent c1fa8afc05
commit 722db32577
2 changed files with 149 additions and 2 deletions

View File

@ -11,7 +11,7 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
all: keen1_lores.dsk
keen1_lores.dsk: HELLO LOADER TITLE ENGINE MARS \
keen1_lores.dsk: HELLO LOADER TITLE STORY ENGINE MARS \
LEVEL1 LEVEL2 LEVEL3 LEVEL4 \
LEVEL5 LEVEL6 LEVEL7 LEVEL8 \
LEVEL9 LEVEL10 LEVEL11 LEVEL12 \
@ -20,6 +20,7 @@ keen1_lores.dsk: HELLO LOADER TITLE ENGINE MARS \
$(DOS33) -y keen1_lores.dsk SAVE A HELLO
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x1000 LOADER
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 TITLE
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 STORY
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 ENGINE
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x4000 MARS
$(DOS33) -y keen1_lores.dsk BSAVE -a 0x6000 LEVEL1
@ -64,6 +65,18 @@ title.o: title.s zp.inc hardware.inc \
####
STORY: story.o
ld65 -o STORY story.o -C ../../linker_scripts/apple2_4000.inc
story.o: story.s zp.inc hardware.inc \
zx02_optim.s \
graphics/keen1_story.hgr.zx02 \
story/story_data.zx02
ca65 -o story.o story.s -l story.lst
####
MARS: mars.o
ld65 -o MARS mars.o -C ../../linker_scripts/apple2_4000.inc
@ -252,7 +265,9 @@ maps/level1_map.lzsa:
####
clean:
rm -f *~ *.o *.lst HELLO LOADER TITLE ENGINE MARS LEVEL1 LEVEL2
rm -f *~ *.o *.lst HELLO LOADER TITLE ENGINE MARS STORY \
LEVEL1 LEVEL2 LEVEL3 LEVEL4 LEVEL5 LEVEL6 LEVEL7 LEVEL8 \
LEVEL9 LEVEL10 LEVEL11 LEVEL12 LEVEL13 LEVEL14 LEVEL15 LEVEL16
cd graphics && make clean
cd maps && make clean
# cd title && make clean

132
games/keen/story.s Normal file
View File

@ -0,0 +1,132 @@
; Keen1 Story
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
story_data = $7000
keen_story_start:
;===================
; init screen
;===================
bit KEYRESET
bit SET_GR
bit PAGE1
bit HIRES
bit FULLGR
;===================
; Load story data
;===================
lda #<compressed_story_data
sta ZX0_src
lda #>compressed_story_data
sta ZX0_src+1
lda #>story_data ; decompress to story data location
jsr full_decomp
;===================
; Load hires graphics
;===================
load_background:
lda #<story_bg
sta ZX0_src
lda #>story_bg
sta ZX0_src+1
lda #$20 ; decompress to hgr page1
jsr full_decomp
wait_until_keypress:
lda KEYPRESS
bpl wait_until_keypress
bit KEYRESET
lda #LOAD_TITLE
sta WHICH_LOAD
rts
;==========================
; includes
;==========================
.include "gr_pageflip.s"
.include "gr_copy.s"
; .include "wait_a_bit.s"
.include "gr_offsets.s"
.include "zx02_optim.s"
.include "text_help.s"
.include "gr_fast_clear.s"
.include "text_print.s"
; .include "lc_detect.s"
story_bg:
.incbin "graphics/keen1_story.hgr.zx02"
compressed_story_data:
.incbin "story/story_data.zx02"
;====================================
; wait for keypress or a few seconds
;====================================
wait_a_bit:
bit KEYRESET
tax
keyloop:
lda #200 ; delay a bit
jsr WAIT
lda KEYPRESS
bmi done_keyloop
; bmi keypress_exit
dex
bne keyloop
done_keyloop:
bit KEYRESET
cmp #'H'|$80
bne really_done_keyloop
bit SET_TEXT
jsr print_help
bit SET_GR
bit PAGE1
ldx #100
jmp keyloop
really_done_keyloop:
rts