From 42ef2297d709de5a075628fd1e18447b5754db0d Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 15 Jun 2020 00:47:07 -0400 Subject: [PATCH] mist: channelwood: fix behavior of bridge/pipe validated with actual game if you could repeatedly open/close including when water is running --- mist/channel_switches.s | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mist/channel_switches.s b/mist/channel_switches.s index f9de804c..7900042e 100644 --- a/mist/channel_switches.s +++ b/mist/channel_switches.s @@ -4,11 +4,13 @@ ; if CHANNEL_SWITCHES CHANNEL_SW_WINDMILL and CHANNEL_SW_FAUCET ; TODO: also if various valves in correct pattern +; verified: can raise and lower bridge if powered with water + raise_bridge: bit $C030 ; click speaker - ; only raise it if water is flowing + ; only raise/lower if water is flowing lda CHANNEL_SWITCHES and #CHANNEL_SW_WINDMILL|CHANNEL_SW_FAUCET @@ -16,10 +18,10 @@ raise_bridge: ; bne no_raise_bridge - ; only raise the bridge, don't think you can lower it + ; toggle bridge state lda CHANNEL_SWITCHES - ora #CHANNEL_BRIDGE_UP + eor #CHANNEL_BRIDGE_UP sta CHANNEL_SWITCHES jsr adjust_after_changes @@ -35,17 +37,16 @@ no_raise_bridge: ;======================= ; extend_pipe -; TODO: can you unextend in game? -; TODO: can you unextend if water flowing? +; verified: can open/shut even if water is flowing extend_pipe: bit $C030 ; click speaker - ; only extend pipe + ; toggle state lda CHANNEL_SWITCHES - ora #CHANNEL_PIPE_EXTENDED + eor #CHANNEL_PIPE_EXTENDED sta CHANNEL_SWITCHES jsr adjust_after_changes