mist: arbor: can walk to switch

This commit is contained in:
Vince Weaver 2020-06-22 01:21:09 -04:00
parent d281c299c8
commit 467549a018
16 changed files with 163 additions and 7 deletions

View File

@ -53,6 +53,8 @@ arbor_start:
lda #0
sta ANIMATE_FRAME
; update state of switch-related stuff
jsr update_arbor_state
game_loop:
;=================

View File

@ -36,3 +36,66 @@ elev1_close_door:
jmp change_location
;==================================
; hut handle, toggle top stair gate
hut_handle:
lda CHANNEL_SWITCHES
eor #CHANNEL_SW_GATE_TOP
sta CHANNEL_SWITCHES
jsr update_arbor_state
jmp change_location
;===============================================
; update all backgrounds based on switch states
update_arbor_state:
lda CHANNEL_SWITCHES
and #CHANNEL_SW_GATE_TOP
beq top_gate_closed
top_gate_open:
; change top gate to open
ldy #LOCATION_SOUTH_BG
lda #<switch_hut_open_s_lzsa
sta location14,Y ; ARBOR_SWITCH_HUT
lda #>switch_hut_open_s_lzsa
sta location14+1,Y ; ARBOR_SWITCH_HUT
; FIXME: change gate graphic close
; FIXME: change gate exit
; change to allow crossing bridge
; ldy #LOCATION_EAST_EXIT
; lda #CHANNEL_AFTER_BRIDGE1
; sta location3,Y ; CHANNEL_BRIDGE
jmp top_gate_done
top_gate_closed:
; change top gate to open
ldy #LOCATION_SOUTH_BG
lda #<switch_hut_closed_s_lzsa
sta location14,Y ; ARBOR_SWITCH_HUT
lda #>switch_hut_closed_s_lzsa
sta location14+1,Y ; ARBOR_SWITCH_HUT
; FIXME: change gate graphic close
; FIXME: change gate exit
; change to allow crossing bridge
; ldy #LOCATION_EAST_EXIT
; lda #CHANNEL_AFTER_BRIDGE1
; sta location3,Y ; CHANNEL_BRIDGE
top_gate_done:
done_update_arbor_state:
rts

View File

@ -369,3 +369,7 @@ ARBOR_SHACK1 = 7
ARBOR_BRIDGE3 = 8
ARBOR_LONGSHACK1 = 9
ARBOR_LONGSHACK2 = 10
ARBOR_SWITCH_BRIDGE1 = 11
ARBOR_SWITCH_HUT1 = 12
ARBOR_SWITCH_BRIDGE2 = 13
ARBOR_SWITCH_HUT = 14

View File

@ -3,9 +3,9 @@
; want to load this to address $80
.byte LOAD_OCTAGON ; WHICH_LOAD = $80
.byte DIRECTION_S ; DIRECTION = $81
.byte OCTAGON_TEMPLE_CENTER ; LOCATION = $82
.byte LOAD_ARBOR ; WHICH_LOAD = $80
.byte DIRECTION_W ; DIRECTION = $81
.byte ARBOR_ARRIVAL_CLOSED ; LOCATION = $82
.byte $00 ; RED_PAGES_TAKEN = $83
.byte $00 ; BLUE_PAGES_TAKEN = $84
.byte $00 ; CLOCK_BRIDGE = $85

View File

