| alien | Routines |
| Prev: 31915 | Up: Map | Next: 32719 |
|
Draws the special actors into the room view when the viewed room hosts them: the activated Android (via AlienTargetID's record) and Jones the cat, plus follow-on room furniture.
|
||||
| 31964 | LD A,(33703) | Android slot chosen for this run | ||
| 31967 | CP 8 | |||
| 31969 | JR NC,31988 | |||
| 31971 | LD A,(33704) | |||
| 31974 | AND A | |||
| 31975 | JR Z,31988 | |||
| 31977 | LD HL,(33701) | |||
| 31980 | INC HL | |||
| 31981 | LD A,(31242) | |||
| 31984 | CP (HL) | |||
| 31985 | CALL Z,32134 | |||
| 31988 | LD A,(31242) | |||
| 31991 | LD HL,33706 | |||
| 31994 | CP (HL) | |||
| 31995 | CALL Z,32109 | |||
| 31998 | LD HL,29567 | |||
| 32001 | CP (HL) | |||
| 32002 | CALL Z,32121 | |||
| 32005 | LD HL,31253 | |||
| 32008 | LD DE,29645 | |||
| 32011 | CP 6 | |||
| 32013 | JR Z,32051 | |||
| 32015 | CP 13 | |||
| 32017 | JR Z,32089 | |||
| 32019 | CP 15 | |||
| 32021 | JR Z,32064 | |||
| 32023 | CP 17 | |||
| 32025 | JR Z,32071 | |||
| 32027 | CP 18 | |||
| 32029 | JR Z,32075 | |||
| 32031 | CP 19 | |||
| 32033 | JR Z,32079 | |||
| 32035 | CP 34 | |||
| 32037 | JR Z,32040 | |||
| 32039 | RET | |||
| 32040 | BIT 6,(HL) | |||
| 32042 | RET NZ | |||
| 32043 | LD A,78 | |||
| 32045 | LD (DE),A | |||
| 32046 | LD A,81 | |||
| 32048 | INC DE | |||
| 32049 | LD (DE),A | |||
| 32050 | RET | |||
| 32051 | LD A,70 | |||
| 32053 | BIT 0,(HL) | |||
| 32055 | JR Z,32059 | |||
| 32057 | LD A,72 | |||
| 32059 | LD (DE),A | |||
| 32060 | INC DE | |||
| 32061 | INC A | |||
| 32062 | LD (DE),A | |||
| 32063 | RET | |||
| 32064 | LD A,74 | |||
| 32066 | LD (DE),A | |||
| 32067 | INC DE | |||
| 32068 | INC A | |||
| 32069 | LD (DE),A | |||
| 32070 | RET | |||
| 32071 | BIT 3,(HL) | |||
| 32073 | JR 32081 | |||
| 32075 | BIT 4,(HL) | |||
| 32077 | JR 32081 | |||
| 32079 | BIT 5,(HL) | |||
| 32081 | RET Z | |||
| 32082 | LD A,76 | |||
| 32084 | LD (DE),A | |||
| 32085 | INC A | |||
| 32086 | INC DE | |||
| 32087 | LD (DE),A | |||
| 32088 | RET | |||
| 32089 | LD A,53 | |||
| 32091 | BIT 1,(HL) | |||
| 32093 | JR Z,32097 | |||
| 32095 | LD A,55 | |||
| 32097 | LD (DE),A | |||
| 32098 | INC DE | |||
| 32099 | LD A,54 | |||
| 32101 | BIT 2,(HL) | |||
| 32103 | JR Z,32107 | |||
| 32105 | LD A,56 | |||
| 32107 | LD (DE),A | |||
| 32108 | RET | |||
|
Jones is in the viewed room: menu Special row 14 ($73CC) offers string 51 "Get Jones " (its handler needs the Net or the Cat Box), and the cat is drawn.
|
||||
| 32109 | PUSH AF | |||
| 32110 | LD DE,29644 | |||
| 32113 | LD A,51 | |||
| 32115 | LD (DE),A | |||
| 32116 | CALL 39655 | |||
| 32119 | POP AF | |||
| 32120 | RET | |||
|
The alien is in the viewed room: draw it and offer " ATTACK ".
|
||||
| 32121 | PUSH AF | |||
| 32122 | JP 44996 | |||
|
This entry point is used by the routine at 44880.
|
||||
| 32125 | LD A,52 | menu row = " ATTACK " | ||
| 32127 | LD (DE),A | |||
| 32128 | XOR A | |||
| 32129 | LD (39741),A | |||
|
This entry point is used by the routine at 44880.
|
||||
| 32132 | POP AF | |||
| 32133 | RET | |||
|
The activated Android is in the viewed room: draw it, offer ATTACK.
|
||||
| 32134 | PUSH AF | |||
| 32135 | JP 45125 | |||
|
This entry point is used by the routine at 44880.
|
||||
| 32138 | LD A,52 | menu row = " ATTACK " | ||
| 32140 | LD (DE),A | |||
|
This entry point is used by the routine at 44880.
|
||||
| 32141 | POP AF | |||
| 32142 | RET | |||
|
This entry point is used by the routine at 37490. DrawRoomTitle: the panel's top line — the room name (or "In Duct") and, for rooms, "Damage" plus the two ASCII damage digits.
|
||||
| 32143 | LD A,(31242) | room-name string = room number, | ||
| 32146 | BIT 6,A | or 93 "In Duct" inside the ducts | ||
| 32148 | JR Z,32152 | |||
| 32150 | LD A,93 | |||
| 32152 | LD HL,20576 | draw pointer -> title row | ||
| 32155 | LD (31257),HL | |||
| 32158 | CALL 31634 | |||
| 32161 | LD HL,31242 | in the ducts: no damage meter | ||
| 32164 | BIT 6,(HL) | |||
| 32166 | RET NZ | |||
| 32167 | LD HL,20587 | "Damage " (89) | ||
| 32170 | LD (31257),HL | |||
| 32173 | LD A,89 | |||
| 32175 | CALL 31634 | |||
| 32178 | LD A,(31242) | DE -> RoomDamageDigits[room] | ||
| 32181 | ADD A,A | |||
| 32182 | LD L,A | |||
| 32183 | LD H,0 | |||
| 32185 | LD DE,30006 | |||
| 32188 | ADD HL,DE | |||
| 32189 | EX DE,HL | |||
| 32190 | LD HL,20594 | draw the two ASCII digits | ||
| 32193 | LD (31257),HL | |||
| 32196 | PUSH DE | |||
| 32197 | CALL 31369 | |||
| 32200 | POP DE | |||
| 32201 | LD HL,31257 | |||
| 32204 | INC (HL) | |||
| 32205 | INC DE | |||
| 32206 | CALL 31369 | |||
| 32209 | LD HL,31257 | |||
| 32212 | INC (HL) | |||
| 32213 | LD A,135 | damage-meter icon glyph | ||
| 32215 | CALL 31370 | |||
| 32218 | RET | |||
|
Room-info panel text fragments (was mis-disassembled as code): ASCII strings drawn one glyph at a time by the panel routines below. Byte 136 is the grille-icon UDG.
|
||||
| 32219 | DEFM "Items Present" | |||
| 32232 | DEFM "Grille" | |||
| 32238 | DEFM " is ",136," " | |||
| 32244 | DEFM "Also here " | |||
| 32254 | DEFM "and " | |||
| 32258 | DEFM "but " | |||
| 32262 | DEFM "Also " | |||
| 32267 | DEFM "Bodies of " | |||
| 32277 | DEFM " ",136," " | |||
|
DrawItemsAndGrille: room-info panel section under the room name. Draws the "Items Present" header when the viewed room's item list ($750A) is non-empty, then (except aboard the Narcissus, room 34) prints "Grille" plus its state (" in place "/" removed ") from RoomGrilleState (30076) and plants the matching action-menu entry: string 49 "RmveGrille" in the Special slot (strip cell 13) while in place, or string 50 "Grille" as a move-to target (strip cell 1) once removed. Used by the routine at 32719.
|
||||
| 32280 | LD HL,29962 | HL -> viewed room's item list | ||
| 32283 | LD A,(HL) | first entry: 255 = no items here | ||
| 32284 | CP 255 | |||
| 32286 | JR Z,32313 | no items: skip the header | ||
| 32288 | LD HL,20608 | draw pointer -> items header row | ||
| 32291 | LD (31257),HL | |||
| 32294 | LD DE,32219 | "Items Present" | ||
| 32297 | LD B,13 | 13 characters | ||
| 32299 | PUSH BC | |||
| 32300 | PUSH DE | |||
| 32301 | CALL 31369 | DrawSpriteRow: one glyph | ||
| 32304 | POP DE | |||
| 32305 | POP BC | |||
| 32306 | INC DE | next character | ||
| 32307 | LD HL,31257 | |||
| 32310 | INC (HL) | draw pointer right one column | ||
| 32311 | DJNZ 32299 | |||
| 32313 | LD A,(31242) | A = viewed room | ||
| 32316 | CP 34 | Narcissus: no grille aboard the shuttle | ||
| 32318 | RET Z | |||
| 32319 | LD DE,32232 | "Grille" | ||
| 32322 | LD HL,20624 | draw pointer -> grille status row | ||
| 32325 | LD (31257),HL | |||
| 32328 | LD B,6 | 6 characters | ||
| 32330 | PUSH BC | |||
| 32331 | PUSH DE | |||
| 32332 | CALL 31369 | DrawSpriteRow: one glyph | ||
| 32335 | POP DE | |||
| 32336 | POP BC | |||
| 32337 | INC DE | |||
| 32338 | LD HL,31257 | |||
| 32341 | INC (HL) | |||
| 32342 | DJNZ 32330 | |||
| 32344 | LD A,(31242) | index RoomGrilleState by room number | ||
| 32347 | AND 63 | (mask off the in-ducts flag, bit 6) | ||
| 32349 | LD L,A | |||
| 32350 | LD H,0 | |||
| 32352 | LD DE,30076 | |||
| 32355 | ADD HL,DE | |||
| 32356 | LD A,(HL) | |||
| 32357 | CP 255 | 255 = grille still in place | ||
| 32359 | JR Z,32373 | |||
| 32361 | LD A,91 | removed: print strip 91 " removed " | ||
| 32363 | CALL 31634 | |||
| 32366 | LD DE,29631 | menu strip cell 1 (a move-to target): | ||
| 32369 | LD A,50 | string 50 "Grille" = enter the open duct | ||
| 32371 | LD (DE),A | |||
| 32372 | RET | |||
| 32373 | LD A,90 | in place: print strip 90 " in place " | ||
| 32375 | CALL 31634 | |||
| 32378 | LD DE,29643 | menu strip cell 13 (the Special slot): | ||
| 32381 | LD A,49 | string 49 "RmveGrille" | ||
| 32383 | LD (DE),A | |||
| 32384 | RET | |||
|
DrawCrewCondition: prints the room-info line "NAME is <injury> and/ but <morale>" for the selected crew member (slot in 31241), using CrewInjuryText (30110, index = strength clamped to 0-3) and CrewMoraleText (30140, index = morale byte clamped to 0-4); "but" is picked when injury and morale disagree. This entry point is used by the routines at 35451, 38379, 45290 and 45401.
|
||||
| 32385 | LD A,(31241) | A = selected crew slot | ||
| 32388 | LD HL,20640 | draw pointer -> condition row | ||
| 32391 | LD (31257),HL | |||
| 32394 | CALL 31690 | PrintName | ||
| 32397 | LD DE,32238 | " is " (shared tail of the grille text) | ||
| 32400 | LD B,4 | 4 characters | ||
| 32402 | PUSH BC | |||
| 32403 | PUSH DE | |||
| 32404 | CALL 31369 | |||
| 32407 | POP DE | |||
| 32408 | INC DE | |||
| 32409 | LD HL,31257 | |||
| 32412 | INC (HL) | |||
| 32413 | POP BC | |||
| 32414 | DJNZ 32402 | |||
| 32416 | LD A,(IX+4) | injury index from strength: | ||
| 32419 | CP 3 | 0/1/2 as-is (Dead/Collapsed/Wounded), | ||
| 32421 | JR C,32429 | 3 -> 2 (Wounded), >3 -> 3 (OK) | ||
| 32423 | LD A,3 | |||
| 32425 | JR NZ,32429 | |||
| 32427 | LD A,2 | |||
| 32429 | LD DE,30110 | print CrewInjuryText[A] | ||
| 32432 | CALL 31693 | |||
| 32435 | LD DE,32254 | "and " | ||
| 32438 | LD A,(IX+4) | pick the conjunction: "but " when | ||
| 32441 | CP 4 | injury and morale disagree (healthy | ||
| 32443 | JR C,32454 | but low morale, or hurt but high | ||
| 32445 | LD A,(IX+6) | morale), else "and " | ||
| 32448 | CP 3 | |||
| 32450 | JR NC,32464 | |||
| 32452 | JR 32461 | |||
| 32454 | LD A,(IX+6) | |||
| 32457 | CP 3 | |||
| 32459 | JR C,32464 | |||
| 32461 | LD DE,32258 | "but " | ||
| 32464 | LD B,4 | draw the 4-character conjunction | ||
| 32466 | PUSH BC | |||
| 32467 | PUSH DE | |||
| 32468 | CALL 31369 | |||
| 32471 | POP DE | |||
| 32472 | INC DE | |||
| 32473 | LD HL,31257 | |||
| 32476 | INC (HL) | |||
| 32477 | POP BC | |||
| 32478 | DJNZ 32466 | |||
| 32480 | LD A,(IX+6) | morale index, clamped to 0-4 | ||
| 32483 | CP 5 | |||
| 32485 | JR C,32489 | |||
| 32487 | LD A,4 | |||
| 32489 | LD DE,30140 | print CrewMoraleText[A] | ||
| 32492 | CALL 31693 | |||
| 32495 | JP 45695 | |||
|
FindRoomMates: scan ActorRecords' +1 room bytes for other actors in the current room, storing the first two slot numbers found into RoomMateA/RoomMateB (31250/31251).
|
||||
| 32498 | LD HL,29575 | HL -> slot 1's +1 (room) byte | ||
| 32501 | LD DE,31250 | DE -> RoomMateA | ||
| 32504 | LD BC,1793 | B = 7 slots, C = slot number 1 | ||
| 32507 | LD A,(31241) | A' = the selected actor (excluded) | ||
| 32510 | EX AF,AF' | |||
| 32511 | LD A,(31242) | A = the viewed room | ||
| 32514 | CP (HL) | same room? | ||
| 32515 | JR NZ,32526 | |||
| 32517 | EX AF,AF' | and not the selected actor itself? | ||
| 32518 | CP C | |||
| 32519 | JR Z,32525 | |||
| 32521 | EX DE,HL | store the slot number | ||
| 32522 | LD (HL),C | |||
| 32523 | EX DE,HL | |||
| 32524 | INC DE | |||
| 32525 | EX AF,AF' | |||
| 32526 | PUSH DE | next 8-byte record | ||
| 32527 | LD DE,8 | |||
| 32530 | ADD HL,DE | |||
| 32531 | POP DE | |||
| 32532 | INC C | |||
| 32533 | DJNZ 32514 | |||
| 32535 | RET | |||
|
This entry point is used by the routines at 36457 and 45401. DrawRoomMates: the "Also here NAME" / "Also Bodies of NAME" panel line. FindRoomMates fills RoomMateA/B; if every listed mate is dead (ActorRecords byte +7 != 0) the line reads "Also Bodies of", else "Also here" with the first mate's name (dead mates get the strip-94 overprint from DrawCrewStatusHalf, 33610).
|
||||
| 32536 | CALL 32498 | FindRoomMates -> RoomMateA/B | ||
| 32539 | LD HL,20672 | draw pointer -> "Also here" row | ||
| 32542 | LD (31257),HL | |||
| 32545 | LD BC,512 | B = 2 mates to check, C = 0 | ||
| 32548 | LD DE,31250 | DE -> RoomMateA | ||
| 32551 | PUSH BC | |||
| 32552 | PUSH DE | |||
| 32553 | LD A,(DE) | no (more) mates: alive path | ||
| 32554 | CP 255 | |||
| 32556 | JR Z,32607 | |||
| 32558 | ADD A,A | HL -> that slot's +7 status byte | ||
| 32559 | ADD A,A | |||
| 32560 | ADD A,A | |||
| 32561 | LD E,A | |||
| 32562 | XOR A | |||
| 32563 | LD D,A | |||
| 32564 | LD HL,29573 | |||
| 32567 | ADD HL,DE | |||
| 32568 | CP (HL) | still alive? -> alive path | ||
| 32569 | JR Z,32607 | |||
| 32571 | POP DE | this one is dead; check the next | ||
| 32572 | INC DE | |||
| 32573 | POP BC | |||
| 32574 | DJNZ 32551 | |||
| 32576 | LD DE,32262 | "Also Bodies of " (15 contiguous chars) | ||
| 32579 | LD B,15 | all mates dead: | ||
| 32581 | CALL 44509 | draw "Also Bodies of " | ||
| 32584 | LD A,(31250) | first body's name | ||
| 32587 | CALL 31690 | |||
| 32590 | LD DE,32277 | " ",136," " grille-icon spacer | ||
| 32593 | LD B,3 | |||
| 32595 | CALL 44509 | |||
| 32598 | LD A,(31251) | second body's name | ||
| 32601 | CALL 31690 | |||
| 32604 | JP 32670 | blank-pad the rest of the row | ||
| 32607 | POP BC | |||
| 32608 | POP DE | |||
| 32609 | LD HL,31250 | anyone here at all? | ||
| 32612 | LD A,(HL) | |||
| 32613 | CP 255 | |||
| 32615 | JR Z,32670 | no: just blank the row | ||
| 32617 | LD DE,32244 | "Also here " | ||
| 32620 | LD B,10 | draw "Also here " one glyph at a time | ||
| 32622 | PUSH BC | |||
| 32623 | PUSH DE | |||
| 32624 | CALL 31369 | |||
| 32627 | POP DE | |||
| 32628 | INC DE | |||
| 32629 | LD HL,31257 | |||
| 32632 | INC (HL) | |||
| 32633 | POP BC | |||
| 32634 | DJNZ 32622 | |||
| 32636 | LD A,(31250) | mate A: dead-overprint check + name | ||
| 32639 | CALL 33610 | |||
| 32642 | CALL 31690 | |||
| 32645 | LD A,(31251) | a second mate too? | ||
| 32648 | CP 255 | |||
| 32650 | JR Z,32670 | |||
| 32652 | LD A,144 | separator glyph | ||
| 32654 | CALL 31370 | |||
| 32657 | LD HL,31257 | |||
| 32660 | INC (HL) | |||
| 32661 | LD A,(31251) | mate B: dead-overprint check + name | ||
| 32664 | CALL 33610 | |||
| 32667 | JP 45692 | |||
|
This entry point is used by the routine at 45401. BlankRestOfRow: draw blank tiles until the draw pointer reaches column 0 of the next row.
|
||||
| 32670 | XOR A | |||
| 32671 | CALL 31370 | |||
| 32674 | LD HL,31257 | |||
| 32677 | INC (HL) | |||
| 32678 | LD A,(HL) | |||
| 32679 | AND 31 | |||
| 32681 | RET Z | |||
| 32682 | JR 32670 | |||
| 32684 | LD DE,29630 | |||
| 32687 | LD HL,30178 | copy the 19-byte menu skeleton | ||
| 32690 | LD BC,19 | |||
| 32693 | LDIR | |||
| 32695 | LD HL,29962 | item list: 20 x 255 = empty | ||
| 32698 | LD A,255 | |||
| 32700 | LD B,20 | |||
| 32702 | LD (HL),A | |||
| 32703 | INC HL | |||
| 32704 | DJNZ 32702 | |||
| 32706 | LD (31249),A | no actor back/front cell | ||
| 32709 | LD (31248),A | |||
| 32712 | LD (31250),A | no crew names cached | ||
| 32715 | LD (31251),A | |||
| 32718 | RET | |||
| Prev: 31915 | Up: Map | Next: 32719 |