![]() |
Routines |
| Prev: 32239 | Up: Map | Next: 32543 |
|
Used by the routine at 55726.
|
||||
| 32252 | CALL 54333 | Print or update command summary window at top of screen | ||
| 32255 | LD DE,42015 | Point DE at "SEND TRANSPORTER CONTENTS"... | ||
| 32258 | CALL 54283 | ...and print in command summary window at top of screen | ||
| 32261 | LD DE,42145 | Point DE at "TO"... | ||
| 32264 | CALL 54283 | ...and print in command summary window at top of screen | ||
| 32267 | LD DE,37227 | Point DE at y-coordinate of top edge of window 17 in window data table at 37089... | ||
| 32270 | LD A,13 | ...and set this window's height to 13... | ||
| 32272 | CALL 33782 | ... | ||
| 32275 | LD A,17 | Draw window 17... | ||
| 32277 | CALL 34990 | ... | ||
| 32280 | LD HL,42032 | Point HL at "ENTER TRANSPORTER COORDINATES" menu text... | ||
| 32283 | CALL 34762 | ...and print to screen | ||
| 32286 | LD A,127 | Store 127 (white INK, white PAPER, BRIGHT) at 23695... | ||
| 32288 | LD (23695),A | ... | ||
| 32291 | LD DE,18438 | Load D with 72 (pixels) and E with 6 (characters) | ||
| 32294 | CALL 32694 | Handle vertical scrolling digit selection for x-coordinate and load A with selected digit's ASCII code | ||
| 32297 | LD (42174),A | Set x-coordinate value (as ASCII character code) in "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32300 | LD DE,18440 | Load D with 72 (pixels) and E with 8 (characters) | ||
| 32303 | CALL 32694 | Handle vertical scrolling digit selection for y-coordinate and load A with selected digit's ASCII code | ||
| 32306 | LD (42176),A | Set y-coordinate value (as ASCII character code) in "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32309 | LD DE,18442 | Load D with 72 (pixels) and E with 10 (characters) | ||
| 32312 | CALL 32694 | Handle vertical scrolling digit selection for z-coordinate and load A with selected digit's ASCII code | ||
| 32315 | LD (42178),A | Set z-coordinate value (as ASCII character code) in "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32318 | LD A,78 | Store 78 (yellow INK, blue PAPER, BRIGHT) at 23695... | ||
| 32320 | LD (23695),A | ... | ||
| 32323 | LD DE,42173 | Point DE at "X.Y.Z."... | ||
| 32326 | CALL 54283 | ...and print in command summary window at top of screen | ||
| 32329 | CALL 55115 | Display execute / reject command window and return here if execute chosen, else exit to main game loop | ||
| 32332 | LD A,(23451) | If transporter-repaired flag is reset... | ||
| 32335 | BIT 0,A | ... | ||
| 32337 | JP Z,32521 | ...then skip ahead to 32521 | ||
| 32340 | LD HL,32543 | Point HL at table of transporter pad data | ||
| 32343 | LD BC,8 | Load BC with 8 (as each transporter pad entry is eight bytes wide) | ||
| 32346 | LD A,(23700) | If current transporter pad is at the same location as the USS Pisces... | ||
| 32349 | CP (HL) | ... | ||
| 32350 | JR Z,32360 | ...then skip ahead to 32360 | ||
| 32352 | LD A,99 | If current transporter pad's current location is 99 (end marker)... | ||
| 32354 | CP (HL) | ... | ||
| 32355 | JR Z,32360 | ...then skip ahead to 32360 | ||
| 32357 | ADD HL,BC | Advance HL by eight bytes to next transporter pad entry | ||
| 32358 | JR 32346 | Loop back to 32346 for next transporter pad | ||
| 32360 | INC HL | Advance HL to transporter pad's x-coordinate (ASCII) | ||
| 32361 | LD A,(42174) | Load A with ASCII x-coordinate value from "YOU HAVE ARRIVED AT..." text at 42171... | ||
| 32364 | CP 48 | ...and if this is 48 ("0", i.e. first digit in USS Pisces' transporter coordinates)... | ||
| 32366 | JP Z,32449 | ...then skip ahead to 32449 | ||
| 32369 | CP (HL) | If current transporter pad's ASCII x-coordinate is not the same as x-coordinate value in A... | ||
| 32370 | JP NZ,32482 | ...then skip ahead to 32482 | ||
| 32373 | LD A,(42176) | Load A with ASCII y-coordinate value from "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32376 | INC HL | Advance HL to transporter pad's ASCII y-coordinate | ||
| 32377 | CP (HL) | If current transporter pad's ASCII y-coordinate is not the same as y-coordinate value in A... | ||
| 32378 | JP NZ,32482 | ...then skip ahead to 32482 | ||
| 32381 | LD A,(42178) | Load A with ASCII z-coordinate value from "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32384 | INC HL | Advance HL to transporter pad's ASCII z-coordinate | ||
| 32385 | CP (HL) | If current transporter pad's ASCII z-coordinate is not the same as z-coordinate value in A... | ||
| 32386 | JP NZ,32482 | ...then skip ahead to 32482 | ||
| 32389 | INC HL | Advance HL to transporter pad's room | ||
| 32390 | LD A,(HL) | Set operand of instruction at 32427 to index of pad's room... | ||
| 32391 | LD (32428),A | ... | ||
| 32394 | INC HL | Advance HL to destination x-coordinate (for Magic Knight) | ||
| 32395 | LD A,(HL) | Set operand of instruction at 32417 to destination x-coordinate... | ||
| 32396 | LD (32418),A | ... | ||
| 32399 | INC HL | Advance HL to destination y-coordinate (for Magic Knight) | ||
| 32400 | LD A,(HL) | Set operand of instruction at 32422 to destination y-coordinate... | ||
| 32401 | LD (32423),A | ... | ||
| 32404 | CALL 27765 | Draw Magic Knight's current room, draw objects and characters and initialise room-specific data | ||
| 32407 | CALL 32623 | Set top-left and bottom-right of area to cycle attributes (for transporter effect) | ||
| 32410 | XOR A | Prepare to fill a region with attribute 0 (black INK, black PAPER)... | ||
| 32411 | LD (35948),A | ... | ||
| 32414 | CALL 32602 | Display transporter glow effect | ||
|
The operand of the instruction at 32417 is Magic Knight's new x-coordinate. This is modified by the instructions at 32396 and 32472.
|
||||
| 32417 | LD A,0 | Set Magic Knight's x-coordinate (pixels) to transporter pad arrival point | ||
| 32419 | LD (25156),A | ... | ||
| 32422 | LD A,0 | Set Magic Knight's y-coordinate (pixels) to transporter pad arrival point | ||
| 32424 | LD (25157),A | ... | ||
| 32427 | LD A,0 | Move Magic Knight into room A, draw room and initialise room-specific data... | ||
| 32429 | CALL 27762 | ... | ||
| 32432 | CALL 32623 | Set top-left and bottom-right of area to cycle attributes (for transporter effect) | ||
| 32435 | CALL 32602 | Display transporter glow effect | ||
| 32438 | LD A,7 | Prepare to fill a region with attribute 7 (white INK, black PAPER)... | ||
| 32440 | LD (35948),A | ... | ||
| 32443 | CALL 35940 | Fill a region of attribute file with specified attribute | ||
| 32446 | JP 55272 | Display "YOU HAVE ARRIVED AT X.Y.Z." window (17) and return to game | ||
| 32449 | LD A,(42176) | Load A with y-coordinate value (as ASCII character code) from "YOU HAVE ARRIVED AT..." text at 42171... | ||
| 32452 | CP 48 | ...and if this is not 48 ("0")... | ||
| 32454 | JP NZ,32482 | ...then skip ahead to 32482 | ||
| 32457 | LD A,(42178) | Load A with z-coordinate value (as ASCII character code) from "YOU HAVE ARRIVED AT..." text at 42171 | ||
| 32460 | CP 48 | ...and if this is not 48 ("0")... | ||
| 32462 | JP NZ,32482 | ...then skip ahead to 32482 | ||
| 32465 | LD A,2 | Set operand of instruction at 32427 to 2 (USS Pisces, 2, The Transporter Room)... | ||
| 32467 | LD (32428),A | ... | ||
| 32470 | LD A,120 | Set operand of instruction at 32417 to 120 (x-coordinate of middle of USS Pisces' transporter pad)... | ||
| 32472 | LD (32418),A | ... | ||
| 32475 | LD A,120 | Set operand of instruction at 32422 to 120 (y-coordinate of USS Pisces' transporter pad)... | ||
| 32477 | LD (32423),A | ... | ||
| 32480 | JR 32404 | Jump back to 32404 to beam Magic Knight back to USS Pisces | ||
| 32482 | CALL 27765 | Draw Magic Knight's current room, draw objects and characters and initialise room-specific data | ||
| 32485 | CALL 32623 | Set top-left and bottom-right of area to cycle attributes (for transporter effect) | ||
| 32488 | CALL 32602 | Display transporter glow effect | ||
| 32491 | LD HL,45157 | Point HL at "IT WOULD MAKE MORE SENSE TO ENTER COORDINATES..." text | ||
| 32494 | PUSH HL | Store HL (pointer to "IT WOULD MAKE MORE SENSE TO ENTER COORDINATES..." text) | ||
| 32495 | LD DE,37187 | Prepare to adjust height of window 12 to accommodate text | ||
| 32498 | LD HL,45013 | Point HL at "THE TRANSPORTER SENDS YOU TO SUFFOCATE..." text | ||
| 32501 | CALL 33774 | Adjust height of window 12 to accommodate text | ||
| 32504 | PUSH HL | Store HL (pointer to "THE TRANSPORTER SENDS YOU TO SUFFOCATE..." / "THE TRANSPORTER IS BROKEN" text) | ||
| 32505 | LD A,12 | Draw window 12... | ||
| 32507 | CALL 34990 | ... | ||
| 32510 | POP HL | Restore HL (pointer to "THE TRANSPORTER SENDS YOU TO SUFFOCATE..." / "THE TRANSPORTER IS BROKEN" text) | ||
| 32511 | CALL 34762 | Print text to screen | ||
| 32514 | CALL 55138 | Display "PRESS FIRE TO CONTINUE" window and wait for fire to be pressed | ||
| 32517 | POP HL | Restore HL (pointer to "IT WOULD MAKE MORE SENSE TO ENTER COORDINATES..." / "THE TRANSPORTER HAS MALFUNCTIONED..." text) | ||
| 32518 | JP 55685 | Jump to "game over" window routine and return to control selection menu | ||
|
Magic Knight has used the transporter while it is broken
|
||||
| 32521 | CALL 27765 | Draw Magic Knight's current room, draw objects and characters and initialise room-specific data | ||
| 32524 | CALL 32623 | Set top-left and bottom-right of area to cycle attributes (for transporter effect) | ||
| 32527 | CALL 32602 | Display transporter glow effect | ||
| 32530 | LD HL,45059 | Point HL at "THE TRANSPORTER HAS MALFUNCTIONED..." text | ||
| 32533 | PUSH HL | Store HL (pointer to "THE TRANSPORTER HAS MALFUNCTIONED..." text) | ||
| 32534 | LD DE,37187 | Prepare to adjust height of window 12 to accommodate text | ||
| 32537 | LD HL,42147 | Point HL at "THE TRANSPORTER IS BROKEN" text | ||
| 32540 | JP 32501 | Jump back to 32501 (display GAME OVER message and return to control selection menu) | ||
| Prev: 32239 | Up: Map | Next: 32543 |