mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-07 21:30:39 +00:00
mist: channel: valves implemented
or at least you can flip them all now
This commit is contained in:
parent
87232719db
commit
2dcbdb9c28
@ -30,9 +30,90 @@ handle_valve6:
|
||||
common_handle_valves:
|
||||
sta CHANNEL_VALVES
|
||||
jsr adjust_valve_backgrounds
|
||||
|
||||
jsr click_speaker
|
||||
|
||||
jmp change_direction ; update background
|
||||
|
||||
;===========================
|
||||
;===========================
|
||||
; goto valves multiple case
|
||||
;===========================
|
||||
;===========================
|
||||
|
||||
; path5
|
||||
|
||||
goto_path5_valve:
|
||||
lda DIRECTION
|
||||
cmp #DIRECTION_N
|
||||
bne path5_south
|
||||
|
||||
path5_north:
|
||||
lda CURSOR_Y
|
||||
cmp #38
|
||||
bcc path5_go_north ; blt
|
||||
jmp goto_valve2
|
||||
path5_go_north:
|
||||
lda #CHANNEL_PATH7 ; didn't hit valve, move instead
|
||||
sta LOCATION
|
||||
jmp change_location
|
||||
|
||||
path5_south:
|
||||
lda CURSOR_Y
|
||||
cmp #32
|
||||
bcs path5_go_south
|
||||
jmp goto_valve4
|
||||
|
||||
path5_go_south:
|
||||
lda #CHANNEL_PATH6 ; didn't hit valve, move instead
|
||||
sta LOCATION
|
||||
jmp change_location
|
||||
|
||||
|
||||
|
||||
; path6
|
||||
; 6S goes to valve6
|
||||
; 6W goes to valve5
|
||||
; 6N goes to valve4
|
||||
|
||||
goto_path6_valve:
|
||||
lda DIRECTION
|
||||
cmp #DIRECTION_S
|
||||
beq path6_south
|
||||
cmp #DIRECTION_W
|
||||
beq path6_west
|
||||
|
||||
path6_north:
|
||||
lda CURSOR_Y
|
||||
cmp #38
|
||||
bcc path6_go_north ; blt
|
||||
jmp goto_valve5
|
||||
path6_go_north:
|
||||
lda #CHANNEL_PATH5 ; didn't hit valve, move instead
|
||||
sta LOCATION
|
||||
jmp change_location
|
||||
|
||||
path6_south:
|
||||
lda CURSOR_Y
|
||||
cmp #32
|
||||
bcs path6_go_south ; bge
|
||||
jmp goto_valve6
|
||||
|
||||
path6_go_south:
|
||||
lda #CHANNEL_PATH2 ; didn't hit valve, move instead
|
||||
sta LOCATION
|
||||
jmp change_location
|
||||
|
||||
path6_west:
|
||||
lda CURSOR_Y
|
||||
cmp #32
|
||||
bcs path6_go_west ; bge
|
||||
jmp goto_valve4
|
||||
|
||||
path6_go_west:
|
||||
lda #CHANNEL_FORK ; didn't hit valve, move instead
|
||||
sta LOCATION
|
||||
jmp change_location
|
||||
|
||||
;===========================
|
||||
;===========================
|
||||
@ -108,7 +189,163 @@ valve1_is_off:
|
||||
|
||||
check_valve2:
|
||||
|
||||
lda CHANNEL_VALVES
|
||||
and #CHANNEL_VALVE2
|
||||
beq valve2_is_off
|
||||
|
||||
valve2_is_on:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_on_lzsa
|
||||
sta location39,Y ; CHANNEL_VALVE2
|
||||
lda #>valve_bottom_on_lzsa
|
||||
sta location39+1,Y ; CHANNEL_VALVE2
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_on_lzsa
|
||||
sta location39,Y ; CHANNEL_VALVE2
|
||||
lda #>valve_top_on_lzsa
|
||||
sta location39+1,Y ; CHANNEL_VALVE2
|
||||
|
||||
jmp check_valve3
|
||||
|
||||
valve2_is_off:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_off_lzsa
|
||||
sta location39,Y ; CHANNEL_VALVE2
|
||||
lda #>valve_bottom_off_lzsa
|
||||
sta location39+1,Y ; CHANNEL_VALVE2
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_off_lzsa
|
||||
sta location39,Y ; CHANNEL_VALVE2
|
||||
lda #>valve_top_off_lzsa
|
||||
sta location39+1,Y ; CHANNEL_VALVE2
|
||||
|
||||
check_valve3:
|
||||
|
||||
lda CHANNEL_VALVES
|
||||
and #CHANNEL_VALVE3
|
||||
beq valve3_is_off
|
||||
|
||||
valve3_is_on:
|
||||
ldy #LOCATION_WEST_BG
|
||||
lda #<valve_bottom_on_lzsa
|
||||
sta location40,Y ; CHANNEL_VALVE3
|
||||
lda #>valve_bottom_on_lzsa
|
||||
sta location40+1,Y ; CHANNEL_VALVE3
|
||||
|
||||
jmp check_valve4
|
||||
|
||||
valve3_is_off:
|
||||
ldy #LOCATION_WEST_BG
|
||||
lda #<valve_bottom_off_lzsa
|
||||
sta location40,Y ; CHANNEL_VALVE3
|
||||
lda #>valve_bottom_off_lzsa
|
||||
sta location40+1,Y ; CHANNEL_VALVE3
|
||||
|
||||
check_valve4:
|
||||
|
||||
lda CHANNEL_VALVES
|
||||
and #CHANNEL_VALVE4
|
||||
beq valve4_is_off
|
||||
|
||||
valve4_is_on:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_on_lzsa
|
||||
sta location41,Y ; CHANNEL_VALVE4
|
||||
lda #>valve_bottom_on_lzsa
|
||||
sta location41+1,Y ; CHANNEL_VALVE4
|
||||
|
||||
ldy #LOCATION_WEST_BG
|
||||
lda #<valve_top_on_lzsa
|
||||
sta location41,Y ; CHANNEL_VALVE4
|
||||
lda #>valve_top_on_lzsa
|
||||
sta location41+1,Y ; CHANNEL_VALVE4
|
||||
|
||||
jmp check_valve5
|
||||
|
||||
valve4_is_off:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_off_lzsa
|
||||
sta location41,Y ; CHANNEL_VALVE4
|
||||
lda #>valve_bottom_off_lzsa
|
||||
sta location41+1,Y ; CHANNEL_VALVE4
|
||||
|
||||
ldy #LOCATION_WEST_BG
|
||||
lda #<valve_top_off_lzsa
|
||||
sta location41,Y ; CHANNEL_VALVE4
|
||||
lda #>valve_top_off_lzsa
|
||||
sta location41+1,Y ; CHANNEL_VALVE4
|
||||
|
||||
check_valve5:
|
||||
|
||||
lda CHANNEL_VALVES
|
||||
and #CHANNEL_VALVE5
|
||||
beq valve5_is_off
|
||||
|
||||
valve5_is_on:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_on_lzsa
|
||||
sta location42,Y ; CHANNEL_VALVE5
|
||||
lda #>valve_bottom_on_lzsa
|
||||
sta location42+1,Y ; CHANNEL_VALVE5
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_on_lzsa
|
||||
sta location42,Y ; CHANNEL_VALVE5
|
||||
lda #>valve_top_on_lzsa
|
||||
sta location42+1,Y ; CHANNEL_VALVE5
|
||||
|
||||
jmp check_valve6
|
||||
|
||||
valve5_is_off:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_off_lzsa
|
||||
sta location42,Y ; CHANNEL_VALVE5
|
||||
lda #>valve_bottom_off_lzsa
|
||||
sta location42+1,Y ; CHANNEL_VALVE5
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_off_lzsa
|
||||
sta location42,Y ; CHANNEL_VALVE5
|
||||
lda #>valve_top_off_lzsa
|
||||
sta location42+1,Y ; CHANNEL_VALVE5
|
||||
|
||||
check_valve6:
|
||||
|
||||
lda CHANNEL_VALVES
|
||||
and #CHANNEL_VALVE6
|
||||
beq valve6_is_off
|
||||
|
||||
valve6_is_on:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_on_lzsa
|
||||
sta location43,Y ; CHANNEL_VALVE6
|
||||
lda #>valve_bottom_on_lzsa
|
||||
sta location43+1,Y ; CHANNEL_VALVE6
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_on_lzsa
|
||||
sta location43,Y ; CHANNEL_VALVE6
|
||||
lda #>valve_top_on_lzsa
|
||||
sta location43+1,Y ; CHANNEL_VALVE6
|
||||
|
||||
jmp check_valve_done
|
||||
|
||||
valve6_is_off:
|
||||
ldy #LOCATION_NORTH_BG
|
||||
lda #<valve_bottom_off_lzsa
|
||||
sta location43,Y ; CHANNEL_VALVE6
|
||||
lda #>valve_bottom_off_lzsa
|
||||
sta location43+1,Y ; CHANNEL_VALVE6
|
||||
|
||||
ldy #LOCATION_SOUTH_BG
|
||||
lda #<valve_top_off_lzsa
|
||||
sta location43,Y ; CHANNEL_VALVE6
|
||||
lda #>valve_top_off_lzsa
|
||||
sta location43+1,Y ; CHANNEL_VALVE6
|
||||
|
||||
check_valve_done:
|
||||
rts
|
||||
|
||||
|
||||
|
@ -48,7 +48,10 @@ location1:
|
||||
.word path2_e_lzsa ; east bg
|
||||
.word $0000 ; west bg
|
||||
.byte BG_SOUTH|BG_NORTH|BG_EAST
|
||||
.byte $ff
|
||||
.byte DIRECTION_N ; special exit
|
||||
.byte 19,24 ; special x
|
||||
.byte 36,44 ; special y
|
||||
.word goto_valve6-1 ; special function
|
||||
|
||||
; CHANNEL_PATH3 -- twisty maze of passages all alike
|
||||
location2:
|
||||
@ -102,7 +105,10 @@ location4:
|
||||
.word path4_e_lzsa ; east bg
|
||||
.word path4_w_lzsa ; west bg
|
||||
.byte BG_SOUTH|BG_WEST|BG_EAST
|
||||
.byte $ff
|
||||
.byte DIRECTION_W ; special exit
|
||||
.byte 19,24 ; special x
|
||||
.byte 36,44 ; special y
|
||||
.word goto_valve3-1 ; special function
|
||||
|
||||
; CHANNEL_PATH5 -- twisty maze of passages all alike
|
||||
location5:
|
||||
@ -119,7 +125,11 @@ location5:
|
||||
.word path5_e_lzsa ; east bg
|
||||
.word $0000 ; west bg
|
||||
.byte BG_NORTH|BG_SOUTH|BG_EAST
|
||||
.byte $ff
|
||||
.byte DIRECTION_S|DIRECTION_N ; special exit
|
||||
.byte 16,24 ; special x 19,24N 16,20S
|
||||
.byte 26,44 ; special y 38,44N 26,32S
|
||||
.word goto_path5_valve-1 ; special function
|
||||
|
||||
|
||||
; CHANNEL_PATH6 -- twisty maze of passages all alike
|
||||
location6:
|
||||
@ -136,7 +146,11 @@ location6:
|
||||
.word $0000 ; east bg
|
||||
.word path6_w_lzsa ; west bg
|
||||
.byte BG_NORTH|BG_WEST|BG_SOUTH
|
||||
.byte $ff
|
||||
.byte DIRECTION_N|DIRECTION_W|DIRECTION_S ; special exit
|
||||
.byte 17,21 ; special x 17,21N 17,21S 17,21W
|
||||
.byte 26,46 ; special y 40,46N 26,32S 26,32W
|
||||
.word goto_path6_valve-1 ; special function
|
||||
|
||||
|
||||
; CHANNEL_FORK -- forked path
|
||||
location7:
|
||||
@ -153,7 +167,10 @@ location7:
|
||||
.word $0000 ; east bg
|
||||
.word fork_w_lzsa ; west bg
|
||||
.byte BG_NORTH|BG_WEST|BG_SOUTH
|
||||
.byte $ff
|
||||
.byte DIRECTION_N ; special exit
|
||||
.byte 19,25 ; special x
|
||||
.byte 38,46 ; special y
|
||||
.word goto_valve4-1 ; special function
|
||||
|
||||
; CHANNEL_BEFORE_ELEV1 -- just befor elevator 1
|
||||
location8:
|
||||
@ -731,8 +748,8 @@ location38:
|
||||
|
||||
; CHANNEL_VALVE2_TREE -- valve by the big tree
|
||||
location39:
|
||||
.byte CHANNEL_STEPS_FORK ; north exit
|
||||
.byte CHANNEL_WIND_PATH ; south exit
|
||||
.byte CHANNEL_PATH5 ; north exit
|
||||
.byte CHANNEL_PATH7 ; south exit
|
||||
.byte $ff ; east exit
|
||||
.byte $ff ; west exit
|
||||
.byte DIRECTION_N ; north exit_dir
|
||||
@ -751,48 +768,48 @@ location39:
|
||||
|
||||
; CHANNEL_VALVE3_BROKEN -- valve to broken pipe
|
||||
location40:
|
||||
.byte CHANNEL_STEPS_FORK ; north exit
|
||||
.byte CHANNEL_WIND_PATH ; south exit
|
||||
.byte $ff ; north exit
|
||||
.byte $ff ; south exit
|
||||
.byte $ff ; east exit
|
||||
.byte $ff ; west exit
|
||||
.byte DIRECTION_N ; north exit_dir
|
||||
.byte DIRECTION_S ; south exit_dir
|
||||
.byte CHANNEL_PATH4 ; west exit
|
||||
.byte $ff ; north exit_dir
|
||||
.byte $ff ; south exit_dir
|
||||
.byte $ff ; east exit_dir
|
||||
.byte $ff ; west exit_dir
|
||||
.word valve_bottom_off_lzsa ; north bg
|
||||
.word valve_top_off_lzsa ; south bg
|
||||
.byte DIRECTION_W ; west exit_dir
|
||||
.word $0000 ; north bg
|
||||
.word $0000 ; south bg
|
||||
.word $0000 ; east bg
|
||||
.word $0000 ; west bg
|
||||
.byte BG_NORTH|BG_SOUTH
|
||||
.byte DIRECTION_N|DIRECTION_S ; special exit
|
||||
.word valve_bottom_off_lzsa ; west bg
|
||||
.byte BG_WEST
|
||||
.byte DIRECTION_W ; special exit
|
||||
.byte 15,25 ; special x
|
||||
.byte 14,34 ; special y
|
||||
.word handle_valve3-1 ; special function
|
||||
|
||||
; CHANNEL_VALVE4_ELEVATOR1 -- valve for elevator1/pipe bridge
|
||||
location41:
|
||||
.byte CHANNEL_STEPS_FORK ; north exit
|
||||
.byte CHANNEL_WIND_PATH ; south exit
|
||||
.byte CHANNEL_FORK ; north exit
|
||||
.byte $ff ; south exit
|
||||
.byte $ff ; east exit
|
||||
.byte $ff ; west exit
|
||||
.byte CHANNEL_PATH6 ; west exit
|
||||
.byte DIRECTION_N ; north exit_dir
|
||||
.byte DIRECTION_S ; south exit_dir
|
||||
.byte $ff ; south exit_dir
|
||||
.byte $ff ; east exit_dir
|
||||
.byte $ff ; west exit_dir
|
||||
.byte DIRECTION_W ; west exit_dir
|
||||
.word valve_bottom_off_lzsa ; north bg
|
||||
.word valve_top_off_lzsa ; south bg
|
||||
.word $0000 ; south bg
|
||||
.word $0000 ; east bg
|
||||
.word $0000 ; west bg
|
||||
.byte BG_NORTH|BG_SOUTH
|
||||
.byte DIRECTION_N|DIRECTION_S ; special exit
|
||||
.word valve_top_off_lzsa ; west bg
|
||||
.byte BG_NORTH|BG_WEST
|
||||
.byte DIRECTION_N|DIRECTION_W ; special exit
|
||||
.byte 15,25 ; special x
|
||||
.byte 14,34 ; special y
|
||||
.word handle_valve4-1 ; special function
|
||||
|
||||
; CHANNEL_VALVE5_ENTRY -- valve that goes to entry tree for some reason
|
||||
; CHANNEL_VALVE5_ENTRY -- valve vaguely near entry
|
||||
location42:
|
||||
.byte CHANNEL_STEPS_FORK ; north exit
|
||||
.byte CHANNEL_WIND_PATH ; south exit
|
||||
.byte CHANNEL_PATH6 ; north exit
|
||||
.byte CHANNEL_PATH5 ; south exit
|
||||
.byte $ff ; east exit
|
||||
.byte $ff ; west exit
|
||||
.byte DIRECTION_N ; north exit_dir
|
||||
@ -811,8 +828,8 @@ location42:
|
||||
|
||||
; CHANNEL_VALVE6_BRIDGE -- valve for bridge extender
|
||||
location43:
|
||||
.byte CHANNEL_STEPS_FORK ; north exit
|
||||
.byte CHANNEL_WIND_PATH ; south exit
|
||||
.byte CHANNEL_PATH2 ; north exit
|
||||
.byte CHANNEL_PATH6 ; south exit
|
||||
.byte $ff ; east exit
|
||||
.byte $ff ; west exit
|
||||
.byte DIRECTION_N ; north exit_dir
|
||||
@ -844,4 +861,11 @@ location44:
|
||||
.word $0000 ; east bg
|
||||
.word $0000 ; west bg
|
||||
.byte BG_NORTH|BG_SOUTH
|
||||
.byte $ff
|
||||
.byte DIRECTION_S ; special exit
|
||||
.byte 17,21 ; special x
|
||||
.byte 26,30 ; special y
|
||||
.word goto_valve2-1 ; special function
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user