Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #= AirLock ICS = v0.2 ================ by swagman =#
- # __ _ ___ _ ___ __ _ 1-2 #
- # / /\ | | | |_) | | / / \ / /` | |_/ rev #
- # /_/--\ |_| |_| \ |_|__ \_\_/ \_\_, |_| \ pas #
- #==================================================#
- # Vent0, Vent1, Pulse - optional devices #
- # + airlock control (1-2 mode, revers, quick pass) #
- # + beacon pulsator (turn on by 1 tick per period) #
- #= 2020.09.11 22:18 https://youtu.be/FDvsPXmCRVM =#
- define press0 0 #outer (Vent0) pressure set 0 kPa
- define press1 50 #inner (Vent1) pressure set 50 kPa
- define period 20 #beacon pulse period 20 ticks
- alias Door0 d0
- alias Vent0 d1
- alias GSens d2
- alias Door1 d3
- alias Vent1 d4
- alias Pulse d5
- alias state r15
- alias route r14
- alias count r13
- #also used r5 to r11
- move state st1
- loop:#--main loop
- s Door0 Setting 0
- s Door1 Setting 0
- yield
- select r5 route press0 press1
- select r7 route 1 4 #Vent0 Vent1
- select r6 route 4 1 #Vent1 Vent0
- select r8 route 3 0 #Door1 Door0
- select r9 route 0 3 #Door0 Door1
- l r10 GSens Pressure
- l r11 dr9 Setting
- l r12 dr8 Setting
- s db Setting state #4debug
- j state
- st1: #--door opened
- l r0 Door0 Open #--init\
- l route Door1 Open
- xor r0 route r0
- s Door0 Mode r0
- s Door1 Mode r0
- brnez r0 3
- s Door0 On 1
- s Door1 On 1 #--init/
- beqz r11 end
- s dr8 Open 0
- s dr8 On 1
- move state st2
- j end
- st2: #--vacuuming
- xor route route r12
- select state r12 st3 st2
- sgtz r0 r10
- bdns dr6 st3
- s dr6 On r0
- s dr6 Mode 1
- select state r0 state st3
- j end
- st3: #--pressurize
- xor route route r12
- select state r12 st2 st3
- slt r0 r10 r5
- select r0 r11 0 r0
- brdns dr7 5
- s dr7 On r0
- s dr7 Mode 0
- s dr7 PressureExternal r5
- bgtz r0 end
- s dr9 Open 1
- s dr9 On 0
- xor route route 1
- move state st1
- end:#--airlock
- brdns Pulse 5 #--beacon pulsator
- slez r0 count
- s Pulse On r0
- select count r0 period count
- sub count count 1
- j loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement