Add advanced_furbace_basic_alloys.asm

This commit is contained in:
Ivor Barhansky 2024-07-30 10:43:46 +00:00
parent 144e2cbff5
commit 522ae7f999

View File

@ -0,0 +1,102 @@
alias Dial d0
alias Lever d1
alias AdvFurnace d2
alias minPressure r15
alias maxPressure r14
alias minTemperature r13
alias maxTemperature r12
alias TFuel r11
alias Ingot r10
alias FPressure r9
alias FTemperature r8
alias OutputPump r7
alias PressureFuel r6
alias SetIngot r5
off:
move TFuel 0
s AdvFurnace Open 0
s AdvFurnace SettingInput 0
s AdvFurnace SettingOutput 0
s Lever Open 0
main:
l r0 Dial Setting
beq r0 0 IngotSteel
beq r0 1 IngotConstantan
beq r0 2 IngotElectrum
beq r0 3 IngotSolder
beq r0 4 IngotInvar
j main
IngotSteel:
move SetIngot 0
move Ingot -654790771
s db Setting -654790771
j IngotAll
IngotConstantan:
move SetIngot 1
move Ingot 1058547521
s db Setting 1058547521
j IngotAll
IngotElectrum:
move SetIngot 2
move Ingot 502280180
s db Setting 502280180
j IngotAll
IngotSolder:
move SetIngot 3
move Ingot -82508479
s db Setting -82508479
j IngotAll
IngotInvar:
move SetIngot 4
move Ingot -297990285
s db Setting -297990285
j SIngotInvar
IngotAll:
l r0 Dial Setting
bne r0 SetIngot main
move minPressure 800
move maxPressure 2400
move minTemperature 1000
move maxTemperature 1500
move OutputPump 40
move PressureFuel 0.05
l r1 Lever Setting
beq r1 1 Smelting
j IngotAll
SIngotInvar:
l r0 Dial Setting
bne r0 SetIngot main
move minPressure 6000
move maxPressure 7000
move minTemperature 1200
move maxTemperature 2000
move OutputPump 50
move PressureFuel 0.1
l r1 Lever Setting
beq r1 1 Smelting
j SIngotInvar
Smelting:
s db Setting 0
s AdvFurnace Activate 1
l FPressure AdvFurnace Pressure
slt r0 FPressure minPressure
l FTemperature AdvFurnace Temperature
slt r2 FTemperature minTemperature
add r1 r0 r2
select r0 r1 TFuel 0
s AdvFurnace SettingInput r0
add TFuel TFuel PressureFuel
l FPressure AdvFurnace Pressure
sgt r0 FPressure maxPressure
select r3 r0 OutputPump 0
s AdvFurnace SettingOutput r3
l r4 AdvFurnace RecipeHash
seq r4 r4 Ingot
s AdvFurnace Open r4
l r4 Lever Open
beq r4 0 off
j Smelting