@ -17,7 +17,11 @@ arbor_graphics.inc: \
shack1_n.lzsa shack1_s.lzsa shack1_e.lzsa shack1_w.lzsa \
bridge3_e.lzsa bridge3_w.lzsa \
longshack1_e.lzsa longshack1_w.lzsa \
longshack2_e.lzsa longshack2_w.lzsa longshack2_n.lzsa longshack2_s.lzsa
longshack2_e.lzsa longshack2_w.lzsa longshack2_n.lzsa longshack2_s.lzsa \
switch_bridge1_n.lzsa switch_bridge1_s.lzsa \
switch_hut1_n.lzsa switch_hut1_e.lzsa \
switch_bridge2_e.lzsa switch_bridge2_w.lzsa \
switch_hut_w.lzsa switch_hut_closed_s.lzsa switch_hut_open_s.lzsa
echo "arrival_e_lzsa: .incbin \"arrival_e.lzsa\"" > arbor_graphics.inc
echo "arrival_open_e_lzsa: .incbin \"arrival_open_e.lzsa\"" >> arbor_graphics.inc
echo "arrival_w_lzsa: .incbin \"arrival_w.lzsa\"" >> arbor_graphics.inc
@ -41,6 +45,16 @@ arbor_graphics.inc: \
echo "longshack2_w_lzsa: .incbin \"longshack2_w.lzsa\"" >> arbor_graphics.inc
echo "longshack2_n_lzsa: .incbin \"longshack2_n.lzsa\"" >> arbor_graphics.inc
echo "longshack2_s_lzsa: .incbin \"longshack2_s.lzsa\"" >> arbor_graphics.inc
echo "switch_bridge1_n_lzsa: .incbin \"switch_bridge1_n.lzsa\"" >> arbor_graphics.inc
echo "switch_bridge1_s_lzsa: .incbin \"switch_bridge1_s.lzsa\"" >> arbor_graphics.inc
echo "switch_hut1_n_lzsa: .incbin \"switch_hut1_n.lzsa\"" >> arbor_graphics.inc
echo "switch_hut1_e_lzsa: .incbin \"switch_hut1_e.lzsa\"" >> arbor_graphics.inc
echo "switch_bridge2_e_lzsa: .incbin \"switch_bridge2_e.lzsa\"" >> arbor_graphics.inc
echo "switch_bridge2_w_lzsa: .incbin \"switch_bridge2_w.lzsa\"" >> arbor_graphics.inc
echo "switch_hut_w_lzsa: .incbin \"switch_hut_w.lzsa\"" >> arbor_graphics.inc
echo "switch_hut_closed_s_lzsa: .incbin \"switch_hut_closed_s.lzsa\"" >> arbor_graphics.inc
echo "switch_hut_open_s_lzsa: .incbin \"switch_hut_open_s.lzsa\"" >> arbor_graphics.inc
%.gr: %.png
$(PNG2GR) $< $@

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -5,7 +5,8 @@
locations:
.word location0, location1, location2, location3
.word location4, location5, location6, location7
.word location8, location9, location10
.word location8, location9, location10,location11
.word location12,location13,location14
; ARBOR_INSIDE_ELEV1 -- arrival in elevator1
@ -187,11 +188,11 @@ location9:
; ARBOR_LONGSHACK2 -- extra long shack part 2
location10:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_SWITCH_BRIDGE1 ; south exit
.byte $ff ; east exit
.byte ARBOR_LONGSHACK1 ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word longshack2_n_lzsa ; north bg
@ -201,3 +202,74 @@ location10:
.byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST
.byte $ff
; ARBOR_SWITCH_BRIDGE1 -- first bridge leading to switch
location11:
.byte ARBOR_LONGSHACK2 ; north exit
.byte ARBOR_SWITCH_HUT1 ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte DIRECTION_E ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word switch_bridge1_n_lzsa ; north bg
.word switch_bridge1_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte $ff
; ARBOR_SWITCH_HUT1 -- first hut on way to switch
location12:
.byte ARBOR_SWITCH_BRIDGE1 ; north exit
.byte $ff ; south exit
.byte ARBOR_SWITCH_BRIDGE2 ; east exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $ff ; west exit_dir
.word switch_hut1_n_lzsa ; north bg
.word $0000 ; south bg
.word switch_hut1_e_lzsa ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_EAST
.byte $ff
; ARBOR_SWITCH_BRIDGE2 -- second bridge on way to switch
location13:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_SWITCH_HUT ; east exit
.byte ARBOR_SWITCH_HUT1 ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_S ; east exit_dir
.byte DIRECTION_N ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word switch_bridge2_e_lzsa ; east bg
.word switch_bridge2_w_lzsa ; west bg
.byte BG_WEST|BG_EAST
.byte $ff
; ARBOR_SWITCH_HUT -- hut with hard-to-find switch
location14:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte ARBOR_SWITCH_BRIDGE2 ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word switch_hut_closed_s_lzsa; south bg
.word $0000 ; east bg
.word switch_hut_w_lzsa ; west bg
.byte BG_WEST|BG_SOUTH
.byte DIRECTION_S ; special exit
.byte 16,22 ; special x
.byte 28,40 ; special y
.word hut_handle-1 ; special function

View File

@ -139,6 +139,7 @@ CHANNEL_SWITCHES= $B5
CHANNEL_BRIDGE_UP = $01
CHANNEL_PIPE_EXTENDED = $02
CHANNEL_BOOK_ELEVATOR_UP= $04
CHANNEL_SW_GATE_TOP = $08
CHANNEL_SW_WINDMILL = $40
CHANNEL_SW_FAUCET = $80
CHANNEL_VALVES = $B6