riven: handle wahrk statues

This commit is contained in:
Vince Weaver 2024-08-12 00:22:20 -04:00
parent 821a1214fe
commit 03361602f3
3 changed files with 76 additions and 1 deletions

View File

@ -0,0 +1,31 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: mid_graphics.inc
mid_graphics.inc: \
mid_n.hgr.zx02 mid_s.hgr.zx02 \
mid_w.hgr.zx02 mid_e.hgr.zx02 \
mid_n_open.hgr.zx02
echo "mid_n_zx02: .incbin \"mid_n.hgr.zx02\"" > mid_graphics.inc
echo "mid_s_zx02: .incbin \"mid_s.hgr.zx02\"" >> mid_graphics.inc
echo "mid_w_zx02: .incbin \"mid_w.hgr.zx02\"" >> mid_graphics.inc
echo "mid_e_zx02: .incbin \"mid_e.hgr.zx02\"" >> mid_graphics.inc
echo "mid_n_open_zx02: .incbin \"mid_n_open.hgr.zx02\"" >> mid_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr mid_graphics.inc

View File

@ -97,6 +97,47 @@ really_exit:
rts
;==========================
; handle wahrks
;==========================
handle_wahrks:
; if 11 or less, go left wahrk
; if 29 or more, go right wahrk
; otherwise, go close
lda CURSOR_X
cmp #29
bcs go_right_wahrk
cmp #12
bcc go_left_wahrk
lda #RIVEN_CLOSE
jmp done_dir
go_left_wahrk:
lda #RIVEN_WAHRK_L
jmp done_dir
go_right_wahrk:
lda #RIVEN_WAHRK_R
done_dir:
sta LOCATION
lda #LOAD_CLOSE
sta WHICH_LOAD
lda #DIRECTION_S
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; includes
;==========================

View File

@ -20,4 +20,7 @@ location0:
.word mid_e_zx02 ; east bg
.word mid_w_zx02 ; west bg
.byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST
.byte $FF ; special exit (none)
.byte DIRECTION_S|DIRECTION_ONLY_POINT ; special exit
.byte 7,33
.byte 0,180
.word handle_wahrks-1