peasant: move over cliff climbing lvel

still not tested but it compiles
This commit is contained in:
Vince Weaver 2024-10-07 16:30:41 -04:00
parent 98b56d422f
commit 71490f8589
18 changed files with 2008 additions and 38 deletions

View File

@ -0,0 +1,44 @@
include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../..utils/hgr-utils/png2hgr
LINKER_SCRIPTS = ../../../linker_scripts
all: CLIMB
####
CLIMB: climb.o
ld65 -o CLIMB climb.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
climb.o: climb.s \
../zp.inc ../hardware.inc ../qload.inc ../version.inc \
draw_peasant_climb.s move_peasant_climb.s \
keyboard_climb.s \
sprites/enemy_sprites.inc \
../cliff_base/graphics_cliff/cliff_base.hgr.zx02 \
graphics_cliff/cliff2.hgr.zx02 \
graphics_cliff/cliff3.hgr.zx02
ca65 -o climb.o climb.s -l climb.lst
####
graphics_cliff/cliff2.hgr.zx02:
cd graphics_cliff && make
sprites/enemy_sprites.inc:
cd sprites && make
####
clean:
rm -f *.lst *.o *~ CLIFF CLIMB HELLO *.zx02
cd graphics_cliff && make clean
cd sprites && make clean
####
distclean: clean

997
games/peasant/climb/climb.s Normal file
View File

