Prev: 39000 Up: Map Next: 39077
39041: EngineStateScan — tick the three engine-room fires
ShipSystemFlags bits 3-5 mark fires in Engine #1/#2/#3 (rooms 17-19, lit by the damage-meter alarm at 38252). Each burning engine goes through FireDamageTick; then the 100-frame ship tick that paces fire damage is advanced.
Used by the routine at 38379.
39041 LD D,8 D = bit mask (bit 3),
39043 LD A,(31253) A = ShipSystemFlags,
39046 LD E,17 E = Engine #1's room
39048 BIT 3,A Engine #1 on fire?
39050 CALL NZ,39077
39053 SLA D next bit / next room:
39055 INC E
39056 BIT 4,A Engine #2 on fire?
39058 CALL NZ,39077
39061 SLA D
39063 INC E
39064 BIT 5,A Engine #3 on fire?
39066 CALL NZ,39077
39069 LD HL,38354 advance the 100-frame ship tick
39072 DEC (HL)
39073 RET NZ
39074 LD (HL),100
39076 RET
Prev: 39000 Up: Map Next: 39077