alias larre d0 alias depositchute d1 alias sensor d2 alias stationidx r15 alias seedstation r10 alias index r9 alias depositstation r8 define tooCold 280 define tooHot 320 start: get r0 db 0 mul r0 r0 3 add sp r0 2 # reset the stack pointer, because we might have not popped everything s db Setting 42 move index 0 loop1: jal clearchute mul r0 index 3 add r0 r0 1 get stationidx db r0 add r0 r0 1 get seedstation db r0 add r0 r0 1 get depositstation db r0 doplant: ls r0 larre 0 Occupied blez r0 regular s larre Setting depositstation jal waittillidle s larre Activate 1 jal waittillidle jal clearchute j doplant regular: s larre Setting stationidx jal waittillidle ls r0 larre 255 Occupied s db Setting 71 blez r0 plantseed # something is growing ls r0 larre 255 Seeding s db Setting 72 bltz r0 advance # hasn't grown a seed yet jal waittillidle harvest: s larre Activate 1 jal waittillidle ls r0 larre 255 Seeding sgez r0 r0 rand r2 sgt r2 r2 0.5 ls r1 larre 255 Occupied max r1 r1 r2 min r0 r0 r1 # disable to allow replanting the same thing bgtz r0 harvest j doplant plantseed: l r0 sensor RatioPollutant bgtz r0 advance l r0 sensor RatioWater l r1 sensor RatioSteam add r0 r1 r0 blt r0 0.9 advance l r0 sensor Temperature blt r0 tooCold advance bgt r0 tooHot advance l r0 sensor Pressure blt r0 10 advance s larre Setting seedstation jal waittillidle s larre Activate 1 jal waittillidle yield # give the game time to detect the arm has an item. ls r0 larre 0 Occupied blez r0 advance #no seed available s larre Setting stationidx jal waittillidle s larre Activate 1 jal waittillidle advance: s db Setting 73 #s db Setting index add index index 1 get r0 db 0 # number of hydroponics blt index r0 loop1 s db Setting index yield j start # waittillidle: yield l r0 larre Idle beqz r0 waittillidle l r0 larre Setting l r1 larre PositionX bne r0 r1 waittillidle j ra clearchute: bdns depositchute nochute ls r0 depositchute 0 Occupied seqz r0 r0 s depositchute Open r0 j ra nochute: lbs r0 HASH("StructureChuteBin") 0 Occupied Maximum seqz r0 r0 sb HASH("StructureChuteBin") Open r0 j ra |
MIPS is the programming language used by IC (integrated circuits) in the game Stationeers. Stationeering web site has a MIPS emulator with syntax highlighting and error detection.