@ -0,0 +1,997 @@
; Cliff climb minigame from Peasant's Quest
;
; the actual climbing part
; by deater (Vince Weaver) <vince@deater.net>
.include "../zp.inc"
.include "../hardware.inc"
;.include "../peasant_sprite.inc"
.include "../qload.inc"
collision_location = $bc00
LOCATION_BASE = LOCATION_CLIMB
; defines
MAX_ROCKS = 3
cliff_climb:
jsr reset_enemy_state
bit HIRES ; init graphics
bit FULLGR
bit SET_GR
bit PAGE1
lda #0 ; init variables
sta LEVEL_OVER
sta FRAME
sta PEASANT_XADD
sta PEASANT_YADD
sta PEASANT_DIR ; 0 = up
sta PEASANT_STEPS
sta FLAME_COUNT
sta CLIMB_COUNT
sta MAP_LOCATION
sta PEASANT_FALLING
sta MAX_HEIGHT
lda #22 ; starting location
sta PEASANT_X
lda #86
sta PEASANT_Y
; default for peasant quest is the tables are for page2
lda #$40
sta HGR_PAGE
jsr hgr_make_tables
jsr load_graphics
;========================
; Load Peasant Sprites
;========================
lda #<climbing_sprite_data
sta zx_src_l+1
lda #>climbing_sprite_data
sta zx_src_h+1
lda #$a0
jsr zx02_full_decomp
;==========================
;==========================
; main loop
;==========================
;==========================
game_loop:
;=====================
; move peasant
jsr move_peasant
;=====================
; draw peasant
jsr draw_peasant_climb
;=====================
;=====================
; draw enemies
;=====================
;=====================
;=====================
; draw bird
;=====================
draw_bird:
; erase the bird if needed
ldy #0 ; always in erase slot 0
jsr hgr_partial_restore_by_num
; only draw bird if it's out
lda bird_out
beq done_draw_bird
; load in X/Y co-ords
lda bird_x
sta SPRITE_X
lda bird_y
sta SPRITE_Y
; get wing flapping (which sprite) based on frame count
lda FRAME
and #1
tax
ldy #0 ; bird always erase slot #0
jsr hgr_draw_sprite
done_draw_bird:
;=====================
; draw rock
;=====================
lda #0
sta CURRENT_ROCK
draw_rock_loop:
ldy CURRENT_ROCK
iny ; rock erase slot=rock+1
jsr hgr_partial_restore_by_num
ldx CURRENT_ROCK
lda rock_x,X
sta SPRITE_X
lda rock_y,X
sta SPRITE_Y
lda rock_state,X
beq do_draw_rock
cmp #3 ; 1,2=exploding
bcc do_explode_rock ; blt
; if we get here, rock not out
; for now just skip
bcs skip_rock
do_explode_rock:
; explode is 1 or 2
; map to 6,7 or 12,13
lda rock_type,X
beq explode_big_rock
explode_small_rock:
lda #11
bne explode_common_rock ; bra
explode_big_rock:
lda #5
explode_common_rock:
clc
adc rock_state,X
bne really_draw_rock
do_draw_rock:
lda rock_type,X
beq draw_big_rock
draw_small_rock:
lda #8
bne draw_common_rock ; bra
draw_big_rock:
lda #2
draw_common_rock:
sta rock_add_smc+1
lda FRAME
and #3
clc
rock_add_smc:
adc #2 ; rock
really_draw_rock:
tax
; erase slot = rock+1
ldy CURRENT_ROCK
iny
jsr hgr_draw_sprite
skip_rock:
inc CURRENT_ROCK
lda CURRENT_ROCK
cmp #MAX_ROCKS
bne draw_rock_loop
;=====================
;=====================
; move enemies
;=====================
;=====================
;=====================
; bird
lda bird_out
bne move_bird
maybe_new_bird:
jsr random16
bird_freq_smc:
and #$1f ; 1/32 of time start new bird?
bne move_bird_done
; bird on base level, 12 .. 76 (MAP_LOCATION==0)
; bird on other levels, 12 .. 140
jsr random16
ldx MAP_LOCATION
bne new_bird_wider
and #$3f ; 0... 64
new_bird_wider:
and #$7f ; 0... 128
clc
adc #12 ; skip top bar
sta bird_y
lda #37
sta bird_x
inc bird_out
jmp move_bird_done
move_bird:
;=========================
; collision detect here
jsr bird_collide
bcc no_bird_collision
; collision happened!
lda #1
sta PEASANT_FALLING
no_bird_collision:
dec bird_x
bpl move_bird_done
; off screen here
lda #0
sta bird_out
move_bird_done:
;=====================
; rock
ldx #0
stx CURRENT_ROCK
move_rock_loop:
ldx CURRENT_ROCK
lda PEASANT_FALLING
bne no_rock_collision
; collision detect
jsr rock_collide
bcc no_rock_collision
; collision happened!
lda #1
sta PEASANT_FALLING
no_rock_collision:
lda rock_state,X
beq move_rock_normal
cmp #3
bcc move_rock_exploding
move_rock_waiting:
; see if start new rock
jsr random16
rock_freq_smc:
and #$1f ; 1/32 of time start new rock
bne rock_good
start_new_rock:
; pick x position
; bit of a hack, really should be from 0..38
; but we actually do 2..34 as it's easier
jsr random16
and #$1f ; 0... 31
clc
adc #2 ; push away from edge a bit
sta rock_x,X
lda #12 ; start at top
sta rock_y,X
lda #0 ; put in falling state
sta rock_state,X
jmp rock_good
move_rock_exploding:
inc rock_state,X
jmp rock_good
move_rock_normal:
; two states. If MAP_LOCATION==0, if ypos>105 start exploding
; else if ypos>190 or so just go away
; sprite code will truncate sprite so we don't
; run off screen and corrupt memory
clc
lda rock_y,X
rock_speed_smc:
adc #3
sta rock_y,X
ldy MAP_LOCATION
beq move_rock_base_level
move_rock_upper_level:
cmp #190 ; if > 168 make disappear
bcc rock_good
lda #3 ; make it go away
sta rock_state,X
bne rock_good ; bra
move_rock_base_level:
cmp #105
bcc rock_good
rock_start_explode:
lda #1
sta rock_state,X
rock_good:
inc CURRENT_ROCK
lda CURRENT_ROCK
cmp #MAX_ROCKS
bne move_rock_loop
;=====================
; increment frame
inc FRAME
inc FLAME_COUNT
lda FLAME_COUNT
cmp #3
bne flame_good
lda #0
sta FLAME_COUNT
flame_good:
;=====================
; check keyboard
jsr check_keyboard
;===========================
; check level over
; a few ways to get here
; 0 = fine, keep going
; $FF = hit top of screen, go to next
; $FF = falling and going down to next
; $80 = falling, end of game, key pressed
; ? = won game
lda LEVEL_OVER
cmp #$80
beq cliff_game_over
lda LEVEL_OVER
bne cliff_reload_bg
; delay
lda #200
jsr wait
jmp game_loop
cliff_game_over:
; jsr clear_gr_all
; bit SET_TEXT
; bit PAGE1
; update max height attained
; lda MAX_HEIGHT
; and #$f
; clc
; adc #$30
; sta losing_number+1
; lda MAX_HEIGHT
; lsr
; lsr
; lsr
; lsr
; clc
; adc #$30
; sta losing_number
; lda #<losing_text
; sta OUTL
; lda #>losing_text
; sta OUTH
; jsr move_and_print_list
; bit KEYRESET
;wait_until_keypress2:
; lda KEYPRESS ; 4
; bpl wait_until_keypress2 ; 3
; cmp #'N'|$80
; beq exit_game
; cmp #'n'|$80
; beq exit_game
; bit KEYRESET ; clear the keyboard buffer
; jmp restart_game
exit_game:
; FIXME
lda #0
sta WHICH_LOAD
rts ; will this work?
cliff_reload_bg:
jsr reset_enemy_state
jsr load_graphics
lda #0
sta LEVEL_OVER
jmp game_loop
load_graphics:
;========================
; Load Priority graphics
;========================
ldx MAP_LOCATION
cpx #2
bcc priority_normal
; here if map_location above 2
; for coach z version make it harder in this case
lda #$f
sta bird_freq_smc+1
sta rock_freq_smc+1
txa
sta rock_speed_smc+1 ; rock speed prop to level
ldx #2
priority_normal:
lda priority_data_l,X
sta zx_src_l+1
lda priority_data_h,X
sta zx_src_h+1
lda #$20 ; temporarily load to $2000
jsr zx02_full_decomp
; copy to $400
jsr gr_copy_to_page1
; copy collision detection info
ldx #0
col_copy_loop:
lda $2400,X
sta collision_location,X
inx
bne col_copy_loop
;=============================
;==========================
; Load Background Graphics
;===========================
ldx MAP_LOCATION
; extra for Z variant
; repeat level 2 over and over
cpx #2
bcc bg_normal
ldx #2
bg_normal:
lda bg_data_l,X
sta zx_src_l+1
lda bg_data_h,X
sta zx_src_h+1
lda #$20
jsr zx02_full_decomp
jsr hgr_copy ; copy to page2
bit PAGE2
rts
;====================================
; includes
; .include "hgr_tables.s"
.include "../hgr_sprite.s"
; .include "zx02_optim.s"
.include "../wait.s"
.include "keyboard_climb.s"
.include "draw_peasant_climb.s"
.include "move_peasant_climb.s"
.include "../hgr_partial_restore.s"
; .include "text_print.s" ; for z version
.include "../gr_copy.s"
.include "../hgr_copy.s"
; .include "random16.s"
.include "../gr_offsets.s"
.include "../hgr_sprite_bg_mask.s"
priority_data_l:
.byte <priority_cliff1,<priority_cliff2,<priority_cliff3
priority_data_h:
.byte >priority_cliff1,>priority_cliff2,>priority_cliff3
bg_data_l:
.byte <bg_cliff1,<bg_cliff2,<bg_cliff3
bg_data_h:
.byte >bg_cliff1,>bg_cliff2,>bg_cliff3
bg_cliff1:
.incbin "../cliff_base/graphics_cliff/cliff_base.hgr.zx02"
bg_cliff2:
.incbin "graphics_cliff/cliff2.hgr.zx02"
bg_cliff3:
.incbin "graphics_cliff/cliff3.hgr.zx02"
priority_cliff1:
.incbin "../cliff_base/graphics_cliff/cliff_base_priority.zx02"
priority_cliff2:
.incbin "graphics_cliff/cliff2_priority.zx02"
priority_cliff3:
.incbin "graphics_cliff/cliff3_priority.zx02"
sprites:
.include "sprites/enemy_sprites.inc"
sprites_xsize:
.byte 3, 3 ; bird
.byte 3, 3, 3, 3 ; bigrock
.byte 3, 4 ; bigrock_crash
.byte 2, 2, 2, 2 ; smallrock
.byte 2, 4 ; smallrock_crash
sprites_ysize:
.byte 16,14 ; bird
.byte 23,22,21,22 ; bigrock
.byte 18,21 ; bigrock_crash
.byte 15,14,15,14 ; smallrock
.byte 15,19 ; smallrock_crash
sprites_data_l:
.byte <bird0_sprite,<bird1_sprite
.byte <bigrock0_sprite,<bigrock1_sprite
.byte <bigrock2_sprite,<bigrock3_sprite
.byte <bigrock_crash0_sprite,<bigrock_crash1_sprite
.byte <smallrock0_sprite,<smallrock1_sprite
.byte <smallrock2_sprite,<smallrock3_sprite
.byte <smallrock_crash0_sprite,<smallrock_crash1_sprite
sprites_data_h:
.byte >bird0_sprite,>bird1_sprite
.byte >bigrock0_sprite,>bigrock1_sprite
.byte >bigrock2_sprite,>bigrock3_sprite
.byte >bigrock_crash0_sprite,>bigrock_crash1_sprite
.byte >smallrock0_sprite,>smallrock1_sprite
.byte >smallrock2_sprite,>smallrock3_sprite
.byte >smallrock_crash0_sprite,>smallrock_crash1_sprite
sprites_mask_l:
.byte <bird0_mask,<bird1_mask
.byte <bigrock0_mask,<bigrock1_mask
.byte <bigrock2_mask,<bigrock3_mask
.byte <bigrock_crash0_mask,<bigrock_crash1_mask
.byte <smallrock0_mask,<smallrock1_mask
.byte <smallrock2_mask,<smallrock3_mask
.byte <smallrock_crash0_mask,<smallrock_crash1_mask
sprites_mask_h:
.byte >bird0_mask,>bird1_mask
.byte >bigrock0_mask,>bigrock1_mask
.byte >bigrock2_mask,>bigrock3_mask
.byte >bigrock_crash0_mask,>bigrock_crash1_mask
.byte >smallrock0_mask,>smallrock1_mask
.byte >smallrock2_mask,>smallrock3_mask
.byte >smallrock_crash0_mask,>smallrock_crash1_mask
.if 0
;========================================
; background restore parameters
; currently 5, should check this and error if we overflow
; tried to dynamically do this, but in the end hard-coded
; 0 = bird
; 1,2,3 = boulders
; 4 = peasant
; 5 = flame
save_valid:
.byte 0, 0, 0, 0, 0, 0
save_xstart:
.byte 0, 0, 0, 0, 0, 0
save_xend:
.byte 0, 0, 0, 0, 0, 0
save_ystart:
.byte 0, 0, 0, 0, 0, 0
save_yend:
.byte 0, 0, 0, 0, 0, 0
.endif
;========================================
; data for the enemies
bird_out:
.byte 0
bird_x:
.byte 37
bird_y:
.byte 75
rock_type: ; 0=big, 1=little
.byte 0, 1, 0
rock_state:
.byte 3, 3, 3 ; 0 = falling, 1,2 = exploding, 3 = waiting?
rock_x:
.byte 7, 12, 17 ; remember, /7
rock_y:
.byte 12,12,12
climbing_sprite_data:
.incbin "../sprites_peasant/climbing_sprites.zx02"
peasant_sprite_offset = $a000
peasant_sprites_xsize = peasant_sprite_offset+0
peasant_sprites_ysize = peasant_sprite_offset+34
peasant_sprites_data_l = peasant_sprite_offset+68
peasant_sprites_data_h = peasant_sprite_offset+102
peasant_mask_data_l = peasant_sprite_offset+136
peasant_mask_data_h = peasant_sprite_offset+170
; call this when restarting, also when move to new screen
reset_enemy_state:
lda #0
sta bird_out
lda #3
sta rock_state
sta rock_state+1
sta rock_state+2
rts
;===========================
; check for bird collisions
bird_collide:
; bird is 3x16
; peasant is 3x30
; doing a sort of Minkowski Sum collision detection here
; with the rectangular regions
; might be faster to set it up so you can subtract, but that leads
; to issues when we go negative and bcc/bcs are unsigned compares
; if (bird_x+1<PEASANT_X-1) no_collide
; equivalent, if (bird_x+2<PEASANT_X)
; equivalent, if (PEASANT_X-1 >= bird_x+1)
lda bird_x
sta TEMP_CENTER
inc TEMP_CENTER ; bird_x+1
sec
lda PEASANT_X
sbc #1 ; A is PEASANT_X-1
cmp TEMP_CENTER ; compare with bird_x+1
bcs bird_no_collide ; bge
; if (bird_x+1>=PEASANT_X+3) no collide
; equivalent, if (bird_x-2>=PEASANT_X)
; equivalent, if (PEASANT_X+3<bird_x+1)
; carry clear here
adc #4 ; A is now PEASANT_X+3
cmp TEMP_CENTER
bcc bird_no_collide ; blt
; if (bird_y+8<PEASANT_Y-8) no_collide
; equivalent, if (bird_y+16<PEASANT_Y)
; equivalent, if (PEASANT_Y-8>=bird_y+8)
lda bird_y
clc
adc #8
sta TEMP_CENTER
lda PEASANT_Y
sec
sbc #8 ; A is now PEASANT_Y-8
cmp TEMP_CENTER
bcs bird_no_collide ; blt
; if (bird_Y+8>=PEASANT_Y+38) no collide
; equivalent, if (bird_y-30>=PEASANT_Y)
; equivalent, if (PEASANT_Y+38<bird_y+8)
; carry clead here
adc #38 ; A is now bird_y+30
cmp TEMP_CENTER
bcc bird_no_collide ; blt
bird_yes_collide:
sec
rts
bird_no_collide:
clc
rts
;===========================
; check for rock collisions
;===========================
; which rock in X
rock_collide:
; first check if out
lda rock_state,X
bne rock_no_collide ; don't collide if not falling
; 0 = bit, 1 = little
lda rock_type,X
bne little_rock_collide
;===========================
; big rock collide
big_rock_collide:
; big rock is 3x22
; little rock is 2x14
; peasant is 3x30
; doing a sort of Minkowski Sum collision detection here
; with the rectangular regions
; might be faster to set it up so you can subtract, but that leads
; to issues when we go negative and bcc/bcs are unsigned compares
; if (rock_x+1<PEASANT_X-1) no_collide
; equivalent, if (rock_x+2<PEASANT_X)
; equivalent, if (PEASANT_X-1 >= rock_x+1)
lda rock_x,X
sta TEMP_CENTER
inc TEMP_CENTER ; rock_x+1
sec
lda PEASANT_X
sbc #1 ; A is PEASANT_X-1
cmp TEMP_CENTER ; compare with rock_x+1
bcs rock_no_collide ; bge
; if (rock_x+1>=PEASANT_X+3) no collide
; equivalent, if (rock_x-2>=PEASANT_X)
; equivalent, if (PEASANT_X+3<rock_x+1)
; carry clear here
adc #4 ; A is now PEASANT_X+3
cmp TEMP_CENTER
bcc rock_no_collide ; blt
; bird = 16
; rock = 22
; if (rock_y+11<PEASANT_Y-11) no_collide
; equivalent, if (rock_y+22<PEASANT_Y)
; equivalent, if (PEASANT_Y-11>=rock_y+11)
lda rock_y,X
clc
adc #11
sta TEMP_CENTER
lda PEASANT_Y
sec
sbc #11 ; A is now PEASANT_Y-11
cmp TEMP_CENTER
bcs rock_no_collide ; blt
; if (rock_Y+11>=PEASANT_Y+41) no collide
; equivalent, if (rock_y-30>=PEASANT_Y)
; equivalent, if (PEASANT_Y+41<rock_y+11)
; carry clear here
adc #41 ; A is now bird_y+30
cmp TEMP_CENTER
bcc rock_no_collide ; blt
rock_yes_collide:
sec
rts
rock_no_collide:
clc
rts
;=================================
; little rock collision
; Arkansas here we come
little_rock_collide:
; little rock is 2x14
; peasant is 3x30
; doing a sort of Minkowski Sum collision detection here
; with the rectangular regions
; if (PEASANT_X >= rock_x+2) no collide
; rr
; ppp
lda rock_x,X
sta TEMP_CENTER
inc TEMP_CENTER ; rock_x+1
inc TEMP_CENTER ; rock_x+2
sec
lda PEASANT_X ; A is PEASANT_X
cmp TEMP_CENTER ; compare with rock_x+1
bcs rock_no_collide ; bge
; if (PEASANT_X+3<rock_x)
; if (PEASANT_X+5<rock_x+2)
; rrzz
; pppzz
; carry clear here
adc #5 ; A is now PEASANT_X+5
cmp TEMP_CENTER ; rock_x+2
bcc rock_no_collide ; blt
; bird = 16
; big rock = 22
; little rock = 14
; if (rock_y+7<PEASANT_Y-7) no_collide
; equivalent, if (rock_y+14<PEASANT_Y)
; equivalent, if (PEASANT_Y-7>=rock_y+7)
lda rock_y,X
clc
adc #7
sta TEMP_CENTER
lda PEASANT_Y
sec
sbc #7 ; A is now PEASANT_Y-7
cmp TEMP_CENTER
bcs rock_no_collide ; blt
; if (rock_Y+7>=PEASANT_Y+37) no collide
; equivalent, if (rock_y-30>=PEASANT_Y)
; equivalent, if (PEASANT_Y+37<rock_y+7)
; carry clear here
adc #27 ; A is now bird_y+30
cmp TEMP_CENTER
bcc rock_no_collide ; blt
bcs rock_yes_collide ; bra

