Prev: 40149 Up: Map Next: 40281
40212: LaunchGate
Fixture 78 (Narcissus launch console). Intended rule: the launch is COUNTERMANDED (msg #28) unless every living crew member's room is 34 (Narcissus); then Jones must be aboard too (JonesRoom = 34, or the cat caught and the Cat in Net/Box item aboard or held) or msg #27 "BioUnit Jones not present" fires first.
BUG (simulator-verified): the crew walk drifts off the +7 status column after the first LIVE crew member — the "back to the next record" step adds 8 from the +1 room byte instead of returning to +7, so every later slot has its ROOM byte read as a status byte.
Rooms are almost never 0, so later crew are simply skipped: the launch really only requires the first-listed living crew member (plus Jones) to be aboard, and the rest are left behind. The one side effect: a later crew member standing in Airlock #1 (room 0) bogusly countermands the launch.
40212 LD HL,29581 walk the +7 status column of all 7 crew
40215 LD DE,8
40218 LD B,7
40220 XOR A is this crew member alive?
40221 CP (HL)
40222 JR NZ,40235 no: he needn't board
40224 PUSH DE yes: HL -> his room byte (+1)
40225 LD DE,65530
40228 ADD HL,DE
40229 POP DE
40230 LD A,(HL) aboard the Narcissus (34)?
40231 CP 34
40233 JR NZ,40275 no: LAUNCH COUNTERMANDED
40235 ADD HL,DE +8 — but from +1 after a live crew
40236 DJNZ 40220 member: the walk drifts (see BUG)
40238 LD A,(33706) Jones aboard on his own paws?
40241 CP 34
40243 JR Z,40281 yes: LAUNCH
40245 CP 255 or caught (carried, room 255)?
40247 JR NZ,40270 neither: he is missing
40249 LD HL,29960 caught: where is the Cat in
40252 LD B,2 Net (20) / Cat in Box (21)?
40254 LD A,(HL)
40255 CP 255 (nonexistent: try the other)
40257 JR Z,40267
40259 CP 34 lying in the Narcissus,
40261 JR Z,40281
40263 CP 128 or in somebody's hand?
40265 JR NC,40281 either way: LAUNCH
40267 INC HL
40268 DJNZ 40254
40270 LD A,27 msg #27 "BioUnit Jones not present"
40272 CALL 37176
40275 LD A,28 msg #28 "LAUNCH COUNTERMANDED"
40277 CALL 37176
40280 RET
Prev: 40149 Up: Map Next: 40281