diff --git a/mist/arbor_switches.s b/mist/arbor_switches.s index 2626141b..88c8b08a 100644 --- a/mist/arbor_switches.s +++ b/mist/arbor_switches.s @@ -24,6 +24,11 @@ elev1_handle: lda #$ff sta LEVEL_OVER + lda CHANNEL_SWITCHES ; make elevator down + and #~CHANNEL_ELEVATOR1_UP + sta CHANNEL_SWITCHES + + rts diff --git a/mist/channel_switches.s b/mist/channel_switches.s index a8eca194..397ab54a 100644 --- a/mist/channel_switches.s +++ b/mist/channel_switches.s @@ -1,6 +1,8 @@ - +;=========================== ;=========================== ; pick up myst linking book +;=========================== +;=========================== book_room_grab_book: lda #CHANNEL_BOOK_CLOSED @@ -9,8 +11,11 @@ book_room_grab_book: rts +;============================= ;============================= ; book elevator handle pulled +;============================= +;============================= ; FIXME: check for water power ; FIXME: animate @@ -67,8 +72,12 @@ book_elevator_handle_done: rts +;============================= +;============================= ;============================= ; elevator1 handle pulled +;============================= +;============================= ; FIXME: check for water power ; FIXME: animate @@ -90,14 +99,49 @@ elev1_handle: lda #LOAD_ARBOR sta WHICH_LOAD + lda CHANNEL_SWITCHES ; make elevator up + ora #CHANNEL_ELEVATOR1_UP + sta CHANNEL_SWITCHES + lda #$ff sta LEVEL_OVER rts - ;========================= - ; close book elevator door +;============================= +;============================= +;============================= +; climb steps +;============================= +;============================= + +climb_steps: + + ; enter steps, which is in ARBOR level + + lda #ARBOR_STEPS_BOTTOM + sta LOCATION + + lda #DIRECTION_E + sta DIRECTION + + lda #LOAD_ARBOR + sta WHICH_LOAD + + lda #$ff + sta LEVEL_OVER + + rts + + + +;========================= +;========================= +; close book elevator door +;========================= +;========================= + book_elevator_close_door: lda #CHANNEL_BOOK_E_IN_CLOSED @@ -114,8 +158,11 @@ elev1_close_door: +;======================= ;======================= ; raise bridge +;======================= +;======================= ; if CHANNEL_SWITCHES CHANNEL_SW_WINDMILL and CHANNEL_SW_FAUCET ; TODO: also if various valves in correct pattern @@ -150,8 +197,11 @@ no_raise_bridge: +;======================= ;======================= ; extend_pipe +;======================= +;======================= ; verified: can open/shut even if water is flowing @@ -174,9 +224,11 @@ no_extend_pipe: - ;====================================== - ; adjust after changes - ;====================================== +;====================================== +;====================================== +; adjust after changes +;====================================== +;====================================== ; should call this when entering level adjust_after_changes: @@ -247,7 +299,7 @@ pipe_extended: lda #>pipe_bridge2_up_w_lzsa sta location10+1,Y ; CHANNEL_PIPE_BRIDGE2 - jmp done_adjust_changes + jmp hide_elevator1 pipe_stowed: @@ -268,6 +320,102 @@ pipe_stowed: lda #>pipe_bridge2_w_lzsa sta location10+1,Y ; CHANNEL_PIPE_BRIDGE2 +hide_elevator1: + + lda CHANNEL_SWITCHES + and #CHANNEL_ELEVATOR1_UP + beq elevator1_down + +elevator1_up: + + ; change bgs so elevator up, can't board + ldy #LOCATION_WEST_BG + + lda #before_elev1_gone_w_lzsa + sta location8+1,Y ; CHANNEL_BEFORE_ELEV1 + + lda #fork_gone_w_lzsa + sta location7+1,Y ; CHANNEL_FORK + + ; make so can't board + ldy #LOCATION_WEST_EXIT + lda #$ff + sta location8,Y ; CHANNEL_BEFORE_ELEV1 + + jmp open_gate + +elevator1_down: + ; change bgs so elevator down + ldy #LOCATION_WEST_BG + + lda #before_elev1_w_lzsa + sta location8+1,Y ; CHANNEL_BEFORE_ELEV1 + + lda #fork_w_lzsa + sta location7+1,Y ; CHANNEL_FORK + + ; make so can board + ldy #LOCATION_WEST_EXIT + lda #CHANNEL_ELEV1_OPEN + sta location8,Y ; CHANNEL_BEFORE_ELEV1 + +open_gate: + lda CHANNEL_SWITCHES + and #CHANNEL_SW_GATE_BOTTOM + beq gate_closed + +gate_open: + + ; change bgs so gate open + + ldy #LOCATION_WEST_BG + + lda #steps_path_open_w_lzsa + sta location12+1,Y ; CHANNEL_STEPS_PATH + + lda #steps_door_open_w_lzsa + sta location13+1,Y ; CHANNEL_STEPS_DOOR + + ; make so can climb steps + ldy #LOCATION_SPECIAL_EXIT + lda #DIRECTION_W + sta location13,Y ; CHANNEL_STEPS_DOOR + + jmp done_adjust_changes + +gate_closed: + + ; change bgs so gate closed + + ldy #LOCATION_WEST_BG + + lda #steps_path_w_lzsa + sta location12+1,Y ; CHANNEL_STEPS_PATH + + lda #steps_door_w_lzsa + sta location13+1,Y ; CHANNEL_STEPS_DOOR + + ; make so can't climb steps + ldy #LOCATION_SPECIAL_EXIT + lda #$ff + sta location13,Y ; CHANNEL_STEPS_DOOR + done_adjust_changes: rts diff --git a/mist/common_defines.inc b/mist/common_defines.inc index 0dddfacf..20a125e5 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -387,11 +387,8 @@ ARBOR_INSIDE_ELEV2_OPEN = 24 ARBOR_INSIDE_ELEV2_CLOSED= 25 ARBOR_IN_ELEV2_TOP_CLOSED= 26 ARBOR_IN_ELEV2_TOP_OPEN= 27 -ARBOR_STEPS1 = 28 +ARBOR_STEPS_TOP = 28 ARBOR_STEPS2 = 29 ARBOR_STEPS3 = 30 ARBOR_STEPS4 = 31 -ARBOR_STEPS5 = 32 - - - +ARBOR_STEPS_BOTTOM = 32 diff --git a/mist/graphics_channel/Makefile b/mist/graphics_channel/Makefile index 3b67a550..cafab37d 100644 --- a/mist/graphics_channel/Makefile +++ b/mist/graphics_channel/Makefile @@ -16,13 +16,14 @@ channel_graphics.inc: \ path4_e.lzsa path4_w.lzsa path4_s.lzsa \ path5_e.lzsa path5_s.lzsa path5_n.lzsa \ path6_s.lzsa path6_w.lzsa path6_n.lzsa \ - fork_n.lzsa fork_s.lzsa fork_w.lzsa \ + fork_n.lzsa fork_s.lzsa fork_w.lzsa fork_gone_w.lzsa \ before_elev1_e.lzsa before_elev1_w.lzsa before_elev1_open_w.lzsa \ + before_elev1_gone_w.lzsa \ pipe_bridge2_up_w.lzsa pipe_bridge2_w.lzsa pipe_bridge2_e.lzsa \ elevator1_open.lzsa elevator1_closed.lzsa \ steps_fork_n.lzsa steps_fork_s.lzsa steps_fork_w.lzsa \ - steps_path_e.lzsa steps_path_w.lzsa \ - steps_door_e.lzsa steps_door_w.lzsa \ + steps_path_e.lzsa steps_path_w.lzsa steps_path_open_w.lzsa \ + steps_door_e.lzsa steps_door_w.lzsa steps_door_open_w.lzsa \ wind_path_n.lzsa wind_path_s.lzsa \ wind_path2_n.lzsa wind_path2_s.lzsa \ island1_n.lzsa island1_s.lzsa \ @@ -65,8 +66,10 @@ channel_graphics.inc: \ echo "fork_n_lzsa: .incbin \"fork_n.lzsa\"" >> channel_graphics.inc echo "fork_s_lzsa: .incbin \"fork_s.lzsa\"" >> channel_graphics.inc echo "fork_w_lzsa: .incbin \"fork_w.lzsa\"" >> channel_graphics.inc + echo "fork_gone_w_lzsa: .incbin \"fork_gone_w.lzsa\"" >> channel_graphics.inc echo "before_elev1_e_lzsa: .incbin \"before_elev1_e.lzsa\"" >> channel_graphics.inc echo "before_elev1_w_lzsa: .incbin \"before_elev1_w.lzsa\"" >> channel_graphics.inc + echo "before_elev1_gone_w_lzsa: .incbin \"before_elev1_gone_w.lzsa\"" >> channel_graphics.inc echo "before_elev1_open_w_lzsa: .incbin \"before_elev1_open_w.lzsa\"" >> channel_graphics.inc echo "pipe_bridge2_e_lzsa: .incbin \"pipe_bridge2_e.lzsa\"" >> channel_graphics.inc echo "pipe_bridge2_w_lzsa: .incbin \"pipe_bridge2_w.lzsa\"" >> channel_graphics.inc @@ -78,8 +81,10 @@ channel_graphics.inc: \ echo "steps_fork_w_lzsa: .incbin \"steps_fork_w.lzsa\"" >> channel_graphics.inc echo "steps_path_e_lzsa: .incbin \"steps_path_e.lzsa\"" >> channel_graphics.inc echo "steps_path_w_lzsa: .incbin \"steps_path_w.lzsa\"" >> channel_graphics.inc + echo "steps_path_open_w_lzsa: .incbin \"steps_path_open_w.lzsa\"" >> channel_graphics.inc echo "steps_door_e_lzsa: .incbin \"steps_door_e.lzsa\"" >> channel_graphics.inc echo "steps_door_w_lzsa: .incbin \"steps_door_w.lzsa\"" >> channel_graphics.inc + echo "steps_door_open_w_lzsa: .incbin \"steps_door_open_w.lzsa\"" >> channel_graphics.inc echo "wind_path_n_lzsa: .incbin \"wind_path_n.lzsa\"" >> channel_graphics.inc echo "wind_path_s_lzsa: .incbin \"wind_path_s.lzsa\"" >> channel_graphics.inc echo "wind_path2_n_lzsa: .incbin \"wind_path2_n.lzsa\"" >> channel_graphics.inc diff --git a/mist/graphics_channel/before_elev1_gone_w.png b/mist/graphics_channel/before_elev1_gone_w.png new file mode 100644 index 00000000..6b3bec7a Binary files /dev/null and b/mist/graphics_channel/before_elev1_gone_w.png differ diff --git a/mist/graphics_channel/fork_gone_w.png b/mist/graphics_channel/fork_gone_w.png new file mode 100644 index 00000000..54b4f95b Binary files /dev/null and b/mist/graphics_channel/fork_gone_w.png differ diff --git a/mist/graphics_channel/steps_door_open_w.png b/mist/graphics_channel/steps_door_open_w.png new file mode 100644 index 00000000..9534fb80 Binary files /dev/null and b/mist/graphics_channel/steps_door_open_w.png differ diff --git a/mist/graphics_channel/steps_path_open_w.png b/mist/graphics_channel/steps_path_open_w.png new file mode 100644 index 00000000..db15e4a6 Binary files /dev/null and b/mist/graphics_channel/steps_path_open_w.png differ diff --git a/mist/leveldata_channel.inc b/mist/leveldata_channel.inc index 02945894..1baeab9a 100644 --- a/mist/leveldata_channel.inc +++ b/mist/leveldata_channel.inc @@ -257,7 +257,10 @@ location13: .word steps_door_e_lzsa ; east bg .word steps_door_w_lzsa ; west bg .byte BG_EAST|BG_WEST - .byte $ff + .byte DIRECTION_W ; special exit + .byte 13,27 ; special x + .byte 4,42 ; special y + .word climb_steps-1 ; special function ; CHANNEL_WIND_PATH -- path to windmill location14: diff --git a/mist/zp.inc b/mist/zp.inc index d20552dd..ba2a0650 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -140,6 +140,8 @@ CHANNEL_SWITCHES= $B5 CHANNEL_PIPE_EXTENDED = $02 CHANNEL_BOOK_ELEVATOR_UP= $04 CHANNEL_SW_GATE_TOP = $08 + CHANNEL_ELEVATOR1_UP = $10 + CHANNEL_SW_GATE_BOTTOM = $20 CHANNEL_SW_WINDMILL = $40 CHANNEL_SW_FAUCET = $80 CHANNEL_VALVES = $B6