View File

@ -0,0 +1,157 @@
;===================================
; draw peasant -- climbing version
;===================================
draw_peasant_climb:
; skip if room over, as otherwise we'll draw at the
; wrong edge of screen
lda LEVEL_OVER
bne done_draw_peasant
lda PEASANT_X ; needed? should we hard-code?
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
lda PEASANT_FALLING ; only for climbing minigame
bne draw_peasant_falling
; get offset for graphics
ldx PEASANT_DIR
lda peasant_climb_offsets,X
clc
ldx CLIMB_COUNT
adc peasant_extra_offset,X
tax
ldy #4 ; reserved for peasant
jsr hgr_draw_sprite_bg_mask
;=============================
; draw flame if applicable
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sec
sbc #4
sta CURSOR_Y
; get offset for graphics
ldx PEASANT_DIR
lda peasant_flame_offsets,X
clc
adc FLAME_COUNT
tax
ldy #5 ; reserved for flame
jsr hgr_draw_sprite_bg_mask
done_draw_peasant:
rts
;================================
draw_peasant_falling:
; PEASANT_FALLING already in A here
; 1 = falling
; 2 = crashing
; 3 = crashed
cmp #1 ; if falling then handle that
beq yep_really_falling ;
lda #(32-2) ; base splat sprite
clc ; -1 as we are 2/3 here
adc PEASANT_FALLING
bne yep_falling_common ; bra
yep_really_falling:
; get offset for graphics
lda FRAME ; always spinning, spinning
and #$3
clc
adc #28 ; peasant fall offset
yep_falling_common:
tax
ldy #4 ; reserved for peasant
jsr hgr_draw_sprite_bg_mask
;=============================
; draw flame if applicable
lda PEASANT_X
sta CURSOR_X
lda PEASANT_FALLING ; if falling, adjust from table
cmp #1
beq flame_adjust_falling
; otherwise, always adjust as if it's 1
ldx #1
bne flame_adjust_mid ; bra
flame_adjust_falling:
lda FRAME
and #3
tax
flame_adjust_mid:
lda peasant_flame_fall_yadjust,X
clc
adc PEASANT_Y
sec
sbc #4
sta CURSOR_Y
; get offset for graphics
ldx PEASANT_DIR
lda peasant_flame_offsets,X
clc
adc FLAME_COUNT
tax
ldy #5 ; reserved for flame
jsr hgr_draw_sprite_bg_mask
rts
; UP RIGHT LEFT DOWN = 0, 1, 2, 3
peasant_climb_offsets:
.byte 8, 0, 4, 12
; note, when climbing, flame is on right for both up and down
; left seems to be same as up
peasant_flame_offsets:
; .byte 22,16,19,25
.byte 25,16,19,25
; head at different heights so move flame with it
peasant_flame_fall_yadjust:
.byte 11,16,16,0
; note: animation actually 5 frames
; essentially counts down 3,2,1,0 then 0 again
peasant_extra_offset:
.byte 0,0,1,2,3

