cliff: can walk around now

This commit is contained in:
Vince Weaver 2023-08-14 15:11:33 -04:00
parent cbfda75a1e
commit eed939a0e0
4 changed files with 29 additions and 15 deletions

View File

@ -16,7 +16,7 @@ CLIFF: cliff.o
ld65 -o CLIFF cliff.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
cliff.o: cliff.s ../zx02_optim.s \
hgr_copy.s \
hgr_copy.s hgr_partial_save.s \
cliff_graphics/cliff_base.hgr.zx02 \
zp.inc hardware.inc
ca65 -o cliff.o cliff.s -l cliff.lst

View File

@ -33,15 +33,20 @@ cliff_base:
lda #0
sta LEVEL_OVER
sta FRAME
sta PEASANT_XADD
sta PEASANT_YADD
sta PEASANT_DIR ; 0 = up
lda #10
sta PEASANT_X
lda #100
sta PEASANT_Y
; default for peasant quest is the tables are for page2
lda #$40
sta HGR_PAGE
jsr hgr_make_tables
;===================
; Load graphics
;===================
@ -82,7 +87,9 @@ load_image:
jsr full_decomp
jsr hgr_copy
jsr hgr_copy ; copy to page2
bit PAGE2

View File

@ -53,25 +53,27 @@ psx_smc2:
; Y = SAVED_Y1 to SAVED_Y2
hgr_partial_restore:
sta partial_restore_x1_smc+1
stx partial_restore_x2_smc+1
sta partial_restore_x1_smc+1 ; update smc with xtart
stx partial_restore_x2_smc+1 ; update smc with xend
ldx SAVED_Y2
ldx SAVED_Y2 ; X = yend
partial_restore_yloop:
lda hposn_low,X
sta prx_smc2+1
lda hposn_low,X ; get hgr line low address
sta prx_smc2+1 ; update smc
sta prx_smc1+1
lda hposn_high,X
sta prx_smc2+2
sec
sbc #$20
sta prx_smc1+2
lda hposn_high,X ; get hgr line high adress
; in peasant's quest this
; defaults to the $40 (page2)
sta prx_smc2+2 ; dest (page2)
eor #$60
sta prx_smc1+2 ; src (page1)
partial_restore_x2_smc:
ldy #$27
ldy #$27 ; xend (smc)
partial_restore_xloop:
prx_smc1:
lda $d000,Y
@ -79,7 +81,7 @@ prx_smc2:
sta $d000,Y
dey
partial_restore_x1_smc:
cpy #$00
cpy #$00 ; xstart (smc)
bpl partial_restore_xloop
dex

View File

@ -9,6 +9,10 @@
; make /7 %7 tables
;=====================
; HGR_PAGE should be $20/$40 to select if default for hposn
; is page1 or page2
hgr_make_tables:
ldy #0
@ -124,6 +128,7 @@ hposn:
and #$1F
ora HGR_PAGE ; default is $40 in this game
sta GBASH
; txa