diff --git a/mist/arbor_switches.s b/mist/arbor_switches.s index 88c8b08a..ff6c0a51 100644 --- a/mist/arbor_switches.s +++ b/mist/arbor_switches.s @@ -51,8 +51,81 @@ hut_handle: jmp change_location - ;=============================================== - ; update all backgrounds based on switch states + +;============================= +;============================= +; elevator2 handle pulled +;============================= +;============================= + + +; FIXME: check for water power +; FIXME: animate +elevator2_handle: + + ; click speaker + bit SPEAKER + + ; check for water power + + lda LOCATION + cmp #ARBOR_INSIDE_ELEV2_CLOSED + beq elev2_goto_top + +elev2_goto_bottom: + lda #ARBOR_INSIDE_ELEV2_CLOSED + bne done_elev2_handle + +elev2_goto_top: + lda #ARBOR_IN_ELEV2_TOP_CLOSED + +done_elev2_handle: + sta LOCATION + jmp change_location + + +;========================= +;========================= +; close elevator2 door +;========================= +;========================= + +elevator2_close_door: + + lda LOCATION + cmp #ARBOR_INSIDE_ELEV2_OPEN + bne elev2_close_top + +elev2_close_bottom: + lda #ARBOR_INSIDE_ELEV2_CLOSED + bne done_elev2_close_door + +elev2_close_top: + lda #ARBOR_IN_ELEV2_TOP_CLOSED + +done_elev2_close_door: + sta LOCATION + jmp change_location + + + +;========================= +;========================= +; handle_top_gate +;========================= +;========================= + +handle_top_gate: + + + rts + + +;=============================================== +;=============================================== +; update all backgrounds based on switch states +;=============================================== +;=============================================== update_arbor_state: diff --git a/mist/common_defines.inc b/mist/common_defines.inc index 20a125e5..97fd645a 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -383,12 +383,15 @@ ARBOR_BRIDGE6 = 20 ARBOR_SHACK2 = 21 ARBOR_BRIDGE7 = 22 ARBOR_DOORS = 23 -ARBOR_INSIDE_ELEV2_OPEN = 24 -ARBOR_INSIDE_ELEV2_CLOSED= 25 -ARBOR_IN_ELEV2_TOP_CLOSED= 26 -ARBOR_IN_ELEV2_TOP_OPEN= 27 -ARBOR_STEPS_TOP = 28 -ARBOR_STEPS2 = 29 -ARBOR_STEPS3 = 30 -ARBOR_STEPS4 = 31 +ARBOR_DOORS_ELEV2_OPEN = 24 +ARBOR_INSIDE_ELEV2_OPEN = 25 +ARBOR_INSIDE_ELEV2_CLOSED= 26 +ARBOR_IN_ELEV2_TOP_CLOSED= 27 +ARBOR_IN_ELEV2_TOP_OPEN= 28 +ARBOR_STEPS_TOP = 29 +ARBOR_STEPS1 = 30 +ARBOR_STEPS2 = 31 ARBOR_STEPS_BOTTOM = 32 +ARBOR_OUTSIDE_ELEV2_OPEN= 33 +ARBOR_OUTSIDE_ELEV2_CLOSED= 34 + diff --git a/mist/graphics_arbor/Makefile b/mist/graphics_arbor/Makefile index e8049703..88b365ec 100644 --- a/mist/graphics_arbor/Makefile +++ b/mist/graphics_arbor/Makefile @@ -31,7 +31,10 @@ arbor_graphics.inc: \ shack2_n.lzsa shack2_s.lzsa shack2_e.lzsa shack2_w.lzsa \ bridge7_e.lzsa bridge7_open_w.lzsa bridge7_closed_w.lzsa \ doors_e.lzsa doors_closed_w.lzsa \ - inside_elevator2_open.lzsa inside_elevator2_closed.lzsa + doors_elev2_open_w.lzsa doors_open_elev2_closed_w.lzsa \ + inside_elevator2_open.lzsa inside_elevator2_closed.lzsa \ + elevator2_open_top.lzsa elevator2_closed_top.lzsa \ + outside_elevator2_e.lzsa outside_elevator2_open_w.lzsa outside_elevator2_closed_w.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 @@ -85,8 +88,15 @@ arbor_graphics.inc: \ echo "bridge7_open_w_lzsa: .incbin \"bridge7_open_w.lzsa\"" >> arbor_graphics.inc echo "doors_e_lzsa: .incbin \"doors_e.lzsa\"" >> arbor_graphics.inc echo "doors_closed_w_lzsa: .incbin \"doors_closed_w.lzsa\"" >> arbor_graphics.inc + echo "doors_elev2_open_w_lzsa: .incbin \"doors_elev2_open_w.lzsa\"" >> arbor_graphics.inc + echo "doors_open_lev2_closed_w_lzsa: .incbin \"doors_open_elev2_closed_w.lzsa\"" >> arbor_graphics.inc echo "inside_elevator2_open_lzsa: .incbin \"inside_elevator2_open.lzsa\"" >> arbor_graphics.inc echo "inside_elevator2_closed_lzsa: .incbin \"inside_elevator2_closed.lzsa\"" >> arbor_graphics.inc + echo "elevator2_open_top_lzsa: .incbin \"elevator2_open_top.lzsa\"" >> arbor_graphics.inc + echo "elevator2_closed_top_lzsa: .incbin \"elevator2_closed_top.lzsa\"" >> arbor_graphics.inc + echo "outside_elevator2_e_lzsa: .incbin \"outside_elevator2_e.lzsa\"" >> arbor_graphics.inc + echo "outside_elevator2_open_w_lzsa: .incbin \"outside_elevator2_open_w.lzsa\"" >> arbor_graphics.inc + echo "outside_elevator2_closed_w_lzsa: .incbin \"outside_elevator2_closed_w.lzsa\"" >> arbor_graphics.inc %.gr: %.png $(PNG2GR) $< $@ diff --git a/mist/graphics_arbor/elevator2_closed_top.png b/mist/graphics_arbor/elevator2_closed_top.png new file mode 100644 index 00000000..6141c969 Binary files /dev/null and b/mist/graphics_arbor/elevator2_closed_top.png differ diff --git a/mist/graphics_arbor/elevator2_open_top.png b/mist/graphics_arbor/elevator2_open_top.png new file mode 100644 index 00000000..5dd25f0e Binary files /dev/null and b/mist/graphics_arbor/elevator2_open_top.png differ diff --git a/mist/graphics_arbor/outside_elevator2_closed_w.png b/mist/graphics_arbor/outside_elevator2_closed_w.png new file mode 100644 index 00000000..523e01c5 Binary files /dev/null and b/mist/graphics_arbor/outside_elevator2_closed_w.png differ diff --git a/mist/graphics_arbor/outside_elevator2_e.png b/mist/graphics_arbor/outside_elevator2_e.png new file mode 100644 index 00000000..43af78ad Binary files /dev/null and b/mist/graphics_arbor/outside_elevator2_e.png differ diff --git a/mist/graphics_arbor/outside_elevator2_open_w.png b/mist/graphics_arbor/outside_elevator2_open_w.png new file mode 100644 index 00000000..7e7ed2eb Binary files /dev/null and b/mist/graphics_arbor/outside_elevator2_open_w.png differ diff --git a/mist/leveldata_arbor.inc b/mist/leveldata_arbor.inc index cadcfc40..4ba9eaf0 100644 --- a/mist/leveldata_arbor.inc +++ b/mist/leveldata_arbor.inc @@ -9,7 +9,10 @@ locations: .word location12,location13,location14,location15 .word location16,location17,location18,location19 .word location20,location21,location22,location23 - .word location24,location25 + .word location24,location25,location26,location27 + .word location28,location29,location30,location31 + .word location32,location33,location34 + ; ARBOR_INSIDE_ELEV1 -- arrival in elevator1 location0: @@ -416,7 +419,7 @@ location23: .byte $ff ; north exit .byte $ff ; south exit .byte ARBOR_BRIDGE7 ; east exit - .byte $ff ; west exit + .byte ARBOR_DOORS_ELEV2_OPEN ; west exit .byte $ff ; north exit_dir .byte $ff ; south exit_dir .byte DIRECTION_E ; east exit_dir @@ -426,10 +429,35 @@ location23: .word doors_e_lzsa ; east bg .word doors_closed_w_lzsa ; west bg .byte BG_EAST|BG_WEST - .byte $ff + .byte DIRECTION_W + .byte 6,19 ; special x + .byte 6,46 ; special y + .word handle_top_gate-1 ; special function + +; ARBOR_DOORS_ELEV2_OPEN -- doors to the stair and elevator, elevator open +location24: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_BRIDGE7 ; east exit + .byte ARBOR_INSIDE_ELEV2_OPEN ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_E ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word doors_e_lzsa ; east bg + .word doors_elev2_open_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte DIRECTION_W + .byte 6,19 ; special x + .byte 6,46 ; special y + .word handle_top_gate-1 ; special function + + ; ARBOR_INSIDE_ELEV2_OPEN -- inside elevator2, door open -location24: +location25: .byte $ff ; north exit .byte $ff ; south exit .byte ARBOR_DOORS ; east exit @@ -443,10 +471,14 @@ location24: .word inside_elevator2_open_lzsa ; east bg .word $0000 ; west bg .byte BG_EAST - .byte $ff + .byte DIRECTION_E ; special exit + .byte 10,17 ; special x + .byte 6,46 ; special y + .word elevator2_close_door-1 ; special function + ; ARBOR_INSIDE_ELEV2_CLOSED -- inside elevator2, door closed -location25: +location26: .byte $ff ; north exit .byte $ff ; south exit .byte ARBOR_INSIDE_ELEV2_OPEN ; east exit @@ -460,9 +492,152 @@ location25: .word inside_elevator2_closed_lzsa ; east bg .word $0000 ; west bg .byte BG_EAST + .byte DIRECTION_E ; special exit + .byte 28,34 ; special x + .byte 28,36 ; special y + .word elevator2_handle-1 ; special function + + +; ARBOR_IN_ELEV2_TOP_CLOSED -- inside elevator2 at top, door closed +location27: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_IN_ELEV2_TOP_OPEN ; east exit + .byte $ff ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte $ff ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word elevator2_closed_top_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte DIRECTION_E ; special exit + .byte 28,34 ; special x + .byte 28,36 ; special y + .word elevator2_handle-1 ; special function + +; ARBOR_IN_ELEV2_TOP_OPEN -- inside elevator2 at top, door open +location28: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_OUTSIDE_ELEV2_CLOSED ; east exit + .byte $ff ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte $ff ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word elevator2_open_top_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte DIRECTION_E ; special exit + .byte 10,17 ; special x + .byte 6,46 ; special y + .word elevator2_close_door-1 ; special function + + +; ARBOR_STEPS_TOP -- top of steps +location29: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_DOORS ; east exit + .byte ARBOR_STEPS1 ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word inside_elevator2_closed_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST .byte $ff +; ARBOR_STEPS1 -- down steps +location30: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_STEPS_TOP ; east exit + .byte ARBOR_STEPS2 ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word inside_elevator2_closed_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte $ff +; ARBOR_STEPS2 -- down steps further +location31: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_STEPS1 ; east exit + .byte ARBOR_STEPS_BOTTOM ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word inside_elevator2_closed_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte $ff +; ARBOR_STEPS_BOTTOM -- bottom of steps +location32: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_STEPS2 ; east exit + .byte $ff ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte $ff ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word inside_elevator2_closed_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte $ff +; ARBOR_OUTSIDE_ELEV2_OPEN -- outside of elevator2 at top, door open +location33: + .byte $ff ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte ARBOR_IN_ELEV2_TOP_OPEN ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_E ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word outside_elevator2_e_lzsa ; east bg + .word outside_elevator2_open_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte $ff + +; ARBOR_OUTSIDE_ELEV2_CLOSED -- outside of elevator2 at top, door closed +location34: + .byte $ff ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte ARBOR_OUTSIDE_ELEV2_OPEN ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word outside_elevator2_e_lzsa ; east bg + .word outside_elevator2_closed_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte $ff