View File

@ -0,0 +1,93 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
PNG2GR = ../../../../utils/gr-utils/png2gr
PNG2SPRITES = ../../../../utils/gr-utils/png2sprites
HGR_SPRITE = ../../../../utils/hgr-utils/hgr_make_sprite
PNG2COLLISION = ../../../../utils/gr-utils/png2collision
all: cliff2.hgr.zx02 cliff2_priority.zx02 \
cliff3.hgr.zx02 cliff3_priority.zx02
####
cliff_base.hgr.zx02: cliff_base.hgr
$(ZX02) cliff_base.hgr cliff_base.hgr.zx02
cliff_base.hgr: cliff_base.png
$(PNG_TO_HGR) cliff_base.png > cliff_base.hgr
####
cliff2.hgr.zx02: cliff2.hgr
$(ZX02) cliff2.hgr cliff2.hgr.zx02
cliff2.hgr: cliff2.png
$(PNG_TO_HGR) cliff2.png > cliff2.hgr
####
cliff3.hgr.zx02: cliff3.hgr
$(ZX02) cliff3.hgr cliff3.hgr.zx02
cliff3.hgr: cliff3.png
$(PNG_TO_HGR) cliff3.png > cliff3.hgr
####
cliff_base_priority.zx02: cliff_base_priority.combined
$(ZX02) -f cliff_base_priority.combined cliff_base_priority.zx02
cliff_base_priority.combined: cliff_base_priority.gr cliff_base_collision.bin
cat cliff_base_priority.gr > cliff_base_priority.combined
cat cliff_base_collision.bin >> cliff_base_priority.combined
cliff_base_priority.gr: cliff_base_priority.png
$(PNG2GR) cliff_base_priority.png cliff_base_priority.gr
cliff_base_collision.bin: cliff_base_collision.png
$(PNG2COLLISION) cliff_base_collision.png cliff_base_collision.bin
####
cliff2_priority.zx02: cliff2_priority.combined
$(ZX02) -f cliff2_priority.combined cliff2_priority.zx02
cliff2_priority.combined: cliff2_priority.gr cliff2_collision.bin
cat cliff2_priority.gr > cliff2_priority.combined
cat cliff2_collision.bin >> cliff2_priority.combined
cliff2_priority.gr: cliff2_priority.png
$(PNG2GR) cliff2_priority.png cliff2_priority.gr
cliff2_collision.bin: cliff2_collision.png
$(PNG2COLLISION) cliff2_collision.png cliff2_collision.bin
####
cliff3_priority.zx02: cliff3_priority.combined
$(ZX02) -f cliff3_priority.combined cliff3_priority.zx02
cliff3_priority.combined: cliff3_priority.gr cliff3_collision.bin
cat cliff3_priority.gr > cliff3_priority.combined
cat cliff3_collision.bin >> cliff3_priority.combined
cliff3_priority.gr: cliff3_priority.png
$(PNG2GR) cliff3_priority.png cliff3_priority.gr
cliff3_collision.bin: cliff3_collision.png
$(PNG2COLLISION) cliff3_collision.png cliff3_collision.bin
####
clean:
rm -f *~ *.o *.bin *.combined *.hgr *.gr *.zx02 *.lst
distclean: clean

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,166 @@
;==========================
; check keyboard
; for climbig part
;==========================
; note, this is different from the rest of the game
; pushing l/r/u/d only does one 5-frame animation of movement
;
; pressing another key while movement underway does not
; cancel/override
;
; holding down key just restarts from scratch
check_keyboard:
lda PEASANT_FALLING
beq keyboard_not_falling
; if on ground then exit if keypressed
cmp #3 ; on ground
beq keyboard_on_ground
; still falling, clear strobe and exit
on_ground_exit:
bit KEYRESET
rts
keyboard_on_ground:
lda KEYPRESS
bpl on_ground_exit ; if no press, exit
lda #$80 ; done
sta LEVEL_OVER
rts
keyboard_not_falling:
lda KEYPRESS
bmi key_was_pressed
rts
key_was_pressed:
inc SEEDL ; ????
and #$7f ; strip off high
cmp #$96
bcc no_upper_convert ; blt
and #$5f ; strip off high bit and make uppercase
no_upper_convert:
; what if punctuation like / which is $2F
; 0101 1111 & 0010 1111 -> 0xF
;===========================
; check moving
;===========================
; only start moving if currently not
check_moving:
ldx CLIMB_COUNT
beq check_left
done_check_moving:
jmp done_check_keyboard
;==========================
; Left
;==========================
check_left:
cmp #$8
beq left_pressed
cmp #'A'
bne check_right
left_pressed:
lda #PEASANT_DIR_LEFT
sta PEASANT_DIR
lda #$FF
sta PEASANT_XADD
bne done_keyboard_reset ; bra
check_right:
cmp #$15
beq right_pressed
cmp #'D'
bne check_up
right_pressed:
lda #PEASANT_DIR_RIGHT
sta PEASANT_DIR
lda #$1
sta PEASANT_XADD
bne done_keyboard_reset ; bra
check_up:
cmp #'W'
beq up_pressed
cmp #';' ; for Apple II+
beq up_pressed
cmp #$0B
bne check_down
up_pressed:
lda #PEASANT_DIR_UP
sta PEASANT_DIR
lda #$FE ; -2
sta PEASANT_YADD
bne done_keyboard_reset ; bra
check_down:
cmp #'S'
beq down_pressed
cmp #'/' ; for Apple II+
beq down_pressed
cmp #$0A
bne check_enter
down_pressed:
lda #PEASANT_DIR_DOWN
sta PEASANT_DIR
; don't go down if below 160 or so?
lda PEASANT_Y
cmp #157
bcs done_keyboard_reset ; bge
lda #$2 ; 2
sta PEASANT_YADD
bne done_keyboard_reset ; bra
check_enter:
cmp #13
beq enter_pressed
cmp #' '
bne done_check_keyboard
enter_pressed:
done_keyboard_reset:
lda #5 ; decremented once before use
sta CLIMB_COUNT ; start climbing
bit KEYRESET
done_check_keyboard:
; bit KEYRESET ; should we?
rts

