diff --git a/mist/arbor.s b/mist/arbor.s index 09b09143..9a78dbdb 100644 --- a/mist/arbor.s +++ b/mist/arbor.s @@ -53,6 +53,8 @@ arbor_start: lda #0 sta ANIMATE_FRAME + ; update state of switch-related stuff + jsr update_arbor_state game_loop: ;================= diff --git a/mist/arbor_switches.s b/mist/arbor_switches.s index 1da4c505..2626141b 100644 --- a/mist/arbor_switches.s +++ b/mist/arbor_switches.s @@ -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+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+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 + + + diff --git a/mist/common_defines.inc b/mist/common_defines.inc index ab281221..ffcabd5c 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -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 diff --git a/mist/default_save.s b/mist/default_save.s index f4e1dec3..fe7644cd 100644 --- a/mist/default_save.s +++ b/mist/default_save.s @@ -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 diff --git a/mist/graphics_arbor/Makefile b/mist/graphics_arbor/Makefile index 773deadd..048d8e02 100644 --- a/mist/graphics_arbor/Makefile +++ b/mist/graphics_arbor/Makefile @@ -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) $< $@ diff --git a/mist/graphics_arbor/switch_bridge1_n.png b/mist/graphics_arbor/switch_bridge1_n.png new file mode 100644 index 00000000..04f96bae Binary files /dev/null and b/mist/graphics_arbor/switch_bridge1_n.png differ diff --git a/mist/graphics_arbor/switch_bridge1_s.png b/mist/graphics_arbor/switch_bridge1_s.png new file mode 100644 index 00000000..958ee18f Binary files /dev/null and b/mist/graphics_arbor/switch_bridge1_s.png differ diff --git a/mist/graphics_arbor/switch_bridge2_e.png b/mist/graphics_arbor/switch_bridge2_e.png new file mode 100644 index 00000000..bd77cd5f Binary files /dev/null and b/mist/graphics_arbor/switch_bridge2_e.png differ diff --git a/mist/graphics_arbor/switch_bridge2_w.png b/mist/graphics_arbor/switch_bridge2_w.png new file mode 100644 index 00000000..7cb4d8e2 Binary files /dev/null and b/mist/graphics_arbor/switch_bridge2_w.png differ diff --git a/mist/graphics_arbor/switch_hut1_e.png b/mist/graphics_arbor/switch_hut1_e.png new file mode 100644 index 00000000..24309b76 Binary files /dev/null and b/mist/graphics_arbor/switch_hut1_e.png differ diff --git a/mist/graphics_arbor/switch_hut1_n.png b/mist/graphics_arbor/switch_hut1_n.png new file mode 100644 index 00000000..51ebf3c2 Binary files /dev/null and b/mist/graphics_arbor/switch_hut1_n.png differ diff --git a/mist/graphics_arbor/switch_hut_closed_s.png b/mist/graphics_arbor/switch_hut_closed_s.png new file mode 100644 index 00000000..4cd6a4ed Binary files /dev/null and b/mist/graphics_arbor/switch_hut_closed_s.png differ diff --git a/mist/graphics_arbor/switch_hut_open_s.png b/mist/graphics_arbor/switch_hut_open_s.png new file mode 100644 index 00000000..5378f234 Binary files /dev/null and b/mist/graphics_arbor/switch_hut_open_s.png differ diff --git a/mist/graphics_arbor/switch_hut_w.png b/mist/graphics_arbor/switch_hut_w.png new file mode 100644 index 00000000..f091c291 Binary files /dev/null and b/mist/graphics_arbor/switch_hut_w.png differ diff --git a/mist/leveldata_arbor.inc b/mist/leveldata_arbor.inc index c817e7e1..859afdcb 100644 --- a/mist/leveldata_arbor.inc +++ b/mist/leveldata_arbor.inc @@ -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 + diff --git a/mist/zp.inc b/mist/zp.inc index 655bc8f1..c92b1c65 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -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