View File

@ -0,0 +1,368 @@
; Move that Peasant!
; climbing edition
; note: left/right across screen is roughly 24 keypresses
; width on Apple II roughly 30 across
; so the full animation should in the end only move one box, not 4?
move_peasant:
lda PEASANT_FALLING
beq peasant_not_falling
peasant_falling:
; if PEASANT_FALLING == 1, then falling
; if PEASANT_FALLING == 2, then crashing
; if PEASANT_FALLING == 3, then crashed
lda PEASANT_FALLING
cmp #3
bcs done_falling_peasant ; bge
; restore bg behind peasant
jsr erase_peasant
; falling, see if hit bottom
;
lda MAP_LOCATION
beq check_falling_hit_ground
; otherwise see if hit bottom of screen
lda PEASANT_Y
cmp #180
bcc move_falling_peasant
; new screen
dec MAP_LOCATION
lda #12 ; move back to top of screen
sta PEASANT_Y
jsr reset_enemy_state
lda #$FF
sta LEVEL_OVER
jmp done_falling_peasant
check_falling_hit_ground:
lda PEASANT_Y
cmp #115
bcc move_falling_peasant
; if here, finish falling
inc PEASANT_FALLING
jmp done_falling_peasant
move_falling_peasant:
inc PEASANT_Y
inc PEASANT_Y
done_falling_peasant:
rts
peasant_not_falling:
; redraw peasant if moved
lda CLIMB_COUNT
bne really_move_peasant
jmp peasant_the_same
really_move_peasant:
; decrement climb count
dec CLIMB_COUNT
bne climb_continue
climb_stop:
jsr stop_peasant
climb_continue:
; restore bg behind peasant
jsr erase_peasant
;=========================
;=========================
; move peasant
;=========================
;=========================
;==========================
; first move in X direction
lda CLIMB_COUNT
cmp #3
beq do_xadd
cmp #1
bne skip_xadd
do_xadd:
clc
lda PEASANT_X
adc PEASANT_XADD ; A = new X
jmp done_xadd
skip_xadd:
lda PEASANT_X
done_xadd:
; in theory this can't happen when climbing
; bmi peasant_x_negative ; if newx <0, handle
; cmp #40
; bcs peasant_x_toobig ; if newx>=40, handle (bge)
;======================================
; not off screen, so check if collision
pha
tay
; FIXME: should we add YADD first, like we do in peasant_move_tiny?
ldx PEASANT_Y
jsr peasant_collide
pla
bcc do_move_peasant_y ; no X collide
;==================================
; we collided in X, so stop moving
jsr stop_peasant ; stop moving
; leave PEASANT_X same as was
lda PEASANT_X
jmp do_move_peasant_y
;============================
;peasant_x_toobig:
; jsr move_map_east
; lda #0 ; new X location
; jmp done_movex
;============================
;peasant_x_negative:
; jsr move_map_west
; lda #39 ; new X location
; jmp done_movex
; check edge of screen
;done_movex:
; if we get here we changed screens
; sta PEASANT_X ; update new location
; jmp peasant_the_same ; skip checking for Y collision
; Move Peasant Y
do_move_peasant_y:
sta PEASANT_X
clc
lda PEASANT_Y
adc PEASANT_YADD ; newy in A
cmp #12 ; if <12 then off screen
bcc peasant_y_negative ; blt
; FIXME: in theory can never go down
; cmp #160 ; if >=150 then off screen
; bcs peasant_y_toobig ; bge
; check collide
pha
ldy PEASANT_X
tax ; newy
jsr peasant_collide
pla
bcc done_movey ; no collide
jsr stop_peasant ; stop moving
lda PEASANT_Y ; leave same
jmp done_movey
;============================
peasant_y_toobig:
; jsr move_map_south
; lda #12 ; new Y location
jmp done_movey
;============================
; move up over top of screen
peasant_y_negative:
lda #$FF
sta LEVEL_OVER
inc MAP_LOCATION
; FIXME: if high enough, we won
; in the coach Z version, increase score
; bcd
lda MAX_HEIGHT
clc
sed
adc #$01
cld
sta MAX_HEIGHT
lda #158 ; new Y location
jmp done_movey
; check edge of screen
done_movey:
sta PEASANT_Y
; if we moved off screen, don't re-draw peasant ?
peasant_the_same:
rts
;===========================
; erase peasant
;===========================
; restore bg behind peasant
erase_peasant:
; erase flame if applicable
ldy #5
jsr hgr_partial_restore_by_num
; erase peasant
ldy #4
jmp hgr_partial_restore_by_num ; tail call
; when peasants collide
;===================
; peasant_collide
;===================
; newx/7 in Y
; newy in X
; returns C=0 if no collide
; C=1 if collide
; collide data, 6 rows of 40 columns
; then in 8 bit chunks
; rrrtttii
; bottom 2 bits don't matter (lores tile is 4 rows high)
; next 3 bits = which of 8 bits is relevant
; top 3 bits are row lookup
peasant_collide:
; assume 3-wide sprite, colliding with feet of the middle?
iny
sty collision_smc1+1
; add 28 to collide with feet
txa
clc
adc #28 ; FIXME: if want to collide somewhere else
lsr
lsr ; need to divide by 4 for offset lookup
pha
and #$7
sta collision_smc2+1
pla
lsr
lsr ; shift 3 more times for row lookup
lsr
tax
lda collision_offset,X ; get collision offset
clc
collision_smc1:
adc #$00 ; add in XPOS
tax
lda collision_location,X ; get 8 bits of collision info
collision_smc2:
ldx #$01
and collision_masks,X
bne collide_true ; true if bit set
collide_false:
clc
rts
collide_true:
sec
rts
move_map_east:
move_map_west:
move_map_north:
move_map_south:
rts
stop_peasant:
lda #0
sta PEASANT_XADD
sta PEASANT_YADD
sta PEASANT_DIR ; PEASANT_UP is 0
rts
collision_offset:
.byte 0,40,80,120,160,200
collision_masks:
.byte $80,$40,$20,$10,$08,$04,$02,$01

View File

@ -0,0 +1,42 @@
HGR_SPRITE = ../../../../utils/hgr-utils/hgr_make_sprite
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
LINKER_SCRIPTS = ../../../../linker_scripts
all: enemy_sprites.inc
####
enemy_sprites.inc: enemy_sprites.png
$(HGR_SPRITE) -l bird0_sprite enemy_sprites.png 210 50 230 66 > enemy_sprites.inc
$(HGR_SPRITE) -l bird0_mask enemy_sprites.png 238 50 258 66 >> enemy_sprites.inc
$(HGR_SPRITE) -l bird1_sprite enemy_sprites.png 210 74 230 88 >> enemy_sprites.inc
$(HGR_SPRITE) -l bird1_mask enemy_sprites.png 238 74 258 88 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock0_sprite enemy_sprites.png 14 7 34 30 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock0_mask enemy_sprites.png 42 7 62 30 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock1_sprite enemy_sprites.png 14 35 34 57 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock1_mask enemy_sprites.png 42 35 62 57 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock2_sprite enemy_sprites.png 14 63 34 84 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock2_mask enemy_sprites.png 42 63 62 84 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock3_sprite enemy_sprites.png 14 91 34 113 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock3_mask enemy_sprites.png 42 91 62 113 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash0_sprite enemy_sprites.png 14 119 34 137 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash0_mask enemy_sprites.png 42 119 62 137 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash1_sprite enemy_sprites.png 14 147 41 168 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash1_mask enemy_sprites.png 56 147 83 168 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock0_sprite enemy_sprites.png 98 7 111 22 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock0_mask enemy_sprites.png 126 7 139 22 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock1_sprite enemy_sprites.png 98 35 111 49 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock1_mask enemy_sprites.png 126 35 139 49 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock2_sprite enemy_sprites.png 98 63 111 78 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock2_mask enemy_sprites.png 126 63 139 78 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock3_sprite enemy_sprites.png 98 91 111 105 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock3_mask enemy_sprites.png 126 91 139 105 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash0_sprite enemy_sprites.png 98 119 111 134 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash0_mask enemy_sprites.png 126 119 139 134 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash1_sprite enemy_sprites.png 126 147 153 166 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash1_mask enemy_sprites.png 168 147 195 165 >> enemy_sprites.inc
clean:
rm -f *~ *.zx02 enemy_sprites.inc

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -2,13 +2,27 @@ HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
LINKER_SCRIPTS = ../../../linker_scripts
all: enemy_sprites.inc walk_sprites.inc climb_flame_sprites.inc \
all: walk_sprites.inc climb_flame_sprites.inc \
climb_sprites.inc robe_sprites.inc flame_sprites.inc \
walking_sprites.zx02 \
climbing_sprites.zx02 \
robe_sprites.zx02 robe_sprites_orange.zx02 robe_sprites_purple.zx02
####
climbing_sprites.zx02: climbing_sprites
$(ZX02) -f climbing_sprites climbing_sprites.zx02
climbing_sprites: climbing_sprites.o
ld65 -o climbing_sprites climbing_sprites.o -C $(LINKER_SCRIPTS)/apple2_a000.inc
climbing_sprites.o: climbing_sprites.s \
climb_flame_sprites.inc \
climb_sprites.inc
ca65 -o climbing_sprites.o climbing_sprites.s -l climbing_sprites.lst
####
walking_sprites.zx02: walking_sprites
$(ZX02) -f walking_sprites walking_sprites.zx02
@ -55,42 +69,6 @@ robe_sprites_orange.o: robe_sprites_orange.s \
flame_sprites.inc robe_sprites_orange.inc
ca65 -o robe_sprites_orange.o robe_sprites_orange.s -l robe_sprites_orange.lst
enemy_sprites.inc: enemy_sprites.png
$(HGR_SPRITE) -l bird0_sprite enemy_sprites.png 210 50 230 66 > enemy_sprites.inc
$(HGR_SPRITE) -l bird0_mask enemy_sprites.png 238 50 258 66 >> enemy_sprites.inc
$(HGR_SPRITE) -l bird1_sprite enemy_sprites.png 210 74 230 88 >> enemy_sprites.inc
$(HGR_SPRITE) -l bird1_mask enemy_sprites.png 238 74 258 88 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock0_sprite enemy_sprites.png 14 7 34 30 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock0_mask enemy_sprites.png 42 7 62 30 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock1_sprite enemy_sprites.png 14 35 34 57 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock1_mask enemy_sprites.png 42 35 62 57 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock2_sprite enemy_sprites.png 14 63 34 84 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock2_mask enemy_sprites.png 42 63 62 84 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock3_sprite enemy_sprites.png 14 91 34 113 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock3_mask enemy_sprites.png 42 91 62 113 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash0_sprite enemy_sprites.png 14 119 34 137 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash0_mask enemy_sprites.png 42 119 62 137 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash1_sprite enemy_sprites.png 14 147 41 168 >> enemy_sprites.inc
$(HGR_SPRITE) -l bigrock_crash1_mask enemy_sprites.png 56 147 83 168 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock0_sprite enemy_sprites.png 98 7 111 22 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock0_mask enemy_sprites.png 126 7 139 22 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock1_sprite enemy_sprites.png 98 35 111 49 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock1_mask enemy_sprites.png 126 35 139 49 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock2_sprite enemy_sprites.png 98 63 111 78 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock2_mask enemy_sprites.png 126 63 139 78 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock3_sprite enemy_sprites.png 98 91 111 105 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock3_mask enemy_sprites.png 126 91 139 105 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash0_sprite enemy_sprites.png 98 119 111 134 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash0_mask enemy_sprites.png 126 119 139 134 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash1_sprite enemy_sprites.png 126 147 153 166 >> enemy_sprites.inc
$(HGR_SPRITE) -l smallrock_crash1_mask enemy_sprites.png 168 147 195 165 >> enemy_sprites.inc
climb_sprites.inc: climb_sprites.png
$(HGR_SPRITE) -l climb_r0_sprite climb_sprites.png 126 129 146 159 > climb_sprites.inc
$(HGR_SPRITE) -l climb_r0_mask climb_sprites.png 126 161 146 191 >> climb_sprites.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,118 @@
climb_sprites_xsize:
.byte 3, 3, 3, 3 ; right ; 0
.byte 3, 3, 3, 3 ; left ; 4
.byte 3, 3, 3, 3 ; up ; 8
.byte 3, 3, 3, 3 ; down ; 12
flame_sprites_xsize:
.byte 2, 2, 2 ; right ; 16
.byte 3, 3, 3 ; left ; 19
.byte 2, 2, 2 ; up ; 22
.byte 2, 2, 2 ; down ; 25
fall_sprites_xsize:
.byte 3, 3, 3, 3 ; 28
splat_sprites_xsize:
.byte 3,3 ; ; 32
climb_sprites_ysize:
.byte 30, 30, 30, 30 ; right
.byte 30, 30, 30, 30 ; left
.byte 31, 31, 31, 31 ; up
.byte 31, 31, 31, 31 ; down
flame_sprites_ysize:
.byte 9, 9, 9 ; right
.byte 9, 9, 9 ; left
.byte 9, 9, 9 ; up
.byte 9, 9, 9 ; down
fall_sprites_ysize:
.byte 21,21,21,21
splat_sprites_ysize:
.byte 21,21
climb_sprites_data_l:
.byte <climb_r0_sprite,<climb_r1_sprite,<climb_r2_sprite
.byte <climb_r3_sprite
.byte <climb_l3_sprite,<climb_l2_sprite,<climb_l1_sprite
.byte <climb_l0_sprite
.byte <climb_u0_sprite,<climb_u1_sprite,<climb_u2_sprite
.byte <climb_u3_sprite
.byte <climb_u3_sprite,<climb_u2_sprite,<climb_u1_sprite
.byte <climb_u0_sprite
flame_sprites_data_l:
.byte <flame_r0_sprite,<flame_r1_sprite,<flame_r2_sprite
.byte <flame_l0_sprite,<flame_l1_sprite,<flame_l2_sprite
.byte <flame_u0_sprite,<flame_u1_sprite,<flame_u2_sprite
.byte <flame_d0_sprite,<flame_d1_sprite,<flame_d2_sprite
fall_sprites_data_l:
.byte <climb_f0_sprite,<climb_f1_sprite,<climb_f2_sprite
.byte <climb_f3_sprite
splat_sprites_data_l:
.byte <climb_s0_sprite,<climb_s1_sprite
climb_sprites_data_h:
.byte >climb_r0_sprite,>climb_r1_sprite,>climb_r2_sprite
.byte >climb_r3_sprite
.byte >climb_l3_sprite,>climb_l2_sprite,>climb_l1_sprite
.byte >climb_l0_sprite
.byte >climb_u0_sprite,>climb_u1_sprite,>climb_u2_sprite
.byte >climb_u3_sprite
.byte >climb_u3_sprite,>climb_u2_sprite,>climb_u1_sprite
.byte >climb_u0_sprite
flame_sprites_data_h:
.byte >flame_r0_sprite,>flame_r1_sprite,>flame_r2_sprite
.byte >flame_l0_sprite,>flame_l1_sprite,>flame_l2_sprite
.byte >flame_u0_sprite,>flame_u1_sprite,>flame_u2_sprite
.byte >flame_d0_sprite,>flame_d1_sprite,>flame_d2_sprite
fall_sprites_data_h:
.byte >climb_f0_sprite,>climb_f1_sprite,>climb_f2_sprite
.byte >climb_f3_sprite
splat_sprites_data_h:
.byte >climb_s0_sprite,>climb_s1_sprite
climb_mask_data_l:
.byte <climb_r0_mask,<climb_r1_mask,<climb_r2_mask
.byte <climb_r3_mask
.byte <climb_l3_mask,<climb_l2_mask,<climb_l1_mask
.byte <climb_l0_mask
.byte <climb_u0_mask,<climb_u1_mask,<climb_u2_mask
.byte <climb_u3_mask
.byte <climb_u3_mask,<climb_u2_mask,<climb_u1_mask
.byte <climb_u0_mask
flame_mask_data_l:
.byte <flame_r0_mask,<flame_r1_mask,<flame_r2_mask
.byte <flame_l0_mask,<flame_l1_mask,<flame_l2_mask
.byte <flame_u0_mask,<flame_u1_mask,<flame_u2_mask
.byte <flame_d0_mask,<flame_d1_mask,<flame_d2_mask
fall_mask_data_l:
.byte <climb_f0_mask,<climb_f1_mask,<climb_f2_mask
.byte <climb_f3_mask
splat_mask_data_l:
.byte <climb_s0_mask,<climb_s1_mask
climb_mask_data_h:
.byte >climb_r0_mask,>climb_r1_mask,>climb_r2_mask
.byte >climb_r3_mask
.byte >climb_l3_mask,>climb_l2_mask,>climb_l1_mask
.byte >climb_l0_mask
.byte >climb_u0_mask,>climb_u1_mask,>climb_u2_mask
.byte >climb_u3_mask
.byte >climb_u3_mask,>climb_u2_mask,>climb_u1_mask
.byte >climb_u0_mask
flame_mask_data_h:
.byte >flame_r0_mask,>flame_r1_mask,>flame_r2_mask
.byte >flame_l0_mask,>flame_l1_mask,>flame_l2_mask
.byte >flame_u0_mask,>flame_u1_mask,>flame_u2_mask
.byte >flame_d0_mask,>flame_d1_mask,>flame_d2_mask
fall_mask_data_h:
.byte >climb_f0_mask,>climb_f1_mask,>climb_f2_mask
.byte >climb_f3_mask
splat_mask_data_h:
.byte >climb_s0_mask,>climb_s1_mask
.include "climb_sprites.inc"
.include "climb_flame_sprites.inc"

View File

@ -261,10 +261,12 @@ END_OF_SAVE = $AD
;=============================================
PEASANT_FALLING = $AF ; cliff climb
CURRENT_VERB = $B0 ; parser
CURRENT_NOUN = $B1
WORD_MATCH = $B2
;INPUT_ACTIVE = $B3
MAX_HEIGHT = $B3
WAIT_LOOP = $B4
INPUT_X = $C0
@ -289,7 +291,10 @@ CURRENT_DISK = $DC
HGR_COLOR = $E4
HGR_PAGE = $E6
TEMP_CENTER = $EC ; for cliff climb
CLIMB_COUNT = $ED ; for cliff climb
FLAME_COUNT = $EE
CURRENT_ROCK = $EF ; for cliff climb
P0 = $F1
P1 = $F2
@ -297,6 +302,8 @@ P2 = $F3
P3 = $F4
P4 = $F5
P5 = $F6
SPRITE_X = $F7 ; ?
SPRITE_Y = $F8 ; ?
CURRENT_ROW = $F9 ; ?
TEMP_SPRITE = $FA