; SkoolKit disassembly for Knight Tyme (48k) ; ; Copyright (c) 2017 Philip M. Anderson (this disassembly) ; Copyright (c) 1986 David Jones / Mastertronic (Knight Tyme) @start=26624 @org ; Space for Calculations / Storage (e.g. Scrolling Graphics) b23296 DEFB 0,0,0,0,0,0,0,0 23304 DEFB 0,0,0,0,0,0,0,0 23312 DEFB 0,0,0,0,0,0,0,0 23320 DEFB 0,0,0,0,0,0,0,0 23328 DEFB 0,0,0,0,0,0,0,0 23336 DEFB 0,0,0,0,0,0,0,0 23344 DEFB 0,0,0,0,0,0,0,0 23352 DEFB 0,0,0,0,0,0,0,0 23360 DEFB 0,0,0,0,0,0,0,0 23368 DEFB 0,0,0,0,0,0,0,0 23376 DEFB 0,0,0,0,0,0,0,0 23384 DEFB 0,0,0,0,0,0,0,0 23392 DEFB 0,0,0,0,0 ; Miscellaneous Data 1 b23397 DEFB 0 ; Bonus Score 23398 DEFW 0 ; Temporary storage used by the routine at #R54647 (Redefine Keyboard Controls) ; Unused b23400 DEFB 0,0 ; Unknown / Unused Flag 1 b23402 DEFB 0 ; Unknown and unused flag in Bit 0, set in routine at #R32055, but otherwise unused. ; Score / Progress Flags (1) ; ; Bitwise flags which record Magic Knight's achievements, and are used in calculating percentage completion. Flags ; are initially reset, and each one is set when the corresponding action is performed. b23403 DEFB 0 ; Table of Characters in Room of Interest ; ; List of characters in a particular room, as set by the routine at #R34512 b23404 DEFB 0,0,0,0,0,0,0,0 23412 DEFB 0,0,0,0,0,0,0,0 ; Miscellaneous Data 2 b23420 DEFW 0 ; Pointer to entry in Table of Display File Addresses for pixel row at Magic Knight's current ; y-coordinate 23422 DEFB 0 ; Temporary store for Magic Knight's x-coordinate in characters 23423 DEFB 0 ; Temporary store for Magic Knight's x-coordinate in characters (stored by instruction at ; #R53173 but otherwise unused) 23424 DEFB 0 ; Temporary store for Magic Knight's y-coordinate in pixels (stored by instruction at #R53179 ; but otherwise unused) 23425 DEFB 0 ; Magic Knight Facing Left Flag ; Miscellaneous Data 3 b23426 DEFB 0 ; Temporary store for x-coordinate of left edge (of frame, or of interior) of current window to ; draw (characters) / graphic (room drawing) 23427 DEFB 0 ; Temporary store for y-coordinate of top edge (of frame, or of interior) of current window to ; draw (characters) / graphic (room drawing) 23428 DEFB 0 ; Temporary store for x-coordinate of right edge (of frame, or of interior) of current window ; to draw (characters), x+1 for current graphic (room drawing) 23429 DEFB 0 ; Temporary store for y-coordinate of bottom edge (of frame, or of interior) of current window ; to draw (characters), y+1 for current graphic (room drawing) ; Unused b23430 DEFB 0,0,0,0 ; Miscellaneous Data 4 b23434 DEFB 0 ; Set to index of Current Character (S3 E3 / Klink help routine) but otherwise unused (see ; trivia) 23435 DEFB 0 ; Remaining amount of star drive fuel in current "unit" (each unit divided into 256 portions) ; Currently Available Destinations for "MOVE STARSHIP" Command ; ; Eight slots, populated by the routine at #R31688 and used by that routine to display the content of the "WHERE TO ; ?" menu. b23436 DEFB 0 23437 DEFB 0 23438 DEFB 0 23439 DEFB 0 23440 DEFB 0 23441 DEFB 0 23442 DEFB 0 23443 DEFB 0 ; Miscellaneous Data 5 b23444 DEFB 0 ; x-coordinate of graphic to draw 23445 DEFB 0 ; y-coordinate of graphic to draw 23446 DEFB 0 ; Store for room attribute, set at #R27953 but otherwise unused 23447 DEFW 0 ; Store for address of graphic data 23449 DEFB 0 ; Store for pixel row counter ; Vertical and Horizontal Mirror Flags ; ; Used by the routines at #R52513, #R52535, #R52566, #R52596, #R52635, #R52717 and #R52820 in graphic / room ; drawing. When the Vertical Mirror Flag is set, the graphic is reflected in a vertical mirror (i.e. left and right ; are swapped). When the Horizontal Mirror Flag is set, the graphic is reflected in a horizontal mirror (i.e. top ; and bottom are swapped). b23450 DEFB 0 ; Score / Progress Flags (2) ; ; Bitwise flags which record Magic Knight's achievements, and are used in calculating percentage completion. Flags ; are initially reset, and each one is set when the corresponding action is performed. b23451 DEFB 0 ; Unused b23452 DEFB 0,0,0 ; Miscellaneous Data 6 b23455 DEFB 0 ; Index of character whose turn it is to be updated 23456 DEFB 0 ; Initial y-coordinate of top of hand cursor relative to current window (characters) ; Time Data ; ; Data related to Magic Knight's time left, and also elapsed game time. b23457 DEFB 0 ; Current Time Left - game days (5 real-time minutes per game day) 23458 DEFB 0 ; Minute Counter (Time Elapsed since last "day") 23459 DEFB 0 ; Second Counter (Time Elapsed since last minute) 23460 DEFB 0 ; 1/50 Second Counter (Time Elapsed since last second) ; Miscellaneous Data 7 b23461 DEFB 0 ; Draw Communicate Window / Face Flag (0 = reset, any other value = set) ; Unused b23462 DEFB 0 ; Miscellaneous Data 8 b23463 DEFB 0 ; Magic Knight's temporary movement flags 23464 DEFB 0,0,0,0,0 ; Storage space for ASCII string converted from numeric value ; Unused b23469 DEFB 0,0 ; Miscellaneous Data 9 b23471 DEFB 0 ; Index of previous "Consult Oracle" text shown ; Tyme Guardians Flags ; ; Bitwise flags. The bits are as follows: b23472 DEFB 0 ; Miscellaneous Data 10 b23473 DEFB 0 ; Temporary store for an object's Terrain Interaction Parameter ; Magic Knight Movement Flags ; ; Bitwise flags which determine which direction(s) Magic Knight cannot currently move (i.e. set means can't move). ; The bits are as follows: b23474 DEFB 0 ; Miscellaneous Data 11 b23475 DEFB 0 ; Height available to Menu Hand Cursor to move down (pixels) 23476 DEFB 0 ; x-coordinate of left-most character in a row of menu text (characters) 23477 DEFB 0 ; y-coordinate of "finger" on hand-cursor (characters) 23478 DEFB 0 ; Menu hand-cursor's y-coordinate (pixels) 23479 DEFB 0 ; Current y-coordinate of hand cursor relative to its starting position (pixels) ; Unknown / Unused Flag 2 b23480 DEFB 0 ; Miscellaneous Data 12 b23481 DEFB 0 ; Attribute of interior of current window, i.e. background / foreground colours of contents 23482 DEFB 0 ; Magic Knight's predicted x-coordinate (used in routine at #R27508) 23483 DEFB 0 ; Magic Knight's predicted y-coordinate (used in routine at #R27508) 23484 DEFB 0 ; Store for selected starship speed index ; Unused b23485 DEFB 0,0 ; Miscellaneous Data 13 b23487 DEFB 0 ; Store for currently active keyboard press / joystick action ; The following byte keeps track of the number of times the text printing routine calls itself, in printing common ; words as part of a higher-level string. 23488 DEFB 0 ; Text Printing Routine Recursion Depth Counter 23489 DEFB 0 ; x-coordinate of left edge of region to scroll (characters) 23490 DEFB 0 ; x-coordinate of right edge of region to scroll (characters) 23491 DEFB 0 ; y-coordinate of top of region to scroll (pixels) 23492 DEFB 0 ; y-coordinate of bottom of region to scroll (pixels) 23493 DEFB 0 ; x-coordinate of left edge (of frame, or of interior) of current window to draw (characters) / ; graphic (room drawing) 23494 DEFB 0 ; y-coordinate of top edge (of frame, or of interior) of current window to draw (characters) / ; graphic (room drawing) 23495 DEFB 0 ; x-coordinate of right edge (of frame, or of interior) of current window to draw (characters), ; x+1 for current graphic (room drawing) 23496 DEFB 0 ; y-coordinate of bottom edge (of frame, or of interior) of current window to draw ; (characters), y+1 for current graphic (room drawing) ; Unused b23497 DEFB 0 ; Attribute File address for Virtual Text Cursor b23498 DEFW 0 ; Unused b23500 DEFB 0,0 ; Visited Room Flags ; ; Fifty bytes, one for each room in the game. At the start of the game, these are all reset (i.e. zero). Each time ; Magic Knight enters a room for the first time, the flag corresponding to that room is set (to 1). These flags are ; used in calculating percentage completion. b23502 DEFB 0 ; (00) - USS Pisces, 0 (The Recreation Room) 23503 DEFB 0 ; (01) - USS Pisces, 1 (The Bridge) 23504 DEFB 0 ; (02) - USS Pisces, 2 (The Transporter Room) 23505 DEFB 0 ; (03) - USS Pisces, 3 (The Transputer Room) 23506 DEFB 0 ; (04) - USS Pisces, 4 (Cargo Hold) 23507 DEFB 0 ; (05) - USS Pisces, 5 (The Airlock) 23508 DEFB 0 ; (06) - USS Pisces, 6 (The Life Boat) 23509 DEFB 0 ; (07) - Retreat, 0 (Murphy's Moon) 23510 DEFB 0 ; (08) - Retreat, 1 23511 DEFB 0 ; (09) - Retreat, 2 23512 DEFB 0 ; (10) - Retreat, 3 23513 DEFB 0 ; (11) - Starbase 1, 0 (The Transporter Room) 23514 DEFB 0 ; (12) - Starbase 1, 1 (McTablet Takeaway Food) 23515 DEFB 0 ; (13) - Starbase 1, 2 23516 DEFB 0 ; (14) - Starbase 1, 3 23517 DEFB 0 ; (15) - Starbase 1, 4 (Fuel and Cargo Area) 23518 DEFB 0 ; (16) - Outpost, 0 (Ye Olde Transporter) 23519 DEFB 0 ; (17) - Outpost, 1 (The Main Defence System) 23520 DEFB 0 ; (18) - Outpost, 2 23521 DEFB 0 ; (19) - Outpost, 3 (The Proof of Power) 23522 DEFB 0 ; (20) - Outpost, 4 (The Tyme Guardians) 23523 DEFB 0 ; (21) - Monopole, 0 (Hooper's Emergency Exit) 23524 DEFB 0 ; (22) - Monopole, 1 (This Way to Hooper ==>>) 23525 DEFB 0 ; (23) - Monopole, 2 (Here is Hooper) 23526 DEFB 0 ; (24) - USS Pisces, 6A (The Control Column) ; The following are unused, but still counted by the routine at #R33657 (see trivia). 23527 DEFB 0,0,0,0,0,0,0,0 23535 DEFB 0,0,0,0,0,0,0,0 23543 DEFB 0,0,0,0,0,0,0,0 23551 DEFB 0 23552 DEFB 0,0,0,0,0,0,0,0 23560 DEFB 0,0,0,0,0,0,0,0 23568 DEFB 0,0,0,0,0,0,0,0 23576 DEFB 0,0,0,0,0,0,0,0 23584 DEFB 0,0,0,0,0,0,0,0 23592 DEFB 0,0,0,0,0,0,0,0 23600 DEFB 0,0,0,0,0,0,0,0 23608 DEFB 0,0,0,0,0,0,0,0 23616 DEFB 0,0,0,0,0,0,0,0 23624 DEFB 0,0,0 ; VARS system variable @ssub=DEFW 23856 b23627 DEFW 0 23629 DEFB 0,0,0,0,0,0 ; PROG system variable @ssub=DEFW 23755 b23635 DEFW 0 23637 DEFB 0,0,0,0,0,0,0,0 23645 DEFB 0,0,0,0,0,0,0,0 23653 DEFB 0,0,0,0,0,0,0,0 23661 DEFB 0,0,0,0,0,0,0,0 23669 DEFB 0,0,0,0,0,0 ; Interrupt Routine Flags ; ; Bitwise flags which determine which things occur upon executing the Interrupt Routine. The bits are as follows: b23675 DEFB 0 23676 DEFB 0,0,0,0,0,0,0,0 23684 DEFB 0,0,0,0,0,0,0,0 23692 DEFB 0,0,0,0,0,0 ; Available In-Game Menu Command Flags ; ; Flags that determine which additional entries are available in Main In-Game Menu b23698 DEFB 0 23699 DEFB 0 ; USS Pisces' Current Location b23700 DEFB 0 ; Magic Knight's current room b23701 DEFB 0 23702 DEFB 0 ; Store for Display File Address to Print Text to in Command Summary Window b23703 DEFW 0 ; Player Attribute Update Flag ; ; #TABLE(default,centre,:w) ; { =h Value | =h Effect } ; { 0 | Player Attribute Ignore Mode } ; { Any other value | Player Attribute Update Mode } ; TABLE# b23705 DEFB 0 23706 DEFB 0,0,0,0,0,0,0,0 23714 DEFB 0,0,0,0,0,0,0,0 23722 DEFB 0,0,0,0,0,0 ; Cheat Mode Enabled Flag ; ; See trivia b23728 DEFB 0 ; Cheat Mode Enabled Flag / NMIADD (LSB) 23729 DEFB 0,0,0,0,0 ; System Data / BASIC Program b23734 DEFB 0,0,0,0,0,0,0,0 23742 DEFB 0,0,0,0,0,0,0,0 23750 DEFB 0,0,0,0,0,0,10,22 23758 DEFB 0,253,50,54,50,48,48,14 23766 DEFB 0,0,88,102,0,58,231,48 23774 DEFB 14,0,0,0,0,0,13,0 23782 DEFB 20,8,0,239,34,75,84,36 23790 DEFB 34,170,13,0,30,41,0,218 23798 DEFB 48,14,0,0,0,0,0,58 23806 DEFB 217,48,14,0,0,0,0 ; Table of Bitmap Data for Magic Knight at his Current Location ; ; Used by the routines at #R52937, #R53019 and #R53073 b23813 DEFB 0,58,245,172,54,14,0,0 23821 DEFB 6,0,0,44,49,14,0,0 23829 DEFB 1,0,0,58,239,34,34,175 23837 DEFB 13,0,40,14,0,249,192,50 23845 DEFB 54,54,50,52,14,0,0,0 23853 DEFB 104,0,13,0,0,0,0,0 23861 DEFB 0,0,0,0,0,0,0,0 23869 DEFB 0,0,0,0,0,0,0,0 23877 DEFB 0,0,0,0,0,0,0,0 23885 DEFB 0,0,0,0,0,0,0,0 23893 DEFB 0,0,0,0,0,0,0,0 23901 DEFB 0,0,0,0,0,0,0,0 ; Table of Background Bitmap Data ; ; Used by the routines at #R52937 and #R53115 b23909 DEFB 0,0,0,0,0,0,0,0 23917 DEFB 0,0,0,0,0,0,0,0 23925 DEFB 0,0,0,0,0,0,0,0 23933 DEFB 0,0,0,0,0,0,0,0 23941 DEFB 0,0,0,0,0,0,0,0 23949 DEFB 0,0,0,0,0,0,0,0 23957 DEFB 0,0,0,0,0,0,0,0 23965 DEFB 0,0,0,0,0,0,0,0 23973 DEFB 0,0,0,0,0,0,0,0 23981 DEFB 0,0,0,0,0,0,0,0 23989 DEFB 0,0,0,0,0,0,0,0 23997 DEFB 0,0,0,0,0,0,0,0 ; Temporary Text Buffer ; ; Used by the routines at #R34762 and #R36602 b24005 DEFB 0,0,0,0,0,0,0,0 24013 DEFB 0,0,0,0,0,0,0,0 24021 DEFB 0,0,0,0,0,0,0,0 24029 DEFB 0,0,0,0,0,0,0,0 ; Table of Background Attribute Data ; ; Attribute values for region behind Magic Knight, stored here so that they can be restored when Magic Knight moves ; on in Player Attribute Update mode. b24037 DEFB 0,0,0 24040 DEFB 0,0,0 24043 DEFB 0,0,0 24046 DEFB 0,0,0 ; Unused b24049 DEFB 0,0,0,0,0,0,0,0 24057 DEFB 0,0,0,0,0,0,0 ; Terrain Interaction Data Table ; ; Table comprised of 32 x 24 entries, each one corresponding to a character block in Magic Knight's current room. ; Each entry is a set of bitwise flags with the following effects: b24064 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24096 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24128 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24160 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24192 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24224 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24256 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24288 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24320 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24352 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24384 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24416 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24448 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24480 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24512 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24544 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24576 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24608 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24640 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24672 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24704 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24736 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24768 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24800 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Movement Data Table for Starfield Routine ; ; Twenty groups of nine bytes, one group per star. The values are: b24832 DEFB 0,0,0,0,0,0,0,0,0 24841 DEFB 0,0,0,0,0,0,0,0,0 24850 DEFB 0,0,0,0,0,0,0,0,0 24859 DEFB 0,0,0,0,0,0,0,0,0 24868 DEFB 0,0,0,0,0,0,0,0,0 24877 DEFB 0,0,0,0,0,0,0,0,0 24886 DEFB 0,0,0,0,0,0,0,0,0 24895 DEFB 0,0,0,0,0,0,0,0,0 24904 DEFB 0,0,0,0,0,0,0,0,0 24913 DEFB 0,0,0,0,0,0,0,0,0 24922 DEFB 0,0,0,0,0,0,0,0,0 24931 DEFB 0,0,0,0,0,0,0,0,0 24940 DEFB 0,0,0,0,0,0,0,0,0 24949 DEFB 0,0,0,0,0,0,0,0,0 24958 DEFB 0,0,0,0,0,0,0,0,0 24967 DEFB 0,0,0,0,0,0,0,0,0 24976 DEFB 0,0,0,0,0,0,0,0,0 24985 DEFB 0,0,0,0,0,0,0,0,0 24994 DEFB 0,0,0,0,0,0,0,0,0 25003 DEFB 0,0,0,0,0,0,0,0,0 ; USS Pisces' Current Stats ; ; See also USS Pisces' Initial Stats at #R37329. b25012 DEFB 0 ; Life Support (%) 25013 DEFB 0 ; Star Drive Fuel 25014 DEFB 0 ; Impulse Drive (%) 25015 DEFB 0 ; Shields (%) 25016 DEFB 0 ; Transputer (%) 25017 DEFB 0 ; Unused 25018 DEFB 0 ; Unused 25019 DEFB 0 ; Unused ; Characters' Current Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are capped at 100: b25020 DEFB 0,0,0,0,0,0,0,0 ; Magic Knight 25028 DEFB 0,0,0,0,0,0,0,0 ; Gordon 25036 DEFB 0,0,0,0,0,0,0,0 ; Sarab 25044 DEFB 0,0,0,0,0,0,0,0 ; Klink 25052 DEFB 0,0,0,0,0,0,0,0 ; S3 E3 25060 DEFB 0,0,0,0,0,0,0,0 ; Hooper 25068 DEFB 0,0,0,0,0,0,0,0 ; Murphy 25076 DEFB 0,0,0,0,0,0,0,0 ; Sharon 25084 DEFB 0,0,0,0,0,0,0,0 ; Forbin 25092 DEFB 0,0,0,0,0,0,0,0 ; Derby IV 25100 DEFB 0,0,0,0,0,0,0,0 ; Swiftfoot 25108 DEFB 0,0,0,0,0,0,0,0 ; Julie 8 25116 DEFB 0,0,0,0,0,0,0,0 ; Hectorr ; Unused b25124 DEFB 0,0,0,0,0,0,0,0 25132 DEFB 0,0,0,0,0,0,0,0 25140 DEFB 0,0,0,0,0,0,0,0 25148 DEFB 0,0,0,0,0,0,0,0 ; Magic Knight's Current Data ; ; See also #R36797 for Magic Knight's Initial Data b25156 DEFB 0 ; x-coordinate (pixels) 25157 DEFB 0 ; y-coordinate (pixels) 25158 DEFB 0 ; Unused (set to zero by instruction at #R31522) 25159 DEFB 0 ; Index of current frame 25160 DEFB 0 ; x-velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 25161 DEFB 0 ; y-velocity (pixels) [jumping] 25162 DEFB 0 ; Attribute 25163 DEFB 0 ; Unused ; Characters' Current Inventories ; ; See also #R36805 for Characters' Initial Inventories b25164 DEFB 0,0,0,0,0 ; Magic Knight (carrying) 25169 DEFB 0,0,0,0,0 ; Magic Knight (wearing) 25174 DEFB 0,0,0,0,0 ; Gordon 25179 DEFB 0,0,0,0,0 ; Sarab 25184 DEFB 0,0,0,0,0 ; Klink 25189 DEFB 0,0,0,0,0 ; S3 E3 25194 DEFB 0,0,0,0,0 ; Hooper 25199 DEFB 0,0,0,0,0 ; Murphy 25204 DEFB 0,0,0,0,0 ; Sharon 25209 DEFB 0,0,0,0,0 ; Forbin 25214 DEFB 0,0,0,0,0 ; Derby IV 25219 DEFB 0,0,0,0,0 ; Swiftfoot 25224 DEFB 0,0,0,0,0 ; Julie 8 25229 DEFB 0,0,0,0,0 ; Hectorr ; Unused ; ; (See trivia) b25234 DEFB 0,0,0,0,0 25239 DEFB 0,0,0,0,0 ; Characters' Current Positions ; ; Twelve groups of three bytes, one group per character (excluding Magic Knight). The values are: b25244 DEFB 0,0,0 ; Gordon 25247 DEFB 0,0,0 ; Sarab 25250 DEFB 0,0,0 ; Klink 25253 DEFB 0,0,0 ; S3 E3 25256 DEFB 0,0,0 ; Hooper 25259 DEFB 0,0,0 ; Murphy 25262 DEFB 0,0,0 ; Sharon 25265 DEFB 0,0,0 ; Forbin 25268 DEFB 0,0,0 ; Derby IV 25271 DEFB 0,0,0 ; Swiftfoot 25274 DEFB 0,0,0 ; Julie 8 25277 DEFB 0,0,0 ; Hectorr ; Unused ; ; (See trivia) b25280 DEFB 0,0,0,0,0,0 ; Objects' Current Positions ; ; Thirty-seven groups of three bytes, one group per object. The values are: b25286 DEFB 0,0,0 ; (00) - Nothing at all 25289 DEFB 0,0,0 ; (01) - Cloak of Invisibility 25292 DEFB 0,0,0 ; (02) - Blank I.D. Card 25295 DEFB 0,0,0 ; (03) - Valid I.D. Card 25298 DEFB 0,0,0 ; (04) - Instant Film 25301 DEFB 0,0,0 ; (05) - Photograph (of Magic Knight) 25304 DEFB 0,0,0 ; (06) - Star Map 25307 DEFB 0,0,0 ; (07) - Gadget X 25310 DEFB 0,0,0 ; (08) - Camera 25313 DEFB 0,0,0 ; (09) - Photograph (of inside of starship) 25316 DEFB 0,0,0 ; (10) - Pot of Glue 25319 DEFB 0,0,0 ; (11) - 5W Resistor 25322 DEFB 0,0,0 ; (12) - Magic Talisman 25325 DEFB 0,0,0 ; (13) - Golden Sundial of Alpha 25328 DEFB 0,0,0 ; (14) - McTablet Food 25331 DEFB 0,0,0 ; (15) - Broken Glass 25334 DEFB 0,0,0 ; (16) - Quark Bomb 25337 DEFB 0,0,0 ; (17) - Advert 25340 DEFB 0,0,0 ; (18) - Part of a Sundial (1) 25343 DEFB 0,0,0 ; (19) - Part of a Sundial (2) 25346 DEFB 0,0,0 ; (20) - Part of a Sundial (3) 25349 DEFB 0,0,0 ; (21) - Brass Ankh 25352 DEFB 0,0,0 ; (22) - Pair of Boots 25355 DEFB 0,0,0 ; (23) - Chocolate Heart 25358 DEFB 0,0,0 ; (24) - Starfleet Manual 25361 DEFB 0,0,0 ; (25) - Ancient Scroll 25364 DEFB 0,0,0 ; (26) - Tower Fish 25367 DEFB 0,0,0 ; (27) - Gas Mask 25370 DEFB 0,0,0 ; (28) - Shield 25373 DEFB 0,0,0 ; (29) - Bag of Runes 25376 DEFB 0,0,0 ; (30) - Bag of Potatoes 25379 DEFB 0,0,0 ; (31) - Pewter Tankard 25382 DEFB 0,0,0 ; (32) - Axe 25385 DEFB 0,0,0 ; (33) - Wrist Terminal 25388 DEFB 0,0,0 ; (34) - Torch 25391 DEFB 0,0,0 ; (35) - Mirror 25394 DEFB 0,0,0 ; (36) - 10MW Laser ; Current Planetary Data ; ; Two bytes per location. The bytes' meanings are: b25397 DEFB 0,0 ; (00) - Unused 25399 DEFB 0,0 ; (01) - Deneb 25401 DEFB 0,0 ; (02) - Gath 25403 DEFB 0,0 ; (03) - Monopole 25405 DEFB 0,0 ; (04) - Porthos 25407 DEFB 0,0 ; (05) - Starbase 1 25409 DEFB 0,0 ; (06) - Lynx 25411 DEFB 0,0 ; (07) - Nirvana 25413 DEFB 0,0 ; (08) - Limbo 25415 DEFB 0,0 ; (09) - Eden 25417 DEFB 0,0 ; (10) - Herschell 25419 DEFB 0,0 ; (11) - Trantore 25421 DEFB 0,0 ; (12) - Plop Plop 25423 DEFB 0,0 ; (13) - Brightstar 25425 DEFB 0,0 ; (14) - Outpost 25427 DEFB 0,0 ; (15) - Polaris 25429 DEFB 0,0 ; (16) - Bingo 25431 DEFB 0,0 ; (17) - Retreat 25433 DEFB 0,0 ; (18) - Dragon Egg 25435 DEFB 0,0 ; (19) - Aridia 25437 DEFB 0,0 ; (20) - Gangrole 25439 DEFB 0,0 ; (21) - Naff 25441 DEFB 0,0 ; (22) - Reef 25443 DEFB 0,0 ; (23) - Menopausia 25445 DEFB 0,0 ; (24) - Plinkit ; Unused ; ; This block loaded with zeroes by routine at #R26997, but otherwise unused. b25447 DEFB 0,0,0,0,0,0,0,0 25455 DEFB 0,0,0,0,0,0,0,0 ; Temporary Storage Region for Bitmap Data used in Viewscreen Scrolling Effect ; ; Used by the routines at #R32065 and #R32124 b25463 DEFB 0,0,0,0,0,0,0,0 25471 DEFB 0,0,0,0,0,0,0,0 25479 DEFB 0,0,0,0,0,0,0,0 25487 DEFB 0,0,0,0,0,0,0,0 25495 DEFB 0,0,0,0,0,0,0,0 25503 DEFB 0,0,0,0,0,0,0,0 25511 DEFB 0,0,0,0,0,0,0,0 25519 DEFB 0,0,0,0,0,0,0,0 25527 DEFB 0,0,0,0,0,0,0,0 25535 DEFB 0,0,0,0,0,0,0,0 25543 DEFB 0,0,0,0,0,0,0,0 25551 DEFB 0,0,0,0,0,0,0,0 25559 DEFB 0,0,0,0,0,0,0,0 25567 DEFB 0,0,0,0,0,0,0,0 25575 DEFB 0,0,0,0,0,0,0,0 25583 DEFB 0,0,0,0,0,0,0,0 25591 DEFB 0,0,0,0,0,0,0,0 25599 DEFB 0,0,0,0,0,0,0,0 25607 DEFB 0,0,0,0,0,0,0,0 25615 DEFB 0,0,0,0,0,0,0,0 25623 DEFB 0,0,0,0,0,0,0,0 25631 DEFB 0,0,0,0,0,0,0,0 25639 DEFB 0,0,0,0,0,0,0,0 25647 DEFB 0,0,0,0,0,0,0,0 25655 DEFB 0,0,0,0,0,0,0,0 25663 DEFB 0,0,0,0,0,0,0,0 25671 DEFB 0,0,0,0,0,0,0,0 25679 DEFB 0,0,0,0,0,0,0,0 25687 DEFB 0,0,0,0,0,0,0,0 25695 DEFB 0,0,0,0,0,0,0,0 25703 DEFB 0,0,0,0,0,0,0,0 25711 DEFB 0,0,0,0,0,0,0,0 25719 DEFB 0,0,0,0,0,0,0,0 25727 DEFB 0,0,0,0,0,0,0,0 25735 DEFB 0,0,0,0,0,0,0,0 25743 DEFB 0,0,0,0,0,0,0,0 25751 DEFB 0,0,0,0,0,0,0,0 25759 DEFB 0,0,0,0,0,0,0,0 25767 DEFB 0,0,0,0,0,0,0,0 25775 DEFB 0,0,0,0,0,0,0,0 25783 DEFB 0,0,0,0,0,0,0,0 25791 DEFB 0,0,0,0,0,0,0,0 25799 DEFB 0,0,0,0,0,0,0,0 25807 DEFB 0,0,0,0,0,0,0,0 25815 DEFB 0,0,0,0,0,0,0,0 25823 DEFB 0,0,0,0,0,0,0,0 25831 DEFB 0,0,0,0,0,0,0,0 25839 DEFB 0,0,0,0,0,0,0,0 25847 DEFB 0,0,0,0,0,0,0,0 25855 DEFB 0,0,0,0,0,0,0,0 25863 DEFB 0,0,0,0,0,0,0,0 25871 DEFB 0,0,0,0,0,0,0,0 25879 DEFB 0,0,0,0,0,0,0,0 25887 DEFB 0,0,0,0,0,0,0,0 ; System Data and Stack Space b25895 DEFB 0,0,0,0,0,0,0,0 25903 DEFB 0,0,0,0,0,0,0,0 25911 DEFB 0,0,0,0,0,0,0,0 25919 DEFB 0,0,0,0,0,0,0,0 25927 DEFB 0,0,0,0,0,0,0,0 25935 DEFB 0,0,0,0,0,0,0,0 25943 DEFB 0,0,0,0,0,0,0,0 25951 DEFB 0,0,0,0,0,0,0,0 25959 DEFB 0,0,0,0,0,0,0,0 25967 DEFB 0,0,0,0,0,0,0,0 25975 DEFB 0,0,0,0,0,0,0,0 25983 DEFB 0,0,0,0,0,0,0,0 25991 DEFB 0,0,0,0,0,0,0,0 25999 DEFB 0,0,0,0,0,0,0,0 26007 DEFB 0,0,0,0,0,0,0,0 26015 DEFB 0,0,0,0,0,0,0,0 26023 DEFB 0,0,0,0,0,0,0,0 26031 DEFB 0,0,0,0,0,0,0,0 26039 DEFB 0,0,0,0,0,0,0,0 26047 DEFB 0,0,0,0,0,0,0,0 26055 DEFB 0,0,0,0,0,0,0,0 26063 DEFB 0,0,0,0,0,0,0,0 26071 DEFB 0,0,0,0,0,0,0,0 26079 DEFB 0,0,0,0,0,0,0,0 26087 DEFB 0,0,0,0,0,0,0,0 26095 DEFB 0,0,0,0,0,0,0,0 26103 DEFB 0,0,0,0,0,0,0,0 26111 DEFB 0,0,0,0,0,0,0,0 26119 DEFB 0,0,0,0,0,0,0,0 26127 DEFB 0,0,0,0,0,0,0,0 26135 DEFB 0,0,0,0,0,0,0,0 26143 DEFB 0,0,0,0,0,0,0,0 26151 DEFB 0,0,0,0,0,0,0,0 26159 DEFB 0,0,0,0,0,0,0,0 26167 DEFB 0,0,0,0,0,0,0,0 26175 DEFB 0,0,0,0,0,0,0,0 26183 DEFB 0,0,0,0,0,0,0,0 26191 DEFB 0,0,0,0,0,0,0,0 26199 DEFB 0,0,0,0,0,0,0,0 26207 DEFB 0,0,0,0,0,0,0,0 26215 DEFB 0,0,0,0,0,0,0,0 26223 DEFB 0,0,0,0,0,0,0,0 26231 DEFB 0,0,0,0,0,0,0,0 26239 DEFB 0 ; Table of Display File Addresses of Start of Each Pixel Row ; ; Addresses are in sequence, from top to bottom of display b26240 DEFW 16384 26242 DEFW 16640 26244 DEFW 16896 26246 DEFW 17152 26248 DEFW 17408 26250 DEFW 17664 26252 DEFW 17920 26254 DEFW 18176 26256 DEFW 16416 26258 DEFW 16672 26260 DEFW 16928 26262 DEFW 17184 26264 DEFW 17440 26266 DEFW 17696 26268 DEFW 17952 26270 DEFW 18208 26272 DEFW 16448 26274 DEFW 16704 26276 DEFW 16960 26278 DEFW 17216 26280 DEFW 17472 26282 DEFW 17728 26284 DEFW 17984 26286 DEFW 18240 26288 DEFW 16480 26290 DEFW 16736 26292 DEFW 16992 26294 DEFW 17248 26296 DEFW 17504 26298 DEFW 17760 26300 DEFW 18016 26302 DEFW 18272 26304 DEFW 16512 26306 DEFW 16768 26308 DEFW 17024 26310 DEFW 17280 26312 DEFW 17536 26314 DEFW 17792 26316 DEFW 18048 26318 DEFW 18304 26320 DEFW 16544 26322 DEFW 16800 26324 DEFW 17056 26326 DEFW 17312 26328 DEFW 17568 26330 DEFW 17824 26332 DEFW 18080 26334 DEFW 18336 26336 DEFW 16576 26338 DEFW 16832 26340 DEFW 17088 26342 DEFW 17344 26344 DEFW 17600 26346 DEFW 17856 26348 DEFW 18112 26350 DEFW 18368 26352 DEFW 16608 26354 DEFW 16864 26356 DEFW 17120 26358 DEFW 17376 26360 DEFW 17632 26362 DEFW 17888 26364 DEFW 18144 26366 DEFW 18400 26368 DEFW 18432 26370 DEFW 18688 26372 DEFW 18944 26374 DEFW 19200 26376 DEFW 19456 26378 DEFW 19712 26380 DEFW 19968 26382 DEFW 20224 26384 DEFW 18464 26386 DEFW 18720 26388 DEFW 18976 26390 DEFW 19232 26392 DEFW 19488 26394 DEFW 19744 26396 DEFW 20000 26398 DEFW 20256 26400 DEFW 18496 26402 DEFW 18752 26404 DEFW 19008 26406 DEFW 19264 26408 DEFW 19520 26410 DEFW 19776 26412 DEFW 20032 26414 DEFW 20288 26416 DEFW 18528 26418 DEFW 18784 26420 DEFW 19040 26422 DEFW 19296 26424 DEFW 19552 26426 DEFW 19808 26428 DEFW 20064 26430 DEFW 20320 26432 DEFW 18560 26434 DEFW 18816 26436 DEFW 19072 26438 DEFW 19328 26440 DEFW 19584 26442 DEFW 19840 26444 DEFW 20096 26446 DEFW 20352 26448 DEFW 18592 26450 DEFW 18848 26452 DEFW 19104 26454 DEFW 19360 26456 DEFW 19616 26458 DEFW 19872 26460 DEFW 20128 26462 DEFW 20384 26464 DEFW 18624 26466 DEFW 18880 26468 DEFW 19136 26470 DEFW 19392 26472 DEFW 19648 26474 DEFW 19904 26476 DEFW 20160 26478 DEFW 20416 26480 DEFW 18656 26482 DEFW 18912 26484 DEFW 19168 26486 DEFW 19424 26488 DEFW 19680 26490 DEFW 19936 26492 DEFW 20192 26494 DEFW 20448 26496 DEFW 20480 26498 DEFW 20736 26500 DEFW 20992 26502 DEFW 21248 26504 DEFW 21504 26506 DEFW 21760 26508 DEFW 22016 26510 DEFW 22272 26512 DEFW 20512 26514 DEFW 20768 26516 DEFW 21024 26518 DEFW 21280 26520 DEFW 21536 26522 DEFW 21792 26524 DEFW 22048 26526 DEFW 22304 26528 DEFW 20544 26530 DEFW 20800 26532 DEFW 21056 26534 DEFW 21312 26536 DEFW 21568 26538 DEFW 21824 26540 DEFW 22080 26542 DEFW 22336 26544 DEFW 20576 26546 DEFW 20832 26548 DEFW 21088 26550 DEFW 21344 26552 DEFW 21600 26554 DEFW 21856 26556 DEFW 22112 26558 DEFW 22368 26560 DEFW 20608 26562 DEFW 20864 26564 DEFW 21120 26566 DEFW 21376 26568 DEFW 21632 26570 DEFW 21888 26572 DEFW 22144 26574 DEFW 22400 26576 DEFW 20640 26578 DEFW 20896 26580 DEFW 21152 26582 DEFW 21408 26584 DEFW 21664 26586 DEFW 21920 26588 DEFW 22176 26590 DEFW 22432 26592 DEFW 20672 26594 DEFW 20928 26596 DEFW 21184 26598 DEFW 21440 26600 DEFW 21696 26602 DEFW 21952 26604 DEFW 22208 26606 DEFW 22464 26608 DEFW 20704 26610 DEFW 20960 26612 DEFW 21216 26614 DEFW 21472 26616 DEFW 21728 26618 DEFW 21984 26620 DEFW 22240 26622 DEFW 22496 ; Initialise Interrupt Code then Display and Handle Input Device Selection Menu c26624 LD (IY+87),3 ; Set P-FLAG bits 0 and 1 (OVER 1) (IY = 23610) 26628 LD HL,(55968) ; Load HL with address of graphic data for Advert's mask... 26631 LD (56082),HL ; ...and store at 56082 (graphic data for graphic 33) 26634 LD HL,55918 ; Load HL with address of Unknown Mask Data... 26637 LD (56084),HL ; ...and store at 56084 (mask data for graphic 33) 26640 LD A,(23728) ; If Cheat Mode Enabled Flag is reset (see trivia)... 26643 OR A ; ... 26644 JR Z,26650 ; ...then skip ahead to #R26650 26646 XOR A ; Set initial room of Valid I.D. Card to USS Pisces, 0, "The Recreation Room" (00)... 26647 LD (36920),A ; ... *26650 LD A,24 ; Put JR instruction at 65535 for jumping to interrupt routine... 26652 LD (65535),A ; ... 26655 LD A,195 ; Load first byte of interrupt routine with 195... 26657 LD (65524),A ; ...representing "JP" 26660 LD HL,53479 ; Load following two bytes of interrupt routine with 53479... 26663 LD (65525),HL ; ...to make "JP 53479" 26666 LD A,57 ; Load I register with 57 (for interrupt routine)... 26668 LD I,A ; ... ; Display input device selection menu ; ; Used by the routine at #R55685. c26670 EI ; Enable Interrupts 26671 HALT ; Wait for interrupt 26672 LD SP,26240 ; Set Stack Pointer to 26240 26675 XOR A ; Reset all Interrupt Routine flags... 26676 LD (IY+65),A ; ... (IY = 23610) 26679 IM 2 ; Set Interrupt Mode 2 26681 CALL 26976 ; Set border to black and clear temporary storage area of memory *26684 CALL 26884 ; Draw Input Device Selection Menu and update currently selected input device *26687 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 26690 CP 4 ; If "CHANGE GAME OPTIONS" selected... 26692 JP Z,26739 ; ...then skip ahead to #R26739 26695 CP 5 ; If "INSTRUCTIONS" selected... 26697 JR Z,26734 ; ...then skip ahead to #R26734 26699 CP 6 ; If "PLAY GAME" selected... 26701 JP Z,26997 ; ...then jump to #R26997 (initialise data and start a new game) 26704 PUSH AF ; Store AF (A = index of selected menu item) 26705 LD A,(54560) ; Load A with index of currently selected input device (see trivia) 26708 PUSH AF ; Store AF (A = index of currently selected input device) 26709 LD C,A ; Load C with index of currently selected input device 26710 LD A,(37139) ; Load A with y-coordinate of top edge of Window 6 (Control Selection Window) 26713 ADD A,C ; Add index of currently selected input device... 26714 ADD A,2 ; ...and add two more to get y-coordinate of menu item for currently selected input device 26716 LD B,A ; Load value into B 26717 LD C,3 ; Load C with 3 26719 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) 26722 LD (HL),71 ; Set attribute at this location to 71 (white INK, black PAPER, BRIGHT) (see trivia) 26724 POP DE ; Restore DE (D = index of currently selected input device, previously in AF) 26725 POP AF ; Store AF (A = index of selected menu item) 26726 LD (54560),A ; Set new selected input device index at #R54560 26729 CALL 54505 ; Update currently selected input device... 26732 JR 26687 ; ...and loop back to #R26687 *26734 CALL 26926 ; Display Instructions windows 26737 JR 26684 ; Jump back to #R26684 to capture next menu selection *26739 CALL 26745 ; Display and handle Gadget X Menu 26742 JP 26684 ; Jump back to #R26684 to capture next menu selection ; Display and Handle Gadget X Menu ; ; Used by the routines at #R26670 and #R30968. c26745 LD A,7 ; Load A with index of "REDEFINE THE GAME" Window 26747 LD HL,38063 ; Point HL at Gadget X menu text 26750 PUSH HL ; Store HL (pointer to Gadget X menu text) 26751 CALL 34982 ; Draw "REDEFINE THE GAME" Menu Window 26754 POP HL ; Restore HL (pointer to Gadget X menu text) 26755 CALL 34762 ; Print text 26758 CALL 35690 ; Play upward scale sound 26761 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 26764 OR A ; If REDEFINE KEYBOARD selected... 26765 JP Z,26816 ; ...then skip ahead to #R26816 26768 CP 1 ; If PLAYER ATTRIBUTE IGNORE selected... 26770 JR Z,26807 ; ...then skip ahead to #R26807 26772 CP 2 ; If PLAYER ATTRIBUTE UPDATE selected... 26774 JR Z,26812 ; ...then skip ahead to #R26812 26776 BIT 0,(IY+65) ; If Game In Progress Flag is reset... (IY = 23610) 26780 JR Z,26790 ; ...then skip ahead to #R26790 26782 CP 3 ; If SAVE THE GAME selected... 26784 JR Z,26833 ; ...then skip ahead to #R26833 26786 CP 4 ; If LOAD AN OLD GAME selected... 26788 JR Z,26840 ; ...then skip ahead to #R26840 *26790 LD A,5 ; Draw Window 5... 26792 CALL 34990 ; ... 26795 LD HL,38180 ; Point HL at "SAVE & LOAD ARE NOT ALLOWED HERE..." text... 26798 CALL 34762 ; ...and print to screen 26801 CALL 35690 ; Play upward scale sound 26804 JP 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed and return *26807 XOR A ; Reset Player Attribute Update Flag (Player Attribute Ignore mode)... *26808 LD (23705),A ; ... 26811 RET ; Return *26812 LD A,1 ; Set Player Attribute Update Flag (Player Attribute Update mode)... 26814 JR 26808 ; ...and return *26816 CALL 35690 ; Play upward scale sound 26819 LD A,8 ; Draw Window 8... 26821 CALL 34990 ; ... 26824 LD HL,38136 ; Point HL at "Redefine Keys Window" text... 26827 CALL 34762 ; ...and print to screen 26830 JP 54647 ; Redefine keyboard controls *26833 CALL 26855 ; Clear Stack and Prepare to Save Data 26836 CALL 1218 ; Jump to ROM routine to save game data 26839 RET ; Return (to start of Main Game Loop - see PUSH at #R26862) *26840 CALL 26855 ; Clear Stack and Prepare to Load Data 26843 SCF ; Set Carry Flag as we are LOADing, not VERIFYing 26844 LD SP,22528 ; Set Stack Pointer to 22528 26847 CALL 1366 ; Jump to ROM routine to load game data 26850 LD SP,(23613) ; Restore Stack Pointer from 23613 (set to 26240 in routine at #R26855) 26854 RET ; Return (to start of Main Game Loop - see PUSH at #R26862) ; Clear Stack and Prepare to Load Data ; ; Used by the routine at #R26745. c26855 POP DE ; Remove return address of calling routine from top of Stack 26856 LD SP,26240 ; Set Stack Pointer to 26240 26859 LD HL,27136 ; Load HL with start address of Main Game Loop routine 26862 PUSH HL ; Store HL (address of Main Game Loop) 26863 LD (23613),SP ; Store Stack Pointer address at 23613 (System Variable ERR SP) 26867 PUSH DE ; Store HL (return address in routine that called this routine) 26868 CALL 35690 ; Play upward scale sound 26871 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 26874 LD IX,23296 ; Set base address for load to 23296 26878 LD DE,23808 ; Set data length to 23808 26881 LD A,255 ; Load A with 255 to denote a data block 26883 RET ; Return ; Draw Input Device Selection Menu and Update Currently Selected Input Device ; ; Used by the routine at #R26670. c26884 CALL 35649 ; Clear Display File 26887 LD A,70 ; Load system variable ATTR T with 70 (yellow INK, black PAPER, BRIGHT)... 26889 LD (23695),A ; ... 26892 CALL 35674 ; ...and flood Attribute File with this attribute 26895 LD A,5 ; Draw Window 5 ("KNIGHT-TYME A NEW GRAPHIC ADVENTURE...")... 26897 CALL 34990 ; ... 26900 LD HL,38238 ; Point HL at "KNIGHT-TYME A NEW GRAPHIC ADVENTURE..." text... 26903 CALL 34762 ; ...and print to screen 26906 LD A,6 ; Draw Control Selection Menu Window... 26908 CALL 34982 ; ... 26911 LD HL,37737 ; Point HL at Initial Control Selection Menu text... 26914 CALL 34762 ; ...and print to screen 26917 CALL 35723 ; Play downward scale sound 26920 LD A,(54560) ; Load index of currently selected input device into A 26923 JP 54505 ; Update currently selected input device and return ; Display Instructions Windows ; ; Used by the routines at #R26670 and #R30968. c26926 LD A,7 ; Load A with 7 (index of window to draw) 26928 LD HL,37795 ; Point HL at Instructions Text 26931 CALL 26962 ; Print text at HL in Window 07 26934 LD A,8 ; Draw Window 8... 26936 CALL 34990 ; ... 26939 LD HL,37951 ; Point HL at "THE KEYS ARE :-..." text... 26942 CALL 34762 ; ...and print to screen 26945 CALL 54598 ; Print current control keys to screen 26948 CALL 35690 ; Play upward scale sound 26951 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 26954 LD A,9 ; Prepare to draw Window 9 26956 LD HL,37967 ; Point HL at Cast of Characters text 26959 JP 26962 ; Skip ahead to #R26962 (see trivia) *26962 PUSH HL ; Store HL (pointer to text to print) 26963 CALL 34990 ; Draw current Instructions Window 26966 POP HL ; Restore HL (pointer to text to print) 26967 CALL 34762 ; Print text 26970 CALL 35690 ; Play upward scale sound 26973 JP 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed and return ; Set Border to Black and Clear Temporary Storage Area of Memory ; ; Used by the routine at #R26670. c26976 LD A,7 ; Set System Variable BORDCR to 7 (black BORDER, white INK, black PAPER)... 26978 LD (23624),A ; ... 26981 XOR A ; Set border to black and reset EAR and MIC bits... 26982 OUT (254),A ; ... 26984 LD HL,23296 ; Load memory addresses from #R23296 to 23551 with zeroes... 26987 LD DE,23297 ; ... 26990 LD BC,255 ; ... 26993 LD (HL),A ; ... 26994 LDIR ; ... 26996 RET ; Return ; Initialise Data and Start a New Game ; ; Used by the routine at #R26670. c26997 LD A,28 ; Set Current Starship Location in " LOCATION : [name of Current Starship Location]" text at ; #R38298... 26999 LD (38307),A ; ...to the name of the Current Starship Location (28) 27002 CALL 35690 ; Play upward scale sound 27005 LD A,70 ; Set ATTR T system variable to 70 (yellow INK, black PAPER, BRIGHT)... 27007 LD (23695),A ; ... 27010 LD HL,37329 ; Copy data from #R37329 - 37472 (USS Pisces' Initial Stats, Characters' Initial Stats, Table ; of Object Properties for first four objects)... 27013 LD DE,25012 ; ...to #R25012 - 25155 (USS Pisces' Current Stats, Characters' Current Stats, Unused Data ; Block)... 27016 LD BC,144 ; ... 27019 LDIR ; ... 27021 LD HL,36797 ; Copy data from #R36797 - 36804 (Magic Knight's Initial Data)... 27024 LD BC,8 ; ...to #R25156 - 25163 (Magic Knight's Current Data)... 27027 LDIR ; ... 27029 LD HL,36805 ; Copy data from #R36805 - 36884 (Characters' Initial Inventories and part of Characters' ; Initial Positions)... (see trivia) 27032 LD BC,80 ; ...to #R25164 - 25243 (Characters' Current Inventories and Unused Data Block)... 27035 LDIR ; ... 27037 LD HL,36875 ; Copy data from #R36875 - 36916 (Characters' Initial Positions and first two entries in ; Objects' Initial Positions)... (see trivia) 27040 LD BC,42 ; ...to #R25244 - 25285 (Characters' Current Positions and Unused Data Block)... 27043 LDIR ; ... 27045 LD HL,36911 ; Copy data from #R36911 - 37021 (Objects' Initial Positions)... 27048 LD BC,111 ; ...to #R25286 - 25396 (Objects' Current Positions)... 27051 LDIR ; ... 27053 LD HL,53361 ; Copy data from #R53361 - 53410 (Initial Planetary Data)... 27056 LD BC,50 ; ...to #R25397 - 25446 (Current Planetary Data)... 27059 LDIR ; ... 27061 LD H,D ; Load HL with value in DE (25447)... 27062 LD L,E ; ... 27063 INC DE ; Advance DE by one byte 27064 LD BC,15 ; Load memory locations at #R25447 - 25462 with zeroes... 27067 LD (HL),0 ; ... 27069 LDIR ; ... 27071 CALL 34265 ; Set Magic Knight's available action flags and validate I.D. Card if appropriate 27074 XOR A ; Load A and HL with zero... 27075 LD H,A ; ... 27076 LD L,A ; ... 27077 LD (23675),HL ; Interrupt Routine Flags 27080 LD (23672),A ; Set system variable FRAMES to zero... 27083 LD (23673),HL ; ... 27086 INC A ; Set Unknown / Unused Flag 2 to 1... 27087 LD (23480),A ; ... 27090 LD A,30 ; Set number of days left to 30... 27092 LD (23457),A ; ... 27095 LD A,13 ; Set USS Pisces' location to Brightstar (13)... 27097 LD (23700),A ; ... 27100 ADD A,A ; Load BC with 26 (A x 2)... 27101 LD C,A ; ... 27102 LD B,0 ; ... 27104 LD HL,25398 ; Point HL at first attribute entry in Table of Current Planetary Data... 27107 ADD HL,BC ; ...and add BC as offset to point to data for Brightstar 27108 LD A,(HL) ; Load A with attribute of Brightstar planet... 27109 LD (52196),A ; ...and set colour of planet on viewscreen accordingly 27112 LD HL,1286 ; Set right exit from USS Pisces, 5 (The Airlock) to USS Pisces, 6 (The Life Boat)... 27115 LD (37033),HL ; ...and left exit from USS Pisces, 6 (The Life Boat) to USS Pisces, 5 (The Airlock) 27118 LD HL,50850 ; Set Room Layout Data Pointer address for Retreat, 2 to address of "With Barrier" version of ; Room 09 (#R50956)... 27121 LD (50161),HL ; ... 27124 LD A,2 ; Move Magic Knight into USS Pisces, 2 (The Transporter Room), draw room and initialise ; room-specific data... 27126 CALL 27762 ; ... 27129 SET 0,(IY+65) ; Set Game In Progress Flag (IY = 23610) 27133 JP 27139 ; Jump into Main Game Loop (process keyboard input and move Magic Knight or enter menus) ; Main Game Loop - Process Keyboard Input and Move Magic Knight or Enter Menus ; ; Used by the routines at #R29330 and #R55887. c27136 CALL 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data ; This entry point is used by the routine at #R26997. *27139 CALL 28457 ; Set Magic Knight's velocity to zero, if appropriate move to new room, execute room-specific ; routine 27142 CALL 27357 ; Handle Magic Knight's fall 27145 LD A,127 ; Reset Bit 7 in A to select the keyboard half-row SPACE - B 27147 IN A,(254) ; Read the keyboard 27149 RRA ; Reset Carry Flag if SPACE pressed, else set it 27150 JR C,27163 ; SPACE was not pressed, so skip ahead to #R27163 27152 LD A,254 ; Reset bit 0 in A to select the keyboard half-row SHIFT - V 27154 IN A,(254) ; Read the keyboard 27156 RRA ; Reset Carry Flag if SHIFT pressed, else set it 27157 LD HL,44552 ; Point HL at "BREAK KEY PRESSED" text 27160 JP NC,55685 ; If SHIFT was pressed (i.e. SHIFT-SPACE, or BREAK) jump to "Game over" window routine and ; return to Control Selection Menu *27163 CALL 27508 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27166 CALL 54942 ; Capture keyboard or joystick input loading result into A 27169 BIT 0,A ; If "left" pressed then... 27171 JR NZ,27198 ; Skip ahead to "move left" subroutine 27173 BIT 1,A ; If "right" pressed then... 27175 JR NZ,27236 ; Skip ahead to "move right" subroutine 27177 BIT 2,A ; If "up" pressed then... 27179 JP NZ,27252 ; Skip ahead to "jump" subroutine 27182 BIT 3,A ; If "down" pressed then... 27184 CALL NZ,55768 ; ...select Magic Knight's Room and USS Pisces' Current Location if Cheat / Debug Mode is ; enabled 27187 BIT 4,A ; If "fire" pressed then... 27189 JP NZ,30001 ; ...display and handle main in-game menu 27192 CALL 53115 ; Erase Magic Knight from display, advance his current position then redraw 27195 JP 27139 ; Loop back for next key / control press ; Left Pressed *27198 LD HL,23474 ; If "Magic Knight Can't Move Left" flag is set... 27201 BIT 0,(HL) ; ... 27203 JR NZ,27139 ; ...then loop back to start of keyboard check routine 27205 EX AF,AF' ; Switch AF and AF' 27206 LD A,1 ; Set Magic Knight Facing Left Flag... 27208 LD (23425),A ; ... 27211 LD A,254 ; Set Magic Knight's x-velocity to minus 2... *27213 LD (25160),A ; ... 27216 LD (27283),A ; Prepare to set Magic Knight's x-velocity to minus 2 27219 EX AF,AF' ; Switch AF and AF' (A now holds pressed controls bitmap) 27220 BIT 2,A ; If "up" was also pressed... 27222 JR NZ,27256 ; ...then skip ahead to #R27256 (jumping subroutine) 27224 XOR A ; Set Magic Knight's current y-velocity to zero... 27225 LD (25161),A ; ... 27228 CALL 53115 ; Erase Magic Knight from display, advance his current position then redraw 27231 CALL 27357 ; Handle Magic Knight's fall 27234 JR 27139 ; Loop back for next key / control press ; Right Pressed *27236 LD HL,23474 ; If "Magic Knight Can't Move Right" flag is set... 27239 BIT 1,(HL) ; ... 27241 JR NZ,27139 ; ...then loop back to start of keyboard check routine 27243 EX AF,AF' ; Switch AF and AF' 27244 XOR A ; Reset Magic Knight Facing Left Flag... 27245 LD (23425),A ; ... 27248 LD A,2 ; Jump to #R27213, setting Magic Knight's x-velocity to 2... 27250 JR 27213 ; ... ; Up Pressed *27252 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 27253 LD (27283),A ; ... *27256 LD HL,37074 ; Point HL at start of Magic Knight's y-velocities sequence table *27259 LD (37072),HL ; Store current position in Magic Knight's y-velocities sequence table at 37072 27262 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 27265 CP 8 ; If y-coordinate is less than 8... 27267 JP C,27336 ; ...then jump to #R27336 (exit loop as Magic Knight can't get any higher!) 27270 LD HL,(37072) ; Load HL with current position in Magic Knight's y-velocities sequence table 27273 LD A,(HL) ; Load the current y-velocity in the sequence into A 27274 NEG ; Negate (as Magic Knight is jumping upwards) 27276 OR A ; If A is zero... 27277 JR Z,27336 ; ...jump to #R27336 (exit loop as we have reached the end of the sequence) 27279 LD (25161),A ; Load A into Magic Knight's y-velocity ; The operand of the instruction at #R27282 represents the x-velocity value stored previously. This is modified by ; the instruction at #R27253. 27282 LD A,0 ; Set Magic Knight's x-velocity... 27284 LD (25160),A ; ... 27287 CALL 27508 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27290 LD A,(25160) ; Load Magic Knight's x-velocity into B... 27293 LD B,A ; ... 27294 LD A,(23474) ; Load Magic Knight movement flags into A 27297 XOR B ; Check: 27298 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 27300 JP Z,27342 ; ...then jump ahead to #R27342 27303 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 27305 JP Z,27342 ; ...then jump ahead to #R27342 27308 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 27310 JP Z,27342 ; ...then jump ahead to #R27342 27313 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 27314 JP Z,27342 ; ...then jump ahead to #R27342 *27317 CALL 27647 ; Kill Magic Knight's jump if he cannot vertically pass through a block above him 27320 PUSH AF ; Store AF (A = "MK's jump was impeded" flag) 27321 CALL 53115 ; Erase Magic Knight from display, advance his current position then redraw 27324 POP AF ; Restore AF (A = "MK's jump was impeded" flag) 27325 JR NZ,27336 ; If Magic Knight's jump was impeded by a block above him then jump to #R27336 27327 CALL 28457 ; Set Magic Knight's velocity to zero, if appropriate move to new room, execute room-specific ; routine 27330 LD HL,(37072) ; Load HL with current position in Magic Knight's y-velocities sequence table 27333 INC HL ; Advance to next y-velocity in the sequence 27334 JR 27259 ; Loop back to #R27259 *27336 CALL 27352 ; Handle Magic Knight's fall, preserving x-velocity 27339 JP 27139 ; Loop back to start of keyboard check routine *27342 XOR A ; Set Magic Knight's x-velocity to zero... 27343 LD (25160),A ; ... 27346 LD (27283),A ; Prepare to set Magic Knight's x-velocity to zero 27349 JP 27317 ; Jump back to #R27317 ; Handle Magic Knight's Fall, Preserving x-Velocity ; ; Used by the routine at #R27136. c27352 LD A,(27283) ; Load Magic Knight's stored x-velocity 27355 JR 27358 ; Handle Magic Knight's fall ; Handle Magic Knight's Falls ; ; Used by the routine at #R27136. c27357 XOR A ; Set A to zero ; This entry point is used by the routine at #R27352. *27358 LD (27393),A ; Prepare to set Magic Knight's x-velocity to A 27361 LD HL,37087 ; Point HL at end of table of y-velocities sequence for jumping and falling 27364 LD (37072),HL ; Store current position at #R37072 *27367 LD A,(23474) ; If Magic Knight's movement flags are reset... 27370 OR A ; ... 27371 JR Z,27377 ; ...then skip ahead to #R27377 27373 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 27374 LD (27393),A ; ... *27377 LD HL,(37072) ; Load current position in y-velocities table into HL 27380 LD A,(HL) ; Load current y-velocity from table into A 27381 CP 7 ; If velocity is 7... 27383 JR Z,27389 ; ...then skip ahead to #R27389 27385 DEC HL ; Step pointer back one byte in y-velocities table 27386 LD (37072),HL ; Store pointer *27389 LD (25161),A ; Load last y-velocity read from table into Magic Knight's y-velocity ; The operand of the instruction at #R27392 represents the x-velocity value stored previously. This is modified by ; the instructions at #R27358, #R27374 and #R27502. 27392 LD A,0 ; Set Magic Knight's x-velocity... 27394 LD (25160),A ; ... 27397 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 27400 ADD A,4 ; Add 4 to x-coordinate 27402 CALL 28625 ; Divide x-coordinate by eight, rounding down to nearest integer 27405 LD C,A ; Load result (Magic Knight's x-coordinate in characters) into C, setting B to zero... 27406 LD B,0 ; ... 27408 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 27411 AND 7 ; If y-coordinate is a multiple of eight... 27413 JR Z,27417 ; ...then skip ahead to #R27417 27415 LD B,8 ; Set B to 8, as we need to look one character block lower due to Magic Knight spanning five, ; rather than four, characters [y-coordinate is not a multiple of eight] *27417 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 27420 ADD A,B ; Add B to current y-coordinate (i.e. y-coordinate of highest full character block spanned by ; Magic Knight) 27421 ADD A,32 ; Add 32 (as Magic Knight is 32 pixels high, so now y-coordinate of highest full character ; block not occupied by Magic Knight) 27423 CALL 28625 ; Divide A by eight, rounding down to nearest integer 27426 LD B,A ; Load result (y-coordinate in characters) into B 27427 CALL 54162 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B (block that Magic ; Knight is "falling through") 27430 LD A,(HL) ; If this block, or the one to the right of it cannot be passed vertically (downwards)... 27431 INC HL ; ...(i.e. Magic Knight has landed)... 27432 OR (HL) ; ... 27433 BIT 7,A ; ... 27435 JR NZ,27476 ; ...then skip ahead to #R27476 27437 CALL 27508 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27440 LD A,(25160) ; Load Magic Knight's x-velocity into B... 27443 LD B,A ; ... 27444 LD A,(23474) ; Load Magic Knight's movement flags into A 27447 XOR B ; Check: 27448 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 27450 JP Z,27498 ; ...then jump ahead to #R27498 27453 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 27455 JP Z,27498 ; ...then jump ahead to #R27498 27458 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 27460 JP Z,27498 ; ...then jump ahead to #R27498 27463 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 27464 JP Z,27498 ; ...then jump ahead to #R27498 *27467 CALL 53115 ; Erase Magic Knight from display, advance his current position then redraw 27470 CALL 28457 ; Set Magic Knight's velocity to zero, if appropriate move to new room, execute room-specific ; routine 27473 JP 27367 ; Loop back to #R27367 *27476 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 27479 AND 7 ; Retain only pixel-within-character component (e.g. 5 pixels down the pair of character ; blocks) 27481 NEG ; Negate (i.e. -5 pixels) 27483 AND 7 ; Retain only pixel-within-character component (e.g. 3 pixels up the pair of character blocks, ; or 3 pixels down to the ground) 27485 LD (25161),A ; Set Magic Knight's y-velocity so that it will take his feet to the ground 27488 CALL 53115 ; Erase Magic Knight from display, advance his current position then redraw 27491 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 27494 LD (25160),HL ; ... 27497 RET ; Return (Magic Knight has landed) *27498 XOR A ; Set Magic Knight's x-velocity to zero... 27499 LD (25160),A ; ... 27502 LD (27393),A ; Prepare to set Magic Knight's x-velocity to zero 27505 JP 27467 ; Loop back to #R27467 ; Kill Magic Knight's x-Velocity if he Cannot Horizontally Pass Through a Block Beside Him ; ; Used by the routines at #R27136 and #R27357. c27508 LD A,(23463) ; Load B with Magic Knight's "temporary store" movement flags... 27511 LD B,A ; ... 27512 LD A,(25156) ; Load Magic Knight's x-coordinate into A 27515 CP 5 ; If x-coordinate is less than 5... 27517 JP C,27527 ; ...then jump ahead to #R27527 27520 CP 230 ; If x-coordinate is greater than 230... 27522 JP NC,27527 ; ...then jump ahead to #R27527 27525 LD B,0 ; Set B (Magic Knight's Temporary Store Movement Flags) to zero (i.e. Magic Knight is not at ; the outer edges of his current room, so can move both left and right) *27527 LD A,B ; Load Magic Knight's Temporary Store Movement Flags into A 27528 LD (23474),A ; Set Magic Knight's movement flags 27531 LD A,(25157) ; Load Magic Knight's y-coordinate into B 27534 LD B,A ; ... 27535 LD A,(25161) ; Add Magic Knight's y-velocity to y-coordinate in A... 27538 ADD A,B ; ... 27539 LD (23483),A ; Store this new (predicted) y-coordinate at #R23483 27542 LD C,4 ; Set C to 4 (as Magic Knight is normally four characters tall) 27544 AND 7 ; If predicted y-coordinate is divisible by eight... 27546 JR Z,27549 ; ...then skip ahead to #R27549... 27548 INC C ; ...else Magic Knight must be airborne and at non-integer y-coordinate, and so spans five ; character blocks rather than four *27549 LD A,C ; Load A with number of vertical characters spanned by Magic Knight... 27550 LD (27582),A ; ...and update instructions at #R27581... 27553 LD (27621),A ; ...and #R27620 with this value 27556 LD A,(25156) ; Load Magic Knight's current x-coordinate into C... 27559 LD C,A ; ... 27560 LD A,(25160) ; Add Magic Knight's x-velocity to x-coordinate in A... 27563 ADD A,C ; ... 27564 LD (23482),A ; Store this new (predicted) x-coordinate at #R23482 27567 CALL 28625 ; Divide predicted x-coordinate by eight, rounding down to nearest integer... 27570 LD C,A ; ...and load into C 27571 LD A,(23483) ; Load predicted y-coordinate into A... 27574 CALL 28625 ; ...divide it by eight, rounding down to nearest integer... 27577 LD (23483),A ; ...store back at #R23483... 27580 LD B,A ; ...and load into B ; The operand of the instruction at #R27581 represents number of characters spanned by Magic Knight, vertically. ; This is modified by the instruction at #R27550. 27581 LD A,0 ; Load number of characters (vertically) to check for impassibility *27583 PUSH AF ; Store remaining number of character blocks spanned by Magic Knight vertically to check 27584 CALL 54162 ; Point HL at terrain interaction data for character coordinates x=C, y=B 27587 BIT 6,(HL) ; If Bit 6 of terrain data is set (i.e. Magic Knight cannot pass block horizontally)... 27589 JR NZ,27598 ; ...then jump ahead to #R27598 27591 INC B ; Advance check to next character down 27592 POP AF ; Restore remaining number of character blocks spanned by Magic Knight vertically to check 27593 DEC A ; Decrease count of remaining character blocks by one 27594 JR NZ,27583 ; Loop back to #R27583 to check next block down 27596 JR 27607 ; Skip over setting Magic Knight's Cannot Move Left Flag as there are no obstructions to the ; left *27598 POP AF ; Restore AF 27599 LD A,(23474) ; Set "Magic Knight Cannot Move Left" Flag... 27602 OR 1 ; ... 27604 LD (23474),A ; ... *27607 LD A,(23482) ; Load Magic Knight's predicted x-coordinate (pixels) into A... 27610 ADD A,15 ; ...and add 15... 27612 CALL 28625 ; ...divide by eight, rounding down to nearest integer... 27615 LD C,A ; ...and load into C 27616 LD A,(23483) ; Load Magic Knight's predicted y-coordinate (chars) into B... 27619 LD B,A ; ... ; The operand of the instruction at #R27620 represents number of characters spanned by Magic Knight, vertically. ; This is modified by the instruction at #R27553. 27620 LD A,0 ; Load number of characters (vertically) to check for impassibility *27622 PUSH AF ; Store AF (remaining number of vertical characters to check for impassibility) 27623 CALL 54162 ; Point HL at terrain interaction data for character coordinates x=C, y=B 27626 BIT 6,(HL) ; If Bit 6 is set (i.e. Magic Knight cannot pass block horizontally)... 27628 JR NZ,27637 ; ...jump ahead to #R27637 27630 INC B ; Increase y-coordinate by one character 27631 POP AF ; Restore AF 27632 DEC A ; Decrease number of remaining blocks to check 27633 JR NZ,27622 ; If number of remaining blocks to check is not zero then loop back to 27622 27635 JR 27646 ; Exit routine *27637 POP AF ; Restore AF 27638 LD A,(23474) ; Set "Magic Knight Cannot Move Right" flag... 27641 OR 2 ; ... 27643 LD (23474),A ; ... *27646 RET ; Return ; Kill Magic Knight's Jump if he Cannot Vertically Pass Through a Block Above Him ; ; Used by the routine at #R27136. Output: A Zero (if Magic Knight's jump was not impeded) or 1 (if the jump was ; impeded) c27647 LD A,(25157) ; Load Magic Knight's current y-coordinate into B... 27650 LD B,A ; ... 27651 LD A,(25161) ; Load A with Magic Knight's y-velocity 27654 ADD A,B ; Add y-velocity to y-coordinate in A 27655 CALL 28625 ; Divide A by eight, rounding down to nearest integer 27658 LD B,A ; Load Magic Knight's y-coordinate (CHARS) into B 27659 LD A,(25156) ; Load Magic Knight's current x-coordinate into A 27662 ADD A,4 ; Add 4 to x-coordinate (to get point roughly quarter of the way through Magic Knight's total ; width) 27664 CALL 28625 ; Divide A by eight, rounding down to nearest integer 27667 LD C,A ; Load Magic Knight's current x-coordinate (CHARS) into C 27668 CALL 54162 ; Point HL at terrain interaction data for character coordinates x=C, y=B 27671 BIT 4,(HL) ; If Bit 4 of Magic Knight's current position's terrain data (block is impassable vertically, ; upwards) is set then... 27673 JR NZ,27695 ; ...kill Magic Knight's y-velocity and exit routine 27675 INC HL ; Advance to next character block along in "terrain interaction data" 27676 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 27678 JR NZ,27695 ; ...kill Magic Knight's y-velocity and exit routine 27680 DEC B ; Advance y-coordinate by one character (to get point roughly three quarters of the way through ; Magic Knight's total width) 27681 CALL 54162 ; Point HL at terrain interaction data for character coordinates x=C, y=B 27684 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 27686 JR NZ,27695 ; ...kill Magic Knight's y-velocity and exit routine 27688 INC HL ; Advance to next character block along in "terrain interaction data" 27689 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 27691 JR NZ,27695 ; ...kill Magic Knight's y-velocity and exit routine 27693 XOR A ; Set A to zero, as jump was not impeded 27694 RET ; Return *27695 XOR A ; Set Magic Knight's y-velocity to zero... 27696 LD (25161),A ; ... 27699 LD A,1 ; Set A to one 27701 OR A ; Reset zero flag 27702 RET ; Return ; Draw Top In-Game Window ; ; Used by the routines at #R27762 and #R31688. c27703 LD A,35 ; Check if Magic Knight is carrying the Mirror (35)... 27705 CALL 33645 ; ... 27708 LD HL,38298 ; Point HL at Info Window Text (not carrying Mirror version) 27711 JR NZ,27716 ; If Magic Knight is not carrying the Mirror then skip ahead to #R27716 27713 LD HL,38544 ; Point HL at Info Window Text (carrying Mirror version) *27716 PUSH HL ; Store HL (pointer to text to print) 27717 LD A,1 ; Draw Window 1... 27719 CALL 34990 ; ... 27722 LD HL,16554 ; Load HL with Display File address corresponding to (10, 5) (characters)... 27725 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 27728 LD HL,38357 ; Point HL at "KNIGHT-TYME" text... 27731 CALL 34762 ; ...and print to screen 27734 LD HL,16417 ; Load HL with Display File address corresponding to (1, 1) (characters)... 27737 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 27740 POP HL ; Store HL (pointer to text to print) 27741 CALL 34762 ; Print window text 27744 CALL 34567 ; Draw Strength Bar at top of screen 27747 JP 34627 ; Draw objects in Magic Knight's inventory if he is carrying the Mirror then return ; Print "KNIGHT-TYME" Text at Bottom of Command Summary Window ; ; Used by the routine at #R54333. c27750 LD HL,16554 ; Load HL with Display File address corresponding to (10, 5) (characters)... 27753 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 27756 LD HL,38357 ; Point HL at "KNIGHT-TYME" text... 27759 JP 34762 ; ...and print to screen, then return ; Move Magic Knight into Room A, Draw Room, Objects and Characters and Initialise Room-Specific Data ; ; Used by the routines at #R26997 and #R32252. Input: A (entry at #R27762 only) Index of room to move Magic Knight ; into c27762 LD (23701),A ; Update Magic Knight's current room to be room index passed to this routine in A ; This entry point is used by the routines at #R27136, #R28323, #R28506, #R28554, #R31688, #R32252, #R32895 and ; #R55814. *27765 LD A,(25020) ; Load Magic Knight's current strength into A... 27768 OR A ; ...and if not zero... 27769 JR NZ,27813 ; ...then skip ahead to #R27813 27771 LD A,14 ; If Magic Knight is carrying the McTablet Food (14)... 27773 CALL 33645 ; ... 27776 JR Z,27784 ; ...then skip ahead to #R27784 27778 LD HL,44643 ; Point HL at "YOU DIED OF EXHAUSTION" text 27781 JP NZ,55685 ; If Magic Knight is not carrying the McTablet Food then jump to "Game over" window routine and ; return to Control Selection Menu *27784 LD HL,45899 ; Point HL at "YOU HAD TO EAT SOME OF YOUR OWN MCTABLETS..." text 27787 LD DE,37195 ; Adjust height of window 13 to accommodate text... 27790 CALL 33774 ; ... 27793 PUSH HL ; Store HL (pointer to start of actual text) 27794 LD A,13 ; Draw Window 13... 27796 CALL 34990 ; ... 27799 POP HL ; Restore HL (pointer to start of actual text) 27800 CALL 34762 ; Print text at HL 27803 LD A,100 ; Set Magic Knight's current strength to 100... 27805 LD (25020),A ; ... 27808 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 27811 JR 27817 ; Skip ahead to #R27817 *27813 DEC A ; Decrease Magic Knight's current strength by one... 27814 LD (25020),A ; ... *27817 CALL 27703 ; Draw Top In-Game Window 27820 LD A,(23701) ; Load A with Magic Knight's current room 27823 AND 3 ; Clear all but the lowest two bits to leave a value 0-3... 27825 ADD A,68 ; ...add this to 68... 27827 LD (37102),A ; ...and set the border attribute of Window 1 to this value 27830 LD A,(23701) ; Load A with Magic Knight's current room... 27833 INC A ; ...increase by one... 27834 AND 3 ; ...clear all but the lowest two bits to leave a value 0-3... 27836 ADD A,68 ; ...add this to 68... 27838 LD (37214),A ; ...and set the border attribute of Window 15 to this value 27841 LD HL,24064 ; Load character rows 0-5 in Terrain Interaction Table with 254... 27844 LD DE,24065 ; ...i.e. prevent Magic Knight jumping above ceilings... 27847 LD BC,192 ; ... 27850 LD (HL),254 ; ... 27852 LDIR ; ... 27854 LD BC,544 ; Load character rows 6-22 in Terrain Interaction Table with 0... 27857 LD (HL),0 ; ...i.e. allow Magic Knight to pass through freely... 27859 LDIR ; ... 27861 LD BC,31 ; Load character row 23 in Terrain Interaction Table with 254... 27864 LD (HL),254 ; ...i.e. prevent Magic Knight falling through floors... 27866 LDIR ; ... 27868 LD A,(23701) ; Load A with Magic Knight's current room 27871 LD HL,50143 ; Point HL at start of Table of Room Layout Data Pointers 27874 CALL 55730 ; Load address of layout data for Magic Knight's current room into HL 27877 PUSH HL ; Store HL (pointer to room layout data for Magic Knight's current room) 27878 CALL 35627 ; Clear Display File Below 7th Character Row (Play Area) 27881 XOR A ; Set ATTR T system variable into 0 (black INK, black PAPER)... 27882 LD (23695),A ; ... 27885 LD H,A ; Copy this attribute into both bytes of HL... 27886 LD L,A ; ... 27887 CALL 28716 ; ...wait for interrupt then flood 7th - 23rd rows of Attribute File with this attribute 27890 POP HL ; Restore HL (pointer to room layout data for Magic Knight's current room) 27891 LD (27987),HL ; Store address of start of room layout data by modifying instruction at #R27985 ; This entry point is used by the routines at #R27934, #R28730, #R28753, #R28766 and #R28785. *27894 LD A,(HL) ; Read byte of room layout data 27895 OR A ; If byte is a zero (i.e. marker for end of layout data)... 27896 JP Z,27951 ; ...then draw floor, paint attributes / Terrain Interaction Data, draw MK, characters and ; objects then return 27899 CP 251 ; If byte is less than 251... 27901 JP C,27934 ; ...then skip ahead to #R27934 (read layout parameters and draw graphic in place, then jump ; back to #R27894) 27904 CP 255 ; If byte is 255 (print run of UDG)... 27906 JP Z,28730 ; ...then jump to #R28730 (read start co-ordinates, repeat count and UDG code, print run of ; UDGs, then jump back to #R27894) 27909 CP 254 ; If byte is 254 (print a single UDG)... 27911 JP Z,28753 ; ...then jump to #R28753 (read co-ordinates and UDG code, print the UDG, then jump back to ; #R27894) 27914 CP 253 ; If byte is 253 (draw a line)... 27916 JP Z,28766 ; ...then jump to #R28766 (draw a line, then jump back to #R27894) 27919 CP 252 ; If byte is 252 (draw a horizontal line)... 27921 JP Z,28785 ; ...then jump to #R28785 (draw a horizontal line, then jump back to #R27894) 27924 CP 251 ; If byte is not 251 (used to draw walls)... 27926 JR NZ,27934 ; ...then skip ahead to #R27934 (read layout parameters and draw graphic in place, then jump ; back to #R27894) 27928 LD BC,6 ; Advance HL by six bytes to next entry in room layout data... 27931 ADD HL,BC ; ... 27932 JR 27894 ; Loop back to #R27894 for next byte of room layout data ; Room Drawing (001 - 250) - Read Layout Parameters and Draw Graphic in Place ; ; Used by the routine at #R27762. Input: A Index of graphic to draw HL Current position in Room Layout Data c27934 INC HL ; Advance HL by three bytes to x- and y-coordinates... 27935 INC HL ; ... 27936 INC HL ; ... 27937 LD E,(HL) ; Load x- and y-coordinates (characters) for graphic into DE... 27938 INC HL ; ... 27939 LD D,(HL) ; ... 27940 INC HL ; Advance HL to Mirror Options... 27941 LD C,(HL) ; ...and load into C 27942 INC HL ; Advance HL to next byte (start of next entry) in Room Layout Data 27943 PUSH HL ; Store HL (current position in Room Layout Data) 27944 EX DE,HL ; Swap DE (now current position in Room Layout Data) and HL (x- and y-coordinates of graphic to ; draw) 27945 CALL 28631 ; Read Graphic Definition from Room Layout Data and Draw 27948 POP HL ; Restore HL (current position in Room Layout Data) 27949 JR 27894 ; Loop back to #R27894 for next byte of room layout data ; Room Drawing (000) - Draw Floor, Paint Attributes / Terrain Interaction Data, Draw MK, Characters and Objects then ; Return ; ; Floods 7th - 23rd rows of Attribute File with attribute value in byte at HL+1. c27951 INC HL ; Advance HL to room attribute... 27952 LD A,(HL) ; ...load into A... 27953 LD (23446),A ; ...and store at #R23446 27956 INC HL ; Advance HL to floor attribute 27957 PUSH HL ; Store HL (points to floor attribute data) 27958 LD H,A ; Load room attribute into both bytes of HL... 27959 LD L,A ; ... 27960 CALL 28716 ; Wait for interrupt then flood 7th - 23rd rows of Attribute File with attribute in HL 27963 LD HL,20704 ; Load HL with Display File address corresponding to (0, 23) (characters)... 27966 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 27969 POP HL ; Restore HL (points to floor attribute data) 27970 LD A,(HL) ; Load floor attribute into A... 27971 LD (23695),A ; ...and set ATTR T system variable to this value 27974 INC HL ; Advance HL to floor UDG code... 27975 LD A,(HL) ; ...load into A... 27976 LD (54235),A ; ...and also load into operand of instruction at #R54234 27979 LD HL,32 ; Load HL with 32 as we need to draw across 32 character blocks 27982 CALL 54231 ; Draw run of 32 characters (i.e. draw the room's floor) ; The operand of the instruction at #R27985 represents the address of start of room layout data for the current ; room. This is modified by the instruction at #R27891. 27985 LD IX,0 ; Load IX with start address of room layout data for current room ; This entry point is used by the routines at #R28095 and #R29060. *27989 LD A,(IX+0) ; Load first byte of room layout data instruction 27992 OR A ; If this byte is zero (i.e. last entry so no more painting to do)... 27993 JP Z,28101 ; ...then draw all objects and characters in current room, draw Magic Knight, set action flags ; and validate I.D. card, then return 27996 CP 252 ; If this byte is 252 or more... 27998 JP NC,29060 ; ...then skip IX over current Room Layout Data entry and jump back to #R27989 for next one 28001 INC IX ; Advance to RLE Attribute Data index and load into L... 28003 LD L,(IX+0) ; ... 28006 INC IX ; Advance to RLE Terrain Interaction Data index and load into E... 28008 LD E,(IX+0) ; ... 28011 INC IX ; Advance to x-coordinate... 28013 LD A,(IX+0) ; ... 28016 LD (23493),A ; ...and store at #R23493 28019 INC IX ; Advance to y-coordinate... 28021 LD A,(IX+0) ; ... 28024 LD (23494),A ; ...and store at #R23494 28027 LD H,0 ; Load H with zero (RLE Attribute Data index already in L)... 28029 ADD HL,HL ; ...and multiply by four... 28030 ADD HL,HL ; ... 28031 LD BC,51997 ; Point BC at start of Lookup Table for RLE Attribute Data (Room Layout Graphics)... 28034 ADD HL,BC ; ...and add HL as offset, loading result into HL 28035 EX DE,HL ; Swap DE (now points to entry in RLE Attribute Lookup Table at #R51997) and HL (L now RLE ; Terrain Interaction Data index) 28036 LD H,0 ; Load H with zero (RLE Terrain Interaction Data index already in L)... 28038 ADD HL,HL ; ...and multiply by four... 28039 ADD HL,HL ; ... 28040 LD BC,52397 ; Point BC at start of Lookup Table for RLE Terrain Interaction Data (Room Layout Graphics)... 28043 ADD HL,BC ; ...and add HL as offset, loading result into HL 28044 EX DE,HL ; Swap DE (now points to entry in RLE Terrain Interaction Lookup Table at #R52397) and HL (now ; points to entry in RLE Attribute Lookup Table at #R51997) 28045 PUSH DE ; Store DE (pointer to required entry in RLE Terrain Interaction Lookup Table) 28046 INC IX ; Advance to Mirror Options... 28048 LD A,(IX+0) ; ...and load into A 28051 PUSH IX ; Store IX (current position in room layout data) 28053 OR A ; If both mirror options are off... ; The following jumps handle the painting of the current room layout data entry's attribute and terrain interaction ; data. After this painting is completed, IX is advanced to the start of the next room layout data entry and a jump ; back to #R27989 occurs to process this next entry. 28054 JP Z,28938 ; ...then paint room layout data entry's attributes and terrain interaction data then process ; next entry 28057 CP 1 ; If Apply Vertical Mirror selected... 28059 JP Z,28906 ; ...then paint room layout data entry's attributes and terrain interaction data applying ; vertical mirror, then process next entry 28062 CP 2 ; If Apply Horizontal Mirror selected... 28064 JP Z,28874 ; ...then paint room layout data entry's attributes and terrain interaction data applying ; horizontal mirror, then process next entry 28067 JP 28846 ; Otherwise, paint room layout data entry's attributes and terrain interaction data applying ; horizontal and vertical mirrors, then process next entry ; Room Drawing Advance IX to Start of Next Room Layout Data Entry and Paint Attributes ; ; This routine is jumped to only by the routine at #R28938, which in turn is only jumped to by the routine at ; #R27951. In this latter routine, the instruction at #R28045 pushes DE (pointer to required entry in RLE Terrain ; Interaction Lookup Table) onto the stack, and then the instruction at #R28051 pushes IX (current position in room ; layout data) onto the stack. c28070 POP IX ; Restore IX (current position in room layout data) 28072 POP HL ; Restore HL (pointer to required entry in RLE Terrain Interaction Lookup Table, PUSHed by ; instruction at #R28045) 28073 LD A,(IX+0) ; Load Mirror Options into A 28076 PUSH IX ; Store IX (current position in room layout data) 28078 OR A ; If both mirror options are off... 28079 JP Z,29174 ; ...then paint room layout data entry's Terrain Interaction Parameters, then advance to next ; entry 28082 CP 1 ; If Apply Vertical Mirror selected... 28084 JP Z,29142 ; ...then paint room layout data entry's Terrain Interaction Parameters, applying vertical ; mirror, then advance to next entry 28087 CP 2 ; If Apply Horizontal Mirror selected... 28089 JP Z,29110 ; ...then paint room layout data entry's Terrain Interaction Parameters, applying horizontal ; mirror, then advance to next entry 28092 JP 29082 ; Otherwise, paint room layout data entry's Terrain Interaction Parameters, applying horizontal ; and vertical mirrors, then advance to next entry ; Room Drawing Advance IX to Start of Next Room Layout Data Entry and Paint Terrain Interaction Data ; ; Used by the routine at #R29174. c28095 POP IX ; Restore IX (current position in room layout data, PUSHed by instruction at #R28076) 28097 INC IX ; Advance IX by one byte to start of next room layout data entry 28099 JR 27989 ; Process next room layout instruction (jump to #R27989) ; Draw All Objects and Characters in Current Room, Draw Magic Knight, Set Action Flags and Validate I.D. Card ; ; Used by the routine at #R27951. Output: A Index of Magic Knight's current room c28101 CALL 29272 ; If Magic Knight is on the bridge and USS Pisces is not at Gangrole then draw viewscreen ; starfield 28104 CALL 28172 ; Print Magic Knight's current room's name at top of screen 28107 CALL 28264 ; Prepare to execute room-specific routine for Magic Knight's current room 28110 CALL 36077 ; Draw all objects in Magic Knight's current room 28113 CALL 28364 ; Draw all characters in Magic Knight's current room 28116 LD A,(23701) ; Flag Magic Knight's current room as visited for scoring purposes... 28119 LD E,A ; ... 28120 LD D,0 ; ... 28122 LD HL,23502 ; ... 28125 ADD HL,DE ; ... 28126 LD (HL),1 ; ... 28128 LD A,7 ; Set system variable BORDCR to 7... 28130 LD (23624),A ; ... 28133 XOR A ; Set border to black and reset speaker state... 28134 OUT (254),A ; ... 28136 LD A,71 ; Set ATTR T system variable to 71 (white INK, black PAPER, BRIGHT)... 28138 LD (23695),A ; ... 28141 RES 1,(IY+65) ; Reset Characters Free to Move Flag (IY = 23610) 28145 RES 2,(IY+65) ; Reset Unknown Flag (IY = 23610) 28149 LD A,(23480) ; If Unknown / Unused Flag 2 is zero... 28152 OR A ; ... 28153 JR Z,28155 ; ...then jump to #R28155 (see trivia) *28155 CALL 53150 ; Store background attributes if appropriate, then draw Magic Knight to display 28158 XOR A ; Set Unknown / Unused Flag 2 to zero... 28159 LD (23480),A ; ... 28162 CALL 28696 ; If Draw Communicate Window / Face Flag is set then draw Communicate Window / Face 28165 CALL 34265 ; Set Magic Knight's available action flags and validate I.D. Card if appropriate 28168 LD A,(23701) ; Load A with Magic Knight's current room 28171 RET ; Return ; Print Magic Knight's Current Room's Name at Top of Screen ; ; The Room Name Bar displayed on the 7th character row defaults to an attribute value of 71 as per the instruction ; at #R28172. However in cases where the current room has a name record defined in the table at #R42765, the ; attribute defined in that record will override this default attribute. Therefore, the default attribute is only ; visible in rooms without names. c28172 LD A,71 ; Set ATTR T system variable to 71 (white INK, black PAPER, BRIGHT)... 28174 LD (23695),A ; ... 28177 LD HL,16576 ; Load HL with Display File address corresponding to (0, 6) (characters)... 28180 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 28183 LD HL,32 ; Load HL (repeat counter) with 32 28186 LD A,93 ; Set character to be repeated to 93 (body of "Room Name Bar")... 28188 LD (54235),A ; ... 28191 CALL 54231 ; Print the character 32 times across width of screen 28194 LD HL,42765 ; Point HL at start of table of room names 28197 LD A,(23701) ; Load B with Magic Knight's current room... 28200 LD B,A ; ... 28201 CALL 54269 ; Advance HL to name entry for Magic Knight's current room 28204 LD A,(HL) ; Load first value (attribute) into A 28205 OR A ; If attribute value is zero (i.e. no room name defined)... 28206 RET Z ; ...then return 28207 LD (23695),A ; Load system variable ATTR T to required attribute value 28210 INC HL ; Advance HL to string length data... 28211 LD A,(HL) ; ...and load into A 28212 INC HL ; Advance HL to first byte of string 28213 PUSH HL ; Store HL (pointer to first byte of room name string) 28214 ADD A,4 ; Add 4 to the string's length to accommodate space, and "bar cap" characters (chars. 35 and ; 36) before and after... 28216 LD B,A ; ...and load value into B 28217 LD A,32 ; Load A with width of screen (characters) minus length of room name string, spaces and bar ; caps... 28219 SUB B ; ... 28220 RRCA ; Divide value by two... 28221 AND 31 ; ...and cap at 31 28223 LD C,A ; Load this value (length of one half of Room Name Bar) into BC... 28224 LD B,0 ; ... 28226 LD HL,16576 ; Point HL at top pixel row of character block at coordinates (0, 6) 28229 ADD HL,BC ; Add value in BC as offset... 28230 LD (54110),HL ; ...and load this address into Bitmap Virtual Text Cursor 28233 LD HL,22720 ; Point HL at Attribute File address for character coordinates (0, 6) 28236 LD DE,22721 ; Point DE at Attribute File address for character coordinates (1, 6) 28239 LD BC,31 ; Set repeat count to 31 ; ATTR T is initially 71 (as set by instruction at #R28174) and may have been changed to a new value as specified in ; room name entry in table at #R42765 28242 LD A,(23695) ; Load A with system variable ATTR T 28245 LD (HL),A ; Fill entire row in Attribute File with this attribute value... 28246 LDIR ; ... 28248 LD HL,42160 ; Point HL at text code for SPACE followed by Room Name Bar End Cap (Right) 28251 CALL 34733 ; Print text at location HL to screen using full screen width 28254 POP HL ; Restore HL (pointer to first byte of room name string) 28255 CALL 34733 ; Print text at location HL to screen using full screen width 28258 LD HL,42163 ; Point HL at text code for Room Name Bar End Cap (Left) followed by SPACE 28261 JP 34733 ; Print text at location HL to screen using full screen width and return ; Prepare to Execute Room-Specific Routine for Magic Knight's Current Room ; ; Used by the routine at #R28101. c28264 LD A,(23701) ; Load A with Magic Knight's current room 28267 LD HL,53429 ; Point HL at start of Table of Room-Specific Routine Addresses 28270 CALL 55730 ; Advance HL to entry for Magic Knight's current room and load into HL 28273 LD (28467),HL ; Update jump in routine at #R28457 to execute room-specific routine 28276 RET ; Return ; Check Whether Magic Knight is Moving into a New Room and React if so ; ; Used by the routine at #R28457. c28277 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 28280 CP 3 ; If less than 3... 28282 JP C,28323 ; ...then skip to #R28323 (move Magic Knight one room to the left if possible then return) 28285 CP 230 ; If 230 or more... 28287 JP NC,28346 ; ...then skip to #R28346 (move Magic Knight one room to the right if possible then return) 28290 RET ; Return ; Change Magic Knight's Current Room if Possible ; ; Used by the routines at #R28323 and #R28346. Input: A Magic Knight's new x-coordinate upon entering new room DE ; Exit that Magic Knight is leaving old room from; either 0 (left exit) or 1 (right exit) Output: F Zero Flag set ; if Magic Knight can't leave his current room, reset otherwise c28291 PUSH AF ; Store new x-coordinate for later 28292 XOR A ; Set Magic Knight's Temporary Movement Flags to zero (new room, so Magic Knight can move both ; left and right)... 28293 LD (23463),A ; ... 28296 LD HL,37022 ; Point HL to Room Connectivity Data Table 28299 LD A,(23701) ; Load Magic Knight's current room's index into A... 28302 ADD A,A ; ...double it... 28303 LD C,A ; ...and load into BC... 28304 LD B,0 ; ... 28306 ADD HL,BC ; Add BC as offset to HL 28307 ADD HL,DE ; Point to left or right exit from current room, as determined by DE 28308 LD A,(HL) ; Load new room number into A... 28309 CP 255 ; ...and if this is 255 (i.e. Magic Knight can't leave his current room)... 28311 JR Z,28320 ; ...set Zero Flag and exit routine... 28313 LD (23701),A ; ...else update Magic Knight's current room to be this new room index 28316 POP BC ; Restore new x-coordinate to B... 28317 LD A,B ; ...and load back into A 28318 OR A ; Reset Zero Flag 28319 RET ; Return *28320 POP BC ; Restore AF to BC... 28321 LD A,B ; ...and load A with contents of B to restore to what it was on entering this routine 28322 RET ; Return ; Move Magic Knight One Room to the Left if Possible ; ; Used by the routine at #R28277. Input: A (Entry at #R28333 only) Magic Knight's new x-coordinate (pixels) c28323 LD DE,0 ; Set DE to zero (dealing with current room's left exit) 28326 LD A,228 ; Load A with Magic Knight's new x-coordinate when he arrives in new room (228 is near ; right-hand side of room) 28328 CALL 28291 ; Change Magic Knight's current room (if possible) based upon left exit of his current room 28331 JR Z,28340 ; If Magic Knight can't leave his current room then jump to #R28340 ; This entry point is used by the routine at #R28346. *28333 LD (25156),A ; Set Magic Knight's x-coordinate 28336 CALL 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data 28339 RET ; Return *28340 LD A,1 ; Set Magic Knight's Temporary Movement Flags to 1 (Magic Knight can't move left because he ; can't leave his current room)... 28342 LD (23463),A ; ... 28345 RET ; Return ; Move Magic Knight One Room to the Right if Possible ; ; Used by the routine at #R28277. c28346 LD DE,1 ; Set DE to one (dealing with current room's right exit) 28349 LD A,5 ; Load A with Magic Knight's new coordinate when he arrives in new room (5 is near left-hand ; side of room) 28351 CALL 28291 ; Change Magic Knight's current room (if possible) based upon right exit of his current room 28354 JR Z,28358 ; If Magic Knight's can't leave his current room then jump to #R28358 28356 JR 28333 ; Set Magic Knight's x-coordinate, draw the room and return *28358 LD A,2 ; Set Magic Knight's Temporary Movement Flags to 2 (Magic Knight can't move right because he ; can't leave his current room)... 28360 LD (23463),A ; ... 28363 RET ; Return ; Draw all Characters in Magic Knight's Current Room ; ; Used by the routine at #R28101. c28364 LD IX,25244 ; Point IX at start of Table of Characters' Current Positions at #R25244 28368 LD BC,4096 ; Load B with 16 and C (current character) with 0 (see trivia) *28371 LD A,(23701) ; Load A with Magic Knight's current room 28374 CP (IX+0) ; If Magic Knight and current character are in the same room... 28377 CALL Z,28390 ; ...then draw character with index C 28380 INC C ; Increase C to advance to next character 28381 INC IX ; Advance IX to entry for next character... 28383 INC IX ; ... 28385 INC IX ; ... 28387 DJNZ 28371 ; Loop back to #R28371 for next character 28389 RET ; Return ; Draw a character ; ; Used by the routine at #R28364. Input: C A character index IX That character's entry in Table of Characters' ; Current Positions at #R25244 c28390 PUSH BC ; Store BC 28391 PUSH IX ; Store IX 28393 LD A,C ; Load A with character's index... 28394 LD E,4 ; ...and point HL at this character's Magic Level / Attribute value (in Characters' Current ; Stats Table)... 28396 CALL 33541 ; ... 28399 LD A,(HL) ; Load character's Magic Level / Attribute into A... 28400 LD (28442),A ; ...and modify instruction at #R28441 with this value 28403 INC HL ; Advance HL to Character Graphic Index... 28404 LD A,(HL) ; ...and load value into A 28405 OR A ; If this is zero... 28406 JR Z,28428 ; ...then skip ahead to #R28428 (i.e. don't draw the character) 28408 LD C,(IX+1) ; Load C with character's x-coordinate (characters) 28411 LD B,(IX+2) ; Load B with character's y-coordinate (characters) 28414 PUSH IX ; Store IX (pointer to character's entry in Table of Characters' Current Positions) 28416 CALL 54411 ; Draw the graphic with lookup index A at character coordinates (C, B) with width = 2 ; characters and height = 4 characters 28419 POP IX ; Restore IX (pointer to character's entry in Table of Characters' Current Positions) 28421 LD A,(23705) ; If Player Attribute Update Flag is set (Player Attribute Update mode)... 28424 OR A ; ... 28425 CALL NZ,28432 ; ...then paint the character's attributes *28428 POP IX ; Restore IX 28430 POP BC ; Restore BC 28431 RET ; Return ; Paint a character's attributes ; ; Used by the routine at #R28390. Input: IX A character's entry in Table of Characters' Current Positions at ; #R25244 c28432 LD C,(IX+1) ; Load C with character's x-coordinate (characters) 28435 LD B,(IX+2) ; Load B with character's y-coordinate (characters) 28438 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) ; The operand of the instruction at #R28441 represents the character's magic level / attribute value. This is ; modified by the instruction at #R28400. 28441 LD A,0 ; Load A with Magic Level / Attribute value 28443 LD B,4 ; Load B with 4 (as characters are four characters high) *28445 PUSH BC ; Store BC (B = remaining number of character rows to paint) 28446 LD (HL),A ; Paint character's attribute at coordinates (C, B)... 28447 INC HL ; ... 28448 LD (HL),A ; ...and at coordinates (C + 1, B) 28449 LD BC,31 ; Advance down one character row, and left one character to coordinates (C, B + 1)... 28452 ADD HL,BC ; ... 28453 POP BC ; Restore BC (B = remaining number of character rows to paint) 28454 DJNZ 28445 ; Decrease remaining number of character rows to paint and loop back to #R28445 28456 RET ; Return ; Set Magic Knight's Velocity to Zero, if Appropriate Move to New Room, Execute Room-Specific Routine ; ; Used by the routines at #R27136 and #R27357. c28457 LD HL,0 ; Set Magic Knight's current x- and y-velocities to zero... 28460 LD (25160),HL ; ... 28463 CALL 28277 ; Check whether Magic Knight is moving into a new room and react if so ; The operand of the instruction at #R28466 (jump destination) is the address of a room-specific routine. This is ; modified by the instruction at #R28273. 28466 JP 28469 ; Jump to room-specific routine ; Room-Specific Routine Do Nothing ; ; Used by the routine at #R28457. c28469 RET ; Return ; Room-Specific Routine Go to Game Over Routine if Magic Knight is not Wearing the Cloak of Invisibility c28470 LD A,1 ; If Magic Knight is wearing the Cloak of Invisibility (01)... 28472 CALL 33640 ; ... 28475 RET Z ; ...then return 28476 LD HL,44699 ; Point HL at "SECURITY SAW YOU..." text 28479 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Room-Specific Routine Go to Game Over Routine if Magic Knight is not Wearing the Pair of Boots c28482 LD A,22 ; If Magic Knight is wearing the Pair of Boots (22)... 28484 CALL 33640 ; ... 28487 RET Z ; ...then return 28488 LD HL,44663 ; Point HL at "SECURITY HEARD YOU..." text 28491 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Room-Specific Routine Go to Game Over Routine if Magic Knight is not Wearing the Gas Mask c28494 LD A,27 ; If Magic Knight is wearing the Gas Mask (27)... 28496 CALL 33640 ; ... 28499 RET Z ; ...then return 28500 LD HL,44733 ; Point HL at "THE GAS PENETRATED YOUR ARMOUR..." text 28503 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Room-Specific Routine Show Tyme Guardians' Warning Message if not Already Shown c28506 LD A,(23472) ; If Tyme Guardians' Warning Message Shown Flag is set... 28509 BIT 2,A ; ... 28511 RET NZ ; ...then return 28512 OR 4 ; Set Tyme Guardians' Warning Message Shown Flag... 28514 LD (23472),A ; ... 28517 LD HL,46989 ; Point HL at "A LOUD BOOMING VOICE..." text 28520 LD DE,37195 ; Adjust height of window 13 to accommodate text... 28523 CALL 33774 ; ... 28526 PUSH HL ; Store HL (pointer to start of text to print) 28527 LD A,13 ; Draw Window 13... 28529 CALL 34990 ; ... 28532 POP HL ; Restore HL (pointer to start of text to print) 28533 CALL 34762 ; Print text to screen 28536 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 28539 JP 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data and return ; Room-Specific Routine Go to Game Over Routine if Magic Knight is not Carrying the Golden Sundial of Alpha c28542 LD A,13 ; If Magic Knight is carrying the Golden Sundial of Alpha (13)... 28544 CALL 33645 ; ... 28547 RET Z ; ...then return 28548 LD HL,44780 ; Point HL at "THE AUTO DEFENCE SYSTEMS HAVE REMOVED YOU..." text 28551 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Room-Specific Routine Show Tyme Guardians' Messages and Install Tyme Machine on USS Pisces c28554 LD A,(23472) ; If Tyme Machine Installed Flag is set... 28557 BIT 1,A ; ... 28559 RET NZ ; ...then return 28560 OR 2 ; Set Tyme Machine Installed Flag... 28562 LD (23472),A ; ... 28565 LD A,(23397) ; Increase Bonus Score by 5... 28568 ADD A,5 ; ... 28570 LD (23397),A ; ... 28573 LD A,24 ; Set right exit from USS Pisces, 5 (The Airlock) to USS Pisces, 6A (The Control Column)... 28575 LD (37033),A ; ... 28578 LD HL,47114 ; Point HL at "THE TYME GUARDIANS ARE SHOCKED AT YOUR ARRIVAL..." text 28581 LD DE,37195 ; Adjust height of window 13 to accommodate text... 28584 CALL 33774 ; ... 28587 PUSH HL ; Store HL (pointer to start of text to print) 28588 LD A,13 ; Draw Window 13... 28590 CALL 34990 ; ... 28593 POP HL ; Restore HL (pointer to start of text to print) 28594 CALL 34762 ; Print text to screen 28597 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 28600 LD HL,47250 ; Point HL at "YOU MUST RETURN TO YOUR OWN TIME..." text 28603 LD DE,37323 ; Adjust height of window 29 to accommodate text... 28606 CALL 33774 ; ... 28609 PUSH HL ; Store HL (pointer to start of text to print) 28610 LD A,29 ; Draw Window 29... 28612 CALL 34990 ; ... 28615 POP HL ; Restore HL (pointer to start of text to print) 28616 CALL 34762 ; Print text to screen 28619 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 28622 JP 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data and return ; Divide A by Eight, Rounding Down to Nearest Integer ; ; Used by the routines at #R27357, #R27508, #R27647, #R33757, #R34567 and #R35525. c28625 RRCA ; Divide by eight... 28626 RRCA ; ... 28627 RRCA ; ... 28628 AND 31 ; ...and remove remainder 28630 RET ; Return ; Room Drawing Read Graphic Definition from Room Layout Data and Draw ; ; Used by the routines at #R27934, #R28696 and #R30145. Input: A Index of graphic to draw C Mirror options (bit 0 ; = apply vertical mirror, bit 1 = apply horizontal mirror) H y-coordinate (characters) L x-coordinate ; (characters) c28631 PUSH BC ; Store BC (C = horizontal / vertical mirror options) 28632 PUSH HL ; Store HL (H = y-coordinate, L = x-coordinate) 28633 LD L,A ; Load four times index of graphic to draw into HL... 28634 LD H,0 ; ... 28636 ADD HL,HL ; ... 28637 ADD HL,HL ; ... 28638 LD BC,55950 ; ...and add (in HL) to address of start of Graphics Data Lookup Table at #R55950 as an ; offset... 28641 ADD HL,BC ; ... 28642 LD C,(HL) ; Load width & height at this location into BC... 28643 INC HL ; ... 28644 LD B,(HL) ; ... 28645 INC HL ; ... 28646 LD A,(HL) ; Load address of graphic data into HL... 28647 INC HL ; ... 28648 LD H,(HL) ; ... 28649 LD L,A ; ... 28650 LD (23447),HL ; ...and store at #R23447 28653 POP HL ; Restore HL (H = y-coordinate, L = x-coordinate)... 28654 LD (23493),HL ; ...and store at #R23493 28657 ADD HL,BC ; Add width and height to get coordinates (x+1, y+1) of bottom right of graphic to draw... 28658 LD (23495),HL ; ...and store at #R23495 28661 POP BC ; Restore BC (C = horizontal / vertical mirror options) 28662 LD A,C ; If both mirror options are switched off... 28663 AND 3 ; ... 28665 JP Z,28684 ; ...then skip ahead to #R28684 28668 CP 1 ; If only the "apply vertical mirror" option is switched on... 28670 JP Z,28687 ; ...then skip ahead to #R28687 28673 CP 2 ; If only the "apply horizontal mirror" option is switched on... 28675 JP Z,28690 ; ...then skip ahead to #R28690 28678 CP 3 ; If both mirror options are switched on... 28680 JP Z,28693 ; ...then skip ahead to #R28693 28683 RET ; Return *28684 JP 52513 ; Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode off, draw the graphic ; and return *28687 JP 52535 ; Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode off, draw the graphic and ; return *28690 JP 52566 ; Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode on, draw the graphic and ; return *28693 JP 52596 ; Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode on, draw the graphic and ; return ; If Draw Communicate Window / Face Flag is Set then Draw Communicate Window / Face ; ; Used by the routine at #R28101. c28696 LD A,(23461) ; If Draw Communicate Window / Face Flag is reset... 28699 OR A ; ... 28700 RET Z ; ...then return 28701 LD A,26 ; Draw Window 26... 28703 CALL 34990 ; ... 28706 LD C,0 ; Load C with zero (Mirror Options = no mirror) 28708 LD A,62 ; Load A with 62 (index of Viewscreen Face graphic) 28710 LD HL,2833 ; Load H with 11 and L with 17 (y- and x-coordinates to draw) 28713 JP 28631 ; Draw Viewscreen Face graphic and return ; Wait for Interrupt then Flood 7th - 22nd Rows of Attribute File with Attribute in HL ; ; Used by the routines at #R27762 and #R27951. Input: HL Attribute to use c28716 HALT ; Wait for interrupt 28717 LD (35670),SP ; Store stack pointer at #R35669 28721 LD SP,23264 ; Point stack pointer at start of last row of Attribute File 28724 LD BC,4098 ; Load B with 16 (repeat inner loop 16 times) and C with 2 (repeat outer loop twice) 28727 JP 35663 ; Clear 7th to 23rd rows of Attribute File ; Room Drawing (255) - Read Start Co-Ordinates, Repeat Count and UDG Code and Print Run of Characters ; ; Used by the routine at #R27762. c28730 CALL 28833 ; Move Virtual Bitmap Cursor to Co-Ordinates Specified in Layout Data 28733 LD B,(HL) ; Load repeat count into B... 28734 INC HL ; ...and advance HL to next parameter 28735 LD A,(HL) ; Load UDG code to print into A... 28736 INC HL ; ...and advance HL to next parameter 28737 PUSH HL ; Store HL (current position in room layout data) *28738 PUSH BC ; Store BC (B = remaining number of UDGs to print) 28739 PUSH AF ; Store AF (A = UDG code to print) 28740 PUSH HL ; Store HL (current position in room layout data) 28741 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 28744 POP HL ; Restore HL (current position in room layout data) 28745 POP AF ; Restore AF (A = UDG code to print) 28746 POP BC ; Restore BC (B = remaining number of UDGs to print) 28747 DJNZ 28738 ; Decrease remaining number of UDGs to print and loop back to #R28738 28749 POP HL ; Restore HL (current position in room layout data) 28750 JP 27894 ; Jump back to #R27894 for next byte of room layout data ; Room Drawing (254) - Read Start Co-Ordinates and UDG Code and Print the UDG ; ; Used by the routine at #R27762. c28753 CALL 28833 ; Move Virtual Bitmap Cursor to Co-Ordinates Specified in Layout Data 28756 LD A,(HL) ; Load UDG code to print into A... 28757 INC HL ; ...and advance HL to next parameter 28758 PUSH HL ; Store HL (current position in room layout data) 28759 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 28762 POP HL ; Restore HL (current position in room layout data) 28763 JP 27894 ; Jump back to #R27894 for next byte of room layout data ; Room Drawing (253) - Draw a Line ; ; Used by the routine at #R27762. c28766 INC HL ; Advance data pointer by three bytes... 28767 INC HL ; ... 28768 INC HL ; ... 28769 LD C,(HL) ; Load x-coordinate of start of line into C 28770 INC HL ; Advance HL to y-coordinate of start of line... 28771 LD B,(HL) ; ...and load into B 28772 INC HL ; Advance HL to x-coordinate of end of line... 28773 LD E,(HL) ; ...and load into E 28774 INC HL ; Advance HL to y-coordinate of end of line... 28775 LD D,(HL) ; ...and load into D 28776 INC HL ; Advance HL to start of next room layout data entry 28777 PUSH HL ; Store HL (current position in room layout data) 28778 CALL 36543 ; Draw a line from (C, B) to (E, D) 28781 POP HL ; Restore HL (current position in room layout data) 28782 JP 27894 ; Jump back to #R27894 for next byte of room layout data ; Room Drawing (252) - Draw a Horizontal Line ; ; Used by the routine at #R27762. c28785 INC HL ; Advance data pointer by three bytes... 28786 INC HL ; ... 28787 INC HL ; ... 28788 PUSH HL ; Transfer current position in room layout data from HL to IX... 28789 POP IX ; ... 28791 LD L,(IX+0) ; Load HL with y-coordinate (pixels)... 28794 LD H,0 ; ... 28796 ADD HL,HL ; ...and double 28797 LD BC,26240 ; Point BC at Table of Display File Addresses of Start of Each Pixel Row... 28800 ADD HL,BC ; ...and add doubled y-coordinate as offset in HL 28801 CALL 55735 ; Load address corresponding to start of pixel row at this coordinate into HL 28804 INC IX ; Advance layout data pointer to next byte 28806 LD C,(IX+0) ; Load BC with x-coordinate of start of line (characters)... 28809 LD B,0 ; ... 28811 ADD HL,BC ; ...and add to HL as offset 28812 INC IX ; Advance layout data pointer to next byte 28814 LD A,(IX+0) ; Load A with x-coordinate of end of line (characters) 28817 SUB C ; Subtract start coord. from end coord. and add one to get width... 28818 INC A ; ... 28819 LD B,A ; ...and load into B 28820 LD A,255 ; Load A with 255 (i.e. all bits set) *28822 LD (HL),A ; Write a row of eight set pixels to the Display File... 28823 INC HL ; ...and advance to next character to the right 28824 DJNZ 28822 ; Decrease B (remaining number of character blocks to draw to) and loop back to #R28822 28826 PUSH IX ; Transfer current position in room layout data from IX to HL... 28828 POP HL ; ... 28829 INC HL ; Advance room layout data pointer to next instruction in layout data 28830 JP 27894 ; Jump back to #R27894 for next byte of room layout data ; Room Drawing - Move Virtual Bitmap Cursor to Co-Ordinates Specified in Layout Data ; ; Used by the routines at #R28730 and #R28753. Input: HL Pointer to an instruction in room layout data Output: HL ; Pointer to next instruction in room layout data c28833 INC HL ; Advance HL by three bytes... 28834 INC HL ; ... 28835 INC HL ; ... 28836 LD C,(HL) ; Load x- and y-coordinates into BC... 28837 INC HL ; ... 28838 LD B,(HL) ; ... 28839 INC HL ; ...advancing to next position in room layout data 28840 PUSH HL ; Store HL (current position in room layout data) 28841 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 28844 POP HL ; Restore HL (current position in room layout data) 28845 RET ; Return ; Paint Room Layout Data Entry's Attributes, Applying Horizontal and Vertical Mirrors (Room Drawing) ; ; Used by the routine at #R27951. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) (at #R51997) Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's right c28846 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 28847 LD HL,23493 ; Modify instruction at #R28984 to load x-coordinate of graphic's left edge into A... 28850 LD (28985),HL ; ...i.e. set end x-coordinate for painting right-to-left 28853 LD HL,29026 ; Modify instruction at #R28988 to jump to #R29026... 28856 LD (28989),HL ; ...i.e. advance HL up one character row in Attribute File 28859 LD A,43 ; Modify instruction at #R28991 with opcode 43 (DEC HL)... 28861 LD (28991),A ; ... 28864 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 28865 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 28868 LD BC,(23495) ; Load BC with coordinates of graphic's bottom-right 28872 JR 28964 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes, Applying Horizontal Mirror (Room Drawing) ; ; Used by the routine at #R27951. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) (at #R51997) Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's left c28874 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 28875 LD HL,23495 ; Modify instruction at #R28984 to load x-coordinate of graphic's right edge into A... 28878 LD (28985),HL ; ...i.e. set end x-coordinate for painting left-to-right 28881 LD HL,29026 ; Modify instruction at #R28988 to jump to #R29026... 28884 LD (28989),HL ; ...i.e. advance HL up one character row in Attribute File 28887 LD A,35 ; Modify instruction at #R28991 with opcode 35 (INC HL)... 28889 LD (28991),A ; ... 28892 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 28893 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 28896 LD A,(23493) ; Load C with x-coordinate of graphic's left edge... 28899 LD C,A ; ... 28900 LD A,(23496) ; Load B with y-coordinate of graphic's bottom edge... 28903 LD B,A ; ... 28904 JR 28964 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes, Applying Vertical Mirror (Room Drawing) ; ; Used by the routine at #R27951. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) (at #R51997) Output: B y-coordinate of graphic's top C x-coordinate of graphic's right c28906 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 28907 LD HL,23493 ; Modify instruction at #R28984 to load x-coordinate of graphic's left edge into A... 28910 LD (28985),HL ; ...i.e. set end x-coordinate for painting right-to-left 28913 LD HL,29005 ; Modify instruction at #R28988 to jump to #R29005... 28916 LD (28989),HL ; ...i.e. advance HL down one character row in Attribute File 28919 LD A,43 ; Modify instruction at #R28991 with opcode 43 (DEC HL)... 28921 LD (28991),A ; ... 28924 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 28925 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 28928 LD A,(23495) ; Load C with x-coordinate of graphic's right edge... 28931 LD C,A ; ... 28932 LD A,(23494) ; Load B with y-coordinate of graphic's top edge... 28935 LD B,A ; ... 28936 JR 28964 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes (Room Drawing) ; ; Used by the routine at #R27951. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) at #R51997 DE Points to entry in Lookup Table for RLE Terrain Interaction Data (Room Layout Graphics) ; at #R52397 c28938 PUSH HL ; Store HL (Pointer to entry in Lookup Table for RLE Attribute Data) 28939 LD HL,23495 ; Modify instruction at #R28984 to load x-coordinate of graphic's right edge into A... 28942 LD (28985),HL ; ...i.e. set end x-coordinate for painting left-to-right 28945 LD HL,29005 ; Modify instruction at #R28988 to jump to #R29005... 28948 LD (28989),HL ; ...i.e. advance HL down one character row in Attribute File 28951 LD A,35 ; Modify instruction at #R28991 with opcode 35 (INC HL)... 28953 LD (28991),A ; ... 28956 POP HL ; Restore HL (Pointer to entry in Lookup Table for RLE Attribute Data) 28957 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 28960 LD BC,(23493) ; Load BC with x- and y-coordinates (top-left) defined in current room layout data entry ; This entry point is used by the routines at #R28846, #R28874 and #R28906. At this point, BC holds the initial ; coordinates in characters, from which to start painting attributes. IX points to the required RLE attribute data. *28964 PUSH BC ; Store BC (B = current y-coordinate, C = initial x-coordinate) 28965 CALL 54148 ; Point HL at Attribute File address for character coordinates (C, B) *28968 LD A,(IX+0) ; Load A with repeat count value 28971 OR A ; If repeat count is zero... 28972 JP Z,29001 ; ...then jump to #R29001 28975 LD B,A ; Load B with repeat count 28976 LD C,(IX+1) ; Load C with attribute to paint *28979 LD (HL),C ; Apply attribute in C to current Attribute File location in HL 28980 LD A,L ; Load E with x-coordinate (characters) of current Attribute File location... 28981 AND 31 ; ... 28983 LD E,A ; ... ; The operand of the instruction at #R28984 is modified by instructions at #R28850, #R28878, #R28910, #R28942, to ; #R23493 (x-coordinate of left edge), #R23495 (x-coordinate of right edge), #R23493 (x-coordinate of left edge), or ; #R23495 (x-coordinate of right edge) respectively. 28984 LD A,(23495) ; Load A with end x-coordinate for painting... 28987 CP E ; ...and if this is the same as the x-coordinate... ; The operand of the instruction at #R28988 (i.e. the destination of the jump) is modified by the instructions at ; #R28856, #R28884, #R28916 and #R28948 to be #R29026 (move up one character row), #R29026 (move up one character ; row), #R29005 (move down one character row) or #R29005 (move down one character row) respectively. 28988 JP Z,29005 ; ...then jump to routine to move up or down one character row ; The instruction at #R28991 is modified by the instructions at #R28861, #R28889, #R28921 and #R28953 to 43 (DEC ; HL), 35 (INC HL), 43 (DEC HL) or 35 (INC HL) respectively. 28991 INC HL ; Advance HL to next (or previous) byte in Attribute File *28992 DJNZ 28979 ; Decrease B (repeat count) and loop back to #R28979 if not zero 28994 INC IX ; Advance IX by two bytes in RLE attribute data... 28996 INC IX ; ... 28998 JP 28968 ; Loop back to #R28968 for this new data *29001 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29002 JP 28070 ; Advance to next Room Layout Data entry and paint its attributes ; Move down one character row *29005 EXX ; Switch registers 29006 LD A,(23496) ; Load A with one more than y-coordinate of bottom edge of area to paint... 29009 INC A ; ... 29010 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29011 INC B ; Increase B (i.e. move down a character row) *29012 PUSH BC ; Store BC (B = updated y-coordinate, C = initial x-coordinate) 29013 CP B ; If B is the same as A (i.e. we are now outside the area to be painted)... 29014 JP Z,29001 ; ...then jump to #R29001 29017 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) and load E with x-coordinate ; (characters) 29020 PUSH HL ; Store HL (new Attribute File Address) 29021 EXX ; Switch registers 29022 POP HL ; Restore HL (new Attribute File Address) 29023 JP 28992 ; Jump back to #R28992 and continue painting ; Move up one character row 29026 EXX ; Switch registers 29027 LD A,(23494) ; Load A with one less than y-coordinate of top edge of area to paint... 29030 DEC A ; ... 29031 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29032 DEC B ; Increase B (i.e. move down a character row) 29033 JP 29012 ; Jump back to #R29012 ; Store Coordinates of Area to be Coloured and Point IX at RLE Attribute (or Terrain Interaction) Data (Room ; Drawing) ; ; Used by the routines at #R28846, #R28874, #R28906, #R28938, #R29082, #R29110, #R29142 and #R29174. Input: HL ; Pointer to entry in Lookup Table for Attribute Data or Terrain Interaction Data Output: IX Points to start of RLE ; attribute data c29036 LD BC,(23493) ; Load BC with x- and y-coordinates (top-left) defined in current room layout data entry 29040 LD A,(HL) ; Load width as defined in attribute lookup data into A... 29041 ADD A,C ; ...add to x-coordinate... 29042 DEC A ; ...subtract one to get x-coordinate of right of graphic... 29043 LD (23495),A ; ...and store at #R23495 29046 INC HL ; Advance HL to height value in attribute lookup data... 29047 LD A,(HL) ; ...load into A... 29048 ADD A,B ; ...add to y-coordinate... 29049 LD (23496),A ; ...and store at #R23496 29052 INC HL ; Advance HL to address of attribute data... 29053 CALL 55735 ; ...load this address into HL... 29056 PUSH HL ; ...and copy the address from HL to IX... 29057 POP IX ; ... 29059 RET ; Return ; Skip IX Over Room Layout Data Entry for Which Painting (Attribute / Terrain Interaction) is Inappropriate ; ; Used by the routine at #R27951. Input: IX Points to start of an instruction (252 - 255) in room layout data A ; First byte of the instruction c29060 INC IX ; Advance by six bytes to start of next instruction... 29062 INC IX ; ... 29064 INC IX ; ... 29066 INC IX ; ... 29068 INC IX ; ... 29070 INC IX ; ... 29072 BIT 0,A ; If instruction number is even (i.e. instruction 252 or 254, each of which have five ; parameters)... 29074 JP Z,27989 ; ...then process next room layout instruction (jump to #R27989)... 29077 INC IX ; ...otherwise, advance by one more byte to skip over sixth parameter (on instructions 253 or ; 255)... 29079 JP 27989 ; ...and process next room layout instruction (jump to #R27989) ; Paint Room Layout Data Entry's Terrain Interaction Parameters, Applying Horizontal and Vertical Mirrors (Room ; Drawing) ; ; Used by the routine at #R28070. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) (at #R52397) Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's right c29082 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29083 LD HL,23493 ; Modify instruction at #R29220 to load x-coordinate of graphic's left edge into A... 29086 LD (29221),HL ; ...i.e. set end x-coordinate for painting right-to-left 29089 LD HL,29262 ; Modify instruction at #R28988 to jump to #R29262... 29092 LD (29225),HL ; ...i.e. advance HL up one character row in Terrain Interaction Data Table at #R24064 29095 LD A,43 ; Modify instruction at #R29227 with opcode 43 (DEC HL)... 29097 LD (29227),A ; ... 29100 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29101 CALL 29036 ; Store coordinates of area to be painted and point IX at RLE Terrain Interaction data 29104 LD BC,(23495) ; Load BC with coordinates of graphic's bottom-right 29108 JR 29200 ; Jump to terrain interaction parameter painting routine ; Paint Room Layout Data Entry's Terrain Interaction Parameters, Applying Horizontal Mirror (Room Drawing) ; ; Used by the routine at #R28070. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) (at #R51997) Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's left c29110 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29111 LD HL,23495 ; Modify instruction at #R29220 to load x-coordinate of graphic's right edge into A... 29114 LD (29221),HL ; ...i.e. set end x-coordinate for painting left-to-right 29117 LD HL,29262 ; Modify instruction at #R29224 to jump to #R29262... 29120 LD (29225),HL ; ...i.e. advance HL up one character row in Terrain Interaction Data Table at #R24064 29123 LD A,35 ; Modify instruction at #R29227 with opcode 35 (INC HL)... 29125 LD (29227),A ; ... 29128 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29129 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 29132 LD A,(23493) ; Load C with x-coordinate of graphic's left edge... 29135 LD C,A ; ... 29136 LD A,(23496) ; Load B with y-coordinate of graphic's bottom edge... 29139 LD B,A ; ... 29140 JR 29200 ; Jump to terrain interaction data painting routine ; Paint Room Layout Data Entry's Terrain Interaction Parameters, Applying Vertical Mirror (Room Drawing) ; ; Used by the routine at #R28070. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) (at #R51997) Output: B y-coordinate of graphic's top C x-coordinate of graphic's right c29142 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29143 LD HL,23493 ; Modify instruction at #R29220 to load x-coordinate of graphic's left edge into A... 29146 LD (29221),HL ; ...i.e. set end x-coordinate for painting right-to-left 29149 LD HL,29241 ; Modify instruction at #R29224 to jump to #R29241... 29152 LD (29225),HL ; ...i.e. advance HL down one character row in Terrain Interaction Data Table at #R24064 29155 LD A,43 ; Modify instruction at #R29227 with opcode 43 (DEC HL)... 29157 LD (29227),A ; ... 29160 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 29161 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 29164 LD A,(23495) ; Load C with x-coordinate of graphic's right edge... 29167 LD C,A ; ... 29168 LD A,(23494) ; Load B with y-coordinate of graphic's top edge... 29171 LD B,A ; ... 29172 JR 29200 ; Jump to terrain interaction data painting routine ; Paint Room Layout Data Entry's Terrain Interaction Parameters then Advance to Next Entry (Room Drawing) ; ; Used by the routine at #R28070. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) (at #R52397) c29174 PUSH HL ; Store HL (Pointer to entry in Lookup Table for RLE Terrain Interaction Data) 29175 LD HL,23495 ; Modify instruction at #R29220 to load x-coordinate of graphic's right edge into A... 29178 LD (29221),HL ; ...i.e. set end x-coordinate for painting left-to-right 29181 LD HL,29241 ; Modify instruction at #R29224 to jump to #R29241... 29184 LD (29225),HL ; ...i.e. advance HL down one character row in Terrain Interaction Data Table at #R24064 29187 LD A,35 ; Modify instruction at #R29227 with opcode 35 (INC HL)... 29189 LD (29227),A ; ... 29192 POP HL ; Restore HL (Pointer to entry in Lookup Table for RLE Terrain Interaction Data) 29193 CALL 29036 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 29196 LD BC,(23493) ; Load BC with x- and y-coordinates (top-left) defined in current room layout data entry ; This entry point is used by the routines at #R29082, #R29110 and #R29142. At this point, BC holds the initial ; coordinates in characters, from which to start painting terrain interaction parameters. IX points to the required ; RLE terrain interaction data. *29200 PUSH BC ; Store BC (B = current y-coordinate, C = initial x-coordinate) 29201 CALL 54162 ; Point HL at Terrain Interaction Data Table address for character coordinates x=C, y=B *29204 LD A,(IX+0) ; Load A with repeat count value 29207 OR A ; If repeat count is zero... 29208 JP Z,29237 ; ...then jump to #R29237 29211 LD B,A ; Load B with repeat count 29212 LD C,(IX+1) ; Load C with terrain interaction parameter to paint *29215 LD (HL),C ; Apply terrain interaction parameter in C to current Terrain Interaction Data Table location ; in HL 29216 LD A,L ; Load E with x-coordinate (characters) of current Terrain Interaction Data location... 29217 AND 31 ; ... 29219 LD E,A ; ... ; The operand of the instruction at #R29220 is modified by instructions at #R29086, #R29114, #R29146, #R29178, to ; #R23493 (x-coordinate of left edge), #R23495 (x-coordinate of right edge), #R23493 (x-coordinate of left edge), or ; #R23495 (x-coordinate of right edge) respectively. 29220 LD A,(23495) ; Load A with end x-coordinate for painting... 29223 CP E ; ...and if this is the same as the x-coordinate... ; The operand of the instruction at #R29224 (i.e. the destination of the jump) is modified by the instructions at ; #R29092, #R29120, #R29152 and #R29184 to be #R29262 (move up one character row), #R29262 (move up one character ; row), #R29241 (move down one character row) or #R29241 (move down one character row) respectively. 29224 JP Z,29241 ; ...then jump to routine to move up or down one character row ; The instruction at #R29227 is modified by the instructions at #R29097, #R29125, #R29157 and #R29189 to 43 (DEC ; HL), 35 (INC HL), 43 (DEC HL) or 35 (INC HL) respectively. 29227 INC HL ; Advance HL to next (or previous) byte in Terrain Interaction Data Table *29228 DJNZ 29215 ; Decrease B (repeat count) and loop back to #R29215 if not zero 29230 INC IX ; Advance IX by two bytes in RLE terrain interaction data... 29232 INC IX ; ... 29234 JP 29204 ; Loop back to #R29204 for this new data *29237 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29238 JP 28095 ; Advance IX to start of next Room Layout Data entry and jump back to #R27989 to paint its ; attributes / terrain interaction data ; Move down one character row *29241 EXX ; Switch registers 29242 LD A,(23496) ; Load A with one more than y-coordinate of bottom edge of area to paint... 29245 INC A ; ... 29246 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29247 INC B ; Increase B (i.e. move down a character row) *29248 PUSH BC ; Store BC (B = updated y-coordinate, C = initial x-coordinate) 29249 CP B ; If B is the same as A (i.e. we are now outside the area to be painted)... 29250 JP Z,29237 ; ...then jump to #R29237 29253 CALL 54162 ; Load HL with Terrain Interaction Data Table address for coordinates (C, B) and load E with ; x-coordinate (characters) 29256 PUSH HL ; Store HL (new Terrain Interaction Data Table Address) 29257 EXX ; Switch registers 29258 POP HL ; Restore HL (new Terrain Interaction Data Table Address) 29259 JP 29228 ; Jump back to #R29228 and continue painting ; Move up one character row 29262 EXX ; Switch registers 29263 LD A,(23494) ; Load A with one less than y-coordinate of top edge of area to paint... 29266 DEC A ; ... 29267 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 29268 DEC B ; Increase B (i.e. move down a character row) 29269 JP 29248 ; Jump back to #R29248 ; If Magic Knight is on The Bridge and USS Pisces is not at Gangrole then Draw Viewscreen Starfield ; ; Used by the routine at #R28101. c29272 LD A,(23701) ; If Magic Knight's current room is not 1 (USS Pisces, 1, The Bridge)... 29275 CP 1 ; ... 29277 RET NZ ; ...then return 29278 LD A,(23700) ; If the USS Pisces' current location is 20 (Gangrole)... 29281 CP 20 ; ... 29283 RET Z ; ...then return 29284 LD A,255 ; Set MASK P and MASK T system variables to 255... 29286 LD (23696),A ; ...to preserve attributes already on screen... 29289 LD (23694),A ; ... 29292 LD A,(23700) ; Load the USS Pisces' current location into H and L... 29295 LD H,A ; ...so that HL points to an address in ROM (pseudo-random data)... 29296 LD L,A ; ... 29297 LD B,50 ; Load B with 50 (as we are PLOTting 50 stars) *29299 PUSH BC ; Store BC (remaining number of stars to PLOT) *29300 INC HL ; Advance HL by one byte 29301 LD A,(HL) ; Load A with byte at HL 29302 AND 63 ; Clear bits 6 and 7 29304 CP 56 ; If this y-coordinate value is 56 or more... 29306 JP NC,29300 ; ...then loop back to #R29300 to get next byte value 29309 LD B,A ; Load this pseudo-random value (0-55) into B (y-coordinate) 29310 INC HL ; Advance HL by one byte 29311 LD A,(HL) ; Load A with byte at HL 29312 AND 127 ; Clear bit 7 29314 LD C,A ; Load this x-coordinate value (0-127) into C (x-coordinate) 29315 PUSH HL ; Store HL (current address in ROM) ; Stars are PLOTted as pixels using the ROM PLOT routine. Therefore, coordinates are relative to the bottom-left of ; the display. The x-coordinate increases towards the right of the display while the y-coordinate increases towards ; the top. Stars are always PLOTted ABOVE the planet rendered on the viewscreen, therefore the lower-left bound of ; the rectangular area for displaying stars ("Star Area") under this system is (64, 56) pixels. The upper-right ; bound is (191, 111) pixels. 29316 LD HL,14400 ; Load H and L with the y- and x-coordinates (56 and 64 pixels, respectively) of the lower-left ; of the viewscreen's "Star Area" 29319 ADD HL,BC ; Add B and C (pseudo-random values) to H and L respectively as offsets 29320 PUSH HL ; Transfer values from H (56-111) and L (64-191)... 29321 POP BC ; ...to B and C 29322 CALL 8933 ; PLOT the pixel (x=C, y=B) 29325 POP HL ; Restore HL (current address in ROM) 29326 POP BC ; Restore BC (remaining number of stars to PLOT) 29327 DJNZ 29299 ; Decrease remaining number of stars and loop back to #R29299 29329 RET ; Return ; Process Command to Pick Up an Object c29330 CALL 54333 ; Print or update Command Summary Window at top of screen 29333 LD DE,38824 ; Point DE at "PICK UP THE" text... 29336 CALL 54283 ; ...and print in Command Summary Window at top of screen 29339 LD HL,25286 ; Point HL at start of Objects' Current Positions Table 29342 LD BC,3200 ; Load B with 12 and C with 128 [bug: Should be Load B with 37 and C with 0, or LD BC, 9472] *29345 LD A,(23701) ; Load A with Magic Knight's current room 29348 CP (HL) ; If current object's room is not the same as Magic Knight's then... 29349 JR NZ,29352 ; ...skip ahead to #R29352 29351 INC C ; Increase C (count of objects in Magic Knight's current room) *29352 INC HL ; Advance HL to next object's position... 29353 INC HL ; ... 29354 INC HL ; ... 29355 DJNZ 29345 ; Decrease B and loop back for next object 29357 LD A,C ; Copy total number of objects into A... 29358 OR A ; ...and if this value is zero... [can't actually happen because of bug at #R29342] 29359 JP Z,55192 ; ...then display "THERE IS NOTHING IN THIS ROOM" Window (13), wait for fire to be pressed then ; jump to Main Game Loop 29362 LD HL,25286 ; Point HL at start of Objects' Current Positions Table 29365 LD A,(23701) ; Load A with Magic Knight's current room 29368 LD C,A ; ...and copy into C 29369 CALL 33757 ; Load Magic Knight's coordinates (in characters) into DE 29372 XOR A ; Set A to zero 29373 EX AF,AF' ; Switch A register 29374 LD B,50 ; Load B with 50 (bug - should be 37 as there are only 37 objects) *29376 LD A,C ; Load Magic Knight's current room into A 29377 CP (HL) ; If room of current object is not the same as Magic Knight's current room... 29378 JR NZ,29401 ; ...then skip ahead to #R29401 [advance to next object] 29380 LD A,D ; Copy Magic Knight's y-coordinate into A 29381 INC HL ; Advance HL to current object's y-coordinate... 29382 INC HL ; ... 29383 CP (HL) ; ...and if this is not the same as Magic Knight's y-coordinate... 29384 JR NZ,29403 ; ...then skip ahead to #R29403 [advance to next object] 29386 DEC HL ; Move HL back to object's x-coordinate 29387 LD A,E ; Load Magic Knight's x-coordinate into A 29388 DEC A ; Decrease x-coordinate by two... 29389 DEC A ; ... 29390 PUSH BC ; Store BC 29391 LD B,5 ; Load B with 5 (as we are going to test 5 different x-coordinates) *29393 CP (HL) ; If x-coordinate of object is the same as current x-coordinate value... 29394 JR Z,29412 ; ...then skip ahead to #R29412 29396 INC A ; Increase value of current x-coordinate (to test next x-coordinate in range -2 to +2) 29397 DJNZ 29393 ; Decrease B (remaining number of x-coordinates to test) and loop back to #R29393 29399 POP BC ; Restore BC 29400 DEC HL ; Move HL back one byte to start of position data for current object *29401 INC HL ; Advance HL by three bytes to move to next object... 29402 INC HL ; ... *29403 INC HL ; ... 29404 EX AF,AF' ; Switch A register back (so now contains the index of the object to test next) 29405 INC A ; Increase A [index of current object to test] 29406 EX AF,AF' ; Switch A register 29407 DJNZ 29376 ; Loop back to #R29376 for next object 29409 JP 55187 ; Display "THERE IS NOTHING NEAR ENOUGH" Window (13), wait for fire to be pressed then jump to ; Main Game Loop ; An object has been found within Magic Knight's reach so make this the current object *29412 POP BC ; Restore BC 29413 EX AF,AF' ; Switch A register (so now contains index of first object that is within Magic Knight's reach) 29414 LD (29526),A ; Load index of this object into instruction at #R29525 (i.e. set as Current Object) 29417 LD DE,33924 ; Point DE at character code to print name of Current Object 29420 CALL 54283 ; ...and print in Command Summary Window at top of screen 29423 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 29426 LD HL,25168 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 29429 LD A,(HL) ; ... 29430 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 29431 JP NZ,55165 ; ...then display "YOUR HANDS ARE FULL" window, wait for fire to be pressed then jump to Main ; Game Loop 29434 CALL 33601 ; Check whether object has a weight greater than Magic Knight's surplus strength... 29437 JP P,55177 ; ...and if it does then display "THE [name of Current Object] IS TOO HEAVY FOR YOU" Window), ; wait for fire to be pressed then jump to Main Game Loop 29440 LD A,(29526) ; Load A with index of Current Object... 29443 LD C,A ; ...and copy into C 29444 LD B,5 ; Load B with 5 (five inventory slots) 29446 LD HL,25164 ; Load object in C into Magic Knight's first empty inventory (carrying) slot... 29449 CALL 33516 ; ... 29452 LD A,(29526) ; Load A with index of Current Object... 29455 LD C,A ; ...and copy into C 29456 ADD A,A ; Multiply index by three in A... 29457 ADD A,C ; ... 29458 LD B,0 ; Load three times object index into BC... 29460 LD C,A ; ... 29461 LD HL,25286 ; Point HL at start of Objects' Current Positions Table 29464 ADD HL,BC ; Add BC as offset to point HL at position data for current object 29465 LD (HL),99 ; Set object's room to 99 ; This entry point is used by the routines at #R29488, #R29619, #R29756 and #R31537. *29467 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 29471 LD B,5 ; Load B with 5 (five inventory slots) 29473 LD HL,38809 ; Point HL at "YOU ARE NOW CARRYING" text 29476 CALL 33945 ; Display "Magic Knight's current inventory" window as an information window ; This entry point is used by the routines at #R29756, #R30145, #R31188, #R31280, #R31312, #R32895, #R33338 and ; #R33725. *29479 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed ; This entry point is used by the routines at #R29488, #R29619, #R29756, #R30145, #R30686, #R30968, #R31257, ; #R31537, #R55115 and #R55364. *29482 CALL 34265 ; Set Magic Knight's available action flags and validate I.D. Card if appropriate 29485 JP 27136 ; Jump to start of Main Game Loop ; Process Command to Drop an Object c29488 CALL 33834 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 29491 JP Z,29482 ; If MK's inventory (carrying) is empty then set his available action flags, validate I.D. Card ; if appropriate and jump to start of Main Game Loop (#R29482) 29494 LD IX,25164 ; Point IX at start of Magic Knight's current inventory (carrying) 29498 LD B,5 ; Load B with 5 (five inventory slots) 29500 LD HL,38904 ; Point HL at "DROP WHICH OBJECT ?" text 29503 LD DE,38916 ; Point DE at "DROP THE " text 29506 CALL 33952 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 29509 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 29512 CALL 33911 ; Print name of selected object in Magic Knight's current inventory (carrying) in Command ; Summary Window 29515 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 29518 BIT 1,(IY+89) ; If "USE TRANSPORTER" command is enabled (i.e. Magic Knight is standing on a transporter ; pad)... (IY = 23610) 29522 JP NZ,55349 ; ...then display "YOU CANNOT DROP THE [Object] HERE" Window (29), wait for fire to be pressed ; then jump to Main Game Loop ; The operand of the instruction at #R29525 represents the index of the Current Object used in multiple routines. ; This is modified by the instructions at #R29414 and #R33916. 29525 LD A,0 ; Load index of current object into A [Operand is index of Current Object] 29527 CP 16 ; If object is Quark Bomb... 29529 JP Z,29613 ; ...then skip ahead to #R29613 29532 LD E,0 ; Load E with 1 (prepare to check Drop Status Flag) 29534 CALL 33525 ; Point HL to byte 1 of the A-th record in Object Properties Table 29537 BIT 4,(HL) ; If object's Drop Status Flag is set... 29539 JP NZ,55197 ; ...then display "YOU CANNOT DROP THE [object]" Window (13), wait for fire to be pressed then ; jump to Main Game Loop 29542 BIT 7,(HL) ; If object's Is Breakable Flag is set... 29544 JP NZ,29597 ; ...then skip ahead to #R29597 29547 LD A,(29526) ; Load A with index of Current Object 29550 LD C,A ; Copy into C 29551 PUSH BC ; Store BC (C = index of Current Object) 29552 LD B,5 ; Load B with 5 (five inventory slots) 29554 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 29557 CALL 36254 ; Remove object C from Magic Knight's current inventory (carrying) 29560 POP BC ; Restore BC (C = index of Current Object) *29561 LD A,C ; Load current object's index into A 29562 ADD A,A ; Multiply object index by 3... 29563 ADD A,C ; ... 29564 LD C,A ; ...and load back into C 29565 LD B,0 ; Load B with zero 29567 LD HL,25286 ; Point HL at start of Objects' Current Positions Table at #R25286 29570 ADD HL,BC ; Add three times Current Object's index as offset to point HL at position data of current ; object 29571 LD A,(23701) ; Load A with Magic Knight's current room 29574 LD (HL),A ; Set object's current room to be same as Magic Knight's 29575 INC HL ; Advance HL to x-coordinate of object 29576 LD B,0 ; Set B to zero 29578 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 29581 AND 7 ; Get x-coordinate in terms of pixels within current character block (i.e. lowest 3 bits of ; x-coordinate) 29583 JR Z,29586 ; If this is zero (i.e. Magic Knight at left-most pixel in character block) then skip ahead to ; #R29586... 29585 INC B ; ...else increase B *29586 CALL 33757 ; Load Magic Knight's Coordinates (in Characters) into DE 29589 LD A,B ; Load B into A 29590 ADD A,E ; Add Magic Knight's x-coordinate to A 29591 LD (HL),A ; Set this as object's x-coordinate 29592 INC HL ; Advance HL to y-coordinate of object 29593 LD (HL),D ; Set this to same as Magic Knight's y-coordinate 29594 JP 29467 ; Show Magic Knight's current inventory and jump back to Main Game Loop *29597 LD A,(29526) ; Load A with index of Current Object 29600 LD C,A ; Copy into C 29601 LD B,5 ; Load B with 5 (five inventory slots) 29603 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 29606 CALL 36254 ; Remove object C from Magic Knight's current inventory (carrying) 29609 LD C,15 ; Set object to drop to Broken Glass 29611 JR 29561 ; Jump back to #R29561 to drop the Broken Glass *29613 LD HL,44862 ; Point HL at "YOU HAVE DESTROYED YOURSELF BY DROPPING THE..." text 29616 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Process Command to Take an Object c29619 LD HL,38647 ; Point HL at "TAKE AN OBJECT FROM ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 29622 LD DE,39015 ; Point DE (Command Summary Text Pointer) at "TAKE SOMETHING FROM" text 29625 CALL 34122 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 29628 JP Z,29482 ; If there are no characters in the room then set MK's available action flags, validate I.D. ; Card if appropriate and jump to start of Main Game Loop (#R29482) ; The operand of the instruction at #R29631 represents the index of the Current Character used in multiple routines. ; This is modified by the instructions at #R30271, #R33804, #R33814, #R33934 and #R34226. 29631 LD A,0 ; Point IX at current inventory of Current Character... 29633 CALL 33585 ; ... 29636 LD A,(IX+0) ; If the first inventory slot of the character is empty... 29639 OR A ; ... 29640 JP Z,55202 ; ...then display "[Character]'S HANDS ARE EMPTY" Window (13), wait for fire to be pressed then ; jump to Main Game Loop 29643 PUSH IX ; Store IX (start of inventory) 29645 LD B,5 ; Load B with 5 (five inventory slots) 29647 LD HL,38998 ; Point HL at "TAKE WHICH OBJECT ?" text 29650 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 29653 CALL 33952 ; Show list of objects in character's inventory as a menu and load A with selected item index 29656 PUSH AF ; Store AF (A = index of chosen object's inventory slot) 29657 CALL 54333 ; Print or update Command Summary Window at top of screen 29660 LD DE,39010 ; Point DE at "TAKE THE" text... 29663 CALL 54283 ; ...and print in Command Summary Window at top of screen 29666 POP AF ; Restore AF (A = index of chosen object's inventory slot) 29667 POP HL ; Restore HL (previously IX, pointer to current inventory of current character) 29668 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 29671 LD DE,39023 ; Point DE at " FROM" text... 29674 CALL 54283 ; ...and print in Command Summary Window at top of screen 29677 LD A,(29632) ; Load A with index of Current Character 29680 CALL 33937 ; Print character's name 29683 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 29686 LD A,253 ; Decrease Current Character's happiness by 3... 29688 CALL 33569 ; ... 29691 LD IX,44238 ; Point IX at Table of Characters' Wanted Objects 29695 CALL 33863 ; If Current Character wants Current Object... 29698 JP Z,55207 ; ...then display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for fire to be ; pressed then jump to Main Game Loop 29701 LD HL,25168 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 29704 LD A,(HL) ; ... 29705 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 29706 JP NZ,55165 ; ...then display "YOUR HANDS ARE FULL" window, wait for fire to be pressed then jump to Main ; Game Loop 29709 CALL 33601 ; Check whether object has a weight greater than Magic Knight's surplus strength... 29712 JP P,55177 ; ...and if it does then display "THE [name of Current Object] IS TOO HEAVY FOR YOU" Window, ; wait for fire to be pressed then jump to Main Game Loop 29715 CALL 33500 ; Load A with Current Character's Happiness Level... 29718 CP 30 ; and if this is less than 30... 29720 JP C,55207 ; ...then display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for fire to be ; pressed then jump to Main Game Loop 29723 LD A,(29632) ; Point IX at current inventory of Current Character... 29726 CALL 33585 ; ... 29729 PUSH IX ; Copy value from IX... 29731 POP HL ; ...to HL 29732 LD A,(29526) ; Load C with index of Current Object... 29735 LD C,A ; ... 29736 LD B,5 ; Load B with 5 (five inventory slots) 29738 CALL 36254 ; Remove object C from Current Character's inventory 29741 LD A,(29526) ; Load C with index of Current Object... 29744 LD C,A ; ... 29745 LD B,5 ; Load B with 5 (five inventory slots) 29747 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying)... 29750 CALL 33516 ; ...and load object C into the first empty slot 29753 JP 29467 ; Show Magic Knight's current inventory and jump back to Main Game Loop ; Process Command to Give an Object c29756 CALL 33834 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 29759 JP Z,29482 ; If MK's inventory (carrying) is empty then set his available action flags, validate I.D. Card ; if appropriate and jump to start of Main Game Loop (#R29482) 29762 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 29766 LD B,5 ; Load B with 5 (five inventory slots) 29768 LD HL,39065 ; Point HL at "GIVE WHICH OBJECT ?" text 29771 LD DE,39077 ; Point DE at "GIVE THE " text 29774 CALL 33952 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 29777 LD HL,25164 ; Point HL at start of Characters' Current Inventories Table 29780 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 29783 LD DE,39082 ; Point DE at "TO" text... 29786 CALL 54283 ; ...and print in Command Summary Window at top of screen 29789 LD HL,38658 ; Point HL at "GIVE AN OBJECT TO ?" text 29792 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 29795 CALL 34122 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 29798 JP Z,29482 ; If there are no characters in the room then set MK's available action flags, validate I.D. ; Card if appropriate and jump to start of Main Game Loop (#R29482) 29801 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 29804 LD IX,44251 ; Point IX at Table of Characters' Unwanted Objects 29808 CALL 33863 ; If Current Character does not want Current Object... 29811 JP Z,55222 ; ...then display "[Character] DOES NOT WANT THE [Object]" Window (13), wait for fire to be ; pressed then jump to Main Game Loop 29814 LD A,4 ; Increase Current Character's happiness by 4... 29816 CALL 33569 ; ... 29819 LD A,(29526) ; Load A with index of Current Object 29822 CP 14 ; If the selected object is the McTablet Food... 29824 JP Z,29907 ; ...then skip ahead to #R29907 29827 LD A,(29632) ; Point IX at current inventory of Current Character... 29830 CALL 33585 ; ... 29833 LD A,(IX+4) ; If last inventory slot of character is not zero... 29836 OR A ; ...(i.e. last inventory slot is occupied)... 29837 JP NZ,55212 ; ...then display "[Character]'S HANDS ARE FULL" Window (13), wait for fire to be pressed then ; jump to Main Game Loop 29840 LD BC,1280 ; Load B with 5 (five inventory slots) and C with zero *29843 LD A,(IX+0) ; Load content of current inventory slot into A 29846 OR A ; If this inventory slot is empty... 29847 JR Z,29858 ; ...then skip ahead to #R29858 29849 CALL 33487 ; Load A with weight of object in current slot... 29852 ADD A,C ; ...and add to C (running total weight)... 29853 LD C,A ; ... 29854 INC IX ; Advance to next inventory slot 29856 DJNZ 29843 ; Loop back to #R29843 for next slot *29858 LD A,(29526) ; Load A with index of Current Object 29861 CALL 33487 ; Load A with weight of object being given... 29864 ADD A,C ; ...and add this to total in C also... 29865 LD C,A ; ... 29866 LD A,(29632) ; Load A with index of Current Character 29869 LD E,0 ; Point HL at character's current strength... 29871 CALL 33541 ; ... 29874 LD A,(HL) ; Load strength into A... 29875 AND 127 ; ...and reset Bit 7 (unused) 29877 CP C ; If character's strength is less than total weight of objects... 29878 JP C,55217 ; ...then display "[Character] IS NOT STRONG ENOUGH" Window (13), wait for fire to be pressed ; then jump to Main Game Loop 29881 CALL 33500 ; Load A with Current Character's Happiness Level... 29884 CP 25 ; ...and if this is less than 25... 29886 JP C,55222 ; ...then display "[Character] DOES NOT WANT THE [Object]" Window (13), wait for fire to be ; pressed then jump to Main Game Loop 29889 LD A,(29526) ; Load A with index of Current Object... 29892 LD (IX+0),A ; ...and load this object into the character's first empty slot 29895 LD C,A ; Load index of object into C 29896 LD B,5 ; Remove object C from Magic Knight's current inventory (carrying)... 29898 LD HL,25164 ; ... 29901 CALL 36254 ; ... 29904 JP 29467 ; Show Magic Knight's current inventory and jump back to Main Game Loop *29907 CALL 33546 ; Point IX at Current Character's current stats 29910 BIT 7,(IX+6) ; If character's Asleep Flag is reset... 29914 JR Z,29930 ; ...then skip ahead to #R29930 29916 LD A,28 ; Draw Window 28... 29918 CALL 34990 ; ... 29921 LD HL,38361 ; Point HL at "[Current Character's name] IS ASLEEP" text... 29924 CALL 34762 ; ...and print to screen 29927 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *29930 LD C,25 ; Set strength increment to 25 29932 LD A,(IX+0) ; Load character's current strength into A... 29935 AND 127 ; ... 29937 CALL 53703 ; Increase value by 25, up to maximum of 100 29940 LD C,A ; Load updated strength value into C 29941 LD A,(IX+0) ; Load updated strength back into character's stats... 29944 AND 128 ; ...preserving bit 7 (see trivia) 29946 ADD A,C ; ... 29947 LD (IX+0),A ; ... 29950 LD C,20 ; Set stamina increment to 20 29952 LD A,(IX+2) ; Load character's current stamina into A... 29955 AND 127 ; ... 29957 CALL 53703 ; Increase value by 20, up to maximum of 100 29960 LD C,A ; Load updated stamina value into C 29961 LD A,(IX+2) ; Load updated stamina back into character's stats... 29964 AND 128 ; ...preserving bit 7 (see trivia) 29966 ADD A,C ; ... 29967 LD (IX+2),A ; ... 29970 LD A,(23672) ; Load A with LSB of FRAMES System Variable (pseudo-random number) 29973 AND 3 ; Discard all but lower two bits, leaving a random number between 0 - 3 (inclusive) 29975 LD B,A ; Load this number into B 29976 LD HL,44276 ; Point HL at start of Character's Responses to McTablet Flavours 29979 CALL 54269 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL 29982 LD DE,37195 ; Adjust height of window 13 to accommodate text... 29985 CALL 33774 ; ... 29988 PUSH HL ; Store HL (pointer to start of text to print) 29989 LD A,13 ; Draw Window 13... 29991 CALL 34990 ; ... 29994 POP HL ; Restore HL (pointer to start of text to print) 29995 CALL 34762 ; Print text to screen 29998 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Display and Handle Main In-Game Menu (When Fire is Pressed) ; ; Used by the routine at #R27136. c30001 CALL 35386 ; Wait for Fire Button / Key to be Released 30004 CALL 35723 ; Play downward scale sound 30007 CALL 34265 ; Set Magic Knight's available action flags and validate I.D. Card if appropriate 30010 LD BC,2048 ; Set B = 8 (eight action flags) and C = 0 (count of set flags) 30013 LD A,(23698) ; Load A with Available In-Game Menu Command Flags (part 1) *30016 RLCA ; Pop a bit into Carry Flag 30017 JR NC,30020 ; If Magic Knight action flag is not set then skip ahead to #R30020 to repeat loop for next ; flag... 30019 INC C ; ...else increase count of set flags *30020 DJNZ 30016 ; Loop back for next bit until all eight are done 30022 LD B,8 ; Set B = 8 (another eight action flags) 30024 LD A,(23699) ; Load A with Available In-Game Menu Command Flags (part 2) *30027 RLCA ; Pop a bit into Carry Flag 30028 JR NC,30031 ; If Magic Knight action flag is not set then skip ahead to #R30031 to repeat loop for next ; flag... 30030 INC C ; ...else increase count of set flags *30031 DJNZ 30027 ; Loop back for next bit until all eight are done 30033 LD A,8 ; Load A with 8 (as minimal command window has bottom y-coordinate of 8) 30035 ADD A,C ; Increase A by number of extra commands available 30036 LD C,A ; Load value back into C 30037 LD A,(37091) ; Load A with y-coordinate (characters) of top of menu window 30040 ADD A,C ; Update y-coordinate of bottom of window according to number of extra commands... 30041 LD (37092),A ; ... 30044 LD A,0 ; Display main in-game menu window (window number zero)... 30046 CALL 34982 ; ... 30049 LD HL,38685 ; Print "COMMANDS AVAILABLE:-" followed by first five commands (Pick up, drop, etc.) that are ; always available... 30052 CALL 34762 ; ... 30055 LD HL,38734 ; Point HL at zero immediately preceding list of conditional entry (Main in-Game Menu) texts 30058 LD A,(23698) ; Load A with Available In-Game Menu Command Flags (part 1) 30061 CALL 30123 ; Print currently available additional In-Game Menu command options (part 1) 30064 LD A,(23699) ; Load A with Available In-Game Menu Command Flags (part 2) 30067 CALL 30123 ; Print currently available additional In-Game Menu command options (part 2) 30070 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 30073 CP 5 ; If index of selected item is less than 5 (i.e. is a permanent, yellow entry)... 30075 JR C,30097 ; ...then skip ahead to #R30097 30077 SUB 4 ; Subtract 4 from index to get index within currently available conditional entries... 30079 LD B,A ; ...and load this value into B 30080 LD C,0 ; Load C with zero 30082 LD HL,(23698) ; Load HL with Available In-Game Menu Command Flags ; At this point, B is initialised to the index of the selected menu option among the currently available conditional ; entries. The following loop loads C with the index of the selected action's Action Flag (bit) in the WORD value at ; #R23698. *30085 RR H ; Perform 16-bit rotation (right) through HL and into Carry Flag... 30087 RR L ; ...so that Carry Flag contains "current" Action Flag 30089 INC C ; Increase C (index of current Action Flag) 30090 JR NC,30085 ; If current Action Flag is not set then loop back to #R30085... 30092 DJNZ 30085 ; ...otherwise decrease B then loop back to #R30085 30094 LD A,C ; Load index of appropriate Action Flag into A 30095 ADD A,4 ; Add 4, to restore original index value (i.e. reverse of instruction at #R30077) ; At this point, A holds either the index of the appropriate Action Flag plus four, or the index of the originally ; selected menu item if less than 5. In either case, A contains the index of the command to initiate. Code between ; #R30097 and #R30105 is not necessary; see trivia. *30097 LD HL,36749 ; Point HL at List of Command Indices 30100 LD B,A ; Load index of selected command into B, setting C to zero... 30101 LD C,0 ; ... *30103 LD A,(HL) ; If current entry in List of Command Indices is the same as the index of the selected ; command... 30104 CP B ; ... 30105 JR Z,30111 ; ...then skip ahead to #R30111 30107 INC C ; Increase C (index of command index) 30108 INC HL ; Advance HL to next command index in list 30109 JR 30103 ; Loop back to #R30103 *30111 PUSH BC ; Store BC (B = selected command index, C = index of selected command index) 30112 CALL 35690 ; Play upward scale sound 30115 POP BC ; Restore BC (B = selected command index, C = index of selected command index) 30116 LD A,C ; Load index (of selected command index) into A 30117 LD HL,36765 ; Point HL at start of Table of Command Routine Addresses 30120 JP 55726 ; Advance HL by A words, load HL with word at location HL as address and jump to it ; Print Currently Available Additional In-Game Menu Command Options ; ; Used by the routine at #R30001. Input: A Available In-Game Menu Command Flags (part 1 or part 2) HL Points to ; #R38734 if dealing with Flags part 1. Points to #R38777 if dealing with Flags part 2. c30123 LD B,8 ; Load B with 8 (as there are 8 flags) *30125 PUSH BC ; Store BC (B = remaining number of flags to process) 30126 RRCA ; Rotate least significant bit of A (i.e. current flag) into Carry Flag 30127 PUSH AF ; Store AF (current flag in Carry and remaining flags in A) 30128 CALL 54242 ; Advance HL to byte after first zero from address in HL onwards 30131 POP AF ; Restore AF (current flag in Carry and remaining flags in A) 30132 JR NC,30141 ; If current flag is reset then skip ahead to #R30141 30134 PUSH HL ; Store HL (current position in Additional Menu Items texts) 30135 PUSH AF ; Store AF (current flag in Carry and remaining flags in A) 30136 CALL 34762 ; Print text at HL (current additional menu item) 30139 POP AF ; Restore AF (current flag in Carry and remaining flags in A) 30140 POP HL ; Restore HL (current position in Additional Menu Items texts) *30141 POP BC ; Restore BC (B = remaining number of flags to process) 30142 DJNZ 30125 ; Decrease B and loop back to #R30125 for next flag 30144 RET ; Return ; Process Command to Examine Yourself / A Character / An Object / USS Pisces c30145 CALL 54333 ; Print or update Command Summary Window at top of screen 30148 LD DE,39152 ; Point DE at "EXAMINE"... 30151 CALL 54283 ; ...and print in Command Summary Window at top of screen 30154 LD A,16 ; Draw "EXAMINE WHAT?" Menu Window... 30156 CALL 34982 ; ... 30159 LD HL,39154 ; Point HL at "EXAMINE WHAT ?" menu text... 30162 CALL 34762 ; ...and print to screen 30165 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 30168 OR A ; If "OBJECT" selected... 30169 JP Z,30432 ; ...then skip ahead to #R30432 30172 CP 1 ; If "CHARACTER" selected... 30174 JP Z,30300 ; ...then skip ahead to #R30300 30177 CP 2 ; If "YOURSELF" selected... 30179 JP Z,30250 ; ...then skip ahead to #R30250 ; Examine USS Pisces 30182 LD A,17 ; Set bottom edge of Window 20 to 17... 30184 LD (37252),A ; ... 30187 LD DE,39524 ; Point DE at "USS PISCES" text... 30190 CALL 54283 ; ...and print in Command Summary Window at top of screen 30193 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30196 LD A,(23701) ; Load A with Magic Knight's current room... 30199 CP 12 ; ...and if this is at least 12... [bug: Should be CP 11] 30201 JP NC,55267 ; ...then display "YOU CANNOT EXAMINE THE USS PISCES IF..." Window (29), wait for fire to be ; pressed then jump to Main Game Loop 30204 LD A,20 ; Draw Window 20 ("EXAMINE OBJECT" / "EXAMINE USS PISCES" Window)... 30206 CALL 34990 ; ... 30209 LD HL,39283 ; Point HL at "      EXAMINE" text... 30212 CALL 34762 ; ...and print to screen 30215 LD HL,25012 ; Point HL at USS Pisces' current stats 30218 CALL 30533 ; Insert numeric stats (at HL) of USS Pisces into "Examine USS Pisces" window text 30221 LD HL,39359 ; Point HL at USS Pisces Stats text... 30224 CALL 34762 ; ...and print to screen 30227 LD C,0 ; Load C with 0 (don't apply mirror) 30229 LD A,64 ; Load A with 64 (graphic index of left half of USS Pisces Picture) 30231 LD HL,2061 ; Load H (y-coordinate) with 8 and L (x-coordinate) with 13 30234 CALL 28631 ; Draw the left half of the USS Pisces picture 30237 LD C,1 ; Load C with 1 (apply vertical mirror) 30239 LD A,64 ; Load A with 64 (graphic index of left half of USS Pisces Picture) 30241 LD HL,2065 ; Load H (y-coordinate) with 8 and L (x-coordinate) with 17 30244 CALL 28631 ; Draw the right half of the USS Pisces picture 30247 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Examine Yourself *30250 LD A,16 ; Set left edge of Window 19 ("Examine Portrait Frame") to 16... 30252 LD (37241),A ; ... 30255 LD DE,39352 ; Point DE at "YOURSELF"... 30258 CALL 54283 ; ...and print in Command Summary Window at top of screen 30261 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30264 LD A,18 ; Draw Window 18... 30266 CALL 34990 ; ... 30269 LD A,205 ; Set Current Character index to 205 (i.e. -51)... 30271 LD (29632),A ; ...as index of "MAGIC KNIGHT" text is -51 relative to start of characters' names at #R44088 30274 LD HL,47501 ; Point HL at percentage completion text 30277 LD DE,47513 ; Point DE at time left text 30280 CALL 33657 ; Insert current time and score into "Time Left" and "Percentage Completion" texts 30283 LD HL,25020 ; Point HL at start of Magic Knight's Current Stats 30286 LD A,1 ; Set Graphic Index to 1... 30288 LD (30412),A ; ...and store as operand to instruction at #R30411 30291 LD A,(25162) ; Load character's Magic Level / Attribute value into... 30294 LD (37248),A ; ...content attribute slot of Window 19 (EXAMINE Portrait Frame) 30297 JP 30353 ; Skip ahead to #R30353 (display window as in Examine Character) ; Examine Character *30300 LD A,17 ; Set left edge of Window 19 ("Examine Portrait Frame") to 17... 30302 LD (37241),A ; ... 30305 LD HL,38665 ; Point HL at "EXAMINE ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 30308 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 30311 CALL 34122 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 30314 JP Z,29482 ; If there are no characters in the room then set MK's available action flags, validate I.D. ; Card if appropriate and jump to start of Main Game Loop (#R29482) 30317 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30320 LD A,5 ; Increase Current Character's happiness by 5... 30322 CALL 33569 ; ... 30325 LD A,18 ; Draw Window 18... 30327 CALL 34990 ; ... 30330 LD A,(29632) ; Load A with index of Current Character 30333 LD E,0 ; Point HL at start of character's stats... 30335 CALL 33541 ; ... 30338 PUSH HL ; Transfer address from HL... 30339 POP IX ; ...into IX 30341 LD A,(IX+5) ; Load Character Graphic Index into A... 30344 LD (30412),A ; ...and modify operand of instruction at #R30411 to match 30347 LD A,(IX+4) ; Load character's Magic Level / Attribute value into... 30350 LD (37248),A ; ...content attribute slot of Window 19 (EXAMINE Portrait Frame) *30353 CALL 30583 ; Insert numeric stats (at HL) of a character into "EXAMINE CHARACTER" window text 30356 PUSH HL ; Store HL (points to start of character's current stats) 30357 LD HL,39187 ; Print Examine Character window text (i.e. "EXAMINE [CHARACTER] ... STRENGTH XX..." text)... 30360 CALL 34762 ; ... 30363 POP IX ; Restore IX (points to start of character's current stats) 30365 LD A,(IX+6) ; Load A with character's Asleep Flag (bit 7)... 30368 AND 128 ; ... 30370 RRCA ; Divide value (0 for awake / 128 for asleep) by 8... 30371 RRCA ; ... 30372 RRCA ; ...to give 0 for awake / 16 for asleep 30373 LD B,A ; Load this awake / asleep offset value into B 30374 LD A,(IX+7) ; Load A with index of character's Current Status Text... 30377 AND 15 ; ... 30379 ADD A,B ; Add value in B to this index to select between "awake" and "asleep" versions... 30380 LD B,A ; ...and place result back in B to get index of string required 30381 LD HL,47491 ; Point HL at start of characters' "current status" texts 30384 CALL 54269 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL... 30387 CALL 34762 ; ...and print 30390 LD A,(30412) ; If Character Graphic Index is zero... 30393 OR A ; ... 30394 JP Z,30420 ; ...then skip ahead to #R30420 30397 LD A,19 ; Draw Window 19 (EXAMINE Portrait Frame)... 30399 CALL 34990 ; ... 30402 LD BC,(23493) ; Load BC with top-left coordinate of current window 30406 LD A,71 ; Load ATTR T system variable with 71 (white INK, black PAPER, BRIGHT)... 30408 LD (23695),A ; ... ; The operand of the instruction at #R30411 represents the Character's Graphic Index. This is modified by the ; instructions at #R30288 and #R30344. 30411 LD A,0 ; Load A with character's Graphic Index... 30413 CP 1 ; ...and if this is 1 (i.e. Magic Knight)... 30415 JR Z,30423 ; ...then skip ahead to #R30423 30417 CALL 54411 ; Draw the graphic with lookup index A at character coordinates (C, B) with width = 2 ; characters and height = 4 characters *30420 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *30423 XOR A ; Draw a Graphic with Lookup Index 0 at Character Coordinates (C, B) with width = 3 characters ; and height = 4 characters... 30424 LD DE,1027 ; ...(Magic Knight Facing Right, Frame 1)... 30427 CALL 54414 ; ... 30430 JR 30420 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Examine Object *30432 CALL 33834 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 30435 JP Z,29482 ; If MK's inventory (carrying) is empty then set his available action flags, validate I.D. Card ; if appropriate and jump to start of Main Game Loop (#R29482) 30438 LD A,15 ; Set bottom edge of Window 20 to 15... 30440 LD (37252),A ; ... 30443 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 30447 LD B,5 ; Load B with 5 (five inventory slots) 30449 LD HL,39140 ; Point HL at "EXAMINE WHICH OBJECT ?" text 30452 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 30455 CALL 33952 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 30458 LD HL,25164 ; Point HL at start of Characters' Current Inventories Table 30461 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 30464 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30467 LD A,(29526) ; Load A with index of Current Object 30470 LD E,0 ; Point HL to the start of the Current Object's record in Object Properties Table... 30472 CALL 33525 ; ... 30475 PUSH HL ; Store HL (pointer to Current Object's properties) 30476 CALL 30643 ; Insert numeric / text properties of the object into "Examine Object" Window Text 30479 LD A,20 ; Draw Window 20 ("EXAMINE OBJECT" / "EXAMINE USS PISCES" Window)... 30481 CALL 34990 ; ... 30484 LD HL,39283 ; Point HL at "      EXAMINE" text... 30487 CALL 34762 ; ...and print to screen 30490 LD A,(29526) ; Load B with index of Current Object... 30493 LD B,A ; ... 30494 CALL 54266 ; ...and point HL at its entry in Table of Object Names 30497 CALL 34762 ; Print the Current Object's name 30500 LD HL,39288 ; Point HL at Object Properties text... 30503 CALL 34762 ; ...and print to screen 30506 POP IX ; Restore IX (pointer to Current Object's properties) 30508 LD A,(IX+6) ; Set content attribute of Window 21 (frame around object in "EXAMINE OBJECT" Window)... 30511 LD (37264),A ; ...to match attribute of object 30514 LD A,21 ; Draw Window 21... 30516 CALL 34990 ; ... 30519 LD BC,(23493) ; Load BC with top-left coordinate of current window 30523 INC B ; Increase y-coordinate by 1 (as object positions are based upon their bottom-left corner) 30524 LD A,(29526) ; Load A with index of Current Object 30527 CALL 36104 ; Set Terrain Interaction Data for character blocks spanned by object and draw the object 30530 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Insert Numeric Stats (at HL) of USS Pisces into "Examine USS Pisces" Window Text ; ; Used by the routine at #R30145. Input: HL Pointer to USS Pisces' Current Stats c30533 PUSH HL ; Store HL (pointer to start of USS Pisces' current stats) 30534 LD A,(HL) ; Load Life Support level into A 30535 PUSH HL ; Store HL (pointer to USS Pisces' current Life Support level) 30536 LD HL,39439 ; Point HL at position in USS Pisces Stats Text (at #R39359) at which to insert Life Support ; level... 30539 CALL 34697 ; ...and splice the value in 30542 POP HL ; Restore HL (pointer to USS Pisces' current Life Support level) 30543 INC HL ; Advance HL to USS Pisces' current Star Drive Fuel level... 30544 LD A,(HL) ; ...and load value into A 30545 PUSH HL ; Store HL (pointer to USS Pisces' current Star Drive Fuel level) 30546 LD HL,39462 ; Point HL at position in USS Pisces Stats Text (at #R39359) at which to insert Star Drive Fuel ; level... 30549 CALL 34697 ; ...and splice the value in 30552 POP HL ; Restore HL (pointer to USS Pisces' current Star Drive Fuel level) 30553 INC HL ; Advance HL to USS Pisces' current Impulse Drive level... 30554 LD A,(HL) ; ...and load value into A 30555 PUSH HL ; Store HL (pointer to USS Pisces' current Impulse Drive level) 30556 LD HL,39486 ; Point HL at position in USS Pisces Stats Text (at #R39359) at which to insert Impulse Drive ; level... 30559 CALL 34697 ; ...and splice the value in 30562 POP HL ; Restore HL (pointer to USS Pisces' current Impulse Drive level) 30563 INC HL ; Advance HL to USS Pisces' current Shields level... 30564 LD A,(HL) ; ...and load value into A 30565 PUSH HL ; Store HL (pointer to USS Pisces' current Shields level) 30566 LD HL,39506 ; Point HL at position in USS Pisces Stats Text (at #R39359) at which to insert Shields ; level... 30569 CALL 34697 ; ...and splice the value in 30572 POP HL ; Restore HL (pointer to USS Pisces' current Shields level) 30573 INC HL ; Advance HL to USS Pisces' current Transputer level... 30574 LD A,(HL) ; ...and load value into A 30575 LD HL,39519 ; Point HL at position in USS Pisces Stats Text (at #R39359) at which to insert Transputer ; level... 30578 CALL 34697 ; ...and splice the value in 30581 POP HL ; Restore HL (pointer to start of USS Pisces' current stats) 30582 RET ; Return ; Insert Numeric Stats (at HL) of a Character into "Examine Character" Window Text ; ; Used by the routine at #R30145. Input: HL Address of start of a character's current stats c30583 PUSH HL ; Store HL (address of start of character's stats) 30584 LD A,(HL) ; Load character's Strength into A... 30585 AND 127 ; ...and remove bit 7 (unused) 30587 PUSH HL ; Store HL (Strength position in character's stats) 30588 LD HL,39201 ; Point HL at start of " 99 " segment for Strength in Character's Stats Text at #R39187 30591 CALL 34697 ; Splice numeric Strength data as a string into Character's Stats Text 30594 POP HL ; Restore HL (Strength position in character's stats) 30595 INC HL ; Advance HL to Happiness position 30596 LD A,(HL) ; Load character's Happiness into A... 30597 AND 127 ; ...and remove bit 7 (unused) 30599 PUSH HL ; Store HL (Happiness position in character's stats) 30600 LD HL,39220 ; Point HL at start of " 99 " segment for Happiness in Character's Stats Text at #R39187 30603 CALL 34697 ; Splice numeric Happiness data as a string into Character's Stats Text 30606 POP HL ; Restore HL (Happiness position in character's stats) 30607 INC HL ; Advance HL to Stamina position 30608 LD A,(HL) ; Load character's Stamina into A... 30609 AND 127 ; ...and remove bit 7 (Characters Can't Move Flag [Gordon Only, see routine at #R53731]) 30611 PUSH HL ; Store HL (Stamina position in character's stats) 30612 LD HL,39237 ; Point HL at start of " 99 " segment for Stamina in Character's Stats Text at #R39187 30615 CALL 34697 ; Splice numeric Stamina data as a string into Character's Stats Text 30618 POP HL ; Restore HL (Stamina position in character's stats) 30619 INC HL ; Advance HL to Charisma position 30620 LD A,(HL) ; Load character's Charisma into A... 30621 AND 127 ; ...and remove bit 7 (Can Help Flag) 30623 PUSH HL ; Store HL (Charisma position in character's stats) 30624 LD HL,39255 ; Point HL at start of " 99 " segment for Charisma in Character's Stats Text at #R39187 30627 CALL 34697 ; Splice numeric Charisma data as a string into Character's Stats Text 30630 POP HL ; Restore HL (Charisma position in character's stats) 30631 INC HL ; Advance HL to Magic Level position 30632 LD A,(HL) ; Load character's Magic Level / attribute value into A... 30633 AND 127 ; ...and remove bit 7 (FLASH Flag) 30635 LD HL,39275 ; Point HL at start of " 99 " segment for Magic Level in Character's Stats Text at #R39187 30638 CALL 34697 ; Splice numeric Magic Level data as a string into Character's Stats Text 30641 POP HL ; Restore HL (address of start of character's stats) 30642 RET ; Return ; Insert Numeric / Text Stats of an Object into "Examine Object" Window Text ; ; Used by the routine at #R30145. Input: HL Address of start of an object's properties c30643 LD A,(HL) ; Load A with weight of the object... 30644 AND 15 ; ...stripping out flag values 30646 PUSH HL ; Store HL (address of start of object's properties) 30647 LD HL,39301 ; Point HL at numeric part of "WEIGHT" string... 30650 CALL 34697 ; ...and overwrite with weight value 30653 POP HL ; Restore HL (address of start of object's properties) 30654 LD A,147 ; Load A with (Common Word Index for text "YES") 30656 BIT 6,(HL) ; If Can Blow Flag is set... 30658 JR NZ,30661 ; ...then skip ahead to #R30661 30660 INC A ; Increase A to 148 (Common Word Index for text "NO") *30661 LD (39320),A ; Insert Common Word Index in A into the "BLOW" field of the string 30664 LD A,147 ; Load A with (Common Word Index for text "YES") 30666 BIT 5,(HL) ; If Can Read Flag is set... 30668 JR NZ,30671 ; ...then skip ahead to #R30671 30670 INC A ; Increase A to 148 (Common Word Index for text "NO") *30671 LD (39333),A ; Insert Common Word Index in A into the "READ" field of the string 30674 INC HL ; Advance HL to second byte in record 30675 LD A,147 ; Load A with (Common Word Index for text "YES") 30677 BIT 3,(HL) ; If Can Be Worn Flag is set... 30679 JR NZ,30682 ; ...then skip ahead to #R30682 30681 INC A ; Increase A to 148 (Common Word Index for text "NO") *30682 LD (39346),A ; Insert Common Word Index in A into the "WEAR" field of the string 30685 RET ; Return ; Process Command to Command a Character c30686 LD HL,38669 ; Point HL at "COMMAND ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 30689 LD DE,39574 ; Point DE (Command Summary Text Pointer) at "COMMAND " text 30692 CALL 34122 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 30695 JP Z,29482 ; If there are no characters in the room then set MK's available action flags, validate I.D. ; Card if appropriate and jump to start of Main Game Loop (#R29482) 30698 LD DE,39082 ; Point DE at "TO"... 30701 CALL 54283 ; ...and print in Command Summary Window at top of screen 30704 LD A,23 ; Draw "WHICH COMMAND DO YOU WANT TO USE?" Menu Window... 30706 CALL 34982 ; ... 30709 LD HL,39577 ; Print "WHICH COMMAND DO YOU WANT TO USE" Menu text... 30712 CALL 34762 ; ... 30715 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 30718 LD (30797),A ; Load index of selected command into operand of instruction at #R30796... 30721 LD B,A ; ...and into B 30722 CALL 54256 ; Point HL at start of B-th entry in list of "COMMAND A CHARACTER" commands at #R39626 30725 EX DE,HL ; Swap HL and DE (Command Summary Text Pointer, now at selected command string) 30726 CALL 54283 ; Print text at DE in Command Summary Window at top of screen 30729 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30732 LD A,250 ; Decrease Current Character's happiness by 6... 30734 CALL 33569 ; ... 30737 LD A,27 ; If Magic Knight is wearing the Gas Mask (27)... 30739 CALL 33640 ; ... 30742 JP Z,55322 ; ...then display "[Character] HEARS A MUFFLED VOICE..." Window (12), wait for fire to be ; pressed then jump to Main Game Loop 30745 LD A,(29632) ; Load A with index of Current Character 30748 LD E,6 ; Point HL at Current Character's Flags... 30750 CALL 33541 ; ... 30753 LD A,(HL) ; Load Flags into A 30754 AND 3 ; If Is Artificial Flag is set and Dislikes Starfleet Flag is reset... 30756 CP 2 ; ... 30758 JR Z,30791 ; ...then skip ahead to #R30791 30760 EX AF,AF' ; Switch AF and AF' (character's "Is Artificial" and "Dislikes Starfleet" flags now in A') 30761 LD A,1 ; If Magic Knight is wearing the Cloak of Invisibility (01)... 30763 CALL 33640 ; ... 30766 JP Z,55303 ; ...then display "[Character] HEARS A VOICE AND IGNORES IT" Window, and Jump to Main Game Loop 30769 EX AF,AF' ; Switch AF and AF' (character's "Is Artificial" and "Dislikes Starfleet" flags now in A) 30770 OR A ; If character is not artificial, and likes Starfleet... 30771 JR Z,30783 ; ...then skip ahead to #R30783 30773 LD A,3 ; If Magic Knight is wearing the Valid I.D. Card (03)... 30775 CALL 33640 ; ... 30778 JP Z,55317 ; ...then display "[Character] DOES NOT LIKE STARFLEET SO HE IGNORES YOU" Window (12), wait for ; fire to be pressed then jump to Main Game Loop 30781 JR 30791 ; Skip ahead to #R30791 *30783 LD A,3 ; If Magic Knight is not wearing the Valid I.D. Card (03)... 30785 CALL 33640 ; ... 30788 JP NZ,55312 ; ...then display "[Character] DOES NOT RECOGNISE YOUR AUTHORITY" Window (12), wait for fire to ; be pressed then jump to Main Game Loop *30791 LD A,7 ; Increase Current Character's happiness by 7... 30793 CALL 33569 ; ... ; The operand of the instruction at #R30796 is the index of the currently selected command from the "COMMAND A ; CHARACTER TO" menu. This is modified by the instruction at #R30718. 30796 LD A,0 ; Load A with index of selected "COMMAND A CHARACTER TO" command 30798 LD HL,30804 ; Point HL at start of Table of "Command a Character" Routine Addresses 30801 JP 55726 ; Advance HL by A words, load HL with word at location HL as address and jump to it ; Table of Routine Addresses for Magic Knight Commanding Characters b30804 DEFW 30810 ; Send Current Character to Sleep if Possible 30806 DEFW 30842 ; Wake Current Character Up if Possible 30808 DEFW 30874 ; Have a Character Help if Possible ; Send Current Character to Sleep if Possible c30810 CALL 33546 ; Point IX at Current Character's current stats 30813 BIT 7,(IX+6) ; If character's Asleep Flag is set... 30817 JP NZ,55227 ; ...then display "[Character] IS ALREADY ASLEEP" window (29), wait for fire to be pressed then ; jump to Main Game Loop 30820 LD A,(IX+2) ; If character's stamina is 70 or more... 30823 AND 127 ; ... 30825 CP 70 ; ... 30827 JP NC,55232 ; ...then display "[Character] IS TOO WAKEFUL TO SLEEP" window (29), wait for fire to be ; pressed then jump to Main Game Loop 30830 LD B,30 ; If character's happiness is less than 30 then Show "[Character] DOES NOT WANT TO BE ; COMMANDED..." and Jump to Main Game Loop... 30832 CALL 33558 ; ... 30835 SET 7,(IX+6) ; Set character's Asleep Flag 30839 JP 55354 ; Display "[Character] HAS GONE TO SLEEP" Window (29), wait for fire to be pressed then jump to ; Main Game Loop ; Wake Current Character Up if Possible c30842 CALL 33546 ; Point IX at Current Character's current stats 30845 BIT 7,(IX+6) ; If character's Asleep Flag is reset... 30849 JP Z,55242 ; ...then display "[Character] IS ALREADY AWAKE" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 30852 LD A,(IX+2) ; If character's stamina is less than 30... 30855 AND 127 ; ... 30857 CP 30 ; ... 30859 JP C,55247 ; ...then display "[Character] IS TOO TIRED TO WAKE UP" Window (29), wait for fire to be ; pressed then jump to Main Game Loop 30862 LD B,30 ; If character's happiness is less than 30 then Show "[Character] DOES NOT WANT TO BE ; COMMANDED..." and Jump to Main Game Loop... 30864 CALL 33558 ; ... 30867 RES 7,(IX+6) ; Reset character's Asleep Flag 30871 JP 55359 ; Display "[Character] HAS WOKEN UP" Window (29), wait for fire to be pressed then jump to Main ; Game Loop ; Have a Character Help if Possible c30874 CALL 33725 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 30877 LD A,32 ; Load A with 32 (ASCII code for SPACE)... 30879 LD (42169),A ; ...and append onto end of "[Character] CANNOT HELP YOU" text at #R42166 30882 CALL 33546 ; Point IX at Current Character's current stats 30885 BIT 7,(IX+3) ; If character's Can Help Flag is reset... 30889 JP Z,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 30892 LD A,(IX+2) ; If character's stamina is less than 10... 30895 AND 127 ; ... 30897 CP 10 ; ... 30899 JP C,55257 ; ...then display "[Character] IS TOO TIRED TO HELP YOU" Window (29), wait for fire to be ; pressed then jump to Main Game Loop 30902 LD B,10 ; If character's happiness is less than 10 then Show "[Character] DOES NOT WANT TO BE ; COMMANDED..." and Jump to Main Game Loop... 30904 CALL 33558 ; ... 30907 LD A,(29632) ; Load A with index of Current Character 30910 LD HL,30916 ; Point HL at start of Table of Addressed of Characters' Help Routines 30913 JP 55726 ; Advance HL by A words, load HL with word at location HL as address and jump to it ; Table of Start Addresses of Routines for Characters Being Commanded to Help b30916 DEFW 33100 ; Gordon 30918 DEFW 33140 ; Sarab 30920 DEFW 33170 ; Klink 30922 DEFW 33170 ; S3 E3 30924 DEFW 33290 ; Hooper 30926 DEFW 33304 ; Murphy 30928 DEFW 33318 ; Sharon 30930 DEFW 33332 ; Forbin 30932 DEFW 33338 ; Derby IV 30934 DEFW 33448 ; Swiftfoot 30936 DEFW 33462 ; Julie 8 30938 DEFW 33468 ; Hectorr ; Process Command to Launch Tyme Machine c30940 LD A,(23700) ; If USS Pisces' current location is Gangrole (20)... 30943 CP 20 ; ... 30945 JP Z,30954 ; ...then skip ahead to #R30954 30948 LD HL,47460 ; Point HL at "YOU AND THE TYME MACHINE CRASHED TO THE SURFACE OF..." text 30951 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu *30954 LD A,(23403) ; If Tyme Machine Charged Flag is set... 30957 AND 2 ; ... 30959 JP NZ,31468 ; ...then show "WELL DONE MAGIC KNIGHT" screen, jumping to Game Over on key-press 30962 LD HL,47406 ; Point HL at "AS YOU FELL TOWARDS GANGROLE THE TYME MACHINE OVERLOADED..." text 30965 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Process Command to Read an Object c30968 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 30972 LD B,5 ; Load B with 5 (five inventory slots) 30974 LD HL,40943 ; Point HL at "READ WHICH OBJECT ?" text 30977 LD DE,40956 ; Point DE at "READ THE " text 30980 CALL 33952 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 30983 LD HL,25164 ; Point HL at start of Characters' Current Inventories Table 30986 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 30989 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 30992 LD A,(29526) ; Load A with index of Current Object 30995 CP 24 ; If Current Object is the Starfleet Manual (24)... 30997 JP Z,31029 ; ...then skip ahead to #R31029 31000 CP 7 ; If Current Object is the Gadget X (07)... 31002 JP Z,31035 ; ...then skip ahead to #R31035 31005 LD E,0 ; Point HL at start of record for object with index A in Object Properties Table... 31007 CALL 33525 ; ... 31010 BIT 5,(HL) ; If Can Read Flag is reset... 31012 JP Z,55282 ; ...then display "THERE IS NO WRITING FOR ME TO READ" Window (12), Wait for Fire to be Pressed ; then Jump to Main Game Loop 31015 INC HL ; Advance HL to read-text index for object... 31016 INC HL ; ... 31017 INC HL ; ... 31018 LD A,(HL) ; ...and load into A 31019 AND 31 ; Clear bits 5, 6 and 7... 31021 LD B,A ; ...and load index into B 31022 CALL 54251 ; Point HL at start of B-th entry in List of Read-Texts of Readable Objects 31025 CALL 55364 ; Display Window 02 with object's read-text, wait for fire to be pressed then jump to Main Game ; Loop... ; Data block at 31028 b31028 DEFB 2 ; ... ; Routine at 31029 ; ; Used by the routine at #R30968. c31029 CALL 26926 ; Display Instructions windows 31032 JP 29482 ; Set Magic Knight's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop ; This entry point is used by the routine at #R30968. *31035 CALL 26745 ; Display and handle Gadget X Menu 31038 JP 29482 ; Set Magic Knight's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop ; Process Command to Cast a Spell c31041 CALL 54333 ; Print or update Command Summary Window at top of screen 31044 LD DE,41705 ; Point DE at "CAST A SPELL"... 31047 CALL 54283 ; ...and print in Command Summary Window at top of screen 31050 LD HL,41711 ; Point HL at byte before "WHICH SPELL DO YOU WANT TO CAST?" full menu text 31053 LD DE,37307 ; Adjust height of window 27 to accommodate text... 31056 CALL 33774 ; ... 31059 PUSH HL ; Store HL (pointer to menu text to print) 31060 LD A,27 ; Draw Menu Window 27... 31062 CALL 34982 ; ... 31065 POP HL ; Restore HL (pointer to menu text to print) 31066 CALL 34762 ; Print text to screen 31069 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 31072 LD (31105),A ; Store index of spell selected in this routine at #R31104 31075 CALL 54333 ; Print or update Command Summary Window at top of screen 31078 LD HL,41794 ; Point HL at "CAST REMOVE BARRIERS" text (i.e. first in list of "CAST [SPELL]" strings) 31081 LD A,(31105) ; Load index of spell selected into B... 31084 LD B,A ; ... 31085 CALL 54269 ; ...and advance HL to relevant "CAST [SPELL]" string 31088 EX DE,HL ; Swap DE (now points to "CAST [SPELL]" text) and HL... 31089 CALL 54283 ; ...and print in Command Summary Window at top of screen 31092 LD A,(31105) ; Load index of spell selected into A 31095 CP 2 ; If selected spell is 2 (FORTIFY CHARACTER)... 31097 JR Z,31104 ; ...then skip ahead to #R31104 31099 CP 5 ; If selected spell is not 5 (or 2, i.e. any spell except FORTIFY CHARACTER)... 31101 CALL NZ,55115 ; ...then display Execute / Reject Command window and return here if Execute chosen, else exit ; to Main Game Loop ; The operand of the instruction at #R31104 represents the index of the selected spell. This is modified by the ; instruction at #R31072. *31104 LD A,0 ; Load A with index of selected spell 31106 LD HL,31112 ; Point HL at table of Cast a Spell routine addresses 31109 JP 55726 ; Load HL with address of appropriate Cast a Spell Routine and jump to it ; Table of Cast a Spell Routine Addresses b31112 DEFW 31122 ; Remove Barriers 31114 DEFW 31188 ; Consult Oracle 31116 DEFW 31257 ; Fortify Character 31118 DEFW 31280 ; Fortify Yourself 31120 DEFW 31312 ; Lightning Bolt ; Cast Remove Barriers if Possible, else Display Failure Message c31122 LD A,(23403) ; If Barriers Removed Flag is set... 31125 AND 1 ; ... 31127 JP NZ,55262 ; ...then display "THERE ARE NO BARRIERS TO BE REMOVED HERE." Window (29), wait for fire to be ; pressed then jump to Main Game Loop 31130 LD A,(23701) ; If Magic Knight's current room is not 09 (Retreat, 2, Barrier Room)... 31133 CP 9 ; ... 31135 JP NZ,55262 ; ...then display "THERE ARE NO BARRIERS TO BE REMOVED HERE." Window (29), wait for fire to be ; pressed then jump to Main Game Loop 31138 LD A,12 ; If Magic Knight is not wearing the Magic Talisman (12)... 31140 CALL 33640 ; ... 31143 JP NZ,55332 ; ...then display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), wait for fire to be pressed ; then jump to Main Game Loop 31146 LD A,(25024) ; Load Magic Knight's current magic level into A... 31149 AND 127 ; ... 31151 CP 55 ; If this is less than 55... 31153 JP C,55332 ; ...then display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), wait for fire to be pressed ; then jump to Main Game Loop 31156 SUB 55 ; Subtract 55 from Magic Level... 31158 LD B,A ; ...and load into B 31159 LD A,(25024) ; Load A with unused bit... 31162 AND 128 ; ... 31164 OR B ; ...combine with remaining Magic Level value... 31165 LD (25024),A ; ...and store 31168 CALL 55651 ; Flash border and screen (as in cast a spell) 31171 LD A,(23403) ; Set Barriers Removed Flag... 31174 OR 1 ; ... 31176 LD (23403),A ; ... 31179 LD HL,50956 ; Set Room Layout Data Pointer address for Retreat, 2 to address of "Without Barrier" version ; of Room 09 (#R50956)... 31182 LD (50161),HL ; ... 31185 JP 55344 ; Display "THE BARRIER HAS FADED INTO NOTHINGNESS" Window (29), wait for fire to be pressed ; then jump to Main Game Loop ; Cast Consult Oracle if Possible, else Display Failure Message c31188 LD A,29 ; If Magic Knight is not carrying the Bag of Runes (29)... 31190 CALL 33645 ; ... 31193 JP NZ,55332 ; ...then display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), wait for fire to be pressed ; then jump to Main Game Loop 31196 LD A,(25024) ; Load Magic Knight's current magic level into A... 31199 AND 127 ; ... 31201 CP 30 ; If this is less than 30... 31203 JP C,55332 ; ...then display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), wait for fire to be pressed ; then jump to Main Game Loop 31206 SUB 30 ; Subtract 30 from Magic Level... 31208 LD B,A ; ...and load into B 31209 LD A,(25024) ; Load A with unused bit... 31212 AND 128 ; ... 31214 OR B ; ...combine with remaining Magic Level value... 31215 LD (25024),A ; ...and store (see trivia) 31218 LD A,(23471) ; If index of previous "Consult Oracle" text shown is not 9... 31221 CP 9 ; ... 31223 JR NZ,31227 ; ...then skip ahead to #R31227 31225 LD A,255 ; Load A with 255 (will be "increased" to zero in next instruction) *31227 INC A ; Increase value of A (index of next "Consult Oracle" text to show)... 31228 LD (23471),A ; ...and store 31231 LD B,A ; Load B with text index 31232 LD HL,45949 ; Point HL at start of list of "Consult Oracle" texts at #R45949 31235 CALL 54269 ; Advance HL to B-th entry in this list 31238 LD DE,37323 ; Adjust height of window 29 to accommodate text... 31241 CALL 33774 ; ... 31244 PUSH HL ; Store HL (pointer to start of text to print) 31245 LD A,29 ; Draw Window 29... 31247 CALL 34990 ; ... 31250 POP HL ; Restore HL (pointer to start of text to print) 31251 CALL 34762 ; Print the text 31254 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Cast Fortify Character if Possible, else Display Failure Message c31257 LD HL,38674 ; Point HL at "FORTIFY?" text (to append to title of Character Selection Menu) 31260 LD DE,41814 ; Point DE at "CAST FORTIFY SPELL ON " (Command Summary Text Pointer) 31263 CALL 34122 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 31266 JP Z,29482 ; If there are no characters in the room then set MK's available action flags, validate I.D. ; Card if appropriate and jump to start of Main Game Loop (#R29482) 31269 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 31272 CALL 33546 ; Point IX at Current Character's current stats... 31275 PUSH IX ; ...and copy address into HL... 31277 POP HL ; ... 31278 JR 31283 ; Jump to #R31283 (fortify stats at HL and return to Main Game Loop) ; Cast Fortify Yourself if Possible, else Display Failure Message Input: HL (Entry at #R31283 only) Pointer to a ; character's current stats c31280 LD HL,25020 ; Point HL at Magic Knight's current stats ; This entry point is used by the routine at #R31257. *31283 LD B,4 ; Load B with 4 (as we are fortifying four stats) *31285 LD C,25 ; Load C with 25 (increment for stats) 31287 LD A,(HL) ; Load current stat into A... 31288 CALL 53703 ; ...increment A by 25, capping at 100... 31291 LD (HL),A ; ...and store 31292 INC HL ; Advance HL to next stat 31293 DJNZ 31285 ; Decrease B (remaining number of stats to fortify) and loop back to #R31285 31295 LD A,(25024) ; Load B with unused bit... 31298 AND 128 ; ... 31300 LD B,A ; ... 31301 XOR A ; Set A (Magic Level) to zero (see trivia) 31302 OR B ; Recombine unused bit... 31303 LD (25024),A ; ...and store 31306 CALL 55651 ; Flash border and screen (as in cast a spell) 31309 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Cast Lightning Bolt if Possible, else Display Failure Message c31312 LD A,(25024) ; Load Magic Knight's current magic level into A... 31315 AND 127 ; ... 31317 CP 65 ; If this is less than 65... 31319 JP C,55332 ; ...then display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), wait for fire to be pressed ; then jump to Main Game Loop 31322 SUB 65 ; Subtract 65 from Magic Level... 31324 LD B,A ; ...and load into B 31325 LD A,(25024) ; Load A with unused bit... 31328 AND 128 ; ... 31330 OR B ; ...combine with remaining Magic Level value... 31331 LD (25024),A ; ...and store 31334 CALL 55651 ; Flash border and screen (as in cast a spell) 31337 LD HL,46894 ; Point HL at "YOUR LIGHTNING BOLT HAS ALERTED THE SECURITY SYSTEM..." text 31340 LD A,(23701) ; Load A with Magic Knight's current room 31343 CP 7 ; If Magic Knight's current room is Retreat, 0, "Murphy's Moon" (07)... 31345 JP Z,55685 ; ...then jump to "Game over" window routine and return to Control Selection Menu 31348 CP 8 ; If Magic Knight's current room is Retreat, 1 (08)... 31350 JP Z,55685 ; ...then jump to "Game over" window routine and return to Control Selection Menu 31353 CP 21 ; If Magic Knight's current room is Monopole, 0, "Hooper's Emergency Exit" (21)... 31355 JP Z,55685 ; ...then jump to "Game over" window routine and return to Control Selection Menu 31358 CP 22 ; If Magic Knight's current room is Monopole, 1, "This Way to Hooper ==>>" (22)... 31360 JP Z,55685 ; ...then jump to "Game over" window routine and return to Control Selection Menu 31363 CP 24 ; If Magic Knight's current room is not USS Pisces, 6A, "The Control Column" (24)... 31365 JR NZ,31392 ; ...then skip ahead to #R31392 31367 LD A,(23403) ; If Tyme Machine Charged Flag is set... 31370 AND 2 ; ... 31372 JR NZ,31392 ; ...then skip ahead to #R31392 31374 OR 3 ; Set Tyme Machine Charged and Barriers Removed flags... (bug) 31376 LD (23403),A ; ... 31379 LD A,(23397) ; Increase Bonus Score by 10... 31382 ADD A,10 ; ... 31384 LD (23397),A ; ... 31387 LD HL,46682 ; Point HL at "YOUR LIGHTNING BOLT HAS HIT THE ANCIENT TYME MACHINE..." text 31390 JR 31449 ; Display text in message window and return to Main Game Loop *31392 LD HL,46598 ; Point HL at "YOU HAVE THROWN A LIGHTNING BOLT BUT..." text 31395 LD A,(23701) ; Load B with Magic Knight's current room... 31398 LD B,A ; ... 31399 LD A,(25340) ; Load A with current room of Part of a Sundial (1)... 31402 CP B ; ...and if this is not the same as Magic Knight's current room... 31403 JR NZ,31449 ; ...then display text in message window and return to Main Game Loop 31405 LD A,(25343) ; Load A with current room of Part of a Sundial (2)... 31408 CP B ; ...and if this is not the same as Magic Knight's current room... 31409 JR NZ,31449 ; ...then display text in message window and return to Main Game Loop 31411 LD A,(25346) ; Load A with current room of Part of a Sundial (3)... 31414 CP B ; ...and if this is not the same as Magic Knight's current room... 31415 JR NZ,31449 ; ...then display text in message window and return to Main Game Loop 31417 LD A,99 ; Set current room of three Sundial parts to 99 (i.e. out of game area)... 31419 LD (25340),A ; ... 31422 LD (25343),A ; ... 31425 LD (25346),A ; ... 31428 LD A,B ; Load A with Magic Knight's current room... 31429 LD (25325),A ; ...and set this as the current room of the Golden Sundial of Alpha 31432 LD HL,(25344) ; Copy x- and y-coordinates of Part of a Sundial (2)... 31435 LD (25326),HL ; ...to Golden Sundial of Alpha 31438 LD A,(23397) ; Increase Bonus Score by 10... 31441 ADD A,10 ; ... 31443 LD (23397),A ; ... 31446 LD HL,46804 ; Point HL at "THE SEGMENTS OF THE GOLDEN SUNDIAL OF ALPHA..." text *31449 LD DE,37323 ; Adjust height of Window 29 to accommodate text... 31452 CALL 33774 ; ... 31455 PUSH HL ; Store HL (pointer to start of text to print) 31456 LD A,29 ; Draw Window 29... 31458 CALL 34990 ; ... 31461 POP HL ; Restore HL (pointer to start of text to print)... 31462 CALL 34762 ; ...and print 31465 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Show "WELL DONE MAGIC KNIGHT" Screen, Jumping to Game Over on Key-Press ; ; Used by the routine at #R30940. c31468 IM 1 ; Set Interrupt Mode 1 31470 LD A,(23397) ; Increase Bonus Score by 5... 31473 ADD A,5 ; ... 31475 LD (23397),A ; ... 31478 CALL 55651 ; Flash border and screen (as in cast a spell) 31481 LD HL,16384 ; Blank out top two thirds of Display File... 31484 LD DE,16385 ; ... 31487 LD BC,4095 ; ... 31490 LD (HL),L ; ... 31491 LDIR ; ... 31493 LD A,71 ; Load A with 71 (white INK, black PAPER, BRIGHT)... 31495 CALL 35677 ; ...and flood Attribute File with this attribute 31498 LD A,22 ; Draw Window 22... 31500 CALL 34990 ; ... 31503 LD HL,38366 ; Point HL at "WELL DONE..." text... 31506 CALL 34762 ; ...and print to screen 31509 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 31512 LD (25160),HL ; ... 31515 LD HL,19320 ; Set Magic Knight's x-coordinate to 120 and y-coordinate to 75... 31518 LD (25156),HL ; ... 31521 XOR A ; Set unused data at #R25158 to zero... 31522 LD (25158),A ; ... 31525 CALL 53150 ; Store background attributes if appropriate, then draw Magic Knight to display 31528 CALL 54575 ; If keypress was enqueued then load A with index of last key pressed, otherwise wait for ; keypress and load A with index 31531 LD HL,44571 ; Point HL at "YOU HAVE ESCAPED FROM THE FUTURE..." text 31534 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Process Command to Wear / Unwear an Object c31537 LD A,11 ; Draw Window 11... 31539 CALL 34982 ; ... 31542 LD HL,41830 ; Point HL at Wear/Unwear Menu text... 31545 CALL 34762 ; ...and print to screen 31548 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 31551 JR NZ,31627 ; If UNWEAR selected then skip ahead to #R31627 31553 CALL 33834 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 31556 JP Z,29482 ; If MK's inventory (carrying) is empty then set his available action flags, validate I.D. Card ; if appropriate and jump to start of Main Game Loop (#R29482) 31559 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 31563 LD B,5 ; Load B with 5 (five inventory slots) 31565 LD HL,41848 ; Point HL at "WEAR WHICH OBJECT ?" text 31568 LD DE,41841 ; Point DE at "WEAR THE " text 31571 CALL 33952 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 31574 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 31577 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 31580 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 31583 LD HL,25173 ; If last slot in Magic Knight's current inventory (wearing) is not empty... 31586 LD A,(HL) ; ... 31587 OR A ; ... 31588 JP NZ,55170 ; ...then display "YOU ARE WEARING TOO MUCH" Window (13), wait for fire to be pressed then jump ; to Main Game Loop 31591 LD A,(29526) ; Load A with index of Current Object 31594 LD E,1 ; If object's Can Wear Flag is reset... 31596 CALL 33525 ; ... 31599 BIT 3,(HL) ; ... 31601 JP Z,55182 ; ...then display "YOU CANNOT WEAR THAT" Window (13), wait for fire to be pressed then jump to ; Main Game Loop 31604 LD A,(29526) ; Load C with index of Current Object... 31607 LD C,A ; ... 31608 LD B,5 ; Load B with 5 (five inventory slots) 31610 PUSH BC ; Store BC (B = number of slots to process, C = Current Object) 31611 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 31614 CALL 36254 ; Remove object C from this inventory 31617 POP BC ; Restore BC (B = number of slots to process, C = Current Object) 31618 LD HL,25169 ; Point HL at Magic Knight's current inventory (wearing)... 31621 CALL 33516 ; ...and load object C into the first empty slot 31624 JP 29467 ; Show Magic Knight's current inventory and jump back to Main Game Loop *31627 CALL 33824 ; Display "YOU ARE NOT WEARING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (wearing) is empty 31630 JP Z,29482 ; If MK's inventory (wearing) is empty then set his available action flags, validate I.D. Card ; if appropriate and jump to start of Main Game Loop (#R29482) 31633 LD IX,25169 ; Point IX at Magic Knight's current inventory (wearing) 31637 LD B,5 ; Load B with 5 (five inventory slots) 31639 LD HL,41846 ; Point HL at "UNWEAR WHICH OBJECT ?" text 31642 LD DE,41839 ; Point DE at "UNWEAR THE " text 31645 CALL 33952 ; Show list of objects in Magic Knight's inventory (wearing) as a menu and load A with selected ; item index 31648 LD HL,25169 ; Point HL at Magic Knight's current inventory (wearing) 31651 CALL 33911 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 31654 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 31657 LD HL,25168 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 31660 LD A,(HL) ; ... 31661 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 31662 JP NZ,55165 ; ...then display "YOUR HANDS ARE FULL" window, wait for fire to be pressed then jump to Main ; Game Loop 31665 LD A,(29526) ; Load C with index of Current Object... 31668 LD C,A ; ... 31669 LD B,5 ; Load B with 5 (five inventory slots) 31671 PUSH BC ; Store BC (B = number of slots to process, C = Current Object) 31672 LD HL,25169 ; Point HL at Magic Knight's current inventory (wearing) 31675 CALL 36254 ; Remove object C from Magic Knight's current inventory (wearing) 31678 POP BC ; Restore BC (B = number of slots to process, C = Current Object) 31679 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying)... 31682 CALL 33516 ; ...and load Object C into the first empty slot 31685 JP 29467 ; Show Magic Knight's current inventory and jump back to Main Game Loop ; Process Command to Move Starship c31688 LD A,255 ; Set MASK P and MASK T system variables to 255... 31690 LD (23696),A ; ...to preserve attributes already on screen... 31693 LD (23694),A ; ... 31696 CALL 54333 ; Print or update Command Summary Window at top of screen 31699 LD DE,41888 ; Point DE at "MOVE THE STARSHIP TO"... 31702 CALL 54283 ; ...and print in Command Summary Window at top of screen 31705 LD A,(23700) ; Load D with USS Pisces' Current Location... 31708 LD D,A ; ... 31709 LD HL,53329 ; Point HL at Starship Location Connectivity Data 31712 LD BC,16384 ; Load B with 64 and C with zero *31715 LD A,(HL) ; Load current location index in Starship Location Connectivity Data into A... 31716 CP D ; ...and if this is the same as the USS Pisces' Current Location... 31717 JR Z,31723 ; ...then skip ahead to #R31723 31719 INC HL ; Advance HL to next location index 31720 INC C ; Increase C 31721 DJNZ 31715 ; Loop back to #R31715 *31723 LD A,C ; Load C (index of index of USS Pisces' Current Location!) into instruction at #R31766 as ; operand... 31724 LD (31767),A ; ... 31727 LD BC,9 ; Load BC with 9 31730 OR A ; Reset Carry Flag 31731 SBC HL,BC ; Move HL back nine bytes to cell to current location's north-west 31733 LD DE,23436 ; Point DE at the List of Currently Available Destinations 31736 LD B,3 ; Load B with 3 *31738 PUSH BC ; Store BC (B = current repeat counter) 31739 LD A,(HL) ; Copy entry from Starship Location Connectivity Data to List of Currently Available ; Destinations... 31740 LD (DE),A ; ... 31741 INC DE ; Advance List of Currently Available Destinations pointer 31742 INC HL ; Advance Starship Location Connectivity Data pointer east one unit 31743 LD A,B ; If repeat counter is 2... 31744 CP 2 ; ... 31746 JR Z,31751 ; ...then skip ahead to #R31751 (skip over current location as we are already here!) 31748 LD A,(HL) ; Copy entry from Starship Location Connectivity Data to List of Currently Available ; Destinations... 31749 LD (DE),A ; ... 31750 INC DE ; Advance List of Currently Available Destinations pointer *31751 INC HL ; Advance Starship Location Connectivity Data pointer east one unit 31752 LD A,(HL) ; Copy entry from Starship Location Connectivity Data to List of Currently Available ; Destinations... 31753 LD (DE),A ; ... 31754 INC DE ; Advance List of Currently Available Destinations pointer 31755 LD BC,6 ; Advance Starship Location Connectivity Data pointer by 6 bytes (i.e. south one and west two ; units)... 31758 ADD HL,BC ; ... 31759 POP BC ; Restore BC (B = current repeat counter) 31760 DJNZ 31738 ; Loop back to #R31738 for next iteration 31762 LD IX,23436 ; Point IX at start of List of Currently Available Destinations 31766 LD A,0 ; Load A with index of index of USS Pisces' Current Location as stored by instruction at ; #R31723 31768 CP 8 ; If index is less than 8 (i.e. already on northern-most row of grid)... 31770 JP C,32200 ; ...then remove starship destination entries for locations to the north-west, north and ; north-east 31773 CP 24 ; If index is 24 or more (i.e. already on southern-most row of grid)... 31775 JP NC,32213 ; ...then remove starship destination entries for locations to the south-west, south and ; south-east ; This entry point is used by the routines at #R32200 and #R32213. *31778 LD A,(31767) ; Load A with index of index of USS Pisces' Current Location as stored by instruction at ; #R31723 31781 AND 7 ; If lowest three bits are reset... 31783 OR A ; ...(i.e. already on western-most column of grid)... 31784 JP Z,32226 ; ...then remove starship destination entries for locations to the north-west, west and ; south-west 31787 CP 7 ; If lowest three bits are set (i.e. already on eastern-most column of grid)... 31789 JP Z,32239 ; ...then remove starship destination entries for locations to the north-east, east and ; south-east ; This entry point is used by the routines at #R32226 and #R32239. Code here compacts the List of Currently ; Available Destinations at #R23436 by removing mid-list zeroes. *31792 LD HL,23436 ; Point HL at start of List of Currently Available Destinations 31795 LD DE,23436 ; Point DE at start of List of Currently Available Destinations 31798 LD BC,2048 ; Set B = 8 (as List of Currently Available Destinations can have at most eight entries) and C ; = 0 *31801 LD A,(HL) ; If current Available Destination List entry is zero... 31802 OR A ; ... 31803 JR Z,31808 ; ...then skip ahead to #R31808 (advance HL to next list position) 31805 LD (DE),A ; Set byte at DE to value read from HL 31806 INC C ; Increase C (current number of entries in tidied list) 31807 INC DE ; Advance DE to next list position *31808 INC HL ; Advance HL to next list position 31809 DJNZ 31801 ; Decrease B (remaining list entries to process) and loop back to #R31801 31811 LD A,9 ; Load A with 9... 31813 ADD A,C ; ...plus number of entries in List of Currently Available Destinations 31814 PUSH BC ; Store BC (C = number of available destinations) 31815 LD (37292),A ; Set y-coordinate of bottom of "WHERE TO ?" Window (Window 25) to value stored in A 31818 LD A,1 ; Set Initial (and minimum allowed) y-coordinate of Hand Cursor to 1 for Window 25... 31820 LD (37295),A ; ... 31823 LD A,25 ; Draw "WHERE TO?" Menu Window... 31825 CALL 34982 ; ... 31828 LD HL,41899 ; Point HL at "WHERE TO ?" text... 31831 CALL 34762 ; ...and print to screen 31834 POP BC ; Restore BC (C = number of available destinations) ; Print list of available destinations as options in "WHERE TO ?" Window 31835 LD HL,23436 ; Point HL at start of List of Currently Available Destinations 31838 LD B,C ; Load B with number of available destinations *31839 LD A,(HL) ; Load location index from current position in List of Currently Available Destinations 31840 PUSH HL ; Store HL (current position in List of Currently Available Destinations) 31841 PUSH BC ; Store BC (B = remaining number of available destinations) 31842 PUSH AF ; Store AF (A = index of a location read from destinations list) 31843 LD HL,38351 ; Move cursor to start of next character row within window, then right by two characters... 31846 CALL 34762 ; ... 31849 POP AF ; Restore AF (A = index of a location read from destinations list) 31850 LD B,A ; Load B with location index... 31851 CALL 54261 ; ...and point HL at that location's name 31854 CALL 34762 ; Print the location's name in the menu window 31857 POP BC ; Restore BC (B = remaining number of available destinations) 31858 POP HL ; Restore HL (current position in List of Currently Available Destinations) 31859 INC HL ; Advance HL to next location in list 31860 DJNZ 31839 ; Loop back to #R31839 to print next name in list 31862 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 31865 LD C,A ; Load BC with index of selected destination... 31866 LD B,0 ; ... 31868 LD HL,23436 ; Point HL at start of List of Currently Available Destinations... 31871 ADD HL,BC ; ...and advance to entry for selected destination 31872 LD A,(HL) ; Store this location index as operand of instruction at #R32034... 31873 LD (32035),A ; ... 31876 LD B,A ; Load B with location's index 31877 CALL 54261 ; Point HL at the location's name 31880 EX DE,HL ; Switch HL and DE (DE now points to location's name)... 31881 CALL 54283 ; ...and print in Command Summary Window at top of screen 31884 LD DE,38233 ; Point DE at "AT"... 31887 CALL 54283 ; ...and print in Command Summary Window at top of screen 31890 LD DE,37291 ; Point DE at y-coordinate of top edge of Window 25... 31893 LD A,14 ; ...and set this window's height to 14... 31895 CALL 33782 ; ... 31898 LD A,2 ; Set Initial (and minimum allowed) y-coordinate of Hand Cursor to 2 for Window 25... 31900 LD (37295),A ; ... 31903 LD A,25 ; Draw Menu Window 25... 31905 CALL 34982 ; ... 31908 LD HL,41928 ; Point HL at "MOVE STARSHIP" Speed Selection Menu Heading text... 31911 CALL 34762 ; ...and print to screen 31914 LD HL,41943 ; Point HL at "MOVE STARSHIP" Speed Selection Menu Options text... 31917 CALL 34762 ; ...and print to screen 31920 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 31923 LD (23484),A ; Store selected speed index at #R23484 31926 LD HL,41984 ; Point HL at start of list of Speed Strings 31929 LD B,A ; Load B with index of selected speed 31930 CALL 54269 ; Advance HL to B-th entry in list of Speed Strings 31933 EX DE,HL ; Switch HE and DE (DE now points to Speed String for selected speed)... 31934 CALL 54283 ; ...and print in Command Summary Window at top of screen 31937 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 31940 CALL 33788 ; If Gordon and Sarab are both asleep then reset Zero Flag, otherwise increase their happiness ; by five if not 31943 JP NZ,55291 ; If Zero Flag is reset then display "GORDON AND SARAB ARE BOTH ASLEEP" Window (12), wait for ; fire to be pressed then jump to Main Game Loop 31946 LD A,27 ; If Magic Knight is wearing the Gas Mask (27)... 31948 CALL 33640 ; ... 31951 JP Z,55327 ; ...then display "GORDON AND SARAB CANNOT UNDERSTAND YOU" Window (12), wait for fire to be ; pressed then jump to Main Game Loop 31954 CALL 36415 ; Reset all stars to point of origin and generate new velocities and movement data 31957 LD A,189 ; Set Current Starship Location in " LOCATION : [name of Current Starship Location]" text at ; #R38298... 31959 LD (38307),A ; ...to "IN TRANSIT" (189) 31962 CALL 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data 31965 CALL 32065 ; Scroll viewscreen content down 24 pixel rows then display acceleration / deceleration effect ; (i.e. leave orbit) 31968 LD A,(23484) ; Load A with selected speed index... 31971 NEG ; ...multiply by minus one... 31973 ADD A,10 ; ...and add 10 to give a delay constant between 1 (fastest) to 10 (slowest) 31975 LD (36350),A ; Update operand to instruction at #R36349 to hold delay constant value 31978 LD A,(23484) ; Load A with selected speed index plus one... 31981 INC A ; ... 31982 ADD A,A ; Load E with this value multiplied by eight... 31983 ADD A,A ; ... 31984 ADD A,A ; ... 31985 LD E,A ; ... 31986 LD BC,1 ; Load B with zero and C (remaining number of blocks of 256 timesteps to process) with 1 *31989 PUSH BC ; Store BC (B = remaining number of timesteps to process) 31990 PUSH DE ; Store DE (E = eight times [speed index + 1]) 31991 CALL 36321 ; Advance positions of stars on viewscreen by one timestep 31994 POP DE ; Restore DE (E = eight times [speed index + 1]) 31995 LD A,(23435) ; Load A with fraction remaining of current unit of star drive fuel 31998 SUB E ; Subtract E (eight times [speed index + 1])... 31999 LD (23435),A ; ...and store 32002 JR NC,32017 ; If unit of star drive fuel was not completely depleted then skip ahead to #R32017 32004 LD A,(25013) ; Decrease USS Pisces' Star Drive Fuel by one... 32007 DEC A ; ... 32008 LD (25013),A ; ... 32011 LD HL,44953 ; Point HL at "YOU RAN OUT OF STAR DRIVE FUEL..." text 32014 JP Z,55685 ; If no star drive fuel remains then jump to "Game over" window routine and return to Control ; Selection Menu *32017 POP BC ; Restore BC (B = remaining number of timesteps to process) 32018 DJNZ 31989 ; Decrease remaining number of timesteps to process and loop back to #R31989 if not zero 32020 DEC C ; Decrease C (remaining number of blocks of 256 timesteps to process) 32021 JR NZ,31989 ; If C is not zero (i.e. there are more blocks of timesteps to process) then loop back to ; #R31989 32023 CALL 35782 ; Play "USS Pisces has Arrived" sound 32026 CALL 32124 ; Display acceleration / deceleration effect then scroll viewscreen content up 24 pixel rows ; (i.e. enter orbit) 32029 LD A,28 ; Set Current Starship Location in " LOCATION : [name of Current Starship Location]" text at ; #R38298... 32031 LD (38307),A ; ...to the name of the Current Starship Location (28) ; The operand of the instruction at #R32034 represents the selected destination from the "MOVE STARSHIP" command. ; This is modified by the instruction at #R31873. 32034 LD A,0 ; Load A with selected destination location index... 32036 LD (23700),A ; ...and set this as the USS Pisces' current location 32039 CP 5 ; If A is 5 (i.e. location is Starbase 1)... 32041 CALL Z,32055 ; ...then set unknown flag and set A to zero 32044 CP 27 ; If A is 27 (location index of Starbase 2 in 128k version)... (see trivia) 32046 CALL Z,32055 ; ...then set unknown flag and set A to zero 32049 CALL 27703 ; Draw Top In-Game Window 32052 JP 55277 ; Display "THE STARSHIP HAS ARRIVED AT [Starship Location]" Window (12), wait for fire to be ; pressed then jump to Main Game Loop ; Set Unknown Flag ; ; Used by the routine at #R31688. Output: A Always zero c32055 LD A,(23402) ; Set Unknown / Unused Flag 1... 32058 OR 1 ; ... 32060 LD (23402),A ; ... 32063 XOR A ; Set A to zero 32064 RET ; Return ; Scroll Viewscreen Content Down 24 Pixel Rows then Display Acceleration / Deceleration Effect (i.e. Leave Orbit) ; ; Used by the routine at #R31688. c32065 LD HL,6151 ; Set left and right x-coordinates of region to scroll to 7 and 24 (characters) respectively... 32068 LD (23489),HL ; ... 32071 LD HL,36416 ; Set top and bottom y-coordinates of region to scroll to 64 and 142 (pixels) respectively... 32074 LD (23491),HL ; ... 32077 LD DE,25877 ; Point DE at end of temporary storage area (i.e. last pixel-row's data) 32080 LD B,24 ; Load B with 24 (number of pixels to scroll viewscreen content down) *32082 PUSH BC ; Store BC (B = remaining number of pixels to scroll viewscreen content down) 32083 PUSH DE ; Store DE (address of current position in temporary storage area) 32084 HALT ; Wait for two interrupts... 32085 HALT ; ... 32086 CALL 55436 ; Scroll a region of the Display File down a pixel row without wrapping 32089 POP DE ; Restore DE (address of current position in temporary storage area) 32090 PUSH DE ; Store DE (address of current position in temporary storage area) 32091 LD HL,22055 ; Point HL at 7th pixel row of character block at 7, 17 (left-most byte of bottom pixel row of ; viewscreen contents) 32094 LD BC,18 ; Load B with 18 (as viewscreen contents are 18 characters wide) and C with zero 32097 LDIR ; Copy bitmap data in bottom pixel row of viewscreen content to temporary storage area 32099 LD HL,20423 ; Point HL at Display File address for pixel row two above top of planet graphic (leftmost ; character in viewscreen content) 32102 LD DE,18439 ; Point DE at Display File address for top pixel row in viewscreen content (leftmost character ; block) 32105 LD BC,18 ; Copy viewscreen content bitmap data from pixel row two above top of planet graphic to top ; pixel row in viewscreen content... 32108 LDIR ; ... 32110 POP HL ; Restore HL (address of current position in temporary storage area, was previously in DE) 32111 OR A ; Reset Carry Flag 32112 LD BC,18 ; Move HL back 18 bytes... 32115 SBC HL,BC ; ... 32117 EX DE,HL ; Swap DE (now points to current position in temporary storage area) and HL 32118 POP BC ; Restore BC (B = remaining number of pixels to scroll viewscreen content down) 32119 DJNZ 32082 ; Decrease remaining number of pixel rows to scroll viewscreen content down, and loop back to ; #R32082 if not zero 32121 JP 35828 ; Display acceleration / deceleration effect on USS Pisces viewscreen and return ; Display Acceleration / Deceleration Effect then Scroll Viewscreen Content Up 24 Pixel Rows (i.e. Enter Orbit) ; ; Used by the routine at #R31688. c32124 CALL 35828 ; Display acceleration / deceleration effect on USS Pisces viewscreen 32127 LD A,(32035) ; Load A with selected destination 32130 CALL 32158 ; Prepare viewscreen for USS Pisces' arrival at destination 32133 LD HL,25463 ; Point HL at start of temporary storage area 32136 LD B,24 ; Load B with 24 (number of pixels to scroll viewscreen content up) *32138 PUSH BC ; Store BC (B = remaining number of pixels to scroll viewscreen content up) 32139 HALT ; Wait for two interrupts... 32140 HALT ; ... 32141 LD DE,22055 ; Point DE at 7th pixel row of character block at 7, 17 (left-most byte of bottom pixel row of ; viewscreen contents) 32144 LD BC,18 ; Load B with 18 (as viewscreen contents are 18 characters wide) and C with zero 32147 LDIR ; Copy bitmap data in temporary storage area to bottom pixel row of viewscreen content 32149 PUSH HL ; Store HL (current position in temporary storage area) 32150 CALL 55401 ; Scroll viewscreen contents up a pixel row without wrapping 32153 POP HL ; Restore HL (current position in temporary storage area) 32154 POP BC ; Restore BC (B = remaining number of pixels to scroll viewscreen content up) 32155 DJNZ 32138 ; Decrease B (remaining number of pixels to scroll viewscreen content up) and loop back to ; #R32138 if not zero 32157 RET ; Return ; Prepare Viewscreen for USS Pisces' Arrival at Destination ; ; Used by the routine at #R32124. Input: A A destination index c32158 ADD A,A ; Double destination index... 32159 LD C,A ; ...and load into BC... 32160 LD B,0 ; ... 32162 LD HL,25398 ; Point HL at first attribute entry in Table of Current Planetary Data... 32165 ADD HL,BC ; ...and add BC as offset 32166 LD A,(HL) ; Load A with attribute of planet at new location 32167 LD (52196),A ; Set colour of planet on viewscreen to this value 32170 LD (35948),A ; Prepare to fill a region with the attribute in A 32173 LD HL,6151 ; Set left and right x-coordinates of region to scroll to 7 and 24 (characters) respectively... 32176 LD (23489),HL ; ... 32179 LD HL,36416 ; Set top and bottom y-coordinates of region to scroll to 64 and 142 (pixels) respectively... 32182 LD (23491),HL ; ... 32185 LD HL,2055 ; Set top-left of area to fill to (7, 8) (characters)... 32188 LD (23493),HL ; ... 32191 LD HL,4376 ; Set bottom-right of area to fill to (24, 17) (characters)... 32194 LD (23495),HL ; ... 32197 JP 35940 ; Fill a region of Attribute File with specified attribute and return ; Remove Starship Destination Entries for Locations to the North-West, North and North-East ; ; Used by the routine at #R31688. c32200 XOR A ; Set three bytes from IX onwards to zero... 32201 LD (IX+0),A ; ...i.e. remove connectivity to the north-west... 32204 LD (IX+1),A ; ...north... 32207 LD (IX+2),A ; ...and north-east 32210 JP 31778 ; Return to "MOVE STARSHIP" routine ; Remove Starship Destination Entries for Locations to the South-West, South and South-East ; ; Used by the routine at #R31688. c32213 XOR A ; Set three bytes from IX+5 onwards to zero... 32214 LD (IX+5),A ; ...i.e. remove connectivity to the south-west... 32217 LD (IX+6),A ; ...south... 32220 LD (IX+7),A ; ...and south-east 32223 JP 31778 ; Return to "MOVE STARSHIP" routine ; Remove Starship Destination Entries for Locations to the North-West, West and South-West ; ; Used by the routine at #R31688. c32226 XOR A ; Relative to IX, set bytes 0, 3 and 5 to zero... 32227 LD (IX+0),A ; ...i.e. remove connectivity to the north-west... 32230 LD (IX+3),A ; ...west... 32233 LD (IX+5),A ; ...and south-west 32236 JP 31792 ; Return to "MOVE STARSHIP" routine ; Remove Starship Destination Entries for Locations to the North-East, East and South-East ; ; Used by the routine at #R31688. c32239 XOR A ; Relative to IX, set bytes 2, 4 and 7 to zero... 32240 LD (IX+2),A ; ...i.e. remove connectivity to the north-east... 32243 LD (IX+4),A ; ...east... 32246 LD (IX+7),A ; ...and south-east 32249 JP 31792 ; Return to "MOVE STARSHIP" routine ; Process Command to Use Transporter c32252 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 #R37089... 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 ; Set ATTR T system variable to 127 (white INK, white PAPER, BRIGHT)... 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 #R42171 32300 LD DE,18440 ; Load D with 72 (pixels) and E with 8 (characters) 32303 CALL 32694 ; Handle vertical scrolling digit selection for x-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 #R42171 32309 LD DE,18442 ; Load D with 72 (pixels) and E with 10 (characters) 32312 CALL 32694 ; Handle vertical scrolling digit selection for x-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 #R42171 32318 LD A,78 ; Set ATTR T system variable to 78 (yellow INK, blue PAPER, BRIGHT)... 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 #R32521 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 #R32360 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 #R32360 32357 ADD HL,BC ; Advance HL by eight bytes to next transporter pad entry 32358 JR 32346 ; Loop back to #R32346 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 #R42171... 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 #R32449 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 #R32482 32373 LD A,(42176) ; Load A with ASCII y-coordinate value from "YOU HAVE ARRIVED AT..." text at #R42171 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 #R32482 32381 LD A,(42178) ; Load A with ASCII z-coordinate value from "YOU HAVE ARRIVED AT..." text at #R42171 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 #R32482 32389 INC HL ; Advance HL to transporter pad's room 32390 LD A,(HL) ; Set operand of instruction at #R32427 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 #R32417 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 #R32422 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 #R32417 is Magic Knight's new x-coordinate. This is modified by the instructions ; at #R32396 and #R32472. 32417 LD A,0 ; Set Magic Knight's x-coordinate (pixels) to transporter pad arrival point 32419 LD (25156),A ; ... ; The operand of the instruction at #R32422 is Magic Knight's new y-coordinate. This is modified by the instructions ; at #R32401 and #R32477. 32422 LD A,0 ; Set Magic Knight's y-coordinate (pixels) to transporter pad arrival point 32424 LD (25157),A ; ... ; The operand of the instruction at #R32427 is the index of the room to move Magic Knight into. This is modified by ; the instructions at #R32391 and #R32467. 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), wait for fire to be pressed then jump to ; Main Game Loop *32449 LD A,(42176) ; Load A with y-coordinate value (as ASCII character code) from "YOU HAVE ARRIVED AT..." text ; at #R42171... 32452 CP 48 ; ...and if this is not 48 ("0")... 32454 JP NZ,32482 ; ...then skip ahead to #R32482 32457 LD A,(42178) ; Load A with z-coordinate value (as ASCII character code) from "YOU HAVE ARRIVED AT..." text ; at #R42171 32460 CP 48 ; ...and if this is not 48 ("0")... 32462 JP NZ,32482 ; ...then skip ahead to #R32482 32465 LD A,2 ; Set operand of instruction at #R32427 to 2 (USS Pisces, 2, The Transporter Room)... 32467 LD (32428),A ; ... 32470 LD A,120 ; Set operand of instruction at #R32417 to 120 (x-coordinate of middle of USS Pisces' ; transporter pad)... 32472 LD (32418),A ; ... 32475 LD A,120 ; Set operand of instruction at #R32422 to 120 (y-coordinate of USS Pisces' transporter pad)... 32477 LD (32423),A ; ... 32480 JR 32404 ; Jump back to #R32404 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 #R32501 (display GAME OVER message and return to Control Selection Menu) ; Table of Transporter Pad Data ; ; Eight values: b32543 DEFB 3,49,56,52,21,16,120,0 ; Monopole, "1", "8", "4", Monopole, 0 (Hooper's Emergency Exit), (16, 120) 32551 DEFB 5,49,50,51,11,16,120,0 ; Starbase 1, "1", "2", "3", Starbase 1, 0 (The Transporter Room), (16, 120) 32559 DEFB 14,56,57,54,16,16,120,0 ; Outpost, "8", "9", "6", Outpost, 0 (Ye Olde Transporter), (16, 120) 32567 DEFB 17,56,52,49,7,16,120,0 ; Retreat, "8", "4", "1", Retreat, 0 (Murphy's Moon), (16, 120) 32575 DEFB 99,90 ; End Marker ; Table of Transporter Pad Locations ; ; In order to set the "USE TRANSPORTER" Menu Command Flag when Magic Knight is standing on a transporter pad, his ; coordinates need to be checked against a list of pad locations. For each pad, this list contains an entry ; specifying the pad's room number, the x-coordinates of its left and right edges and a y-coordinate. If, for any ; entry, Magic Knight's room number matches the value in byte 0, his x-coordinate is between the values specified in ; bytes 1 and 2, and his y-coordinate is the same as in byte 3 then the "USE TRANSPORTER" Menu Command Flag will be ; set. b32577 DEFB 90,90,1,1 ; Unused / Start Marker 32581 DEFB 2,88,152,120 ; USS Pisces, 2 (The Transporter Room) 32585 DEFB 7,16,40,120 ; Retreat, 0 (Murphy's Moon) 32589 DEFB 11,16,40,120 ; Starbase 1, 0 (The Transporter Room) 32593 DEFB 16,16,40,120 ; Outpost, 0 (Ye Olde Transporter) 32597 DEFB 21,16,40,120 ; Monopole, 0 (Hooper's Emergency Exit) 32601 DEFB 255 ; End Marker ; Update and Increment Predefined Region's Attribute 64 Times (Transporter Effect) ; ; Used by the routine at #R32252. c32602 LD B,64 ; Load B with 64 as we are changing the attribute of the filled area 64 times *32604 PUSH BC ; Store BC (B = remaining number of attribute changes) 32605 HALT ; Wait for interrupt 32606 LD A,(35948) ; Load A with old fill attribute 32609 ADD A,8 ; Add 8 to increment PAPER colour 32611 AND 120 ; Ensure that attribute value is capped at 120 (white PAPER, BRIGHT) and mask out INK and FLASH ; bits 32613 LD (35948),A ; Store updated attribute value 32616 CALL 35940 ; Fill a region of Attribute File with specified attribute 32619 POP BC ; Restore BC (B = remaining number of attribute changes) 32620 DJNZ 32604 ; Decrease B and loop back to #R32604 if not zero 32622 RET ; Return ; Set Top-Left and Bottom-Right of Area to Cycle Attributes (for Transporter Effect) ; ; Used by the routine at #R32252. c32623 LD HL,2571 ; Set top-left of area for transporter effect to (11, 10) characters... 32626 LD (23493),HL ; ... 32629 LD HL,4628 ; Set bottom-right of area for transporter effect to (20, 18) characters... 32632 LD (23495),HL ; ... 32635 LD A,(23701) ; If Magic Knight's current room is 2 (USS Pisces, 2, The Transporter Room)... 32638 CP 2 ; ... 32640 RET Z ; ...then return 32641 LD HL,2561 ; Set top-left of area for transporter effect to (1, 10) characters... 32644 LD (23493),HL ; ... 32647 LD HL,4613 ; Set bottom-right of area for transporter effect to (5, 18) characters... 32650 LD (23495),HL ; ... 32653 LD A,(23701) ; If Magic Knight's current room is not 36 (index of "YE OLDE TRANSPORTER" room in 128k version ; - see trivia) 32656 CP 36 ; ... 32658 RET NZ ; ...then return 32659 LD HL,4870 ; Set top-left of area for transporter effect to (6, 19) characters... 32662 LD (23493),HL ; ... 32665 LD HL,5640 ; Set bottom-right of area for transporter effect to (8, 22) characters... 32668 LD (23495),HL ; ... 32671 RET ; Return ; ASCII Digit Sequences for "Enter Transport Coordinates" Routine b32672 DEFB 0 32673 DEFM "0123456789" 32683 DEFM "0123456789" 32693 DEFB 0 ; Handle Vertical Scrolling Digit Selection (Use Transporter Menu) and Load Selected Digit's ASCII Code into A ; ; Used by the routine at #R32252. Input: D y-coordinate in pixels E x-coordinate in characters Output: A ASCII ; code of selected digit c32694 LD IX,32683 ; Point IX at start of second ASCII digit sequence for transport coordinate selection 32698 LD A,E ; Set x-coordinate of left and right of region to scroll to value in E (6, 8 or 10 characters ; depending upon value in E)... 32699 LD (23489),A ; ... 32702 LD (23490),A ; ... 32705 LD A,D ; Set y-coordinate of top of region to scroll to value in D (72 pixels)... 32706 LD (23491),A ; ... 32709 ADD A,39 ; Set y-coordinate of bottom of region to scroll to value in D plus 39 (pixels)... 32711 LD (23492),A ; ... *32714 CALL 54942 ; Capture keyboard or joystick input loading result into A 32717 BIT 2,A ; If up was pressed... 32719 JR NZ,32761 ; ...then skip ahead to #R32761 32721 BIT 3,A ; If down was pressed... 32723 JR NZ,32814 ; ...then skip ahead to #R32814 32725 BIT 4,A ; If fire was not pressed... 32727 JR Z,32714 ; ...then jump back to #R32714 32729 PUSH IX ; Store IX (current position in digit sequence) 32731 LD A,(23489) ; Load C with x-coordinate of left and right of region to scroll (characters)... 32734 LD C,A ; ... 32735 LD A,(23491) ; Load A with y-coordinate of top of region to scroll (pixels)... 32738 ADD A,16 ; ...plus 16 32740 RRCA ; Divide result by 8... 32741 RRCA ; ... 32742 RRCA ; ... 32743 LD B,A ; ...and load result (y-coordinate of "selected" coordinate value in characters) into B 32744 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B)... 32747 LD (HL),71 ; ...and apply attribute 71 (white INK, black PAPER, BRIGHT) 32749 CALL 35690 ; Play upward scale sound 32752 CALL 35723 ; Play downward scale sound 32755 POP IX ; Restore IX (current position in digit sequence) 32757 LD A,(IX+0) ; Load (ASCII code of) currently selected digit into A 32760 RET ; Return ; Up pressed *32761 LD B,8 ; Load B with 8, as we are scrolling by eight pixels *32763 PUSH BC ; Store BC (B = remaining number of pixels to scroll) 32764 PUSH IX ; Store IX (current position in digit sequence) 32766 CALL 32886 ; Make a click sound (reset Port 254 EAR Bit, wait for interrupt then set EAR Bit of Port 254) 32769 CALL 55408 ; Scroll a region of the Display File up a pixel row with wrapping 32772 CALL 32886 ; Make a click sound (reset Port 254 EAR Bit, wait for interrupt then set EAR Bit of Port 254) 32775 POP IX ; Restore IX (current position in digit sequence) 32777 POP BC ; Restore BC (B = remaining number of pixels to scroll) 32778 DJNZ 32763 ; Decrease B (remaining number of pixels to scroll) and loop back to #R32763 if not zero 32780 INC IX ; Increase IX to point to next digit in sequence 32782 LD A,(IX+2) ; Load digit that is two after current one into A... 32785 OR A ; ...and if this is zero (end marker)... 32786 CALL Z,32867 ; ...then subtract ten from IX to wrap from 9 to 0 32789 LD A,(23489) ; Load C with x-coordinate of left and right of region to scroll (characters)... 32792 LD C,A ; ... 32793 LD A,(23492) ; Load A with y-coordinate of bottom of region to scroll (pixels)... 32796 RRCA ; ...divide by 8... 32797 RRCA ; ... 32798 RRCA ; ... 32799 AND 31 ; ...cap at 31 to give y-coordinate in characters, one character below bottom of the three ; visible "scrolling" digits... 32801 LD B,A ; ...and load result into B 32802 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 32805 LD A,(IX+2) ; Load A with digit two after currently selected one ; By this point, the system variable ATTR T has been set to 127 (white INK, white PAPER, BRIGHT) by the instruction ; at #R32286, so the character is printed but is invisible. 32808 CALL 54097 ; Print character in A 32811 JP 32714 ; Loop back to #R32714 for next keyboard / joystick input ; Down pressed *32814 LD B,8 ; Load B with 8, as we are scrolling by eight pixels *32816 PUSH BC ; Store BC (B = remaining number of pixels to scroll) 32817 PUSH IX ; Store IX (current position in digit sequence) 32819 CALL 32886 ; Make a click sound (reset Port 254 EAR Bit, wait for interrupt then set EAR Bit of Port 254) 32822 CALL 55442 ; Scroll a region of the Display File down a pixel row with wrapping 32825 CALL 32886 ; Make a click sound (reset Port 254 EAR Bit, wait for interrupt then set EAR Bit of Port 254) 32828 POP IX ; Restore IX (current position in digit sequence) 32830 POP BC ; Restore BC (B = remaining number of pixels to scroll) 32831 DJNZ 32816 ; Decrease B (remaining number of pixels to scroll) and loop back to #R32816 if not zero 32833 DEC IX ; Decrease IX to point to previous digit in sequence 32835 LD A,(IX-2) ; Load digit that is two before current one into A... 32838 OR A ; ...and if this is zero (end marker)... 32839 CALL Z,32880 ; ...then add ten to IX to wrap from 0 to 9 32842 LD A,(23489) ; Load C with x-coordinate of left and right of region to scroll (characters)... 32845 LD C,A ; ... 32846 LD A,(23491) ; Load A with y-coordinate of top of region to scroll (pixels)... 32849 RRCA ; ...divide by 8... 32850 RRCA ; ... 32851 RRCA ; ... 32852 AND 31 ; ...cap at 31 to give y-coordinate in characters, one character above top of the three visible ; "scrolling" digits... 32854 LD B,A ; ...and load result into B 32855 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 32858 LD A,(IX-2) ; Load A with digit two before currently selected one ; By this point, the system variable ATTR T has been set to 127 (white INK, white PAPER, BRIGHT) by the instruction ; at #R32286, so the character is printed but is invisible. 32861 CALL 54097 ; Print character in A 32864 JP 32714 ; Loop back to #R32714 for next keyboard / joystick input ; Subtract Ten from IX ; ; Used by the routine at #R32694. Input: IX A value Output: IX The input value minus 10 c32867 LD BC,10 ; Load B with 10 32870 XOR A ; Reset Carry Flag 32871 PUSH IX ; Transfer value from IX to HL... 32873 POP HL ; ... 32874 SBC HL,BC ; Subtract 10 from HL 32876 PUSH HL ; Transfer value from HL to IX... 32877 POP IX ; ... 32879 RET ; Return ; Add Ten to IX ; ; Used by the routine at #R32694. Input: IX A value Output: IX The input value plus 10 c32880 LD BC,10 ; Load B with 10 32883 ADD IX,BC ; Add to IX 32885 RET ; Return ; Reset Port 254 EAR Bit, Wait for Interrupt then Set EAR Bit of Port 254 ; ; Used by the routine at #R32694. c32886 XOR A ; Reset all bits of Port 254 (including EAR bit)... 32887 OUT (254),A ; ... 32889 HALT ; Wait for interrupt 32890 LD A,16 ; Set EAR bit of Port 254... 32892 OUT (254),A ; ... 32894 RET ; Return ; Process Command to Communicate c32895 LD A,(23700) ; Load B with USS Pisces' current location... 32898 LD B,A ; ... 32899 LD HL,48004 ; Point HL at start of Planets' "REQUEST HELP" Strings 32902 CALL 54269 ; Advance HL to "REQUEST HELP" string for current location 32905 LD A,(HL) ; Load first byte of data (usually height of text) into A... 32906 OR A ; ...and if this zero (i.e. the current location is not valid for communication)... 32907 JP Z,55298 ; ...then display "THERE IS NOBODY WITHIN SUB-SPACE COMMUNICATOR RANGE" Window (12), wait for ; fire to be pressed then jump to Main Game Loop 32910 CALL 54333 ; Print or update Command Summary Window at top of screen 32913 LD DE,42180 ; Point DE at "COMMUNICATE WITH"... 32916 CALL 54283 ; ...and print in Command Summary Window at top of screen 32919 LD HL,42191 ; Point HL at "CHOOSE COMMUNICATION" menu text 32922 LD DE,37091 ; Adjust height of Main Menu (Game) / "Choose Communication" Window to accommodate text... 32925 CALL 33774 ; ... 32928 PUSH HL ; Store HL (pointer to start of text to print) 32929 XOR A ; Draw "Choose Communication" Menu Window... 32930 CALL 34982 ; ... 32933 POP HL ; Restore HL (pointer to start of text to print) 32934 CALL 34762 ; Print text to screen 32937 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 32940 LD (32984),A ; Store index of selected menu item as operand of instruction at #R32983... 32943 LD B,A ; ...and load into B 32944 LD HL,42300 ; Point HL at "REQUEST HELP" text 32947 CALL 54269 ; Advance HL to "REFUEL STARSHIP" text if refuel option was selected 32950 EX DE,HL ; Swap HL and DE (DE now points to "REQUEST HELP" or "REFUEL STARSHIP" text)... 32951 CALL 54283 ; ...and print in Command Summary Window at top of screen 32954 CALL 55115 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 32957 CALL 33788 ; If Gordon and Sarab are both asleep then reset Zero Flag, otherwise increase their happiness ; by five if not 32960 JP NZ,55291 ; If Zero Flag is reset then display "GORDON AND SARAB ARE BOTH ASLEEP" Window (12), wait for ; fire to be pressed then jump to Main Game Loop 32963 LD A,27 ; If Magic Knight is wearing the Gas Mask (27)... 32965 CALL 33640 ; ... 32968 JP Z,55327 ; ...then display "GORDON AND SARAB CANNOT UNDERSTAND YOU" Window (12), wait for fire to be ; pressed then jump to Main Game Loop 32971 LD A,1 ; Set Draw Communicate Window / Face Flag... 32973 LD (23461),A ; ... 32976 CALL 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data 32979 XOR A ; Reset Draw Communicate Window / Face Flag... 32980 LD (23461),A ; ... ; The operand of the instruction at #R32983 represents the index of the option selected from "CHOOSE COMMUNICATION" ; menu. This is modified by the instruction at #R32940. 32983 LD A,0 ; Load A with selected menu option index 32985 CP 1 ; If "REFUEL STARSHIP" was selected... 32987 JP Z,33019 ; ...then skip ahead to #R33019 ; Request Help Option Selected 32990 LD A,(23700) ; Load B with index of USS Pisces' current location... 32993 LD B,A ; ... 32994 LD HL,48004 ; Point HL at start of Planets' "REQUEST HELP" Strings 32997 CALL 54269 ; Advance HL to B-th entry in this list 33000 LD DE,37211 ; Adjust height of Window 15 to accommodate text... 33003 CALL 33774 ; ... 33006 PUSH HL ; Store HL (pointer to start of text to print) 33007 LD A,15 ; Draw Window 15... 33009 CALL 34990 ; ... 33012 POP HL ; Restore HL (pointer to start of text to print) 33013 CALL 34762 ; Print text to screen *33016 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Refuel Starship Option Selected *33019 LD A,1 ; Draw Window 1... 33021 CALL 34990 ; ... 33024 LD HL,42216 ; Point HL at "REFUEL STARSHIP REQUESTED" text... 33027 CALL 34762 ; ...and print to screen 33030 LD A,(23700) ; Load BC with double index of USS Pisces' current location... 33033 ADD A,A ; ... 33034 LD C,A ; ... 33035 LD B,0 ; ... 33037 LD HL,25397 ; Point HL at start of Current Planetary Data... 33040 ADD HL,BC ; ...and add BC as offset 33041 LD B,200 ; Load B with 200 (as USS Pisces can hold 200 units of fuel) 33043 LD A,(HL) ; Load A with current location's available fuel level... 33044 OR A ; ...and if this is zero... 33045 JP Z,33084 ; ...then skip ahead to #R33084 33048 CP 255 ; If available fuel level is 255 (i.e. unlimited)... 33050 JP Z,33072 ; ...then skip ahead to #R33072 33053 LD B,A ; Load B with current location's available fuel level 33054 LD A,(25013) ; Load A with USS Pisces' current Star Drive Fuel level *33057 CP 200 ; If A is 200... 33059 JR Z,33067 ; ...then skip ahead to #R33067 33061 INC A ; Increase A (USS Pisces' fuel) by one 33062 DEC B ; Decrease B (planet's fuel) by one 33063 JR Z,33093 ; If B is zero then skip ahead to #R33093 33065 JR 33057 ; Loop back to #R33057 *33067 LD (HL),B ; Store updated (i.e. reduced) value for planet's fuel 33068 LD B,A ; Load B with USS Pisces' new fuel level 33069 LD HL,42282 ; Point HL at "THE USS PISCES IS FULLY REFUELED" text... *33072 LD HL,42282 ; ... (see trivia) *33075 LD A,B ; Set USS Pisces' new fuel level... 33076 LD (25013),A ; ... 33079 CALL 34762 ; Print text to screen 33082 JR 33016 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *33084 LD HL,42226 ; Point HL at "SORRY MAGIC KNIGHT WE ARE OUT OF FUEL" text... 33087 CALL 34762 ; ...and print to screen 33090 JP 33016 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *33093 LD (HL),B ; Store updated (i.e. zero) value for planet's fuel 33094 LD HL,42240 ; Point HL at "...WE DO NOT HAVE ENOUGH FUEL..." text 33097 LD B,A ; Load B with USS Pisces' new fuel level 33098 JR 33075 ; Jump back to #R33075 ; "Command Character to Help" Routine for Gordon c33100 LD E,31 ; If Current Character is carrying the Pewter Tankard (31)... 33102 CALL 33896 ; ... 33105 JR Z,33113 ; ...then skip ahead to #R33113 33107 LD HL,39947 ; Point HL at "I WOULD LIKE YOU TO FETCH MY TANKARD..." text 33110 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop *33113 LD A,(23700) ; If the USS Pisces is not currently at Starbase 1 (05)... 33116 CP 5 ; ... 33118 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33121 LD A,(23451) ; If Transporter Repaired Flag is set... 33124 BIT 0,A ; ... 33126 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33129 OR 1 ; Set Transporter Repaired Flag... 33131 LD (23451),A ; ... 33134 LD HL,39995 ; Point HL at "I HAVE RE-ROUTED THE TRANSPORTER CONTROL SYSTEM..." text 33137 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Sarab c33140 LD HL,25174 ; If Gordon is carrying the Star Map... 33143 LD A,6 ; ... 33145 CALL 33648 ; ... 33148 JR Z,33156 ; ...then skip ahead to #R33156 33150 LD HL,40067 ; Point HL at "GORDON WILL NEED THE STARMAP..." text 33153 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop *33156 LD A,(23451) ; If Transporter Repaired Flag is set... 33159 BIT 0,A ; ... 33161 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33164 LD HL,40180 ; Point HL at "REPAIRS ARE NEEDED..." text 33167 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Klink and S3 E3 c33170 LD A,(29632) ; Load A with index of Current Character... 33173 LD (23434),A ; ...and store at #R23434 (see trivia) 33176 LD A,3 ; If Magic Knight is wearing the Valid I.D. Card (03)... 33178 CALL 33640 ; ... 33181 JP Z,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33184 LD A,(23451) ; If I.D. Card Validated Flag is reset... 33187 BIT 4,A ; ... 33189 JP Z,33195 ; ...then skip ahead to #R33195 33192 JP 55252 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then jump to ; Main Game Loop *33195 LD E,8 ; If Current Character is not carrying the Camera (8)... 33197 CALL 33896 ; ... 33200 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33203 LD E,4 ; If Current Character is not carrying the Instant Film (4)... 33205 CALL 33896 ; ... 33208 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33211 LD A,(29632) ; Load BC with five times index of Current Character... 33214 LD C,A ; ... 33215 ADD A,A ; ... 33216 ADD A,A ; ... 33217 ADD A,C ; ... 33218 LD C,A ; ... 33219 LD B,0 ; ... 33221 LD IX,25174 ; Point IX at start of Characters' Current Inventories Table... 33225 ADD IX,BC ; ...and add BC as offset to point to start of Current Character's inventory 33227 LD A,(IX+4) ; If this character has no free inventory slots... 33230 OR A ; ... 33231 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33234 LD (33282),IX ; Modify operand of the instruction at #R33281 to address of start of Current Character's ; current inventory 33238 LD A,1 ; If Magic Knight is not wearing the Cloak of Invisibility (01)... 33240 CALL 33640 ; ... 33243 JR NZ,33259 ; ...then skip ahead to #R33259 33245 LD A,(23451) ; If Photograph of Inside of Starship Taken Flag is set... 33248 BIT 1,A ; ... 33250 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33253 LD B,2 ; Load B with 2 (as Photograph of Inside of Starship Taken Flag is in bit 1) 33255 LD A,9 ; Load A with 9 (index of Photograph of inside of starship) 33257 JR 33271 ; Skip ahead to #R33271 *33259 LD A,(23451) ; If Photograph of Magic Knight Taken Flag is set... 33262 BIT 2,A ; ... 33264 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33267 LD B,4 ; Load B with 4 (as Photograph of Magic Knight Taken Flag is in bit 2) 33269 LD A,5 ; Load A with 5 (index of Photograph of Magic Knight) *33271 LD C,A ; Load C with object index from A 33272 LD A,(23451) ; Load A with current Score Progress Flags 33275 OR B ; Set Flag(s) according to value in B... 33276 LD (23451),A ; ... 33279 LD B,5 ; Load B with 5 (five inventory slots) ; The operand of the instruction at #R33281 represents the address of the start of the current inventory of the ; Current Character. This is modified by the instruction at #R33234. 33281 LD HL,0 ; Point HL at start of Current Character's current inventory as stored previously 33284 CALL 33516 ; Load object C into the first empty inventory slot of Current Character 33287 JP 55339 ; Display "[Character] HAS TAKEN YOUR PHOTO" Window (10), wait for fire to be pressed then jump ; to Main Game Loop ; "Command Character to Help" Routine for Hooper c33290 LD E,29 ; If Current Character is not carrying the Bag of Runes (29)... 33292 CALL 33896 ; ... 33295 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33298 LD HL,40326 ; Point HL at "I REMEMBER WHEN YOU COULD BUY..." text 33301 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Murphy c33304 LD E,30 ; If Current Character is not carrying the Bag of Potatoes (30)... 33306 CALL 33896 ; ... 33309 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33312 LD HL,40414 ; Point HL at "THE GOLDEN SUNDIAL OF ALPHA WAS SPLIT..." text 33315 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Sharon c33318 LD E,23 ; If Current Character is not carrying the Chocolate Heart (23)... 33320 CALL 33896 ; ... 33323 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33326 LD HL,40489 ; Point HL at "THANKS FOR THE HEART BIG BOY!..." text 33329 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Forbin c33332 LD HL,40562 ; Point "SHARONN WANTS TO KNOW..." text 33335 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Derby IV c33338 LD A,(23451) ; If Blank I.D. Card Obtained Flag is set... 33341 BIT 3,A ; ... 33343 JR NZ,33421 ; ...then skip ahead to #R33421 33345 OR 8 ; Set Blank I.D. Card Obtained Flag... 33347 LD (23451),A ; ... 33350 LD HL,25292 ; Point HL at current position of Blank I.D. Card... 33353 LD (HL),3 ; ...and set its room to 03 (USS Pisces, 3, The Transputer Room) 33355 LD DE,37307 ; Point DE at height data for Window 27 33358 LD HL,45236 ; Point HL at "HELLO MAGIC KNIGHT. AS A TEMPORALY MISPLACED..." text 33361 CALL 33774 ; Adjust height of window (pointed to by DE) to accommodate text 33364 PUSH HL ; Store HL (pointer to start of text to print) 33365 LD A,27 ; Draw Window 27... 33367 CALL 34990 ; ... 33370 POP HL ; Restore HL (pointer to start of text to print) 33371 CALL 34762 ; Print text to screen 33374 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 33377 LD DE,37227 ; Load DE with address of y-coordinate of top edge of Window 17 in Window Data Table at #R37089 33380 LD HL,45395 ; Point HL at "FROM TIME TO TIME I WILL BE ABLE TO..." text 33383 CALL 33774 ; Adjust height of 17 window to accommodate text 33386 PUSH HL ; Store HL (pointer to start of text to print) 33387 LD A,17 ; Draw Window 17... 33389 CALL 34990 ; ... 33392 POP HL ; Restore HL (pointer to start of text to print) 33393 CALL 34762 ; Print text to screen 33396 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 33399 LD DE,37307 ; Point DE at height data for Window 27 33402 LD HL,45517 ; Point HL at "WHIRRRRR........ PLOP !..." text 33405 CALL 33774 ; Adjust height of 27 window to accommodate text 33408 PUSH HL ; Store HL (pointer to start of text to print) 33409 LD A,27 ; Draw Window 27... 33411 CALL 34990 ; ... 33414 POP HL ; Restore HL (pointer to start of text to print) 33415 CALL 34762 ; Print text to screen 33418 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *33421 BIT 4,A ; If I.D. Card Validated Flag is set... 33423 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33426 LD DE,37307 ; Point DE at height data for Window 27 33429 LD HL,45629 ; Point HL at "[Character] SAYS 'STICK YOUR PHOTO ON THE I.D. CARD..." text 33432 CALL 33774 ; Adjust height of Window 27 to accommodate text 33435 PUSH HL ; Store HL (pointer to start of text to print) 33436 LD A,27 ; Draw Window 27... 33438 CALL 34990 ; ... 33441 POP HL ; Restore HL (pointer to start of text to print) 33442 CALL 34762 ; Print text to screen 33445 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; "Command Character to Help" Routine for Swiftfoot c33448 LD E,22 ; If Current Character is not carrying the Pair of Boots (22)... 33450 CALL 33896 ; ... 33453 JP NZ,55252 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for fire to be pressed then ; jump to Main Game Loop 33456 LD HL,40600 ; Point HL at "MY BOOTS COULD BE USEFUL..." text 33459 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Julie 8 c33462 LD HL,40651 ; Point HL at "[Character] SAYS 'HARK WHAT LIGHT THRU YONDER PORTHOLE..." text 33465 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Hectorr c33468 LD E,10 ; If Current Character is carrying the Pot of Glue (10)... 33470 CALL 33896 ; ... 33473 JR Z,33481 ; ...then skip ahead to #R33481 33475 LD HL,40747 ; Point HL at "[Character] SAYS 'FORSOOTH THERE IS STICKY STUFF NEARBY..." text 33478 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop *33481 LD HL,40819 ; Point HL at "[Character] SAYS 'COME ON THEN! COME ON THEN!..." text 33484 JP 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Load A with weight of object A ; ; Used by the routines at #R29756 and #R33601. Input: A Index of object of interest Output: A Weight of object of ; interest c33487 PUSH HL ; Store HL 33488 PUSH DE ; Store DE 33489 LD E,0 ; Point HL to the first byte of the A-th record in Object Properties Table... 33491 CALL 33525 ; ... 33494 LD A,(HL) ; Load data at this location into A 33495 AND 15 ; Discard all but the Weight bits 33497 POP DE ; Restore DE 33498 POP HL ; Restore HL 33499 RET ; Return ; Load A with Current Character's Happiness Level ; ; Used by the routines at #R29619 and #R29756. Output: A Happiness of Current Character c33500 LD A,(29632) ; Load A with index of Current Character 33503 PUSH HL ; Store HL 33504 PUSH DE ; Store DE 33505 LD E,1 ; Point HL at Current Character's Happiness... 33507 CALL 33541 ; ... 33510 LD A,(HL) ; ...and load Happiness into A 33511 AND 127 ; Reset Bit 7 (unused) 33513 POP DE ; Restore DE 33514 POP HL ; Restore HL 33515 RET ; Return ; Load Object C into the First Empty Inventory Slot of a Character ; ; Used by the routines at #R29330, #R29619, #R31537, #R33170 and #R34265. Input: B Number of inventory slots to ; process C Index of an object to load into a character's inventory HL Points to (usually the start of) a record ; in the Characters' Current Inventories Table at #R25164 c33516 LD A,(HL) ; If current inventory slot is empty... 33517 OR A ; ... 33518 JR Z,33523 ; ...then skip ahead to 33523 33520 INC HL ; Advance to next inventory slot 33521 DJNZ 33516 ; If there are still slots to process then loop back to #R33516 *33523 LD (HL),C ; Load item into current inventory slot 33524 RET ; Return ; Point HL to the E-th byte of the A-th record in Object Properties Table ; ; Used by the routines at #R29488, #R30145, #R30968, #R31537, #R33487, #R34484 and #R34627. Input: A Index of ; required record (i.e. table entry number), first is zero E Index of required field within record (i.e. byte ; number), first is zero HL (entry at #R33528 only) Points to Table of Characters' Current Stats (Gordon's entry, ; i.e. not including Magic Knight) Output: HL Points to required field within record of interest c33525 LD HL,37441 ; Point HL at start of Table of Object Properties ; This entry point is used by the routine at #R33541. *33528 PUSH HL ; Store HL (points to current position in a table of 8-byte-wide records) 33529 ADD A,A ; Multiply A (record number) by eight and load into HL... 33530 ADD A,A ; ... 33531 LD L,A ; ... 33532 LD H,0 ; ... 33534 ADD HL,HL ; ... 33535 LD D,0 ; Set D to zero (DE = field number) 33537 ADD HL,DE ; Add field number to HL to give exact offset to record and field of interest 33538 POP DE ; Restore DE (points to current position in a table of 8-byte-wide records)... 33539 ADD HL,DE ; ...and add to offset value already in HL 33540 RET ; Return ; Point HL at E-th Byte on A-th Record of Characters' Current Stats Table (Excluding Magic Knight) ; ; Used by the routines at #R28390, #R29756, #R30145, #R30686, #R33500, #R33546, #R33725 and #R53731. c33541 LD HL,25028 ; Point HL at Table of Characters' Current Stats (Gordon's entry, i.e. not including Magic ; Knight)... 33544 JR 33528 ; ...and advance to the E-th byte of the A-th entry in this table of 8-byte-wide records, then ; return ; Point IX at Current Character's Current Stats ; ; Used by the routines at #R29756, #R30810, #R30842, #R30874, #R31257 and #R33569. Output: HL Address of start of ; Current Character's stats IX Address of start of Current Character's stats c33546 LD A,(29632) ; Load A with index of Current Character 33549 LD E,0 ; Point HL at Current Character's current strength... 33551 CALL 33541 ; ... 33554 PUSH HL ; Transfer address from HL... 33555 POP IX ; ...to IX 33557 RET ; Return ; If Character's Happiness is Lower than B then Show "[Character] DOES NOT WANT TO BE COMMANDED..." and Jump to Main ; Game Loop ; ; Used by the routines at #R30810, #R30842 and #R30874. Input: IX Pointer to start of a character's current stats ; B Happiness threshold c33558 LD A,(IX+1) ; If character's current happiness is at or above the threshold value... 33561 AND 127 ; ... 33563 CP B ; ... 33564 RET NC ; ...then return 33565 POP AF ; Remove return value from top of stack as we are not RETurning 33566 JP 55237 ; Display "[Character] DOES NOT WANT TO BE COMMANDED BY YOU" Window (29), wait for fire to be ; pressed then jump to Main Game Loop ; Increase Current Character's Happiness by Amount A ; ; Used by the routines at #R29619, #R29756, #R30145, #R30686 and #R33788. Input: A Value by which to change ; character's Happiness c33569 PUSH AF ; Store AF (A = increment value) 33570 CALL 33546 ; Point IX at Current Character's current stats 33573 POP AF ; Restore AF (A = increment value) 33574 LD C,A ; Load increment value into C 33575 LD A,(IX+1) ; Add increment value to Current Character's Happiness... 33578 CALL 53703 ; ... 33581 LD (IX+1),A ; ...and store 33584 RET ; Return ; Point IX at Current Inventory of Character A ; ; Used by the routines at #R29619, #R29756 and #R33896. Input: A Index of a character Output: IX Points to ; current inventory of character A c33585 PUSH DE ; Store DE 33586 LD E,A ; Multiply character index by five (as each character has five inventory slots)... 33587 ADD A,A ; ... 33588 ADD A,A ; ... 33589 ADD A,E ; ... 33590 LD E,A ; ...and load into DE... 33591 LD D,0 ; ... 33593 LD IX,25174 ; Point IX at Gordon's entry in Characters' Current Inventories Table (i.e. first entry for ; non-player characters) 33597 ADD IX,DE ; Add five times character index to this as offset 33599 POP DE ; Restore DE 33600 RET ; Return ; Test Whether Current Object is too Heavy for Magic Knight to Pick Up (or Take) ; ; Used by the routines at #R29330 and #R29619. Output: F S Flag set if object is light enough to be picked up, ; reset otherwise c33601 LD IX,25164 ; Point IX at start of Magic Knight's current inventory 33605 LD A,(25020) ; Load Magic Knight's current strength into A 33608 PUSH AF ; Store AF (A = Magic Knight's current strength) 33609 LD BC,1280 ; Load B with 5 (as five inventory slots to check) and C (total weight carried) with zero *33612 LD A,(IX+0) ; Load object in current inventory slot 33615 OR A ; If no object present... 33616 JR Z,33627 ; ...skip ahead to #R33627... 33618 CALL 33487 ; Load A with weight of object A 33621 ADD A,C ; Add C to this... 33622 LD C,A ; ...and load result into C (total weight so far) 33623 INC IX ; Advance to next inventory slot 33625 DJNZ 33612 ; Loop back for next inventory slot *33627 POP AF ; Restore AF (A = Magic Knight's current strength) 33628 AND 127 ; Ensure that strength is capped at 127 and that Sign Flag is reset 33630 SUB C ; Subtract total weight of Magic Knight's carried objects from his strength to get "surplus" ; strength... 33631 LD C,A ; ...and load into C 33632 LD A,(29526) ; Load A with index of Current Object (i.e. object Magic Knight is trying to pick up) 33635 CALL 33487 ; Load A with weight of object A 33638 CP C ; Set Sign Flag if surplus strength exceeds weight of object, otherwise reset 33639 RET ; Return ; Check Whether Magic Knight is Wearing an Object ; ; Used by the routines at #R28470, #R28482, #R28494, #R30686, #R31122, #R31688, #R32895, #R33170, #R34265 and ; #R53498. Input: A Index of an object Output: F Zero Flag set if object is present in inventory, reset otherwise c33640 LD HL,25169 ; Point HL at start of Magic Knight's Inventory (Wearing) 33643 JR 33648 ; Jump to #R33648 (set Zero Flag if Magic Knight is wearing object A, reset otherwise) ; Check Whether Magic Knight is Carrying an Object ; ; Used by the routines at #R27703, #R27762, #R28542, #R31188, #R34265, #R34567 and #R34627. Input: A Index of an ; object HL (entry at #R33648) Pointer to start of a character's inventory Output: F Zero Flag set if object is ; present in inventory, reset otherwise c33645 LD HL,25164 ; Point HL at start of Magic Knight's current Inventory (carrying) ; This entry point is used by the routines at #R33140, #R33640, #R33896 and #R34265. *33648 LD B,5 ; Load B with 5 (as characters have five inventory slots) *33650 CP (HL) ; If object at current inventory slot is the object of interest... 33651 RET Z ; ...then return with zero flag set 33652 INC HL ; Advance HL to next inventory slot 33653 DJNZ 33650 ; Decrease B (remaining number of inventory slots to check) and loop back to #R33650 33655 OR A ; Reset zero flag, as object is not present 33656 RET ; Return ; Insert Current Time and Score into "Time Left" and "Percentage Completion" Texts ; ; Used by the routines at #R30145 and #R55685. Input: HL Points to percentage completion text (#R47492 or #R44506) ; DE Points to time left text (#R47492 or #R44506) c33657 PUSH DE ; Store DE 33658 PUSH HL ; Store HL 33659 LD HL,23502 ; Point HL at Visited Rooms table 33662 LD BC,12800 ; Set B=50, C=0 (see trivia) *33665 LD A,(HL) ; Load A with value at HL 33666 ADD A,C ; Add this to C... 33667 LD C,A ; ... 33668 INC HL ; Advance to next byte 33669 DJNZ 33665 ; Loop back to #R33665 (adding together 50 values from #R23502 onwards to get score for ; exploring rooms) 33671 DEC C ; Decrease exploration score by one (due to no score for The Transporter Room) 33672 LD A,C ; Double count of rooms visited... 33673 ADD A,A ; ... 33674 LD C,A ; ... 33675 LD A,(23451) ; If I.D. Card Validated Flag is reset... 33678 BIT 4,A ; ... 33680 JP Z,33687 ; ...then skip ahead to #R33687 33683 LD A,10 ; Add ten percent to score in C... 33685 ADD A,C ; ... 33686 LD C,A ; ... *33687 LD A,(23451) ; If Transporter Repaired Flag is reset... 33690 AND 1 ; ... 33692 JR Z,33698 ; ...then skip ahead to #R33698 33694 LD A,10 ; Add ten percent to score in C... 33696 ADD A,C ; ... 33697 LD C,A ; ... *33698 LD A,(23403) ; If Barriers Removed Flag is reset... 33701 AND 1 ; ... 33703 JR Z,33709 ; ...then skip ahead to #R33709 33705 LD A,2 ; Add two percent to score in C... 33707 ADD A,C ; ... 33708 LD C,A ; ... *33709 LD A,(23397) ; Add Bonus Score to total... 33712 ADD A,C ; ... 33713 POP HL ; 33714 CALL 34697 ; Splice numeric data A as a string into a string at HL 33717 LD A,(23457) ; Load A with number of days left 33720 POP HL ; Restore HL (originally DE, time left text) 33721 CALL 34697 ; Splice numeric data A as a string into a string at HL 33724 RET ; Return ; Display "[Character] IS ASLEEP" Window and Jump to Main Game Loop if Current Character is Asleep, else Return ; ; Used by the routine at #R30874. Output: A Zero if character is awake c33725 PUSH HL ; Store HL 33726 LD A,(29632) ; Load A with index of Current Character 33729 LD E,6 ; Point HL at character's Flags... 33731 CALL 33541 ; ... 33734 BIT 7,(HL) ; If character is awake... 33736 JR Z,33754 ; ...then skip ahead to #R33754 33738 LD A,28 ; Draw Window 28... 33740 CALL 34990 ; ... 33743 LD HL,38361 ; Point HL at "[Current Character's name] IS ASLEEP" text... 33746 CALL 34762 ; ...and print to screen 33749 POP HL ; Restore HL 33750 POP HL ; Remove value from top of stack as we are not RETurning 33751 JP 29479 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *33754 POP HL ; Restore HL 33755 XOR A ; Set A to zero 33756 RET ; Return ; Load Magic Knight's Coordinates (in Characters) into DE ; ; Used by the routines at #R29330 and #R29488. Output: D y-coordinate (characters) E x-coordinate (characters) c33757 LD A,(25157) ; Load Magic Knight's current y-coordinate into A 33760 CALL 28625 ; Divide A by eight, rounding down to nearest integer 33763 ADD A,3 ; Add 3 (as Magic Knight is four characters tall) 33765 LD D,A ; And load result into D 33766 LD A,(25156) ; Load Magic Knight's current x-coordinate into A 33769 CALL 28625 ; Divide A by eight, rounding down to nearest integer 33772 LD E,A ; Load result into E 33773 RET ; Return ; Adjust Height (at DE) of a Window to Accommodate Text ; ; Used by the routines at #R27762, #R28506, #R28554, #R29756, #R31041, #R31188, #R31312, #R32252, #R32895, #R33338, ; #R33834, #R34122, #R34265, #R55364 and #R55685. Input: HL Points to height byte preceding text data DE Points ; to third byte of an entry in table at #R37089 (i.e. y-coordinate of top edge of a window) Output: HL Points to ; first byte of text data (i.e. input HL value plus one) c33774 LD A,(HL) ; Load height data into C... 33775 LD C,A ; ... 33776 LD A,(DE) ; Load y-coordinate in characters of window of interest into A 33777 ADD A,C ; Add height to window's top y-coordinate to get required bottom y-coordinate 33778 INC DE ; Advance DE to y-coordinate of bottom edge of window... 33779 LD (DE),A ; ...and load calculated bottom y-coordinate into address in DE 33780 INC HL ; Advance HL to first byte of actual text data 33781 RET ; Return ; Set a Window's Height to A ; ; Used by the routines at #R31688 and #R32252. Input: A A window height DE Location of a window's top y-coordinate ; data c33782 LD C,A ; Load window height into C 33783 LD A,(DE) ; Load window's top y-coordinate into A 33784 ADD A,C ; Add C to give bottom y-coordinate 33785 INC DE ; Advance DE to window's bottom y-coordinate data... 33786 LD (DE),A ; ...and update with new height value in A 33787 RET ; Return ; Check Whether Gordon and Sarab are Both Asleep, and Increase Their Happiness by Five if Not ; ; Used by the routines at #R31688 and #R32895. Output: A Non-zero if Gordon and Sarab are both asleep. Zero ; otherwise. F Zero Flag reset if Gordon and Sarab are both asleep. Set otherwise. c33788 LD A,(25034) ; If Gordon's Asleep Flag is reset... 33791 BIT 7,A ; ... 33793 JR Z,33803 ; ...then skip ahead to #R33803 33795 LD A,(25042) ; If Sarab's Asleep Flag is reset... 33798 BIT 7,A ; ... 33800 JR Z,33803 ; ...then skip ahead to #R33803 33802 RET ; Return *33803 XOR A ; Set Current Character to Gordon... 33804 LD (29632),A ; ... 33807 LD A,5 ; Increase Gordon's happiness by 5... 33809 CALL 33569 ; ... 33812 LD A,1 ; Set Current Character to Sarab... 33814 LD (29632),A ; ... 33817 LD A,5 ; Increase Gordon's happiness by 5... 33819 CALL 33569 ; ... 33822 XOR A ; Set A to zero 33823 RET ; Return ; Display "YOU ARE NOT WEARING ANYTHING" Window and Set Zero Flag if Magic Knight's Inventory (Wearing) is Empty ; ; Used by the routine at #R31537. c33824 LD A,(25169) ; If Magic Knight's first inventory slot (wearing) is not empty... 33827 OR A ; ... 33828 RET NZ ; ...then return 33829 LD HL,38598 ; Point HL at "YOU ARE NOT WEARING ANYTHING" text 33832 JR 33842 ; Display "YOU ARE NOT WEARING ANYTHING" Window, wait for Fire to be pressed and return ; Display "YOU ARE NOT CARRYING ANYTHING" Window and Set Zero Flag if Magic Knight's Inventory (Carrying) is Empty ; ; Used by the routines at #R29488, #R29756, #R30145 and #R31537. Output: F Zero Flag set if Magic Knight's (first) ; inventory (slot) is empty. Reset otherwise c33834 LD A,(25164) ; Load A with index of first object in Magic Knight's (Carrying) inventory... 33837 OR A ; ...and if this is zero... 33838 RET NZ ; ...then return 33839 LD HL,38582 ; Point HL at "YOU ARE NOT CARRYING ANYTHING" text ; This entry point is used by the routine at #R33824. *33842 LD DE,37195 ; Adjust height of window 13 to accommodate text... 33845 CALL 33774 ; ... 33848 PUSH HL ; Store HL (pointer to text to print) 33849 LD A,13 ; Draw Window 13... 33851 CALL 34990 ; ... 33854 POP HL ; Restore HL (pointer to text to print) 33855 CALL 34762 ; Print text to screen 33858 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 33861 XOR A ; Load A with zero 33862 RET ; Return ; Check Whether Current Object is Wanted / Unwanted by Current Character ; ; This routine checks whether the Current Object is associated with the Current Character in either the Table of ; Characters' Wanted Objects (IX = #R44238) or the Table of Characters' Unwanted Objects (IX = #R44251). Input: IX ; Points to Table of Characters' Wanted (IX = #R44238) or Unwanted (IX = #R44251) Objects Output: F Zero Flag set ; if match found, reset otherwise c33863 HALT ; Wait for interrupt *33864 LD A,(IX+0) ; If current entry's character index is 255 (End Marker)... 33867 CP 255 ; ... 33869 JP Z,33894 ; ...then skip ahead to #R33894 33872 LD A,(29632) ; If current entry's character index is not the same as the Current Character... 33875 CP (IX+0) ; ... 33878 JR NZ,33888 ; ...then skip ahead to #R33888 (advance to next character-object pair record) 33880 LD A,(29526) ; If current entry's object index is the same as Current Object... 33883 CP (IX+1) ; ... 33886 JR Z,33895 ; ... then return (with Zero Flag set) *33888 INC IX ; Advance to next character-object pair to check... 33890 INC IX ; ... 33892 JR 33864 ; Loop back to #R33864 *33894 OR A ; Reset Zero Flag as no match was found *33895 RET ; Return ; Check Whether Current Character is Carrying an Object ; ; Used by the routines at #R33100, #R33170, #R33290, #R33304, #R33318, #R33448 and #R33468. Input: E Index of an ; object Output: F (via jumped-to routine at #R33645) Zero Flag set if object is present in inventory, reset ; otherwise c33896 LD A,(29632) ; Load A with index of Current Character 33899 PUSH DE ; Store DE (E = index of object to check for) 33900 CALL 33585 ; Point IX at current inventory of character with index A... 33903 PUSH IX ; ...and copy into HL... 33905 POP HL ; ... 33906 POP DE ; Restore DE (E = index of object to check for) 33907 LD A,E ; Load index of object to check for into A 33908 JP 33648 ; Check if object is in inventory data at HL and (re)set Zero Flag accordingly ; Print Name of Object in Inventory Slot A of Inventory Data at HL in Command Summary Window ; ; Used by the routines at #R29488, #R29619, #R29756, #R30145, #R30968 and #R31537. Input: A Index of an inventory ; slot, with first slot being zero HL Points to start of a character's inventory c33911 LD E,A ; Load inventory slot number into DE... 33912 LD D,0 ; ... 33914 ADD HL,DE ; Add to HL as offset 33915 LD A,(HL) ; Load index of object in that slot into A 33916 LD (29526),A ; Set this object as the Current Object 33919 LD DE,33924 ; Point DE at instruction to print name of Current Object... 33922 JR 33940 ; ...print in Command Summary Window at top of screen and return ; Code for Printing Routine to Display Name of Current Object b33924 DEFM 29,0 ; name of Current Object ; Update Current Character Based Upon Selection Made in Menu ; ; Used by the routine at #R34122. Input: A Index of selected character from a character-selection menu c33926 LD HL,23404 ; Point HL at list of characters in room of interest 33929 LD E,A ; Load DE with index of selected item in menu... 33930 LD D,0 ; ... 33932 ADD HL,DE ; Add this as offset in table of characters in room to point to character of interest 33933 LD A,(HL) ; Load index of this character into A 33934 LD (29632),A ; Modify operand of instruction at #R29631 to use this particular character (i.e. set Current ; Character) ; This entry point is used by the routine at #R29619. *33937 LD DE,33943 ; Point DE at instruction to print name of Current Character ; This entry point is used by the routine at #R33911. *33940 JP 54283 ; Print text at DE in Command Summary Window at top of screen and return ; Code for Printing Routine to Display Name of Current Character b33943 DEFM 31,0 ; name of Current Character ; Display a Character's Inventory Window as an Information Window ; ; Used by the routine at #R29330. Input: IX Points to a character's inventory (usually Magic Knight) c33945 LD A,111 ; Modify instruction at #R34017 to display as information window, rather than menu window... 33947 LD (34018),A ; ... 33950 JR 33984 ; Jump into inventory window drawing routine ; Show List of Objects (Window or Menu) and Handle Selection if a Menu ; ; Used by the routines at #R29488, #R29619, #R29756, #R30145, #R30968 and #R31537. Input: B Number of inventory ; slots to check DE Points to summary command text (i.e. "DROP THE ", "GIVE THE ", "READ THE ", "WEAR THE " or ; "UNWEAR THE "), or 0 for no summary text HL (entry via #R33952) Points to full command text (e.g. "DROP WHICH ; OBJECT?", or "YOU ARE NOW CARRYING") HL (entry via #R33984) Points to "YOU ARE NOW CARRYING" text IX Points to a ; character's inventory Output: A Zero-based index of selected menu item c33952 CALL 54051 ; Store all registers on the stack 33955 CALL 35723 ; Play downward scale sound 33958 CALL 54079 ; Restore all registers from the stack 33961 LD A,(IX+0) ; Load first object in character's inventory into A 33964 OR A ; If nothing in first slot... 33965 JP Z,34087 ; ...jump ahead to #R34087 (unused code block - see trivia) 33968 LD A,105 ; Modify instruction at #R34017 with 105, denoting window as a menu rather than information ; window... 33970 LD (34018),A ; ... 33973 PUSH BC ; Store BC (B = number of inventory slots) 33974 PUSH HL ; Store HL 33975 PUSH IX ; Store IX 33977 CALL 54322 ; Print Command Summary Text at DE (e.g. "DROP THE ") in Command Summary Window 33980 POP IX ; Restore IX 33982 POP HL ; Restore HL 33983 POP BC ; Restore BC ; This entry point is used by the routine at #R33945. *33984 LD C,0 ; Load C (object counter) with zero 33986 PUSH BC ; Store BC (B = number of inventory slots) 33987 PUSH IX ; Store IX (points to start of inventory) *33989 LD A,(IX+0) ; Load object from character's inventory (slot number C) into A 33992 OR A ; If nothing in this slot... 33993 JR Z,34000 ; ...then jump ahead to #R34000 33995 INC C ; Increase count of objects in inventory 33996 INC IX ; Advance IX to next slot 33998 DJNZ 33989 ; Loop back to #R33989 for next slot *34000 POP IX ; Restore IX (points to start of inventory) 34002 LD A,C ; Copy number of objects into A 34003 OR A ; If number of objects is zero... 34004 JP Z,34096 ; ...then jump ahead to #R34096 34007 LD A,(37123) ; Load A with y-coordinate of top edge of Window 04 34010 ADD A,C ; Add number of objects to this y-coordinate 34011 ADD A,3 ; Add an additional 3 to this total (menu window padding) 34013 LD (37124),A ; Set y-coordinate of bottom edge of Window 04 to accommodate list of C objects 34016 PUSH HL ; Store HL (e.g. pointer to "DROP WHICH OBJECT?" text) ; The operand of the instruction at #R34017 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instructions at #R33947 and #R33970. 34017 LD A,0 ; Load A with menu / static window value 34019 CP 105 ; If this is not 105 (i.e. window is not a menu, but a simple information window)... 34021 JR NZ,34030 ; ...then skip ahead to #R34030 34023 LD A,4 ; Draw Window 4 as a menu window... 34025 CALL 34982 ; ... 34028 JR 34035 ; ...and skip over "draw an information window" section *34030 LD A,4 ; Draw Window 4 as an information window... 34032 CALL 34990 ; ... *34035 POP HL ; Restore HL (pointer to full command text)... 34036 PUSH IX ; Store IX (points to start of inventory) 34038 CALL 34762 ; Print text to screen 34041 POP IX ; Restore IX (points to start of inventory) 34043 POP BC ; Restore BC (B = number of remaining inventory slots) *34044 PUSH BC ; Store BC (B = number of remaining inventory slots) 34045 LD A,(IX+0) ; Load index of object in current inventory into A 34048 OR A ; If index is zero (i.e. inventory slot is empty)... 34049 JP Z,34077 ; ...then skip ahead to #R34077 34052 LD B,A ; Copy index into B 34053 PUSH IX ; Store IX (pointer to start of inventory) 34055 LD HL,38351 ; Point HL to text printing instruction to move cursor to start of next character row within ; window, then right by two characters 34058 PUSH BC ; Store BC (B = index of an object) 34059 CALL 34762 ; Print text to screen (i.e. move text printing cursor right by two characters) 34062 POP BC ; Restore BC (B = index of an object) 34063 CALL 54266 ; Point HL at object B's name in Table of Object Names... 34066 CALL 34762 ; ...and print to screen 34069 POP IX ; Restore IX (pointer to start of inventory) 34071 INC IX ; Advance IX to next inventory slot 34073 POP BC ; Restore BC (B = number of remaining inventory slots) 34074 DJNZ 34044 ; Repeat loop for next object in inventory, decreasing B (number of remaining inventory slots) 34076 PUSH BC ; Store BC (B = 0) *34077 POP BC ; Restore BC (B = number of remaining inventory slots 34078 LD A,(34018) ; If window is a menu, rather than information window... 34081 CP 105 ; ... 34083 CALL Z,35296 ; ...process keyboard / joystick input on a menu and load A with selected item index 34086 RET ; ...and return ; This jump point can never be reached, as a separate routine already checks for an empty inventory before code ; execution reaches this routine - see trivia *34087 LD A,13 ; Prepare to display Window 13 34089 POP HL ; Remove RETurn address from stack (as we are not RETurning) 34090 LD HL,44862 ; Point HL at "YOU HAVE DESTROYED YOURSELF BY DROPPING THE..." text 34093 JP 55364 ; Display Window 13 with text at HL, wait for Fire to be pressed then jump to Main Game Loop *34096 PUSH HL ; Store HL (pointer to "YOU ARE NOW CARRYING" text) 34097 LD A,(37123) ; Load A with y-coordinate of top edge of Window 04 34100 ADD A,4 ; Add 4 to this y-coordinate 34102 LD (37124),A ; Set y-coordinate of bottom edge of Window 04 to accommodate three rows of text 34105 LD A,4 ; Draw Window 4... 34107 CALL 34990 ; ... 34110 POP HL ; Restore HL (pointer to "YOU ARE NOW CARRYING" text) 34111 CALL 34762 ; ...and print to screen 34114 LD HL,42373 ; Point HL at "NOTHING AT ALL" text... 34117 CALL 34762 ; ...and print to screen 34120 POP BC ; Restore BC (number of inventory slots, PUSHed by instruction at #R33986) 34121 RET ; Return ; Display and Process Input for Character Selection Menu (Current Room's Characters Only) ; ; Used by the routines at #R29619, #R29756, #R30145, #R30686 and #R31257. Input: HL Pointer to text to append to ; menu's title string, after "WHO DO YOU WANT TO " DE Command Summary Text Pointer (second row of text in Command ; Summary Window) Output: A 1 if there is at least one character in the room, zero otherwise F Reset if there is ; at least one character in the room, set otherwise c34122 PUSH HL ; Store HL (pointer to text to append to menu's title string) 34123 PUSH BC ; Store BC 34124 PUSH IX ; Store IX 34126 PUSH DE ; Store DE (Command Summary Text Pointer) 34127 CALL 35731 ; Play Short Downward Scale Sound 34130 POP DE ; Restore DE (Command Summary Text Pointer) 34131 CALL 54322 ; Print text at Command Summary Text Pointer (e.g. "COMMAND ") in Command Summary Window 34134 LD A,(23701) ; Load A with Magic Knight's current room... 34137 CALL 34512 ; ...and create list of characters in this room at #R23404, loading A with number of characters 34140 JR NZ,34170 ; If there are characters in this room then skip ahead to #R34170 34142 LD HL,38628 ; Point HL at "THERE IS NOBODY IN THIS ROOM" text 34145 LD DE,37195 ; Adjust height of window 13 to accommodate text... 34148 CALL 33774 ; ... 34151 PUSH HL ; Store HL (pointer to start of text to print) 34152 LD A,13 ; Draw Window 13... 34154 CALL 34990 ; ... 34157 POP HL ; Restore HL (pointer to start of text to print) 34158 CALL 34762 ; Print text at HL 34161 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 34164 POP IX ; Restore IX 34166 POP BC ; Restore BC 34167 POP HL ; Restore HL (pointer to text to append to menu's title string) 34168 XOR A ; Set A to zero and set Zero Flag 34169 RET ; Return *34170 ADD A,4 ; Add four to number of characters in current room (for menu size padding)... 34172 LD C,A ; ...and load value into C 34173 LD A,(37115) ; Load A with window's top y-coordinate 34176 ADD A,C ; Add 4 + number of characters... 34177 LD (37116),A ; ...and set window's bottom y-coordinate to this value 34180 POP IX ; Restore IX 34182 POP BC ; Restore BC 34183 LD A,3 ; Draw Window 3 as a menu window... 34185 CALL 34982 ; ... 34188 LD HL,38610 ; Point HL at "WHO DO YOU WANT TO " text... 34191 CALL 34762 ; ...and print to screen 34194 POP HL ; Restore HL (pointer to text to append to menu's title string, as at beginning of this ; routine) 34195 CALL 34762 ; Append this text to menu's title 34198 LD IX,23404 ; Point IX at list of characters in room 34202 LD B,16 ; Load B with 16 (16 characters) (see trivia) *34204 PUSH BC ; Store BC (B = remaining characters to process) 34205 LD A,(IX+0) ; Load A with index of current character in list... 34208 CP 255 ; ...and if this is 255 (End Marker)... 34210 JP Z,34254 ; ...then skip ahead to #R34254 34213 LD HL,38351 ; Point HL at text printing instructions to move cursor to start of next character row within ; window, then right by two characters 34216 PUSH IX ; Store IX (current position in list of characters in room) 34218 CALL 34762 ; Print text at HL to screen (i.e. move cursor) 34221 POP IX ; Restore IX (current position in list of characters in room) 34223 LD A,(IX+0) ; Load A with index of current character in list... 34226 LD (29632),A ; Set this character as the Current Character 34229 LD HL,33943 ; Point HL at instruction to print name of Current Character 34232 PUSH IX ; Store IX (current position in list of characters in room) 34234 CALL 34762 ; Print text to screen 34237 POP IX ; Restore IX (current position in list of characters in room) 34239 INC IX ; Advance IX to next character in list 34241 POP BC ; Restore BC (B = remaining characters to process) 34242 DJNZ 34204 ; Decrease B and loop back to #R34204 34244 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 34247 CALL 33926 ; Update Current Character based upon selection made in menu 34250 LD A,1 ; Load A with 1 34252 OR A ; Reset Zero Flag 34253 RET ; Return *34254 POP BC ; Restore BC (B = remaining characters to process) 34255 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index 34258 CALL 33926 ; Update Current Character based upon selection made in menu 34261 LD A,1 ; Load A with 1 34263 OR A ; Reset Zero Flag 34264 RET ; Return ; Set Magic Knight's Available Action Flags and Validate I.D. Card if Appropriate ; ; Used by the routines at #R26997, #R28101, #R29330 and #R30001. c34265 LD HL,1 ; Reset all Available In-Game Menu Command Flags except "COMMAND A CHARACTER" which is always ; set... 34268 LD (23698),HL ; ... 34271 LD A,(25024) ; If Magic Knight's Magic Level is zero... 34274 OR A ; ... 34275 JR Z,34281 ; ...then skip ahead to #R34281 34277 SET 5,(IY+88) ; Set "CAST A SPELL" Menu Command Flag (IY = 23610) *34281 LD A,(23701) ; If Magic Knight's current room is not 1 (The Bridge, USS Pisces 1)... 34284 CP 1 ; ... 34286 JR NZ,34320 ; ...then skip ahead to #R34320 34288 LD A,1 ; If Magic Knight is wearing the Cloak of Invisibility (01)... 34290 CALL 33640 ; ... 34293 JR Z,34320 ; ...then skip ahead to #R34320 34295 LD A,3 ; If Magic Knight is not wearing the Valid ID Card (03)... 34297 CALL 33640 ; ... 34300 JR NZ,34320 ; ...then skip ahead to #R34320 34302 SET 2,(IY+89) ; Set "COMMUNICATE" Menu Command Flag (IY = 23610) 34306 LD HL,25174 ; If Gordon is not carrying the Star Map... 34309 LD A,6 ; ... 34311 CALL 33648 ; ... 34314 JR NZ,34320 ; ...then skip ahead to #R34320 34316 SET 0,(IY+89) ; Set "MOVE STARSHIP" Menu Command Flag (IY = 23610) *34320 LD A,(23701) ; Load E with Magic Knight's current room... 34323 LD E,A ; ... 34324 LD BC,4 ; Load BC with 4 (as each Transporter Pad Location entry is composed of 4 bytes) 34327 LD HL,32577 ; Point HL at Table of Transporter Pad Locations (#R32577) *34330 ADD HL,BC ; Advance HL by four bytes to next entry 34331 LD A,(HL) ; If first byte (Room Number) is 255 (End Marker)... 34332 CP 255 ; ... 34334 JR Z,34363 ; ...then skip ahead to #R34363 (end of data reached) 34336 CP E ; If current transporter pad's room is not in the same room as Magic Knight... 34337 JR NZ,34330 ; ...then loop back to #R34330 for next transporter pad 34339 INC HL ; Advance HL to pad's left x-coordinate 34340 LD A,(25156) ; If Magic Knight's current x-coordinate (pixels) is less than this... 34343 CP (HL) ; ... 34344 JP C,34363 ; ...then skip ahead to #R34363 (Magic Knight not on a transporter pad) 34347 INC HL ; Advance HL to pad's right x-coordinate 34348 CP (HL) ; If Magic Knight's current x-coordinate (pixels) is not less than this... 34349 JP NC,34363 ; ...then skip ahead to #R34363 (Magic Knight not on a transporter pad) 34352 INC HL ; Advance HL to pad's y-coordinate 34353 LD A,(25157) ; If Magic Knight's current y-coordinate (pixels) is not the same as this... 34356 CP (HL) ; ... 34357 JR NZ,34363 ; ...then skip ahead to #R34363 (Magic Knight not on a transporter pad) 34359 SET 1,(IY+89) ; Set "USE TRANSPORTER" Menu Command Flag (IY = 23610) *34363 XOR A ; Load C with weights / flags of all Magic Knight's carried objects, OR-ed Together... 34364 CALL 34484 ; ... 34367 BIT 5,C ; ...and if Can Be Read Flag is not set for any of the objects... 34369 JR Z,34375 ; ...then skip ahead to #R34375 34371 SET 3,(IY+88) ; Set "READ SOMETHING" Menu Command Flag (IY = 23610) *34375 LD A,1 ; Load C with flags (2) of all Magic Knight's carried objects, OR-ed Together... 34377 CALL 34484 ; ... 34380 BIT 3,C ; ...and if Can Be Worn Flag is set for at least one of the objects... 34382 JR NZ,34390 ; ...then skip ahead to #R34390 34384 LD A,(25169) ; If Magic Knight's first inventory slot (wearing) is empty... 34387 OR A ; ... 34388 JR Z,34394 ; ...then skip ahead to #R34394 *34390 SET 7,(IY+88) ; Set "WEAR/UNWEAR OBJECT" Menu Command Flag (IY = 23610) *34394 LD A,2 ; If Magic Knight is not carrying the Blank I.D. Card (02)... 34396 CALL 33645 ; ... 34399 JR NZ,34473 ; ...then skip ahead to #R34473 34401 LD A,10 ; If Magic Knight is not carrying the Pot of Glue (10)... 34403 CALL 33645 ; ... 34406 JR NZ,34473 ; ...then skip ahead to #R34473 34408 LD A,5 ; If Magic Knight is not carrying the Photograph (of Magic Knight) (05)... 34410 CALL 33645 ; ... 34413 JR NZ,34473 ; ...then skip ahead to #R34473 34415 LD C,5 ; Remove Photograph (of Magic Knight) from Magic Knight's current inventory (carrying)... 34417 LD B,5 ; ... 34419 LD HL,25164 ; ... 34422 PUSH HL ; ...storing HL (pointer to start of Magic Knight's current inventory)... 34423 CALL 36254 ; ... 34426 POP HL ; ...and restoring HL (pointer to start of Magic Knight's current inventory) 34427 PUSH HL ; Store HL (pointer to start of Magic Knight's current inventory) 34428 LD C,2 ; Remove Blank ID Card from Magic Knight's current inventory... 34430 LD B,5 ; ... 34432 CALL 36254 ; ... 34435 POP HL ; Restore HL (pointer to start of Magic Knight's current inventory) 34436 LD C,3 ; Load Valid ID Card into the first empty inventory slot of Magic Knight... 34438 LD B,5 ; ... 34440 CALL 33516 ; ... 34443 LD A,(23451) ; Set I.D. Card Validated Flag... 34446 OR 16 ; ... 34448 LD (23451),A ; ... 34451 LD HL,45771 ; Point HL at "YOU HAVE HAD AN ACCIDENT WITH THE GLUE..." text 34454 LD DE,37227 ; Adjust height of window 17 to accommodate text... 34457 CALL 33774 ; ... 34460 PUSH HL ; Store HL (pointer to start of text) 34461 LD A,17 ; Draw Window 17 as a Menu Window... 34463 CALL 34982 ; ... (bug) 34466 POP HL ; Restore HL (pointer to start of text) 34467 CALL 34762 ; Print text to screen 34470 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed *34473 LD A,(23701) ; If Magic Knight's current room is not 24 (The Control Column, USS Pisces, 6A)... 34476 CP 24 ; ... 34478 RET NZ ; ...then return 34479 SET 1,(IY+88) ; Set "LAUNCH TYME MACHINE" Menu Command Flag (IY = 23610) 34483 RET ; Return ; Load C with Property of Index A for All Magic Knight's Carried Objects, OR-ed Together ; ; Used by the routine at #R34265. Input: A Index of required property of objects Output: C Flags of all objects ; held, OR-ed together c34484 LD (34500),A ; Modify instruction at #R34499 with index of required property 34487 LD IX,25164 ; Point IX at Magic Knight's current inventory (carrying) 34491 LD BC,1280 ; Load B with 5 and C with 0 (i.e. reset all bits in C) *34494 LD A,(IX+0) ; If Magic Knight's current inventory slot is empty... 34497 OR A ; ... 34498 RET Z ; ...then return ; The operand of the instruction at #R34499 represents the index of the required property. This is modified by the ; instruction at #R34484. 34499 LD E,1 ; Load E with index of required property 34501 CALL 33525 ; Point HL to the E-th byte of the A-th record in Object Properties Table 34504 LD A,(HL) ; Load A with value of required property (flags)... 34505 OR C ; ...and set corresponding bits of C... 34506 LD C,A ; ... 34507 INC IX ; Advance IX to next inventory slot... 34509 DJNZ 34494 ; ...and loop back to #R34494 for next object 34511 RET ; Return ; Create List of Characters in Room A at 23404 and Load A with Number of Characters ; ; Used by the routine at #R34122. Input: A Room index Output: A Number of characters in room F Zero Flag set if ; no characters in room, reset otherwise c34512 LD (34541),A ; Modify instruction at #R34540 with room index 34515 PUSH HL ; Store HL 34516 PUSH BC ; Store BC 34517 PUSH DE ; Store DE 34518 PUSH IX ; Store IX 34520 LD A,255 ; Set A to 255 (End Marker) 34522 LD HL,23419 ; Point HL at end of Table of Characters in Room of Interest 34525 LD B,15 ; Load B with 15 (as we are clearing 15 entries in the list) *34527 LD (HL),A ; Set value at address in HL to 255 34528 DEC HL ; Move HL back one byte 34529 DJNZ 34527 ; Loop back to #R34527 34531 LD IX,25244 ; Point IX at start of Table of Characters' Current Positions at #R25244 34535 LD D,0 ; Set D (index of current character) to zero 34537 LD C,D ; Set C (count of characters in room of interest) to zero 34538 LD B,12 ; Load B with 12 (as there are 12 characters in the game) ; The operand of the instruction at #R34540 represents a room index. This is modified by the instruction at #R34512. *34540 LD A,0 ; Load A with room index 34542 CP (IX+0) ; If current character's current room is not the room of interest... 34545 JR NZ,34550 ; ...then skip ahead to #R34550 34547 INC C ; Increase C (count of number of characters in room of interest) 34548 LD (HL),D ; Load index of current character into address in HL 34549 INC HL ; Advance HL by one byte *34550 INC IX ; Advance IX to next character's position data... 34552 INC IX ; ... 34554 INC IX ; ... 34556 INC D ; Increase index of current character (i.e. advance to next character) 34557 DJNZ 34540 ; Loop back to #R34540 34559 LD A,C ; Load number of characters in room of interest into A 34560 OR A ; Set zero flag is there are no characters in room, otherwise reset 34561 POP IX ; Restore IX 34563 POP DE ; Restore DE 34564 POP BC ; Restore BC 34565 POP HL ; Restore HL 34566 RET ; Return ; Draw Strength Bar at Top of Screen ; ; Used by the routine at #R27703. c34567 LD A,35 ; If Magic Knight is not carrying the Mirror (35)... 34569 CALL 33645 ; ... 34572 RET NZ ; ...then return 34573 LD HL,16482 ; Point HL at Display File Address for top pixel row of cell at (2, 3) (characters) 34576 LD A,(25020) ; Load A with Magic Knight's strength 34579 CALL 28625 ; Divide A by eight, rounding down to nearest integer 34582 AND 15 ; If lowest four bits are reset (i.e. don't need to draw part of a character block)... 34584 JR Z,34603 ; ...then skip ahead to #R34603 34586 LD B,A ; Load number of full character blocks to draw into B 34587 LD A,255 ; Load A with 255 (draw row of eight pixels) *34589 PUSH HL ; Store HL (current Display File position in health bar block) 34590 PUSH BC ; Store BC (B = remaining number of full character blocks to draw) 34591 LD B,4 ; Load B with 4 (health bar has 4 stripes) *34593 LD (HL),A ; Draw a byte (i.e. a "block" of 8 health units) to health bar 34594 INC H ; Advance HL two rows down (as bar is made of alternating horizontal stripes)... 34595 INC H ; ... 34596 DJNZ 34593 ; Decrease B (number of stripes to draw) and loop back to #R34593 if not zero 34598 POP BC ; Restore BC (B = remaining number of full character blocks to draw) 34599 POP HL ; Restore HL (current Display File position in health bar block) 34600 INC HL ; Advance HL (horizontally) one character to draw next full block 34601 DJNZ 34589 ; Decrease B (remaining number of full character blocks to draw) and loop back to #R34589 if ; not zero *34603 LD A,(25020) ; Load A with Magic Knight's strength 34606 AND 7 ; Get fractional part (i.e. amount by which strength is more than a multiple of eight) 34608 JR NZ,34613 ; If this is not zero, then skip ahead to #R34613 34610 XOR A ; Set A to zero 34611 JR 34619 ; Skip ahead to draw the blank rows (see trivia) *34613 LD B,A ; Load fractional part of strength into B 34614 XOR A ; Set A to zero *34615 SCF ; Set the Carry Flag 34616 RRA ; Move carry Flag bit into MSB of A 34617 DJNZ 34615 ; Decrease B and loop back if not zero (i.e. place a bit at the LHS of A for each unit of ; strength that is left!) *34619 LD B,4 ; Load B with 4 (health bar has 4 stripes) *34621 LD (HL),A ; Draw a byte (i.e. a "block" of 8 health units) to health bar 34622 INC H ; Advance HL two rows down (as bar is made of alternating horizontal stripes)... 34623 INC H ; ... 34624 DJNZ 34621 ; Loop back to #R34621 to draw next row 34626 RET ; Return ; Draw Objects in Magic Knight's Inventory if he is Carrying the Mirror ; ; Used by the routine at #R27703. c34627 LD A,35 ; If Magic Knight is not carrying the Mirror (35)... 34629 CALL 33645 ; ... 34632 RET NZ ; ...then return 34633 LD HL,25164 ; Point HL at start of Magic Knight's current inventory (carrying) 34636 LD B,5 ; Load B with 5 (five inventory slots) 34638 LD DE,784 ; Load DE with x- and y-coordinates respectively to start drawing object graphics (D, or x = 3, ; E, or y = 16) *34641 PUSH BC ; Store BC (B = remaining number of inventory slots to process) 34642 PUSH HL ; Store HL (pointer to current position in Magic Knight's current inventory) 34643 PUSH DE ; Store DE (coordinates in characters to draw object) 34644 LD A,(HL) ; Load index of object in current slot in Magic Knight's inventory into A 34645 OR A ; If this is zero... 34646 JR Z,34693 ; ...then restore registers and return 34648 LD E,6 ; Load 6 (index of objects' attribute property) into E 34650 CALL 33525 ; Point HL at the attribute property of the object in the current inventory slot 34653 LD A,(HL) ; Load attribute into ATTR T system variable... 34654 LD (23695),A ; ... 34657 INC HL ; Advance HL to point to graphic index property... 34658 LD A,(HL) ; ...and load into A 34659 POP BC ; Restore BC (coordinates in characters to draw object, was in DE) 34660 PUSH BC ; Store BC (coordinates in characters to draw object) 34661 PUSH BC ; Store BC (coordinates in characters to draw object) 34662 CALL 54406 ; Draw an object with lookup index A at character coordinates (C, B) 34665 POP BC ; Restore BC (coordinates in characters to draw object) 34666 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) 34669 LD A,(23695) ; Load A with value stored in ATTR T system variable... 34672 LD (HL),A ; ...and apply this attribute to Attribute File at coordinates (C, B)... 34673 INC HL ; ... 34674 LD (HL),A ; ...(C + 1, B)... 34675 LD BC,31 ; ... 34678 ADD HL,BC ; ... 34679 LD (HL),A ; ...(C, B + 1)... 34680 INC HL ; ... 34681 LD (HL),A ; ...and (C + 1, B + 1) 34682 POP DE ; Restore DE (coordinates in characters to draw object) 34683 LD A,E ; Advance right by three characters (i.e. add three to x-coordinate in E)... 34684 ADD A,3 ; ... 34686 LD E,A ; ... 34687 POP HL ; Restore HL (pointer to current position in Magic Knight's current inventory) 34688 INC HL ; Advance HL to next inventory slot 34689 POP BC ; Restore BC (B = remaining number of inventory slots to process) 34690 DJNZ 34641 ; Decrease B, and loop back to #R34641 if not zero 34692 RET ; Return *34693 POP DE ; Restore DE (coordinates in characters to draw object) 34694 POP HL ; Restore HL (pointer to current position in Magic Knight's current inventory) 34695 POP BC ; Restore BC (B = remaining number of inventory slots to process) 34696 RET ; Return ; Splice Numeric Data A as a String into a String at HL ; ; Used by the routines at #R30533, #R30583, #R30643 and #R33657. Input: A Numeric value to put into string HL ; Address of string to modify c34697 PUSH HL ; Store HL (address of string to modify) 34698 LD HL,23464 ; Point HL at destination location for ASCII string 34701 LD B,0 ; Load numeric value into BC... 34703 LD C,A ; ... 34704 CALL 35591 ; Convert numeric value BC to ASCII string at address in HL (#R23464) 34707 LD HL,23466 ; Point HL at third digit in converted five-digit string 34710 LD C,2 ; Load C with 2 (as we can have up to two leading zeroes on a three-digit number) *34712 LD A,(HL) ; Load ASCII character at HL into A 34713 CP 48 ; If character is not a zero ("0")... 34715 JR NZ,34723 ; ...then skip ahead to #R34723 34717 LD (HL),32 ; Replace the zero character with a space (i.e. remove leading zeroes from number) 34719 INC HL ; Advance to next character in string 34720 DEC C ; Decrease C (number of remaining digits to process) 34721 JR NZ,34712 ; Loop back to #R34712 if there are still digits to process *34723 POP DE ; Restore pointer to "numeric text" (originally in HL at start of this routine) into DE 34724 LD HL,23466 ; Point HL at string just created 34727 LD BC,3 ; Splice ASCII string number just generated into "numeric data" text 34730 LDIR ; ... 34732 RET ; Return ; Print Text at Location HL to Screen Using Full Screen Width ; ; Used by the routines at #R28172 and #R54505. Input: HL Text to print c34733 LD A,(23495) ; Load A with x-coordinate of right edge of current window to draw (characters) 34736 PUSH AF ; Store AF (A = x-coordinate of right edge of current window) 34737 LD A,31 ; Set right-edge x-coordinate value at #R23495 to 31... 34739 LD (23495),A ; ... 34742 LD A,(23493) ; Load A with x-coordinate of left edge of current window to draw (characters) 34745 PUSH AF ; Store AF (A = x-coordinate of left edge of current window) 34746 XOR A ; Set left-edge x-coordinate value at #R23493 to zero... 34747 LD (23493),A ; ... 34750 CALL 34762 ; Print text at location HL to screen 34753 POP AF ; Restore x-coordinate of left edge of current window... 34754 LD (23493),A ; ...to #R23493 34757 POP AF ; Restore x-coordinate of right edge of current window... 34758 LD (23495),A ; ...to #R23495 34761 RET ; Return ; Print Text at Location HL to Screen ; ; Used by the routines at #R26745, #R26884, #R26926, #R27703, #R27750, #R27762, #R28506, #R28554, #R29756, #R30001, ; #R30123, #R30145, #R30686, #R31041, #R31188, #R31312, #R31468, #R31537, #R31688, #R32252, #R32895, #R33338, ; #R33725, #R33834, #R33952, #R34122, #R34265, #R34733, #R54283, #R54333, #R55115, #R55138, #R55364 and #R55685. ; Input: HL Points to text data to print c34762 LD IX,24005 ; Point IX at start of Temporary Text Buffer 34766 LD A,255 ; Prepare Recursion Depth Counter for loop... 34768 LD (23488),A ; ... ; This entry point is used by the routine at #R34887. *34771 LD A,(23488) ; Increase Recursion Depth Counter... 34774 INC A ; ... 34775 LD (23488),A ; ... 34778 PUSH HL ; Store HL 34779 CALL 54215 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 34782 POP HL ; Restore HL 34783 DEC HL ; Prepare pointer to text to print for loop ; This entry point is used by the routines at #R34858, #R34934 and #R36602. *34784 LD A,(23488) ; Start of loop - load Recursion Depth Counter into A... 34787 CP 255 ; ...and if this is 255 (i.e. no more text to print)... 34789 RET Z ; ...then return 34790 INC HL ; Advance to next character to be printed 34791 LD A,(HL) ; Get character from string 34792 OR A ; If character is a "0"... 34793 JP Z,34861 ; ...then return from current level of text printing 34796 CP 32 ; If the character is a "32" (SPACE)... 34798 JP Z,36602 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R34784 to load next word 34801 CP 31 ; If the character is a "31"... 34803 JP Z,34968 ; ...then print the Current Character's name 34806 CP 29 ; If the character is a "29"... 34808 JP Z,34958 ; ...then print the Current Object's name 34811 CP 28 ; If the character is a "28"... 34813 JP Z,34948 ; ...then print the Current Starship Location's name 34816 CP 19 ; If the character is a "19"... 34818 JP Z,34918 ; ...then toggle BRIGHT Flag then loop back to #R34784 for next data 34821 CP 18 ; If the character is a "18"... 34823 JP Z,34922 ; ...then toggle FLASH Flag then loop back to #R34784 for next data 34826 CP 17 ; If the character is a "17"... 34828 JP Z,34930 ; ...then change PAPER colour based upon following data byte then loop back to #R34784 for next ; data 34831 CP 16 ; If the character is a "16"... 34833 JP Z,34934 ; ...then change INK colour based upon following data byte then loop back to #R34784 for next ; data 34836 CP 14 ; If the character is a "14" (Carriage return / line feed to start of next character row down ; within window)... 34838 JP Z,36602 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R34784 to load next word 34841 CP 13 ; If the character is a "13" (Carriage return / line feed to start of next character row ; down)... 34843 JP Z,36602 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R34784 to load next word 34846 CP 91 ; If value is 91 or greater (i.e. special character)... 34848 JP NC,34887 ; ...then print an entry from the Common Words Table 34851 LD (IX+0),A ; Load character into temporary text buffer 34854 INC IX ; Advance to next position in temporary text buffer 34856 JR 34784 ; Loop back to #R34784 ; Return from recursive text-printing ; ; Used by the routine at #R34887. c34858 POP HL ; Restore HL (pointer to current position in text to print) 34859 JR 34784 ; Jump back into text printing routine to process next character in parent string ; Text Printing Return from current level of text printing ; ; Used by the routine at #R34762. c34861 PUSH AF ; Store AF 34862 LD A,(23488) ; Load Recursion Depth Counter into B... 34865 LD B,A ; ... 34866 POP AF ; Restore AF 34867 OR B ; If Recursion Depth Counter is not zero (i.e. we are not at the end of the top-level ; string)... 34868 JR NZ,34879 ; ...then skip ahead to 34879 34870 DEC A ; Decrease Recursion Depth Counter to 255, as we have reached the end of the top-level ; string... 34871 LD (23488),A ; ... 34874 LD A,255 ; Load A with 255 (End Marker) 34876 JP 36602 ; Print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump to ; #R34784 to return *34879 LD A,(23488) ; Decrease Recursion Depth Counter... 34882 DEC A ; ... 34883 LD (23488),A ; ... 34886 RET ; Return ; Text Printing Print an entry from the Common Words Table ; ; Used by the routines at #R34762 and #R34968. Input: A (Entry at #R34887 only) 91 + Index of required entry in ; Common Words Table A (Entry at #R34893 only) Index of required entry in list of texts HL (Entry at #R34893 only) ; Start address of a list of texts c34887 PUSH HL ; Store HL (pointer to current position in text to print) 34888 LD HL,43196 ; Point HL at start of Common Words Table 34891 SUB 91 ; Subtract 91 to get absolute index of required entry in table ; This entry point is used by the routines at #R34948 and #R34958. *34893 JR Z,34913 ; If index is zero (i.e. first entry is required) then skip ahead to #R34913 34895 CP 100 ; If index is at least 100... 34897 CALL NC,34976 ; ...then advance HL to second part of Common Words Table and subtract 100 from required index ; (see trivia) 34900 JR Z,34913 ; If index is zero (i.e. first entry is required) then skip ahead to #R34913 34902 LD B,A ; Load index into B *34903 PUSH BC ; Store BC (B = Remaining number of strings to skip, initially set to index of required entry ; in Common Words Table) 34904 LD BC,65535 ; Set BC to 65535 (repeat count for CPIR) 34907 XOR A ; Set A to zero 34908 CPIR ; Advance HL until (HL) = A, i.e. a zero (end of string) is found 34910 POP BC ; Restore BC (B = Remaining number of strings to skip) 34911 DJNZ 34903 ; Loop back to 34903 *34913 CALL 34771 ; Call text printing routine recursively to print the common word 34916 JR 34858 ; Restore HL (pointer to current position in text to print) then jump back into text printing ; routine to process next character in parent string ; Text Printing Toggle BRIGHT Flag ; ; Used by the routine at #R34762. c34918 LD B,64 ; Load B with 64 (BRIGHT flag) 34920 JR 34924 ; Skip ahead to 34924 (toggle BRIGHT flag, store ATTR T system variable and jump back to start ; of text printing loop to process next data byte) ; Text Printing Toggle FLASH Flag ; ; Used by the routine at #R34762. c34922 LD B,128 ; Load B with 128 (FLASH flag) ; This entry point is used by the routine at #R34918. *34924 LD A,(23695) ; Load A with current ATTR T system variable value 34927 XOR B ; Toggle FLASH flag 34928 JR 34942 ; Store ATTR T system variable and jump back to start of text printing loop to process next ; data byte ; Text Printing Change PAPER Colour ; ; Used by the routine at #R34762. c34930 LD B,199 ; Load B with attribute mask (FLASH, BRIGHT and all INK bits set, all PAPER bits reset) 34932 JR 34936 ; Change PAPER colour then jump back to start of text printing loop to process next data byte ; Text Printing Change INK Colour ; ; Used by the routine at #R34762. c34934 LD B,248 ; Load B with attribute mask (FLASH, BRIGHT and all PAPER bits set, all INK bits reset) ; This entry point is used by the routine at #R34930. *34936 INC HL ; Advance HL pointer to next byte in text data 34937 LD A,(23695) ; Load ATTR T system variable value into A 34940 AND B ; Apply mask to reset all INK bits 34941 OR (HL) ; Set INK bits as defined in next text data byte ; This entry point is used by the routine at #R34922. *34942 LD (23695),A ; Store new value of ATTR T 34945 JP 34784 ; Jump back to start of text printing loop to process next data byte ; Print the Current Starship Location's Name ; ; Used by the routine at #R34762. c34948 PUSH HL ; Store HL (current position in text data) 34949 LD HL,43031 ; Point HL at start of Table of Starship Destination Names 34952 LD A,(23700) ; Load A with Current Starship Location 34955 OR A ; Set Zero Flag if location index is zero 34956 JR 34893 ; Jump back to print this location's name ; Print the Current Object's Name ; ; Used by the routine at #R34762. c34958 PUSH HL ; Store HL (current position in text data) 34959 LD HL,42373 ; Point HL at start of Table of Object Names 34962 LD A,(29526) ; Load A with index of Current Object 34965 OR A ; Set Zero Flag is object index is zero 34966 JR 34893 ; Jump back to print this object's name ; Print the Current Character's Name ; ; Used by the routine at #R34762. c34968 LD A,(29632) ; Load A with index of Current Character 34971 ADD A,195 ; Add 195 (as 195 is the index of the first of the list of characters' names in the Common ; Words Table) 34973 JP 34887 ; Print an entry (A) from the Common Words Table ; Subtract 100 from Common Word Index and Jump to Second Part of Common Words Table ; ; This routine is redundant in that if it is skipped (via a RET at #R34976) the game continues to function normally. ; (See trivia) Input: A Index of common word required Output: A Modified common word index (as input, minus 100) c34976 LD HL,44061 ; Advance to second part of Common Words Table 34979 SUB 100 ; Subtract 100 from index required 34981 RET ; Return ; Draw a Menu Window ; ; Used by the routines at #R26745, #R26884, #R30001, #R30145, #R30686, #R31041, #R31537, #R31688, #R32895, #R33952, ; #R34122, #R34265 and #R55115. c34982 EX AF,AF' ; Swap AF register (A holds index of window to draw) 34983 LD A,105 ; Load the value 105 into #R35086 (i.e. set "Draw Menu (Hand) Cursor" 'flag' to true)... 34985 LD (35087),A ; ... 34988 JR 34996 ; Draw the window ; Draw a Window ; ; Used by the routines at #R26745, #R26884, #R26926, #R27703, #R27762, #R28506, #R28554, #R28696, #R29756, #R30145, ; #R31188, #R31312, #R31468, #R32252, #R32895, #R33338, #R33725, #R33834, #R33952, #R34122, #R54333, #R55138, ; #R55364 and #R55685. Input: A Index of window to draw c34990 EX AF,AF' ; Switch AF and AF' 34991 LD A,111 ; Reset "Draw Hand Menu Cursor" Flag (later in this routine)... 34993 LD (35087),A ; ... ; This entry point is used by the routine at #R34982. *34996 SET 1,(IY+65) ; Set Characters Free to Move Flag (IY = 23610) 35000 EX AF,AF' ; Restore original AF (with A being index of window) 35001 LD (54334),A ; Set this index as the "current" window index 35004 LD L,A ; Load HL with A value (index of required window)... 35005 LD H,0 ; ... 35007 ADD HL,HL ; Multiply index by eight (as each window's data takes up eight bytes in table at 37089)... 35008 ADD HL,HL ; ... 35009 ADD HL,HL ; ... 35010 LD BC,37089 ; Set BC to start of window data table 35013 ADD HL,BC ; Calculate location of start of required window's data 35014 LD E,(HL) ; Load E with x-coordinate of left edge (characters) 35015 INC HL ; Load C with x-coordinate of right edge (characters)... 35016 LD C,(HL) ; ... 35017 INC HL ; Load D with y-coordinate of top edge (characters)... 35018 LD D,(HL) ; ... 35019 INC HL ; Load B with y-coordinate of bottom edge (characters)... 35020 LD B,(HL) ; ... 35021 LD (23493),DE ; Store values for later use... 35025 LD (23495),BC ; ... 35029 INC HL ; Load A with window's upper edge border style... 35030 LD A,(HL) ; ... 35031 LD (54235),A ; Store for later use in routine at #R54231 35034 INC HL ; Load A with window's border attribute... 35035 LD A,(HL) ; ... 35036 EX AF,AF' ; Exchange AF and AF' 35037 INC HL ; Load A with starting y-coordinate of hand cursor... 35038 LD A,(HL) ; ... 35039 LD (23456),A ; Store for later use 35042 INC HL ; Load A with window's content attribute... 35043 LD A,(HL) ; ... 35044 LD (23481),A ; Store for later use 35047 EX AF,AF' ; Exchange AF and AF' (restoring border attribute to A and putting background colour in A') 35048 CALL 35123 ; Draw window frame 35051 LD HL,23493 ; Point HL at previously stored values 35054 INC (HL) ; Increase top-left x-coordinate 35055 INC HL ; Increase top-left y-coordinate... 35056 INC (HL) ; ... 35057 INC HL ; Decrease bottom-right x-coordinate... 35058 DEC (HL) ; ... 35059 INC HL ; Decrease bottom-right y-coordinate... 35060 DEC (HL) ; ... 35061 LD A,(23481) ; Load window content attribute into A 35064 LD (35948),A ; Prepare to fill a region with the attribute in A 35067 LD (23695),A ; Update ATTR T system variable with window content attribute 35070 CALL 35940 ; Fill a region of Attribute File with specified attribute 35073 CALL 35994 ; Blank the interior of the window (Display File) 35076 LD HL,23493 ; Load x-coordinate of left of interior of window into C... 35079 LD C,(HL) ; ... 35080 INC HL ; Load y-coordinate of top of interior of window into B... 35081 LD B,(HL) ; ... 35082 CALL 54132 ; Move Bitmap Virtual Cursor (bitmap) to top-left of interior or window and load address into ; HL 35085 PUSH HL ; Store HL (address in Display File of top-left of interior of window) ; The operand of the instruction at #R35086 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instructions at #R34985 and #R34993. 35086 LD A,0 ; Load A with "Draw Hand Menu Cursor" Flag 35088 CP 105 ; If value is not 105... 35090 JP NZ,35114 ; ...then jump to #R35114 (i.e. don't draw the hand cursor) ; Window is a menu (105) 35093 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 35097 LD A,(23456) ; Load A with starting y-coordinate of hand cursor 35100 ADD A,B ; Add y-coordinate of top of area to this... 35101 LD B,A ; ...and place back into B 35102 LD A,2 ; Load A with 2 (graphic lookup index of Menu Hand Cursor graphic in table at #R55950) 35104 LD DE,514 ; Load D (graphic width) with 2 and E (graphic height) with 2 35107 PUSH IX ; Store IX 35109 CALL 54414 ; Draw a Graphic with Lookup Index A at Character Coordinates (C, B) with width = E characters ; and height = D characters 35112 POP IX ; Restore IX *35114 XOR A ; Set A to zero 35115 LD (23479),A ; Set hand cursor's current y-coordinate to zero (i.e. defaults to top of its movement range ; within current window) 35118 POP HL ; Restore HL (address in Display File of top-left of interior of window) 35119 LD (54110),HL ; Set memory location to start printing character in character printing routine 35122 RET ; Return ; Draw a Window Frame ; ; Used by the routine at #R34990. c35123 LD (23695),A ; Store border attribute in ATTR T system variable 35126 LD A,(23493) ; Load A with x-coordinate of left of window 35129 LD C,A ; Copy into C 35130 LD A,(23495) ; Load A with x-coordinate of right of window 35133 SUB C ; Get distance between left and right coordinates 35134 DEC A ; Subtract 1 to get width of window top-edge (not including corner pieces) 35135 LD C,A ; Transfer this to BC... 35136 LD B,0 ; ... 35138 PUSH BC ; Store BC (width of top edge of window, not including corner pieces) 35139 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 35143 INC C ; Increase C by one (as top edge strictly starts one to the right of this x-coordinate - the ; left-most is actually a corner piece, not an edge) 35144 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35147 POP HL ; Restore HL (width of top edge of window, not including corner pieces) 35148 PUSH HL ; Store HL (width of top edge of window, not including corner pieces) 35149 HALT ; Wait for interrupt 35150 CALL 35285 ; Draw upper window frame edge then increment the border character index in routine at #R54231 35153 LD A,(23493) ; Load C with x-coordinate of left of window... 35156 LD C,A ; ... 35157 LD A,(23496) ; Load B with y-coordinate of bottom of window... 35160 LD B,A ; ... 35161 INC C ; Increase C by one (as bottom edge strictly starts one to the right of this x-coordinate - the ; left-most is actually a corner piece, not an edge) 35162 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35165 POP HL ; Restore HL (width of bottom edge of window)... 35166 CALL 35285 ; Draw lower window frame edge then increment the border character index in routine at #R54231 35169 LD A,(23494) ; Load y-coordinate of top of window into B... 35172 LD B,A ; ... 35173 LD A,(23496) ; Load y-coordinate of bottom of window into A 35176 SUB B ; Subtract B... 35177 DEC A ; ...and decrease by one to get length of left-edge (not including corner pieces) *35178 PUSH AF ; Store AF (A = remaining length of left / right edges) 35179 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 35183 ADD A,B ; Add A and B to get y-coordinate of character to draw in left edge... 35184 LD B,A ; ...and load into B 35185 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35188 LD A,(54235) ; Load A with index of character (left edge) to draw 35191 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 35194 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 35197 LD A,L ; Load A with LSB of Display File address (virtual attribute cursor location) 35198 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of character row)... 35200 LD L,A ; ...and place back in L 35201 LD A,(23495) ; Load A with x-coordinate of right edge of window (characters) 35204 OR L ; Add this x-coordinate to value in HL... 35205 LD L,A ; ... 35206 LD (54110),HL ; ...and update address of Bitmap Virtual Text Cursor 35209 LD A,(54235) ; Load A with index of character (left edge) to draw... 35212 INC A ; ...and increment index to get index of right-edge character 35213 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 35216 POP AF ; Restore AF (A = remaining length of left / right edges) 35217 DEC A ; Decrease remaining length 35218 JP NZ,35178 ; If remaining length is not zero then loop back to #R35178 35221 LD A,(23495) ; Load C with x-coordinate of right edge of window (characters)... 35224 LD C,A ; ... 35225 LD A,(23494) ; Load y-coordinate of top edge of window into B... 35228 LD B,A ; ... 35229 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35232 LD A,(54235) ; Load A with index of character (left-edge) to draw... 35235 INC A ; ...and increment (to get right-edge character) 35236 CALL 35291 ; Increment index again (to get top-right corner character) and store at #R54234 35239 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 35242 LD BC,(23495) ; Load B with y-coordinate of window's bottom edge and C with x-coordinate of window's ; right-edge 35246 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35249 CALL 35288 ; Increment index of window frame character currently in use to get bottom-right corner ; character 35252 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 35255 LD A,(23493) ; Load C with x-coordinate of left edge of current window to draw (characters)... 35258 LD C,A ; ... 35259 LD A,(23496) ; Load B with y-coordinate of window's bottom edge... 35262 LD B,A ; ... 35263 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35266 CALL 35288 ; Increment index of window frame character currently in use to get bottom-left corner ; character 35269 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 35272 LD BC,(23493) ; Load B with y-coordinate of top-edge of window and C with x-coordinate of left-edge of window 35276 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 35279 CALL 35288 ; Increment index of window frame character currently in use to get top-left corner character 35282 JP 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor and return ; Draw an upper or lower window frame edge then increment the border character index ; ; Used by the routine at #R35123. Input: A (Input, #R35291) Previous border edge character index used HL (Input, ; #R35285) Width of window edge to draw (characters, minus 1) c35285 CALL 54231 ; Draw an Edge of Frame of a Window ; This entry point is used by the routine at #R35123. *35288 LD A,(54235) ; Load A with window edge border character previously used ; This entry point is used by the routine at #R35123. *35291 INC A ; Increase index of window edge border character to use next... 35292 LD (54235),A ; ...and store at #R54234 35295 RET ; Return ; Process Keyboard / Joystick Input on a Menu and Load A with Selected Item Index ; ; Used by the routines at #R26670, #R26745, #R30001, #R30145, #R30686, #R31041, #R31537, #R31688, #R32895, #R33952, ; #R34122 and #R55115. Output: A Selected menu item index (zero-based) c35296 LD A,(35087) ; Check whether to draw hand cursor on menu... 35299 CP 105 ; ...and if not... 35301 RET NZ ; ...then return 35302 LD A,(23493) ; Load A with x-coordinate of left edge of current window to draw (characters)... 35305 LD (23489),A ; ...and store at #R23489 35308 INC A ; Increase by one character... 35309 LD (23490),A ; ...and store for later use 35312 LD A,(23456) ; Load starting y-coordinate of hand cursor into A... 35315 LD B,A ; and copy into B 35316 LD A,(23494) ; Load y-coordinate of current window's top-left corner into A... 35319 ADD A,B ; ...add to B... 35320 ADD A,A ; ...and multiply by 8 to get y-coordinate of top of hand cursor in pixels... 35321 ADD A,A ; ... 35322 ADD A,A ; ... 35323 LD (23491),A ; Then store for later use 35326 LD A,(23496) ; Load y-coordinate of current window's bottom edge into A... 35329 ADD A,A ; ...multiply by eight... 35330 ADD A,A ; ... 35331 ADD A,A ; ... 35332 ADD A,7 ; ...then add 7 to get y-coordinate of absolute bottom of window in pixels 35334 LD (23492),A ; ...and store for later 35337 LD A,(23494) ; Load y-coordinate of current window's top-left corner into A... 35340 LD B,A ; ...and copy into B 35341 LD A,(23496) ; Load y-coordinate of current window's bottom-right corner into A... 35344 SUB B ; ...subtract B... 35345 DEC A ; ...then subtract one to get height of window, not including frame 35346 LD B,A ; Copy this into B 35347 LD A,(23456) ; Load A with initial y-coordinate of hand cursor relative to current window... 35350 SUB B ; ...subtract B... 35351 NEG ; ...and negate to give vertical distance available to hand cursor to move 35353 ADD A,A ; Multiply this by eight to convert from characters to pixels... 35354 ADD A,A ; ... 35355 ADD A,A ; ... 35356 LD (23475),A ; ...and store at 23475 35359 LD A,(23479) ; Load A with current y-coordinate of hand cursor relative to its starting position (pixels)... 35362 CALL 35525 ; ...and invert INK and PAPER bits to highlight currently active menu item at this position ; This entry point is used by the routines at #R35397 and #R35459. *35365 CALL 54942 ; Capture keyboard or joystick input loading result into A 35368 HALT ; Wait for interrupt 35369 BIT 2,A ; If "up" pressed then... 35371 JP NZ,35397 ; ...jump to routine to move Hand Cursor up and update menu item highlighting 35374 BIT 3,A ; If "down" pressed then... 35376 JP NZ,35459 ; ...jump to routine to move Hand Cursor down and update menu item highlighting 35379 BIT 4,A ; If "fire" has not been pressed then... 35381 JR Z,35365 ; Loop back to #R35365 35383 JP 35497 ; Load A with (zero-based) index of selected menu item and return ; Wait for Fire Button / Key to be Released ; ; Used by the routines at #R30001, #R35497 and #R55138. c35386 PUSH AF ; Store AF *35387 HALT ; Wait for interrupt 35388 CALL 54942 ; Capture keyboard or joystick input loading result into A 35391 BIT 4,A ; If fire button / key pressed... 35393 JR NZ,35387 ; ...loop back to #R35387 35395 POP AF ; Restore AF 35396 RET ; Return ; Move Hand Cursor Up and Update Menu Item Highlighting ; ; Used by the routine at #R35296. c35397 LD A,(23479) ; Load menu hand cursor's current y-coordinate into A 35400 OR A ; If coordinate is zero... 35401 JP Z,35365 ; ...then jump to #R35365 (return to menu input handling routine) 35404 LD (23478),A ; Store y-coordinate (pixels) at #R23478 35407 PUSH AF ; Store AF (A = Menu Hand Cursor's y-coordinate, in pixels) 35408 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 35410 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 35411 RRCA ; ... 35412 RRCA ; ... 35413 AND 31 ; ... 35415 LD C,A ; Load this y-coordinate into C 35416 POP AF ; Restore AF (A = Menu Hand Cursor's y-coordinate, in pixels) 35417 DEC A ; Decrease y-coordinate (pixels) by two... 35418 DEC A ; ... 35419 LD (23479),A ; Store new y-coordinate (in pixels) 35422 PUSH BC ; Store BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 35423 CALL 55401 ; Scroll a region of the Display File up two pixel rows without wrapping... 35426 CALL 55401 ; ... ; This entry point is used by the routine at #R35459. *35429 POP BC ; Restore BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 35430 LD A,(23479) ; Load menu hand cursor's new y-coordinate (in pixels) into A 35433 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 35435 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 35436 RRCA ; ... 35437 RRCA ; ... 35438 AND 31 ; ... 35440 CP C ; If new y-coordinate of Menu Hand Cursor (in characters) is the same as its previous ; y-coordinate... 35441 JP Z,35365 ; ...then jump to #R35365 (return to menu input handling routine) 35444 LD A,(23478) ; Load A with previous y-coordinate in pixels... 35447 CALL 35525 ; ...and invert INK and PAPER bits to remove highlighting at this location 35450 LD A,(23479) ; Load A with new y-coordinate in pixels... 35453 CALL 35525 ; and invert INK and PAPER bits to apply highlighting at this location 35456 JP 35365 ; Jump to #R35365 (return to menu input handling routine) ; Move Hand Cursor Down and Update Menu Item Highlighting ; ; Used by the routine at #R35296. c35459 LD A,(23479) ; Load menu hand cursor's current y-coordinate into A 35462 LD HL,23475 ; If height available to Menu Hand Cursor to move down (in pixels, stored at #R23475) is the ; same as the cursor's current y-coordinate... 35465 CP (HL) ; ...i.e. the cursor cannot move any further down... 35466 JP Z,35365 ; ...then jump to #R35365 (return to menu input handling routine) 35469 LD (23478),A ; Store y-coordinate (pixels) at #R23478 35472 PUSH AF ; Store AF (A = Menu Hand Cursor's y-coordinate, in pixels) 35473 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 35475 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 35476 RRCA ; ... 35477 RRCA ; ... 35478 AND 31 ; ... 35480 LD C,A ; Load this y-coordinate into C 35481 POP AF ; Restore AF (A = Menu Hand Cursor's y-coordinate, in pixels) 35482 INC A ; Increase y-coordinate (pixels) by two... 35483 INC A ; ... 35484 LD (23479),A ; Store new y-coordinate (in pixels) 35487 PUSH BC ; Store BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 35488 CALL 55436 ; Scroll a region of the Display File down two pixel rows without wrapping... 35491 CALL 55436 ; ... 35494 JP 35429 ; Jump to #R35429 (update menu highlighting as appropriate then jump to menu input handling ; routine) ; Load A with (Zero-Based) Index of Selected Menu Item ; ; Used by the routine at #R35296. Output: A Selected menu item index (zero-based) c35497 CALL 35386 ; Wait for Fire Button / Key to be Released 35500 LD BC,(23476) ; Load BC with absolute coordinates (characters) of start of row of text of interest in menu 35504 LD A,(23456) ; Load C with initial y-coordinate of top of Hand Cursor relative to current window ; (characters)... 35507 LD C,A ; ... 35508 LD A,(23494) ; Load A with y-coordinate of top edge of current window (characters)... 35511 ADD A,C ; ...add C... 35512 INC A ; ...and add 1 to get absolute y-coordinate of first item in menu 35513 LD C,A ; Store y-coordinate in C 35514 LD A,B ; Load A with y-coordinate of row of text of interest in menu 35515 SUB C ; Subtract absolute y-coordinate of first item in menu to give zero-based index of selected ; item 35516 PUSH AF ; Store AF (A = selected item index) 35517 LD A,(23479) ; Load A with current y-coordinate of hand cursor relative to its starting position (pixels)... 35520 CALL 35525 ; ...and use to de-highlight selected menu item 35523 POP AF ; Restore AF (A = selected item index) 35524 RET ; Return ; Invert INK and PAPER bits to (De-)Highlight Currently Active Menu Item ; ; Used by the routines at #R35296, #R35397 and #R35497. Input: A y-coordinate of Menu Hand Cursor (pixels) c35525 PUSH AF ; Store AF (A = y-coordinate of Menu Hand Cursor) 35526 LD A,(23493) ; Load A with x-coordinate of left edge of current window to draw (characters) 35529 ADD A,2 ; Add 2, as Menu Hand Cursor is two characters wide... 35531 LD C,A ; ...and load into C (x-coordinate of start of row of text in menu) 35532 POP AF ; Restore AF (A = y-coordinate of Menu Hand Cursor) 35533 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 35535 CALL 28625 ; Divide this new y-coordinate by eight to get y-coordinate in characters 35538 LD B,A ; Load this y-coordinate into B 35539 LD A,(23456) ; Load initial y-coordinate of top of hand cursor relative to current window, into A 35542 ADD A,B ; Add this to y-coordinate of "finger" 35543 LD B,A ; Load this into B, so that B now contains y-coordinate of "finger" relative to top of window ; (characters) 35544 LD A,(23494) ; Load y-coordinate of top edge of current window into A 35547 ADD A,B ; Add... 35548 INC A ; ...then add one (for window frame at top) so we now have absolute y-coordinate of "finger" 35549 LD B,A ; Load into B 35550 LD (23476),BC ; Store coordinates at #R23476 35554 CALL 54148 ; Point HL at Attribute File address for character coordinates x=C, y=B 35557 LD A,(23493) ; Load B with x-coordinate of left edge of current window to draw (characters)... 35560 LD B,A ; ... 35561 LD A,(23495) ; Load A with x-coordinate of right edge of current window... 35564 SUB B ; ...and subtract x-coordinate of left edge to get width 35565 DEC A ; Decrease width by one to take into account window frame width... 35566 LD B,A ; ...and load into B 35567 LD A,(HL) ; Load attribute at current position in Attribute File into A 35568 AND 56 ; Reset INK, BRIGHT and FLASH bits, preserving PAPER only 35570 RRCA ; Shift PAPER bits into INK bit slots... 35571 RRCA ; ... 35572 RRCA ; ... 35573 LD C,A ; Store this value (new INK colour) in C 35574 LD A,(HL) ; Load attribute at current position in Attribute File into A 35575 RLCA ; Shift all bits right by three (i.e. INK bits now contain former PAPER colour)... 35576 RLCA ; ... 35577 RLCA ; ... 35578 AND 56 ; Reset INK, BRIGHT and FLASH bits, preserving PAPER only (i.e. PAPER bits now contain former ; INK colour) 35580 OR C ; Merge modified PAPER value back in, to give new attribute (i.e. swapped INK and PAPER ; colours)... 35581 LD C,A ; ...and load into C 35582 LD A,(HL) ; Load attribute at current position in Attribute File into A 35583 AND 192 ; Reset INK and PAPER bits, preserving BRIGHT and FLASH only... 35585 OR C ; ...and merge in swapped INK and PAPER values *35586 LD (HL),A ; Write this new attribute value back to the Attribute File 35587 INC HL ; Advance HL to next byte in Attribute File 35588 DJNZ 35586 ; Decrease B (remaining number of characters to invert) and loop back to #R35586 for next ; character block 35590 RET ; Return ; Convert Numeric Value BC to ASCII String at Location HL ; ; Used by the routine at #R34697. Input: BC A numeric value HL Points to location to hold a five-character string c35591 PUSH DE ; Store DE 35592 LD DE,53419 ; Point DE at table of powers of ten 35595 PUSH BC ; Store BC (value) 35596 PUSH HL ; Store HL (location to hold string) 35597 PUSH HL ; Store HL (location to hold string) 35598 LD H,B ; Load BC (value) into HL... 35599 LD L,C ; ... *35600 EX DE,HL ; Swap DE (now value) and HL (now pointer to table of powers of ten) 35601 LD C,(HL) ; Read WORD at HL (power of ten) into BC... 35602 INC HL ; ...and advance HL by two bytes... 35603 LD B,(HL) ; ... 35604 INC HL ; ... 35605 EX DE,HL ; Swap DE (now pointer to next power of ten) and HL (now value) 35606 LD A,47 ; Load A with 47 (ASCII code immediately prior to that for zero, "0") *35608 INC A ; Increase A to next ASCII character 35609 OR A ; (Re)Set carry flag 35610 SBC HL,BC ; Subtract (BC [power of ten] + carry flag) from HL (value) 35612 JR NC,35608 ; If carry flag was not set then loop back to #R35608 35614 ADD HL,BC ; Add power of ten back to HL 35615 EX (SP),HL ; Swap value on top of stack (now remaining value) with HL (now location to hold string) 35616 LD (HL),A ; Store ASCII code in string and advance HL to next slot... 35617 INC HL ; ... 35618 EX (SP),HL ; Swap value on top of stack (pointer to current position in string) with HL (now remaining ; value) 35619 DEC C ; Decrease C to check if last power of ten (i.e. 1) has been reached... 35620 JR NZ,35600 ; ...and if not, then loop back to #R35600 for next power of ten 35622 POP HL ; Restore HL 35623 POP HL ; Restore HL 35624 POP BC ; Restore BC 35625 POP DE ; Restore DE 35626 RET ; Return ; Clear Display File Below 7th Character Row (Play Area) ; ; Used by the routine at #R27762. c35627 LD HL,16608 ; Load HL with Display File address corresponding to (0, 7) (characters)... 35630 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 35633 LD HL,32 ; Load HL (width parameter) with 32 35636 LD A,L ; Load A with 32 (SPACE character code)... 35637 LD (54235),A ; ...and modify instruction at #R54234 with this operand 35640 CALL 54231 ; Draw 32 SPACE characters across the screen to clear bottom character row of top third of ; Display File, then set HL to zero 35643 LD BC,8 ; Clear bottom two thirds of Display File... 35646 JP 35656 ; ... ; Clear Display File ; ; When this routine is entered via #R35649 and #R35656, B is set to zero. Upon reaching the DJNZ instruction (end of ; inner loop) at #R35664, B is already zero, so the loop will execute 256 times, clearing one twelfth of the Display ; File (two bytes cleared per PUSH, 256 PUSHes per loop). c35649 LD HL,0 ; Load zero (all bits reset) into HL 35652 LD BC,12 ; Load B with 0 (repeat inner loop 256 times) and C with 12 (repeat outer loop 12 times) 35655 DI ; Disable interrupts ; This entry point is used by the routine at #R35627. *35656 LD (35670),SP ; Store stack pointer at #R35669 35660 LD SP,22528 ; Point stack pointer at start of attribute section of video memory ; This entry point is used by the routine at #R28716. *35663 PUSH HL ; Decrease current stack pointer position by two and load two zeroes into it 35664 DJNZ 35663 ; Loop back for next iteration 35666 DEC C ; Decrease C... 35667 JR NZ,35663 ; ...and repeat if C is still greater than zero, to clear the remaining eleven twelfths of the ; Display File 35669 LD SP,0 ; Restore stack pointer to original value [Operand set by instructions at #R28717 and #R35656] 35672 EI ; Enable interrupts 35673 RET ; Return ; Flood Attribute File with Value in ATTR T System Variable ; ; Used by the routine at #R26884. Input: A (Input, entry at #R35677) Attribute to flood Attribute File with c35674 LD A,(23695) ; Load ATTR T system variable into A ; This entry point is used by the routine at #R31468. *35677 LD HL,22528 ; Load HL with start of attribute section of video memory 35680 LD DE,22529 ; Load DE with next byte up 35683 LD BC,767 ; Load BC with length of data to copy (767 bytes = length of attribute area of video memory ; minus one) 35686 LD (HL),A ; Load memory at HL with this attribute... 35687 LDIR ; ...and repeat 767 times 35689 RET ; Return ; Set Parameters for and Play Upward Scale Sound ; ; The value of A (set to zero at the start of this routine, or set to 1 before jumps from other routines into ; #R35695) is a delay constant that determines the speed at which the sound is played. Input: A (Entry at #R35695 ; only) Delay constant c35690 XOR A ; Set A to 0 35691 LD B,13 ; Set B to 13 (DEC C) 35693 LD H,A ; Set HL to 0... 35694 LD L,A ; ... ; This entry point is used by the routines at #R35723 and #R35731. *35695 LD (35709),A ; Modify instruction at #R35708 with value of delay constant 35698 LD A,B ; Load B into A 35699 LD (35717),A ; Set instruction at #R35717 35702 LD (35718),HL ; Set instructions at #R35718 and #R35719 35705 CALL 35819 ; Load A with current border colour ; The operand of the instruction at #R35708 represents the value of the delay constant. This is modified by the ; instruction at #R35695. 35708 LD C,0 ; Load C with delay constant *35710 OUT (254),A ; Set border colour, and reset ear/speaker 35712 XOR 16 ; Invert ear/speaker bit of A 35714 LD B,C ; Load C (delay constant) into B... *35715 DJNZ 35715 ; ...and delay ; The instructions at #R35717 - #R35719 represent the manipulation of the delay constant between iterations of this ; routine. These instructions may decrease C by one, increase C by three or do nothing. These instructions are ; modified by the instructions at #R35699 and #R35702. 35717 DEC C ; Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone ; respectively 35718 NOP ; Do nothing, or increase delay constant (modified by instruction at 35702) 35719 NOP ; Do nothing, or increase delay constant (modified by instruction at 35702) 35720 JR NZ,35710 ; If delay constant is not zero, then loop back to continue playing tone 35722 RET ; Return ; Set Parameters for and Play Downward Scale Sound ; ; Used by the routines at #R26884, #R30001, #R32694 and #R33952. c35723 XOR A ; Set parameters... 35724 LD B,12 ; ...(INC C)... 35726 LD H,A ; ... 35727 LD L,A ; ... 35728 INC A ; ... 35729 JR 35695 ; ...and play sound ; Set Parameters for and Play Short Downward Scale Sound ; ; Used by the routine at #R34122. c35731 LD A,1 ; Set parameters... 35733 LD B,12 ; ...(INC C)... 35735 LD H,B ; ... 35736 LD L,B ; ... 35737 JR 35695 ; ...and play sound ; Play Hiss-Type Sound ; ; Used by the routines at #R55115 and #R55138. c35739 CALL 35819 ; 35742 EX AF,AF' ; 35743 LD H,0 ; 35745 LD BC,128 ; *35748 EX AF,AF' ; 35749 OUT (254),A ; 35751 XOR 16 ; 35753 EX AF,AF' ; 35754 LD L,0 ; 35756 LD D,L ; 35757 LD E,H ; 35758 AND A ; 35759 SBC HL,DE ; 35761 SBC HL,DE ; 35763 LD DE,254 ; 35766 ADD HL,DE ; 35767 LD A,L ; 35768 SUB H ; 35769 JR C,35772 ; 35771 DEC A ; *35772 LD H,A ; *35773 DEC A ; 35774 JR NZ,35773 ; 35776 DEC BC ; 35777 LD A,B ; 35778 OR C ; 35779 JR NZ,35748 ; 35781 RET ; ; Set Parameters (for "USS Pisces has Arrived" sound) and Jump to Playing Routine ; ; Used by the routine at #R31688. c35782 LD HL,8390 ; Load HL with bytecodes for instruction "ADD A,32" 35785 LD DE,255 ; Load D with 0 and E with 255 35788 JR 35796 ; Jump to audio playing routine ; Set Parameters (for Cheat / Debug Routine Sound) and Play ; ; Used by the routine at #R55768. c35790 LD HL,1222 ; Load HL with bytecodes for instruction "ADD A,4" 35793 LD DE,0 ; Load D with 0 and E with 0 ; This entry point is used by the routine at #R35782. *35796 CALL 35819 ; Load A with current border colour 35799 LD (35811),HL ; Set instruction at #R35811 to "ADD A,4" or "ADD A,32" depending upon value in HL *35802 OUT (254),A ; Set current border colour and reset speaker state 35804 XOR 16 ; Flip "speaker" bit 35806 LD B,E ; Copy E into B *35807 DJNZ 35807 ; Delay for period determined by B 35809 EX AF,AF' ; Switch AF and AF' 35810 LD A,E ; Copy E into A 35811 XOR 128 ; Change E (delay constant)... 35813 LD E,A ; ... 35814 EX AF,AF' ; Switch AF and AF' again 35815 DEC D ; Decrease D (initially zero)... 35816 JR NZ,35802 ; ...and repeat loop (256 times) 35818 RET ; Return ; Get Current Border Colour in A ; ; Used by the routines at #R35690, #R35739 and #R35790. Output: A Current border colour (0 - 7) c35819 LD A,(23624) ; Get border & BASIC cursor area attribute 35822 RRCA ; Clear bits for 1, 2 and 4 to leave (border colour * 8) only... 35823 RRCA ; ... 35824 RRCA ; ... 35825 AND 7 ; Ensure all other bits are cleared 35827 RET ; Return ; Display Acceleration / Deceleration Effect on USS Pisces Viewscreen ; ; Used by the routines at #R32065 and #R32124. c35828 LD HL,2055 ; Set x- and y-coordinates of top-left of region to fill to (7, 8)... 35831 LD (23493),HL ; ... 35834 LD HL,4376 ; Set x- and y-coordinates of bottom-right of region to fill to (24, 17)... 35837 LD (23495),HL ; ... 35840 LD A,71 ; Set attribute to use in fill to 71 (white INK, black PAPER, BRIGHT)... 35842 LD (35948),A ; ... 35845 HALT ; Wait for interrupt 35846 CALL 35940 ; Fill the defined region of Attribute File (i.e. viewscreen contents) with attribute 71 35849 CALL 35882 ; Draw Viewscreen "tunnel" rectangles 35852 XOR A ; Set attribute to use in fill to 0 (black INK, black PAPER)... 35853 LD (35948),A ; ... 35856 LD B,16 ; Load B with 16 (repeat counter) *35858 PUSH BC ; Store BC (B = remaining number of attribute updates) 35859 LD A,(35948) ; Add eight to attribute value used to fill viewscreen contents (i.e. increment PAPER ; component)... 35862 ADD A,8 ; ... 35864 AND 56 ; Ensure that INK, BRIGHT and FLASH bits are all reset 35866 OR 71 ; Set INK component to WHITE and set BRIGHT flag 35868 LD (35948),A ; Store updated attribute value 35871 HALT ; Wait for interrupt 35872 CALL 35940 ; Fill the defined region of Attribute File (i.e. viewscreen contents) with current attribute ; value 35875 POP BC ; Restore BC (B = remaining number of attribute updates) 35876 DJNZ 35858 ; Decrease remaining number of attribute updates and loop back to #R35858 if not zero 35878 CALL 35882 ; Draw Viewscreen "tunnel" rectangles 35881 RET ; Return ; Draw Viewscreen "Tunnel" Rectangles ; ; Used by the routine at #R35828. c35882 LD HL,35903 ; Point HL at Table of Definitions (Coordinates) of Viewscreen "Tunnel" Rectangles *35885 LD A,(HL) ; Load A with x-coordinate of right edge of rectangle... 35886 OR A ; ...and if this is zero... 35887 RET Z ; ...then return 35888 LD E,A ; Load E with x-coordinate of right edge of rectangle 35889 INC HL ; Advance HL to y-coordinate of bottom edge of rectangle... 35890 LD D,(HL) ; ...and load into D 35891 INC HL ; Advance HL to x-coordinate of left edge of rectangle... 35892 LD C,(HL) ; ...and load into C 35893 INC HL ; Advance HL to y-coordinate of top edge of rectangle... 35894 LD B,(HL) ; ...and load into B 35895 PUSH HL ; Store HL (current position in rectangle definition data) 35896 CALL 36573 ; Draw a Rectangle with Opposite Vertices at (C, B) and (E, D) (Pixels) 35899 POP HL ; Restore HL (current position in rectangle definition data) 35900 INC HL ; Advance HL to start of next rectangle's definition data 35901 JR 35885 ; Loop back to #R35885 to draw next rectangle ; Table of Definitions (Coordinates) of Viewscreen "Tunnel" Rectangles b35903 DEFB 121,74,135,66 35907 DEFB 114,78,142,62 35911 DEFB 107,82,149,58 35915 DEFB 100,86,156,54 35919 DEFB 93,90,163,50 35923 DEFB 86,94,170,46 35927 DEFB 79,98,177,42 35931 DEFB 72,102,184,38 35935 DEFB 65,106,191,34 35939 DEFB 0 ; End Marker ; Fill a Region of Attribute File with Specified Attribute (e.g. Background Colour and Colour of Text Within) ; ; Used by the routines at #R32158, #R32252, #R32602, #R34990 and #R35828. c35940 LD BC,(23493) ; Load BC with the coordinates of the top-left corner of the area to fill 35944 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) ; The operand of the instruction at #R35947 is an attribute value. This is modified by the instructions at #R32170, ; #R32411, #R32440, #R32613, #R35064, #R35842, #R35853 and #R35868. *35947 LD A,0 ; Load attribute to place into A 35949 LD (HL),A ; Apply attribute data to Attribute File address in HL 35950 LD A,(23495) ; Load A with x-coordinate of right side of area to fill 35953 CP C ; Check if left and right edges are at same x-coordinate (i.e. zero width)... 35954 JP Z,35970 ; ...and if so, skip to #R35970 35957 INC C ; Increase C 35958 LD A,C ; Copy C into A 35959 AND 31 ; Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen) 35961 LD C,A ; Place back into C 35962 LD A,L ; Get LSB of Attribute File address 35963 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of character row in Attribute File) 35965 ADD A,C ; Add x-offset (i.e. current x-coordinate, C) 35966 LD L,A ; Update HL with x-offset 35967 JP 35947 ; Loop back to #R35947 to print next attribute block *35970 LD A,(23493) ; Get x-coordinate of left of area to fill 35973 LD C,A ; Store in C 35974 LD A,(23496) ; Get y-coordinate of bottom of area to fill 35977 CP B ; Compare with y-coordinate of top of area to fill 35978 RET Z ; If no difference between current y-coordinate and y-coordinate of bottom of area to fill then ; exit function and return 35979 INC B ; Advance current y-coordinate down one unit 35980 LD A,B ; Copy current y-coordinate into A... 35981 CP 24 ; ...and ensure it doesn't exceed 24 (i.e. height of screen)... 35983 JP NZ,35988 ; ...if it doesn't then skip ahead to #R35988... 35986 LD B,0 ; ...else set current y-coord to zero (top of screen) *35988 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) 35991 JP 35947 ; Loop back to print next attribute block row ; Blank the Interior of an Area of the Display File (i.e. Set Bytes to Zero) ; ; Used by the routine at #R34990. c35994 PUSH IX ; Store IX 35996 LD BC,(23493) ; Load B with y-coordinate of top, and C with x-coordinate of left of area to fill 36000 LD DE,(23495) ; Load D with y-coordinate of bottom, and E with x-coordinate of right of area to fill 36004 LD L,C ; Load HL with x-coordinate of left of area to fill... 36005 LD H,0 ; ... 36007 LD (36054),HL ; ...and store as operand of instruction at #R36053 36010 LD A,D ; Load A with y-coordinate of bottom of area to fill... 36011 SUB B ; ...subtract B (y-coordinate of top of area to fill)... 36012 INC A ; ...and add one to give number of rows to fill 36013 ADD A,A ; Multiply A by eight to get number of pixel rows to fill... 36014 ADD A,A ; ... 36015 ADD A,A ; ... 36016 LD (36045),A ; ...and store as operand of instruction at #R36044 36019 LD A,B ; Load A with y-coordinate of top of area to fill (characters)... 36020 ADD A,A ; ...and multiply by eight to get y-coordinate in pixels... 36021 ADD A,A ; ... 36022 ADD A,A ; ... 36023 LD L,A ; Load y-coordinate (pixels) into HL... 36024 LD H,0 ; ... 36026 ADD HL,HL ; Double HL (as entries in table at #R26240 are two bytes wide) 36027 PUSH DE ; Store DE (coordinates of bottom right of area to fill) 36028 LD DE,26240 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 36031 ADD HL,DE ; Add HL as offset, in HL 36032 POP DE ; Restore DE (coordinates of bottom right of area to fill) 36033 PUSH HL ; Copy pointer to entry in table of Display File addresses for start of pixel row at top of ; area to fill from HL to IX... 36034 POP IX ; ... 36036 LD A,E ; Load A with x-coordinate of right of area to fill (characters)... 36037 SUB C ; ...subtract C (x-coordinate of left of area to fill)... 36038 LD L,A ; ...and load into HL... 36039 LD H,0 ; ... 36041 LD (36061),HL ; ...and store as operand of instruction at #R36060 ; The operand of the instruction at #R36044 represents the number of pixel rows to fill. This is modified by the ; instruction at #R36016. 36044 LD B,0 ; Load B with number of pixel rows to fill *36046 PUSH BC ; Store BC (B = remaining number of pixel rows to fill) 36047 LD L,(IX+0) ; Load HL with Display File address of start of current pixel row... 36050 LD H,(IX+1) ; ... ; The operand of the instruction at #R36053 represents the x-coordinate of the area to fill (characters). This is ; modified by the instruction at #R36007. 36053 LD BC,0 ; Load BC with x-coordinate of area to fill (characters)... 36056 ADD HL,BC ; ...and add to HL as offset 36057 PUSH HL ; Copy Display File address of left-most byte of top pixel row of area to fill from HL to DE... 36058 POP DE ; ... 36059 INC DE ; Advance DE to next address in Display File ; The operand of the instruction at #R36060 represents the width, minus 1, of the area to fill (characters). This is ; modified by the instruction at #R36041. 36060 LD BC,0 ; Load BC with width, minus 1, of area to fill (characters) 36063 LD (HL),0 ; Set content of this address to zero... 36065 LDIR ; ...and repeat for remaining BC addresses, clearing entire pixel row within specified ; x-coordinates 36067 POP BC ; Restore BC (B = remaining number of pixel rows to fill) 36068 INC IX ; Advance IX by two bytes to point to start address of next pixel row down in Display File... 36070 INC IX ; ... 36072 DJNZ 36046 ; Decrease B (remaining number of pixel rows to fill) and loop back to #R36046 if not zero 36074 POP IX ; Restore IX 36076 RET ; Return ; Draw all Objects in Magic Knight's Current Room ; ; Used by the routine at #R28101. c36077 LD IX,25286 ; Point IX at start of Objects' Current Positions Table 36081 LD C,0 ; Set current object to zero 36083 LD B,36 ; Set counter to 36 (as there are 37 objects, including "Nothing at All", but the last, the "10 ; MW Laser" never appears outside Klink's inventory) *36085 LD A,(23701) ; Load A with Magic Knight's current room 36088 CP (IX+0) ; If object and Magic Knight are in the same room... 36091 CALL Z,36115 ; ...then set Terrain Interaction Data for character blocks spanned by that object and draw 36094 INC C ; Increase C 36095 INC IX ; Advance to next object... 36097 INC IX ; ... 36099 INC IX ; ... 36101 DJNZ 36085 ; ...and loop back to #R36085 for next object 36103 RET ; Return ; Set Terrain Interaction Data for Character Blocks Spanned by an Object and Draw the Object ; ; Used by the routine at #R30145. Input: A Index of object to draw (entry at #R36104 only) B y-coordinate (entry ; at #R36104 only) C x-coordinate (entry at #R36104 only) IX Position data for an object (entry at #R36115 only) c36104 LD IX,23296 ; Store object's position data temporarily at 23296 - 23298... 36108 LD (IX+1),C ; ...x-coordinate... 36111 LD (IX+2),B ; ...y-coordinate... 36114 LD C,A ; Load index of object of interest into C ; This entry point is used by the routine at #R36077. *36115 PUSH BC ; Store BC 36116 PUSH IX ; Store IX 36118 LD A,C ; Load HL with eight times current object index... 36119 ADD A,A ; ... 36120 ADD A,A ; ... 36121 LD L,A ; ... 36122 LD H,0 ; ... 36124 ADD HL,HL ; ... 36125 LD DE,37448 ; Point DE at last byte (graphic index) of "Nothing at All" properties 36128 ADD HL,DE ; Add eight times current object index as offset 36129 LD A,(HL) ; Load graphic index into A 36130 PUSH AF ; Store AF (A = graphic index) 36131 DEC HL ; Move pointer back one byte to point at attribute of object... 36132 LD A,(HL) ; ... 36133 LD (23695),A ; ...and copy into System Variable ATTR T 36136 DEC HL ; Move pointer back one byte to point at object's Terrain Interaction Parameter... 36137 LD A,(HL) ; ...and store at #R23473... 36138 LD (23473),A ; ... 36141 DEC HL ; Move pointer back one byte to point at object's Attribute Flags... 36142 LD A,(HL) ; ...load into A... 36143 AND 15 ; ...clear upper four bits... 36145 LD (36184),A ; ...and store as operand of instruction at #R36183 36148 LD C,(IX+1) ; Load C with x-coordinate of current object 36151 LD B,(IX+2) ; Load B with y-coordinate of current object 36154 DEC B ; Decrease y-coordinate by one to point to object's top-left character block 36155 POP AF ; Restore AF (A = graphic index) 36156 PUSH IX ; Store IX (pointer to position data for object) 36158 PUSH BC ; Store BC (x- and y-coordinates of object's top-left character block) 36159 CALL 54406 ; Draw object with lookup index A at character coordinates (C, B) 36162 POP BC ; Restore BC (x- and y-coordinates of object's top-left character block) 36163 PUSH BC ; Store BC (x- and y-coordinates of object's top-left character block) 36164 LD A,B ; If object's y-coordinate is 4 (i.e. drawn in window at top while carrying mirror)... 36165 CP 4 ; ... 36167 JR Z,36176 ; ...then skip ahead to #R36176 36169 LD A,(23705) ; If Player Attribute Update Flag is reset (Player Attribute Ignore mode)... 36172 OR A ; ... 36173 JP Z,36211 ; ...then skip ahead to #R36211 *36176 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) 36179 LD A,(23695) ; Load E with value of system variable ATTR T... 36182 LD E,A ; ... ; The operand of the instruction at #R36183 represents the object's Attribute Flags. This is modified by the ; instruction at #R36145. 36183 LD A,0 ; Load A with object's Attribute Flags 36185 BIT 0,A ; If Paint Top-Left Flag is reset... 36187 JR Z,36190 ; ...then skip ahead to #R36190 36189 LD (HL),E ; Paint top-left character block of object with object attribute *36190 INC HL ; Increase HL to move to top-right character block 36191 BIT 1,A ; If Paint Top-Right Flag is reset... 36193 JR Z,36196 ; ...then skip ahead to #R36196 36195 LD (HL),E ; Paint top-right character block of object with object attribute *36196 LD BC,31 ; Advance HL by 31 bytes... 36199 ADD HL,BC ; ...to point to bottom-left character block of object 36200 BIT 2,A ; If Paint Bottom-Left Flag is reset... 36202 JR Z,36205 ; ...then skip ahead to #R36205 36204 LD (HL),E ; Paint bottom-left character block of object with object attribute *36205 INC HL ; Increase HL to move to bottom-right character block 36206 BIT 3,A ; If Paint Bottom-Right Flag is reset... 36208 JR Z,36211 ; ...then skip ahead to #R36211 36210 LD (HL),E ; Paint bottom-right character block of object with object attribute *36211 POP BC ; Store BC (x- and y-coordinates of object's top-left character block) 36212 CALL 54162 ; Point HL at terrain interaction data for character coordinates x=C, y=B 36215 LD A,(23473) ; Load E with object's Terrain Interaction Parameter... 36218 LD E,A ; ... 36219 LD A,(36184) ; Load A with object's Attribute Flags 36222 BIT 0,A ; If Paint Top-Left Flag is reset... 36224 JR Z,36227 ; ...then skip ahead to #R36227 36226 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; top-left character block *36227 INC HL ; Increase HL to move to top-right character block 36228 BIT 1,A ; If Paint Top-Right Flag is reset... 36230 JR Z,36233 ; ...then skip ahead to #R36233 36232 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; top-right character block *36233 LD BC,31 ; Advance HL by 31 bytes... 36236 ADD HL,BC ; ...to point to bottom-left character block of object 36237 BIT 2,A ; If Paint Bottom-Left Flag is reset... 36239 JR Z,36242 ; ...then skip ahead to #R36242 36241 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; bottom-left character block *36242 INC HL ; Increase HL to move to bottom-right character block 36243 BIT 3,A ; If Paint Bottom-Right Flag is reset... 36245 JR Z,36248 ; ...then skip ahead to #R36248 36247 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; bottom-right character block *36248 POP IX ; Restore IX (pointer to position data for object) 36250 POP IX ; Restore IX 36252 POP BC ; Restore BC 36253 RET ; Return ; Remove Object C from a Character's Inventory and Tidy Up Remaining Entries ; ; Used by the routines at #R29488, #R29619, #R29756, #R31537 and #R34265. Input: B Number of inventory slots to ; check C Index of object to be removed HL Pointer to a character's current inventory c36254 LD A,(HL) ; Load A with inventory object 36255 CP C ; If this matches index in C... 36256 JR Z,36262 ; ...then skip ahead to #R36262 36258 INC HL ; Advance to next inventory slot... 36259 DJNZ 36254 ; ...and loop back to #R36254 for next slot 36261 RET ; Return if object not found *36262 INC HL ; Advance to next inventory slot 36263 LD A,(HL) ; Load object at this slot into A 36264 DEC HL ; Move back to previous slot again 36265 LD (HL),A ; Place object from next slot into current one 36266 INC HL ; Advance to next slot again 36267 DJNZ 36262 ; Loop back to #R36262 (i.e. repeat for all remaining slots) 36269 DEC HL ; Move back to previous slot (i.e. final slot for this character)... 36270 XOR A ; ...and set to empty... 36271 LD (HL),A ; ... 36272 RET ; Return ; Reset Star to Point of Origin and Generate a New Direction and Movement Data ; ; Used by the routines at #R36321 and #R36415. Input: IX Points to an entry in table of stars' movement data at ; #R24832 c36273 CALL 55740 ; Set new random seed and load LSB of this (random value) into A and E 36276 AND 31 ; Discard bits five to seven 36278 SUB 15 ; Subtract 15 36280 LD B,A ; Load result into B (random number -15 to 16) (y-component of star's direction) 36281 CALL 55740 ; Set new random seed and load LSB of this (random value) into A and E 36284 AND 31 ; Discard bits five to seven 36286 SUB 15 ; Subtract 15 36288 LD C,A ; Load result into C (random number -15 to 16) (x-component of star's direction) 36289 LD A,128 ; Add to 128 (set bit 7) in C... 36291 ADD A,C ; ... 36292 LD C,A ; ...(random number 113 to 144) 36293 LD A,B ; Add 70 to B... 36294 ADD A,70 ; ... 36296 LD B,A ; ...(random number 55 to 86) 36297 CP 70 ; If A is not 70 (i.e. y-direction component is not zero)... 36299 JR NZ,36306 ; ...skip ahead to #R36306 36301 LD C,A ; If A (loaded into C) is 128... [bug: this instruction only executed if A is 87, so how could ; it ever be 128 here? This should actually be LD A,C, preventing stars having zero for both ; direction components] 36302 CP 128 ; ... 36304 JR Z,36273 ; ...then restart this routine to generate two new random numbers/seeds *36306 LD DE,18048 ; Load D (initial y-coordinate) with 70 and E (initial x-coordinate) with 128 36309 PUSH DE ; Store DE 36310 CALL 36434 ; Set up star's movement data based upon starting position and direction 36313 POP DE ; Restore DE 36314 LD (IX+0),E ; Set star's initial coordinates as (128, 70)... 36317 LD (IX+1),D ; ... 36320 RET ; Return ; Advance Positions of Stars on Viewscreen by One Timestep ; ; Used by the routine at #R31688. c36321 LD A,70 ; Load A with y-coordinate of viewscreen centre (pixels) 36323 RRCA ; Divide by 8 to get y-coordinate in characters... 36324 RRCA ; ... 36325 RRCA ; ... 36326 NEG ; Negate and add 21... 36328 ADD A,21 ; ...to adjust for fact that PLOT origin is at bottom-left of screen 36330 LD B,A ; Load y-coordinate (characters) into B 36331 LD A,128 ; Load A with x-coordinate of viewscreen centre (pixels) 36333 RRCA ; Divide by 8 to get x-coordinate in characters... 36334 RRCA ; ... 36335 RRCA ; ... 36336 LD C,A ; Load x-coordinate (characters) into C 36337 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B) (characters) 36340 LD (HL),0 ; Set attribute at this location to zero (black INK, black PAPER) to hide stars' origin 36342 LD IX,24832 ; Point IX at start of table of stars' movement data 36346 LD B,20 ; Load B with 20 (as there are 20 stars to process) *36348 PUSH BC ; Store BC (B = remaining number of stars to process) ; The operand of the instruction at #R36349 represents a delay constant. This is modified by the instruction at ; #R31975. 36349 LD C,0 ; Load C with delay constant, outer loop *36351 LD B,30 ; Load B with 30 (delay constant, inner loop) *36353 DJNZ 36353 ; Pause for 30 cycles 36355 DEC C ; Decrease C by one 36356 JR NZ,36351 ; If C is not zero then loop back to #R36351 36358 LD B,(IX+1) ; Load B with star's current y-coordinate 36361 LD C,(IX+0) ; Load C with star's current x-coordinate 36364 CALL 8933 ; PLOT the star to remove it from display (x=C, y=B) 36367 CALL 36499 ; Load BC with new (y,x) coordinates of a star depending upon the signs and magnitudes of its ; direction 36370 LD A,B ; If new y-coordinate is less than 33... 36371 CP 33 ; ... 36373 JR C,36388 ; ...then reset star to point of origin and generate a new direction and movement data and jump ; ahead to #R36406 36375 CP 112 ; If new y-coordinate is 112 or more... 36377 JR NC,36388 ; ...then reset star to point of origin and generate a new direction and movement data and jump ; ahead to #R36406 36379 LD A,C ; If new x-coordinate is less than 56... 36380 CP 56 ; ... 36382 JR C,36388 ; ...then reset star to point of origin and generate a new direction and movement data and jump ; ahead to #R36406 36384 CP 198 ; If new x-coordinate is less than 198... 36386 JR C,36393 ; ...then skip ahead to #R36393 *36388 CALL 36273 ; Reset star to point of origin and generate a new direction and movement data 36391 JR 36406 ; Advance to next star *36393 LD A,C ; If new x-coordinate is zero... 36394 AND A ; ... 36395 JR Z,36388 ; ...then reset star to point of origin and generate a new direction and movement data and jump ; ahead to #R36406 36397 LD (IX+0),C ; Update star's coordinates in table at #R24832 with new position data... 36400 LD (IX+1),B ; ... 36403 CALL 8933 ; PLOT the star to add it to display (x=C, y=B) *36406 POP BC ; Restore BC (B = remaining number of stars to process) 36407 LD DE,9 ; Advance IX by nine bytes to data for next star... 36410 ADD IX,DE ; ... 36412 DJNZ 36348 ; Decrease remaining number of stars to process and loop back to #R36348 36414 RET ; Return ; Reset All Stars to Point of Origin and Generate New Velocities and Movement Data ; ; Used by the routine at #R31688. c36415 LD IX,24832 ; Point IX at start of table of stars' movement data 36419 LD B,20 ; Load B with 20 (as there are 20 stars to process) *36421 PUSH BC ; Store BC (B = remaining number of stars to process) 36422 CALL 36273 ; Reset star to point of origin and generate a new direction and movement data 36425 LD DE,9 ; Load DE with 9 36428 ADD IX,DE ; Advance IX by 9 bytes 36430 POP BC ; Restore BC 36431 DJNZ 36421 ; Decrease B and repeat loop 36433 RET ; Return ; Set Up Star Movement Data Based Upon Starting Position and Direction ; ; Used by the routine at #R36273. Input: B y component of star direction added to initial y-coordinate (random ; number 55 to 86) C x component of star direction added to initial x-coordinate (random number 113 to 144) D ; Initial y-coordinate of star (70) (pixels) E Initial x-coordinate of star (128) (pixels) IX Points to an entry ; in table of stars' movement data at #R24832 c36434 LD A,B ; Load (DIR-Y + INIT-Y) into A 36435 SUB D ; Subtract initial y-coordinate to leave y-component of direction in A 36436 LD D,1 ; Set D to 1 (because star is moving up) 36438 JR NC,36444 ; If y-component is positive (i.e. star is moving up) then skip ahead to #R36444 36440 CPL ; Negate negative y-direction component... 36441 INC A ; ... 36442 LD D,255 ; Set D to -1 (because star is moving down) *36444 LD B,A ; Load magnitude of y-component into B 36445 LD A,C ; Load (DIR-X + INIT-X) into A 36446 SUB E ; Subtract initial x-coordinate to leave x-component of direction in A 36447 LD E,1 ; Set D to 1 (because star is moving 1 pixel right) 36449 JR NC,36455 ; If x-component is positive (i.e. star is moving right) then skip ahead to #R36455 36451 CPL ; Negate negative x-direction component... 36452 INC A ; ... 36453 LD E,255 ; Set E to -1 (because star is moving 1 pixel left) *36455 LD C,A ; Load magnitude of x-component into C 36456 LD (IX+3),D ; Store y-direction at byte 4 36459 LD (IX+2),E ; Store x-direction at byte 3 36462 LD (IX+5),D ; Store y-direction at byte 6 36465 LD (IX+4),E ; Store x-direction at byte 5 36468 LD A,C ; Load magnitude of x-component into A 36469 CP B ; If magnitude of y-component is less than or equal to magnitude of x-component... 36470 JR NC,36481 ; ...then skip ahead to #R36481 36472 LD (IX+8),C ; Store magnitude of x-component at byte 9 36475 LD (IX+2),0 ; Set byte 3 to zero 36479 JR 36491 ; Skip ahead to #R36491 *36481 OR C ; If magnitude of x-component is zero... 36482 RET Z ; ...then return 36483 LD (IX+8),B ; Store magnitude of y-component at byte 9 36486 LD B,C ; Load magnitude of x-component into B 36487 LD (IX+3),0 ; Store zero at byte 4 *36491 LD (IX+7),B ; Store magnitude of x-/y-component at byte 8 36494 LD A,B ; Load magnitude of x-/y-component into A... 36495 LD (IX+6),A ; ...and store at byte 7 36498 RET ; Return ; Move a Star Depending Upon the Signs and Magnitudes of its "Direction" ; ; Each time this routine runs, we add the smaller of the x- and y-magnitudes to the running "ratio" value in (IX+6). ; Input: IX Points to entry in Star Data table at #R24832 Output: B New y-coordinate to plot C New x-coordinate ; to plot c36499 LD A,(IX+6) ; Load current "ratio" value into A 36502 ADD A,(IX+8) ; Add smaller of x- and y-component magnitudes 36505 JR C,36512 ; If result is crosses the 255-0 boundary then skip ahead to #R36512 36507 CP (IX+7) ; If result is less than larger of x- and y-component magnitudes... 36510 JR C,36523 ; ...then skip ahead to #R36523 (move star only on axis with larger magnitude) *36512 SUB (IX+7) ; Subtract larger of x- and y-magnitudes 36515 LD H,(IX+5) ; Load y-step into H... 36518 LD L,(IX+4) ; ...and x-step into H (moving star on BOTH axes) 36521 JR 36529 ; Skip ahead to #R36529 *36523 LD H,(IX+3) ; Load 0 / y-step into H 36526 LD L,(IX+2) ; Load 0 / x-step into H *36529 LD (IX+6),A ; Update "ratio" value 36532 LD A,(IX+1) ; Add previous y-coordinate... 36535 ADD A,H ; ...to y-step... 36536 LD B,A ; ...in B 36537 LD A,(IX+0) ; Add previous x-coordinate... 36540 ADD A,L ; ...to x-step... 36541 LD C,A ; ...in C 36542 RET ; Return ; Draw a Line From (C, B) to (E, D) ; ; Used by the routines at #R28766 and #R36573. Input: B y-coordinate of start of line C x-coordinate of start of ; line D y-coordinate of end of line E x-coordinate of end of line c36543 LD (23677),DE ; Load contents of DE into system variable COORDS (start point of line) 36547 LD A,B ; Subtract y-coordinate of start of line from y-coordinate of end of line... 36548 SUB D ; ...to get delta-y 36549 LD D,1 ; Set direction of vertical change to +1 (upward) 36551 JR NC,36557 ; If delta-y is positive (i.e. upward) then skip ahead to #R36557 36553 CPL ; Multiply delta-y by -1 (downward) to get absolute magnitude... 36554 INC A ; ... 36555 LD D,255 ; Set direction of vertical change to -1 (downward) *36557 LD B,A ; Load B with magnitude of difference in y-coordinate between start and end of line 36558 LD A,C ; Subtract x-coordinate of start of line from y-coordinate of end of line... 36559 SUB E ; ...to get delta-x 36560 LD E,1 ; Set direction of horizontal change to +1 (rightward) 36562 JR NC,36568 ; If delta-x is positive (i.e. rightward) then skip ahead to #R36568 36564 CPL ; Multiply delta-x by -1 (leftward) to get absolute magnitude... 36565 INC A ; ... 36566 LD E,255 ; Set direction of vertical change to -1 (leftward) *36568 LD C,A ; Load C with magnitude of difference in x-coordinate between start and end of line 36569 CALL 9402 ; Draw the line (ROM routine) 36572 RET ; Return ; Draw a Rectangle with Opposite Vertices at (C, B) and (E, D) (Pixels) ; ; Used by the routine at #R35882. Input: B y-coordinate of vertex 1 C x-coordinate of vertex 1 D y-coordinate of ; vertex 2 E x-coordinate of vertex 2 c36573 PUSH DE ; Draw a line from (E, B) to (E, D)... 36574 PUSH BC ; ... 36575 LD C,E ; ... 36576 CALL 36543 ; ... 36579 POP BC ; ... 36580 POP DE ; ... 36581 PUSH DE ; Draw a line from (C, D) to (E, D)... 36582 PUSH BC ; ... 36583 LD B,D ; ... 36584 CALL 36543 ; ... 36587 POP BC ; ... 36588 POP DE ; ... 36589 PUSH DE ; Draw a line from (C, B) to (E, B)... 36590 PUSH BC ; ... 36591 LD D,B ; ... 36592 CALL 36543 ; ... 36595 POP BC ; ... 36596 POP DE ; ... 36597 LD E,C ; Draw a line from (C, B) to (C, D)... 36598 CALL 36543 ; ... 36601 RET ; Return ; Print word in Temporary Text Buffer to screen, wrapping text if necessary, then process next word ; ; This routine prints the string of characters stored in the Temporary Text Buffer. If the string is longer than the ; available space to the right of the Virtual Text Cursor, then the cursor is wrapped, moving down to the next ; character row and to the left edge of the current window. Input: A A word-ending character (e.g. a SPACE) from a ; character string IX Points to current position in Temporary Text buffer at #R24005 c36602 LD (IX+0),A ; Store character in temporary text buffer 36605 PUSH HL ; Store HL (pointer to current position in text to print) 36606 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 36609 LD A,L ; Load x-coordinate of the cursor into B, decreasing by one... 36610 DEC A ; ... 36611 AND 31 ; ... 36613 LD B,A ; ... 36614 LD A,(23495) ; Load x-coordinate of right edge of current window into A 36617 SUB B ; Subtract B to get distance to right-edge of window in A 36618 PUSH AF ; Store AF (A = distance to right-edge of window) 36619 LD HL,24005 ; Point HL at start of Temporary Text Buffer 36622 LD C,0 ; Set C to zero *36624 LD A,(HL) ; Load character from current position in Temporary Text Buffer into A 36625 CP 32 ; If character is 32 (SPACE)... 36627 JR Z,36645 ; ...then skip ahead to 36645 as end of word reached 36629 CP 13 ; If character is 13 (Carriage return / line feed to start of next character row down)... 36631 JR Z,36645 ; ...then skip ahead to 36645 as end of word reached 36633 CP 14 ; If character is 14 (Carriage return / line feed to start of next character row down within ; window)... 36635 JR Z,36645 ; ...then skip ahead to 36645 as end of word reached 36637 CP 255 ; If character is 255 (End Marker)... 36639 JR Z,36645 ; ...then skip ahead to 36645 as end of word reached 36641 INC C ; Increase C (number of characters to print) 36642 INC HL ; Advance to next character in Temporary Text Buffer 36643 JR 36624 ; Loop back to 36624 *36645 POP AF ; Restore AF (A = distance to right-edge of window) 36646 SUB C ; Subtract C (number of characters) 36647 CALL C,36731 ; If result is negative (i.e. more characters than space) then move Virtual Text Cursors ; (Attribute and Bitmap) down to left edge of next row of window 36650 LD HL,24004 ; Point HL at byte before start of Temporary Text Buffer *36653 INC HL ; Advance to next byte in Temporary Text Buffer 36654 LD A,(HL) ; Load character from current position in Temporary Text Buffer into A 36655 CP 255 ; If character is 255 (End Marker)... 36657 JR Z,36723 ; ...then skip ahead to 36723 (reset Temporary Text Buffer and load next word into it) 36659 CP 32 ; If character is 32 (SPACE)... 36661 JR Z,36704 ; ...then skip ahead to 36704 36663 CP 13 ; If character is 13 (Carriage return / line feed to start of next character row down)... 36665 JP Z,36691 ; ...then skip ahead to 36691 36668 CP 14 ; If character is 14 (Carriage return / line feed to start of next character row down within ; window)... 36670 JP Z,36699 ; ...then skip ahead to 36699 36673 CP 9 ; If character is 9 (Move Virtual Text Cursor right one character)... 36675 JP Z,36683 ; ...then skip ahead to 36683 36678 CALL 54097 ; Print the character 36681 JR 36653 ; Loop back to #R36653 ; Move Virtual Text Cursor right one character (9) *36683 PUSH HL ; Store HL (current position in Temporary Text Buffer) 36684 CALL 54176 ; Advance Bitmap Virtual Text Cursor right by one character 36687 POP HL ; Restore HL (current position in Temporary Text Buffer) 36688 JP 36653 ; Jump to 36653 for next character ; Carriage return / line feed to start of next character row down (13) *36691 CALL 54192 ; Advance Bitmap Virtual Text Cursor to start of next character row 36694 CALL 54215 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 36697 JR 36723 ; Skip ahead to 36723 (reset Temporary Text Buffer and load next word into it) ; Carriage return / line feed to start of next character row down within window (14) *36699 CALL 36731 ; Move Virtual Text Cursors (Attribute and Bitmap) down to left edge of next row of window 36702 JR 36723 ; Skip ahead to 36723 (reset Temporary Text Buffer and load next word into it) ; Print a SPACE (32) *36704 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 36707 LD A,L ; Strip out higher-order bits in L to leave only x-coordinate component... 36708 AND 31 ; ... 36710 LD L,A ; ... 36711 LD A,(23495) ; Load A with x-coordinate of right edge of current window plus one... 36714 INC A ; ... 36715 CP L ; If this is the same as the x-coordinate of the Bitmap Virtual Text Cursor... 36716 JR Z,36723 ; ...then skip ahead to 36723 (reset Temporary Text Buffer and load next word into it, i.e. no ; need to print a SPACE) 36718 LD A,32 ; Print a SPACE character (chr. 32)... 36720 CALL 54097 ; ... ; End Marker (255) *36723 POP HL ; Restore HL (pointer to current position in text to print) 36724 LD IX,24005 ; Point IX at start of Temporary Text Buffer 36728 JP 34784 ; Jump back to #R34784 to load next word into Temporary Text Buffer ; Move Virtual Text Cursors (Attribute and Bitmap) down to left edge of next row of window ; ; Used by the routine at #R36602. c36731 CALL 54192 ; Advance Bitmap Virtual Text Cursor to start of next character row 36734 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 36737 LD A,(23493) ; Load A with x-coordinate of left edge of window 36740 ADD A,L ; Add this to address in HL to move cursor to left edge of window... 36741 LD L,A ; ... 36742 LD (54110),HL ; ...and place the result back at #R54109 36745 CALL 54215 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 36748 RET ; Return ; List of Command Indices ; ; See trivia b36749 DEFB 0,1,2,3,4,5,6,7 36757 DEFB 8,9,10,11,12,13,14,15 ; Routine Start Addresses for Magic Knight's Commands (Main Menu) b36765 DEFW 29330 ; (00) - Process Command to Pick Up an Object 36767 DEFW 29488 ; (01) - Process Command to Drop an Object 36769 DEFW 29619 ; (02) - Process Command to Take an Object 36771 DEFW 29756 ; (03) - Process Command to Give an Object 36773 DEFW 30145 ; (04) - Process Command to Examine Yourself / A Character / An Object / USS Pisces 36775 DEFW 30686 ; (05) - Process Command to Command a Character 36777 DEFW 30940 ; (06) - Process Command to Launch Tyme Machine 36779 DEFW 29482 ; (07) - Unused [Set MK's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop] 36781 DEFW 30968 ; (08) - Process Command to Read an Object 36783 DEFW 29482 ; (09) - Unused [Set MK's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop] 36785 DEFW 31041 ; (10) - Process Command to Cast a Spell 36787 DEFW 29482 ; (11) - Unused [Set MK's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop] 36789 DEFW 31537 ; (12) - Process Command to Wear / Unwear an Object 36791 DEFW 31688 ; (13) - Process Command to Move Starship 36793 DEFW 32252 ; (14) - Process Command to Use Transporter 36795 DEFW 32895 ; (15) - Process Command to Communicate ; Magic Knight's Initial Data ; ; See also #R25156 for Magic Knight's Current Data b36797 DEFB 120 ; x-coordinate (pixels) 36798 DEFB 100 ; y-coordinate (pixels) 36799 DEFB 0 ; Unused 36800 DEFB 0 ; Index of current frame 36801 DEFB 0 ; x-velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 36802 DEFB 0 ; y-velocity (pixels) [jumping] 36803 DEFB 71 ; Attribute 36804 DEFB 0 ; Unused ; Characters' Initial Inventories ; ; See also #R25164 for Characters' Current Inventories b36805 DEFB 7,0,0,0,0 ; Magic Knight (carrying) 36810 DEFB 28,1,0,0,0 ; Magic Knight (wearing) 36815 DEFB 4,0,0,0,0 ; Gordon 36820 DEFB 14,0,0,0,0 ; Sarab 36825 DEFB 36,0,0,0,0 ; Klink 36830 DEFB 10,0,0,0,0 ; S3 E3 36835 DEFB 12,18,0,0,0 ; Hooper 36840 DEFB 20,0,0,0,0 ; Murphy 36845 DEFB 27,17,0,0,0 ; Sharon 36850 DEFB 0,0,0,0,0 ; Forbin 36855 DEFB 23,0,0,0,0 ; Derby IV 36860 DEFB 0,0,0,0,0 ; Swiftfoot 36865 DEFB 0,0,0,0,0 ; Julie 8 36870 DEFB 0,0,0,0,0 ; Hectorr ; Characters' Initial Positions ; ; Twelve groups of three bytes, one group per character (excluding Magic Knight). The values are: b36875 DEFB 1,10,19 ; Gordon 36878 DEFB 1,20,19 ; Sarab 36881 DEFB 2,4,19 ; Klink 36884 DEFB 3,4,19 ; S3 E3 36887 DEFB 23,20,19 ; Hooper 36890 DEFB 10,4,19 ; Murphy 36893 DEFB 6,4,19 ; Sharon 36896 DEFB 11,14,19 ; Forbin 36899 DEFB 3,12,19 ; Derby IV 36902 DEFB 15,7,19 ; Swiftfoot 36905 DEFB 12,4,19 ; Julie 8 36908 DEFB 15,4,19 ; Hectorr ; Objects' Initial Positions ; ; Thirty-seven groups of three bytes, one group per object. The values are: b36911 DEFB 99,0,0 ; (00) - Nothing at all 36914 DEFB 99,0,0 ; (01) - Cloak of Invisibility 36917 DEFB 99,10,22 ; (02) - Blank I.D. Card 36920 DEFB 99,2,22 ; (03) - Valid I.D. Card 36923 DEFB 99,0,22 ; (04) - Instant Film 36926 DEFB 99,0,22 ; (05) - Photograph (of Magic Knight) 36929 DEFB 5,5,14 ; (06) - Star Map 36932 DEFB 99,0,22 ; (07) - Gadget X 36935 DEFB 0,14,18 ; (08) - Camera 36938 DEFB 99,0,22 ; (09) - Photograph (of inside of starship) 36941 DEFB 99,0,22 ; (10) - Pot of Glue 36944 DEFB 4,15,14 ; (11) - 5W Resistor 36947 DEFB 99,0,22 ; (12) - Magic Talisman 36950 DEFB 99,0,22 ; (13) - Golden Sundial of Alpha 36953 DEFB 99,0,22 ; (14) - McTablet Food 36956 DEFB 99,0,22 ; (15) - Broken Glass 36959 DEFB 15,24,14 ; (16) - Quark Bomb 36962 DEFB 99,5,14 ; (17) - Advert 36965 DEFB 99,0,22 ; (18) - Part of a Sundial (1) 36968 DEFB 22,12,22 ; (19) - Part of a Sundial (2) 36971 DEFB 99,0,22 ; (20) - Part of a Sundial (3) 36974 DEFB 12,15,22 ; (21) - Brass Ankh 36977 DEFB 15,5,14 ; (22) - Pair of Boots 36980 DEFB 99,0,22 ; (23) - Chocolate Heart 36983 DEFB 5,20,14 ; (24) - Starfleet Manual 36986 DEFB 14,10,22 ; (25) - Ancient Scroll 36989 DEFB 3,1,22 ; (26) - Tower Fish 36992 DEFB 99,0,22 ; (27) - Gas Mask 36995 DEFB 99,0,22 ; (28) - Shield 36998 DEFB 15,16,22 ; (29) - Bag of Runes 37001 DEFB 14,21,22 ; (30) - Bag of Potatoes 37004 DEFB 5,4,14 ; (31) - Pewter Tankard 37007 DEFB 14,16,22 ; (32) - Axe 37010 DEFB 6,15,22 ; (33) - Wrist Terminal 37013 DEFB 4,5,14 ; (34) - Torch 37016 DEFB 2,25,22 ; (35) - Mirror 37019 DEFB 99,0,22 ; (36) - 10MW Laser ; Room Connectivity Data ; ; Two values per room: b37022 DEFB 255,1 ; (00) - USS Pisces, 0 (The Recreation Room) 37024 DEFB 0,2 ; (01) - USS Pisces, 1 (The Bridge) 37026 DEFB 1,3 ; (02) - USS Pisces, 2 (The Transporter Room) 37028 DEFB 2,4 ; (03) - USS Pisces, 3 (The Transputer Room) 37030 DEFB 3,5 ; (04) - USS Pisces, 4 (Cargo Hold) 37032 DEFB 4,6 ; (05) - USS Pisces, 5 (The Airlock) 37034 DEFB 5,255 ; (06) - USS Pisces, 6 (The Life Boat) 37036 DEFB 255,8 ; (07) - Retreat, 0 (Murphy's Moon) 37038 DEFB 7,9 ; (08) - Retreat, 1 37040 DEFB 8,10 ; (09) - Retreat, 2 (Barrier Room) 37042 DEFB 9,255 ; (10) - Retreat, 3 37044 DEFB 255,12 ; (11) - Starbase 1, 0 (The Transporter Room) 37046 DEFB 11,13 ; (12) - Starbase 1, 1 (McTablet Takeaway Food) 37048 DEFB 12,14 ; (13) - Starbase 1, 2 37050 DEFB 13,15 ; (14) - Starbase 1, 3 37052 DEFB 14,255 ; (15) - Starbase 1, 4 (Fuel and Cargo Area) 37054 DEFB 255,17 ; (16) - Outpost, 0 (Ye Olde Transporter) 37056 DEFB 16,18 ; (17) - Outpost, 1 (The Main Defence System) 37058 DEFB 17,19 ; (18) - Outpost, 2 37060 DEFB 18,20 ; (19) - Outpost, 3 (The Proof of Power) 37062 DEFB 19,255 ; (20) - Outpost, 4 (The Tyme Guardians) 37064 DEFB 255,22 ; (21) - Monopole, 0 (Hooper's Emergency Exit) 37066 DEFB 21,23 ; (22) - Monopole, 1 (This Way to Hooper ==>>) 37068 DEFB 22,255 ; (23) - Monopole, 2 (Here is Hooper) 37070 DEFB 5,255 ; (24) - USS Pisces, 6A (The Control Column) ; Store for address of current position in Magic Knight's y-velocities sequence table at 37074 b37072 DEFW 0 ; Magic Knight's y-Velocities Sequence for Jumping and Falling ; ; This is the sequence of y-velocity increments / decrements applied to Magic Knight's y-coordinate when he is ; jumping or falling. The data is zero-terminated. b37074 DEFB 7,7 37076 DEFB 6,6 37078 DEFB 5,5 37080 DEFB 4,4 37082 DEFB 3,3 37084 DEFB 2,2 37086 DEFB 1,1 37088 DEFB 0 ; Window Data ; ; Eight bytes per window. The meaning of the data is: b37089 DEFB 0,23,6,20,116,79,1,79 ; (00) Main Menu (Game) Window / "Choose Communication" Window 37097 DEFB 0,31,0,5,116,67,0,71 ; (01) Starship Summary Window (top of screen) 37105 DEFB 0,25,6,15,116,68,0,79 ; (02) 37113 DEFB 0,26,6,18,116,68,2,79 ; (03) 37121 DEFB 0,25,6,20,116,70,1,79 ; (04) List of objects window (menu or info) 37129 DEFB 5,26,16,21,116,66,0,70 ; (05) "KNIGHT-TYME A NEW GRAPHIC ADVENTURE..." window below Control Selection ; Window 37137 DEFB 4,27,3,12,116,70,0,69 ; (06) Control Selection Window 37145 DEFB 0,31,3,12,116,70,2,79 ; (07) "REDEFINE THE GAME" Window 37153 DEFB 3,28,2,12,116,84,0,14 ; (08) 37161 DEFB 5,26,0,12,116,115,0,69 ; (09) 37169 DEFB 0,23,6,9,116,68,0,71 ; (10) 37177 DEFB 0,19,6,10,116,76,0,70 ; (11) "EXECUTE / REJECT COMMAND" Window 37185 DEFB 0,16,6,10,116,98,0,104 ; (12) 37193 DEFB 0,18,6,9,116,67,0,70 ; (13) 37201 DEFB 4,27,21,23,116,70,0,205 ; (14) 37209 DEFB 0,31,0,5,116,70,0,69 ; (15) 37217 DEFB 0,15,6,13,116,98,1,112 ; (16) "EXAMINE WHAT?" Window 37225 DEFB 0,18,6,14,116,68,5,120 ; (17) 37233 DEFB 0,22,6,18,116,67,0,120 ; (18) "EXAMINE YOURSELF" / "EXAMINE CHARACTER" Window 37241 DEFB 17,20,9,14,116,68,0,71 ; (19) Frame around portrait of character on "EXAMINE CHARACTER" and "EXAMINE ; YOURSELF" windows 37249 DEFB 0,22,6,15,116,67,0,120 ; (20) "EXAMINE OBJECT" / "EXAMINE USS PISCES" Window 37257 DEFB 2,5,10,13,116,69,0,69 ; (21) Frame around object in "EXAMINE OBJECT" Window 37265 DEFB 0,31,14,23,116,67,0,79 ; (22) 37273 DEFB 0,22,6,13,116,77,2,78 ; (23) "WHICH COMMAND DO YOU WANT TO USE?" ("COMMAND [CHARACTER] TO...") ; Window 37281 DEFB 4,27,7,18,116,104,0,104 ; (24) Game Over Window 37289 DEFB 0,18,6,17,116,77,1,71 ; (25) "WHERE TO ?" Window / Speed Selection Window 37297 DEFB 16,23,10,16,116,104,0,120 ; (26) 37305 DEFB 0,26,6,16,116,87,2,87 ; (27) 37313 DEFB 0,10,6,9,116,104,0,104 ; (28) 37321 DEFB 0,19,6,9,116,68,2,71 ; (29) ; USS Pisces' Initial Stats ; ; See also USS Pisces' Current Stats at #R25012. b37329 DEFB 70 ; Life Support (%) 37330 DEFB 200 ; Star Drive Fuel 37331 DEFB 82 ; Impulse Drive (%) 37332 DEFB 50 ; Shields (%) 37333 DEFB 62 ; Transputer (%) 37334 DEFB 0 ; Unused 37335 DEFB 0 ; Unused 37336 DEFB 0 ; Unused ; Characters' Initial Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are capped at 100: b37337 DEFB 70,17,82,14,62,0,0,1 ; Magic Knight 37345 DEFB 100,70,30,148,0,0,68,2 ; Gordon 37353 DEFB 100,65,41,158,0,0,68,3 ; Sarab 37361 DEFB 100,60,52,128,70,70,6,4 ; Klink 37369 DEFB 100,55,63,128,69,70,6,5 ; S3 E3 37377 DEFB 100,50,74,200,68,0,69,6 ; Hooper 37385 DEFB 100,45,75,200,67,72,5,7 ; Murphy 37393 DEFB 100,40,76,200,70,69,4,8 ; Sharon 37401 DEFB 100,40,76,138,68,80,4,9 ; Forbin 37409 DEFB 100,100,100,128,0,0,70,10 ; Derby IV 37417 DEFB 100,50,50,200,67,71,4,11 ; Swiftfoot 37425 DEFB 100,50,50,200,70,72,4,12 ; Julie 8 (see trivia) 37433 DEFB 100,50,50,228,68,81,4,13 ; Hectorr ; Table of Object Properties ; ; Thirty seven groups of eight bytes, one group per object (including "Nothing at All"). The values are: b37441 DEFB 0,0,0,0,0,0,0,0 ; (00) - Nothing at all 37449 DEFB 33,72,0,0,0,0,1,33 ; (01) - Cloak of Invisibility 37457 DEFB 33,72,0,1,12,0,70,13 ; (02) - Blank I.D. Card 37465 DEFB 33,72,0,2,12,0,70,13 ; (03) - Valid I.D. Card 37473 DEFB 33,64,0,3,15,0,70,20 ; (04) - Instant Film 37481 DEFB 33,64,0,4,15,0,71,7 ; (05) - Photograph (of Magic Knight) 37489 DEFB 1,64,0,0,12,0,71,8 ; (06) - Star Map 37497 DEFB 33,64,0,0,15,0,70,29 ; (07) - Gadget X 37505 DEFB 1,72,0,0,15,0,70,12 ; (08) - Camera 37513 DEFB 33,64,0,6,15,0,71,6 ; (09) - Photograph (of inside of starship) 37521 DEFB 49,0,0,7,15,0,70,21 ; (10) - Pot of Glue 37529 DEFB 33,64,0,8,12,0,70,22 ; (11) - 5W Resistor 37537 DEFB 1,168,0,0,15,0,70,15 ; (12) - Magic Talisman 37545 DEFB 33,72,0,10,15,0,70,16 ; (13) - Golden Sundial of Alpha 37553 DEFB 33,64,0,9,12,0,71,27 ; (14) - McTablet Food 37561 DEFB 1,64,0,0,12,0,71,28 ; (15) - Broken Glass 37569 DEFB 33,96,0,14,15,0,7,25 ; (16) - Quark Bomb 37577 DEFB 33,64,0,12,15,128,70,4 ; (17) - Advert 37585 DEFB 1,64,0,0,4,0,70,31 ; (18) - Part of a Sundial (1) 37593 DEFB 1,64,0,0,4,0,70,31 ; (19) - Part of a Sundial (2) 37601 DEFB 1,96,0,0,4,0,70,31 ; (20) - Part of a Sundial (3) 37609 DEFB 1,72,0,0,15,0,68,23 ; (21) - Brass Ankh 37617 DEFB 34,72,0,11,13,0,66,11 ; (22) - Pair of Boots 37625 DEFB 33,64,0,5,15,0,66,3 ; (23) - Chocolate Heart 37633 DEFB 33,64,0,0,15,0,70,10 ; (24) - Starfleet Manual 37641 DEFB 1,64,0,0,15,0,71,9 ; (25) - Ancient Scroll 37649 DEFB 1,64,0,0,12,0,6,17 ; (26) - Tower Fish 37657 DEFB 1,72,0,0,15,0,7,32 ; (27) - Gas Mask 37665 DEFB 1,72,0,0,15,0,68,14 ; (28) - Shield 37673 DEFB 1,64,0,0,15,0,67,18 ; (29) - Bag of Runes 37681 DEFB 1,64,0,0,15,0,70,18 ; (30) - Bag of Potatoes 37689 DEFB 1,64,0,0,15,0,71,24 ; (31) - Pewter Tankard 37697 DEFB 65,96,0,0,15,0,70,26 ; (32) - Axe 37705 DEFB 33,72,0,13,12,0,70,19 ; (33) - Wrist Terminal 37713 DEFB 1,64,0,0,10,0,6,30 ; (34) - Torch 37721 DEFB 129,192,0,0,15,0,71,5 ; (35) - Mirror 37729 DEFB 1,64,0,0,12,0,69,15 ; (36) - 10MW Laser ; Initial Control Selection Menu Text b37737 DEFM 16,7,14 ; KEYBOARD KEMPSTON JOYSTICK CURSOR JOYSTICK SINCLAIR JOYSTICK 1 ; CHANGE GAME OPTIONS INSTRUCTIONS PLAY GAME 37740 DEFM 93,211,14 37743 DEFM 93,212,14 37746 DEFM 93,213,14 37749 DEFM 93,214,14 37752 DEFM 16,6,93,"CHANGE ",103," OPTIONS",14 37772 DEFM 16,5,93,95,"STRUCTIONS",14 37787 DEFM 93,"PLAY ",103 37794 DEFM 0 ; Instructions Text b37795 DEFM "AFTER RELEAS",207," GIMBAL ",116," " ; AFTER RELEASING GIMBAL THE WIZARD IN SPELLBOUND YOU FIND ; YOURSELF ABOARD THE USS PISCES A 25TH CENTURY STARSHIP ON ; A PEACEFUL TRADE MISSION. YOU MUST FIND A WAY TO RETURN ; TO YOUR OWN TIME. ** GOOD LUCK MAGIC KNIGHT ** 37818 DEFM "WIZARD ",95," ",132,105," F",95,"D " 37834 DEFM 105,"RSELF ABOARD ",116," ",146," " 37852 DEFM 97,"25TH CENTURY ",145," ON ",97 37872 DEFM "PEACEFUL TRADE MISSION.",14 37896 DEFM 105," MUST F",95,"D ",97,"WAY ",99,"RETURN " 37920 DEFM 99,105,"R OWN ",129,".",14 37931 DEFM "** GOOD LUCK ",144," **" 37950 DEFM 0 37951 DEFM 110," ",116," KEYS ",125,":-",91,14 ; THE KEYS ARE :- N = LEFT M = RIGHT A = JUMP/UP Z = ; DOWN - = MENU (FIRE) 37965 DEFM 190 37966 DEFM 0 37967 DEFM " TH",115,103," FEATURES",14 ; THIS GAME FEATURES WINDIMATION+ STARRING YOU AS MAGIC ; KNIGHT WITH GORDON SARAB KLINK S3 E3 HOOPER ; MURPHY SHARON FORBIN DERBY IV SWIFTFOOT JULIE 8 ; HECTORR (see trivia) 37982 DEFM 110," ",134,"+",14 37987 DEFM 110," ",16,4,18," STARR",207," ",18,92,14 38004 DEFM 16,7," ",105," AS ",144,14 38014 DEFM 110,110," ",16,5,"WITH",14 38025 DEFM 16,7," ",195,110," ",196,14 38033 DEFM " ",197,110," ",198,14 38040 DEFM " ",199,110," ",200,14 38046 DEFM " ",201,110," ",202,14 38052 DEFM " ",203," ",204,14 38058 DEFM " ",205,110,206 38062 DEFM 0 ; "REDEFINE THE GAME" Window Text b38063 DEFM 110,110,"REDEF",95,"E ",116," ",103,14 ; REDEFINE THE GAME REDEFINE KEYBOARD PLAYER ATTRIBUTE IGNORE ; PLAYER ATTRIBUTE UPDATE SAVE THE GAME LOAD AN OLD GAME 38077 DEFM 14,14 38079 DEFM 16,5,93,"REDEF",95,"E ",211,14 38092 DEFM 93,136,135,"IG",148,"RE",14 38101 DEFM 93,136,135,"UPDATE",14 38111 DEFM 16,6,93,"SAVE ",116," ",103,14 38123 DEFM 93,"LOAD ",98,"OLD ",103 38135 DEFM 0 ; "Redefine Keys Window" Text 38136 DEFM "ENTER NEW KEY CHOICE",14 ; ENTER NEW KEY CHOICE OR PRESS ENTER TO EXIT N = LEFT M = ; RIGHT A = JUMP/UP Z = DOWN - = MENU (FIRE) 38157 DEFM "OR PRESS ENTER ",99,"EXIT",91 38178 DEFM 190 38179 DEFM 0 38180 DEFM "SAVE & LOAD ",125,148,"T " ; SAVE & LOAD ARE NOT ALLOWED HERE. START A GAME THEN READ GADGET ; X 38196 DEFM "ALLOWED HERE.",14 38210 DEFM "START ",97,103," ",116,"N " 38222 DEFM 114," GADGET X" 38232 DEFM 0 ; Miscellaneous Texts b38233 DEFM " AT " ; AT 38237 DEFM 0 38238 DEFM 92," ",142,16,6," ",97,"NEW",14 ; KNIGHT-TYME A NEW GRAPHIC ADVENTURE BY DAVID JONES ; COPYRIGHT 1986 (see trivia) 38249 DEFM " GRAPHIC ADVENTURE",14 38268 DEFM 16,7,110,"BY DAVID ",173,14 38282 DEFM 110,"COPYRIGHT 1986" 38297 DEFM 0 38298 DEFM 14 ; STARSHIP USS PISCES LOCATION : {name of Current Starship ; Location} 38299 DEFM 16,7," ",145," ",146,14 38306 DEFM 133,28 38308 DEFM 0 38309 DEFM "PRESS FIRE ",99,"CONT",95,"UE" ; PRESS FIRE TO CONTINUE 38328 DEFM 0 38329 DEFM 14 ; EXECUTE COMMAND REJECT COMMAND 38330 DEFM 93,"EXECUTE ",100,14 38341 DEFM 93,"REJECT ",100 38350 DEFM 0 38351 DEFM 14 ; carriage return / line feed}{move text cursor right by two ; characters 38352 DEFM 93 38353 DEFM 0 38354 DEFM 100,14 ; COMMAND 38356 DEFM 0 38357 DEFM 16,6,142 ; KNIGHT-TYME 38360 DEFM 0 38361 DEFM 31," ",115,122 ; name of Current Character} IS ASLEEP 38365 DEFM 0 38366 DEFM "WELL DONE ",105," HAVE MANAGED ",99 ; WELL DONE YOU HAVE MANAGED TO ESCAPE THROUGH THE BLACK ; HOLE. BUT UPON REACHING HOME YOU FIND THAT THE OFF-WHITE ; KNIGHT HAS BEEN CAUSING HAVOC BY MESSING AROUND WITH THE ; WEATHER. PRESS ANY KEY TO CONTINUE 38392 DEFM "ESCAPE THROUGH ",116," BLACK HOLE.",14 38421 DEFM "BUT UPON REACH",207," HOME ",105," " 38444 DEFM "F",95,"D THAT ",116," OFF-WHITE KNIGHT " 38472 DEFM 151,"BEEN CAUS",207," HAVOC BY " 38493 DEFM "MESS",207," AROUND WITH ",116," " 38513 DEFM "WEA",116,"R.",14 38520 DEFM 110,"PRESS ANY KEY ",99,"CONT",95,"UE" 38543 DEFM 0 38544 DEFM 14 ; STRENGTH 1 2 3 4 5 38545 DEFM " STRENGTH",110," 1 2 3 4 5",14 38572 DEFM " ",16,2,17,32,110,110,110," " 38581 DEFM 0 38582 DEFM 3 ; Required height of window = 2 (3 - 1) 38583 DEFM 105," ",125,148,"T CARRY",207," ",127 ; YOU ARE NOT CARRYING ANYTHING 38597 DEFM 0 38598 DEFM 3 ; Height = 3 38599 DEFM 105," ",125,148,"T " ; YOU ARE NOT WEARING ANYTHING 38605 DEFM 119,207," ",127 38609 DEFM 0 38610 DEFM 16,6,"WHO DO ",105," WANT ",99 ; WHO DO YOU WANT TO 38627 DEFM 0 38628 DEFM 3 ; Height = 2 38629 DEFM 116,"RE ",115,148,"BODY ",95," TH",115,208 ; THERE IS NOBODY IN THIS ROOM 38646 DEFM 0 38647 DEFM 117,98,149,"FROM ?",14 ; TAKE AN OBJECT FROM ? 38657 DEFM 0 38658 DEFM 118,98,149,99,"?",14 ; GIVE AN OBJECT TO ? 38664 DEFM 0 38665 DEFM 101,"?",14 ; EXAMINE ? 38668 DEFM 0 38669 DEFM 100," ?",14 ; COMMAND ? 38673 DEFM 0 38674 DEFM "FORTIFY ?",14 ; FORTIFY ? 38684 DEFM 0 ; Main In-Game Menu Strings ; ; Permanent entries: b38685 DEFM 16,4,100,"S AVAILABLE :-",91 ; COMMANDS AVAILABLE :- PICK UP AN OBJECT DROP AN OBJECT TAKE AN OBJECT ; GIVE AN OBJECT EXAMINE 38703 DEFM 16,6,93,"PICK UP ",98,149,14 38717 DEFM 93,120,98,149,14 38722 DEFM 93,117,98,149,14 38727 DEFM 93,118,98,149,14 38732 DEFM 93,101 38734 DEFM 0 ; Conditional entries: 38735 DEFM 94,93,100," ",97,"CHARACTER",0 ; COMMAND A CHARACTER 38750 DEFM 94,93,"LAUNCH ",166,0 ; LAUNCH TYME MACHINE 38761 DEFM 0 ; Unused 38762 DEFM 94,93,114," ",139,0 ; READ SOMETHING 38768 DEFM 0 ; Unused 38769 DEFM 94,93,174," ",97,175,0 ; CAST A SPELL 38776 DEFM 0 ; Unused 38777 DEFM 94,93,119,"/UN",119," ",149,0 ; WEAR/UNWEAR OBJECT 38787 DEFM 94,93,"MOVE ",145,0 ; MOVE STARSHIP 38796 DEFM 94,93,"USE ",141,0 ; USE TRANSPORTER 38804 DEFM 94,93,140,"E",0 ; COMMUNICATE ; Text Relating to "Pick Up" Command b38809 DEFM 92,105," ",125,148,"W CARRY",207,94 ; YOU ARE NOW CARRYING 38823 DEFM 0 38824 DEFM 92,"PICK UP ",116," " ; PICK UP THE 38835 DEFM 0 38836 DEFM 3 ; Height = 3 38837 DEFM 116,"RE ",115,150,95," TH",115,208 ; THERE IS NOTHING IN THIS ROOM 38849 DEFM 0 38850 DEFM 3 ; Height = 3 38851 DEFM 116,"RE ",115,150,"NEAR E",148,"UGH" ; THERE IS NOTHING NEAR ENOUGH 38867 DEFM 0 38868 DEFM 3 ; Height = 3 38869 DEFM 105,"R H",112,"S ",125,"FULL" ; YOUR HANDS ARE FULL 38881 DEFM 0 38882 DEFM 4 ; Height = 4 38883 DEFM 116," ",29," ",115,"TOO HEAVY FOR ",105 ; THE {name of Current Object} IS TOO HEAVY FOR YOU 38903 DEFM 0 ; Text Relating to "Drop" Command b38904 DEFM 92,120,"WHICH ",149,"?",94 ; DROP WHICH OBJECT ? 38915 DEFM 0 38916 DEFM 92,120,116," " ; DROP THE 38920 DEFM 0 38921 DEFM 3 ; Height = 3 38922 DEFM 105," ",121," ",120,116," ",29 ; YOU CANNOT DROP THE {name of Current Object} 38930 DEFM 0 38931 DEFM 8 ; Height = 8 38932 DEFM 105," ",121," ",120 ; YOU CANNOT DROP THE {name of Current Object} HERE BECAUSE IT WOULD ; INTERFERE WITH THE TRANSPORTERS FLUX GENERATOR. (bug) 38937 DEFM 116," ",29," HERE " 38946 DEFM "BECAUSE IT WOULD " 38963 DEFM 95,"TERFERE WITH ",116," " 38979 DEFM 141,"S FLUX " 38987 DEFM "GENERATOR." 38997 DEFM 0 ; Text Relating to "Take" Command b38998 DEFM 92,117,"WHICH ",149,"?",94 ; TAKE WHICH OBJECT ? 39009 DEFM 0 39010 DEFM 92,117,116," " ; TAKE THE 39014 DEFM 0 39015 DEFM 117,139,"FROM " ; TAKE SOMETHING FROM 39022 DEFM 0 39023 DEFM " FROM " ; FROM 39029 DEFM 0 39030 DEFM 3 ; Height = 3 39031 DEFM 31,"'S H",112,"S ",125,"EMPTY" ; name of Current Character}'S HANDS ARE EMPTY 39045 DEFM 0 39046 DEFM 4 ; Height = 4 39047 DEFM 31," WANTS ",99,"KEEP ",116," ",29 ; name of Current Character} WANTS TO KEEP THE {name of Current ; Object 39064 DEFM 0 ; Text Relating to "Give" Command b39065 DEFM 92,118,"WHICH ",149,"?",94 ; GIVE WHICH OBJECT ? 39076 DEFM 0 39077 DEFM 92,118,116," " ; GIVE THE 39081 DEFM 0 39082 DEFM " ",99 ; TO 39084 DEFM 0 39085 DEFM 3 ; Height = 3 39086 DEFM 31,"'S H",112,"S ",125,"FULL" ; name of Current Character}'S HANDS ARE FULL 39099 DEFM 0 39100 DEFM 3 ; Height = 3 39101 DEFM 31," ",115,148,"T STRONG E",148,"UGH" ; name of Current Character} IS NOT STRONG ENOUGH 39119 DEFM 0 39120 DEFM 4 ; Height = 4 39121 DEFM 31," DOES ",148,"T WANT ",116," ",29 ; name of Current Character} DOES NOT WANT THE {name of Current ; Object 39139 DEFM 0 ; Text Relating to "Examine" Command b39140 DEFM 92,101,"WHICH ",149,"?",94 ; EXAMINE WHICH OBJECT ? 39151 DEFM 0 39152 DEFM 101 ; EXAMINE 39153 DEFM 0 39154 DEFM 101,"WHAT ?",91 ; EXAMINE WHAT ? OBJECT CHARACTER YOURSELF USS ; PISCES 39162 DEFM 93,149,14 39165 DEFM 93,"CHARACTER",14 39176 DEFM 93,105,"RSELF",14 39184 DEFM 93,146 39186 DEFM 0 ; Character's Stats Text 39187 DEFM 101,31,91 ; EXAMINE {name of Current Character} STRENGTH ; 99 HAPPINESS 99 STAMINA 99 CHARISMA 99 MAGIC ; LVL. 99 39190 DEFM "STRENGTH",110,16,4," 99 ",16,0,14 39208 DEFM "HAPP",95,"ESS ",16,4," 99 ",16,0,14 39227 DEFM "STAM",95,"A",110," ",16,4," 99 ",16,0,14 39244 DEFM "CHARISMA",110,16,4," 99 ",16,0,14 39262 DEFM "MAGIC LVL. ",16,4," 99 ",16,0,91 39282 DEFM 0 39283 DEFM 110,110,101,14 ; EXAMINE 39287 DEFM 0 ; Object's Stats Text 39288 DEFM 91,110,110,"WEIGHT",110," ",16,4," 99 ",16,0,14 ; WEIGHT 99 BLOW . READ . WEAR . 39309 DEFM 110,110,"BLOW",110,110," ",16,4,". ",16,0,14 39325 DEFM 110,110,114," ",110,110,16,4,". ",16,0,14 39338 DEFM 110,110,119,110,110," ",16,4,". ",16,0,91 39351 DEFM 0 39352 DEFM 105,"RSELF" ; YOURSELF 39358 DEFM 0 ; USS Pisces Stats Text 39359 DEFM 146," ",16,3,17,0,110,110," ",14 ; USS PISCES LIFE SUPPORT % STAR DRIVE FUEL ; IMPULSE DRIVE % SHIELDS % TRANSPUTER % 39371 DEFM 17,120,110,110,110,110,17,0," ",16,4,110,110,16,3," ",14 39388 DEFM 17,120,110,110,110,110,17,0," ",16,4,110,110,16,3," ",14 39405 DEFM 17,120,110,110,110,110,17,0,110,110," ",14 39418 DEFM 16,0,17,120,"LIFE SUPPORT",110," ",16,4," %",14 39444 DEFM 16,0,"STAR DRIVE ",193," ",16,4," ",14 39467 DEFM 16,0,"IMPULSE DRIVE",110," ",16,4," %",14 39491 DEFM 16,0,"SHIELDS",110,110,110," ",16,4," %",14 39511 DEFM 16,0,178,110,110," ",16,4," %" 39523 DEFM 0 39524 DEFM 146 ; USS PISCES 39525 DEFM 0 39526 DEFM 6 ; Height = 6 39527 DEFM 105," ",121," ",101 ; YOU CANNOT EXAMINE THE USS PISCES IF YOU ARE ; NOT ABOARD THE MAIN SECTION OF THE SHIP 39532 DEFM 116," ",146," IF " 39539 DEFM 105," ",125,148,"T ABOARD " 39552 DEFM 116," MA",95," SECTION " 39566 DEFM 111,116," SHIP" 39573 DEFM 0 ; Text Relating to "Command" Command b39574 DEFM 100," " ; COMMAND 39576 DEFM 0 39577 DEFM "WHICH ",100," DO ",105," WANT ",99,"USE ?",14,14 ; WHICH COMMAND DO YOU WANT TO USE ? GO TO ; SLEEP WAKE UP HELP (see trivia) 39603 DEFM 93,"GO ",99,"SLEEP",14 39614 DEFM 93,"WAKE UP",14 39623 DEFM 93,104 39625 DEFM 0 39626 DEFM "GO ",99,"SLEEP" ; GO TO SLEEP 39635 DEFM 0 39636 DEFM "WAKE UP" ; WAKE UP 39643 DEFM 0 39644 DEFM 104 ; HELP 39645 DEFM 0 39646 DEFM 4 ; Height = 4 39647 DEFM 31," HEARS ",97,"VOICE ",112," IG",148,"RES IT" ; name of Current Character} HEARS A VOICE AND ; IGNORES IT 39673 DEFM 0 39674 DEFM 4 ; Height = 4 39675 DEFM 31," DOES ",148,"T RECOGNISE ",105,"R AUTHORITY" ; name of Current Character} DOES NOT RECOGNISE ; YOUR AUTHORITY 39707 DEFM 0 39708 DEFM 5 ; Height = 5 39709 DEFM 31," DOES ",148,"T LIKE ",172," SO HE IG",148,"RES ",105 ; name of Current Character} DOES NOT LIKE ; STARFLEET SO HE IGNORES YOU 39740 DEFM 0 39741 DEFM 7 ; Height = 7 39742 DEFM 31," HEARS ",97 ; name of Current Character} HEARS A MUFFLED ; VOICE BUT CANNOT UNDERSTAND WHAT YOU ARE ; TRYING TO SAY 39751 DEFM "MUFFLED VOICE " 39765 DEFM "BUT ",121," " 39771 DEFM "UNDERST",112," WHAT " 39785 DEFM 105," ",125,"TRY",207," " 39793 DEFM 99,"SAY" 39797 DEFM 0 39798 DEFM 4 ; Height = 4 39799 DEFM 31," DOES ",148,"T WANT ",99,"BE ",100,"ED BY ",105 ; name of Current Character} DOES NOT WANT TO ; BE COMMANDED BY YOU 39826 DEFM 0 39827 DEFM 3 ; Height = 3 39828 DEFM 31," ",115,"AL",114,"Y ",122 ; name of Current Character} IS ALREADY ASLEEP 39837 DEFM 0 39838 DEFM 4 ; Height = 4 39839 DEFM 31," ",115,"TOO WAKEFUL ",99,"SLEEP" ; name of Current Character} IS TOO WAKEFUL TO ; SLEEP 39860 DEFM 0 39861 DEFM 3 ; Height = 3 39862 DEFM 31," ",151,"GONE ",99,"SLEEP" ; name of Current Character} HAS GONE TO SLEEP 39876 DEFM 0 39877 DEFM 3 ; Height = 3 39878 DEFM 31," ",115,"AL",114,"Y AWAKE" ; name of Current Character} IS ALREADY AWAKE 39891 DEFM 0 39892 DEFM 3 ; Height = 3 39893 DEFM 31," ",115,"TOO TIRED ",99,"WAKE UP" ; name of Current Character} IS TOO TIRED TO ; WAKE UP 39914 DEFM 0 39915 DEFM 3 ; Height = 3 39916 DEFM 31," ",151,"WOKEN UP" ; name of Current Character} HAS WOKEN UP 39927 DEFM 0 39928 DEFM 4 ; Height = 4 39929 DEFM 31," ",115,"TOO TIRED ",99,104," ",105 ; name of Current Character} IS TOO TIRED TO ; HELP YOU 39946 DEFM 0 39947 DEFM 6 ; Height = 6 39948 DEFM 31," ",102,"'I WOULD LIKE ",105," " ; name of Current Character} SAYS 'I WOULD LIKE ; YOU TO FETCH MY TANKARD FOR ME MAGIC KNIGHT' 39967 DEFM 99,"FETCH MY TANKARD FOR ME ",144,"'" 39994 DEFM 0 39995 DEFM 8 ; Height = 8 39996 DEFM 31," ",102,"'I HAVE RE-ROUTED ",116," " ; name of Current Character} SAYS 'I HAVE ; RE-ROUTED THE TRANSPORTER CONTROL SYSTEM AS ; DIRECTED BY THE STARBASE OVERHAUL TRANSPUTER' 40019 DEFM 141," CONTROL SYSTEM AS DIRECTED BY ",116," " 40053 DEFM 177," OVERHAUL ",178,"'" 40066 DEFM 0 40067 DEFM 11 ; Height = 11 40068 DEFM 31," ",102 ; name of Current Character} SAYS 'GORDON WILL ; NEED THE STARMAP BEFORE WE CAN MOVE THE ; STARSHIP ANYWHERE. YOU WILL NEED TO GET THE ; ADVERT BEFORE YOU CAN GET THE STARMAP.' 40071 DEFM "'",195," WILL NEED " 40084 DEFM 116," STARMAP " 40094 DEFM "BEFORE ",113,"CAN " 40106 DEFM "MOVE ",116," ",145," " 40115 DEFM "ANYWHERE. ",105," " 40127 DEFM "WILL NEED ",99,"GET " 40142 DEFM 116," ADVERT BEFORE " 40158 DEFM 105," CAN GET ",116," " 40170 DEFM "STARMAP.'" 40179 DEFM 0 40180 DEFM 13 ; Height = 13 40181 DEFM 31," ",102,"'SOME " ; name of Current Character} SAYS 'SOME REPAIRS ; ARE NEEDED. WE WILL NEED TO REACH A STARBASE ; BEFORE THEY CAN BE DONE. THE BROKEN EQUIPMENT ; WILL NOT CAUSE PROBLEMS WITH MOVING THE USS ; PISCES.' 40190 DEFM "REPAIRS ",125 40199 DEFM "NEEDED. ",113,"WILL " 40213 DEFM "NEED ",99,"REACH ",97 40226 DEFM 177," BEFORE " 40235 DEFM 116,"Y C",98,"BE DONE. " 40249 DEFM 116," BROKEN " 40258 DEFM "EQUIPMENT WILL " 40273 DEFM 148,"T CAUSE " 40282 DEFM "PROBLEMS WITH " 40296 DEFM "MOV",207," ",116," " 40303 DEFM 146,".'" 40306 DEFM 0 40307 DEFM 3 ; Height = 3 40308 DEFM 31," ",151,"TAKEN ",105,"R PHOTO" ; name of Current Character} HAS TAKEN YOUR ; PHOTO 40325 DEFM 0 40326 DEFM 8 ; Height = 8 40327 DEFM 31," ",102,"'I " ; name of Current Character} SAYS 'I REMEMBER ; WHEN YOU COULD BUY A LOAF OF BREAD FOR 5000 ; SOLAR CREDITS AND STILL HAVE CHANGE!' 40333 DEFM "REMEMBER WHEN ",105," " 40349 DEFM "COULD BUY ",97,"LOAF " 40365 DEFM 111,"B",114," FOR 5000 " 40378 DEFM "SOLAR CREDITS ",112," " 40394 DEFM "STILL HAVE " 40405 DEFM "CHANGE!'" 40413 DEFM 0 40414 DEFM 9 ; Height = 9 40415 DEFM 31," ",102,"'",116," " ; name of Current Character} SAYS 'THE GOLDEN ; SUNDIAL OF ALPHA. WAS SPLIT INTO THREE PARTS ; AND THEY WILL NEED A GREAT POWER TO JOIN THEM ; AGAIN' (bug) 40421 DEFM 162," " 40423 DEFM "WAS SPLIT " 40433 DEFM 95,99,"THREE PARTS " 40447 DEFM 112," ",116,"Y WILL " 40457 DEFM "NEED ",97,"GREAT " 40469 DEFM "POWER ",99,"JO",95," " 40480 DEFM 116,"M AGA",95,"'" 40488 DEFM 0 40489 DEFM 8 ; Height = 8 40490 DEFM 31," ",102 ; name of Current Character} SAYS 'THANKS FOR ; THE HEART BIG BOY! THE GAS MASK WILL BE HANDY ; ON HOOPERS ASTEROID.' (bug) 40493 DEFM "'THANKS FOR ",116," " 40507 DEFM "HEART BIG BOY! " 40522 DEFM 116," GAS MASK WILL " 40538 DEFM "BE H",112,"Y ON " 40548 DEFM 199,"S " 40551 DEFM "ASTEROID.'" 40561 DEFM 0 40562 DEFM 5 ; Height = 5 40563 DEFM 31," ",102 ; name of Current Character} SAYS 'SHARONN ; WANTS TO KNOW THAT YOU CARE FOR HER.' (bug) 40566 DEFM "'",201,"N WANTS ",99 40577 DEFM "K",148,"W THAT ",105," " 40588 DEFM "C",125,"FOR HER.'" 40599 DEFM 0 40600 DEFM 5 ; Height = 5 40601 DEFM 31," ",102,"'MY " ; name of Current Character} SAYS 'MY BOOTS ; COULD BE USEFUL IF YOU USE THEM WELL.' 40608 DEFM "BOOTS COULD BE " 40623 DEFM "USEFUL IF ",105," USE " 40639 DEFM "THEM WELL.'" 40650 DEFM 0 40651 DEFM 9 ; Height = 9 40652 DEFM 31," ",102,"'HARK " ; name of Current Character} SAYS 'HARK WHAT ; LIGHT THRU YONDER PORTHOLE BREAKS. TIS THE ; GALACTIC EAST AND ROMIE 0 IS THE LOCAL STAR.' 40661 DEFM "WHAT LIGHT THRU " 40677 DEFM "YONDER PORTHOLE " 40693 DEFM "BREAKS. TIS ",116," " 40707 DEFM "GALACTIC EAST ",112," " 40723 DEFM "ROMIE 0 ",115,116," " 40734 DEFM "LOCAL STAR.'" 40746 DEFM 0 40747 DEFM 8 ; Height = 8 40748 DEFM 31," ",102 ; name of Current Character} SAYS 'FORSOOTH ; THERE IS STICKY STUFF NEARBY. I WOULD TAKE IT ; FROM YOU MAGIC KNIGHT IF YOU WISH' 40751 DEFM "'FORSOOTH ",116,"RE " 40765 DEFM 115,"STICKY STUFF " 40779 DEFM "NEARBY. I WOULD " 40795 DEFM 117,"IT FROM ",105," " 40806 DEFM 144," IF " 40811 DEFM 105," WISH'" 40818 DEFM 0 40819 DEFM 12 ; Height = 12 40820 DEFM 31," ",102,"'COME " ; name of Current Character} SAYS 'COME ON ; THEN! COME ON THEN!... {name of Current ; Character}! WHO'S A PRETTY BOY THEN? LUMPS OF ; NINETEEN. N.N.N...NINETEEN. I'M NOT REALLY ; SURE WHATS GOING ON!' (bug) 40829 DEFM "ON ",116,"N! COME ON " 40844 DEFM 116,"N!... ",31,"! " 40854 DEFM "WHO'S ",97,"PRETTY " 40868 DEFM "BOY ",116,"N? LUMPS " 40882 DEFM 111,"N",95,"ETEEN. " 40892 DEFM "N.N.N...N",95,"ETEEN. " 40909 DEFM "I'M ",148,"T REALLY " 40923 DEFM "SURE WHATS GO",207," " 40938 DEFM "ON!'" 40942 DEFM 0 ; Text Relating to "Read" Command b40943 DEFM 92,114," WHICH ",149,"?",94 ; READ WHICH OBJECT ? 40955 DEFM 0 40956 DEFM 92,114," ",116," " ; READ THE 40961 DEFM 0 40962 DEFM 4 ; Height = 4 40963 DEFM 116,"RE ",115,148," " ; THERE IS NO WRITING FOR ME TO READ 40970 DEFM "WRIT",207," FOR ME " 40983 DEFM 99,114 40985 DEFM 0 ; List of Read-Texts of Readable Objects 00: Cloak of Invisibility (note: text is not in yellow INK here - perhaps ; because it isn't actually being read!) b40986 DEFM 4 ; Height = 4 40987 DEFM 29,14,14 ; name of Current Object} I SEE NO CLOAK 40990 DEFM "I SEE ",148," CLOAK" 41003 DEFM 0 ; 01: Blank I.D. Card 41004 DEFM 7 ; Height = 7 41005 DEFM 92,29,91 ; name of Current Object} STARFLEET COMMANDER ; ................... AUTHORIZED BY ................... 41008 DEFM 172," ",100,"ER",14 41014 DEFM 165 41015 DEFM 182 41016 DEFM 165 41017 DEFM 0 ; 02: Valid I.D. Card 41018 DEFM 8 ; Height = 8 41019 DEFM 92,29,91 ; name of Current Object} STARFLEET COMMANDER ** MAGIC ; KNIGHT ** AUTHORIZED BY KING JONES OF THE GALACTIC ; FEDERATION 41022 DEFM 172," ",100,"ER",14 41028 DEFM "** ",144," **",14 41036 DEFM 182 41037 DEFM "K",207," ",173," ",111,116," " 41045 DEFM "GALACTIC ",168 41055 DEFM 0 ; 03: Instant Film 41056 DEFM 4 ; Height = 4 (bug) 41057 DEFM 92,29,91 ; name of Current Object} 100 ASA. USE BEFORE APRIL 2485 ; AD 41060 DEFM "100 ASA. USE BEFORE " 41080 DEFM "APRIL 2485 AD" 41093 DEFM 0 ; 04: Photograph (of Magic Knight) 41094 DEFM 7 ; Height = 7 41095 DEFM 92,29,91 ; name of Current Object} NO WRITING HERE. BUT THERE IS A ; VERY CUTE PICTURE OF A SHORT GUY IN ARMOUR 41098 DEFM 148," WRIT",207," HERE. BUT " 41116 DEFM 116,"RE ",115,97,"VERY CUTE " 41132 DEFM "PICTURE ",111,97,"SHORT GUY " 41152 DEFM 95," ARMOUR" 41160 DEFM 0 ; 05: Chocolate Heart 41161 DEFM 5 ; Height = 5 41162 DEFM 92,29,91 ; name of Current Object} THE LABEL READS 'ICH LIEBE DICH' 41165 DEFM 116," LABEL ",114,"S 'ICH " 41181 DEFM "LIEBE DICH'" 41192 DEFM 0 ; 06: Photograph (of inside of starship) 41193 DEFM 7 ; Height = 7 41194 DEFM 92,29,91 ; name of Current Object} NO WRITING HERE, IN FACT ALL ; THERE IS, IS A PHOTO OF THE INSIDE OF THE STARSHIP 41197 DEFM 148," WRIT",207," HERE, ",95," FACT " 41218 DEFM "ALL ",116,"RE IS, ",115,97,"PHO",99 41236 DEFM 111,116," ",95,"SIDE ",111,116," " 41248 DEFM 145 41249 DEFM 0 ; 07: Pot of Glue 41250 DEFM 6 ; Height = 6 41251 DEFM 92,29,91 ; name of Current Object} STICKY STUFF. FIND IT AND YOU ; WILL HAVE TO KEEP IT 41254 DEFM "STICKY STUFF. F",95,"D IT " 41275 DEFM 112," ",105," WILL HAVE ",99 41290 DEFM "KEEP IT" 41297 DEFM 0 ; 08: 5W Resistor 41298 DEFM 5 ; Height = 5 41299 DEFM 92,29,91 ; name of Current Object} COLOUR CODE READS 1.5K OHM 41302 DEFM "COLOUR CODE ",114,"S 1.5K " 41322 DEFM "OHM" 41325 DEFM 0 ; 09: McTablet Food 41326 DEFM 10 ; Height = 10 41327 DEFM 92,29,91 ; name of Current Object} THE LABEL READS 'MCTABLET ; CONDENSED MEALS A COMPLETE NUTRIENT COURSE IN ONE HANDY ; TABLET' THERE IS A PICTURE OF A CLOWN HERE AS WELL ! 41330 DEFM 116," LABEL ",114,"S " 41341 DEFM "'",171," CONDENSED " 41354 DEFM "MEALS ",97,"COMPLETE " 41370 DEFM "NUTRIENT COURSE ",95," ONE " 41392 DEFM "H",112,"Y TABLET' ",116,"RE ",115,97 41410 DEFM "PICTURE ",111,97,"CLOWN HERE " 41431 DEFM "AS WELL !" 41440 DEFM 0 ; 10: Golden Sundial of Alpha 41441 DEFM 7 ; Height = 7 41442 DEFM 92,29,91 ; name of Current Object} THE {name of Current Object} HAS ; A MESSAGE INSCRIBED ON THE BASE. IT SAYS 'GOLDEN SUNDIAL ; OF ALPHA..' (bug) 41445 DEFM 116," ",29," " 41449 DEFM "HAS ",97,"MESSAGE ",95,"SCRIBED ON ",116," " 41476 DEFM "BASE. IT ",102,"'" 41487 DEFM 162,".'" 41490 DEFM 0 ; 11: Pair of Boots 41491 DEFM 5 ; Height = 5 41492 DEFM 92,29,91 ; name of Current Object} SIZE 10, CUSHION SOLE SPACE BOOT 41495 DEFM "SIZE 10, CUSHION SOLE " 41517 DEFM "SPACE BOOT" 41527 DEFM 0 ; 12: Advert 41528 DEFM 9 ; Height = 9 41529 DEFM 92,29,91 ; name of Current Object} GAME CONCEPT AND PROGRAM BY ; DAVID JONES. OTHER GAMES FROM MASTERTRONIC STARRING ; MAGIC KNIGHT ARE :-FINDERS KEEPERS AND SPELLBOUND 41532 DEFM 16,7 41534 DEFM 103," CONCEPT ",112," PROGRAM " 41554 DEFM "BY " 41557 DEFM 16,6,18 41560 DEFM "DAVID ",173,". " 41569 DEFM 18,16,7 41572 DEFM "O",116,"R " 41576 DEFM 103,"S FROM ",143," " 41586 DEFM "STARR",207," ",144," " 41595 DEFM 125,":-F",95,"DERS KEEPERS " 41613 DEFM 112," ",132 41616 DEFM 0 ; 13: Wrist Terminal 41617 DEFM 7 ; Height = 7 41618 DEFM 92,29,91 ; name of Current Object} THERE IS A MESSAGE HERE. IT SAYS ; 'HOOPERS ASTEROID TRANSPORTER COORDINATES ARE X1Y8Z4.' ; (bug) 41621 DEFM 116,"RE ",115,97,"MESSAGE HERE. " 41641 DEFM "IT ",102,"'",199,"S " 41649 DEFM "ASTEROID ",141," " 41660 DEFM 163,125,"X1Y8Z4.'" 41670 DEFM 0 ; 14: Quark Bomb 41671 DEFM 5 ; Height = 5 41672 DEFM 92,29,91 ; name of Current Object} 250 GIGATON {name of Current ; Object}. BOMB ARMED 41675 DEFM "250 GIGATON ",29,".",14 41690 DEFM 18," BOMB ARMED ",18 41704 DEFM 0 ; Text Relating to "Cast a Spell" Command b41705 DEFM 92,174," ",97,175 ; CAST A SPELL 41710 DEFM 0 41711 DEFM 9 ; Height = 9 41712 DEFM "WHICH ",175," DO ",105," WANT " ; WHICH SPELL DO YOU WANT TO CAST ? REMOVE BARRIERS CONSULT ORACLE ; FORTIFY CHARACTER FORTIFY YOURSELF LIGHTNING BOLT 41730 DEFM 99,174," ?",91 41735 DEFM 93,179,14 41738 DEFM 93,180,14 41741 DEFM 93,181,14 41744 DEFM 93,176,14 41747 DEFM 93,183 41749 DEFM 0 41750 DEFM 4 ; Height = 4 41751 DEFM 105," ",121," ",174," THAT " ; YOU CANNOT CAST THAT SPELL NOW. MAYBE YOU NEED MORE SPELL POWER 41762 DEFM 175," ",148,"W. MAYBE ",105," " 41776 DEFM "NEED MORE ",175," POWER" 41793 DEFM 0 41794 DEFM 174," ",179,0 ; CAST REMOVE BARRIERS 41798 DEFM 174," ",180,0 ; CAST CONSULT ORACLE 41802 DEFM 174," ",181,0 ; CAST FORTIFY CHARACTER 41806 DEFM 174," ",176,0 ; CAST FORTIFY YOURSELF 41810 DEFM 174," ",183,0 ; CAST LIGHTNING BOLT 41814 DEFM 174," FORTIFY ",175," ON ",0 ; CAST FORTIFY SPELL ON ; Text Relating to "WEAR/UNWEAR OBJECT" Command b41830 DEFM 14 ; WEAR UNWEAR 41831 DEFM 93,119,14 41834 DEFM 93,"UN",119 41838 DEFM 0 41839 DEFM "UN",119," ",116," " ; UNWEAR THE 41845 DEFM 0 41846 DEFM "UN",119," WHICH ",149,"?",14 ; UNWEAR WHICH OBJECT ? 41859 DEFM 0 41860 DEFM 3 ; Height = 3 41861 DEFM 105," ",125,119,207," TOO MUCH" ; YOU ARE WEARING TOO MUCH 41875 DEFM 0 41876 DEFM 3 ; Height = 3 41877 DEFM 105," ",121," ",119," THAT" ; YOU CANNOT WEAR THAT 41887 DEFM 0 ; Text Relating to "MOVE STARSHIP" Command b41888 DEFM "MOVE ",116," ",145," ",99 ; MOVE THE STARSHIP TO 41898 DEFM 0 41899 DEFM "WHERE ",99,"?",14 ; WHERE TO ? 41908 DEFM 0 41909 DEFM 4 ; Height = 4 41910 DEFM 116," ",145," ",151 ; THE STARSHIP HAS ARRIVED AT {name of Current Starship Location} 41915 DEFM "ARRIVED AT ",28 41927 DEFM 0 ; "MOVE STARSHIP" Speed Selection Menu Heading Text 41928 DEFM "WHAT ",138,"SPEED ?",91 ; WHAT TYME DISTORT SPEED ? 41942 DEFM 0 ; "MOVE STARSHIP" Speed Selection Menu Options Text 41943 DEFM 93,138,"1",14 ; TYME DISTORT 1 TYME DISTORT 2 TYME DISTORT 3 TYME DISTORT 4 TYME DISTORT 5 ; TYME DISTORT 6 TYME DISTORT 7 TYME DISTORT 8 TYME DISTORT 9 TYME DISTORT 10 41947 DEFM 93,138,"2",14 41951 DEFM 93,138,"3",14 41955 DEFM 93,138,"4",14 41959 DEFM 93,138,"5",14 41963 DEFM 93,138,"6",14 41967 DEFM 93,138,"7",14 41971 DEFM 93,138,"8",14 41975 DEFM 93,138,"9",14 41979 DEFM 93,138,"10" 41983 DEFM 0 41984 DEFM 138,"1",0 ; TYME DISTORT 1 41987 DEFM 138,"2",0 ; TYME DISTORT 2 41990 DEFM 138,"3",0 ; TYME DISTORT 3 41993 DEFM 138,"4",0 ; TYME DISTORT 4 41996 DEFM 138,"5",0 ; TYME DISTORT 5 41999 DEFM 138,"6",0 ; TYME DISTORT 6 42002 DEFM 138,"7",0 ; TYME DISTORT 7 42005 DEFM 138,"8",0 ; TYME DISTORT 8 42008 DEFM 138,"9",0 ; TYME DISTORT 9 42011 DEFM 138,"10",0 ; TYME DISTORT 10 ; Text Relating to "USE TRANSPORTER" Command b42015 DEFM "SEND ",141," CONTENTS " ; SEND TRANSPORTER CONTENTS 42031 DEFM 0 42032 DEFM "ENTER ",141," ",163,14 ; ENTER TRANSPORTER COORDINATES 8 8 8 9 9 9 X0Y0Z0 1 1 1 2 2 2 MOVE THE ; REELS UP OR DOWN USING THE JOYSTICK AND PRESS FIRE TO CHOOSE. 42042 DEFM 93,16,7,110,"8 8 8",14 42052 DEFM 16,0,93,110,"9 9 9",14 42062 DEFM 93," X0Y0Z0",14 42072 DEFM 93,110,"1 1 1",14 42080 DEFM 93,16,7,110,"2 2 2",14 42090 DEFM 16,0,"MOVE ",116," REELS UP " 42108 DEFM "OR DOWN US",207," ",116," " 42122 DEFM 215,112," " 42125 DEFM "PRESS FIRE ",99 42137 DEFM "CHOOSE." 42144 DEFM 0 42145 DEFM 99 ; TO 42146 DEFM 0 42147 DEFM 3 ; Height = 3 42148 DEFM 116," ",141," " ; THE TRANSPORTER IS BROKEN 42152 DEFM 115,"BROKEN" 42159 DEFM 0 ; Miscellaneous Text b42160 DEFM 35," ",0 ; room name bar end cap (right) 42163 DEFM " ",36,0 ; room name bar end cap (left) 42166 DEFM 3 ; Height = 3 42167 DEFM 31,186," " ; name of Current Character} CANNOT HELP YOU 42170 DEFM 0 42171 DEFM 3 ; Height = 3 42172 DEFM 187 ; YOU HAVE ARRIVED AT X.Y.Z. 42173 DEFM "X.Y.Z." 42179 DEFM 0 ; Text Relating to "COMMUNICATE" Command b42180 DEFM 140,"E WITH ",28,14 ; COMMUNICATE WITH {name of Current ; Starship Location} 42190 DEFM 0 42191 DEFM 5 ; Height = 5 42192 DEFM "CHOOSE ",140,"ION",91 ; CHOOSE COMMUNICATION REQUEST HELP REFUEL ; STARSHIP 42204 DEFM 93,192," ",104,14 42209 DEFM 93,"RE",193," ",145 42215 DEFM 0 42216 DEFM "RE",193," ",145," ",192,"ED" ; REFUEL STARSHIP REQUESTED 42225 DEFM 0 42226 DEFM 14 ; SORRY MAGIC KNIGHT WE ARE OUT OF FUEL 42227 DEFM 194," ",144," ",113,125,"OUT ",111,193 42239 DEFM 0 42240 DEFM 14 ; Height = 14 42241 DEFM 194," ",144," " ; SORRY MAGIC KNIGHT WE DO NOT HAVE ENOUGH ; FUEL TO FILL UP YOUR TANK 42245 DEFM 113,"DO ",148,"T " 42252 DEFM "HAVE E",148,"UGH " 42263 DEFM 193," ",99 42266 DEFM "FILL UP ",105,"R " 42277 DEFM "TANK" 42281 DEFM 0 42282 DEFM 14 ; Height = 14 42283 DEFM 116," ",146," ",115,"FULLY RE",193,"ED" ; THE USS PISCES IS FULLY REFUELED 42299 DEFM 0 42300 DEFM 192," ",104,0 ; REQUEST HELP 42304 DEFM "RE",193," ",145,0 ; REFUEL STARSHIP 42310 DEFM 6 ; Height = 6 42311 DEFM 116,"RE ",115,148,"BODY WITH",95," SUB-SPACE ",140,"OR RANGE" ; THERE IS NOBODY WITHIN SUB-SPACE ; COMMUNICATOR RANGE 42347 DEFM 0 ; Text Relating to "MOVE STARSHIP" Command b42348 DEFM 4 ; Height = 4 42349 DEFM 185,125,"BOTH ",122 ; GORDON AND SARAB ARE BOTH ASLEEP 42357 DEFM 0 42358 DEFM 4 ; Height = 4 42359 DEFM 185,121," UNDERST",112," ",105 ; GORDON AND SARAB CANNOT UNDERSTAND YOU 42372 DEFM 0 ; Object names ; ; Zero-terminated strings b42373 DEFM 14,150,"AT ALL ",0 ; NOTHING AT ALL 42383 DEFM "CLOAK ",111,"INVISIBILITY",0 ; CLOAK OF INVISIBILITY 42403 DEFM "BLANK I.D. CARD",0 ; BLANK I.D. CARD 42419 DEFM "VALID I.D. CARD",0 ; VALID I.D. CARD 42435 DEFM "INSTANT FILM",0 ; INSTANT FILM 42448 DEFM "PHOTOGRAPH",0 ; PHOTOGRAPH 42459 DEFM "STAR MAP",0 ; STAR MAP 42468 DEFM "GADGET X",0 ; GADGET X 42477 DEFM "CAMERA",0 ; CAMERA 42484 DEFM "PHOTOGRAPH",0 ; PHOTOGRAPH 42495 DEFM "POT ",111,"GLUE",0 ; POT OF GLUE 42505 DEFM "5W RESISTOR",0 ; 5W RESISTOR 42517 DEFM "MAGIC TALISMAN",0 ; MAGIC TALISMAN 42532 DEFM "GOLDEN SUNDIAL",0 ; GOLDEN SUNDIAL 42547 DEFM 171," FOOD",0 ; MCTABLET FOOD 42554 DEFM "BROKEN GLASS",0 ; BROKEN GLASS 42567 DEFM "QUARK BOMB",0 ; QUARK BOMB 42578 DEFM "ADVERT",0 ; ADVERT 42585 DEFM 152,0 ; PART OF A SUNDIAL 42587 DEFM 152,0 ; PART OF A SUNDIAL 42589 DEFM 152,0 ; PART OF A SUNDIAL 42591 DEFM "BRASS ANKH",0 ; BRASS ANKH 42602 DEFM "PAIR ",111,"BOOTS",0 ; PAIR OF BOOTS 42614 DEFM "CHOCOLATE HEART",0 ; CHOCOLATE HEART 42630 DEFM 172," MANUAL",0 ; STARFLEET MANUAL 42639 DEFM "ANCIENT SCROLL",0 ; ANCIENT SCROLL 42654 DEFM "TOWER FISH",0 ; TOWER FISH 42665 DEFM "GAS MASK",0 ; GAS MASK 42674 DEFM "SHIELD",0 ; SHIELD 42681 DEFM "BAG ",111,"RUNES",0 ; BAG OF RUNES 42692 DEFM "BAG ",111,"POTATOES",0 ; BAG OF POTATOES 42706 DEFM "PEWTER TANKARD",0 ; PEWTER TANKARD 42721 DEFM "AXE",0 ; AXE 42725 DEFM "WRIST TERMINAL",0 ; WRIST TERMINAL 42740 DEFM "TORCH",0 ; TORCH 42746 DEFM "MIRROR",0 ; MIRROR 42753 DEFM "10 MW LASER",0 ; 10 MW LASER ; Room names ; ; Strings are zero-terminated. For rooms without a name, the entry is a single zero byte. For rooms with names, the ; first two bytes of the entry are data, and the text string itself starts at the third byte. The data structure is: b42765 DEFM 71,19,116," RECREATION ",208,0 ; THE RECREATION ROOM 42782 DEFM 71,10,116," BRIDGE",0 ; THE BRIDGE 42793 DEFM 71,20,116," ",141," ",208,0 ; THE TRANSPORTER ROOM 42801 DEFM 71,19,116," ",178," ",208,0 ; THE TRANSPUTER ROOM 42809 DEFM 71,10,"CARGO HOLD",0 ; CARGO HOLD 42822 DEFM 71,11,116," AIRLOCK",0 ; THE AIRLOCK 42834 DEFM 71,13,116," LIFE BOAT",0 ; THE LIFE BOAT 42848 DEFM 103,12,200,"'S MOON",0 ; MURPHY'S MOON 42859 DEFM 0 ; Unused 42860 DEFM 0 ; Unused 42861 DEFM 0 ; Unused 42862 DEFM 71,20,116," ",141," ",208,0 ; THE TRANSPORTER ROOM 42870 DEFM 71,22,171," TAKEAWAY FOOD",0 ; MCTABLET TAKEAWAY FOOD 42888 DEFM 0 ; Unused 42889 DEFM 0 ; Unused 42890 DEFM 71,17,193," & CARGO AREA",0 ; FUEL & CARGO AREA 42907 DEFM 71,19,"YE OLDE ",141,0 ; YE OLDE TRANSPORTER 42919 DEFM 71,23,116," MA",95," DEFENCE SYSTEM",0 ; THE MAIN DEFENCE SYSTEM 42942 DEFM 0 ; Unused 42943 DEFM 71,18,116," PRO",111,111,"POWER",0 ; THE PROOF OF POWER 42958 DEFM 71,18,116," ",167,0 ; THE TYME GUARDIANS 42964 DEFM 71,23,199,"'S EMERGENCY EXIT",0 ; HOOPER'S EMERGENCY EXIT 42985 DEFM 71,24,"TH",115,"WAY ",99,199," ==>>",0 ; THIS WAY TO HOOPER ==>> 43002 DEFM 71,14,"HERE ",115,199,0 ; HERE IS HOOPER 43012 DEFM 71,18,116," CONTROL COLUMN",0 ; THE CONTROL COLUMN ; Starship Destination Names ; ; Zero-terminated strings b43031 DEFM 0 ; Unused 43032 DEFM "DENEB",0 ; DENEB 43038 DEFM "GATH",0 ; GATH 43043 DEFM 108,0 ; MONOPOLE 43045 DEFM "PORTHOS",0 ; PORTHOS 43053 DEFM "STARBASE 1",0 ; STARBASE 1 43064 DEFM "LYNX",0 ; LYNX 43069 DEFM "NIRVANA",0 ; NIRVANA 43077 DEFM "LIMBO",0 ; LIMBO 43083 DEFM "EDEN",0 ; EDEN 43088 DEFM 106,0 ; HERSCHELL 43090 DEFM "TRANTORE",0 ; TRANTORE 43099 DEFM "PLOP PLOP",0 ; PLOP PLOP 43109 DEFM "BRIGHTSTAR",0 ; BRIGHTSTAR 43120 DEFM "OUTPOST",0 ; OUTPOST 43128 DEFM "POLARIS",0 ; POLARIS 43136 DEFM "B",207,"O",0 ; BINGO 43140 DEFM 107,0 ; RETREAT 43142 DEFM "DRAGON EGG",0 ; DRAGON EGG 43153 DEFM "ARIDIA",0 ; ARIDIA 43160 DEFM "GANGROLE",0 ; GANGROLE 43169 DEFM "NAFF",0 ; NAFF 43174 DEFM "REEF",0 ; REEF 43179 DEFM "ME",148,"PAUSIA",0 ; MENOPAUSIA 43189 DEFM "PL",95,"KIT",0 ; PLINKIT ; Common Words Table, Part 1 ; ; This data block contains a list of zero-terminated (sub-)strings. Other text blocks reference this table when a ; particular string is required. This reduces the space requirements for storage of all of the game's text. b43196 DEFM 14,14,0 ; carriage return / line feed}{carriage return / ; line feed 43199 DEFM 16,6,0 ; change INK colour to yellow 43202 DEFM 9,9,0 ; move text cursor right by two characters 43205 DEFM 14,16,7,0 ; carriage return / line feed}{change INK colour to ; white 43209 DEFM "IN",0 ; IN 43212 DEFM " = ",0 ; = 43216 DEFM "A ",0 ; A 43219 DEFM "AN ",0 ; AN 43223 DEFM "TO ",0 ; TO 43227 DEFM "COMMAND",0 ; COMMAND 43235 DEFM "EXAMINE ",0 ; EXAMINE 43244 DEFM "SAYS ",0 ; SAYS 43250 DEFM "GAME",0 ; GAME 43255 DEFM "HELP",0 ; HELP 43260 DEFM "YOU",0 ; YOU 43264 DEFM "HERSCHELL",0 ; HERSCHELL 43274 DEFM "RETREAT",0 ; RETREAT 43282 DEFM "MONOPOLE",0 ; MONOPOLE 43291 DEFM "ECCENTRIC",0 ; ECCENTRIC 43301 DEFM " ",0 43305 DEFM "OF ",0 ; OF 43309 DEFM "AND",0 ; AND 43313 DEFM "WE ",0 ; WE 43317 DEFM "READ",0 ; READ 43322 DEFM "IS ",0 ; IS 43326 DEFM "THE",0 ; THE 43330 DEFM "TAKE ",0 ; TAKE 43336 DEFM "GIVE ",0 ; GIVE 43342 DEFM "WEAR",0 ; WEAR 43347 DEFM "DROP ",0 ; DROP 43353 DEFM "CANNOT",0 ; CANNOT 43360 DEFM "ASLEEP",0 ; ASLEEP 43367 DEFM "DREAMING ",0 ; DREAMING 43377 DEFM "ABOUT ",0 ; ABOUT 43384 DEFM "ARE ",0 ; ARE 43389 DEFM "ASTRONOMER",0 ; ASTRONOMER 43400 DEFM "ANYTHING",0 ; ANYTHING 43409 DEFM "HELLO ",0 ; HELLO 43416 DEFM "TIME",0 ; TIME 43421 DEFM 0 ; Unused 43422 DEFM "SECURITY",0 ; SECURITY 43431 DEFM "SPELLBOUND ",0 ; SPELLBOUND 43443 DEFM " LOCATION : ",0 ; LOCATION : 43456 DEFM "WINDIMATION",0 ; WINDIMATION 43468 DEFM "ATTRIBUTE ",0 ; ATTRIBUTE 43479 DEFM "PLAYER ",0 ; PLAYER 43487 DEFM "GREETINGS ",0 ; GREETINGS 43498 DEFM "TYME DISTORT ",0 ; TYME DISTORT 43512 DEFM "SOMETHING ",0 ; SOMETHING 43523 DEFM "COMMUNICAT",0 ; COMMUNICAT 43534 DEFM "TRANSPORTER",0 ; TRANSPORTER 43546 DEFM "KNIGHT-TYME",0 ; KNIGHT-TYME 43558 DEFM "MASTERTRONIC",0 ; MASTERTRONIC 43571 DEFM "MAGIC KNIGHT",0 ; MAGIC KNIGHT 43584 DEFM "STARSHIP",0 ; STARSHIP 43593 DEFM "USS PISCES",0 ; USS PISCES 43604 DEFM "YES",0 ; YES 43608 DEFM "NO",0 ; NO 43611 DEFM "OBJECT ",0 ; OBJECT 43619 DEFM "NOTHING ",0 ; NOTHING 43628 DEFM "HAS ",0 ; HAS 43633 DEFM "PART OF A SUNDIAL",0 ; PART OF A SUNDIAL 43651 DEFM 0 ; Unused 43652 DEFM 0 ; Unused 43653 DEFM 0 ; Unused 43654 DEFM 0 ; Unused 43655 DEFM 0 ; Unused 43656 DEFM 0 ; Unused 43657 DEFM 0 ; Unused 43658 DEFM 0 ; Unused 43659 DEFM 0 ; Unused 43660 DEFM "GOLDEN SUNDIAL ",111,"ALPHA.",0 ; GOLDEN SUNDIAL OF ALPHA. (bug) 43683 DEFM "COORDINATES ",0 ; COORDINATES 43696 DEFM 116,"RE ",115,150,"USEFUL FROM ",116," ORACLE NOW",0 ; THERE IS NOTHING USEFUL FROM THE ORACLE NOW 43727 DEFM "...................",14,0 ; ................... 43748 DEFM "TYME MACHINE",0 ; TYME MACHINE 43761 DEFM "TYME GUARDIANS",0 ; TYME GUARDIANS 43776 DEFM "FEDERATION ",0 ; FEDERATION 43788 DEFM "HERE",0 ; HERE 43793 DEFM "YET",0 ; YET 43797 DEFM "MCTABLET",0 ; MCTABLET 43806 DEFM "STARFLEET",0 ; STARFLEET 43816 DEFM "JONES",0 ; JONES 43822 DEFM "CAST",0 ; CAST 43827 DEFM "SPELL",0 ; SPELL 43833 DEFM "FORTIFY ",105,"RSELF",0 ; FORTIFY YOURSELF 43848 DEFM "STARBASE",0 ; STARBASE 43857 DEFM "TRANSPUTER",0 ; TRANSPUTER 43868 DEFM "REMOVE BARRIERS",0 ; REMOVE BARRIERS 43884 DEFM "CONSULT ORACLE",0 ; CONSULT ORACLE 43899 DEFM "FORTIFY CHARACTER",0 ; FORTIFY CHARACTER 43917 DEFM "AUTHORIZED BY",14,0 ; AUTHORIZED BY 43932 DEFM "LIGHTNING BOLT",0 ; LIGHTNING BOLT 43947 DEFM 0 ; Unused 43948 DEFM 195," ",112," ",196," ",0 ; GORDON AND SARAB 43955 DEFM " CANNOT ",104," ",105," ",0 ; CANNOT HELP YOU 43968 DEFM 105," HAVE ARRIVED AT ",0 ; YOU HAVE ARRIVED AT 43987 DEFM "CONTROL : ",0 ; CONTROL : 43998 DEFM "IN TRANSIT",0 ; IN TRANSIT 44009 DEFM " N",96,"LEFT",110," M",96,"RIGHT",91 ; N = LEFT M = RIGHT A = JUMP/UP Z = DOWN - = MENU ; (FIRE) 44027 DEFM " A",96,"JUMP/UP Z",96,"DOWN",91 44046 DEFM " -",96,"MENU (FIRE)",0 ; Common Words Table, Part 2 ; ; This data block contains a list of zero-terminated (sub-)strings. Other text blocks reference this table when a ; particular string is required. This reduces the space requirements for storage of all of the game's text. b44061 DEFM "CITIZEN",0 ; CITIZEN 44069 DEFM "REQUEST",0 ; REQUEST 44077 DEFM "FUEL",0 ; FUEL 44082 DEFM "SORRY",0 ; SORRY 44088 DEFM "GORDON",0 ; GORDON 44095 DEFM "SARAB",0 ; SARAB 44101 DEFM "KLINK",0 ; KLINK 44107 DEFM "S3 E3",0 ; S3 E3 44113 DEFM "HOOPER",0 ; HOOPER 44120 DEFM "MURPHY",0 ; MURPHY 44127 DEFM "SHARON",0 ; SHARON 44134 DEFM "FORBIN",0 ; FORBIN 44141 DEFM "DERBY IV",0 ; DERBY IV 44150 DEFM "SWIFTFOOT",0 ; SWIFTFOOT 44160 DEFM "JULIE 8",0 ; JULIE 8 44168 DEFM "HECTORR",0 ; HECTORR 44176 DEFM "ING",0 ; ING 44180 DEFM "ROOM",0 ; ROOM 44185 DEFM 0 ; Unused 44186 DEFM 0 ; Unused 44187 DEFM "KEYBOARD",0 ; KEYBOARD 44196 DEFM "KEMPSTON ",215,0 ; KEMPSTON JOYSTICK 44207 DEFM "CURSOR ",215,0 ; CURSOR JOYSTICK 44216 DEFM "SINCLAIR ",215,"1",0 ; SINCLAIR JOYSTICK 1 44228 DEFM "JOYSTICK ",0 ; JOYSTICK ; Table of Characters' Wanted Objects ; ; Each entry is comprised of two bytes. The End Marker is denoted by a value of 255 in the first byte. b44238 DEFB 0,6 ; Gordon, Star Map 44240 DEFB 2,36 ; Klink, 10MW Laser 44242 DEFB 4,29 ; Hooper, Bag of Runes 44244 DEFB 5,30 ; Murphy, Bag of Potatoes 44246 DEFB 6,23 ; Sharon, Chocolate Heart 44248 DEFB 11,10 ; Hectorr, Pot of Glue 44250 DEFB 255 ; End Marker ; Table of Characters' Unwanted Objects ; ; Each entry is comprised of two bytes. The End Marker is denoted by a value of 255 in the first byte. b44251 DEFB 0,10 ; Gordon, Pot of Glue 44253 DEFB 1,6 ; Sarab, Star Map 44255 DEFB 1,10 ; Sarab, Pot of Glue 44257 DEFB 2,10 ; Klink, Pot of Glue 44259 DEFB 3,10 ; S3 E3, Pot of Glue 44261 DEFB 4,10 ; Hooper, Pot of Glue 44263 DEFB 5,10 ; Murphy, Pot of Glue 44265 DEFB 6,10 ; Sharon, Pot of Glue 44267 DEFB 7,10 ; Forbin, Pot of Glue 44269 DEFB 8,10 ; Derby IV, Pot of Glue 44271 DEFB 9,10 ; Swiftfoot, Pot of Glue 44273 DEFB 10,10 ; Julie 8, Pot of Glue 44275 DEFB 255 ; End Marker ; Character's Responses to McTablet Flavours b44276 DEFM 6 ; Height = 6 44277 DEFM 31," ",102 ; name of Current Character} SAYS 'GREAT ! CHEESE AND ONION FLAVOUR MCTABLET ; IS MY FAVOURITE' 44280 DEFM "'GREAT ! CHEESE " 44296 DEFM 112," ONION FLAVOUR " 44312 DEFM 171," ",115,"MY " 44318 DEFM "FAVOURITE'" 44328 DEFM 0 44329 DEFM 8 ; Height = 8 44330 DEFM 31," ",102,"'I DO " ; name of Current Character} SAYS 'I DO NOT LIKE ORIGINAL SALTY FLAVOUR ; MCTABLET BUT AT LEAST IT CONTAINS NO ANIMAL PRODUCTS' 44339 DEFM 148,"T LIKE ORIG",95,"AL " 44355 DEFM "SALTY FLAVOUR " 44369 DEFM 171," BUT AT " 44378 DEFM "LEAST IT CONTA",95,"S " 44395 DEFM 148," ANIMAL " 44404 DEFM "PRODUCTS'" 44413 DEFM 0 44414 DEFM 4 ; Height = 4 44415 DEFM 31," ",102,"'BEEF " ; name of Current Character} SAYS 'BEEF AND ONION MCTABLET! YUK!!' 44424 DEFM 112," ONION " 44432 DEFM 171,"! YUK!!'" 44441 DEFM 0 44442 DEFM 7 ; Height = 7 44443 DEFM 31," ",102 ; name of Current Character} SAYS 'YUMMY ! YOU CAN ALMOST TASTE THE SIDE ; SALAD IN THIS T-BONE STEAK MCTABLET' 44446 DEFM "'YUMMY ! ",105," C",98 44459 DEFM "ALMOST TASTE ",116," " 44474 DEFM "SIDE SALAD ",95," " 44487 DEFM "TH",115,"T-BONE STEAK " 44503 DEFM 171,"'" 44505 DEFM 0 ; Cyan "Game Over" Window Texts and Transporter Problem Messages b44506 DEFM 103," OVER",14 ; GAME OVER TOTAL COMPLETION 000 % TIME LEFT 30 DAYS 44513 DEFM "TOTAL COMPLETION 000 % " 44536 DEFM 129," LEFT 30 DAYS",91 44551 DEFM 0 44552 DEFM 6 ; Height = 6 44553 DEFM "BREAK KEY PRESSED" ; BREAK KEY PRESSED 44570 DEFM 0 44571 DEFM 11 ; Height = 11 44572 DEFM 105," HAVE ESCAPED FROM " ; YOU HAVE ESCAPED FROM THE FUTURE AND ARE HEADING BACK TO YOUR OWN ; TIME. TO BE CONTINUED.... 44592 DEFM 116," FUTURE ",112," ",125 44604 DEFM "HEAD",207," BACK ",99,105,"R " 44619 DEFM "OWN ",129,".",91 44626 DEFM 99,"BE CONT",95,"UED...." 44642 DEFM 0 44643 DEFM 6 ; Height = 5 44644 DEFM 105," DIED ",111,"EXHAUSTION" ; YOU DIED OF EXHAUSTION 44662 DEFM 0 44663 DEFM 8 ; Height = 8 44664 DEFM 131," HEARD ",105," ",112," " ; SECURITY HEARD YOU AND THREW YOU OUT OF THE AIRLOCK 44676 DEFM "THREW ",105," OUT ",111,116," " 44691 DEFM "AIRLOCK" 44698 DEFM 0 44699 DEFM 8 ; Height = 8 44700 DEFM 131," SAW ",105," ",112," " ; SECURITY SAW YOU AND BLASTED YOU INTO SPACE DUST 44710 DEFM "BLASTED ",105," ",95,99,"SPACE " 44728 DEFM "DUST" 44732 DEFM 0 44733 DEFM 8 ; Height = 8 44734 DEFM 116," GAS PENETRATED " ; THE GAS PENETRATED YOUR ARMOUR AND YOU DIED HORRIBLY. 44751 DEFM 105,"R ARMOUR ",112," ",105," " 44765 DEFM "DIED HORRIBLY." 44779 DEFM 0 44780 DEFM 12 ; Height = 12 44781 DEFM 116," AU",99,"DEFENCE " ; THE AUTO DEFENCE SYSTEMS HAVE REMOVED YOU FROM THIS SPACE/TIME ; CONTINUUM. YOU NEEDED THE GOLDEN SUNDIAL OF ALPHA. TO PASS (bug) 44794 DEFM "SYSTEMS HAVE REMOVED " 44815 DEFM 105," FROM TH",115 44825 DEFM "SPACE/",129," CONT",95,"UUM. " 44843 DEFM 105," NEEDED ",116," " 44854 DEFM 162," ",99,"PASS" 44861 DEFM 0 44862 DEFM 11 ; Height = 11 44863 DEFM 105," HAVE DESTROYED " ; YOU HAVE DESTROYED YOURSELF BY DROPPING THE {name of Current ; Object}. THERE IS UTTER CHAOS FOR 3.14 PARSECS IN ALL DIRECTIONS 44880 DEFM 105,"RSELF BY DROPP",207," " 44897 DEFM 116," ",29,". " 44902 DEFM 116,"RE ",115,"UTTER CHAOS " 44919 DEFM "FOR 3.14 PARSECS ",95," " 44938 DEFM "ALL DIRECTIONS" 44952 DEFM 0 44953 DEFM 9 ; Height = 9 44954 DEFM 105," R",98,"OUT ",111,"STAR " ; YOU RAN OUT OF STAR DRIVE FUEL AND HAVE STRANDED YOURSELF IN DEEP ; SPACE 44968 DEFM "DRIVE FUEL ",112," HAVE " 44986 DEFM "STR",112,"ED ",105,"RSELF ",95," " 45002 DEFM "DEEP SPACE" 45012 DEFM 0 45013 DEFM 6 ; Height = 6 45014 DEFM 116," ",141," " ; THE TRANSPORTER SENDS YOU TO SUFFOCATE IN THE COLD OF OUTER SPACE 45018 DEFM "SENDS ",105," ",99 45027 DEFM "SUFFOCATE ",95," " 45039 DEFM 116," COLD ",111 45047 DEFM "OUTER SPACE" 45058 DEFM 0 45059 DEFM 12 ; Height = 12 45060 DEFM 116," ",141," ",151 ; THE TRANSPORTER HAS MALFUNCTIONED AND SPREAD YOUR ATOMS ACROSS THE ; COSMOS IN THE SHAPE OF A BUTTERFLY. WHAT A PRETTY WAY TO DIE ! 45065 DEFM "MALFUNCTIONED ",112," " 45081 DEFM "SP",114," ",105,"R ATOMS " 45094 DEFM "ACROSS ",116," COSMOS ",95," " 45112 DEFM 116," SHAPE ",111,97 45122 DEFM "BUTTERFLY. WHAT ",97 45139 DEFM "PRETTY WAY ",99,"DIE !" 45156 DEFM 0 45157 DEFM 10 ; Height = 10 45158 DEFM "IT WOULD MAKE MORE " ; IT WOULD MAKE MORE SENSE TO ENTER COORDINATES THAT LAND YOU ON A ; TRANSPORTER PAD OF SOME SORT ! 45177 DEFM "SENSE ",99,"ENTER " 45190 DEFM 163,"THAT L",112," " 45199 DEFM 105," ON ",97,141," " 45207 DEFM "PAD ",111,"SOME SORT !" 45223 DEFM 0 45224 DEFM 6 ; Height = 6 45225 DEFM 105," R",98,"OUT ",111,129 ; YOU RAN OUT OF TIME 45235 DEFM 0 ; Derby IV Dialogue and I.D. Card Messages b45236 DEFM 11 ; Height = 11 45237 DEFM 31," ",102,"'",128 ; name of Current Character} SAYS 'HELLO MAGIC KNIGHT. AS A ; TEMPORALY MISPLACED PERSON YOU ARE ALSO UNWITTINGLY A ; STOWAWAY ON THIS STARSHIP. FORTUNATELY FOR YOU MY PROGRAMMERS ; FORESAW YOUR ARRIVAL AND HAVE GIVEN ME A CHANCE TO HELP YOU. ; (bug) 45242 DEFM 144,". AS ",97 45249 DEFM "TEMPORALY MISPLACED " 45269 DEFM "PERSON ",105," ",125,"ALSO " 45284 DEFM "UNWITT",207,"LY ",97,"STOWAWAY ON " 45307 DEFM "TH",115,145,". " 45313 DEFM "FORTUNATELY FOR ",105," MY " 45334 DEFM "PROGRAMMERS FORESAW ",105,"R " 45357 DEFM "ARRIVAL ",112," HAVE GIVEN ME " 45381 DEFM 97,"CHANCE ",99,104," ",105,"." 45394 DEFM 0 45395 DEFM 11 ; Height = 11 45396 DEFM "FROM ",129," ",99,129," " ; FROM TIME TO TIME I WILL BE ABLE TO GIVE YOU ADVICE. FOR THE ; MOMENT THE ONLY HELP I CAN GIVE YOU IS THIS BLANK I.D. CARD ; WHICH YOU WILL HAVE TO GET AUTHORIZED' 45406 DEFM "I WILL BE ABLE ",99 45422 DEFM 118,105," ADVICE. " 45433 DEFM "FOR ",116," MOMENT " 45446 DEFM 116," ONLY ",104," I " 45457 DEFM "C",98,118,105," ",115 45463 DEFM "TH",115,"BLANK I.D. " 45477 DEFM "CARD WHICH ",105," " 45490 DEFM "WILL HAVE ",99,"GET " 45505 DEFM "AUTHORIZED'" 45516 DEFM 0 45517 DEFM 7 ; Height = 7 45518 DEFM "WHIRRRRR........ PLOP !",14 ; WHIRRRRR........ PLOP ! A PIECE OF PLASTICARD HAS FALLEN FROM ; A SLOT IN THE TRANSPUTER. IT HAS A SECTION SAYING 'REGISTER ; YOUR I.D. HERE' 45542 DEFM 97,"PIECE ",111,"PLASTICARD ",151 45562 DEFM "FALLEN FROM ",97,"SLOT ",95," ",116," " 45584 DEFM 178,". IT ",151,97 45592 DEFM "SECTION SAY",207," 'REGISTER " 45615 DEFM 105,"R I.D. HERE'" 45628 DEFM 0 45629 DEFM 9 ; Height = 9 45630 DEFM 31," ",102,"'STICK ",105,"R " ; name of Current Character} SAYS 'STICK YOUR PHOTO ON THE I.D. ; CARD SO THAT THE NON-ELECTRONIC CREW WILL TAKE NOTICE OF YOU. ; I HAVE FIXED IT SO THAT YOU WILL BE QUITE AN IMPORTANT ; STARFLEET OFFICIAL.' 45643 DEFM "PHO",99,"ON ",116," I.D. CARD SO " 45665 DEFM "THAT ",116," ",148,"N-ELECTRONIC " 45686 DEFM "CREW WILL ",117,148,"TICE ",111 45704 DEFM 105,". I HAVE FIXED IT SO " 45726 DEFM "THAT ",105," WILL BE QUITE ",98 45748 DEFM "IMPORTANT ",172," " 45760 DEFM "OFFICIAL.'" 45770 DEFM 0 45771 DEFM 11 ; Height = 10 45772 DEFM "OOOPS!.. ",105," HAVE " ; OOOPS!.. YOU HAVE HAD AN ACCIDENT WITH THE GLUE! THE PHOTO ; HAS BECOME STUCK TO THE BLANK I.D. CARD. IT WOULD SEEM THAT ; YOU HAVE BEEN QUITE LUCKY. 45788 DEFM "HAD ",98,"ACCIDENT " 45802 DEFM "WITH ",116," GLUE! " 45815 DEFM 116," PHO",99,151 45822 DEFM "BECOME STUCK ",99 45836 DEFM 116," BLANK I.D. " 45849 DEFM "CARD. IT WOULD " 45864 DEFM "SEEM THAT ",105," " 45876 DEFM "HAVE BEEN QUITE " 45892 DEFM "LUCKY." 45898 DEFM 0 ; "Eat Own McTablets" Message b45899 DEFM 5 ; Height = 4 45900 DEFM 105," HAD ",99,"EAT " ; YOU HAD TO EAT SOME OF YOUR OWN MCTABLETS TO KEEP YOUR STRENGTH UP. 45911 DEFM "SOME ",111,105,"R OWN " 45924 DEFM 171,"S ",99,"KEEP " 45933 DEFM 105,"R STRENGTH UP." 45948 DEFM 0 ; "CAST A SPELL" Messages Consult Oracle (00) b45949 DEFM 4 ; Height = 4 45950 DEFM 116," ORACLE ",115,148,"T " ; THE ORACLE IS NOT ABLE TO HELP AT THE MOMENT 45963 DEFM "ABLE ",99,104," AT " 45974 DEFM 116," MOMENT" 45982 DEFM 0 ; Consult Oracle (01) 45983 DEFM 4 ; Height = 4 45984 DEFM 164 ; THERE IS NOTHING USEFUL FROM THE ORACLE NOW 45985 DEFM 0 ; Consult Oracle (02) 45986 DEFM 4 ; Height = 4 45987 DEFM 164 ; THERE IS NOTHING USEFUL FROM THE ORACLE NOW 45988 DEFM 0 ; Consult Oracle (03) 45989 DEFM 14 ; Height = 14 45990 DEFM 116," " ; THE GOLDEN SUNDIAL OF ALPHA. WAS THE SYMBOL OF THE TYME GUARDIANS ; POWER. NOBODY KNOWS FOR CERTAIN WHERE IT IS NOWBUT THERE ARE ; RUMOURS THAT IT WAS BROKEN UP FOR SCRAP WHEN THE TYME GUARDIANS ; WERE OFFICIALLY DISBANDED. (bug) 45992 DEFM 162," WAS ",116," " 46000 DEFM "SYMBOL ",111,116," " 46010 DEFM 167," POWER. " 46019 DEFM 148,"BODY K",148,"WS FOR " 46034 DEFM "CERTA",95," WHERE IT " 46050 DEFM 115,148,"WBUT ",116,"RE " 46061 DEFM 125,"RUMOURS THAT " 46075 DEFM "IT WAS BROKEN UP " 46092 DEFM "FOR SCRAP WHEN ",116," " 46109 DEFM 167," " 46111 DEFM "WERE OFFICIALLY " 46127 DEFM "DISB",112,"ED." 46135 DEFM 0 ; Consult Oracle (04) 46136 DEFM 4 ; Height = 4 46137 DEFM 164 ; THERE IS NOTHING USEFUL FROM THE ORACLE NOW 46138 DEFM 0 ; Consult Oracle (05) 46139 DEFM 10 ; Height = 10 46140 DEFM 116," ORACLE HAS " ; THE ORACLE HAS LOCATED THE TYME GUARDIANS AT A PLACE CALLED ; OUTPOST. THEY HAVE BEEN THERE IN HIDING SINCE THE END OF THE 23RD ; CENTURY. 46153 DEFM "LOCATED ",116," " 46163 DEFM 167," " 46165 DEFM "AT ",97,"PLACE CALLED " 46182 DEFM "OUTPOST. ",116,"Y HAVE " 46199 DEFM "BEEN ",116,"RE ",95," " 46210 DEFM "HID",207," S",95,"CE ",116," " 46222 DEFM "END ",111,116," 23RD " 46234 DEFM "CENTURY." 46242 DEFM 0 ; Consult Oracle (06) 46243 DEFM 8 ; Height = 8 46244 DEFM 116," ORACLE SEES " ; THE ORACLE SEES DANGER ON SOME PLANETS. SECURITY SYSTEMS MUST BE ; BYPASSED. SOME SILENT BOOTS COULD PROVE USEFUL. 46258 DEFM "DANGER ON SOME " 46273 DEFM "PLANETS. ",131," " 46284 DEFM "SYSTEMS MUST BE " 46300 DEFM "BYPASSED. SOME " 46315 DEFM "SILENT BOOTS COULD " 46334 DEFM "PROVE USEFUL." 46347 DEFM 0 ; Consult Oracle (07) 46348 DEFM 8 ; Height = 8 46349 DEFM 116,"RE ",115,97,"SUNDIAL " ; THERE IS A SUNDIAL TO BE MENDED. YOU MUST APPLY A LARGE BURST OF ; ENERGY TO THE SEGMENTS BEFORE THEY WILL MERGE 46363 DEFM 99,"BE MENDED. ",105," " 46377 DEFM "MUST APPLY ",97,"LARGE " 46395 DEFM "BURST ",111,"ENERGY ",99 46410 DEFM 116," SEGMENTS " 46421 DEFM "BEFORE ",116,"Y WILL " 46436 DEFM "MERGE" 46441 DEFM 0 ; Consult Oracle (08) 46442 DEFM 4 ; Height = 4 46443 DEFM "IT ",104,"S ",99,"BE " ; IT HELPS TO BE UNSEEN IN SOME PLACES 46453 DEFM "UNSEEN ",95," SOME " 46467 DEFM "PLACES" 46473 DEFM 0 ; Consult Oracle (09) 46474 DEFM 5 ; Height = 5 46475 DEFM 97,"GAS MASK WILL " ; A GAS MASK WILL SAVE YOUR LIFE IF YOU USE IT IN THE RIGHT PLACE 46490 DEFM "SAVE ",105,"R LIFE IF " 46506 DEFM 105," USE IT ",95," ",116," " 46519 DEFM "RIGHT PLACE" 46530 DEFM 0 46531 DEFM 4 ; Height = 4 46532 DEFM 116,"RE ",125,148," " ; THERE ARE NO BARRIERS TO BE REMOVED HERE. 46539 DEFM "BARRIERS ",99,"BE " 46552 DEFM "REMOVED HERE." 46565 DEFM 0 46566 DEFM 4 ; Height = 4 46567 DEFM 116," BARRIER HAS " ; THE BARRIER HAS FADED INTO NOTHINGNESS 46581 DEFM "FADED ",95,99 46589 DEFM 148,"TH",207,"NESS" 46597 DEFM 0 46598 DEFM 8 ; Height = 8 46599 DEFM 105," HAVE THROWN ",97 ; YOU HAVE THROWN A LIGHTNING BOLT BUT THERE WAS NO OBVIOUS TARGET ; SO IT DISSIPATED HARMLESSLY IN THE AIR. 46614 DEFM 183," BUT " 46620 DEFM 116,"RE WAS ",148," " 46630 DEFM "OBVIOUS TARGET SO " 46648 DEFM "IT DISSIPATED " 46662 DEFM "HARMLESSLY ",95," ",116," " 46677 DEFM "AIR." 46681 DEFM 0 46682 DEFM 12 ; Height = 12 46683 DEFM 105,"R ",183," " ; YOUR LIGHTNING BOLT HAS HIT THE ANCIENT TYME MACHINE AND GIVEN IT ; ENOUGH ENERGY TO TRAVEL ABOUT 1200 YEARS BACKWARD IN TIME. ALL YOU ; HAVE TO DO NOW IS TO FIND THE ROUTE HOME. 46688 DEFM "HAS HIT ",116," " 46698 DEFM "ANCIENT ",166," " 46708 DEFM 112," GIVEN " 46716 DEFM "IT E",148,"UGH ENERGY " 46732 DEFM 99,"TRAVEL ",124 46741 DEFM "1200 YEARS " 46752 DEFM "BACKWARD ",95," ",129,". " 46766 DEFM "ALL ",105," HAVE ",99,"DO " 46781 DEFM 148,"W ",115,99,"F",95,"D ",116," " 46792 DEFM "ROUTE HOME." 46803 DEFM 0 46804 DEFM 11 ; Height = 11 46805 DEFM 116," SEGMENTS ",111 ; THE SEGMENTS OF THE GOLDEN SUNDIAL OF ALPHA. HAVE BEEN WELDED INTO ; ONE UNIT BY THE AWESOME POWER OF YOUR LIGHTNING BOLT. BEHOLD! HERE ; IS THE GOLDEN SUNDIAL OF ALPHA.. (bug) 46817 DEFM 116," ",162," " 46821 DEFM "HAVE BEEN WELDED ",95,99 46840 DEFM "ONE UNIT BY ",116," " 46854 DEFM "AWESOME POWER ",111 46869 DEFM 105,"R ",183,". " 46875 DEFM "BEHOLD! HERE " 46888 DEFM 115,116," " 46891 DEFM 162,"." 46893 DEFM 0 46894 DEFM 14 ; Height = 14 (bug) 46895 DEFM 105,"R ",183," " ; YOUR LIGHTNING BOLT HAS ALERTED THE SECURITY SYSTEM TO YOUR ; PRESENCE. A BIGGER LIGHTNING BOLT HAS JUST BLASTED YOU OUT OF ; MORTAL EXISTENCE. 46900 DEFM "HAS ALERTED " 46912 DEFM 116," ",131," " 46916 DEFM "SYSTEM ",99,105,"R " 46927 DEFM "PRESENCE. ",97,"BIGGER " 46945 DEFM 183," HAS " 46951 DEFM "JUST BLASTED ",105," " 46966 DEFM "OUT ",111,"MORTAL " 46978 DEFM "EXISTENCE." 46988 DEFM 0 ; Tyme Guardians Messages b46989 DEFM 13 ; Height = 12 46990 DEFM 97,"LOUD BOOM",207," " ; A LOUD BOOMING VOICE ECHOES ABOUT THE ROOM 'HAIL VISITOR! BE WARNED THAT ; THE GOLDEN SUNDIAL OF ALPHA. IS THE ONLY PASSPORT TO SAFETY IF YOU WISH TO ; TRAVEL FURTHER AND LIVE!' (bug) 47002 DEFM "VOICE ECHOES " 47015 DEFM 124,116," ",208," " 47020 DEFM "'HAIL VISITOR! BE " 47038 DEFM "WARNED THAT ",116," " 47052 DEFM 162 47053 DEFM " ",115,116," " 47057 DEFM "ONLY PASSPORT ",99 47072 DEFM "SAFETY IF ",105," " 47084 DEFM "WISH ",99,"TRAVEL " 47097 DEFM "FURTHER ",112," " 47107 DEFM "LIVE!'" 47113 DEFM 0 47114 DEFM 13 ; Height = 13 47115 DEFM 116," ",167," " ; THE TYME GUARDIANS ARE SHOCKED AT YOUR ARRIVAL AND AFTER THE PANIC HAS DIED ; DOWN THEY SAY 'MAGIC KNIGHT YOU HAVE PUT US ALL IN GRAVE DANGER THROUGH ; YOUR MISSUSE OF THE OLDE MAJICK. (bug) 47119 DEFM 125,"SHOCKED AT " 47131 DEFM 105,"R ARRIVAL ",112," " 47144 DEFM "AFTER ",116," PANIC " 47158 DEFM "HAS DIED DOWN ",116,"Y " 47175 DEFM "SAY '",144," " 47182 DEFM 105," HAVE PUT US " 47196 DEFM "ALL ",95," GRAVE " 47208 DEFM "DANGER THROUGH " 47223 DEFM 105,"R MISSUSE ",111 47235 DEFM 116," OLDE MAJICK." 47249 DEFM 0 47250 DEFM 14 ; Height = 14 47251 DEFM 105," MUST RETURN ",99 ; YOU MUST RETURN TO YOUR OWN TIME BEFORE THE DAMAGE IS IRREVERSIBLE. OUR ; EMERGENCY TYME MACHINE IS BEING FITTED TO THE AIRLOCK OF THE USS PISCES AT ; THIS VERY MOMENT. GO QUICKLY THERE IS NO TIME OR TYME TO WASTE!' 47266 DEFM 105,"R OWN ",129," " 47275 DEFM "BEFORE ",116," DAMAGE " 47291 DEFM 115,"IRREVERSIBLE. " 47306 DEFM "OUR EMERGENCY ",166," " 47322 DEFM 115,"BE",207," " 47327 DEFM "FITTED ",99,116," " 47337 DEFM "AIRLOCK ",111,116," " 47348 DEFM 146," AT TH",115 47356 DEFM "VERY MOMENT. GO " 47372 DEFM "QUICKLY ",116,"RE ",115 47385 DEFM 148," ",129," OR TYME ",99 47398 DEFM "WASTE!'" 47405 DEFM 0 ; Tyme Machine-Related "Game Over" Texts b47406 DEFM 9 ; Height = 9 47407 DEFM "AS ",105," FELL TOWARDS " ; AS YOU FELL TOWARDS GANGROLE THE TYME MACHINE OVERLOADED AND BLEW UP. 47425 DEFM "GANGROLE ",116," ",166," " 47438 DEFM "OVERLOADED ",112," " 47451 DEFM "BLEW UP." 47459 DEFM 0 47460 DEFM 8 ; Height = 8 47461 DEFM 105," ",112," ",116," ",166," " ; YOU AND THE TYME MACHINE CRASHED TO THE SURFACE OF {name of Current ; Starship Location} 47469 DEFM "CRASHED ",99,116," " 47480 DEFM "SURFACE ",111,28 47490 DEFM 0 ; Characters' "Current Status" Texts ; ; First group of texts are strings used when characters are awake. Second group are for characters that are asleep. b47491 DEFM 0 ; Unused ; (01) Magic Knight 47492 DEFM "PROGRESS 000 %",14 ; PROGRESS 000 % TIME LEFT 30 DAYS 47507 DEFM 129," LEFT 30 DAYS" 47521 DEFM 0 ; (02) Gordon (awake) 47522 DEFM 195," ",115,"AT ",116," HELM CONTROL" ; GORDON IS AT THE HELM CONTROL 47542 DEFM 0 ; (03) Sarab (awake) 47543 DEFM 196," ",115,"DEPUTY HELMSMAN" ; SARAB IS DEPUTY HELMSMAN 47561 DEFM 0 ; (04) Klink (awake) 47562 DEFM 197," ",115,97,"ROBODROID" ; KLINK IS A ROBODROID 47575 DEFM 0 ; (05) S3 E3 (awake) 47576 DEFM 198," ",151,97,"FAMOUS COUS",95 ; S3 E3 HAS A FAMOUS COUSIN 47592 DEFM 0 ; (06) Hooper (awake) 47593 DEFM 199," USED ",99,"M",95,"E TRILITHIUM" ; HOOPER USED TO MINE TRILITHIUM 47615 DEFM 0 ; (07) Murphy (awake) 47616 DEFM 200," LIKES POTATOES" ; MURPHY LIKES POTATOES 47632 DEFM 0 ; (08) Sharon (awake) 47633 DEFM 201," COMES FROM VALHALLA" ; SHARON COMES FROM VALHALLA 47654 DEFM 0 ; (09) Forbin (awake) 47655 DEFM 202," ",115,"QUITE CLEVER" ; FORBIN IS QUITE CLEVER 47670 DEFM 0 ; (10) Derby IV (awake) 47671 DEFM 203," RUNS AT 200 GHZ" ; DERBY IV RUNS AT 200 GHZ 47688 DEFM 0 ; (11) Swiftfoot (awake) 47689 DEFM 204," FEELS LIKE ",97,"BIT ",111,97,"HEEL" ; SWIFTFOOT FEELS LIKE A BIT OF A HEEL 47713 DEFM 0 ; (12) Julie 8 (awake) 47714 DEFM 205," ",115,"VERY ROMANTIC FOR ",98,112,"ROID" ; JULIE 8 IS VERY ROMANTIC FOR AN ANDROID 47741 DEFM 0 ; (13) Hectorr (awake) 47742 DEFM 206," ",115,97,"FEATHERED ALIEN" ; HECTORR IS A FEATHERED ALIEN 47761 DEFM 0 ; (14) Unused 47762 DEFM 0 ; (15) Unused 47763 DEFM 0 ; (16) Unused 47764 DEFM 0 ; (17) Unused 47765 DEFM 0 ; (18) Gordon (asleep) 47766 DEFM 195," ",115,122," AT ",116," HELM CONTROL" ; GORDON IS ASLEEP AT THE HELM CONTROL 47788 DEFM 0 ; (19) Sarab (asleep) 47789 DEFM 196," ",115,97,"S",148,"R",207," DEPUTY HELMSMAN" ; SARAB IS A SNORING DEPUTY HELMSMAN 47813 DEFM 0 ; (20) Klink (asleep) 47814 DEFM 197," ",115,97,148,"N FUNCTION",207," ROBODROID" ; KLINK IS A NON FUNCTIONING ROBODROID 47840 DEFM 0 ; (21) S3 E3 (asleep) 47841 DEFM 198," ",151,"BLEEPED ",95,99,116," L",112," ",111,148,"DE" ; S3 E3 HAS BLEEPED INTO THE LAND OF NODE 47863 DEFM 0 ; (22) Hooper (asleep) 47864 DEFM 199," ",115,123,124,"M",95,207 ; HOOPER IS DREAMING ABOUT MINING 47872 DEFM 0 ; (23) Murphy (asleep) 47873 DEFM 200," ",115,122 ; MURPHY IS ASLEEP 47877 DEFM 0 ; (24) Sharon (asleep) 47878 DEFM 201," ",115,123,124,"VALHALLA" ; SHARON IS DREAMING ABOUT VALHALLA 47891 DEFM 0 ; (25) Forbin (asleep) 47892 DEFM 202," ",115,"TOTALLY ZONKED OUT" ; FORBIN IS TOTALLY ZONKED OUT 47913 DEFM 0 ; (26) Derby IV (asleep) 47914 DEFM 203," RUNS AT 0 MHZ WHEN SWITCHED OFF (LIKE ",148,"W)" ; DERBY IV RUNS AT 0 MHZ WHEN SWITCHED OFF ; (LIKE NOW) (bug) 47957 DEFM 0 ; (27) Swiftfoot (asleep) 47958 DEFM 204," ",115,95," ",116," MIDST ",111,97,"DREAM" ; SWIFTFOOT IS IN THE MIDST OF A DREAM 47978 DEFM 0 ; (28) Julie 8 (asleep) 47979 DEFM 205," ",115,123,124,"ROMIE 0" ; JULIE 8 IS DREAMING ABOUT ROMIE 0 47991 DEFM 0 ; (29) Hectorr (asleep) 47992 DEFM 206," ",115,123,124,"RAVENS" ; HECTORR IS DREAMING ABOUT RAVENS 48003 DEFM 0 ; Planets' "REQUEST HELP" Strings (00) Unused b48004 DEFM 0 ; (01) Deneb 48005 DEFM 6 ; Height = 6 (see trivia) 48006 DEFM "TH",115,115,97,"RECORDED MESSAGE. " ; THIS IS A RECORDED MESSAGE. THE SPACE PLAGUE HAS STRUCK ; HERE. I AM THE LAST SURVIVOR. KEEP CLEAR THERE IS NO ; KNOWN CURE. 48029 DEFM 116," SPACE PLAGUE ",151,"STRUCK " 48052 DEFM "HERE. I AM ",116," LAST SURVIVOR. " 48080 DEFM "KEEP CLEAR ",116,"RE ",115,148," K",148,"WN " 48103 DEFM "CURE." 48108 DEFM 0 ; (02) Gath 48109 DEFM 6 ; Height = 6 48110 DEFM "HAIL ",145,", FABI",98,116," " ; HAIL STARSHIP, FABIAN THE HUMAN TRADER CLONE HERE. ; SORRY I CANNOT HELP YOU BUT MY BROTHER VESUVIUS MIGHT ; BE ABLE TO, HE IS ON EDEN 48125 DEFM "HUM",98,"TRADER CLONE HERE. SORRY " 48154 DEFM "I",186,"BUT MY " 48163 DEFM "BRO",116,"R VESUVIUS MIGHT BE ABLE " 48192 DEFM "TO, HE ",115,"ON EDEN" 48207 DEFM 0 ; (03) Monopole 48208 DEFM 5 ; Height = 5 48209 DEFM 199," ",102,"'GO AWAY !! " ; HOOPER SAYS 'GO AWAY !! STARFLEET ARE NOTHING BUT ; TROUBLE TO DECENT FOLKS' AND BREAKS COMMUNICATION 48224 DEFM 172," ",125,150,"BUT " 48232 DEFM "TROUBLE ",99,"DECENT FOLKS' ",112," " 48257 DEFM "BREAKS ",140,"ION" 48268 DEFM 0 ; (04) Porthos 48269 DEFM 4 ; Height = 4 48270 DEFM 128,"EARTH BE",207,". ",28," ",115 ; HELLO EARTH BEING. {name of Current Starship Location} ; IS PLEASED TO WELCOME YOU BUT WE CANNOT HELP YOU 48285 DEFM "PLEASED ",99,"WELCOME ",105," BUT ",113 48309 DEFM 186 48310 DEFM 0 ; (05) Starbase 1 48311 DEFM 5 ; Height = 5 48312 DEFM "AHOY ",116,"RE ",144,", WHY " ; AHOY THERE MAGIC KNIGHT, WHY NOT BEAM DOWN FOR SOME ; SHORE LEAVE ? COORDINATES ARE X1Y2Z3 48328 DEFM 148,"T BEAM DOWN FOR SOME SHORE " 48356 DEFM "LEAVE ?",14 48364 DEFM 163,125,"X1Y2Z3" 48372 DEFM 0 ; (06) Lynx 48373 DEFM 8 ; Height = 8 48374 DEFM "TH",115,115,"RADIO ",28," ON 234 KHZ " ; THIS IS RADIO {name of Current Starship Location} ON ; 234 KHZ AND 97.2 FM. AND HERE IS AN URGENT NEWSFLASH ; FOR MAGIC KNIGHT 'MURPHY THE ECCENTRIC LIVES ON RETREAT ; AND THE TRANSPORTER COORDINATES ARE X8Y4Z1.' 48397 DEFM 112," 97.2 FM. ",112," HERE ",115,98 48417 DEFM "URGENT NEWSFLASH FOR ",144," " 48440 DEFM "'",200," ",116," ",109," " 48447 DEFM "LIVES ON ",107," ",112," ",116," " 48462 DEFM 141," ",163,125 48466 DEFM "X8Y4Z1.'" 48474 DEFM 0 ; (07) Nirvana 48475 DEFM 5 ; Height = 5 48476 DEFM 137,146,", MAY " ; GREETINGS USS PISCES, MAY ALLAH GREET YOUR SPIRIT IN ; HEAVEN, I CANNOT HELP YOU MAGIC KNIGHT 48484 DEFM "ALLAH GREET ",105,"R SPIRIT ",95," " 48508 DEFM "HEAVEN, I",186 48518 DEFM 144 48519 DEFM 0 ; (08) Limbo 48520 DEFM 5 ; Height = 5 48521 DEFM "MAY ",116," FORD BE WITH ",105," " ; MAY THE FORD BE WITH YOU MAGIC KNIGHT. WE ARE TOLD THAT ; THE PLANET HERSCHELL IS FAMOUS FOR IT'S ASTRONOMERS ; (bug) 48542 DEFM 144,". ",113,125,"TOLD THAT ",116," " 48559 DEFM "PLANET ",106," ",115,"FAMOUS FOR " 48580 DEFM "IT'S ",126,"S" 48587 DEFM 0 ; (09) Eden 48588 DEFM 5 ; Height = 5 48589 DEFM 128,"MATEY, DR VESUVIUS HERE " ; HELLO MATEY, DR VESUVIUS HERE ON PLANET {name of ; Current Starship Location} APPARENTLY HOOPER THE ; ECCENTRIC LIVES ON A PLANET CALLED 'NAFF' 48614 DEFM "ON PLANET ",28," APPARENTLY " 48637 DEFM 199," ",116," ",109," LIVES ON " 48652 DEFM 97,"PLANET CALLED 'NAFF'" 48673 DEFM 0 ; (10) Herschell 48674 DEFM 7 ; Height = 7 48675 DEFM 137,144,", I HAVE " ; GREETINGS MAGIC KNIGHT, I HAVE A MESSAGE FROM OUR CHIEF ; ASTRONOMER. SHE SAYS 'GANGROLE IS A BLACK HOLE WITH A ; HIGH RATE OF ROTATION AND A VERY STRONG MAGNETIC FIELD' 48686 DEFM 97,"MESSAGE FROM OUR CHIEF " 48710 DEFM 126,". SHE ",102,"'GANGROLE " 48728 DEFM 115,97,"BLACK HOLE WITH ",97,"HIGH " 48752 DEFM "RATE ",111,"ROTATION ",112," ",97,"VERY " 48775 DEFM "STRONG MAGNETIC FIELD'" 48797 DEFM 0 ; (11) Trantore 48798 DEFM 10 ; Height = 10 48799 DEFM "TRANSMISSION..... RE: " ; TRANSMISSION..... RE: TYME GUARDIANS TRANSPORTER ; COORDINATES . DO NOT BELIEVE THOSE GIVEN BY THE TYME ; GUARDIANS. THEY ARE A TRAP FOR THE UNWARY VISITOR. ADD ; 1 TO EACH DIGIT IN THE SEQUENCE ... XMIT FROM GALACTIC ; CITIZENS ADVICE CENTRE ... MSG END. 48821 DEFM 167," ",141," " 48825 DEFM 163,". DO ",148,"T BELIEVE " 48842 DEFM "THOSE GIVEN BY ",116," " 48859 DEFM 167,". ",116,"Y ",125,97,"TRAP FOR " 48876 DEFM 116," UNWARY VISITOR. ADD 1 ",99 48901 DEFM "EACH DIGIT ",95," ",116," SEQUENCE ... " 48929 DEFM "XMIT FROM GALACTIC ",191,"S " 48951 DEFM "ADVICE CENTRE ... MSG END." 48977 DEFM 0 ; (12) Plop Plop 48978 DEFM 7 ; Height = 7 48979 DEFM "TH",115,115,97,"RECORDED MESSAGE. " ; THIS IS A RECORDED MESSAGE. THIS PLANET IS INHABITED BY ; DOLPHINS WHO LEFT EARTH WAY BACK IN THE 22ND CENTURY ; WHEN IT WAS DESTROYED TO MAKE WAY FOR A MCTABLET ; MEGASTORE. 49002 DEFM "TH",115,"PLANET ",115,95,"HABITED BY " 49025 DEFM "DOLPH",95,"S WHO LEFT EARTH WAY " 49052 DEFM "BACK ",95," ",116," 22ND CENTURY WHEN " 49079 DEFM "IT WAS DESTROYED ",99,"MAKE WAY " 49106 DEFM "FOR ",97,171," MEGASTORE." 49123 DEFM 0 ; (13) Brightstar 49124 DEFM 8 ; Height = 8 49125 DEFM "TH",115,115,116," ",28," " ; THIS IS THE {name of Current Starship Location} ; COMMUNICATION CENTRE, WE HAVE BEEN INFORMED OF YOUR ; SITUATION MAGIC KNIGHT. WE SUGGEST THAT YOU TRAVEL ; IMMEDIATELY TO HERSCHELL TO PICK UP VITAL INFORMATION 49133 DEFM 140,"ION CENTRE, ",113,"HAVE " 49152 DEFM "BEEN ",95,"FORMED ",111,105,"R " 49169 DEFM "SITUATION ",144,". ",113 49183 DEFM "SUGGEST THAT ",105," TRAVEL " 49205 DEFM "IMMEDIATELY ",99,106," ",99 49221 DEFM "PICK UP VITAL ",95,"FORMATION" 49245 DEFM 0 ; (14) Outpost 49246 DEFM 4 ; Height = 4 49247 DEFM 116," ",167," SLEEP HERE. " ; THE TYME GUARDIANS SLEEP HERE. ENTER AT YOUR PERIL. THE ; COORDINATES ARE Z5Y8X7. 49263 DEFM "ENTER AT ",105,"R PERIL. ",116," " 49284 DEFM 163,125,"Z5Y8X7." 49293 DEFM 0 ; (15) Polaris 49294 DEFM 6 ; Height = 6 49295 DEFM 128,144,". APPARENTLY " ; HELLO MAGIC KNIGHT. APPARENTLY HOOPER USED TO BE A ; CITIZEN OF THE PERSONS REPUBLIC OF PLINKIT BEFORE HE ; BECAME AN ASTEROID MINER. 49310 DEFM 199," USED ",99,"BE A ",191," ",111 49326 DEFM 116," PERSONS REPUBLIC ",111 49346 DEFM "PL",95,"KIT BEFORE HE BECAME ",98 49371 DEFM "ASTEROID M",95,"ER." 49385 DEFM 0 ; (16) Bingo 49386 DEFM 8 ; Height = 8 49387 DEFM "TH",115,"PLANET ",115,116," PROPERTY ",111 ; THIS PLANET IS THE PROPERTY OF ARTHUR SCRUNGE. THE ; WINNER OF THE DAILY SOLAR NEWSPAPER 20 BILLION CREDIT ; GAME. ARTHUR IS NOT AT HOME JUST NOW BUT THE SLAVE ; DROIDS ARE READY TO REFUEL YOUR STARSHIP. (bug) 49410 DEFM "ARTHUR SCRUNGE. ",116," W",95,"NER ",111 49435 DEFM 116," DAILY SOLAR NEWSPAPER 20 " 49462 DEFM "BILLION CREDIT GAME. ARTHUR ",115 49491 DEFM 148,"T AT HOME JUST ",148,"W BUT ",116," " 49516 DEFM "SLAVE DROIDS ",125,"READY ",99 49537 DEFM "REFUEL ",105,"R ",145,"." 49549 DEFM 0 ; (17) Retreat 49550 DEFM 5 ; Height = 5 49551 DEFM "TH",115,115,200," HERE.. GO AWAY " ; THIS IS MURPHY HERE.. GO AWAY MAGIC KNIGHT, I DO NOT ; HAVE ANY TRUCK WITH STARFLEET PEOPLE 49572 DEFM 144,", I DO ",148,"T HAVE " 49588 DEFM "ANY TRUCK WITH ",172," " 49605 DEFM "PEOPLE" 49611 DEFM 0 ; (18) Dragon Egg 49612 DEFM 4 ; Height = 4 49613 DEFM "WARN",207," ",99,"ALL CARBON BASED " ; WARNING TO ALL CARBON BASED LIFE FORMS. DO NOT BEAM ; DOWN HERE. THIS IS A NEUTRON STAR ! 49637 DEFM "LIFE FORMS. DO ",148,"T BEAM DOWN " 49665 DEFM "HERE. TH",115,115,97,"NEUTRON STAR !" 49690 DEFM 0 ; (19) Aridia 49691 DEFM 6 ; Height = 6 (see trivia) 49692 DEFM "TH",115,115,"A RECORDED MESSAGE. " ; THIS IS A RECORDED MESSAGE. THE SPACE PLAGUE HAS STRUCK ; HERE. I AM THE LAST SURVIVOR. KEEP CLEAR THERE IS NO ; KNOWN CURE. 49716 DEFM 116," SPACE PLAGUE ",151,"STRUCK " 49739 DEFM "HERE. I AM ",116," LAST SURVIVOR. " 49767 DEFM "KEEP CLEAR ",116,"RE ",115,148," K",148,"WN " 49790 DEFM "CURE." 49795 DEFM 0 ; (20) Gangrole 49796 DEFM 0 ; (21) Naff 49797 DEFM 9 ; Height = 9 49798 DEFM 128,144," I AM ZOBBF. " ; HELLO MAGIC KNIGHT I AM ZOBBF. I EXPECT YOU ARE LOOKING ; FOR HOOPER. HE MOVED ON AFTER HIS 'SECRET' BECAME ; KNOWN. THE RUMOURS SAY THAT HE FOUND A SECTION OF THE ; GOLDEN SUNDIAL OF ALPHA. WHILE MINING FOR QUARKANIUM. ; (bug) 49813 DEFM "I EXPECT ",105," ",125,"LOOK",207," FOR " 49835 DEFM 199,". HE MOVED ON AFTER H",115 49858 DEFM "'SECRET' BECAME K",148,"WN. ",116," " 49882 DEFM "RUMOURS SAY THAT HE FOUND ",97 49909 DEFM "SECTION ",111,116," " 49920 DEFM 162," WHILE M",95,207," FOR " 49936 DEFM "QUARKANIUM." 49947 DEFM 0 ; (22) Reef 49948 DEFM 0 ; (23) Menopausia 49949 DEFM 7 ; Height = 7 49950 DEFM "TH",115,115,28," WEA",116,"R " ; THIS IS {name of Current Starship Location} WEATHER ; STATION. WE ARE EXPECTING PARTICLE STORMS IN THE REGION ; OF BRIGHTSTAR AND LIMBO. PLEASE ENSURE THAT YOUR ; SHIELDS ARE OPERATIONAL 49962 DEFM "STATION. ",113,125,"EXPECT",207," " 49981 DEFM "PARTICLE STORMS ",95," ",116," ","REGION " 50008 DEFM 111,"BRIGHTSTAR ",112," LIMBO. " 50029 DEFM "PLEASE ENSURE THAT ",105,"R " 50051 DEFM "SHIELDS ",125,"OPERATIONAL" 50071 DEFM 0 ; (24) Plinkit 50072 DEFM 5 ; Height = 5 50073 DEFM 137,"FROM ",116," PERSONS " ; GREETINGS FROM THE PERSONS REPUBLIC OF {name of Current ; Starship Location}. OUR SPACE IS YOURS AND YOUR ; FRIENDSHIP IS VALUED MAGIC KNIGHT 50089 DEFM "REPUBLIC ",111,28,". OUR SPACE " 50112 DEFM 115,105,"RS ",112," ",105,"R FRIENDSHIP " 50133 DEFM 115,"VALUED ",144 50142 DEFM 0 ; Room Layout Data Pointers b50143 DEFW 50193 ; (00) - USS Pisces, 0 (The Recreation Room) 50145 DEFW 50253 ; (01) - USS Pisces, 1 (The Bridge) 50147 DEFW 50372 ; (02) - USS Pisces, 2 (The Transporter Room) 50149 DEFW 50425 ; (03) - USS Pisces, 3 (The Transputer Room) 50151 DEFW 50489 ; (04) - USS Pisces, 4 (Cargo Hold) 50153 DEFW 50535 ; (05) - USS Pisces, 5 (The Airlock) 50155 DEFW 50607 ; (06) - USS Pisces, 6 (The Life Boat) 50157 DEFW 50667 ; (07) - Retreat, 0 (Murphy's Moon) 50159 DEFW 50762 ; (08) - Retreat, 1 50161 DEFW 50850 ; (09) - Retreat, 2 50163 DEFW 51056 ; (10) - Retreat, 3 50165 DEFW 51150 ; (11) - Starbase 1, 0 (The Transporter Room) 50167 DEFW 51203 ; (12) - Starbase 1, 1 (McTablet Takeaway Food) 50169 DEFW 51243 ; (13) - Starbase 1, 2 50171 DEFW 51265 ; (14) - Starbase 1, 3 50173 DEFW 51281 ; (15) - Starbase 1, 4 (Fuel and Cargo Area) 50175 DEFW 51315 ; (16) - Outpost, 0 (Ye Olde Transporter) 50177 DEFW 51362 ; (17) - Outpost, 1 (The Main Defence System) 50179 DEFW 51414 ; (18) - Outpost, 2 50181 DEFW 51442 ; (19) - Outpost, 3 (The Proof of Power) 50183 DEFW 51500 ; (20) - Outpost, 4 (The Tyme Guardians) 50185 DEFW 51558 ; (21) - Monopole, 0 (Hooper's Emergency Exit) 50187 DEFW 51653 ; (22) - Monopole, 1 (This Way to Hooper ==>>) 50189 DEFW 51819 ; (23) - Monopole, 2 (Here is Hooper) 50191 DEFW 51919 ; (24) - USS Pisces, 6A (The Control Column) ; Room Layout Data (00) - USS Pisces, 0 (The Recreation Room) b50193 DEFB 55,5,5,11,19,0 ; Draw table (55) with attribute data index of 5, terrain interaction data index of 5 ; at (11, 19) 50199 DEFB 52,2,2,4,16,1 ; Draw large chair (52) with attribute data index of 2, terrain interaction data index ; of 2 at ( 4, 16), and apply vertical mirror (1) 50205 DEFB 52,2,2,20,16,0 ; Draw large chair (52) with attribute data index of 2, terrain interaction data index ; of 2 at (20, 16) 50211 DEFB 54,12,0,13,7,0 ; Draw chandelier (54) with attribute data index of 12, terrain interaction data index ; of 0 at (13, 7) 50217 DEFB 64,17,0,20,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (20, 8) 50223 DEFB 64,17,0,24,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (24, 8), and apply vertical mirror (1) 50229 DEFB 253,0,0,2,119,2,0 ; Draw line from (2, 119) to (2, 0) 50236 DEFB 253,0,0,5,119,5,0 ; Draw line from (5, 119) to (5, 0) 50243 DEFB 251,14,14,0,7,0 ; Draw wall at (0, 7) 50249 DEFB 0,71,94,92 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 92 ; Room Layout Data (01) - USS Pisces, 1 (The Bridge) b50253 DEFB 50,6,17,7,15,0 ; Draw Left Half of Planet (50) with attribute data index of 6, terrain interaction ; data index of 17 at (7, 15) 50259 DEFB 50,6,17,16,15,1 ; Draw Right Half of Planet (50) with attribute data index of 6, terrain interaction ; data index of 17 at (16, 15), and apply vertical mirror (1) 50265 DEFB 252,0,0,163,0,31 ; Draw a horizontal line at y = 163 pixels, from x = 0 characters to x = 31 ; characters 50271 DEFB 40,1,0,5,18,0 ; Draw Gordon (or Sarab) at Control Panel (40) with attribute data index of 1, ; terrain interaction data index of 0 at (5, 18) 50277 DEFB 40,1,0,16,18,1 ; Draw Sarab (or Gordon) at Control Panel (40) with attribute data index of 1, ; terrain interaction data index of 0 at (16, 18), and apply vertical mirror (1) 50283 DEFB 61,9,0,6,7,0 ; Draw Left Edge of Viewscreen (61) with attribute data index of 9, terrain ; interaction data index of 0 at (6, 7) 50289 DEFB 61,9,0,25,7,1 ; Draw Right Edge of Viewscreen (61) with attribute data index of 9, terrain ; interaction data index of 0 at (25, 7), and apply vertical mirror (1) 50295 DEFB 252,0,0,56,0,31 ; Draw a horizontal line at y = 56 pixels, from x = 0 characters to x = 31 characters 50301 DEFB 252,0,0,61,7,24 ; Draw a horizontal line at y = 61 pixels, from x = 7 characters to x = 24 characters 50307 DEFB 252,0,0,62,7,24 ; Draw a horizontal line at y = 62 pixels, from x = 7 characters to x = 24 characters 50313 DEFB 252,0,0,63,7,24 ; Draw a horizontal line at y = 63 pixels, from x = 7 characters to x = 24 characters 50319 DEFB 49,3,0,2,14,0 ; Draw Wall-Mounted Telephone (49) with attribute data index of 3, terrain ; interaction data index of 0 at (2, 14) 50325 DEFB 68,0,0,28,11,0 ; Draw Balls Picture (68) with attribute data index of 0, terrain interaction data ; index of 0 at (28, 11) 50331 DEFB 255,0,0,0,22,32,91 ; Start at (0, 22) and print run of 32 characters (char. code 91) (railings along ; floor) 50338 DEFB 254,0,0,5,21,91 ; Move to (5, 21) and print character code 91 50344 DEFB 254,0,0,7,21,91 ; Move to (7, 21) and print character code 91 50350 DEFB 254,0,0,24,21,91 ; Move to (24, 21) and print character code 91 50356 DEFB 254,0,0,26,21,91 ; Move to (26, 21) and print character code 91 50362 DEFB 251,23,0,0,7,0 ; Draw (invisible) wall at (0, 7) 50368 DEFB 0,70,94,92 ; Flood room with attribute 70 (yellow INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 92 ; Room Layout Data (02) - USS Pisces, 2 (The Transporter Room) b50372 DEFB 41,7,7,10,18,0 ; Draw left half of lower transporter pad (41) with attribute data index of 7, ; terrain interaction data index of 7 at (10, 18) 50378 DEFB 41,7,7,16,18,1 ; Draw right half of lower transporter pad (41) with attribute data index of 7, ; terrain interaction data index of 7 at (16, 18), and apply vertical mirror (1) 50384 DEFB 41,24,7,10,6,2 ; Draw left half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (10, 6), and apply horizontal mirror (2) 50390 DEFB 41,24,7,16,6,3 ; Draw right half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (16, 6), and apply horizontal and vertical ; mirrors (3) 50396 DEFB 255,0,0,10,22,12,92 ; Start at (10, 22) and print run of 12 characters (char. code 92) (base of ; transporter pad) 50403 DEFB 64,17,0,23,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (23, 8) 50409 DEFB 64,17,0,27,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, ; terrain interaction data index of 0 at (27, 8), and apply vertical mirror (1) 50415 DEFB 49,3,0,5,14,0 ; Draw Wall-Mounted Telephone (49) with attribute data index of 3, terrain ; interaction data index of 0 at (5, 14) 50421 DEFB 0,71,94,92 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 92 ; Room Layout Data (03) - USS Pisces, 3 (The Transputer Room) b50425 DEFB 56,18,0,6,10,0 ; Draw Left half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (6, 10) 50431 DEFB 56,18,0,9,10,1 ; Draw right half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (9, 10), and apply vertical mirror (1) 50437 DEFB 56,18,0,20,10,0 ; Draw left half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (20, 10) 50443 DEFB 56,18,0,23,10,1 ; Draw right half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (23, 10), and apply vertical mirror (1) 50449 DEFB 65,0,0,6,20,0 ; Draw left half of transputer panel base (65) with attribute data index of 0, terrain ; interaction data index of 0 at (6, 20) 50455 DEFB 65,0,0,9,20,1 ; Draw right half of transputer panel base (65) with attribute data index of 0, terrain ; interaction data index of 0 at (9, 20), and apply vertical mirror (1) 50461 DEFB 65,0,0,20,20,0 ; Draw left half of transputer panel base (65) with attribute data index of 0, terrain ; interaction data index of 0 at (20, 20) 50467 DEFB 65,0,0,23,20,1 ; Draw right half of transputer panel base (65) with attribute data index of 0, terrain ; interaction data index of 0 at (23, 20), and apply vertical mirror (1) 50473 DEFB 64,17,0,12,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (12, 8) 50479 DEFB 64,17,0,16,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (16, 8), and apply vertical mirror (1) 50485 DEFB 0,71,94,92 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 92 ; Room Layout Data (04) - USS Pisces, 4 (Cargo Hold) b50489 DEFB 57,8,16,1,15,0 ; Draw cargo container (57) with attribute data index of 8, terrain interaction data ; index of 16 at (1, 15) 50495 DEFB 57,8,16,11,15,0 ; Draw cargo container (57) with attribute data index of 8, terrain interaction data ; index of 16 at (11, 15) 50501 DEFB 53,4,0,22,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction data ; index of 0 at (22, 10) 50507 DEFB 53,4,0,24,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction data ; index of 0 at (24, 10) 50513 DEFB 53,4,0,26,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction data ; index of 0 at (26, 10) 50519 DEFB 64,17,0,12,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (12, 8) 50525 DEFB 64,17,0,16,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (16, 8), and apply vertical mirror (1) 50531 DEFB 0,71,86,92 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 86 (yellow INK, red PAPER, BRIGHT), and UDG 92 (bug) ; Room Layout Data (05) - USS Pisces, 5 (The Airlock) b50535 DEFB 64,17,0,23,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, ; terrain interaction data index of 0 at (23, 8) 50541 DEFB 64,17,0,27,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, ; terrain interaction data index of 0 at (27, 8), and apply vertical mirror (1) 50547 DEFB 66,16,0,10,16,0 ; Draw plant (66) with attribute data index of 16, terrain interaction data index ; of 0 at (10, 16) 50553 DEFB 67,0,0,12,21,0 ; Draw plant pot (67) with attribute data index of 0, terrain interaction data ; index of 0 at (12, 21) 50559 DEFB 55,5,5,16,19,0 ; Draw table (55) with attribute data index of 5, terrain interaction data index ; of 5 at (16, 19) 50565 DEFB 55,5,5,23,19,0 ; Draw table (55) with attribute data index of 5, terrain interaction data index ; of 5 at (23, 19) 50571 DEFB 55,5,5,19,15,0 ; Draw table (55) with attribute data index of 5, terrain interaction data index ; of 5 at (19, 15) 50577 DEFB 57,8,16,1,15,0 ; Draw cargo container (57) with attribute data index of 8, terrain interaction ; data index of 16 at (1, 15) 50583 DEFB 253,0,0,253,119,253,24 ; Draw line from (253, 119) to (253, 24) 50590 DEFB 253,0,0,250,119,250,24 ; Draw line from (250, 119) to (250, 24) 50597 DEFB 251,15,15,31,7,0 ; Draw wall at (0, 7) 50603 DEFB 0,71,94,92 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 92 ; Room Layout Data (06) - USS Pisces, 6 (The Life Boat) b50607 DEFB 63,22,0,6,12,0 ; Draw wall-mounted helmet (63) with attribute data index of 22, terrain interaction ; data index of 0 at (6, 12) 50613 DEFB 63,21,0,14,12,0 ; Draw wall-mounted helmet (63) with attribute data index of 21, terrain interaction ; data index of 0 at (14, 12) 50619 DEFB 63,19,0,22,12,0 ; Draw wall-mounted helmet (63) with attribute data index of 19, terrain interaction ; data index of 0 at (22, 12) 50625 DEFB 64,17,0,12,8,0 ; Draw left half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (12, 8) 50631 DEFB 64,17,0,16,8,1 ; Draw right half of USS Pisces picture (64) with attribute data index of 17, terrain ; interaction data index of 0 at (16, 8), and apply vertical mirror (1) 50637 DEFB 253,0,0,2,119,2,24 ; Draw line from (2, 119) to (2, 24) 50644 DEFB 253,0,0,5,119,5,24 ; Draw line from (5, 119) to (5, 24) 50651 DEFB 251,15,15,0,7,0 ; Draw wall at (0, 7) 50657 DEFB 251,14,14,31,7,0 ; Draw wall at (31, 7) 50663 DEFB 0,71,94,111 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 111 ; Room Layout Data (07) - Retreat, 0 (Murphy's Moon) b50667 DEFB 41,7,7,1,18,1 ; Draw left half of lower transporter pad (41) with attribute data index of 7, terrain ; interaction data index of 7 at (1, 18), and apply vertical mirror (1) 50673 DEFB 41,24,7,1,6,3 ; Draw left half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (1, 6), and apply horizontal and vertical ; mirrors (3) 50679 DEFB 255,0,0,1,22,6,92 ; Start at (1, 22) and print run of 6 characters (char. code 92) (base of transporter ; pad) 50686 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 50692 DEFB 44,0,0,10,7,1 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7), and apply vertical mirror (1) 50698 DEFB 47,0,0,13,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 7) 50704 DEFB 48,0,0,16,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 7), and apply vertical mirror (1) 50710 DEFB 47,0,0,19,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 7), and apply vertical mirror (1) 50716 DEFB 42,0,0,22,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (22, 7), and apply vertical mirror (1) 50722 DEFB 48,0,0,25,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (25, 7), and apply vertical mirror (1) 50728 DEFB 42,0,0,29,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 7) 50734 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 50740 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 50746 DEFB 51,29,0,27,11,0 ; Draw security camera (51) with attribute data index of 29, terrain interaction data ; index of 0 at (27, 11) 50752 DEFB 251,14,14,0,7,0 ; Draw wall at (0, 7) 50758 DEFB 0,68,96,100 ; Flood room with attribute 68 (green INK, black PAPER, BRIGHT), draw floor with ; attribute 96 (black INK, green PAPER, BRIGHT), and UDG 100 ; Room Layout Data (08) - Retreat, 1 b50762 DEFB 42,0,0,0,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7), and apply vertical mirror (1) 50768 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 50774 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 50780 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 50786 DEFB 45,0,0,10,7,1 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7), and apply vertical mirror (1) 50792 DEFB 44,0,0,12,7,1 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7), and apply vertical mirror (1) 50798 DEFB 45,0,0,15,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (15, 7) 50804 DEFB 47,0,0,17,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (17, 7), and apply vertical mirror (1) 50810 DEFB 48,0,0,20,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (20, 7) 50816 DEFB 48,0,0,24,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (24, 7), and apply vertical mirror (1) 50822 DEFB 46,0,0,28,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (28, 7) 50828 DEFB 47,0,0,29,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 7) 50834 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 50840 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 50846 DEFB 0,68,96,100 ; Flood room with attribute 68 (green INK, black PAPER, BRIGHT), draw floor with ; attribute 96 (black INK, green PAPER, BRIGHT), and UDG 100 ; Room Layout Data (09) - Retreat, 2 (With Barrier) b50850 DEFB 42,0,0,0,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7), and apply vertical mirror (1) 50856 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 50862 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 50868 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 50874 DEFB 45,0,0,10,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7) 50880 DEFB 46,0,0,12,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7) 50886 DEFB 47,0,0,13,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 7) 50892 DEFB 47,0,0,16,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 7), and apply vertical mirror (1) 50898 DEFB 48,0,0,19,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 7) 50904 DEFB 48,0,0,23,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (23, 7), and apply vertical mirror (1) 50910 DEFB 44,0,0,27,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (27, 7) 50916 DEFB 45,0,0,30,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (30, 7) 50922 DEFB 47,0,0,13,17,2 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 17), and apply horizontal mirror (2) 50928 DEFB 47,0,0,16,17,3 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 17), and apply horizontal and vertical mirrors (3) 50934 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 50940 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 50946 DEFB 251,13,13,15,7,0 ; Draw barrier at (15, 7) 50952 DEFB 0,68,96,100 ; Flood room with attribute 68 (green INK, black PAPER, BRIGHT), draw floor with ; attribute 96 (black INK, green PAPER, BRIGHT), and UDG 100 ; Room Layout Data (09A) - Retreat, 2 (Without Barrier) b50956 DEFB 42,0,0,0,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7), and apply vertical mirror (1) 50962 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 50968 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 50974 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 50980 DEFB 45,0,0,10,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7) 50986 DEFB 46,0,0,12,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7) 50992 DEFB 47,0,0,13,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 7) 50998 DEFB 47,0,0,16,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 7), and apply vertical mirror (1) 51004 DEFB 48,0,0,19,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 7) 51010 DEFB 48,0,0,23,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (23, 7), and apply vertical mirror (1) 51016 DEFB 44,0,0,27,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (27, 7) 51022 DEFB 45,0,0,30,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (30, 7) 51028 DEFB 47,0,0,13,17,2 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 17), and apply horizontal mirror (2) 51034 DEFB 47,0,0,16,17,3 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 17), and apply horizontal and vertical mirrors (3) 51040 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 51046 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 51052 DEFB 0,68,96,100 ; Flood room with attribute 68 (green INK, black PAPER, BRIGHT), draw floor with ; attribute 96 (black INK, green PAPER, BRIGHT), and UDG 100 ; Room Layout Data (10) - Retreat, 3 b51056 DEFB 42,0,0,0,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7), and apply vertical mirror (1) 51062 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 51068 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 51074 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 51080 DEFB 45,0,0,10,7,1 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7), and apply vertical mirror (1) 51086 DEFB 44,0,0,12,7,1 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7), and apply vertical mirror (1) 51092 DEFB 45,0,0,15,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (15, 7) 51098 DEFB 47,0,0,17,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (17, 7), and apply vertical mirror (1) 51104 DEFB 48,0,0,20,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (20, 7) 51110 DEFB 48,0,0,24,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (24, 7), and apply vertical mirror (1) 51116 DEFB 46,0,0,28,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (28, 7) 51122 DEFB 47,0,0,29,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 7) 51128 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 51134 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 51140 DEFB 251,31,14,31,7,0 ; Draw wall at (31, 7) 51146 DEFB 0,68,96,100 ; Flood room with attribute 68 (green INK, black PAPER, BRIGHT), draw floor with ; attribute 96 (black INK, green PAPER, BRIGHT), and UDG 100 ; Room Layout Data (11) - Starbase 1, 0 (The Transporter Room) b51150 DEFB 41,7,7,1,18,1 ; Draw left half of lower transporter pad (41) with attribute data index of 7, terrain ; interaction data index of 7 at (1, 18), and apply vertical mirror (1) 51156 DEFB 41,24,7,1,6,3 ; Draw left half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (1, 6), and apply horizontal and vertical ; mirrors (3) 51162 DEFB 255,0,0,1,22,6,92 ; Start at (1, 22) and print run of 6 characters (char. code 92) (base of transporter ; pad) 51169 DEFB 56,18,0,20,10,0 ; Draw left half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (20, 10) 51175 DEFB 56,18,0,23,10,1 ; Draw right half of transputer panel (56) with attribute data index of 18, terrain ; interaction data index of 0 at (23, 10), and apply vertical mirror (1) 51181 DEFB 65,0,0,20,20,0 ; Draw left half of transputer panel base (65) with attribute data index of 0, terrain ; interaction data index of 0 at (20, 20) 51187 DEFB 65,0,0,23,20,1 ; Draw right half of transputer panel base (65) with attribute data index of 0, ; terrain interaction data index of 0 at (23, 20), and apply vertical mirror (1) 51193 DEFB 251,14,14,0,7,0 ; Draw wall at (0, 7) 51199 DEFB 0,71,94,108 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 108 ; Room Layout Data (12) - Starbase 1, 1 (McTablet Takeaway Food) b51203 DEFB 75,26,0,2,14,0 ; Draw control panel (75) with attribute data index of 26, terrain interaction data ; index of 0 at (2, 14) 51209 DEFB 75,26,0,10,14,0 ; Draw control panel (75) with attribute data index of 26, terrain interaction data ; index of 0 at (10, 14) 51215 DEFB 75,26,0,18,14,0 ; Draw control panel (75) with attribute data index of 26, terrain interaction data ; index of 0 at (18, 14) 51221 DEFB 75,26,0,26,14,0 ; Draw control panel (75) with attribute data index of 26, terrain interaction data ; index of 0 at (26, 14) 51227 DEFB 84,0,0,6,10,0 ; Draw picture 1 (84) with attribute data index of 0, terrain interaction data index of ; 0 at (6, 10) 51233 DEFB 85,0,0,21,10,0 ; Draw picture 2 (85) with attribute data index of 0, terrain interaction data index of ; 0 at (21, 10) 51239 DEFB 0,71,94,108 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 108 ; Room Layout Data (13) - Starbase 1, 2 b51243 DEFB 55,5,5,11,19,0 ; Draw table (55) with attribute data index of 5, terrain interaction data index of 5 at ; (11, 19) 51249 DEFB 84,0,0,6,10,0 ; Draw picture 1 (84) with attribute data index of 0, terrain interaction data index of 0 ; at (6, 10) 51255 DEFB 85,0,0,21,10,0 ; Draw picture 2 (85) with attribute data index of 0, terrain interaction data index of 0 ; at (21, 10) 51261 DEFB 0,71,94,108 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 108 ; Room Layout Data (14) - Starbase 1, 3 b51265 DEFB 84,0,0,4,10,0 ; Draw picture 1 (84) with attribute data index of 0, terrain interaction data index of 0 ; at (4, 10) 51271 DEFB 85,0,0,23,10,0 ; Draw picture 2 (85) with attribute data index of 0, terrain interaction data index of 0 ; at (23, 10) 51277 DEFB 0,71,94,108 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 108 ; Room Layout Data (15) - Starbase 1, 4 (Fuel and Cargo Area) b51281 DEFB 57,8,16,1,15,0 ; Draw cargo container (57) with attribute data index of 8, terrain interaction data ; index of 16 at (1, 15) 51287 DEFB 82,33,0,12,17,0 ; Draw patterned column (82) with attribute data index of 33, terrain interaction data ; index of 0 at (12, 17) 51293 DEFB 82,33,0,18,17,1 ; Draw patterned column (82) with attribute data index of 33, terrain interaction data ; index of 0 at (18, 17), and apply vertical mirror (1) 51299 DEFB 57,8,16,21,15,0 ; Draw cargo container (57) with attribute data index of 8, terrain interaction data ; index of 16 at (21, 15) 51305 DEFB 251,14,14,31,7,0 ; Draw wall at (31, 7) 51311 DEFB 0,71,94,108 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 108 ; Room Layout Data (16) - Outpost, 0 (Ye Olde Transporter) b51315 DEFB 41,7,7,1,18,1 ; Draw left half of lower transporter pad (41) with attribute data index of 7, terrain ; interaction data index of 7 at (1, 18), and apply vertical mirror (1) 51321 DEFB 41,24,7,1,6,3 ; Draw left half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (1, 6), and apply horizontal and vertical ; mirrors (3) 51327 DEFB 255,0,0,1,22,6,92 ; Start at (1, 22) and print run of 6 characters (char. code 92) (base of transporter ; pad) 51334 DEFB 251,14,14,0,7,0 ; Draw wall at (0, 7) 51340 DEFB 88,34,0,13,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (13, 11) 51346 DEFB 88,34,0,16,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (16, 11), and apply vertical mirror (1) 51352 DEFB 88,34,0,29,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (29, 11) 51358 DEFB 0,71,94,109 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 109 ; Room Layout Data (17) - Outpost, 1 (The Main Defence System) b51362 DEFB 88,34,0,13,11,2 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (13, 11), and apply horizontal mirror (2) 51368 DEFB 88,34,0,16,11,3 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (16, 11), and apply horizontal and vertical ; mirrors (3) 51374 DEFB 88,34,0,0,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (0, 11), and apply vertical mirror (1) 51380 DEFB 88,34,0,29,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (29, 11) 51386 DEFB 87,0,0,7,19,0 ; Draw left half of reel-to-reel tape device (87) with attribute data index of 0, ; terrain interaction data index of 0 at (7, 19) 51392 DEFB 87,0,0,10,19,1 ; Draw right half of reel-to-reel tape device (87) with attribute data index of 0, ; terrain interaction data index of 0 at (10, 19), and apply vertical mirror (1) 51398 DEFB 87,0,0,13,19,0 ; Draw left half of reel-to-reel tape device (87) with attribute data index of 0, ; terrain interaction data index of 0 at (13, 19) 51404 DEFB 87,0,0,16,19,1 ; Draw right half of reel-to-reel tape device (87) with attribute data index of 0, ; terrain interaction data index of 0 at (16, 19), and apply vertical mirror (1) 51410 DEFB 0,71,94,109 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 109 ; Room Layout Data (18) - Outpost, 2 b51414 DEFB 88,34,0,13,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (13, 11) 51420 DEFB 88,34,0,16,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (16, 11), and apply vertical mirror (1) 51426 DEFB 88,34,0,0,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (0, 11), and apply vertical mirror (1) 51432 DEFB 88,34,0,29,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (29, 11) 51438 DEFB 0,71,94,109 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 109 ; Room Layout Data (19) - Outpost, 3 (The Proof of Power) b51442 DEFB 88,34,0,13,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (13, 11) 51448 DEFB 88,34,0,16,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (16, 11), and apply vertical mirror (1) 51454 DEFB 88,34,0,0,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (0, 11), and apply vertical mirror (1) 51460 DEFB 88,34,0,29,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (29, 11) 51466 DEFB 89,35,18,1,20,2 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 18 at (1, 20), and apply horizontal mirror (2) 51472 DEFB 89,35,18,7,20,2 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 18 at (7, 20), and apply horizontal mirror (2) 51478 DEFB 89,35,18,13,20,2 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 18 at (13, 20), and apply horizontal mirror (2) 51484 DEFB 89,35,18,19,20,2 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 18 at (19, 20), and apply horizontal mirror (2) 51490 DEFB 89,35,18,25,20,2 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 18 at (25, 20), and apply horizontal mirror (2) 51496 DEFB 0,71,94,109 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 109 ; Room Layout Data (20) - Outpost, 4 (The Tyme Guardians) b51500 DEFB 88,34,0,13,11,0 ; Draw left half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (13, 11) 51506 DEFB 88,34,0,16,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (16, 11), and apply vertical mirror (1) 51512 DEFB 88,34,0,0,11,1 ; Draw right half of Tyme Guardians' Symbol 1 (88) with attribute data index of 34, ; terrain interaction data index of 0 at (0, 11), and apply vertical mirror (1) 51518 DEFB 251,14,14,31,7,0 ; Draw wall at (31, 7) 51524 DEFB 73,0,0,6,18,0 ; Draw Tyme Guardian (73) with attribute data index of 0, terrain interaction data ; index of 0 at (6, 18) 51530 DEFB 73,0,0,11,18,0 ; Draw Tyme Guardian (73) with attribute data index of 0, terrain interaction data ; index of 0 at (11, 18) 51536 DEFB 73,0,0,16,18,0 ; Draw Tyme Guardian (73) with attribute data index of 0, terrain interaction data ; index of 0 at (16, 18) 51542 DEFB 73,0,0,21,18,0 ; Draw Tyme Guardian (73) with attribute data index of 0, terrain interaction data ; index of 0 at (21, 18) 51548 DEFB 73,0,0,26,18,0 ; Draw Tyme Guardian (73) with attribute data index of 0, terrain interaction data ; index of 0 at (26, 18) 51554 DEFB 0,71,94,109 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 109 ; Room Layout Data (21) - Monopole, 0 (Hooper's Emergency Exit) b51558 DEFB 41,7,7,1,18,1 ; Draw left half of lower transporter pad (41) with attribute data index of 7, terrain ; interaction data index of 7 at (1, 18), and apply vertical mirror (1) 51564 DEFB 41,24,7,1,6,3 ; Draw left half of upper transporter pad (41) with attribute data index of 24, ; terrain interaction data index of 7 at (1, 6), and apply horizontal and vertical ; mirrors (3) 51570 DEFB 255,0,0,1,22,6,92 ; Start at (1, 22) and print run of 6 characters (char. code 92) (base of transporter ; pad) 51577 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 51583 DEFB 44,0,0,10,7,1 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7), and apply vertical mirror (1) 51589 DEFB 47,0,0,13,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 7) 51595 DEFB 48,0,0,16,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 7), and apply vertical mirror (1) 51601 DEFB 47,0,0,19,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 7), and apply vertical mirror (1) 51607 DEFB 42,0,0,22,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (22, 7), and apply vertical mirror (1) 51613 DEFB 48,0,0,25,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (25, 7), and apply vertical mirror (1) 51619 DEFB 42,0,0,29,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 7) 51625 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 51631 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 51637 DEFB 51,29,0,27,11,0 ; Draw security camera (51) with attribute data index of 29, terrain interaction data ; index of 0 at (27, 11) 51643 DEFB 251,14,14,0,7,0 ; Draw wall at (0, 7) 51649 DEFB 0,71,120,100 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 120 (black INK, white PAPER, BRIGHT), and UDG 100 ; Room Layout Data (22) - Monopole, 1 (This Way to Hooper ==>>) b51653 DEFB 42,0,0,0,7,1 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7), and apply vertical mirror (1) 51659 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 51665 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 51671 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 51677 DEFB 45,0,0,10,7,1 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7), and apply vertical mirror (1) 51683 DEFB 44,0,0,12,7,1 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7), and apply vertical mirror (1) 51689 DEFB 45,0,0,15,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (15, 7) 51695 DEFB 47,0,0,17,7,1 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (17, 7), and apply vertical mirror (1) 51701 DEFB 48,0,0,20,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (20, 7) 51707 DEFB 48,0,0,24,7,1 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (24, 7), and apply vertical mirror (1) 51713 DEFB 46,0,0,28,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (28, 7) 51719 DEFB 47,0,0,29,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 7) 51725 DEFB 44,0,0,0,18,2 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 18), and apply horizontal mirror (2) 51731 DEFB 46,0,0,3,19,2 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (3, 19), and apply horizontal mirror (2) 51737 DEFB 44,0,0,4,18,2 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (4, 18), and apply horizontal mirror (2) 51743 DEFB 44,0,0,7,18,2 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 18), and apply horizontal mirror (2) 51749 DEFB 42,0,0,10,17,2 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 17), and apply horizontal mirror (2) 51755 DEFB 47,0,0,13,17,3 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 17), and apply horizontal and vertical mirrors (3) 51761 DEFB 47,0,0,16,17,2 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 17), and apply horizontal mirror (2) 51767 DEFB 47,0,0,19,17,3 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 17), and apply horizontal and vertical mirrors (3) 51773 DEFB 48,0,0,22,18,2 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (22, 18), and apply horizontal mirror (2) 51779 DEFB 45,0,0,26,20,2 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (26, 20), and apply horizontal mirror (2) 51785 DEFB 46,0,0,28,19,2 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (28, 19), and apply horizontal mirror (2) 51791 DEFB 43,0,0,29,19,2 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (29, 19), and apply horizontal mirror (2) 51797 DEFB 46,0,0,31,19,2 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (31, 19), and apply horizontal mirror (2) 51803 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 51809 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 51815 DEFB 0,71,120,100 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 120 (black INK, white PAPER, BRIGHT), and UDG 100 ; Room Layout Data (23) - Monopole, 2 (Here is Hooper) b51819 DEFB 44,0,0,0,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (0, 7) 51825 DEFB 42,0,0,2,7,0 ; Draw cavern ceiling part 1 (42) with attribute data index of 0, terrain interaction ; data index of 0 at (2, 7) 51831 DEFB 43,0,0,5,7,0 ; Draw cavern ceiling part 2 (43) with attribute data index of 0, terrain interaction ; data index of 0 at (5, 7) 51837 DEFB 44,0,0,7,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (7, 7) 51843 DEFB 45,0,0,10,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (10, 7) 51849 DEFB 46,0,0,12,7,0 ; Draw cavern ceiling part 5 (46) with attribute data index of 0, terrain interaction ; data index of 0 at (12, 7) 51855 DEFB 47,0,0,13,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (13, 7) 51861 DEFB 47,0,0,16,7,0 ; Draw cavern ceiling part 6 (47) with attribute data index of 0, terrain interaction ; data index of 0 at (16, 7) 51867 DEFB 48,0,0,19,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (19, 7) 51873 DEFB 48,0,0,23,7,0 ; Draw cavern ceiling part 7 (48) with attribute data index of 0, terrain interaction ; data index of 0 at (23, 7) 51879 DEFB 44,0,0,27,7,0 ; Draw cavern ceiling part 3 (44) with attribute data index of 0, terrain interaction ; data index of 0 at (27, 7) 51885 DEFB 45,0,0,30,7,0 ; Draw cavern ceiling part 4 (45) with attribute data index of 0, terrain interaction ; data index of 0 at (30, 7) 51891 DEFB 60,11,0,8,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (8, 13) 51897 DEFB 60,11,0,23,13,0 ; Draw wall-mounted plaque (60) with attribute data index of 11, terrain interaction ; data index of 0 at (23, 13) 51903 DEFB 59,27,0,20,16,0 ; Draw Hooper (59) with attribute data index of 27, terrain interaction data index of 0 ; at (20, 16) 51909 DEFB 251,30,14,31,7,0 ; Draw wall at (31, 7) 51915 DEFB 0,71,120,100 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 120 (black INK, white PAPER, BRIGHT), and UDG 100 ; Room Layout Data (24) - USS Pisces, 6A (The Control Column) b51919 DEFB 89,35,0,13,11,0 ; Draw Tyme Guardians' Symbol 2 (89) with attribute data index of 35, terrain ; interaction data index of 0 at (13, 11) 51925 DEFB 67,0,0,8,15,0 ; Draw Tyme Machine Control Column block (67) with attribute data index of 0, terrain ; interaction data index of 0 at (8, 15) 51931 DEFB 67,0,0,8,17,0 ; Draw Tyme Machine Control Column block (67) with attribute data index of 0, terrain ; interaction data index of 0 at (8, 17) 51937 DEFB 67,0,0,8,19,0 ; Draw Tyme Machine Control Column block (67) with attribute data index of 0, terrain ; interaction data index of 0 at (8, 19) 51943 DEFB 67,0,0,8,21,0 ; Draw Tyme Machine Control Column block (67) with attribute data index of 0, terrain ; interaction data index of 0 at (8, 21) 51949 DEFB 53,4,0,22,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction ; data index of 0 at (22, 10) 51955 DEFB 53,4,0,24,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction ; data index of 0 at (24, 10) 51961 DEFB 53,4,0,26,10,0 ; Draw wall-mounted rifle (53) with attribute data index of 4, terrain interaction ; data index of 0 at (26, 10) 51967 DEFB 253,0,0,2,119,2,24 ; Draw line from (2, 119) to (2, 24) 51974 DEFB 253,0,0,5,119,5,24 ; Draw line from (5, 119) to (5, 24) 51981 DEFB 251,15,15,0,7,0 ; Draw wall at (0, 7) 51987 DEFB 251,14,14,31,7,0 ; Draw wall at (31, 7) 51993 DEFB 0,71,94,110 ; Flood room with attribute 71 (white INK, black PAPER, BRIGHT), draw floor with ; attribute 94 (yellow INK, magenta PAPER, BRIGHT), and UDG 110 ; Lookup Table for RLE Attribute Data (Room Layout Graphics) ; ; Each entry is comprised of four bytes: b51997 DEFB 1,1,173,203 ; (00) - #R52141 - No colouring 52001 DEFB 11,15,174,203 ; (01) - #R52142 - Gordon / Sarab at Helm 52005 DEFB 5,7,199,203 ; (02) - #R52167 - Large Chair 52009 DEFB 2,4,216,203 ; (03) - #R52184 - Wall-Mounted Telephone 52013 DEFB 2,9,219,203 ; (04) - #R52187 - Wall-Mounted Rifle 52017 DEFB 7,4,224,203 ; (05) - #R52192 - Table 52021 DEFB 9,3,227,203 ; (06) - #R52195 - Half of Planet 52025 DEFB 6,5,230,203 ; (07) - #R52198 - Lower Part of Transporter Pad 52029 DEFB 9,4,237,203 ; (08) - #R52205 - Cargo Container 52033 DEFB 1,11,244,203 ; (09) - #R52212 - Left / Right Edge of Viewscreen 52037 DEFB 32,1,253,203 ; (10) - #R52221 - Unused 52041 DEFB 2,2,0,204 ; (11) - #R52224 - Wall-Mounted Plaque 52045 DEFB 3,7,5,204 ; (12) - #R52229 - Chandelier 52049 DEFB 2,16,30,204 ; (13) - #R52254 - Barrier 52053 DEFB 1,15,37,204 ; (14) - #R52261 - Wall (1, full-length) 52057 DEFB 1,11,37,204 ; (15) - #R52261 - Wall (2, short) 52061 DEFB 6,5,40,204 ; (16) - #R52264 - Plant 52065 DEFB 4,4,43,204 ; (17) - #R52267 - Half of USS Pisces Picture 52069 DEFB 3,10,54,204 ; (18) - #R52278 - Half of Transputer Panel 52073 DEFB 4,5,83,204 ; (19) - #R52307 - Wall-Mounted Helmet (1) 52077 DEFB 4,5,86,204 ; (20) - #R52310 - Unused 52081 DEFB 4,5,89,204 ; (21) - #R52313 - Wall-Mounted Helmet (2) 52085 DEFB 4,5,92,204 ; (22) - #R52316 - Wall-Mounted Helmet (3) 52089 DEFB 32,1,95,204 ; (23) - #R52319 - Wall (3) (invisible, used to paint upper part of The Bridge) 52093 DEFB 6,4,98,204 ; (24) - #R52322 - Upper Part of Transporter Pad 52097 DEFB 0,0,0,0 ; (25) - Unused 52101 DEFB 4,5,105,204 ; (26) - #R52329 - Control Panel 52105 DEFB 6,7,116,204 ; (27) - #R52340 - Hooper 52109 DEFB 0,0,0,0 ; (28) - Unused 52113 DEFB 5,3,143,204 ; (29) - #R52367 - Security Camera 52117 DEFB 1,15,146,204 ; (30) - #R52370 - Wall (4, full-length) 52121 DEFB 1,15,149,204 ; (31) - #R52373 - Wall (5, full-length) 52125 DEFB 0,0,0,0 ; (32) - Unused 52129 DEFB 3,6,152,204 ; (33) - #R52376 - Patterned Column 52133 DEFB 3,5,155,204 ; (34) - #R52379 - Half of Tyme Guardians' Symbol (1) 52137 DEFB 6,3,166,204 ; (35) - #R52390 - Half of Tyme Guardians' Symbol (2) ; RLE Attribute Data (Room Layout Graphics) ; ; Run Length Encoded data used to paint attributes, with two bytes per entry (or a one-byte end marker represented ; by a zero). Records are comprised of: (00) - No colouring b52141 DEFB 0 ; End Marker ; (01) - Gordon / Sarab at Helm 52142 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52144 DEFB 10,69 ; 10 x 69 (cyan INK, black PAPER, BRIGHT) 52146 DEFB 4,70 ; 4 x 70 (yellow INK, black PAPER, BRIGHT) 52148 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 52150 DEFB 2,69 ; 2 x 69 (cyan INK, black PAPER, BRIGHT) 52152 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 52154 DEFB 6,70 ; 6 x 70 (yellow INK, black PAPER, BRIGHT) 52156 DEFB 4,71 ; 4 x 71 (white INK, black PAPER, BRIGHT) 52158 DEFB 3,78 ; 3 x 78 (yellow INK, blue PAPER, BRIGHT) 52160 DEFB 4,70 ; 4 x 70 (yellow INK, black PAPER, BRIGHT) 52162 DEFB 4,68 ; 4 x 68 (green INK, black PAPER, BRIGHT) 52164 DEFB 3,70 ; 3 x 70 (yellow INK, black PAPER, BRIGHT) 52166 DEFB 0 ; End Marker ; (02) - Large Chair 52167 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 52169 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 52171 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 52173 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 52175 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 52177 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 52179 DEFB 10,68 ; 10 x 68 (green INK, black PAPER, BRIGHT) 52181 DEFB 10,70 ; 10 x 70 (yellow INK, black PAPER, BRIGHT) 52183 DEFB 0 ; End Marker ; (03) - Wall-Mounted Telephone 52184 DEFB 8,66 ; 8 x 66 (red INK, black PAPER, BRIGHT) 52186 DEFB 0 ; End Marker ; (04) - Wall-Mounted Rifle 52187 DEFB 8,69 ; 8 x 69 (cyan INK, black PAPER, BRIGHT) 52189 DEFB 10,70 ; 10 x 70 (yellow INK, black PAPER, BRIGHT) 52191 DEFB 0 ; End Marker ; (05) - Table 52192 DEFB 7,66 ; 7 x 66 (red INK, black PAPER, BRIGHT) 52194 DEFB 0 ; End Marker ; (06) - Half of Planet 52195 DEFB 27,68 ; 27 x 68 (green INK, black PAPER, BRIGHT) 52197 DEFB 0 ; End Marker ; (07) - Half of Transporter Pad 52198 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 52200 DEFB 5,7 ; 5 x 7 (white INK, black PAPER) 52202 DEFB 24,70 ; 24 x 70 (yellow INK, black PAPER, BRIGHT) 52204 DEFB 0 ; End Marker ; (08) - Cargo Container 52205 DEFB 36,69 ; 36 x 69 (cyan INK, black PAPER, BRIGHT) 52207 DEFB 9,70 ; 9 x 70 (yellow INK, black PAPER, BRIGHT) 52209 DEFB 27,69 ; 27 x 69 (cyan INK, black PAPER, BRIGHT) 52211 DEFB 0 ; End Marker ; (09) - Left / Right Edge of Viewscreen 52212 DEFB 5,69 ; 5 x 69 (cyan INK, black PAPER, BRIGHT) 52214 DEFB 1,101 ; 1 x 101 (cyan INK, green PAPER, BRIGHT) 52216 DEFB 1,93 ; 1 x 93 (cyan INK, magenta PAPER, BRIGHT) 52218 DEFB 4,69 ; 4 x 69 (cyan INK, black PAPER, BRIGHT) 52220 DEFB 0 ; End Marker ; (10) - Unused 52221 DEFB 32,69 ; 32 x 69 (cyan INK, black PAPER, BRIGHT) 52223 DEFB 0 ; End Marker ; (11) - Wall-Mounted Plaque 52224 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 52226 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 52228 DEFB 0 ; End Marker ; (12) - Chandelier 52229 DEFB 4,69 ; 4 x 69 (cyan INK, black PAPER, BRIGHT) 52231 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52233 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52235 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52237 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52239 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52241 DEFB 4,69 ; 4 x 69 (cyan INK, black PAPER, BRIGHT) 52243 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52245 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52247 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52249 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52251 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52253 DEFB 0 ; End Marker ; (13) - Barrier 52254 DEFB 6,124 ; 6 x 124 (green INK, white PAPER, BRIGHT) 52256 DEFB 20,120 ; 20 x 120 (black INK, white PAPER, BRIGHT) 52258 DEFB 6,124 ; 6 x 124 (green INK, white PAPER, BRIGHT) 52260 DEFB 0 ; End Marker ; (14 / 15) - Wall (1, full-length / 2, short) 52261 DEFB 17,112 ; 17 x 112 (black INK, yellow PAPER, BRIGHT) 52263 DEFB 0 ; End Marker ; (16) - Plant 52264 DEFB 30,68 ; 30 x 68 (green INK, black PAPER, BRIGHT) 52266 DEFB 0 ; End Marker ; (17) - USS Pisces Picture 52267 DEFB 5,67 ; 5 x 67 (magenta INK, black PAPER, BRIGHT) 52269 DEFB 3,68 ; 3 x 68 (green INK, black PAPER, BRIGHT) 52271 DEFB 1,67 ; 1 x 67 (magenta INK, black PAPER, BRIGHT) 52273 DEFB 3,68 ; 3 x 68 (green INK, black PAPER, BRIGHT) 52275 DEFB 4,67 ; 4 x 67 (magenta INK, black PAPER, BRIGHT) 52277 DEFB 0 ; End Marker ; (18) - Transputer Panel 52278 DEFB 4,70 ; 4 x 70 (yellow INK, black PAPER, BRIGHT) 52280 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 52282 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52284 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 52286 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52288 DEFB 2,67 ; 2 x 67 (magenta INK, black PAPER, BRIGHT) 52290 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52292 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 52294 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52296 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 52298 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52300 DEFB 2,7 ; 2 x 7 (white INK, black PAPER) 52302 DEFB 3,70 ; 3 x 70 (yellow INK, black PAPER, BRIGHT) 52304 DEFB 6,69 ; 6 x 69 (cyan INK, black PAPER, BRIGHT) 52306 DEFB 0 ; End Marker ; (19) - Wall-Mounted Helmet (1) 52307 DEFB 20,71 ; 20 x 71 (white INK, black PAPER, BRIGHT) 52309 DEFB 0 ; End Marker ; (20) - Unused 52310 DEFB 20,70 ; 20 x 70 (yellow INK, black PAPER, BRIGHT) 52312 DEFB 0 ; End Marker ; (21) - Wall-Mounted Helmet (2) 52313 DEFB 20,69 ; 20 x 69 (cyan INK, black PAPER, BRIGHT) 52315 DEFB 0 ; End Marker ; (22) - Wall-Mounted Helmet (3) 52316 DEFB 20,68 ; 20 x 68 (green INK, black PAPER, BRIGHT) 52318 DEFB 0 ; End Marker ; (23) - Wall (3) (invisible, used to paint upper part of The Bridge) 52319 DEFB 32,69 ; 32 x 69 (cyan INK, black PAPER, BRIGHT) 52321 DEFB 0 ; End Marker ; (24) - Half of Transporter Pad 52322 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 52324 DEFB 5,7 ; 5 x 7 (white INK, black PAPER) 52326 DEFB 18,70 ; 18 x 70 (yellow INK, black PAPER, BRIGHT) 52328 DEFB 0 ; End Marker ; (26) - Control Panel 52329 DEFB 4,68 ; 4 x 68 (green INK, black PAPER, BRIGHT) 52331 DEFB 9,70 ; 9 x 70 (yellow INK, black PAPER, BRIGHT) 52333 DEFB 2,101 ; 2 x 101 (cyan INK, green PAPER, BRIGHT) 52335 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52337 DEFB 4,77 ; 4 x 77 (cyan INK, blue PAPER, BRIGHT) 52339 DEFB 0 ; End Marker ; (27) - Hooper 52340 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 52342 DEFB 3,70 ; 3 x 70 (yellow INK, black PAPER, BRIGHT) 52344 DEFB 1,68 ; 1 x 68 (green INK, black PAPER, BRIGHT) 52346 DEFB 5,71 ; 5 x 71 (white INK, black PAPER, BRIGHT) 52348 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52350 DEFB 5,71 ; 5 x 71 (white INK, black PAPER, BRIGHT) 52352 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 52354 DEFB 2,7 ; 2 x 7 (white INK, black PAPER) 52356 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 52358 DEFB 2,67 ; 2 x 67 (magenta INK, black PAPER, BRIGHT) 52360 DEFB 7,70 ; 7 x 70 (yellow INK, black PAPER, BRIGHT) 52362 DEFB 6,69 ; 6 x 69 (cyan INK, black PAPER, BRIGHT) 52364 DEFB 6,71 ; 6 x 71 (white INK, black PAPER, BRIGHT) 52366 DEFB 0 ; End Marker ; (29) - Security Camera 52367 DEFB 15,71 ; 15 x 71 (white INK, black PAPER, BRIGHT) 52369 DEFB 0 ; End Marker ; (30) - Wall (4, full-length) 52370 DEFB 17,127 ; 17 x 127 (white INK, white PAPER, BRIGHT) 52372 DEFB 0 ; End Marker ; (31) - Wall (5, full-length) 52373 DEFB 17,100 ; 17 x 100 (green INK, green PAPER, BRIGHT) 52375 DEFB 0 ; End Marker ; (33) - Patterned Column 52376 DEFB 18,66 ; 18 x 66 (red INK, black PAPER, BRIGHT) 52378 DEFB 0 ; End Marker ; (34) - Tyme Guardians' Symbol (1) 52379 DEFB 8,2 ; 8 x 2 (red INK, black PAPER) 52381 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52383 DEFB 2,2 ; 2 x 2 (red INK, black PAPER) 52385 DEFB 1,69 ; 1 x 69 (cyan INK, black PAPER, BRIGHT) 52387 DEFB 3,2 ; 3 x 2 (red INK, black PAPER) 52389 DEFB 0 ; End Marker ; (35) - Tyme Guardians' Symbol (2) 52390 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 52392 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 52394 DEFB 14,68 ; 14 x 68 (green INK, black PAPER, BRIGHT) 52396 DEFB 0 ; End Marker ; Lookup Table for RLE Terrain Interaction Parameter Data (Room Layout Graphics) ; ; Each entry is comprised of four bytes: b52397 DEFB 1,1,173,203 ; (00) - #R52141 - No interaction 52401 DEFB 11,15,174,203 ; (01) - #R52142 - Unused 52405 DEFB 5,7,249,204 ; (02) - #R52473 - Large Chair 52409 DEFB 2,4,216,203 ; (03) - #R52184 - Unused 52413 DEFB 2,9,219,203 ; (04) - #R52187 - Unused 52417 DEFB 7,4,6,205 ; (05) - #R52486 - Table 52421 DEFB 9,3,227,203 ; (06) - #R52195 - Unused 52425 DEFB 6,4,9,205 ; (07) - #R52489 - Half of Transporter Pad (Upper or Lower) 52429 DEFB 9,4,237,203 ; (08) - #R52205 - Unused 52433 DEFB 1,11,244,203 ; (09) - #R52212 - Unused 52437 DEFB 32,1,253,203 ; (10) - #R52221 - Unused 52441 DEFB 2,2,0,204 ; (11) - #R52224 - Unused 52445 DEFB 3,7,5,204 ; (12) - #R52229 - Unused 52449 DEFB 2,16,14,205 ; (13) - #R52494 - Barrier 52453 DEFB 1,15,17,205 ; (14) - #R52497 - Wall (1, full-length) 52457 DEFB 1,11,17,205 ; (15) - #R52497 - Wall (2, short) 52461 DEFB 9,4,20,205 ; (16) - #R52500 - Cargo Container 52465 DEFB 9,3,25,205 ; (17) - #R52505 - Half of Planet 52469 DEFB 6,1,28,205 ; (18) - #R52508 - Tyme Guardians' Symbol (2) ; RLE Terrain Interaction Parameter Data (Room Layout Graphics) ; ; Run Length Encoded data used to paint terrain interaction parameters, with two bytes per entry (or a one-byte end ; marker represented by a zero). Records are comprised of: (02) - Large Chair b52473 DEFB 9,0 ; 9 x 0 (no interaction) 52475 DEFB 1,255 ; 1 x 255 (impassable horizontally, upwards and downwards / preserve attribute) 52477 DEFB 3,0 ; 3 x 0 (no interaction) 52479 DEFB 2,255 ; 2 x 255 (impassable horizontally, upwards and downwards / preserve attribute) 52481 DEFB 5,0 ; 5 x 0 (no interaction) 52483 DEFB 5,128 ; 5 x 128 (impassable downwards) 52485 DEFB 0 ; End Marker ; (05) - Table 52486 DEFB 7,128 ; 7 x 128 (impassable downwards) 52488 DEFB 0 ; End Marker ; (07) - Transporter Pad 52489 DEFB 7,0 ; 7 x 0 (no interaction) 52491 DEFB 5,128 ; 5 x 128 (impassable downwards) 52493 DEFB 0 ; End Marker ; (13) - Barrier 52494 DEFB 32,96 ; 32 x 96 (impassable horizontally / preserve attribute) 52496 DEFB 0 ; End Marker ; (14 / 15) - Wall (1, full-length) / Wall (2, short) 52497 DEFB 17,96 ; 17 x 96 (impassable horizontally / preserve attribute) 52499 DEFB 0 ; End Marker ; (16) - Cargo Container 52500 DEFB 3,0 ; 3 x 0 (no interaction) 52502 DEFB 3,128 ; 3 x 128 (impassable downwards) 52504 DEFB 0 ; End Marker ; (17) - Half of Planet 52505 DEFB 27,127 ; 27 x 127 (impassable horizontally and upwards / preserve attribute) 52507 DEFB 0 ; End Marker ; (18) - Tyme Guardians' Symbol (2) 52508 DEFB 12,0 ; 12 x 0 (no interaction) 52510 DEFB 6,128 ; 6 x 128 (impassable downwards) 52512 DEFB 0 ; End Marker ; Room Drawing Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode off and Draw a Graphic ; ; Used by the routine at #R28631. c52513 XOR A ; Load #R52672 with opcode for "NOP"... 52514 LD (52672),A ; ... 52517 LD H,A ; Load #R52672 and #R52672 with opcode for "NOP" 52518 LD L,A ; ... 52519 LD (52673),HL ; ... 52522 LD (23450),A ; Reset both Horizontal and Vertical Mirror Flags 52525 LD (23449),A ; Set Pixel Row Counter to zero 52528 LD BC,(23493) ; Load BC with x- and y-coordinates of graphic to draw 52532 JP 52635 ; Jump to #R52635 (draw the graphic then return) ; Room Drawing Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode off and Draw a Graphic ; ; Used by the routine at #R28631. c52535 LD A,205 ; Load #R52672 with opcode for "CALL"... 52537 LD (52672),A ; ... 52540 LD HL,52924 ; Load #R52672 (i.e. operand of instruction at #R52672) with address of start of "Reverse the ; order of the bits in A" routine... 52543 LD (52673),HL ; ... 52546 XOR A ; Set Pixel Row Counter to zero... 52547 LD (23449),A ; ... 52550 INC A ; Set Apply Vertical Mirror Flag and reset Apply Horizontal Mirror Flag... 52551 LD (23450),A ; ... 52554 LD A,(23494) ; Load B with y-coordinate of graphic to draw... 52557 LD B,A ; ... 52558 LD A,(23495) ; Load C with x-coordinate of graphic to draw... 52561 DEC A ; ...and decrease by one... 52562 LD C,A ; ... 52563 JP 52635 ; Jump to #R52635 (draw the graphic then return) ; Room Drawing Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode on and Draw a Graphic ; ; Used by the routine at #R28631. c52566 XOR A ; Load #R52672 with opcode for "NOP"... 52567 LD (52672),A ; ... 52570 LD H,A ; Load #R52672 and #R52672 with opcode for "NOP" 52571 LD L,A ; ... 52572 LD (52673),HL ; ... 52575 LD A,2 ; Reset Apply Vertical Mirror Flag and set Apply Horizontal Mirror Flag... 52577 LD (23450),A ; ... 52580 LD A,7 ; Set Pixel Row Counter to 7... 52582 LD (23449),A ; ... 52585 LD A,(23493) ; Load C with x-coordinate of left edge of current graphic to draw... 52588 LD C,A ; ... 52589 LD A,(23496) ; Load B with y-coordinate + 1 for current graphic... 52592 LD B,A ; ... 52593 JP 52622 ; Jump to #R52622 (set coordinates, draw the graphic then return) ; Room Drawing Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode on and Draw a Graphic ; ; Used by the routine at #R28631. c52596 LD A,205 ; Load #R52672 with opcode for "CALL"... 52598 LD (52672),A ; ... 52601 LD HL,52924 ; Load #R52672 (i.e. operand of instruction at #R52672) with address of start of "Reverse the ; order of the bits in A" routine... 52604 LD (52673),HL ; ... 52607 LD A,7 ; Set Pixel Row Counter to 7... 52609 LD (23449),A ; ... 52612 LD A,3 ; Set both Horizontal and Vertical Mirror Flags... 52614 LD (23450),A ; ... 52617 LD BC,(23495) ; Load BC with coordinates (each +1) of bottom-right of graphic to draw 52621 DEC C ; Decrease x-coordinate by one ; This entry point is used by the routine at #R52566. *52622 LD (23444),BC ; Store coordinates at which to draw graphic at #R23444 52626 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 52629 LD A,7 ; Advance HL down to bottom pixel row in its current character block (as we are drawing up from ; the bottom)... 52631 ADD A,H ; ... 52632 LD H,A ; ... 52633 JR 52642 ; Jump to #R52642 (draw the graphic then return) ; Room Drawing Draw a Graphic ; ; Used by the routines at #R52513 and #R52535. Input: BC x- and y-coordinates HL (Entry at #R52642 only) Address ; in Display File to start drawing c52635 LD (23444),BC ; Store x- and y-coordinates of character block currently being drawn at #R23444 52639 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL ; This entry point is used by the routine at #R52596. *52642 PUSH HL ; Store HL (address in Display File to print character) 52643 LD HL,52717 ; Load HL with 52717 (address of "Advance HL to next Display File Address to be drawn to (Apply ; Horizontal Mirror Flag reset)" routine) 52646 LD A,(23450) ; Load A with Apply Horizontal and Apply Vertical Mirror Flags 52649 AND 2 ; If Apply Horizontal Mirror Flag is reset... 52651 JR Z,52656 ; ...then skip ahead to #R52656 52653 LD HL,52820 ; Load HL with 52820 (address of "Advance HL to next Display File Address to be drawn to (Apply ; Horizontal Mirror Flag set)" routine) *52656 LD (52715),HL ; Change destination for JP instruction at #R52714 to value in HL... 52659 POP HL ; Restore HL (address in Display File to print character) 52660 LD DE,(23447) ; Load DE with graphic data address ; This entry point is used by the routine at #R52689. *52664 LD A,(DE) ; Load A with a byte of graphic data 52665 OR A ; If data is zero... 52666 JR Z,52689 ; ...then read repeat counter value, x, and draw x rows of reset pixels 52668 CP 255 ; If data is 255... 52670 JR Z,52710 ; ...then read repeat counter value, x, and draw x rows of set pixels ; The three-byte instruction at #R52672 is modified by the instructions at #R52514, #R52537, #R52567 and #R52598. ; Initially it is as shown below, however upon modification it can take the following forms: ; #TABLE(default,centre,:w) ; { =h Instruction | =h Mirror Options | =h Effect } ; { #R52514 | None | NOP / NOP / NOP (do nothing) } ; { #R52537 | Apply Vertical | CALL #R52924 (Reverse the order of the bits in A) } ; { #R52567 | Apply Horizontal | NOP / NOP / NOP (do nothing) } ; { #R52598 | Both | CALL #R52924 (Reverse the order of the bits in A) } ; TABLE# 52672 CALL 52924 ; Reverse the order of the bits in A [This instruction is modified by the instructions at ; #R52514, #R52537, #R52567 and #R52598] 52675 CALL 52686 ; Load byte of graphic data in A into Display File address in HL 52678 INC DE ; Advance DE to next byte of graphic data 52679 CALL 52714 ; Advance HL to next location in Display File (up or down one pixel)... 52682 JP Z,52664 ; ...and if this new location is not outside dimensions of the graphic then loop back to ; #R52664 ; This entry point is used by the routine at #R52689. *52685 RET ; Return ; Load Contents of A into Memory Location Pointed to by HL ; ; Used by the routines at #R52635 and #R52689. Input: A A byte of (e.g. graphic) data HL An address (e.g. in ; Display File) c52686 NOP ; Do nothing (see trivia) 52687 LD (HL),A ; Load byte of graphic data into Display File address HL 52688 RET ; Return ; Read (From Graphic Data) Repeat Counter Value, x, and Draw x Rows of Reset Pixels ; ; Used by the routine at #R52635. Input: DE Current position in graphic data c52689 LD C,0 ; Set C to zero (all bits reset) ; This entry point is used by the routine at #R52710. *52691 INC DE ; Advance graphic data pointer 52692 LD A,(DE) ; Load next data byte (repeat counter) into A 52693 INC DE ; Advance graphic data pointer 52694 LD B,A ; Load B (repeat counter) with value in A *52695 LD A,C ; Load A with zero (i.e. all eight pixel bits reset) 52696 CALL 52686 ; Load byte of graphic data in A into Display File address in HL 52699 CALL 52714 ; Advance HL to next location in Display File (up or down one pixel)... 52702 JP NZ,52685 ; ...and if this new location is outside dimensions of the graphic then jump to #R52685 ; (return) 52705 DJNZ 52695 ; Decrease repeat counter and loop back to #R52695 if not zero 52707 JP 52664 ; Jump back to #R52664 to process next graphic data byte ; Read (From Graphic Data) Repeat Counter Value, x, and Draw x Rows of Set Pixels ; ; Used by the routine at #R52635. c52710 LD C,255 ; Load C with 255 (all bits set) 52712 JR 52691 ; Read repeat counter value, x, and draw x rows of set pixels ; Room Drawing Jump to routine to advance HL to next Display File address to be drawn to ; ; Destination of jump (i.e. WORD value at 52715) depends upon whether or not the Apply Horizontal Mirror Flag is ; set. If the flag is set, then the jump destination is #R52820, otherwise, the jump destination is #R52717. Input: ; HL A Display File address c52714 JP 52717 ; Advance HL to next Display File Address to be drawn to, depending upon state of Apply ; Horizontal Mirror Flag and return ; Room Drawing Advance HL to next Display File address to be drawn to (Apply Horizontal Mirror Flag reset) ; ; Used when Apply Horizontal Mirror Flag is reset Input: HL A Display File address Output: A 1 (if returning via ; #R52792, drawing complete), otherwise zero F Zero Flag reset (if returning via #R52792, drawing complete) c52717 LD A,(23449) ; Increase Pixel Row Counter... 52720 INC A ; ... 52721 AND 7 ; ...and reset to zero if it exceeds 7... 52723 LD (23449),A ; ... 52726 JR Z,52731 ; If new value of Pixel Row Counter is zero (i.e. we have rolled over to a new character block) ; then advance HL to next character block to be drawn and return 52728 INC H ; Increase Display File address by 256 bytes (i.e. move to next pixel row down) 52729 XOR A ; Set A to zero 52730 RET ; Return ; This next section advances HL to next character block to be drawn *52731 LD A,(23450) ; Load A with Horizontal and Vertical Mirror Flags 52734 AND 1 ; If Apply Vertical Mirror Flag is set... 52736 JP NZ,52793 ; ...then skip ahead to #R52793 52739 PUSH BC ; Store BC 52740 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 52743 INC A ; ...increase by one... 52744 LD B,A ; ...and load into B 52745 LD A,(23495) ; Load (x-coordinate + 1) of right of graphic being drawn into A 52748 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)... 52749 JR Z,52765 ; ...then jump to #R52765 52751 LD A,B ; Store increased x-coordinate at #R23444... 52752 LD (23444),A ; ... *52755 LD BC,(23444) ; Load BC with coordinates of new character block to draw 52759 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 52762 XOR A ; Set A to zero 52763 POP BC ; Restore BC 52764 RET ; Return ; This next section advances HL to next character row to be drawn *52765 LD A,(23493) ; Load A with x-coordinate of left of graphic to draw... *52768 LD (23444),A ; ...and set current x-coordinate to match 52771 LD A,(23445) ; Load current y-coordinate into C, increasing by one... 52774 INC A ; ... 52775 LD C,A ; ... 52776 LD A,(23496) ; Load (y-coordinate + 1) of bottom of graphic being drawn into A 52779 CP C ; If both y-coordinates are the same (i.e. we have moved beyond graphic's bottom edge)... 52780 JR Z,52788 ; ...then skip ahead to #R52788 52782 LD A,C ; Store increased y-coordinate at #R23445... 52783 LD (23445),A ; ... 52786 JR 52755 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return ; This entry point is used by the routine at #R52820. *52788 LD A,1 ; Load A with 1 52790 OR A ; Reset Zero Flag 52791 POP BC ; Restore BC 52792 RET ; Return ; This next section advances HL to next character block to be drawn where the Apply Vertical Mirror Flag is set *52793 PUSH BC ; Store BC 52794 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 52797 DEC A ; ...decrease by one... 52798 LD B,A ; ...and load into B 52799 LD A,(23493) ; Load x-coordinate of left of graphic being drawn into A... 52802 DEC A ; ...and decrease by one 52803 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)... 52804 JR Z,52813 ; ...then jump to #R52813 52806 LD A,B ; Store decreased x-coordinate at #R23444... 52807 LD (23444),A ; ... 52810 JP 52755 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return *52813 LD A,(23495) ; Load x-coordinate of right of graphic being drawn into A... 52816 DEC A ; ... 52817 JP 52768 ; Move current character position down one character row and return ; Room Drawing Advance HL to next Display File address to be drawn to (Apply Horizontal Mirror Flag set) ; ; Used when Apply Horizontal Mirror Flag is set Input: HL A Display File address Output: A 1 (if returning via ; #R52792, drawing complete), otherwise zero F Zero Flag reset (if returning via #R52792, drawing complete) c52820 LD A,(23449) ; Increase Pixel Row Counter... 52823 DEC A ; ... 52824 AND 7 ; ...and reset to 7 if it falls below zero... 52826 LD (23449),A ; ... 52829 CP 7 ; If new value of Pixel Row Counter is 7 (i.e. we have rolled over to a new character block)... 52831 JR Z,52836 ; ...then advance HL to next character block to be drawn and return 52833 DEC H ; Decrease Display File address by 256 bytes (i.e. move to next pixel row up) 52834 XOR A ; Set A to zero 52835 RET ; Return ; This next section advances HL to next character block to be drawn *52836 LD A,(23450) ; Load A with Horizontal and Vertical Mirror Flags 52839 AND 1 ; If Apply Vertical Mirror Flag is set... 52841 JP NZ,52897 ; ...then skip ahead to #R52897 52844 PUSH BC ; Store BC 52845 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 52848 INC A ; ...increase by one... 52849 LD B,A ; ...and load into B 52850 LD A,(23495) ; Load (x-coordinate + 1) of right of graphic being drawn into A 52853 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)... 52854 JR Z,52874 ; ...then jump to #R52874 52856 LD A,B ; Store increased x-coordinate at #R23444... 52857 LD (23444),A ; ... *52860 LD BC,(23444) ; Load BC with coordinates of new character block to draw 52864 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 52867 LD A,7 ; Advance HL down seven pixel rows to bottom of character block... 52869 ADD A,H ; ... 52870 LD H,A ; ... 52871 XOR A ; Set A to zero 52872 POP BC ; Restore BC 52873 RET ; Return ; This next section advances HL to next character row to be drawn *52874 LD A,(23493) ; Load A with x-coordinate of left of graphic to draw... *52877 LD (23444),A ; ...and set current x-coordinate to match 52880 LD A,(23445) ; Load current y-coordinate into C, decreasing by one... 52883 DEC A ; ... 52884 LD C,A ; ... 52885 LD A,(23494) ; Load y-coordinate of top of graphic being drawn into A 52888 CP C ; If both y-coordinates are the same (i.e. we have moved beyond graphic's top edge)... 52889 JR Z,52788 ; ...then jump to #R52788 (load A with 1, reset Zero Flag and return) 52891 LD A,C ; Store increased y-coordinate at #R23445... 52892 LD (23445),A ; ... 52895 JR 52860 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return ; This next section advances HL to next character block to be drawn where the Apply Vertical Mirror Flag is set *52897 PUSH BC ; Store BC 52898 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 52901 DEC A ; ...decrease by one... 52902 LD B,A ; ...and load into B 52903 LD A,(23493) ; Load x-coordinate of left of graphic being drawn into A... 52906 DEC A ; ...and decrease by one 52907 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)... 52908 JR Z,52917 ; ...then jump to #R52917 52910 LD A,B ; Store decreased x-coordinate at #R23444... 52911 LD (23444),A ; ... 52914 JP 52860 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return *52917 LD A,(23495) ; Load x-coordinate of right of graphic being drawn into A... 52920 DEC A ; ... 52921 JP 52877 ; Move current character position down one character row and return ; Reverse the order of the bits in A ; ; For example, if A is 3 (00000011) at input, then at output, A will be 192 (11000000). Input: A A bitmap Output: ; A A vertically mirrored bitmap c52924 PUSH BC ; Store BC 52925 LD B,8 ; Load B with 8 (eight bits) 52927 LD C,0 ; Load C with zero *52929 RRA ; Shift bit right out of A and into Carry Flag 52930 RL C ; Shift bit left out of Carry Flag and into C 52932 DJNZ 52929 ; Loop back to #R52929 for next bit 52934 LD A,C ; Load modified bitmap back into A 52935 POP BC ; Restore BC 52936 RET ; Return ; Store Background Bitmap Data at Magic Knight's Current Location ; ; Used by the routine at #R53150. c52937 LD DE,23813 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location 52940 LD A,(25157) ; Load HL with double Magic Knight's current y-coordinate (pixels)... 52943 LD L,A ; ... 52944 LD H,0 ; ... 52946 ADD HL,HL ; ... 52947 LD BC,26240 ; Point BC at Table of Display File Addresses of Start of Each Pixel Row 52950 ADD HL,BC ; Add double y-coordinate as offset in HL 52951 LD (23420),HL ; Store pointer to entry for pixel row at Magic Knight's current y-coordinate 52954 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 52957 RRCA ; Divide by two 52958 PUSH AF ; Store AF (A = Magic Knight's current x-coordinate in pixels, divided by two) 52959 AND 3 ; Clear all but the lowest three bits... 52961 LD (25159),A ; ...and store the remaining value as Magic Knight's current frame index 52964 POP AF ; Restore AF (A = Magic Knight's current x-coordinate in pixels, divided by two) 52965 RRCA ; Divide Magic Knight's current x-coordinate in pixels by eight and remove remainder... 52966 RRCA ; ... 52967 AND 31 ; ... 52969 LD (23422),A ; Store value (Magic Knight's current x-coordinate in characters) at #R23422... 52972 LD C,A ; ...and load into C 52973 LD B,32 ; Load B with 32 (as Magic Knight is 32 pixels tall) 52975 LD IX,(23420) ; Load IX with pointer to entry for pixel row at Magic Knight's current y-coordinate *52979 PUSH BC ; Store BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 52980 LD L,(IX+0) ; Load Display File address of pixel row at IX into HL... 52983 INC IX ; ...and advance IX to entry for next pixel row down... 52985 LD H,(IX+0) ; ... 52988 INC IX ; ... 52990 LD B,0 ; Set B to zero (BC = Magic Knight's current x-coordinate in characters) 52992 ADD HL,BC ; Add BC to HL as offset 52993 LD A,(HL) ; Copy three bytes of graphic data from Display File address... 52994 LD (DE),A ; ...into Table of Background Bitmap Data... 52995 INC HL ; ...as Magic Knight can only occupy three consecutive character blocks horizontally... 52996 INC DE ; ... 52997 LD A,(HL) ; ... 52998 LD (DE),A ; ... 52999 INC HL ; ... 53000 INC DE ; ... 53001 LD A,(HL) ; ... 53002 LD (DE),A ; ... 53003 INC DE ; ... 53004 POP BC ; Restore BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 53005 DJNZ 52979 ; Decrease B (remaining number of pixel rows to store) and loop back to #R52979 if non-zero for ; next pixel row 53007 LD HL,23813 ; Copy contents of Table of Bitmap Data for Magic Knight at his Current Location to Table of ; Background Bitmap Data #R23909... 53010 LD DE,23909 ; ... 53013 LD BC,96 ; ... 53016 LDIR ; ... 53018 RET ; Return ; Overlay Graphic Data for MK's Current Frame on Table of Bitmap Data for MK at his Current Location ; ; Used by the routine at #R53150. c53019 LD A,(25159) ; Load Magic Knight's current frame index into A... 53022 LD B,A ; ...multiply by 48... 53023 ADD A,A ; ... 53024 ADD A,B ; ... 53025 ADD A,A ; ... 53026 ADD A,A ; ... 53027 ADD A,A ; ... 53028 ADD A,A ; ... 53029 LD L,A ; ...load into HL... 53030 LD H,0 ; ... 53032 ADD HL,HL ; ...and double again to give 96 times original value, as graphic data for MK's frames are 96 ; bytes each 53033 LD A,(23425) ; If Magic Knight Facing Left Flag is reset... 53036 OR A ; ... 53037 JR Z,53043 ; ...then skip ahead to #R53043 53039 LD BC,384 ; Advance HL by 384 bytes... 53042 ADD HL,BC ; ...i.e. prepare to use left-facing graphic data, rather than right-facing... *53043 PUSH HL ; Copy value in HL to IX... 53044 POP IX ; ... 53046 LD DE,63988 ; Point DE at start of graphic data for Magic Knight facing right, frame 1 (mask) 53049 ADD HL,DE ; Add HL as offset in HL (HL now points to start of graphic data for Magic Knight's current ; frame mask) 53050 LD DE,63220 ; Point DE at start of graphic data for Magic Knight facing right, frame 1 53053 ADD IX,DE ; Add IX as offset in IX (IX now points to start of graphic data for Magic Knight's current ; frame) 53055 LD DE,23813 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location 53058 LD B,96 ; Load B with 96, as Magic Knight's bitmap graphic data is 96 bytes per frame *53060 LD A,(DE) ; Load current background bitmap byte into A 53061 AND (HL) ; Apply mask to bitmap data 53062 OR (IX+0) ; Overlay Magic Knight bitmap graphic data 53065 LD (DE),A ; Store result back into Table of Background Bitmap Data 53066 INC HL ; Advance HL to next byte in Magic Knight mask bitmap data 53067 INC DE ; Advance DE to next byte in background graphic bitmap data 53068 INC IX ; Advance IX to next byte in Magic Knight graphic bitmap data 53070 DJNZ 53060 ; Decrease B (remaining number of bytes to process) and loop back to #R53060 53072 RET ; Return ; Draw Bitmap Data for Magic Knight Overlaid on Background to Display File ; ; Used by the routine at #R53150. Input: DE (Entry at #R53076 only) Address of Table of Background Bitmap Data ; (#R23909) c53073 LD DE,23813 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location ; This entry point is used by the routine at #R53115. *53076 LD IX,(23420) ; Load IX with pointer to entry in Table of Display File Addresses for pixel row at Magic ; Knight's current y-coordinate 53080 LD A,(23422) ; Load C with Magic Knight's current x-coordinate (characters)... 53083 LD C,A ; ... 53084 LD B,32 ; Load B with 32 (as Magic Knight is 32 pixels tall) *53086 PUSH BC ; Store BC (B = remaining number of pixel rows to draw, C = MK's x-coordinate in characters) 53087 LD L,(IX+0) ; Load Display File address of pixel row at IX into HL... 53090 INC IX ; ...and advance IX to entry for next pixel row down... 53092 LD H,(IX+0) ; ... 53095 INC IX ; ... 53097 LD B,0 ; Set B to zero (BC = Magic Knight's current x-coordinate in characters) 53099 ADD HL,BC ; Add BC to HL as offset 53100 LD A,(DE) ; Copy three bytes of graphic data from Table of Bitmap Data for Magic Knight at his Current ; Location... 53101 LD (HL),A ; ...into Display File... 53102 INC HL ; ...as Magic Knight can only occupy three consecutive character blocks horizontally... 53103 INC DE ; ... 53104 LD A,(DE) ; ... 53105 LD (HL),A ; ... 53106 INC HL ; ... 53107 INC DE ; ... 53108 LD A,(DE) ; ... 53109 LD (HL),A ; ... 53110 INC DE ; ... 53111 POP BC ; Restore BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 53112 DJNZ 53086 ; Decrease B (remaining number of pixel rows to draw) and loop back to #R53086 if non-zero for ; next pixel row 53114 RET ; Return ; Erase Magic Knight from Display, Advance his Current Position then Redraw ; ; Used by the routines at #R27136 and #R27357. c53115 PUSH IX ; Store IX 53117 LD DE,23909 ; Point DE at Table of Background Bitmap Data 53120 HALT ; Wait for interrupt 53121 CALL 53076 ; Restore background bitmap data (i.e. remove Magic Knight bitmap data from display) 53124 LD A,(23705) ; If Player Attribute Update Flag is set... 53127 OR A ; ... 53128 CALL NZ,53278 ; ...then restore background attribute data at Magic Knight's current location 53131 POP IX ; Restore IX 53133 LD HL,25156 ; Point HL at Magic Knight's current x-coordinate 53136 LD A,(25160) ; Load A with Magic Knight's current x-velocity... 53139 ADD A,(HL) ; ...and add to this Magic Knight's current x-coordinate 53140 LD (HL),A ; Set this as Magic Knight's new x-coordinate 53141 INC HL ; Advance HL to Magic Knight's y-coordinate 53142 LD A,(25161) ; Load A with Magic Knight's current y-velocity... 53145 ADD A,(HL) ; ...and add to this Magic Knight's current y-coordinate 53146 LD (HL),A ; Set this as Magic Knight's new y-coordinate 53147 XOR A ; Set A to zero (see trivia) 53148 JR 53152 ; Store background attributes if appropriate, then draw Magic Knight to display, then return ; Store Background Attributes if Appropriate, then Draw Magic Knight to Display ; ; Used by the routines at #R28101 and #R31468. c53150 LD A,1 ; Load A with 1 (see trivia) ; This entry point is used by the routine at #R53115. *53152 PUSH IX ; Store IX 53154 LD A,(23705) ; If Player Attribute Update Flag is set (Player Attribute Update mode)... 53157 OR A ; ... 53158 CALL NZ,53185 ; ...then store background attribute data at Magic Knight's current location 53161 CALL 52937 ; Store background bitmap data at Magic Knight's current location 53164 CALL 53019 ; Overlay graphic data for MK's current frame on Table of Bitmap Data for MK at his Current ; Location 53167 CALL 53073 ; Draw bitmap data for Magic Knight overlaid on background to Display File 53170 LD A,(23422) ; Store Magic Knight's current x-coordinate (characters) at #R23423... 53173 LD (23423),A ; ... 53176 LD A,(25157) ; Store Magic Knight's current y-coordinate (pixels) at #R23424... 53179 LD (23424),A ; ... 53182 POP IX ; Restore IX 53184 RET ; Return ; Store Background Attribute Data at Magic Knight's Current Location ; ; Used by the routine at #R53150. c53185 LD DE,24037 ; Point DE at Table of Background Attribute data 53188 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 53191 AND 248 ; Clear lowest three bits to round down to nearest multiple of 8 53193 LD L,A ; Load this value into HL... 53194 LD H,0 ; ... 53196 ADD HL,HL ; Multiply by four to obtain 32 x y-coordinate (characters)... 53197 ADD HL,HL ; ... 53198 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 53201 RRCA ; Divide this by eight, rounding down to nearest integer... 53202 RRCA ; ...to convert from pixels to characters... 53203 RRCA ; ... 53204 AND 31 ; ... 53206 LD C,A ; Load x-coordinate (characters) into BC... 53207 LD B,0 ; ... 53209 ADD HL,BC ; Add x-coordinate to 32 x y-coordinate in HL 53210 PUSH HL ; Store HL (32 x y-coordinate in characters) 53211 LD BC,22528 ; Add this to start address of Attribute File... 53214 ADD HL,BC ; ...so that HL points to required byte in Attribute File 53215 EX (SP),HL ; Put Attribute File address on top of stack and load HL with 32 x y-coordinate 53216 LD BC,24064 ; Point BC at start of Terrain Interaction Data Table... 53219 ADD HL,BC ; ...and add 32 x y-coordinate as offset in HL 53220 EX (SP),HL ; Restore Attribute File address to HL... 53221 POP IX ; ...and load IX with Terrain Interaction address 53223 LD A,(25162) ; Load C with Magic Knight's attribute... 53226 LD C,A ; ... 53227 LD B,4 ; Load B with 4 as Magic Knight is four characters tall *53229 PUSH BC ; Store BC (B = remaining number of character rows) 53230 LD A,(HL) ; Copy byte from Attribute File... 53231 LD (DE),A ; ...into Table of Background Attribute Data 53232 BIT 5,(IX+0) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 53236 JP NZ,53240 ; ...then skip ahead to #R53240 53239 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *53240 INC HL ; Advance current position in Attribute File 53241 INC DE ; Advance current position in Table of Background Attribute Data 53242 LD A,(HL) ; Copy byte from Attribute File... 53243 LD (DE),A ; ...into Table of Background Attribute Data 53244 BIT 5,(IX+1) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 53248 JP NZ,53252 ; ...then skip ahead to #R53252 53251 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *53252 INC HL ; Advance current position in Attribute File 53253 INC DE ; Advance current position in Table of Background Attribute Data 53254 LD A,(HL) ; Copy byte from Attribute File... 53255 LD (DE),A ; ...into Table of Background Attribute Data 53256 BIT 5,(IX+2) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 53260 JP NZ,53264 ; ...then skip ahead to #R53264 53263 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *53264 INC DE ; Advance current position in Table of Background Attribute Data 53265 LD BC,30 ; Advance current position in Attribute File by 30 bytes... 53268 ADD HL,BC ; ...i.e. down one character and left two characters 53269 LD BC,32 ; Advance current position in Terrain Interaction Data Table by 32 bytes... 53272 ADD IX,BC ; ...i.e. down one character 53274 POP BC ; Restore BC (B = remaining number of character rows) 53275 DJNZ 53229 ; If character rows remain then loop back to #R53229 53277 RET ; Return ; Restore Background Attribute Data at Magic Knight's Current Location ; ; Used by the routine at #R53115. c53278 LD DE,24037 ; Point DE at Table of Background Attribute Data 53281 LD A,(25157) ; Load A with Magic Knight's current y-coordinate (pixels) 53284 AND 248 ; Clear lowest three bits to round down to nearest multiple of 8 53286 LD L,A ; Load this value into HL... 53287 LD H,0 ; ... 53289 ADD HL,HL ; Multiply by four to obtain 32 x y-coordinate (characters)... 53290 ADD HL,HL ; ... 53291 LD A,(25156) ; Load A with Magic Knight's current x-coordinate (pixels) 53294 RRCA ; Divide this by eight, rounding down to nearest integer... 53295 RRCA ; ...to convert from pixels to characters... 53296 RRCA ; ... 53297 AND 31 ; ... 53299 LD C,A ; Load x-coordinate (characters) into BC... 53300 LD B,0 ; ... 53302 ADD HL,BC ; Add x-coordinate to 32 x y-coordinate in HL... 53303 LD BC,22528 ; ...then add this to start address of Attribute File... 53306 ADD HL,BC ; ...so that HL points to required byte in Attribute File 53307 LD B,4 ; Load B with 4 as Magic Knight is four characters tall *53309 PUSH BC ; Store BC (B = remaining number of character rows) 53310 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 53311 LD (HL),A ; ...into Attribute File 53312 INC HL ; Advance current position in Attribute File 53313 INC DE ; Advance current position in Table of Background Attribute Data 53314 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 53315 LD (HL),A ; ...into Attribute File 53316 INC HL ; Advance current position in Attribute File 53317 INC DE ; Advance current position in Table of Background Attribute Data 53318 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 53319 LD (HL),A ; ...into Attribute File 53320 INC DE ; Advance current position in Table of Background Attribute Data 53321 LD BC,30 ; Advance current position in Attribute File by 30 bytes... 53324 ADD HL,BC ; ...i.e. down one character and left two characters 53325 POP BC ; Restore BC (B = remaining number of character rows) 53326 DJNZ 53309 ; If character rows to be coloured remain then loop back to #R53309 53328 RET ; Return ; Starship Location Connectivity Data ; ; The various locations that the USS Pisces can travel to are laid out on a grid, eight units by four units. When ; the USS Pisces is at a given location on the grid, it can move only to the eight adjacent locations (north, ; north-east, east, south-east, south, south-west, west and north-west). b53329 DEFB 1,2,3,4,22,6,7,0 ; Deneb, Gath, Monopole, Porthos, Reef, Lynx, Nirvana, NULL 53337 DEFB 8,9,0,10,12,11,14,16 ; Limbo, Eden, NULL, Herschell, Plop Plop, Trantore, Outpost, Bingo 53345 DEFB 13,15,5,0,0,17,24,0 ; Brightstar, Polaris, Starbase 1, NULL, NULL, Retreat, Plinkit, NULL 53353 DEFB 18,0,19,20,21,0,0,23 ; Dragon Egg, NULL, Aridia, Gangrole, Naff, NULL, NULL, ; Menopausia ; Initial Planetary Data ; ; Two bytes per location. The bytes' meanings are: b53361 DEFB 0,0 ; (00) - Unused 53363 DEFB 0,66 ; (01) - Deneb 53365 DEFB 0,70 ; (02) - Gath 53367 DEFB 0,66 ; (03) - Monopole 53369 DEFB 50,6 ; (04) - Porthos 53371 DEFB 255,71 ; (05) - Starbase 1 53373 DEFB 70,7 ; (06) - Lynx 53375 DEFB 25,71 ; (07) - Nirvana 53377 DEFB 30,70 ; (08) - Limbo 53379 DEFB 80,68 ; (09) - Eden 53381 DEFB 255,68 ; (10) - Herschell 53383 DEFB 80,65 ; (11) - Trantore 53385 DEFB 0,69 ; (12) - Plop Plop 53387 DEFB 10,71 ; (13) - Brightstar 53389 DEFB 0,7 ; (14) - Outpost 53391 DEFB 20,7 ; (15) - Polaris 53393 DEFB 255,71 ; (16) - Bingo 53395 DEFB 0,7 ; (17) - Retreat 53397 DEFB 0,4 ; (18) - Dragon Egg 53399 DEFB 0,66 ; (19) - Aridia 53401 DEFB 0,0 ; (20) - Gangrole 53403 DEFB 20,71 ; (21) - Naff 53405 DEFB 0,69 ; (22) - Reef 53407 DEFB 0,66 ; (23) - Menopausia 53409 DEFB 255,6 ; (24) - Plinkit ; Table of Start Addresses of Input Device Reading Routines b53411 DEFW 54950 ; Address of keyboard reading routine 53413 DEFW 54999 ; Address of Kempston Joystick reading routine 53415 DEFW 55030 ; Address of Cursor Joystick reading routine 53417 DEFW 55067 ; Address of Sinclair Joystick 1 reading routine ; Powers of Ten (Used by Routine at 35591) for Converting Numbers to ASCII String b53419 DEFW 10000 53421 DEFW 1000 53423 DEFW 100 53425 DEFW 10 53427 DEFW 1 ; Addresses of Room-Specific Routines b53429 DEFW 28469 ; (00) Do Nothing - USS Pisces, 0 (The Recreation Room) 53431 DEFW 28469 ; (01) Do Nothing - USS Pisces, 1 (The Bridge) 53433 DEFW 28469 ; (02) Do Nothing - USS Pisces, 2 (The Transporter Room) 53435 DEFW 28469 ; (03) Do Nothing - USS Pisces, 3 (The Transputer Room) 53437 DEFW 28469 ; (04) Do Nothing - USS Pisces, 4 (Cargo Hold) 53439 DEFW 28469 ; (05) Do Nothing - USS Pisces, 5 (The Airlock) 53441 DEFW 28469 ; (06) Do Nothing - USS Pisces, 6 (The Life Boat) 53443 DEFW 28470 ; (07) Go to Game Over Routine if Magic Knight is not Wearing the Cloak of Invisibility - ; Retreat, 0 (Murphy's Moon) 53445 DEFW 28482 ; (08) Go to Game Over Routine if Magic Knight is not Wearing the Pair of Boots - Retreat, 1 53447 DEFW 28469 ; (09) Do Nothing - Retreat, 2 53449 DEFW 28469 ; (10) Do Nothing - Retreat, 3 53451 DEFW 28469 ; (11) Do Nothing - Starbase 1, 0 (The Transporter Room) 53453 DEFW 28469 ; (12) Do Nothing - Starbase 1, 1 (McTablet Takeaway Food) 53455 DEFW 28469 ; (13) Do Nothing - Starbase 1, 2 53457 DEFW 28469 ; (14) Do Nothing - Starbase 1, 3 53459 DEFW 28469 ; (15) Do Nothing - Starbase 1, 4 (Fuel and Cargo Area) 53461 DEFW 28494 ; (16) Go to Game Over Routine if Magic Knight is not Wearing the Gas Mask - Outpost, 0 (Ye ; Olde Transporter) 53463 DEFW 28482 ; (17) Go to Game Over Routine if Magic Knight is not Wearing the Pair of Boots - Outpost, 1 ; (The Main Defence System) 53465 DEFW 28506 ; (18) Show Tyme Guardians' Warning Message if not Already Shown - Outpost, 2 53467 DEFW 28542 ; (19) Go to Game Over Routine if Magic Knight is not Carrying the Golden Sundial of Alpha - ; Outpost, 3 (The Proof of Power) 53469 DEFW 28554 ; (20) Show Tyme Guardians' Messages and Install Tyme Machine on USS Pisces - Outpost, 4 (The ; Tyme Guardians) 53471 DEFW 28470 ; (21) Go to Game Over Routine if Magic Knight is not Wearing the Cloak of Invisibility - ; Monopole, 0 (Hooper's Emergency Exit) 53473 DEFW 28494 ; (22) Go to Game Over Routine if Magic Knight is not Wearing the Gas Mask - Monopole, 1 (This ; Way to Hooper ==>>) 53475 DEFW 28469 ; (23) Do Nothing - Monopole, 2 (Here is Hooper) 53477 DEFW 28469 ; (24) Do Nothing - USS Pisces, 6A (The Control Column) ; Call Time-Dependent Routines [Main Interrupt Routine] ; ; Used by the routine at #R65524. c53479 CALL 54051 ; Store all registers on the stack 53482 BIT 0,(IY+65) ; If Game In Progress Flag is reset... (IY = 23610) 53486 JP Z,53492 ; ...then skip ahead to #R53492 53489 CALL 53498 ; Update game time, time left and move characters if appropriate *53492 CALL 54079 ; Restore all registers from the stack 53495 JP 56 ; Jump to ROM maskable interrupt routine (update frame counter, read keyboard and then return ; from interrupt routine) ; Update Game Time, Time Left and Move Characters if Appropriate ; ; Used by the routine at #R53479. c53498 LD A,(23460) ; If number of 1/50 seconds elapsed in current minute is divisible by eight... 53501 AND 7 ; ... 53503 CALL Z,53731 ; ...then move character whose turn it is to move, if allowed 53506 LD A,(23460) ; [EVERY 1/50 SECOND] Increase number of elapsed 1/50 seconds 53509 INC A ; ... 53510 LD (23460),A ; ... 53513 CP 50 ; If new value isn't 50... 53515 RET NZ ; ...then return 53516 XOR A ; [EVERY 1 SECOND] Else, set the value to zero (start of next full second)... 53517 LD (23460),A ; ... 53520 LD A,(23459) ; Increase number of seconds elapsed... 53523 INC A ; ... 53524 LD (23459),A ; ... 53527 CP 60 ; If new value isn't 60... 53529 RET NZ ; ...then return 53530 XOR A ; [EVERY 1 MINUTE] Else, set the value to zero (start of next minute)... 53531 LD (23459),A ; ... 53534 CALL 53585 ; Update All Characters' Stats (Deteriorate or Regenerate) and Wake Up / Send to Sleep if ; Required 53537 CALL 53573 ; Increase Magic Knight's current Magic Level by 10 (capped at 100) 53540 LD A,12 ; If Magic Knight is wearing the Magic Talisman (12)... 53542 CALL 33640 ; ... 53545 CALL Z,53573 ; ...then increase Magic Knight's current Magic Level by another 10 (capped at 100) 53548 LD A,(23458) ; Increase number of minutes elapsed... 53551 INC A ; ... 53552 LD (23458),A ; ... 53555 CP 5 ; If new value isn't 5... 53557 RET NZ ; ...then return 53558 XOR A ; [EVERY 5 MINUTES] Else, set the value to zero (start of next "day")... 53559 LD (23458),A ; ... 53562 LD A,(23457) ; Decrease number of days left... 53565 DEC A ; ... 53566 LD (23457),A ; ... 53569 JP Z,53937 ; If zero then show "Out of time" game over message and return to Control Selection Menu 53572 RET ; Return ; Increase Magic Knight's Current Magic Level by 10 (Up to Maximum of 100) ; ; Used by the routine at #R53498. c53573 LD A,(25024) ; Load A with Magic Knight's current Magic Level 53576 LD C,10 ; Add 10 to this value, capping at 100... 53578 CALL 53703 ; ... 53581 LD (25024),A ; Store updated value for Magic Level 53584 RET ; Return ; Update All Characters' Stats (Deteriorate or Regenerate) and Wake Up / Send to Sleep if Required ; ; Used by the routine at #R53498. c53585 LD DE,8 ; Load DE with 8 (as data is 8 bytes long) 53588 LD HL,53955 ; Point HL at start of characters' Stat Regeneration Data Table 53591 LD IX,25028 ; Point IX at Gordon's current stats (2nd entry in Characters' Current Stats Table, as first is ; Magic Knight's) 53595 LD B,16 ; Load B with 16 (16 characters) (see trivia) *53597 BIT 7,(IX+6) ; If current character is awake... 53601 JR Z,53607 ; ...then skip ahead to 53607 53603 INC HL ; Advance HL by four bytes to stat deterioration data... 53604 INC HL ; ... 53605 INC HL ; ... 53606 INC HL ; ... *53607 LD C,(HL) ; Load stat change value into C 53608 LD A,(IX+0) ; Load current character's strength into A 53611 CALL 53703 ; Update character's strength as they tire (awake) or regenerate (asleep)... 53614 LD (IX+0),A ; ... 53617 INC HL ; Advance HL to next (happiness) data 53618 LD C,(HL) ; Load stat change value into C 53619 LD A,(IX+1) ; Load current character's happiness into A 53622 CALL 53703 ; Update character's happiness as they tire (awake) or regenerate (asleep)... 53625 LD (IX+1),A ; ... 53628 INC HL ; Advance HL to next (stamina) data 53629 LD C,(HL) ; Load stat change value into C 53630 LD A,(IX+2) ; Load current character's stamina into A 53633 CALL 53703 ; Update character's stamina as they tire (awake) or regenerate (asleep)... 53636 LD (IX+2),A ; ... 53639 INC HL ; Advance HL to next (charisma) data 53640 LD C,(HL) ; Load stat change value into C 53641 LD A,(IX+3) ; Load current character's charisma into A 53644 CALL 53703 ; Update character's charisma as they tire (awake) or regenerate (asleep)... 53647 LD (IX+3),A ; ... 53650 INC HL ; Advance HL to next block of data 53651 BIT 7,(IX+6) ; If current character is asleep... 53655 JR NZ,53661 ; ...then we have already moved into data for next character, so skip ahead to 53661 53657 INC HL ; Else, we are now in same character's "asleep" data, so need to advance HL by four bytes to ; get to next character's data... 53658 INC HL ; ... 53659 INC HL ; ... 53660 INC HL ; ... *53661 ADD IX,DE ; Advance IX by eight bytes to next character's stats 53663 DJNZ 53597 ; Loop back to 53597 53665 LD DE,8 ; Load DE with 8 53668 LD IX,25028 ; Point IX to Gordon's current stats 53672 LD B,16 ; Load B with 16 (16 characters) (see trivia) 53674 LD C,0 ; Load C with zero (to denote first character, Gordon) *53676 LD A,(IX+2) ; Load current character's stamina into A 53679 AND 127 ; If stamina (bits 0-6) is not zero... 53681 JR NZ,53689 ; ...then skip ahead to 53689 53683 SET 7,(IX+6) ; Else send character to sleep 53687 JR 53697 ; Skip ahead to 53697 *53689 CP 100 ; If stamina is not 100... 53691 JR NZ,53697 ; ...then skip ahead to 53697 53693 RES 7,(IX+6) ; Else wake character up *53697 ADD IX,DE ; Advance IX to next character's stats 53699 INC C ; Increase C for next character 53700 DJNZ 53676 ; Loop back to 53676 for next character 53702 RET ; Return ; Update Characters' Stats as They Tire (Awake) or Regenerate (Asleep) ; ; Used by the routines at #R29756, #R31280, #R33569, #R53573 and #R53585. Input: A A character's stat (strength, ; stamina, happiness or spell power) C An increment (while asleep) or decrement (while awake) for that stat Output: ; A New value of stat c53703 PUSH AF ; Store AF (A = value of character's stat) 53704 AND 128 ; Capture MSB in stat value and store in instruction at #R53728... 53706 LD (53729),A ; ... 53709 POP AF ; Restore AF (A = value of character's stat) 53710 AND 127 ; Discard MSB of stat value 53712 ADD A,C ; Add change value 53713 OR A ; Check Sign Flag 53714 JP P,53720 ; If sign flag reset (i.e. MSB of result is reset and result is positive) then jump ahead to ; #R53720 53717 XOR A ; else stat must have dropped below zero, so set stat to zero (as it can't be less than 0) 53718 JR 53728 ; Skip ahead to #R53728 *53720 CP 100 ; If new value of stat is less than or equal to 100... 53722 JR Z,53728 ; ...then skip ahead to #R53728... 53724 JR C,53728 ; ... 53726 LD A,100 ; ...else set stat to 100 (as it can't be greater than 100) ; The operand of the instruction at #R53728 represents bit 7 of the input value in A. This is modified by the ; instruction at #R53706. *53728 OR 0 ; Restore previously stored MSB state 53730 RET ; Return ; Move Character Whose Turn it is to Move, if Allowed ; ; Alternate characters move in opposite directions on alternate days. c53731 CALL 53871 ; Update index of character whose turn it is to be updated and load into A 53734 LD E,6 ; Point HL at this character's flags... 53736 CALL 33541 ; ... 53739 LD A,(HL) ; ...and load flags into A 53740 AND 192 ; If character is asleep, or character can't move... 53742 RET NZ ; ...then return 53743 LD E,2 ; Point HL at Gordon's stamina (A=0)... (see trivia) 53745 CALL 33541 ; ... 53748 LD A,(HL) ; ...and load into A 53749 BIT 7,A ; If Bit 7 of Gordon's stamina is set... 53751 RET NZ ; ...then return 53752 LD A,(23455) ; Load BC with three times index of character whose turn it is to be updated... 53755 LD C,A ; ... 53756 ADD A,A ; ... 53757 ADD A,C ; ... 53758 LD C,A ; ... 53759 LD B,0 ; ... 53761 LD HL,25244 ; Point HL at start of Table of Characters' Current Positions at #R25244 53764 ADD HL,BC ; Add BC to HL as offset 53765 LD A,(23701) ; If Magic Knight is not in the same room as this character... 53768 CP (HL) ; ... 53769 JP NZ,53777 ; ...then skip ahead to #R53777 53772 BIT 1,(IY+65) ; If Characters Free to Move Flag is reset (IY = 23610)... 53776 RET Z ; ...then return *53777 LD A,(23455) ; Load B with index of character whose turn it is to be updated... 53780 LD B,A ; ... 53781 LD A,(23457) ; Load A with number of days left... 53784 ADD A,B ; ...and add index of character to be updated 53785 BIT 0,A ; If result is even... 53787 JP Z,53824 ; ...then skip ahead to #R53824 ; Move character left 53790 LD A,(HL) ; Load A with character's current room 53791 PUSH HL ; Store HL (pointer to character's current room) 53792 LD HL,37022 ; Point HL to left exit value of first entry in Room Connectivity Data Table 53795 CALL 53861 ; Get index of destination room for character and load into A and instruction at #R53812 53798 LD (53813),A ; Load value into instruction at #R53812 (see trivia) 53801 POP HL ; Restore HL (pointer to character's current room) 53802 INC HL ; Advance HL to character's x-coordinate 53803 LD A,(HL) ; Load x-coordinate into A... 53804 DEC A ; ...and decrease 53805 CALL 53886 ; If character has a disallowed x-coordinate in the "Barrier Room" then return to routine that ; called this one 53808 OR A ; If character's x-coordinate is not zero... 53809 JP NZ,53859 ; ...then skip ahead to #R53859 ; The operand of the instruction at #R53812 represents the character's destination room when moving left. This is ; modified by the instructions at #R53798 and #R53867. 53812 LD A,0 ; Load B with character's destination room... 53814 LD B,A ; ... 53815 CP 255 ; ...and if this is 255 (i.e. no room available)... 53817 RET Z ; ...then return 53818 LD A,29 ; Set character's x-coordinate to 29 (right-hand side of new room)... 53820 LD (HL),A ; ... 53821 DEC HL ; Move HL back to character's room 53822 LD (HL),B ; Set current room to new room index 53823 RET ; Return ; Move character right *53824 LD A,(HL) ; Load A with character's current room 53825 PUSH HL ; Store HL (pointer to character's current room) 53826 LD HL,37023 ; Point HL to right exit value of first entry in Room Connectivity Data Table 53829 CALL 53861 ; Get index of destination room for character and load into A and instruction at #R53812 53832 LD (53848),A ; Load value into instruction at #R53847 53835 POP HL ; Restore HL (pointer to character's current room) 53836 INC HL ; Advance HL to character's x-coordinate 53837 LD A,(HL) ; Load x-coordinate into A... 53838 INC A ; ...and increase 53839 CALL 53886 ; If character has a disallowed x-coordinate in the "Barrier Room" then return to routine that ; called this one 53842 CP 30 ; If character's x-coordinate is not 30... 53844 JP NZ,53859 ; ...then skip ahead to #R53859 ; The operand of the instruction at #R53847 represents the character's destination room when moving right. This is ; modified by the instruction at #R53832. 53847 LD A,0 ; Load B with character's destination room... 53849 LD B,A ; ... 53850 CP 255 ; ...and if this is 255 (i.e. no room available)... 53852 RET Z ; ...then return 53853 LD A,1 ; Set character's x-coordinate to 1 (left-hand side of new room)... 53855 LD (HL),A ; ... 53856 DEC HL ; Move HL back to character's room 53857 LD (HL),B ; Set current room to new room index 53858 RET ; Return *53859 LD (HL),A ; Store updated x-coordinate for character 53860 RET ; Return ; Get Index of Destination Room for a Character and Load into A and Instruction at 53812 ; ; Used by the routine at #R53731. Input: A A room index HL Points to one of the two bytes of the first entry of ; the Room Connectivity Data Table at #R37022 Output: A New room index c53861 ADD A,A ; Load double room index into BC... 53862 LD C,A ; ... 53863 LD B,0 ; ... 53865 ADD HL,BC ; Add BC to HL as offset 53866 LD A,(HL) ; Load A with room index at HL... 53867 LD (53813),A ; ...and modify the instruction at #R53812 with this value 53870 RET ; Return ; Update Index of Character Whose Turn it is to be Updated ; ; Used by the routine at #R53731. Output: A Updated index of character whose turn it is to be updated c53871 LD A,(23455) ; Increment index of character whose turn it is to be updated... 53874 INC A ; ... 53875 LD (23455),A ; ... 53878 CP 12 ; If new character index is not 12... 53880 RET NZ ; ...then return 53881 XOR A ; Set new character index to 0, as there are only 12 characters... 53882 LD (23455),A ; ... 53885 RET ; Return ; If Character has a Disallowed x-Coordinate in the "Barrier Room" then Return Twice ; ; Used by the routine at #R53731. Input: A A character's x-coordinate HL Pointer to character's x-coordinate in ; Characters' Current Positions Table at #R25244 Output: A A character's x-coordinate (same as input) HL Pointer ; to character's x-coordinate in Characters' Current Positions Table at #R25244 (same as input) c53886 PUSH HL ; Store HL (pointer to character's x-coordinate) 53887 PUSH AF ; Store AF (A = character's x-coordinate) 53888 LD E,A ; Load x-coordinate into A 53889 DEC HL ; Move HL back to character's current room 53890 LD A,(HL) ; If character's room is not 9 (barrier room on Murphy's Moon)... 53891 CP 9 ; ... 53893 JP NZ,53922 ; ...then skip ahead to #R53922 53896 LD A,(23403) ; If Barriers Removed Flag is set... 53899 AND 1 ; ... 53901 JP NZ,53922 ; ...then skip ahead to #R53922 53904 LD HL,53929 ; Point HL at list of disallowed character x-coordinates in barrier room (Murphy's Moon) 53907 LD A,E ; Load A with character's x-coordinate *53908 CP (HL) ; If character's x-coordinate is the same as the current disallowed x-coordinate... 53909 JP Z,53925 ; ...then skip ahead to #R53925 53912 EX AF,AF' ; Swap AF and AF' 53913 LD A,(HL) ; Load A with current x-coordinate entry... 53914 CP 255 ; ...and if this is 255 (End Marker)... 53916 JR Z,53922 ; ...then skip ahead to #R53922 53918 EX AF,AF' ; Swap AF and AF' 53919 INC HL ; Advance HL to next x-coordinate entry 53920 JR 53908 ; Loop back to #R53908 *53922 POP AF ; Restore AF (A = character's x-coordinate) 53923 POP HL ; Restore HL (pointer to character's x-coordinate) 53924 RET ; Return *53925 POP AF ; Restore AF (A = character's x-coordinate) 53926 POP HL ; Restore HL (pointer to character's x-coordinate) 53927 POP AF ; Remove return address from top of stack... 53928 RET ; ...and return to routine that called the routine that called this one ; List of Disallowed Character x-Coordinates in Barrier Room (Murphy's Moon) b53929 DEFB 12,13,14,15,16,17,18,255 ; End Game Due to Running Out of Time ; ; Used by the routine at #R53498. c53937 LD HL,45224 ; Point HL at "YOU RAN OUT OF TIME" text... 53940 LD (53949),HL ; ...and store as operand in instruction at #R53948 53943 POP AF ; Remove return address (call to this routine) from top of stack 53944 CALL 54079 ; Restore all registers from the stack 53947 POP AF ; Remove return address (call to interrupt routine) from top of stack ; The operand of the instruction at #R53948 represents the address of the Game Over text to use. This is modified by ; the instruction at #R53940. 53948 LD HL,0 ; Restore address of "YOU RAN OUT OF TIME" text to HL 53951 EI ; Enable interrupts 53952 JP 55685 ; Jump to "Game over" window routine and return to Control Selection Menu ; Characters' Rates of Stat Regeneration ; ; Stats are in order: b53955 DEFB 255,255,253,252,10,8,15,10 ; Gordon (-1, -1, -3, -4, 10, 8, 15, 10) 53963 DEFB 250,255,255,255,5,3,4,1 ; Sarab (-6, -1, -1, -1, 5, 3, 4, 1) 53971 DEFB 253,0,252,251,3,0,4,8 ; Klink (-3, 0, -4, -5, 3, 0, 4, 8) 53979 DEFB 253,0,252,252,7,0,3,9 ; S3 E3 (-3, 0, -4, -4, 7, 0, 3, 9) 53987 DEFB 255,255,253,255,10,2,10,1 ; Hooper (-1, -1, -3, -1, 10, 2, 10, 1) 53995 DEFB 253,255,252,250,8,4,4,8 ; Murphy (-3, -1, -4, -6, 8, 4, 4, 8) 54003 DEFB 253,255,252,252,8,4,4,3 ; Sharon (-3, -1, -4, -4, 8, 4, 4, 3) 54011 DEFB 253,255,252,252,8,4,4,3 ; Forbin (-3, -1, -4, -4, 8, 4, 4, 3) 54019 DEFB 253,0,252,252,8,0,4,3 ; Derby IV (-3, 0, -4, -4, 8, 0, 4, 3) 54027 DEFB 253,255,252,252,8,4,4,3 ; Swiftfoot (-3, -1, -4, -4, 8, 4, 4, 3) 54035 DEFB 253,255,252,252,8,4,4,3 ; Julie 8 (-3, -1, -4, -4, 8, 4, 4, 3) 54043 DEFB 253,255,252,252,8,4,4,3 ; Hectorr (-3, -1, -4, -4, 8, 4, 4, 3) ; Store all Registers on the Stack ; ; Used by the routines at #R33952 and #R53479. c54051 EX (SP),HL ; Place HL onto stack in place of top entry (the address of the CALL to this routine is now in ; HL) 54052 PUSH DE ; Store registers AF, BC & DE... 54053 PUSH BC ; ... 54054 PUSH AF ; ... 54055 EX AF,AF' ; Store shadow registers too... 54056 EXX ; ... 54057 PUSH HL ; ... 54058 PUSH DE ; ... 54059 PUSH BC ; ... 54060 PUSH AF ; ... 54061 EX AF,AF' ; ... 54062 EXX ; ... 54063 PUSH IX ; Store IX 54065 PUSH IY ; Store IY 54067 PUSH HL ; Store HL (address of call to this routine) 54068 PUSH AF ; Store AF 54069 LD HL,23 ; Restore original value of HL (as switched with top of stack at beginning of this routine)... 54072 ADD HL,SP ; ... 54073 LD A,(HL) ; ... 54074 DEC HL ; ... 54075 LD L,(HL) ; ... 54076 LD H,A ; ... 54077 POP AF ; Restore AF 54078 RET ; Return ; Restore All Registers from the Stack ; ; Used by the routines at #R33952, #R53479 and #R53937. c54079 POP HL ; Restore registers HL, IY & IX (HL has address of call to this routine, i.e. 54079)... 54080 POP IY ; ... 54082 POP IX ; ... 54084 EX AF,AF' ; Restore shadow registers too... 54085 EXX ; ... 54086 POP AF ; ... 54087 POP BC ; ... 54088 POP DE ; ... 54089 POP HL ; ... 54090 EX AF,AF' ; ... 54091 EXX ; ... 54092 POP AF ; Restore AF, BC, DE... 54093 POP BC ; ... 54094 POP DE ; ... 54095 EX (SP),HL ; Put HL (address of call to 54079) back on stack in preparation for RET and take off original ; value of HL 54096 RET ; Return ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor ; ; Used by the routines at #R28730, #R28753, #R32694, #R35123, #R36602, #R54231, #R54598 and #R54647. Input: A ; Index of character to print c54097 PUSH HL ; Store HL 54098 LD DE,64500 ; Point to (effective) start Character Set graphics 54101 ADD A,A ; Load index of character into HL and multiply by 8... 54102 LD H,0 ; ... 54104 LD L,A ; ... 54105 ADD HL,HL ; ... 54106 ADD HL,HL ; ... 54107 ADD HL,DE ; ...and add to DE to obtain memory location of required character in the character set 54108 EX DE,HL ; Swap values (DE now holds memory location of character to print and HL holds 64500) ; The operand of the instruction at #R54109 represents the address of the Bitmap Virtual Text Cursor. This is ; modified by the instructions at #R27725, #R27737, #R27753, #R27966, #R28180, #R28230, #R35119, #R35206, #R35630, ; #R36742, #R54188, #R54297, #R54532 and #R54549. 54109 LD HL,0 ; Load (video) memory location to start printing character into HL 54112 LD B,8 ; For eight bytes (i.e. full height of character)... *54114 LD A,(DE) ; ...get graphic data from character set... 54115 LD (HL),A ; ...and load into video memory... 54116 INC DE ; ...move to next pixel row in character set... 54117 INC H ; ...and move to next pixel row in video memory 54118 DJNZ 54114 ; Loop back to #R54114 54120 CALL 54215 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 54123 LD A,(23695) ; Obtain attribute data stored previously (71 = bright white) 54126 LD (HL),A ; Apply attribute to character just printed 54127 CALL 54176 ; Advance Bitmap Virtual Text Cursor right by one character 54130 POP HL ; Restore HL 54131 RET ; Return ; Move Virtual Cursor (Bitmap) to Display File for Coordinates x=C, y=B and Load Address into HL ; ; Used by the routines at #R28833, #R32694, #R34990, #R35123, #R52596, #R52635, #R52717, #R52820, #R54598 and ; #R54647. Input: B y-coordinate (characters) C x-coordinate (characters) Output: HL Virtual Cursor (Bitmap) ; Display File address c54132 LD A,B ; Load y-coordinate into A 54133 AND 24 ; AND 24 to determine which third of the bitmap memory we are in (A = 0, 8 or 16. Can't be 24 ; as this is greater than y-resolution in characters, 0-23) 54135 ADD A,64 ; Load HL with bitmap Display File address of start of appropriate third of display... 54137 LD H,A ; ...(16,384, 18,432 or 20,480) 54138 LD A,B ; Load y-coordinate back into A 54139 AND 7 ; AND 7 to determine which of the 8 character rows within the third we are interested in 54141 RRCA ; Multiply by 8 to get pixel row required... 54142 RRCA ; ... 54143 RRCA ; ... 54144 ADD A,C ; Add x-coordinate 54145 LD L,A ; Add to value currently in HL 54146 JR 54188 ; Store the updated address of Bitmap Virtual Text Cursor and return ; Point HL at Terrain Interaction Data, or Attribute File address for Character Coordinates x=C, y=B ; ; The operand in the instruction at #R54157 is usually 88 (corresponding to a Attribute File lookup). It is only ; changed to 94 (corresponding to a Terrain Interaction Data lookup) by the routine at #R54162, and is returned to a ; value of 88 before that routine concludes. Input: B y-coordinate (chars) C x-coordinate (chars) Output: DE ; points to entry in data table with coordinates (C, 0) HL points to entry in data table with coordinates (C, B) c54148 LD A,B ; Load y-coordinate into A 54149 ADD A,A ; Multiply this by 8... 54150 ADD A,A ; ... 54151 ADD A,A ; ... 54152 LD L,A ; Copy 8 times y-coordinate into HL... 54153 LD H,0 ; ... 54155 ADD HL,HL ; Multiply by 4... 54156 ADD HL,HL ; ...to give 32 times original y-coordinate in HL ; The operand of the instruction at #R54157 determines whether we are dealing with the Attribute File (88), or the ; current Terrain Interaction Data (94). It is modified by the instructions at #R54164 and #R54172. 54157 LD D,88 ; Point DE at start of data, plus x-coordinate offset in C... 54159 LD E,C ; ... 54160 ADD HL,DE ; Add 32 times y-coordinate as offset in HL 54161 RET ; Return ; Point HL at Terrain Interaction Data for Character Coordinates x=C, y=B ; ; Used by the routines at #R27357, #R27508, #R27647, #R29174 and #R36104. Input: B y-coordinate (chars) C ; x-coordinate (chars) Output: HL points to entry in Terrain Interaction Data c54162 LD A,94 ; Set most significant byte in Terrain Interaction Data / Attribute File lookup routine to 94 ; (Terrain Interaction Table)... 54164 LD (54158),A ; ... 54167 CALL 54148 ; Point HL at Terrain Interaction Data for Character Coordinates x=C, y=B 54170 LD A,88 ; Set most significant byte in Terrain Interaction Data / Attribute File lookup routine to 88, ; (Attribute File)... 54172 LD (54158),A ; ... 54175 RET ; Return ; Advance Bitmap Virtual Text Cursor right by one character ; ; Used by the routines at #R36602 and #R54097. c54176 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor... 54179 INC HL ; ...and increase (for next character) 54180 LD A,L ; Load LSB of HL into A... 54181 OR A ; ...and check whether it is zero 54182 JR NZ,54188 ; If it is not zero (i.e. advancing down a character row will not take us into a different ; third of bitmap video memory) then skip ahead to 54188 54184 LD A,H ; Add 7 to MSB of video memory address... 54185 ADD A,7 ; ...as advancing by one at 54179 took video memory pointer back up to 2nd pixel row of the ; current third of the display... 54187 LD H,A ; ...when in fact we need to move to top pixel row of the NEXT third of the display (i.e. 7 x ; 32 x 8 = 7 x 256 bytes on from this!) ; This entry point is used by the routines at #R54132, #R54192, #R54283 and #R54333. *54188 LD (54110),HL ; Store the updated address of Bitmap Virtual Text Cursor 54191 RET ; Return ; Advance Bitmap Virtual Text Cursor to start of next character row ; ; Used by the routines at #R36602 and #R36731. c54192 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 54195 LD A,L ; Get LSB of video memory address in A 54196 ADD A,32 ; Add 32 (i.e. move down one character row) 54198 JP C,54206 ; If we have encountered the bottom of the current third of the display, then skip ahead to ; 54206 54201 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of a character row) 54203 LD L,A ; Place modified address back into HL 54204 JR 54188 ; Store at 54110 and return *54206 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of a character row) 54208 LD L,A ; Place modified address back into L 54209 LD A,H ; Load MSB of video memory address into A 54210 ADD A,8 ; Increase by 8 (as we're moving one text row, or EIGHT pixel rows down) 54212 LD H,A ; Place modified address back into HL 54213 JR 54188 ; Store at 54110 and return ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor ; ; Used by the routines at #R34762, #R36602, #R36731 and #R54097. c54215 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 54218 LD A,H ; Load H into A... 54219 AND 31 ; ...and cap at 31, to give screen third of interest (H=0-7, top third; H=8-15, middle third; ; H=16-23, bottom third) 54221 RRCA ; Divide by eight to get character row within the third... 54222 RRCA ; ... 54223 RRCA ; ... 54224 ADD A,88 ; Add 22,528 to HL to move into attribute section of video memory 54226 LD H,A ; L still contains offset of x characters, so points to start of attributes for area where room ; name was just printed 54227 LD (23498),HL ; Store memory location for later use 54230 RET ; Return ; Draw a Run of Characters (e.g. Edge of Frame of a Window) ; ; Used by the routines at #R27951, #R28172, #R35285, #R35627 and #R54505. Input: HL Repeat count for printing ; character (e.g. width of window in characters minus 1) c54231 LD A,H ; Check whether remaining window's width is zero... 54232 OR L ; ...and if it is... 54233 RET Z ; ...then return without doing anything ; The operand of the instruction at #R54234 represents the index of a character set character to draw. This is ; modified by the instructions at #R27976, #R28188, #R35031, #R35292, #R35637 and #R54537. 54234 LD A,0 ; Else, load A with the character index 54236 CALL 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 54239 DEC HL ; Decrease remaining width 54240 JR 54231 ; Loop back to #R54231 ; Advance HL to Byte After First Zero From Address in HL Onwards ; ; Used by the routine at #R30123. Input: HL Pointer to search starting point Output: HL Pointer to byte after ; first zero at or after HL input c54242 PUSH BC ; Store BC 54243 LD BC,65535 ; Set range to 65535 54246 XOR A ; Load A (value to search for) to zero 54247 CPIR ; Advance HL to byte after first zero found 54249 POP BC ; Restore BC 54250 RET ; Return ; Point HL at Start of B-th Entry in List of Read-Texts of Readable Objects ; ; Used by the routine at #R30968. Input: B Index of read-text required c54251 LD HL,40986 ; Point HL at start of List of Read-Texts of Readable Objects 54254 JR 54269 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL and return ; Point HL at Start of B-th Entry in List of "COMMAND A CHARACTER" Commands at 39626 ; ; Used by the routine at #R30686. c54256 LD HL,39626 ; Point HL at first of the "COMMAND A CHARACTER" commands (i.e. "GO TO SLEEP") 54259 JR 54269 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL and return ; Point HL at Start of B-th Entry in List of Starship Destination Names at 43031 ; ; Used by the routine at #R31688. Input: B Index of a location c54261 LD HL,43031 ; Point HL at start of Table of Starship Destination Names 54264 JR 54269 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL and return ; Point HL at B-th Entry in Table of Object Names ; ; Used by the routines at #R30145 and #R33952. Input: B Index of required text string HL (entry via #R54269) ; address of start of a table of zero-terminated strings Output: HL Points to string of index B (input) c54266 LD HL,42373 ; Point HL at start of Table of Object Names ; This entry point is used by the routines at #R28172, #R29756, #R30145, #R31041, #R31188, #R31688, #R32895, ; #R54251, #R54256 and #R54261. *54269 LD A,B ; Load string index into A 54270 OR A ; Return if index is zero... 54271 RET Z ; ... *54272 PUSH BC ; Store BC 54273 LD BC,65535 ; Load BC (loop counter) with 65535 54276 XOR A ; Set A to zero 54277 CPIR ; Advance HL to start of next zero-terminated string 54279 POP BC ; Store BC 54280 DJNZ 54272 ; Decrease B (remaining number of object names to skip over) and loop back to #R54272 54282 RET ; Return ; Print Text at DE (Command Summary) in Command Summary Window at Top of Screen ; ; Used by the routines at #R29330, #R29619, #R29756, #R30145, #R30686, #R31041, #R31688, #R32252, #R32895, #R33926 ; and #R54322. Input: DE Points to command text c54283 PUSH DE ; Store DE (Pointer to command text to print) 54284 LD A,70 ; Set ATTR T system variable to 70 (yellow INK, black PAPER, BRIGHT)... 54286 LD (23695),A ; ... 54289 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 54292 EX (SP),HL ; Swap registers so that HL points to text to be printed, and (SP) i.e. PUSHed value) contains ; Display File address to start printing character 54293 LD DE,(23703) ; Load DE with new Display File address to print character... 54297 LD (54110),DE ; ...and update Bitmap Virtual Text Cursor with this location 54301 PUSH HL ; Store HL (pointer to text to be printed) 54302 CALL 54377 ; Swap x- and y-coordinates of current window with those of Command Summary Window in temporary ; storage at #R23426 54305 POP HL ; Restore HL (pointer to text to be printed) 54306 CALL 34762 ; Print text to screen 54309 CALL 54377 ; Restore x- and y-coordinates of current window from temporary storage at #R23426 54312 LD HL,(54110) ; Load HL with new address in Bitmap Virtual Text Cursor (i.e. after text just printed)... 54315 LD (23703),HL ; ...and store back at #R23703 54318 POP HL ; Restore HL (Display File address to start printing character as swapped by instruction at ; #R54292) 54319 JP 54188 ; Store the updated address of Bitmap Virtual Text Cursor and return ; Print Command Summary Text (Text at DE, e.g. "COMMAND ") in Command Summary Window ; ; Used by the routines at #R33952 and #R34122. Input: DE Pointer to text to print c54322 LD A,D ; If DE is zero (i.e. no Command Summary Text)... 54323 OR E ; ... 54324 RET Z ; ...then return 54325 PUSH DE ; Store DE (Command Summary Text Pointer) 54326 CALL 54333 ; Print or update Command Summary Window at top of screen 54329 POP DE ; Restore DE (Command Summary Text Pointer)... 54330 JP 54283 ; ...and print in Command Summary Window at top of screen and return ; Print or Update Command Summary Window at Top of Screen ; ; Used by the routines at #R29330, #R29619, #R30145, #R31041, #R31688, #R32252, #R32895 and #R54322. The operand of ; the instruction at #R54333 represents the index of the window being drawn. This is modified by the instructions at ; #R35001 and #R54371. c54333 LD A,0 ; Load index of window being drawn into A 54335 PUSH AF ; Store AF (A = index of Current Window) 54336 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor... 54339 PUSH HL ; ...and store 54340 CALL 54377 ; Store x- and y-coordinates of current window temporarily at #R23426 54343 LD A,1 ; Draw Window 1 (Command Summary Window at top of screen)... 54345 HALT ; ...and wait for interrupt... 54346 CALL 34990 ; ... 54349 LD HL,38354 ; Point HL to ("COMMAND") text... 54352 CALL 34762 ; ...and print to screen 54355 LD HL,(54110) ; Load HL with address of Bitmap Virtual Text Cursor 54358 PUSH HL ; Store HL (address of Bitmap Virtual Text Cursor) 54359 CALL 27750 ; Print "KNIGHT-TYME" text at bottom of Command Summary Window 54362 POP HL ; Restore HL (address of Bitmap Virtual Text Cursor) 54363 LD (23703),HL ; Store this location as the location to print text to in the Command Summary Window 54366 CALL 54377 ; Restore x- and y-coordinates of current window from #R23426 54369 POP HL ; Restore HL (address of Bitmap Virtual Text Cursor) 54370 POP AF ; Restore AF (A = index of Current Window) 54371 LD (54334),A ; Restore index of Current Window to 54334 (was updated to 1 by call at #R54346) 54374 JP 54188 ; Store the updated address of Bitmap Virtual Text Cursor and return ; Swap x- and y-coordinates of current window / graphic with values in temporary storage (at 23426) ; ; This routine is used when there are two windows being updated (e.g. Command Summary Window at top of screen, and ; "EXAMINE" window). It is used to keep track of the dimensions of two windows simultaneously c54377 LD HL,(23426) ; Swap x- and y-coordinates of top-left of window / graphic currently at #R23493 with values in ; temporary store at #R23426... 54380 LD DE,(23493) ; ... 54384 LD (23426),DE ; ... 54388 LD (23493),HL ; ... 54391 LD HL,(23428) ; Swap x- and y-coordinates of bottom-right of window / graphic currently at #R23495 with ; values in temporary store at #R23428... 54394 LD DE,(23495) ; ... 54398 LD (23428),DE ; ... 54402 LD (23495),HL ; ... 54405 RET ; Return ; Draw a Graphic with Lookup Index A, Width of 2 and Height of 2 at Character Coordinates (C, B) ; ; Used by the routines at #R34627 and #R36104. Input: A Index of graphic to draw in graphic data lookup table at ; #R55950 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c54406 LD DE,514 ; Load D and E with 2 54409 JR 54414 ; Draw a Graphic with Lookup Index A at Character Coordinates (C, B) with width = 2 characters ; and height = 2 characters and return ; Draw a Graphic with Lookup Index A at Character Coordinates (C, B) ; ; Used by the routines at #R28390 and #R30145. Input: A Index of graphic to draw in graphic data lookup table at ; #R55950 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item D (entry at ; #R54414) Graphic height (characters) E (entry at #R54414) Graphic width (characters) c54411 LD DE,1026 ; Set D (height) to 4 and E to 2 (width) ; This entry point is used by the routines at #R30145, #R34990 and #R54406. *54414 PUSH HL ; Store HL 54415 PUSH DE ; Store DE 54416 PUSH AF ; Store AF 54417 LD A,C ; Load x-coordinate to draw item into instruction at #R54477... 54418 LD (54478),A ; ... 54421 LD A,B ; Multiply y-coordinate by 8... 54422 ADD A,A ; ... 54423 ADD A,A ; ... 54424 ADD A,A ; ... 54425 LD L,A ; ...and load into HL... 54426 LD H,0 ; ... 54428 ADD HL,HL ; Double again (so now 16 times y-coordinate, as 8 pixels in a character block, and two bytes ; per entry in data at #R26240) 54429 LD DE,26240 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 54432 ADD HL,DE ; Advance by 16 times y-coordinate to point HL at entry for start of item's current pixel row 54433 PUSH HL ; Transfer this value into IX... 54434 POP IX ; ... 54436 POP AF ; Restore A (graphic index of item to draw)... 54437 LD L,A ; ...and load into HL... 54438 LD H,0 ; ... 54440 ADD HL,HL ; Multiply by four (as there are two WORD entries for each graphic in the table at #R55950)... 54441 ADD HL,HL ; ... 54442 LD BC,55950 ; Point BC at start of Graphics Data Lookup Table at #R55950... 54445 ADD HL,BC ; ...and add offset to point to entry for item of interest 54446 LD E,(HL) ; Load graphic data address for this graphic into DE... 54447 INC HL ; ... 54448 LD D,(HL) ; ... 54449 INC HL ; ... 54450 CALL 55735 ; Load next value in table (address of graphic data for this object's mask) into HL 54453 POP BC ; Restore BC (B = height, C = width) 54454 LD A,B ; Load height into A... 54455 ADD A,A ; ...and multiply by eight... 54456 ADD A,A ; ... 54457 ADD A,A ; ... 54458 EX AF,AF' ; Swap A and A' 54459 LD B,C ; Copy graphic width into B... 54460 LD A,C ; ...and A'... 54461 LD (54481),A ; ...and modify instruction at #R54480 with this value also 54464 EX AF,AF' ; Swap A and A' 54465 EX DE,HL ; Swap DE (now pointer to object's mask graphic data) and HL (now pointer to object's graphic ; data) 54466 EXX ; Switch registers 54467 LD C,A ; Load C with eight times graphic's height *54468 PUSH BC ; Store BC (C = remaining number of pixel rows to draw, initially eight times graphic's height) 54469 LD L,(IX+0) ; Load HL' with Display File address of start of pixel row at object's y-coordinate... 54472 LD H,(IX+1) ; ... 54475 LD B,0 ; Set B' to zero ; The operand of the instruction at #R54477 represents the x-coordinate at which to draw the item. This is modified ; by the instruction at #R54418. 54477 LD C,0 ; Set C' to x-coordinate of item 54479 ADD HL,BC ; Add x-coordinate as offset to address of start of pixel row in HL' (HL' now points at Display ; File address to begin drawing) ; The operand of the instruction at #R54480 represents the width of the graphic to draw. This is modified by the ; instruction at #R54461. 54480 LD B,0 ; Load B with graphic width *54482 EXX ; Switch registers 54483 LD A,(DE) ; Load graphic data byte from graphic mask data into A 54484 EXX ; Switch registers 54485 AND (HL) ; Modify mask data by AND-ing with data already present in Display File (to allow scenery in ; background to show as set pixels are transparent) 54486 EXX ; Switch registers 54487 OR (HL) ; Modify modified mask data by OR-ing with object graphic data byte from graphic data 54488 INC HL ; Advance HL to next byte in object graphic data 54489 INC DE ; Advance DE to next byte in object graphic mask data 54490 EXX ; Switch registers 54491 LD (HL),A ; Load masked graphic data byte into Display File 54492 INC HL ; Advance HL to next byte in Display File 54493 DJNZ 54482 ; Loop back to #R54482 for next column of object graphic data 54495 INC IX ; Advance IX by two bytes to next address in Table of Addresses of Starts of Pixel Rows... 54497 INC IX ; ... 54499 POP BC ; Restore BC (C = remaining number of pixel rows to draw) 54500 DEC C ; Decrease remaining number pixel rows to draw 54501 JR NZ,54468 ; If not zero (i.e. still need to draw at least one more pixel row of graphic data) then loop ; back to #R54468 54503 POP HL ; Restore HL 54504 RET ; Return ; Update Currently Selected Input Device ; ; Used by the routines at #R26670 and #R26884. Input: A Index of currently selected input device D Index of ; previously selected input device (valid for call at #R26729 only) c54505 LD B,A ; Load B with index of currently selected input device... 54506 CP 1 ; ...and if this is 1 (Kempston Joystick)... 54508 CALL Z,54564 ; ...then if Kempston Joystick is not present, revert to previously selected input device 54511 LD A,B ; Load A with currently selected input device 54512 LD HL,53411 ; Point HL at start of Table of Start Addresses of Input Device Reading Routines 54515 CALL 55730 ; Load HL with A-th entry from table (i.e. the routine for the currently selected input ; device)... 54518 LD (54948),HL ; ...and update jump (at #R54947) in input reading routine to this address 54521 LD A,(54560) ; Load index of currently selected input device into A 54524 ADD A,211 ; Add 211 (index in Common Words Table for first "control method" string) 54526 LD (54562),A ; Store as text code at #R54561 54529 LD HL,18636 ; Load HL with Display File address corresponding to (12, 14) (characters)... 54532 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 54535 LD A,32 ; Set character to be repeated to 32 (SPACE)... 54537 LD (54235),A ; ... 54540 LD HL,20 ; Load HL with 20 as we need to draw across 20 character blocks 54543 CALL 54231 ; Draw run of 20 SPACE characters (i.e. clear old "CONTROL : ..." text) 54546 LD HL,18626 ; Load HL with Display File address corresponding to (2, 14) (characters)... 54549 LD (54110),HL ; ...and move Bitmap Virtual Text Cursor here 54552 LD HL,54561 ; Point HL at Current Control Text (Control Selection Screen) 54555 CALL 34733 ; Print text at location HL to screen using full screen width 54558 XOR A ; Set A to zero 54559 RET ; Return ; Index of Currently Selected Input Device b54560 DEFB 0 ; Current Control Text (on Control Selection Screen) b54561 DEFM 188,212,0 ; CONTROL : KEMPSTON JOYSTICK ; If Kempston Joystick is Not Present then Revert to Previously Selected Input Device ; ; Used by the routine at #R54505. Input: B Index of currently selected input device D Index of previously ; selected input device Output: B Index of currently selected input device if Kempston Joystick is present, ; otherwise index of previously selected input device c54564 IN A,(31) ; Load A with current Kempston Joystick state 54566 AND 224 ; If bits 5, 6 and 7 (i.e. unused bits) are reset, indicating presence of Kempston Joystick... 54568 RET Z ; ...then return 54569 LD A,D ; Load A with index of previously selected input device... 54570 LD (54560),A ; ...set as currently selected input device... 54573 LD B,A ; ...and load into B 54574 RET ; Return ; If Keypress Was Enqueued then Return Index of Last Key Pressed, Else Wait for Keypress and Return Index ; ; Used by the routines at #R31468 and #R54647. Output: A Index of key pressed The operand of the instruction at ; #R54575 represents an enqueued keypress. This is modified by the instructions at #R54593 and #R54656. c54575 LD A,0 ; Load A with enqueued key index... 54577 OR A ; ...and if not zero... 54578 JR NZ,54584 ; ...then skip ahead to #R54584 54580 XOR A ; Clear last pressed key... 54581 LD (23560),A ; ... *54584 HALT ; Wait for interrupt 54585 LD A,(23560) ; Load last pressed key into A... 54588 OR A ; ...and if this is zero (i.e. no key pressed)... 54589 JR Z,54584 ; ...then loop back to #R54584 54591 EX AF,AF' ; Switch AF and AF' 54592 XOR A ; Set enqueued key index to zero... 54593 LD (54576),A ; ... 54596 EX AF,AF' ; Switch AF and AF' 54597 RET ; Return ; Print Current Control Keys to Screen ; ; Used by the routines at #R26926 and #R54647. c54598 LD HL,54894 ; Point HL at list of current keyboard control characters 54601 LD BC,1541 ; Print LEFT key at (5, 6)... 54604 CALL 54631 ; ... 54607 LD BC,1554 ; Print RIGHT key at (18, 6)... 54610 CALL 54631 ; ... 54613 LD BC,2053 ; Print JUMP/UP key at (5, 8)... 54616 CALL 54631 ; ... 54619 LD BC,2066 ; Print DOWN key at (18, 8)... 54622 CALL 54631 ; ... 54625 LD BC,2565 ; Print MENU (FIRE) key at (5, 10)... 54628 JP 54631 ; ... (see trivia) *54631 PUSH HL ; Store HL (current position in list of current keyboard control characters) 54632 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 54635 POP HL ; Restore HL (current position in Current Keyboard Controls) 54636 LD A,(HL) ; Load current keyboard control character into A 54637 INC HL ; Advance HL by one byte to next keyboard control 54638 CP 32 ; If current keyboard control character is not 32 (SPACE)... 54640 JR NZ,54644 ; ...then skip ahead to #R54644 54642 LD A,127 ; Load A with 127 (index of "SP" graphic in character set) *54644 JP 54097 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor and return ; Redefine Keyboard Controls ; ; Used by the routine at #R26745. c54647 CALL 54598 ; Print current control keys to Screen 54650 CALL 54575 ; If keypress was enqueued then load A with index of last key pressed, otherwise wait for ; keypress and load A with index 54653 CP 13 ; If key pressed was 13 (ENTER)... 54655 RET Z ; ...then return 54656 LD (54576),A ; Set enqueued key index to index of key pressed 54659 LD B,5 ; Load B with 5 (as there are five controls) 54661 LD HL,54894 ; Point HL at start of list of current keyboard control characters *54664 LD (HL),0 ; Set current keyboard control character to zero 54666 INC HL ; Advance to next keyboard control character 54667 DJNZ 54664 ; Decrease B (remaining number of keyboard control characters to clear) and loop back to ; #R54664 if not zero 54669 LD BC,1280 ; Load B with 5 and C with zero 54672 LD HL,54894 ; Point HL at start of list of current keyboard control characters *54675 PUSH BC ; Store BC (B = remaining number of controls to define, C = number of controls defined) 54676 PUSH HL ; Store HL (current position in List of Keyboard Control Characters) 54677 LD A,C ; Load number of controls defined (0, 1, 2, 3 or 4) into A 54678 AND 6 ; Reset all but bits 1 and 2 (to give 0, 2 or 4) 54680 ADD A,6 ; Add 6 (to give 6, 8 or 10, the y-coordinates in characters of displayed keyboard controls)... 54682 LD B,A ; ...and load into B 54683 LD A,C ; Load A with number of controls defined (0, 1, 2, 3 or 4) 54684 AND 1 ; Reset all but bit 0 (to give 0 or 1) 54686 PUSH AF ; Store AF (A = bit 0 of number of controls defined) 54687 ADD A,A ; Double A (to give 0 or 2)... 54688 LD C,A ; ...and load into C 54689 POP AF ; Restore AF (A = bit 0 of number of controls defined) 54690 PUSH AF ; Store AF (A = bit 0 of number of controls defined) 54691 ADD A,C ; Add C to A (to give 0 or 3) 54692 ADD A,A ; Multiply A by four... 54693 ADD A,A ; ...to give 0 or 12... 54694 LD C,A ; ...and load into C 54695 POP AF ; Restore AF (A = bit 0 of number of controls defined) 54696 ADD A,C ; Add value in C to A (to give 0 or 13) 54697 ADD A,5 ; Add 5 (to give 5 or 18, the x-coordinates in characters of displayed keyboard controls)... 54699 LD C,A ; ...and load into C 54700 PUSH BC ; Store BC (coordinates in characters of current control being defined) 54701 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B)... 54704 LD A,(HL) ; ...and set the FLASH Flag for this address... 54705 OR 128 ; ... 54707 LD (HL),A ; ... *54708 POP BC ; Restore BC (coordinates in characters of current control being defined) 54709 PUSH BC ; Store BC (coordinates in characters of current control being defined) 54710 CALL 54132 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 54713 CALL 54575 ; If keypress was enqueued then load A with index of last key pressed, otherwise wait for ; keypress and load A with index 54716 CP 32 ; If key pressed was SPACE... 54718 JP Z,54744 ; ...then skip ahead to #R54744 54721 CP 48 ; If index of key pressed is less than 48 (i.e. below "0")... 54723 JP M,54708 ; ...then jump back to #R54708 (i.e. wait for next key press and try again) 54726 CP 91 ; If index of key pressed is 91 or higher (i.e. above "Z")... 54728 JP P,54708 ; ...then jump back to #R54708 (i.e. wait for next key press and try again) 54731 CP 58 ; If index of key pressed is less than 58 (i.e. "9" or below)... 54733 JP M,54744 ; ...then skip ahead to #R54744 54736 CP 65 ; If index of key pressed is 65 or higher (i.e. "A" or above)... 54738 JP P,54744 ; ...then skip ahead to #R54744 54741 JP 54708 ; Jump back to #R54708 (i.e. wait for next key press and try again) *54744 CALL 54876 ; Set Zero Flag if key pressed is already assigned to a control, otherwise reset 54747 JP Z,54708 ; If key pressed is already assigned then jump back to #R54708 (i.e. wait for next key press ; and try again) 54750 LD (23398),A ; Store pressed key index at #R23398 54753 CP 32 ; If key was not SPACE... 54755 JR NZ,54759 ; ...then skip ahead to #R54759 54757 LD A,127 ; Load A with 127 (index in character set of "SP" UDG at #R65516) *54759 CALL 54097 ; Print text character in A and advance Bitmap Virtual Text Cursor 54762 POP BC ; Restore BC (coordinates in characters of current control being defined) 54763 CALL 54148 ; Load HL with Attribute File address for coordinates (C, B)... 54766 LD A,(HL) ; ...and reset the FLASH Flag for this address... 54767 AND 127 ; ... 54769 LD (HL),A ; ... 54770 POP HL ; Restore HL (current position in List of Keyboard Control Characters) 54771 LD A,(23398) ; Load A with index of previously defined key... 54774 LD (HL),A ; ...and store in List of Keyboard Control Characters 54775 INC HL ; Advance HL to next entry in List of Keyboard Control Characters 54776 POP BC ; Restore BC (B = remaining number of controls to define, C = number of controls defined) 54777 INC C ; Increase C (number of controls defined) 54778 DJNZ 54675 ; Decrease B (remaining number of controls to define) and loop back to #R54675 if not zero 54780 LD B,5 ; Load B with 5 (as each keyboard half-row holds five keys) 54782 LD HL,54953 ; Load HL with address of operand of instruction at #R54952 (MSB of "input address" for ; keyboard half-row reading for LEFT)... 54785 LD (23398),HL ; ...and store at #R23398 54788 LD HL,54894 ; Point HL at start of list of current keyboard control characters *54791 PUSH BC ; Store BC (B = remaining number of control keys to check) 54792 PUSH HL ; Store HL (pointer to current position in list of current keyboard control characters) 54793 LD IX,54902 ; Point IX at Lists of Characters on Each Keyboard Half-Row 54797 LD A,(HL) ; Load A with current keyboard control character index 54798 LD C,0 ; Set C (index in list of half-rows) to zero *54800 CP (IX+0) ; If current keyboard control character index is the same as the current character in keyboard ; half-row groups... 54803 JR Z,54810 ; ...then skip ahead to #R54810 54805 INC C ; Increase C (index in list of half-rows) 54806 INC IX ; Advance to next entry in list of half-rows 54808 JR 54800 ; Loop back to #R54800 *54810 LD A,C ; Load A with index of current control key in list of half-rows ; At this point we know the index of the current key in the list of half-rows. We now need to identify which half ; row it belongs to. 54811 LD B,0 ; Set B (keyboard half-row index) to zero *54813 SUB 5 ; If index of key in current half-row is less than 5 (i.e. key is in the current half-row)... 54815 JP M,54821 ; ...then skip ahead to #R54821 54818 INC B ; Increase B (keyboard half-row index) 54819 JR 54813 ; Loop back to #R54813 ; The MSB in the "input address" for the various keyboard half-rows obeys the progression (254, 253, 251, 247, 239, ; 223, 191, 127). *54821 LD A,B ; Load A with index of keyboard half-row containing current key 54822 PUSH BC ; Store BC (B = index of keyboard half-row, C = index of key in list of half-rows) 54823 INC B ; Increase B 54824 LD HL,128 ; Load HL with 128 *54827 ADD HL,HL ; Double value in HL 54828 DJNZ 54827 ; Decrease B (index of keyboard half-row) and loop back to #R54827 if not zero ; HL now contains the value (128 * 2^n) where n is the (1-based) index of the relevant half-row. H contains (2^m), ; where m is the (zero-based) index of the relevant half-row. 54830 LD A,255 ; Load A with 255 54832 SUB H ; Subtract H (2^m) to give MSB of input address for relevant half-row 54833 LD HL,(23398) ; Load HL with address of operand of instruction to modify (#R54952)... 54836 LD (HL),A ; ...and set operand to value in A ; Next we need to modify the second part of the opcode for the instruction that checks the set bit in A to determine ; which key in the half-row was pressed. The range of opcode values are: ; #TABLE(default,centre,:w) ; { =h Opcode Value | =h Instruction } ; { 71 | BIT 0,A } ; { 79 | BIT 1,A } ; { 87 | BIT 2,A } ; { 95 | BIT 3,A } ; { 103 | BIT 4,A } ; TABLE# 54837 INC HL ; Advance HL by four bytes to operand of instruction at #R54956... 54838 INC HL ; ... 54839 INC HL ; ... 54840 INC HL ; ... 54841 LD (23398),HL ; ...and store at #R23398 54844 POP BC ; Restore BC (B = index of keyboard half-row, C = index of key in list of half-rows) 54845 LD A,B ; Load B with five times index of keyboard half-row (value currently in B)... 54846 ADD A,A ; ... 54847 ADD A,A ; ... 54848 ADD A,B ; ... 54849 LD B,A ; ... (B is now 0, 5, 10, 15, 20, 25, 30 or 35) 54850 LD A,C ; Load A with index of key in list of half-rows... 54851 SUB B ; ...and subtract B (5 times index of half-row) to give index of key within current half-row 54852 ADD A,A ; Multiply this index by 8 (opcode interval between successive "BIT n,A" and "BIT n+1,A" ; instructions)... 54853 ADD A,A ; ... 54854 ADD A,A ; ... 54855 ADD A,71 ; ...and add 71 (opcode for "BIT 0,A") 54857 LD HL,(23398) ; Load HL with address of operand / opcode for "BIT n,A" instruction... 54860 LD (HL),A ; ...and set "n" accordingly 54861 LD BC,5 ; Advance HL by five bytes to operand of next "LD B,x" instruction (i.e. MSB of "input address" ; for next control)... 54864 ADD HL,BC ; ... 54865 LD (23398),HL ; ...and store at #R23398 54868 POP HL ; Restore HL (pointer to current position in list of current keyboard control characters, ; PUSHed at #R54792) 54869 INC HL ; Advance HL to next keyboard control character 54870 POP BC ; Store BC (B = remaining number of control keys to check, PUSHed at #R54791) 54871 DJNZ 54791 ; Decrease B (remaining number of control keys to check) and loop back to #R54791 for next ; control key if not zero 54873 JP 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed and return ; Set Zero Flag if Key Pressed is Already Assigned to a Control, Otherwise Reset ; ; Used by the routine at #R54647. Input: A Index of key pressed Output: F Zero Flag set if pressed key is already ; assigned, otherwise reset c54876 PUSH BC ; Store BC 54877 PUSH HL ; Store HL 54878 LD HL,54894 ; Point HL at start of list of current keyboard control characters 54881 LD B,5 ; Load B with 5 (as there are five controls to process) *54883 CP (HL) ; If key pressed is the same as current control key index... 54884 JR Z,54891 ; ...then skip ahead to #R54891 54886 INC HL ; Advance HL to next entry in list of current keyboard control characters 54887 DJNZ 54883 ; Decrease B (remaining number of control characters to process) and loop back to #R54883 if ; not zero 54889 CP 0 ; Reset Zero Flag *54891 POP HL ; Restore HL 54892 POP BC ; Restore BC 54893 RET ; Return ; Current Keyboard Controls b54894 DEFB 78 ; Left 54895 DEFB 77 ; Right 54896 DEFB 65 ; Jump / Up 54897 DEFB 90 ; Down 54898 DEFB 32 ; Menu (Fire) 54899 DEFB 32,32,32 ; Unused ; Lists of Characters on Each Keyboard Half-Row b54902 DEFM 45,"ZXCV" ; (00) - IN 65278 (B = 254, C = 254) 54907 DEFM "ASDFG" ; (01) - IN 65022 (B = 253, C = 254) 54912 DEFM "QWERT" ; (02) - IN 64510 (B = 251, C = 254) 54917 DEFM "12345" ; (03) - IN 63486 (B = 247, C = 254) 54922 DEFM "09876" ; (04) - IN 61438 (B = 239, C = 254) 54927 DEFM "POIUY" ; (05) - IN 57342 (B = 223, C = 254) 54932 DEFM 45,"LKJH" ; (06) - IN 49150 (B = 191, C = 254) 54937 DEFM " ",45,"MNB" ; (07) - IN 32766 (B = 127, C = 254) ; Capture Keyboard Input, or Jump to Joystick Reading Routine, Loading Result into A ; ; Used by the routines at #R27136, #R32694, #R35296, #R35386, #R55138 and #R55768. Output: A Stored keypress (bits: ; 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c54942 LD HL,23487 ; Point HL at input control flags and reset all 54945 LD (HL),0 ; ... ; The operand of the instruction at #R54947 represents the start address of the input reading routine for the ; currently selected input device. This is modified by the instruction at #R54518. 54947 JP 54950 ; Jump to appropriate keyboard / joystick reading routine ; Capture Keyboard Input ; ; Used by the routine at #R54942. Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c54950 LD C,254 ; Load C with 254 (as all keyboard half-row "input addresses" have C = 254) ; The operand of the instruction at #R54952 represents the MSB of the "input address" to use in reading the keyboard ; for the currently defined LEFT key. This is modified by the routine at #R54647. 54952 LD B,127 ; Load B with MSB of "input address" 54954 IN A,(C) ; Read keyboard ; The operand of the instruction at #R54956 represents the index of the bit to use in reading the keyboard. It is ; modified by the routine at #R54647. 54956 BIT 3,A ; "N" key pressed so... 54958 CALL Z,55100 ; ...store a LEFT input from control device 54961 LD B,127 ; Load B with MSB of "input address" 54963 IN A,(C) ; Read keyboard 54965 BIT 2,A ; "M" key pressed so... 54967 CALL Z,55103 ; ...store a RIGHT input from control device 54970 LD B,253 ; IN 65022 reads the half row A to G... 54972 IN A,(C) ; Read keyboard 54974 BIT 0,A ; "A" key pressed so... 54976 CALL Z,55106 ; ...store an UP input from control device 54979 LD B,254 ; IN 65278 reads the half row CAPS SHIFT to V 54981 IN A,(C) ; Read keyboard 54983 BIT 1,A ; "Z" key pressed so... 54985 CALL Z,55109 ; ...store a DOWN input from control device 54988 LD B,127 ; IN 32766 reads the half row SPACE to B 54990 IN A,(C) ; Read keyboard 54992 BIT 0,A ; SPACE bar pressed so... 54994 CALL Z,55112 ; ...store a FIRE input from control device 54997 LD A,(HL) ; Load stored input into A 54998 RET ; Return ; Capture Kempston Joystick Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c54999 LD C,31 ; Load 31 (Kempston port number) into A 55001 IN A,(C) ; Read byte from port 31 (i.e. read state of joystick) 55003 BIT 0,A ; If joystick moved right... 55005 CALL NZ,55103 ; ...store a RIGHT input from control device 55008 BIT 1,A ; If joystick moved left... 55010 CALL NZ,55100 ; ...store a LEFT input from control device 55013 BIT 2,A ; If joystick moved down... 55015 CALL NZ,55109 ; ...store a DOWN input from control device 55018 BIT 3,A ; If joystick moved up... 55020 CALL NZ,55106 ; ...store an UP input from control device 55023 BIT 4,A ; If fire button pressed... 55025 CALL NZ,55112 ; ...store a FIRE input from control device 55028 LD A,(HL) ; Return stored joystick movement in A 55029 RET ; Return ; Capture Cursor Joystick Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c55030 LD C,254 ; IN 63486 reads the half row 1 to 5 55032 LD B,247 ; ... 55034 IN A,(C) ; Read keyboard/joystick 55036 BIT 4,A ; If joystick moved left ("5" key pressed)... 55038 CALL Z,55100 ; ...store a LEFT input from control device 55041 LD B,239 ; IN 61438 reads the half row O to 6 55043 IN A,(C) ; Read keyboard/joystick 55045 BIT 2,A ; If joystick moved right ("8" key pressed)... 55047 CALL Z,55103 ; ...store a RIGHT input from control device 55050 BIT 4,A ; If joystick moved down ("6" key pressed)... 55052 CALL Z,55109 ; ...store a DOWN input from control device 55055 BIT 3,A ; If joystick moved up ("7" key pressed)... 55057 CALL Z,55106 ; ...store an UP input from control device 55060 BIT 0,A ; If fire button pressed ("0" key pressed)... 55062 CALL Z,55112 ; ...store a FIRE input from control device 55065 LD A,(HL) ; Return stored joystick movement in A 55066 RET ; Return ; Capture Sinclair Joystick 1 Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c55067 LD C,254 ; IN 61438 reads the half row O to 6 55069 LD B,239 ; ... 55071 IN A,(C) ; ... 55073 BIT 4,A ; If joystick moved left ("6" key pressed)... 55075 CALL Z,55100 ; ...store a LEFT input from control device 55078 BIT 3,A ; If joystick moved right ("7" key pressed)... 55080 CALL Z,55103 ; ...store a RIGHT input from control device 55083 BIT 2,A ; If joystick moved down ("8" key pressed)... 55085 CALL Z,55109 ; ...store a DOWN input from control device 55088 BIT 1,A ; If joystick moved down ("9" key pressed)... 55090 CALL Z,55106 ; ...store an UP input from control device 55093 BIT 0,A ; If fire button pressed ("0" key pressed)... 55095 CALL Z,55112 ; ...store a FIRE input from control device 55098 LD A,(HL) ; Return stored joystick movement in A 55099 RET ; Return ; Store a LEFT Input from Control Device ; ; Used by the routines at #R54950, #R54999, #R55030 and #R55067. Input: HL Pointer to Input Control Flags (#R23487) c55100 SET 0,(HL) ; Set Left Pressed Flag 55102 RET ; Return ; Store a RIGHT Input from Control Device ; ; Used by the routines at #R54950, #R54999, #R55030 and #R55067. Input: HL Pointer to Input Control Flags (#R23487) c55103 SET 1,(HL) ; Set Right Pressed Flag 55105 RET ; Return ; Store an UP Input from Control Device ; ; Used by the routines at #R54950, #R54999, #R55030 and #R55067. Input: HL Pointer to Input Control Flags (#R23487) c55106 SET 2,(HL) ; Set Up Pressed Flag 55108 RET ; Return ; Store a DOWN Input from Control Device ; ; Used by the routines at #R54950, #R54999, #R55030 and #R55067. Input: HL Pointer to Input Control Flags (#R23487) c55109 SET 3,(HL) ; Set Down Pressed Flag 55111 RET ; Return ; Store a FIRE Input from Control Device ; ; Used by the routines at #R54950, #R54999, #R55030 and #R55067. Input: HL Pointer to Input Control Flags (#R23487) c55112 SET 4,(HL) ; Set Fire Pressed Flag 55114 RET ; Return ; Display Execute / Reject Command Window and Return if Execute Chosen, Else Exit to Main Game Loop ; ; Used by the routines at #R29330, #R29488, #R29619, #R29756, #R30145, #R30686, #R30968, #R31041, #R31257, #R31537, ; #R31688, #R32252 and #R32895. c55115 CALL 35739 ; Play Hiss-Type Sound 55118 LD A,11 ; Draw "EXECUTE / REJECT COMMAND" Window... 55120 CALL 34982 ; ... 55123 LD HL,38329 ; Point to "EXECUTE COMMAND..." text... 55126 CALL 34762 ; ...and print to screen 55129 CALL 35296 ; Process keyboard / joystick input on a menu and load A with selected item index... 55132 OR A ; ...and if this is 0 (i.e. Execute Command)... 55133 RET Z ; ...then return 55134 POP HL ; Remove return address from stack 55135 JP 29482 ; Set Magic Knight's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed ; ; Used by the routines at #R26745, #R26855, #R26926, #R27762, #R28506, #R28554, #R29330, #R32252, #R33338, #R33834, ; #R34122, #R34265, #R54647, #R55364 and #R55685. c55138 CALL 35739 ; Play Hiss-Type Sound 55141 LD A,14 ; Draw Window 14 ("PRESS FIRE TO CONTINUE")... 55143 CALL 34990 ; ... 55146 LD HL,38309 ; Point HL at "PRESS FIRE TO CONTINUE" text string... 55149 CALL 34762 ; ...and print to screen *55152 CALL 54942 ; Capture keyboard or joystick input loading result into A 55155 BIT 4,A ; If bit 4 (Fire Button Flag) is not set... 55157 JR Z,55152 ; ...then loop back to #R55152 55159 CALL 35386 ; Wait for Fire Button / Key to be Released 55162 JP 35690 ; Play upward scale sound and return ; Display "YOUR HANDS ARE FULL" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R29330, #R29619 and #R31537. c55165 LD HL,38868 ; Point HL at "YOUR HANDS ARE FULL" text 55168 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU ARE WEARING TOO MUCH" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R31537. Input: HL (Entry at #R55173 only) Text to print in window c55170 LD HL,41860 ; Point HL at "YOU ARE WEARING TOO MUCH" text ; This entry point is used by the routines at #R33100, #R33140, #R33290, #R33304, #R33318, #R33332, #R33448, ; #R33462, #R33468, #R55165, #R55177, #R55182, #R55187, #R55192, #R55197, #R55202, #R55207, #R55212, #R55217 and ; #R55222. *55173 CALL 55364 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Data block at 55176 b55176 DEFB 13 ; ... ; Display "THE [object] IS TOO HEAVY FOR YOU" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R29330 and #R29619. c55177 LD HL,38882 ; Point HL at "THE [name of current object] IS TOO HEAVY FOR YOU" text 55180 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT WEAR THAT" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R31537. c55182 LD HL,41876 ; Point HL at "YOU CANNOT WEAR THAT" text 55185 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "THERE IS NOTHING NEAR ENOUGH" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29330. c55187 LD HL,38850 ; Point HL at "THERE IS NOTHING NEAR ENOUGH" text 55190 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "THERE IS NOTHING IN THIS ROOM" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29330. c55192 LD HL,38836 ; Point HL at "THERE IS NOTHING IN THIS ROOM" text 55195 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT DROP THE [object]" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29488. c55197 LD HL,38921 ; Point HL at "YOU CANNOT DROP THE [name of current object]" text 55200 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character]'S HANDS ARE EMPTY" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29619. c55202 LD HL,39030 ; Point HL at "[Name of Current Character]'S HANDS ARE EMPTY" text 55205 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] WANTS TO KEEP THE [Object]" Window (13), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R29619. c55207 LD HL,39046 ; Point HL at "[Name of Current Character] WANTS TO KEEP THE [name of Current Object]" text 55210 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character]'S HANDS ARE FULL" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29756. c55212 LD HL,39085 ; Point HL at "[Name of Current Character]'S HANDS ARE FULL" text 55215 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS NOT STRONG ENOUGH" Window (13), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29756. c55217 LD HL,39100 ; Point HL at "[Name of Current Character] IS NOT STRONG ENOUGH" text 55220 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] DOES NOT WANT THE [Object]" Window (13), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R29756. c55222 LD HL,39120 ; Point HL at "[Name of Current Character] DOES NOT WANT THE [name of Current Object]" text 55225 JR 55173 ; Display Window 13 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS ALREADY ASLEEP" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30810. c55227 LD HL,39827 ; Point HL at "[Name of Current Character] IS ALREADY ASLEEP" text 55230 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS TOO WAKEFUL TO SLEEP" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30810. c55232 LD HL,39838 ; Point HL at "[Name of Current Character] IS TOO WAKEFUL TO SLEEP" text 55235 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] DOES NOT WANT TO BE COMMANDED BY YOU" Window (29), Wait for Fire to be Pressed then Jump to ; Main Game Loop ; ; Used by the routine at #R33558. c55237 LD HL,39798 ; Point HL at "[Name of Current Character] DOES NOT WANT TO BE COMMANDED BY YOU" text 55240 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS ALREADY AWAKE" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30842. c55242 LD HL,39877 ; Point HL at "[Name of Current Character] IS ALREADY AWAKE" text 55245 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS TOO TIRED TO WAKE UP" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30842. c55247 LD HL,39892 ; Point HL at "[Name of Current Character] IS TOO TIRED TO WAKE UP" text 55250 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] CANNOT HELP YOU" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R30874, #R33100, #R33140, #R33170, #R33290, #R33304, #R33318, #R33338 and #R33448. c55252 LD HL,42166 ; Point HL at "[Name of Current Character] CANNOT HELP YOU " text 55255 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] IS TOO TIRED TO HELP YOU" Window (29), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R30874. c55257 LD HL,39928 ; Point HL at "[Name of Current Character] IS TOO TIRED TO HELP YOU" text 55260 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "THERE ARE NO BARRIERS TO BE REMOVED HERE." Window (29), Wait for Fire to be Pressed then Jump to Main ; Game Loop ; ; Used by the routine at #R31122. c55262 LD HL,46531 ; Point HL at "THERE ARE NO BARRIERS TO BE REMOVED HERE." text 55265 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT EXAMINE THE USS PISCES IF..." Window (29), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R30145. c55267 LD HL,39526 ; Point HL at "YOU CANNOT EXAMINE THE USS PISCES IF..." text 55270 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU HAVE ARRIVED AT X.Y.Z." Window (17), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R32252. c55272 LD HL,42171 ; Point HL at "YOU HAVE ARRIVED AT X.Y.Z." text 55275 JR 55287 ; Display Window 17 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Display "THE STARSHIP HAS ARRIVED AT [Starship Location]" Window (12), Wait for Fire to be Pressed then Jump to ; Main Game Loop ; ; Used by the routine at #R31688. c55277 LD HL,41909 ; Point HL at "THE STARSHIP HAS ARRIVED AT [name of Current Starship Location]" text 55280 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "THERE IS NO WRITING FOR ME TO READ" Window (12), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30968. c55282 LD HL,40962 ; Point HL at "THERE IS NO WRITING FOR ME TO READ" text... 55285 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display Window 17 with Text at HL, Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R55272. Input: HL Text to print in window c55287 CALL 55364 ; Display Window 17 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Data block at 55290 b55290 DEFB 17 ; ... ; Display "GORDON AND SARAB ARE BOTH ASLEEP" Window (12), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R31688 and #R32895. Input: HL (Entry at #R55294 only) Text to print in window c55291 LD HL,42348 ; Point HL at "GORDON AND SARAB ARE BOTH ASLEEP" text ; This entry point is used by the routines at #R55277, #R55282, #R55298, #R55303, #R55312, #R55317, #R55322 and ; #R55327. *55294 CALL 55364 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Data block at 55297 b55297 DEFB 12 ; ... ; Display "THERE IS NOBODY WITHIN SUB-SPACE COMMUNICATOR RANGE" Window (12), Wait for Fire to be Pressed then Jump ; to Main Game Loop ; ; Used by the routine at #R32895. c55298 LD HL,42310 ; Point HL at "THERE IS NOBODY WITHIN SUB-SPACE COMMUNICATOR RANGE" text 55301 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] HEARS A VOICE AND IGNORES IT" Window (12), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R30686. c55303 LD HL,39646 ; Point HL at "[Name of Current Character] HEARS A VOICE AND IGNORES IT" text 55306 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display Window 29 with Text at HL, Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R55227, #R55232, #R55237, #R55242, #R55247, #R55252, #R55257, #R55262, #R55267, #R55344, ; #R55349, #R55354 and #R55359. Input: HL Text to print in window c55308 CALL 55364 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Data block at 55311 b55311 DEFB 29 ; ... ; Display "[Character] DOES NOT RECOGNISE YOUR AUTHORITY" Window (12), Wait for Fire to be Pressed then Jump to Main ; Game Loop ; ; Used by the routine at #R30686. c55312 LD HL,39674 ; Point HL at "[Name of Current Character] DOES NOT RECOGNISE YOUR AUTHORITY" text 55315 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] DOES NOT LIKE STARFLEET SO HE IGNORES YOU" Window (12), Wait for Fire to be Pressed then Jump ; to Main Game Loop ; ; Used by the routine at #R30686. c55317 LD HL,39708 ; Point HL at "[Name of Current Character] DOES NOT LIKE STARFLEET SO HE IGNORES YOU " text 55320 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] HEARS A MUFFLED VOICE..." Window (12), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R30686. c55322 LD HL,39741 ; Point HL at "[Name of Current Character] HEARS A MUFFLED VOICE..." text 55325 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "GORDON AND SARAB CANNOT UNDERSTAND YOU" Window (12), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routines at #R31688 and #R32895. c55327 LD HL,42358 ; Point HL at "GORDON AND SARAB CANNOT UNDERSTAND YOU" text 55330 JR 55294 ; Display Window 12 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT CAST THAT SPELL NOW..." Window (10), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routines at #R31122, #R31188 and #R31312. Input: HL (Entry at #R55335 only) Text to print in window c55332 LD HL,41750 ; Point HL at "YOU CANNOT CAST THAT SPELL NOW..." text ; This entry point is used by the routine at #R55339. *55335 CALL 55364 ; Display Window 10 with text at HL, wait for fire to be pressed then jump to Main Game Loop... ; Data block at 55338 b55338 DEFB 10 ; ... ; Display "[Character] HAS TAKEN YOUR PHOTO" Window (10), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R33170. c55339 LD HL,40307 ; Point HL at "[Name of Current Character] HAS TAKEN YOUR PHOTO" text 55342 JR 55335 ; Display Window 10 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "THE BARRIER HAS FADED INTO NOTHINGNESS" Window (29), Wait for Fire to be Pressed then Jump to Main Game ; Loop ; ; Used by the routine at #R31122. c55344 LD HL,46566 ; Point HL at "THE BARRIER HAS FADED INTO NOTHINGNESS" text 55347 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT DROP THE [Object] HERE" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R29488. c55349 LD HL,38931 ; Point HL at "YOU CANNOT DROP THE [name of current object] HERE " text 55352 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] HAS GONE TO SLEEP" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30810. c55354 LD HL,39861 ; Point HL at "[Name of Current Character] HAS GONE TO SLEEP" text 55357 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display "[Character] HAS WOKEN UP" Window (29), Wait for Fire to be Pressed then Jump to Main Game Loop ; ; Used by the routine at #R30842. c55359 LD HL,39915 ; Point HL at "[Name of Current Character] HAS WOKEN UP" text 55362 JR 55308 ; Display Window 29 with text at HL, wait for fire to be pressed then jump to Main Game Loop ; Display an Information Window with Text at HL, Wait for Fire to be Pressed then Jump to Main Game Loop ; ; This routine is CALLed by the instructions at #R31025, #R55173, #R55287, #R55294, #R55308 and #R55335. Immediately ; after each of these calls is a byte of data representing the index of the window to draw. This data is read in ; this routine by loading the RETurn address (where the data is held) into DE and then performing a LD A,(DE). ; Input: HL Points to text to print in the window c55364 POP DE ; Remove value on top of stack, as we are not RETurning to this address, but reading data from ; it 55365 LD A,(DE) ; Load A with window index data... 55366 LD (55387),A ; ...and modify instruction at #R55386 with this index 55369 PUSH HL ; Store HL (pointer to text to print) 55370 LD L,A ; Load eight times window index into HL... 55371 LD H,0 ; ... 55373 ADD HL,HL ; ... 55374 ADD HL,HL ; ... 55375 ADD HL,HL ; ... 55376 LD DE,37091 ; Point DE at y-coordinate of top of window in first entry of Window Data table at #R37089... 55379 ADD HL,DE ; ...and add HL as offset in HL 55380 EX DE,HL ; Swap DE (now points to y-coordinate of top of required window) and HL (now points to first ; entry in Window Data table) 55381 POP HL ; Restore HL (pointer to text to print) 55382 CALL 33774 ; Adjust height of window to accommodate text 55385 PUSH HL ; Store HL (pointer to start of text data) ; The operand of the instruction at #R55386 represents a window index. This is modified by the instruction at ; #R55366. 55386 LD A,0 ; Draw window with index specified in data previously... 55388 CALL 34990 ; ... 55391 POP HL ; Restore HL (pointer to start of text data) 55392 CALL 34762 ; Print text to screen 55395 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and wait for fire to be pressed 55398 JP 29482 ; Set Magic Knight's available action flags, validate I.D. Card if appropriate and jump to ; start of Main Game Loop ; Scroll a Region of the Display File Up a Pixel Row Without Wrapping ; ; Used by the routines at #R32124 and #R35397. c55401 LD HL,55407 ; Load HL with address of routine at #R55407 (return) 55404 JP 55470 ; Jump to #R55470 (scroll a region of the Display File up a pixel row then return) ; Do Nothing (Return) ; ; Used by the routines at #R55470 and #R55559. c55407 RET ; Return ; Scroll a Region of the Display File Up a Pixel Row With Wrapping ; ; Used by the routine at #R32694. c55408 LD HL,55414 ; Load HL with address of routine at #R55414 (restore copied bitmap data from top of region to ; scroll to bottom of region to scroll) 55411 JP 55470 ; Jump to #R55470 (scroll a region of the Display File up a pixel row then return) ; Restore Copied Bitmap Data from Top of Region to Scroll to Bottom of Region to Scroll ; ; (See trivia) Input: B Width of region to scroll (characters) HL Points to bottom pixel row (left-most ; character) of region to scroll c55414 LD DE,23296 ; Point DE at copied bitmap data at #R23296 55417 EX DE,HL ; Swap DE (now points to bottom pixel row in region to scroll) and HL (now points to copied ; bitmap data at #R23296) 55418 LDIR ; Copy previously stored bitmap data into bottom pixel row of region to scroll 55420 RET ; Return ; Unused routine ; ; See trivia and functionally identical routine at #R55455. c55421 LD A,255 ; 55423 XOR (HL) ; 55424 LD (HL),A ; 55425 INC HL ; 55426 DJNZ 55421 ; 55428 POP HL ; 55429 LD DE,23296 ; 55432 EX DE,HL ; 55433 LDIR ; 55435 RET ; ; Scroll a Region of the Display File Down a Pixel Row Without Wrapping ; ; Used by the routines at #R32065 and #R35459. c55436 LD HL,55407 ; Load HL with address of routine at #R55407 (return) 55439 JP 55559 ; Jump to #R55559 (scroll a region of the Display File down a pixel row then return) ; Scroll a Region of the Display File Down a Pixel Row With Wrapping ; ; Used by the routine at #R32694. c55442 LD HL,55448 ; Load HL with address of routine at #R55448 (restore copied bitmap data from bottom of region ; to scroll to top of region to scroll) 55445 JP 55559 ; Jump to #R55559 (scroll a region of the Display File down a pixel row then return) ; Restore Copied Bitmap Data from Bottom of Region to Scroll to Top of Region to Scroll ; ; (See trivia) Input: B Width of region to scroll (characters) HL Points to top pixel row (left-most character) ; of region to scroll c55448 LD DE,23296 ; Point DE at copied bitmap data at #R23296 55451 EX DE,HL ; Swap DE (now points to bottom pixel row in region to scroll) and HL (now points to copied ; bitmap data at #R23296) 55452 LDIR ; Copy previously stored bitmap data into bottom pixel row of region to scroll 55454 RET ; Return ; Unused routine ; ; See trivia and functionally identical routine at #R55421. c55455 LD A,255 ; 55457 XOR (HL) ; 55458 LD (HL),A ; 55459 INC HL ; 55460 DJNZ 55455 ; 55462 POP HL ; 55463 LD DE,23296 ; 55466 EX DE,HL ; 55467 LDIR ; 55469 RET ; ; Scroll a Region of the Display File Up a Pixel Row ; ; Used by the routines at #R55401 and #R55408. Input: HL Address to jump to at the end of this routine ; (instruction at #R55556) c55470 LD (55557),HL ; Modify jump (at #R55556) destination to address stored in HL 55473 LD A,(23491) ; Load y-coordinate of top of region to scroll (pixels) into C... 55476 LD C,A ; ... 55477 LD DE,26240 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 55480 LD H,0 ; Load HL with double y-coordinate of top of region to scroll... 55482 LD L,A ; ...(as entries in table at #R26240 are two bytes wide)... 55483 ADD HL,HL ; ... 55484 ADD HL,DE ; ...and add to DE as offset in HL 55485 LD E,(HL) ; Load Display File address of pixel row of interest into DE... 55486 INC HL ; ... 55487 LD D,(HL) ; ... 55488 EX DE,HL ; Swap HL (now Display File address of start of A-th pixel row) and DE (now points to entry in ; table at #R26240) 55489 LD A,(23492) ; Load y-coordinate of bottom of region to scroll (pixels) into A... 55492 SUB C ; ...and subtract C to get height of region to scroll (pixels) 55493 EX AF,AF' ; Swap AF and AF' (A' now holds height of region to scroll in pixels) 55494 LD A,(23489) ; Load C with x-coordinate of left edge of region to scroll (characters)... 55497 LD C,A ; ... 55498 LD A,L ; Add this x-coordinate value as offset (via OR) to HL... 55499 OR C ; ... 55500 LD L,A ; ... 55501 LD A,(23490) ; Load A with x-coordinate of right edge of region to scroll (characters) 55504 SUB C ; Subtract C... 55505 INC A ; ...and add one to get width (characters) of region to scroll 55506 LD B,0 ; Load BC with width of region to scroll (characters)... 55508 LD C,A ; ... 55509 PUSH BC ; Store BC (width of region to scroll in characters) 55510 PUSH HL ; Store HL (current position in Display File, at left edge of top pixel row in region to ; scroll) 55511 LD DE,23296 ; Point DE at #R23296 55514 LDIR ; Copy BC bytes of data from HL to DE 55516 POP HL ; Restore HL (current position in Display File, at left edge of top pixel row in region to ; scroll) 55517 POP BC ; Restore BC (width of region to scroll in characters) 55518 EXX ; Swap all registers (B' = width of region to scroll in characters) 55519 EX AF,AF' ; Swap AF and AF' (A now holds height of region to scroll in pixels) 55520 JP Z,55555 ; If height of region to scroll in pixels is zero then skip ahead to #R55555 55523 LD B,A ; Load B with height of region to scroll in pixels *55524 EXX ; Swap all registers (B = width of region to scroll, B' = remaining number of pixel rows to ; scroll) 55525 LD A,H ; Load D and A with H plus 1 and E with L... 55526 INC A ; ... 55527 LD D,A ; ... 55528 LD E,L ; ... 55529 AND 7 ; If any of three least significant bits in A are set (i.e. at least one of the three least ; significant bits in H were also set)... 55531 JP NZ,55545 ; ...then skip ahead to #R55545 ; At least one of the three least significant bits of H are set, meaning we could be at the top of a third of the ; display 55534 LD A,E ; Move DE on by 32 bytes to move up one character row (eight rows of pixels)... 55535 ADD A,32 ; ... 55537 LD E,A ; ... 55538 JP C,55545 ; If L hasn't gone over 256 (i.e. we haven't moved 32 bytes on from the top pixel row of the ; bottom character row of a third) then skip ahead to #R55545... 55541 LD A,D ; ...else move up by a third... 55542 SUB 8 ; ... 55544 LD D,A ; ... *55545 EX DE,HL ; Swap DE (now points to start of upper pixel row) and HL (now points to start of lower pixel ; row) 55546 PUSH HL ; Store HL (pointer to lower pixel row) 55547 PUSH BC ; Store BC (B = width of region to scroll, in characters) 55548 LDIR ; Copy row of bitmap data up a row from HL to DE 55550 POP BC ; Restore BC (B = width of region to scroll, in characters) 55551 POP HL ; Store HL (pointer to upper pixel row) 55552 EXX ; Swap all registers (B = remaining number of pixel rows to scroll, B' = width of region to ; scroll) 55553 DJNZ 55524 ; Loop back to #R55524 to copy next row of pixels up *55555 EXX ; Swap all registers ; The operand of the instruction at #R55556 is the address to jump to upon completion of this routine. This is ; modified by the instruction at #R55470, set to the value in HL at the start of this routine. The possible values ; are #R55407 (return) or #R55414 (restore copied bitmap data to bottom of region to scroll, then return). 55556 JP 55407 ; Jump to address that was in HL at start of this routine (return, or place copied bitmap data ; at bottom of scrolled region then return) ; Scroll a Region of the Display File Down a Pixel Row ; ; Used by the routines at #R55436 and #R55442. Input: HL Address to jump to at the end of this routine ; (instruction at #R55648) c55559 LD (55649),HL ; Modify jump (at #R55648) destination to address stored in HL 55562 LD A,(23492) ; Load y-coordinate of bottom of region to scroll (pixels) into A and C... 55565 LD C,A ; ... 55566 LD DE,26240 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 55569 LD H,0 ; Load HL with double y-coordinate of bottom of region to scroll... 55571 LD L,A ; ...(as entries in table at #R26240 are two bytes wide)... 55572 ADD HL,HL ; ... 55573 ADD HL,DE ; ...and add to DE as offset in HL 55574 LD E,(HL) ; Load Display File address of pixel row of interest into DE... 55575 INC HL ; ... 55576 LD D,(HL) ; ... 55577 EX DE,HL ; Swap HL (now Display File address of start of A-th pixel row) and DE (now points to entry in ; table at #R26240) 55578 LD A,(23491) ; Load y-coordinate of top of region to scroll (pixels) into B... 55581 LD B,A ; ... 55582 LD A,C ; Load y-coordinate of bottom of region to scroll into A... 55583 SUB B ; ...and subtract B to get height of region to scroll (pixels) 55584 EX AF,AF' ; Swap AF and AF' (A' now holds height of region to scroll in pixels) 55585 LD A,(23489) ; Load C with x-coordinate of left edge of region to scroll (characters)... 55588 LD C,A ; ... 55589 LD A,L ; Add this x-coordinate value as offset (via OR) to HL... 55590 OR C ; ... 55591 LD L,A ; ... 55592 LD A,(23490) ; Load A with x-coordinate of right edge of region to scroll (characters) 55595 SUB C ; Subtract C... 55596 INC A ; ...and add one to get width (characters) of region to scroll 55597 LD B,0 ; Load BC with width of region to scroll (characters)... 55599 LD C,A ; ... 55600 PUSH BC ; Store BC (width of region to scroll in characters) 55601 PUSH HL ; Store HL (current position in Display File, at left edge of bottom pixel row in region to ; scroll) 55602 LD DE,23296 ; Point DE at #R23296 55605 LDIR ; Copy BC bytes of data from HL to DE 55607 POP HL ; Restore HL (current position in Display File, at left edge of bottom pixel row in region to ; scroll) 55608 POP BC ; Restore BC (width of region to scroll in characters) 55609 EXX ; Swap all registers (B' = width of region to scroll in characters) 55610 EX AF,AF' ; Swap AF and AF' (A now holds height of region to scroll in pixels) 55611 JP Z,55647 ; If height of region to scroll in pixels is zero then skip ahead to #R55647 55614 LD B,A ; Load B with height of region to scroll in pixels *55615 EXX ; Swap all registers (B = width of region to scroll, B' = remaining number of pixel rows to ; scroll) 55616 LD A,H ; Load D and A with H minus 1 and E with L... 55617 DEC A ; ... 55618 LD E,L ; ... 55619 LD D,A ; ... 55620 CPL ; Invert all bits in A 55621 AND 7 ; If any of three least significant bits in A are set (i.e. at least one of the three least ; significant bits in H were also set)... 55623 JP NZ,55637 ; ...then skip ahead to #R55637 ; At least one of the three least significant bits of H are set, meaning we could be at the top of a third of the ; display 55626 LD A,E ; Move DE back by 32 bytes to move up one character row (eight rows of pixels)... 55627 SUB 32 ; ... 55629 LD E,A ; ... 55630 JP C,55637 ; If E hasn't gone under zero (i.e. we haven't moved 32 bytes back from the top character row ; of a third) then skip ahead to #R55637... 55633 LD A,D ; ...else move down by a third... 55634 ADD A,8 ; ... 55636 LD D,A ; ... *55637 EX DE,HL ; Swap DE (now points to start of lower pixel row) and HL (now points to start of upper pixel ; row) 55638 PUSH HL ; Store HL (pointer to upper pixel row) 55639 PUSH BC ; Store BC (B = width of region to scroll, in characters) 55640 LDIR ; Copy row of bitmap data down a row from HL to DE 55642 POP BC ; Restore BC (B = width of region to scroll, in characters) 55643 POP HL ; Store HL (pointer to upper pixel row) 55644 EXX ; Swap all registers (B = remaining number of pixel rows to scroll, B' = width of region to ; scroll) 55645 DJNZ 55615 ; Loop back to #R55615 to copy next row of pixels down *55647 EXX ; Swap all registers ; The operand of the instruction at #R55648 is the address to jump to upon completion of this routine. This is ; modified by the instruction at #R55559, set to the value in HL at the start of this routine. The possible values ; are #R55407 (return) or #R55448 (restore copied bitmap data to top of region to scroll, then return). 55648 JP 55407 ; Jump to address that was in HL at start of this routine (return, or place copied bitmap data ; at top of scrolled region then return) ; Flash Border and Screen (as in Cast a Spell) ; ; Used by the routines at #R31122, #R31280, #R31312 and #R31468. c55651 LD B,96 ; Load B with 96 (number of times to repeat routine) *55653 LD DE,576 ; Load DE with 576 (number of bytes to modify - i.e. bottom 18 rows) 55656 LD HL,22720 ; Point HL at start of 7th row in Attribute File *55659 LD A,(HL) ; Load attribute byte into A 55660 AND 248 ; Clear three lowest bits (i.e. INK colour) preserving only PAPER, BRIGHT and FLASH bits 55662 LD C,A ; Place modified value into C 55663 LD A,(HL) ; Get original attribute from screen again 55664 INC A ; Increase by one 55665 AND 7 ; Clear all bits except the lowest three (i.e. INK colour) 55667 OUT (254),A ; Set border colour to A 55669 OR C ; Combine other bits back in 55670 OUT (254),A ; Update border / speaker state 55672 LD (HL),A ; Load modified value back into Attribute File 55673 INC HL ; Move to next byte in Attribute File 55674 DEC DE ; Reduce DE (reducing number of attribute bytes left to modify) 55675 LD A,D ; If DE is not zero (i.e. there are more attribute bytes to modify)... 55676 OR E ; ... 55677 JR NZ,55659 ; ...then loop back to #R55659 55679 DJNZ 55653 ; Loop back for another pass 55681 XOR A ; Set A to zero 55682 OUT (254),A ; Reset border to black and reset speaker state 55684 RET ; Return ; Display Cyan "Game Over" Window and Return to Control Selection Menu ; ; Used by the routines at #R27136, #R27762, #R28470, #R28482, #R28494, #R28542, #R29488, #R30940, #R31312, #R31468, ; #R31688, #R32252 and #R53937. Input: HL Points to location of a string c55685 RES 0,(IY+65) ; Reset Game In Progress Flag (IY = 23610) 55689 LD DE,37283 ; Adjust height of window 24 ("Game Over" Window) to accommodate text... 55692 CALL 33774 ; ... 55695 PUSH HL ; Store HL (points to first character of text to display) 55696 LD A,24 ; Draw Window 24 ("Game Over" Window)... 55698 CALL 34990 ; ... 55701 LD HL,44530 ; Point to string for percentage completion 55704 LD DE,44542 ; Point to string for time left 55707 CALL 33657 ; Insert current time and score into "Time Left" and "Percentage Completion" texts 55710 LD HL,44506 ; Point HL at "GAME OVER / TOTAL COMPLETION XX% / TIME LEFT XX DAYS" text... 55713 CALL 34762 ; ...and print to screen 55716 POP HL ; Restore HL (points to first character of text to display) 55717 CALL 34762 ; Print text to screen 55720 CALL 55138 ; Display "PRESS FIRE TO CONTINUE" Window and Wait for Fire to be Pressed 55723 JP 26670 ; Display and handle Input Device Selection Menu ; Advance HL by A Words, Load HL with Word at Location HL as Address and Jump to it ; ; Used by the routines at #R30001, #R30686, #R30874 and #R31041. Input: A An index HL First entry in list of ; addresses c55726 CALL 55730 ; Load address with index A in a list of addresses at HL into HL 55729 JP (HL) ; Jump to address in HL ; Load address with index A in a list of addresses at HL into HL ; ; Used by the routines at #R27762, #R28264, #R54505 and #R55726. Input: A Index of required entry in list (0 is ; first) HL Address of start of list Output: HL A-th address in list at HL (input) c55730 ADD A,A ; Double offset value... 55731 LD D,0 ; ...and load into DE... 55733 LD E,A ; ... 55734 ADD HL,DE ; Add doubled offset to address in HL ; This entry point is used by the routines at #R28785, #R29036 and #R54411. *55735 LD A,(HL) ; Load address at HL into HL... 55736 INC HL ; ... 55737 LD H,(HL) ; ... 55738 LD L,A ; ... 55739 RET ; Return ; Set New Random Seed and Load A and E with a Random Number ; ; Used by the routines at #R36273 and #R55760. Output: A LSB of new random seed E LSB of new random seed c55740 PUSH HL ; Store HL 55741 PUSH BC ; Store BC 55742 LD BC,(23671) ; Load system variables Seed (hi) and Frames (1) into BC 55746 LD HL,(23670) ; Load system variable Seed into HL 55749 ADD HL,BC ; Add these together 55750 LD A,H ; Add together H and L in A... 55751 ADD A,L ; ... 55752 LD L,A ; ...and load into L 55753 LD (23670),HL ; Place new HL back into system variable Seed 55756 POP BC ; Restore BC 55757 POP HL ; Restore HL 55758 LD E,A ; Load LSB of new seed into E 55759 RET ; Return ; Unused routine ; ; This routine generates a random seed / random number up to B. Input: B Cap value c55760 CALL 55740 ; Set new random seed and load A and E with a random number 55763 CP B ; If random seed is greater than or equal to B... 55764 JR NC,55760 ; ...then loop back to #R55760 55766 LD E,A ; Load value into E 55767 RET ; Return ; Select Magic Knight's Room and USS Pisces' Current Location (Cheat / Debug Routine) ; ; Used by the routine at #R27136. Input: A Keyboard / joystick input c55768 LD (55776),A ; Store keyboard / joystick input at #R55775 55771 LD A,(23728) ; Set Zero Flag if Cheat Mode Enabled Flag is reset (see trivia)... 55774 OR A ; ... ; The operand of the instruction at #R55775 represents the most recent keyboard / joystick input. This is modified ; by the instruction at #R55768. 55775 LD A,0 ; Restore keyboard / joystick input to A 55777 RET Z ; Return is Zero Flag was set 55778 POP HL ; Remove return address from top of Stack 55779 CALL 35790 ; Set parameters (for Cheat Routine Sound) and play ; This entry point is used by the routine at #R55814. *55782 LD A,2 ; Set BORDER to red... 55784 OUT (254),A ; ... 55786 CALL 54942 ; Capture keyboard or joystick input loading result into A 55789 BIT 0,A ; If left pressed... 55791 JR NZ,55819 ; ...then jump to #R55819 (decrease Magic Knight's current room index, wrapping around to 24 if ; below zero) 55793 BIT 1,A ; If right pressed... 55795 JR NZ,55836 ; ...then jump to #R55836 (increase Magic Knight's current room index, wrapping around to zero ; if above 24) 55797 BIT 2,A ; If up pressed... 55799 JP NZ,55869 ; ...then jump to #R55869 (increase USS Pisces' current location index, wrapping around to 1 if ; above 24) 55802 BIT 3,A ; If down pressed... 55804 JP NZ,55853 ; ...then jump to #R55853 (decrease USS Pisces' current location index, wrapping around to 24 ; if below 1) 55807 BIT 4,A ; If fire pressed... 55809 JP NZ,55887 ; ...then jump to #R55887 (exit Cheat / Debug Mode) 55812 JR 55782 ; Loop back to #R55782 ; Cheat / Debug Routine Draw Magic Knight's Current Room then Jump Back into Cheat Routine Main Loop ; ; Used by the routines at #R55819, #R55836, #R55853 and #R55869. c55814 CALL 27765 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data 55817 JR 55782 ; Jump back into Cheat Routine main loop ; Cheat / Debug Routine Decrease Magic Knight's Current Room Index, Wrapping Around to 24 if Below Zero ; ; Used by the routine at #R55768. c55819 LD A,(23701) ; Decrease index of Magic Knight's current room... 55822 DEC A ; ... 55823 LD (23701),A ; ... 55826 JP P,55814 ; If new room index is not less than zero then draw Magic Knight's current room then jump back ; into Cheat Routine Main Loop 55829 LD A,24 ; Set new room index to 24... 55831 LD (23701),A ; ... 55834 JR 55814 ; Draw Magic Knight's current room then jump back into Cheat Routine Main Loop ; Cheat / Debug Routine Increase Magic Knight's Current Room Index, Wrapping Around to Zero if Above 24 ; ; Used by the routine at #R55768. c55836 LD A,(23701) ; Increase index of Magic Knight's current room... 55839 INC A ; ... 55840 LD (23701),A ; ... 55843 CP 25 ; If new room index is 25... 55845 JR NZ,55814 ; ...then draw Magic Knight's current room then jump back into Cheat Routine Main Loop 55847 XOR A ; Set new room index to zero... 55848 LD (23701),A ; ... 55851 JR 55814 ; Draw Magic Knight's current room then jump back into Cheat Routine Main Loop ; Cheat / Debug Routine Decrease USS Pisces' Current Location Index, Wrapping Around to 24 if Below 1 ; ; Used by the routine at #R55768. c55853 LD A,(23700) ; Decrease index of USS Pisces' current location... 55856 DEC A ; ... 55857 LD (23700),A ; ... 55860 JR NZ,55814 ; If new location index is not zero then draw Magic Knight's current room then jump back into ; Cheat Routine Main Loop 55862 LD A,24 ; Set new location index to 24... 55864 LD (23700),A ; ... 55867 JR 55814 ; Draw Magic Knight's current room then jump back into Cheat Routine Main Loop ; Cheat / Debug Routine Increase USS Pisces' Current Location Index, Wrapping Around to 1 if Above 24 ; ; Used by the routine at #R55768. c55869 LD A,(23700) ; Increase index of USS Pisces' current location... 55872 INC A ; ... 55873 LD (23700),A ; ... 55876 CP 25 ; If new location index is 25... 55878 JR NZ,55814 ; ...then draw Magic Knight's current room then jump back into Cheat Routine Main Loop 55880 LD A,1 ; Set new location index to 1... 55882 LD (23700),A ; ... 55885 JR 55814 ; Draw Magic Knight's current room then jump back into Cheat Routine Main Loop ; Cheat / Debug Routine Exit Cheat / Debug Mode ; ; Used by the routine at #R55768. c55887 XOR A ; Set BORDER to black... 55888 OUT (254),A ; ... 55890 CALL 35690 ; Play upward scale sound 55893 JP 27136 ; Jump to start of Main Game Loop ; Unused b55896 DEFB 0,0,215,130,0,0,216,130 55904 DEFB 0,0,217,130,0,0,218,130 55912 DEFB 0,0,219,130,0,0 ; Graphics (02 x 02) Unknown / Unused Mask b55918 DEFB 255,255,255,255,255,255,255,255 55926 DEFB 255,255,255,255,255,255,255,255 55934 DEFB 255,255,255,255,255,255,255,255 55942 DEFB 255,255,255,255,255,255,255,255 ; Graphic Lookup Data ; ; Table of addresses of start of graphic data for game graphics. b55950 DEFW 63220,63220 ; (00) - Graphics (Standard): (03 x 04) Magic Knight Facing Right, Frame 1 55954 DEFW 0,0 ; (01) - Unused 55958 DEFW 56310,56310 ; (02) - Graphics (Standard): (02 x 02) Menu Hand Cursor 55962 DEFW 56342,56374 ; (03) - Graphics (Standard): (02 x 02) Chocolate Heart and mask 55966 DEFW 56406,56438 ; (04) - Graphics (Standard): (02 x 02) Advert and mask 55970 DEFW 56470,56438 ; (05) - Graphics (Standard): (02 x 02) Mirror and mask 55974 DEFW 56502,56438 ; (06) - Graphics (Standard): (02 x 02) Photograph (inside of starship) and mask 55978 DEFW 56534,56438 ; (07) - Graphics (Standard): (02 x 02) Photograph (Magic Knight) and mask 55982 DEFW 56566,56438 ; (08) - Graphics (Standard): (02 x 02) Star Map and mask 55986 DEFW 56598,56438 ; (09) - Graphics (Standard): (02 x 02) Ancient Scroll and mask 55990 DEFW 56630,56438 ; (10) - Graphics (Standard): (02 x 02) Starfleet Manual and mask 55994 DEFW 56662,56694 ; (11) - Graphics (Standard): (02 x 02) Pair of Boots and mask 55998 DEFW 56726,56758 ; (12) - Graphics (Standard): (02 x 02) Camera and mask 56002 DEFW 56790,56822 ; (13) - Graphics (Standard): (02 x 02) Blank / Valid ID Card and mask 56006 DEFW 56854,56886 ; (14) - Graphics (Standard): (02 x 02) Shield and mask 56010 DEFW 56918,56950 ; (15) - Graphics (Standard): (02 x 02) Magic Talisman / 10MW Laser and mask 56014 DEFW 56982,57014 ; (16) - Graphics (Standard): (02 x 02) Golden Sundial of Alpha and mask 56018 DEFW 57046,57078 ; (17) - Graphics (Standard): (02 x 02) Tower Fish and mask 56022 DEFW 57110,57142 ; (18) - Graphics (Standard): (02 x 02) Bag of Runes / Potatoes and mask 56026 DEFW 57174,57206 ; (19) - Graphics (Standard): (02 x 02) Wrist Terminal and mask 56030 DEFW 57238,57270 ; (20) - Graphics (Standard): (02 x 02) Instant Film and mask 56034 DEFW 57302,57334 ; (21) - Graphics (Standard): (02 x 02) Pot of Glue and mask 56038 DEFW 57366,57398 ; (22) - Graphics (Standard): (02 x 02) 5W Resistor and mask 56042 DEFW 57430,57462 ; (23) - Graphics (Standard): (02 x 02) Brass Ankh and mask 56046 DEFW 57494,57526 ; (24) - Graphics (Standard): (02 x 02) Pewter Tankard and mask 56050 DEFW 57558,57590 ; (25) - Graphics (Standard): (02 x 02) Quark Bomb and mask 56054 DEFW 57622,57654 ; (26) - Graphics (Standard): (02 x 02) Axe and mask 56058 DEFW 57686,57718 ; (27) - Graphics (Standard): (02 x 02) McTablet Food and mask 56062 DEFW 57750,57782 ; (28) - Graphics (Standard): (02 x 02) Broken Glass and mask 56066 DEFW 57814,57846 ; (29) - Graphics (Standard): (02 x 02) Gadget X and mask 56070 DEFW 57878,57910 ; (30) - Graphics (Standard): (02 x 02) Torch and mask 56074 DEFW 57942,57974 ; (31) - Graphics (Standard): (02 x 02) Part of a Sundial and mask 56078 DEFW 58006,58038 ; (32) - Graphics (Standard): (02 x 02) Gas Mask and mask 56082 DEFW 56666,56538 ; (33) - Unknown / Unused (see trivia) 56086 DEFW 56698,56538 ; (34) - Unknown / Unused (see trivia) 56090 DEFW 56730,56538 ; (35) - Unknown / Unused (see trivia) 56094 DEFW 56762,56794 ; (36) - Unknown / Unused (see trivia) 56098 DEFW 56826,56858 ; (37) - Unknown / Unused (see trivia) 56102 DEFW 56890,56922 ; (38) - Unknown / Unused (see trivia) 56106 DEFW 56954,56986 ; (39) - Unknown / Unused (see trivia) 56110 DEFW 1035,58070 ; (40) - Graphics (Compacted): (11 x 04) Gordon / Sarab at Control Panel 56114 DEFW 1030,58339 ; (41) - Graphics (Compacted): (06 x 04) Transporter Pad 56118 DEFW 1283,58405 ; (42) - Graphics (Compacted): (03 x 05) Cavern Ceiling Part (1) 56122 DEFW 770,58497 ; (43) - Graphics (Compacted): (02 x 03) Cavern Ceiling Part (2) 56126 DEFW 1027,58528 ; (44) - Graphics (Compacted): (03 x 04) Cavern Ceiling Part (3) 56130 DEFW 514,58598 ; (45) - Graphics (Compacted): (02 x 02) Cavern Ceiling Part (4) 56134 DEFW 769,58622 ; (46) - Graphics (Compacted): (01 x 03) Cavern Ceiling Part (5) 56138 DEFW 1283,58644 ; (47) - Graphics (Compacted): (03 x 05) Cavern Ceiling Part (6) 56142 DEFW 1028,58707 ; (48) - Graphics (Compacted): (04 x 04) Cavern Ceiling Part (7) 56146 DEFW 1026,58793 ; (49) - Graphics (Compacted): (02 x 04) Wall-Mounted Telephone 56150 DEFW 777,58849 ; (50) - Graphics (Compacted): (09 x 03) Left Half of Planet (as shown on viewscreen) 56154 DEFW 773,59031 ; (51) - Graphics (Compacted): (05 x 03) Security Camera 56158 DEFW 1797,59149 ; (52) - Graphics (Compacted): (05 x 07) Large Chair 56162 DEFW 2306,59296 ; (53) - Graphics (Compacted): (02 x 09) Wall-Mounted Rifle 56166 DEFW 1795,59429 ; (54) - Graphics (Compacted): (03 x 07) Chandelier 56170 DEFW 1031,59585 ; (55) - Graphics (Compacted): (07 x 04) Table 56174 DEFW 2563,59677 ; (56) - Graphics (Compacted): (03 x 10) Half Transputer Panel 56178 DEFW 2057,59879 ; (57) - Graphics (Compacted): (09 x 08) Cargo Container 56182 DEFW 0,0 ; (58) - Unused 56186 DEFW 1798,60186 ; (59) - Graphics (Compacted): (06 x 07) Hooper 56190 DEFW 514,60432 ; (60) - Graphics (Compacted): (02 x 02) Wall-Mounted Plaque 56194 DEFW 2817,60459 ; (61) - Graphics (Compacted): (01 x 11) Left Edge of Viewscreen 56198 DEFW 1286,60541 ; (62) - Graphics (Compacted): (06 x 05) Face (shown upon Communicate command) 56202 DEFW 1284,60735 ; (63) - Graphics (Compacted): (04 x 05) Wall-Mounted Helmet 56206 DEFW 1028,60871 ; (64) - Graphics (Compacted): (04 x 04) Left Half of USS Pisces Picture 56210 DEFW 771,60970 ; (65) - Graphics (Compacted): (03 x 03) Transputer Base (Left Half) 56214 DEFW 1286,61021 ; (66) - Graphics (Compacted): (06 x 05) Plant 56218 DEFW 514,61209 ; (67) - Graphics (Compacted): (02 x 02) Plant Pot / Tyme Machine Control Column block 56222 DEFW 1284,61237 ; (68) - Graphics (Compacted): (04 x 05) Balls Picture 56226 DEFW 61392,61456 ; (69) - Graphics (Standard): (02 x 04) Sharon and mask 56230 DEFW 61520,61584 ; (70) - Graphics (Standard): (02 x 04) S3 E3 / Klink and mask 56234 DEFW 61648,61712 ; (71) - Graphics (Standard): (02 x 04) Swiftfoot and mask 56238 DEFW 61776,61840 ; (72) - Graphics (Standard): (02 x 04) Murphy / Julie 8 and mask 56242 DEFW 1284,61904 ; (73) - Graphics (Compacted): (04 x 05) Tyme Guardian 56246 DEFW 1026,58893 ; (74) - Graphics (Compacted): (02 x 04) Middle Section of Planet (unused) 56250 DEFW 1284,62013 ; (75) - Graphics (Compacted): (04 x 05) Control Panel 56254 DEFW 773,59131 ; (76) - Graphics (Compacted): (05 x 03) Unused 56258 DEFW 1027,62181 ; (77) - Graphics (Compacted): (03 x 04) Wall-Mounted Device 56262 DEFW 2306,59396 ; (78) - Graphics (Compacted): (02 x 09) Unused 56266 DEFW 1795,59529 ; (79) - Graphics (Compacted): (03 x 07) Unused 56270 DEFW 62278,62342 ; (80) - Graphics (Standard): (02 x 04) Forbin and mask 56274 DEFW 62406,62470 ; (81) - Graphics (Standard): (02 x 04) Hectorr and mask 56278 DEFW 1539,62534 ; (82) - Graphics (Compacted): (03 x 06) Patterned Column 56282 DEFW 0,0 ; (83) - Unused 56286 DEFW 773,62658 ; (84) - Graphics (Compacted): (05 x 03) Picture (1) 56290 DEFW 773,62760 ; (85) - Graphics (Compacted): (05 x 03) Picture (2) 56294 DEFW 2817,60559 ; (86) - Graphics (Compacted): (01 x 11) Unused 56298 DEFW 1027,62869 ; (87) - Graphics (Compacted): (03 x 04) Left half of Reel-to-Reel Tape Device 56302 DEFW 1283,62978 ; (88) - Graphics (Compacted): (03 x 05) Left half of Tyme Guardians' Symbol (1) 56306 DEFW 774,63088 ; (89) - Graphics (Compacted): (06 x 03) Tyme Guardians' Symbol (2) ; Graphics (02 x 02) Menu Hand Cursor b56310 DEFB 0,0,12,0,30,0,63,0 56318 DEFB 127,128,255,24,254,232,108,8 56326 DEFB 56,16,20,72,4,164,5,82 56334 DEFB 2,169,1,69,0,131,0,0 ; Graphics Objects ; ; All object graphics are (2 x 2). Chocolate Heart b56342 DEFB 0,0,0,0,0,0,28,56 56350 DEFB 62,124,127,254,127,254,127,238 56358 DEFB 127,230,63,198,63,196,31,140 56366 DEFB 31,24,14,48,7,224,1,128 ; Chocolate Heart (Mask) 56374 DEFB 255,255,255,255,193,131,128,1 56382 DEFB 0,0,0,0,0,0,0,0 56390 DEFB 0,0,0,0,128,1,128,1 56398 DEFB 192,3,192,3,224,7,240,15 ; Advert 56406 DEFB 0,0,127,254,64,138,72,254 56414 DEFB 92,130,78,254,64,130,127,138 56422 DEFB 68,178,127,178,72,130,127,254 56430 DEFB 64,146,127,254,68,130,127,254 ; Advert / Mirror / Photograph / Star Map / Ancient Scroll / Starfleet Manual (Mask) 56438 DEFB 0,0,0,0,0,0,0,0 56446 DEFB 0,0,0,0,0,0,0,0 56454 DEFB 0,0,0,0,0,0,0,0 56462 DEFB 0,0,0,0,0,0,0,0 ; Mirror 56470 DEFB 0,0,82,74,76,50,63,252 56478 DEFB 48,12,81,10,18,8,84,10 56486 DEFB 48,12,81,10,18,8,84,10 56494 DEFB 48,12,63,252,76,50,82,74 ; Photograph (Blank) 56502 DEFB 0,0,127,254,127,254,96,6 56510 DEFB 96,6,96,6,96,6,96,6 56518 DEFB 96,6,96,6,96,6,96,6 56526 DEFB 96,6,96,6,127,254,127,254 ; Photograph (Magic Knight) 56534 DEFB 0,0,127,254,127,254,96,6 56542 DEFB 99,230,101,86,101,86,101,86 56550 DEFB 102,182,99,198,96,6,99,198 56558 DEFB 103,230,96,6,127,254,127,254 ; Star Map 56566 DEFB 0,0,127,254,104,22,80,10 56574 DEFB 96,6,74,2,85,242,85,82 56582 DEFB 85,242,64,66,64,66,64,66 56590 DEFB 96,6,80,10,104,22,127,254 ; Ancient Scroll 56598 DEFB 0,0,127,254,255,255,127,254 56606 DEFB 32,4,45,228,44,4,45,100 56614 DEFB 44,196,32,36,47,84,32,36 56622 DEFB 32,84,127,254,255,255,127,254 ; Starfleet Manual 56630 DEFB 0,0,31,254,96,4,127,254 56638 DEFB 127,252,127,252,125,188,125,188 56646 DEFB 126,124,126,124,125,188,127,252 56654 DEFB 127,252,124,62,127,252,31,254 ; Pair of Boots 56662 DEFB 0,0,0,0,0,0,0,0 56670 DEFB 31,0,63,0,58,0,62,0 56678 DEFB 58,0,63,28,57,50,63,242 56686 DEFB 127,250,127,254,121,254,120,252 ; Pair of Boots (Mask) 56694 DEFB 255,255,255,255,255,255,192,255 56702 DEFB 128,255,128,255,128,255,128,255 56710 DEFB 128,193,128,128,128,0,0,0 56718 DEFB 0,0,0,0,0,0,0,0 ; Camera 56726 DEFB 0,0,0,0,0,0,0,0 56734 DEFB 0,0,7,192,108,96,107,174 56742 DEFB 75,162,107,174,108,110,87,222 56750 DEFB 88,62,127,254,64,2,127,254 ; Camera (Mask) 56758 DEFB 255,255,255,255,255,255,255,255 56766 DEFB 240,31,128,15,0,0,0,0 56774 DEFB 0,0,0,0,0,0,0,0 56782 DEFB 0,0,0,0,0,0,0,0 ; ID Card 56790 DEFB 0,0,0,0,0,0,0,0 56798 DEFB 0,0,0,0,0,0,0,0 56806 DEFB 0,0,127,254,127,130,97,130 56814 DEFB 127,130,127,130,97,130,127,254 ; Blank / Valid ID Card (Mask) 56822 DEFB 255,255,255,255,255,255,255,255 56830 DEFB 255,255,255,255,255,255,255,255 56838 DEFB 0,0,0,0,0,0,0,0 56846 DEFB 0,0,0,0,0,0,0,0 ; Shield 56854 DEFB 0,0,64,2,96,6,126,126 56862 DEFB 127,254,103,230,115,206,121,158 56870 DEFB 63,252,63,252,30,120,28,56 56878 DEFB 13,176,7,224,3,192,1,128 ; Shield (Mask) 56886 DEFB 31,248,15,240,0,0,0,0 56894 DEFB 0,0,0,0,0,0,0,0 56902 DEFB 128,1,128,1,128,1,192,3 56910 DEFB 192,3,224,7,240,15,248,31 ; Magic Talisman 56918 DEFB 0,0,1,128,3,192,3,192 56926 DEFB 7,224,7,224,14,112,13,176 56934 DEFB 13,176,14,112,7,224,7,224 56942 DEFB 3,192,3,192,1,128,1,128 ; Magic Talisman (Mask) 56950 DEFB 252,63,248,31,248,31,240,15 56958 DEFB 240,15,224,7,224,7,224,7 56966 DEFB 224,7,224,7,224,7,240,15 56974 DEFB 240,15,248,31,248,31,252,63 ; Golden Sundial of Alpha 56982 DEFB 0,0,0,0,0,0,3,192 56990 DEFB 31,248,61,188,97,134,97,254 56998 DEFB 97,254,96,6,60,60,31,248 57006 DEFB 3,192,7,224,15,240,31,248 ; Golden Sundial of Alpha (Mask) 57014 DEFB 255,255,255,255,248,31,192,3 57022 DEFB 128,1,0,0,0,0,0,0 57030 DEFB 0,0,0,0,0,0,128,1 57038 DEFB 192,3,224,7,192,3,192,3 ; Tower Fish 57046 DEFB 0,0,0,0,0,0,0,0 57054 DEFB 0,0,0,0,0,0,0,0 57062 DEFB 15,1,63,198,79,236,223,252 57070 DEFB 255,252,95,236,63,198,15,1 ; Tower Fish (Mask) 57078 DEFB 255,255,255,255,255,255,255,255 57086 DEFB 255,255,255,255,255,255,224,252 57094 DEFB 128,16,0,0,0,0,0,1 57102 DEFB 0,1,0,0,0,0,128,16 ; Bag of Runes / Potatoes 57110 DEFB 0,0,0,0,0,0,10,80 57118 DEFB 21,168,8,16,5,160,15,240 57126 DEFB 26,88,56,28,114,78,100,38 57134 DEFB 96,6,114,78,63,252,31,248 ; Bag of Runes / Potatoes (Mask) 57142 DEFB 255,255,255,255,224,7,192,3 57150 DEFB 192,3,192,3,224,7,192,3 57158 DEFB 128,1,0,0,0,0,0,0 57166 DEFB 0,0,0,0,0,0,128,1 ; Wrist Terminal 57174 DEFB 0,0,0,0,0,0,0,0 57182 DEFB 0,0,0,0,0,0,0,0 57190 DEFB 0,0,0,0,3,192,6,96 57198 DEFB 124,190,125,62,6,96,3,192 ; Wrist Terminal (Mask) 57206 DEFB 255,255,255,255,255,255,255,255 57214 DEFB 255,255,255,255,255,255,255,255 57222 DEFB 255,255,248,31,240,15,0,0 57230 DEFB 0,0,0,0,0,0,240,15 ; Instant Film 57238 DEFB 0,0,0,0,0,0,7,224 57246 DEFB 14,112,3,192,12,16,15,240 57254 DEFB 3,240,0,112,0,112,0,112 57262 DEFB 8,112,15,240,15,240,7,224 ; Instant Film (Mask) 57270 DEFB 255,255,255,255,240,15,224,7 57278 DEFB 224,7,224,7,224,7,224,7 57286 DEFB 224,7,224,7,224,7,224,7 57294 DEFB 224,7,224,7,224,7,224,7 ; Pot of Glue 57302 DEFB 0,0,0,0,0,0,0,0 57310 DEFB 15,240,15,240,7,224,7,224 57318 DEFB 127,254,77,168,93,170,93,168 57326 DEFB 93,170,85,170,76,136,127,254 ; Pot of Glue (Mask) 57334 DEFB 255,255,255,255,255,255,224,7 57342 DEFB 224,7,224,7,224,7,0,0 57350 DEFB 0,0,0,0,0,0,0,0 57358 DEFB 0,0,0,0,0,0,0,0 ; 5W Resistor 57366 DEFB 0,0,0,0,0,0,0,0 57374 DEFB 0,0,0,0,0,0,0,0 57382 DEFB 0,0,0,0,0,0,31,248 57390 DEFB 21,120,117,126,85,122,95,250 ; 5W Resistor (Mask) 57398 DEFB 255,255,255,255,255,255,255,255 57406 DEFB 255,255,255,255,255,255,255,255 57414 DEFB 255,255,255,255,192,3,192,3 57422 DEFB 0,0,0,0,0,0,0,0 ; Brass Ankh 57430 DEFB 0,0,7,224,15,240,28,56 57438 DEFB 24,24,24,24,12,48,6,96 57446 DEFB 127,254,127,254,3,192,3,192 57454 DEFB 3,192,3,192,3,192,3,192 ; Brass Ankh (Mask) 57462 DEFB 240,15,224,7,192,3,192,3 57470 DEFB 193,131,193,131,192,3,224,7 57478 DEFB 0,0,0,0,0,0,248,31 57486 DEFB 248,31,248,31,248,31,248,31 ; Pewter Tankard 57494 DEFB 0,0,0,0,0,0,0,0 57502 DEFB 0,56,127,252,127,204,127,140 57510 DEFB 127,140,127,152,127,176,127,224 57518 DEFB 63,64,30,96,63,32,127,128 ; Pewter Tankard (Mask) 57526 DEFB 255,255,255,255,255,255,255,131 57534 DEFB 0,1,0,1,0,1,0,1 57542 DEFB 0,1,0,1,0,3,0,7 57550 DEFB 0,15,128,15,0,15,0,15 ; Quark Bomb 57558 DEFB 0,0,0,56,0,192,1,0 57566 DEFB 1,0,3,192,7,224,8,48 57574 DEFB 27,216,24,56,27,216,27,216 57582 DEFB 8,48,15,240,7,224,3,192 ; Quark Bomb (Mask) 57590 DEFB 255,131,255,3,252,3,252,31 57598 DEFB 248,31,240,15,224,7,224,7 57606 DEFB 192,3,192,3,192,3,192,3 57614 DEFB 192,3,224,7,224,7,240,15 ; Axe 57622 DEFB 0,0,0,0,0,0,0,0 57630 DEFB 59,0,55,128,15,192,63,224 57638 DEFB 127,224,95,192,111,176,119,104 57646 DEFB 63,100,30,114,12,58,0,28 ; Axe (Mask) 57654 DEFB 255,255,255,255,255,255,128,127 57662 DEFB 128,63,128,31,128,15,128,7 57670 DEFB 0,15,0,7,0,3,0,1 57678 DEFB 0,0,128,0,192,0,225,128 ; McTablet Food 57686 DEFB 0,0,126,0,102,0,90,0 57694 DEFB 102,0,90,0,102,0,90,0 57702 DEFB 102,0,90,0,102,0,90,0 57710 DEFB 102,0,90,0,102,0,126,0 ; McTablet Food (Mask) 57718 DEFB 0,255,0,255,0,255,0,255 57726 DEFB 0,255,0,255,0,255,0,255 57734 DEFB 0,255,0,255,0,255,0,255 57742 DEFB 0,255,0,255,0,255,0,255 ; Broken Glass 57750 DEFB 0,0,0,0,0,0,0,0 57758 DEFB 0,0,0,0,0,0,0,0 57766 DEFB 0,0,0,0,0,0,0,0 57774 DEFB 0,0,13,84,50,204,127,254 ; Broken Glass (Mask) 57782 DEFB 255,255,255,255,255,255,255,255 57790 DEFB 255,255,255,255,255,255,255,255 57798 DEFB 255,255,255,255,255,255,255,255 57806 DEFB 224,1,128,1,0,0,0,0 ; Gadget X 57814 DEFB 0,0,112,14,120,30,124,62 57822 DEFB 62,124,31,248,15,240,7,224 57830 DEFB 7,224,15,240,31,248,62,124 57838 DEFB 124,62,120,30,112,14,0,0 ; Gadget X (Mask) 57846 DEFB 7,224,3,192,1,128,0,0 57854 DEFB 0,0,128,1,192,3,224,7 57862 DEFB 224,7,192,3,128,1,0,0 57870 DEFB 0,0,1,128,3,192,7,224 ; Torch 57878 DEFB 0,0,0,60,0,60,0,62 57886 DEFB 0,62,0,62,0,62,0,60 57894 DEFB 0,60,0,60,0,110,0,94 57902 DEFB 0,94,0,94,0,94,0,126 ; Torch (Mask) 57910 DEFB 255,129,255,129,255,128,255,128 57918 DEFB 255,128,255,128,255,128,255,128 57926 DEFB 255,129,255,0,255,0,255,0 57934 DEFB 255,0,255,0,255,0,255,0 ; Part of a Sundial 57942 DEFB 0,0,0,0,0,0,0,0 57950 DEFB 0,0,0,0,0,0,0,0 57958 DEFB 0,0,16,0,16,0,16,0 57966 DEFB 56,0,56,0,124,0,124,0 ; Part of a Sundial (Mask) 57974 DEFB 255,255,255,255,255,255,255,255 57982 DEFB 255,255,255,255,255,255,255,255 57990 DEFB 199,255,199,255,199,255,131,255 57998 DEFB 131,255,1,255,1,255,1,255 ; Gas Mask 58006 DEFB 0,0,30,120,63,252,115,206 58014 DEFB 97,134,96,6,97,134,51,204 58022 DEFB 30,120,36,36,34,68,28,56 58030 DEFB 6,96,4,32,15,240,15,240 ; Gas Mask (Mask) 58038 DEFB 192,3,128,1,0,0,0,0 58046 DEFB 0,0,0,0,0,0,0,0 58054 DEFB 128,1,128,1,128,1,128,1 58062 DEFB 192,3,224,7,224,7,224,7 ; Graphics (Compacted) Scenery Part 1 (11 x 04) Gordon / Sarab at Control Panel b58070 DEFB 0,8,7,3,1,0,5,255 58078 DEFB 3,0,5,255,3,0,5,255 58086 DEFB 3,8,24,56,216,244,224,223 58094 DEFB 63,191,191,255,3,15,247,249 58102 DEFB 250,250,254,254,254,255,3,16 58110 DEFB 60,31,7,7,255,3,0,2 58118 DEFB 128,224,224,255,3,0,5,255 58126 DEFB 3,0,21,126,66,126,106,126 58134 DEFB 194,126,16,252,212,214,214,212 58142 DEFB 212,252,8,252,120,32,120,248 58150 DEFB 243,239,223,127,63,63,31,31 58158 DEFB 239,240,240,252,248,248,240,240 58166 DEFB 231,31,31,1,3,7,15,63 58174 DEFB 255,3,128,192,224,224,224,192 58182 DEFB 192,128,31,113,110,232,238,241 58190 DEFB 127,8,255,1,199,187,139,187 58198 DEFB 199,255,1,1,0,2,3,239 58206 DEFB 60,120,127,56,63,127,234,127 58214 DEFB 48,112,231,60,255,2,170,213 58222 DEFB 45,45,255,1,60,252,252,172 58230 DEFB 252,204,206,254,112,255,4,253 58238 DEFB 121,1,1,248,255,7,63,255 58246 DEFB 8,252,240,193,129,129,129,128 58254 DEFB 63,112,232,215,129,145,239,8 58262 DEFB 247,192,214,247,234,234,247,8 58270 DEFB 255,1,243,243,255,1,131,131 58278 DEFB 255,1,1,0,8,255,2,0 58286 DEFB 14,252,252,0,1,1,1,1 58294 DEFB 1,1,31,124,127,255,5,213 58302 DEFB 42,255,6,171,84,255,6,248 58310 DEFB 62,254,255,5,127,127,96,1 58318 DEFB 1,1,1,1,255,2,8,245 58326 DEFB 240,27,251,14,255,2,1,227 58334 DEFB 63,227,254,14,0 ; (06 x 04) Transporter Pad 58339 DEFB 0,13,3,31,8,0,3,7 58347 DEFB 127,255,2,16,0,3,254,255 58355 DEFB 3,32,0,4,240,254,255,1 58363 DEFB 64,0,6,192,128,0,3,1 58371 DEFB 1,3,3,3,255,40,7,7 58379 DEFB 15,15,15,31,31,31,255,43 58387 DEFB 18,255,7,73,255,7,36,255 58395 DEFB 7,146,255,7,73,255,7,36 58403 DEFB 255,4 ; (03 x 05) Cavern Ceiling Part (1) 58405 DEFB 255,4,129,240,28,6,255,1 58413 DEFB 254,254,127,255,3,127,255,7 58421 DEFB 252,2,2,3,0,5,255,3 58429 DEFB 239,103,119,51,35,248,248,248 58437 DEFB 248,248,240,240,208,0,8,51 58445 DEFB 59,59,63,31,27,27,25,208 58453 DEFB 144,176,48,32,160,160,224,0 58461 DEFB 8,29,29,29,29,12,12,12 58469 DEFB 14,224,224,224,224,192,192,64 58477 DEFB 64,0,8,7,7,7,7,1 58485 DEFB 1,1,1,192,192,192,192,192 58493 DEFB 128,128,128,0 ; (02 x 03) Cavern Ceiling Part (2) 58497 DEFB 255,4,127,31,207,99,255,8 58505 DEFB 97,113,57,59,27,25,29,25 58513 DEFB 248,240,192,192,192,192,0,2 58521 DEFB 31,31,30,14,12,0,11 ; (03 x 04) Cavern Ceiling Part (3) 58528 DEFB 255,7,223,255,13,251,251,251 58536 DEFB 207,227,241,48,60,12,14,14 58544 DEFB 255,7,158,243,243,243,225,225 58552 DEFB 225,241,99,14,7,7,7,6 58560 DEFB 6,0,2,30,199,241,124,120 58568 DEFB 25,28,28,7,230,238,236,252 58576 DEFB 240,112,112,0,8,28,14,14 58584 DEFB 14,14,15,7,7,96,224,192 58592 DEFB 192,64,192,192,0,1 ; (02 x 02) Cavern Ceiling Part (4) 58598 DEFB 255,7,246,255,3,247,225,252 58606 DEFB 226,227,240,243,227,199,206,248 58614 DEFB 240,0,1,193,129,128,0,5 ; (01 x 03) Cavern Ceiling Part (5) 58622 DEFB 255,1,223,255,4,127,127,255 58630 DEFB 1,254,254,252,221,79,71,102 58638 DEFB 114,60,28,24,0,4 ; (03 x 05) Cavern Ceiling Part (6) 58644 DEFB 255,6,253,220,255,13,248,248 58652 DEFB 240,222,135,131,131,131,3,1 58660 DEFB 1,127,127,127,63,63,191,191 58668 DEFB 163,240,224,128,0,5,1,1 58676 DEFB 1,1,0,4,130,206,254,254 58684 DEFB 250,242,246,228,0,16,100,112 58692 DEFB 116,100,120,120,56,56,0,16 58700 DEFB 56,56,24,24,24,0,11 ; (04 x 04) Cavern Ceiling Part (7) 58707 DEFB 255,2,239,231,112,12,6,6 58715 DEFB 255,5,127,127,127,255,5,251 58723 DEFB 243,243,255,2,252,248,255,1 58731 DEFB 252,252,176,7,3,3,1,0 58739 DEFB 4,63,191,159,159,255,2,254 58747 DEFB 254,247,246,135,15,125,76,70 58755 DEFB 71,48,32,32,96,96,64,192 58763 DEFB 192,0,8,126,126,126,110,100 58771 DEFB 97,113,126,199,131,131,131,128 58779 DEFB 128,0,2,192,128,0,14,28 58787 DEFB 28,28,24,24,0,19 ; (02 x 04) Wall-Mounted Telephone 58793 DEFB 126,129,255,2,171,255,1,171 58801 DEFB 255,1,0,8,171,255,3,147 58809 DEFB 147,147,147,0,3,128,128,128 58817 DEFB 192,224,147,147,147,147,147,147 58825 DEFB 215,126,32,112,16,48,16,48 58833 DEFB 16,48,1,7,2,7,0,4 58841 DEFB 16,48,16,48,144,224,0,2 ; (09 x 03) Left Half of Planet (as shown on viewscreen) 58849 DEFB 0,38,3,31,0,4,31,255 58857 DEFB 2,254,0,3,127,255,1,252 58865 DEFB 225,12,0,1,9,252,255,2 58873 DEFB 127,63,191,0,1,239,31,254 58881 DEFB 63,191,255,1,249,0,20,3 58889 DEFB 15,63,255,1,0,1,7,60 58897 DEFB 249,244,224,207,255,2,254,63 58905 DEFB 159,15,227,255,2,252,252,248 58913 DEFB 227,127,127,62,158,254,0,1 58921 DEFB 4,191,255,1,251,3,255,1 58929 DEFB 31,31,79,231,255,2,127,248 58937 DEFB 226,230,192,223,255,3,127,0 58945 DEFB 5,1,7,0,1,3,7,30 58953 DEFB 124,254,255,2,0,1,239,255 58961 DEFB 1,249,252,7,215,255,1,0 58969 DEFB 1,199,214,240,255,1,252,254 58977 DEFB 255,1,0,1,255,1,120,255 58985 DEFB 2,59,239,255,1,0,1,224 58993 DEFB 239,255,2,253,249,255,1,0 59001 DEFB 1,255,1,254,254,220,249,255 59009 DEFB 2,0,1,35,126,12,3,192 59017 DEFB 231,239,0,1,31,15,15,207 59025 DEFB 7,167,255,1,0,1 ; (05 x 03) Security Camera 59031 DEFB 0,3,1,3,15,31,127,15 59039 DEFB 63,127,255,3,254,252,254,252 59047 DEFB 249,227,207,159,61,253,48,240 59055 DEFB 240,240,112,112,112,112,0,4 59063 DEFB 126,255,2,195,255,1,128,176 59071 DEFB 175,159,127,7,123,249,1,61 59079 DEFB 133,197,229,229,229,245,245,213 59087 DEFB 215,215,223,223,255,1,112,240 59095 DEFB 240,240,224,224,192,128,219,219 59103 DEFB 219,219,219,219,219,94,253,158 59111 DEFB 190,182,134,142,252,123,229,229 59119 DEFB 197,197,133,61,1,255,2,254 59127 DEFB 252,249,241,224 59131 DEFB 192,0,3,192,224,241,123,27 59139 DEFB 11,28,60,124,248,240,192,192 59147 DEFB 128,255 ; (05 x 07) Large Chair 59149 DEFB 0,29,1,1,1,0,3,208 59157 DEFB 184,184,120,120,0,24,1,3 59165 DEFB 2,2,2,2,6,4,120,120 59173 DEFB 120,248,248,248,240,240,0,24 59181 DEFB 5,13,9,11,27,19,55,103 59189 DEFB 240,240,240,240,240,240,224,224 59197 DEFB 0,5,7,60,1,0,4,15 59205 DEFB 248,3,255,1,1,7,28,49 59213 DEFB 231,31,255,2,207,63,127,255 59221 DEFB 5,224,224,224,192,192,192,128 59229 DEFB 128,127,255,4,127,31,7,255 59237 DEFB 7,240,255,5,248,128,63,254 59245 DEFB 254,252,240,128,0,16,3,3 59253 DEFB 0,2,3,15,63,252,240,240 59261 DEFB 252,252,240,192,0,25,1,15 59269 DEFB 255,2,63,15,4,31,255,2 59277 DEFB 240,128,0,1,192,128,240,255 59285 DEFB 2,31,1,0,4,128,240,255 59293 DEFB 2,0,8 ; (02 x 09) Wall-Mounted Rifle 59296 DEFB 0,11,32,32,32,112,112,0 59304 DEFB 8,112,112,32,32,32,32,32 59312 DEFB 32,0,3,1,0,1,1,0 59320 DEFB 1,1,240,240,0,1,232,0 59328 DEFB 1,232,0,1,232,0,1,1 59336 DEFB 0,1,1,0,1,1,0,1 59344 DEFB 1,0,1,232,0,1,232,0 59352 DEFB 1,232,0,1,200,1,1,1 59360 DEFB 1,1,0,1,3,7,200,200 59368 DEFB 200,200,200,0,1,252,226,7 59376 DEFB 3,0,1,1,1,1,1,1 59384 DEFB 246,252,0,1,104,104,104,104 59392 DEFB 104,7,15,9 59396 DEFB 9,13,7,3,1,104,104,104 59404 DEFB 104,104,8,8,104,1,3,7 59412 DEFB 28,120,224,193,195,252,222,30 59420 DEFB 62,124,254,198,128,231,124,0 59428 DEFB 14 ; (03 x 07) Chandelier 59429 DEFB 255,2,8,127,63,8,8,8 59437 DEFB 255,2,16,255,2,16,16,16 59445 DEFB 255,2,16,255,1,254,16,16 59453 DEFB 16,8,8,8,8,8,8,8 59461 DEFB 8,56,124,254,254,254,124,56 59469 DEFB 16,16,16,16,16,16,16,16 59477 DEFB 16,28,62,127,127,127,62,28 59485 DEFB 8,16,16,16,16,16,16,16 59493 DEFB 16,56,124,254,254,254,124,56 59501 DEFB 16,8,8,8,8,8,8,8 59509 DEFB 8,16,16,16,16,16,16,16 59517 DEFB 16,16,16,16,16,16,16,16 59525 DEFB 16,8,8,8 59529 DEFB 8,8,8,8,8,56,124,254 59537 DEFB 254,254,124,56,16,16,16,16 59545 DEFB 16,16,16,16,16,28,62,127 59553 DEFB 127,127,62,28,0,1,16,16 59561 DEFB 16,16,16,16,16,16,56,124 59569 DEFB 254,254,254,124,56,0,9,56 59577 DEFB 124,254,254,254,124,56,0,9 ; (07 x 04) Table 59585 DEFB 255,1,31,7,0,5,255,1 59593 DEFB 195,255,1,0,1,1,0,3 59601 DEFB 255,3,0,1,255,1,112,30 59609 DEFB 3,255,3,0,1,255,2,127 59617 DEFB 255,4,0,1,255,1,254,240 59625 DEFB 128,255,3,0,5,255,1,252 59633 DEFB 224,0,30,255,1,60,24,24 59641 DEFB 8,8,8,0,48,8,8,8 59649 DEFB 8,8,8,8,8,0,45,3 59657 DEFB 127,255,1,28,20,20,54,103 59665 DEFB 199,143,255,1,0,5,192,254 59673 DEFB 255,1,0,16 ; (03 x 10) Half Transputer Panel 59677 DEFB 0,1,7,15,15,15,14,14 59685 DEFB 14,0,1,255,3,0,5,255 59693 DEFB 3,0,4,14,14,14,14,14 59701 DEFB 14,14,14,1,1,1,1,1 59709 DEFB 1,1,1,255,1,199,131,1 59717 DEFB 1,1,131,199,14,14,14,14 59725 DEFB 14,14,14,14,1,0,7,255 59733 DEFB 1,0,2,60,60,0,1,60 59741 DEFB 0,1,14,14,14,14,14,14 59749 DEFB 14,14,0,8,127,255,2,252 59757 DEFB 248,240,240,240,14,14,14,14 59765 DEFB 14,14,14,14,0,8,240,240 59773 DEFB 248,252,255,2,127,0,1,14 59781 DEFB 14,14,14,14,14,14,14,0 59789 DEFB 9,127,255,1,248,240,243,231 59797 DEFB 228,14,14,14,14,14,14,14 59805 DEFB 14,0,8,13,12,231,243,240 59813 DEFB 248,255,1,127,14,14,14,14 59821 DEFB 15,15,7,0,5,255,3,0 59829 DEFB 5,255,3,0,2,15,31,28 59837 DEFB 24,24,24,24,0,1,255,2 59845 DEFB 0,3,14,31,0,1,255,2 59853 DEFB 0,3,14,31,24,24,24,24 59861 DEFB 24,28,31,15,31,31,14,0 59869 DEFB 3,255,2,31,31,14,0,3 59877 DEFB 255,2 ; (09 x 08) Cargo Container 59879 DEFB 0,17,1,2,2,4,9,19 59887 DEFB 23,255,1,0,1,127,255,6 59895 DEFB 0,1,255,7,0,1,254,255 59903 DEFB 5,0,1,128,64,64,160,144 59911 DEFB 200,232,0,28,1,2,4,5 59919 DEFB 39,79,159,191,63,127,255,3 59927 DEFB 224,192,200,200,200,200,204,255 59935 DEFB 1,0,7,255,1,7,3,3 59943 DEFB 3,3,3,3,244,242,249,252 59951 DEFB 254,254,255,2,0,3,128,128 59959 DEFB 64,32,144,0,14,1,1,9 59967 DEFB 19,39,39,79,159,63,63,255 59975 DEFB 8,199,224,255,6,240,0,1 59983 DEFB 255,6,3,7,255,14,208,200 59991 DEFB 228,242,250,249,252,254,0,6 59999 DEFB 128,64,2,4,9,9,19,39 60007 DEFB 79,8,127,255,6,8,255,7 60015 DEFB 8,255,7,8,255,7,8,255 60023 DEFB 7,8,255,7,8,255,7,8 60031 DEFB 32,32,144,200,228,228,242,8 60039 DEFB 95,95,79,47,39,23,19,11 60047 DEFB 255,33,248,240,248,255,5,0 60055 DEFB 3,240,255,4,63,31,31,63 60063 DEFB 255,3,250,242,242,228,228,200 60071 DEFB 200,144,8,5,4,2,2,1 60079 DEFB 1,0,1,8,255,3,127,127 60087 DEFB 63,191,8,255,7,8,255,7 60095 DEFB 8,255,7,8,255,7,8,255 60103 DEFB 7,8,255,2,254,254,252,252 60111 DEFB 253,0,1,32,32,64,64,128 60119 DEFB 128,0,9,159,95,79,47,39 60127 DEFB 23,19,11,255,40,249,250,242 60135 DEFB 244,228,232,200,208,0,16,9 60143 DEFB 5,4,2,2,1,1,0,1 60151 DEFB 255,4,127,127,0,1,255,7 60159 DEFB 0,1,255,7,0,1,255,7 60167 DEFB 0,1,255,5,254,254,0,1 60175 DEFB 255,1,144,160,32,64,64,128 60183 DEFB 128,0,9 ; (06 x 07) Hooper 60186 DEFB 0,16,2,2,3,3,3,3 60194 DEFB 1,1,4,4,4,14,206,251 60202 DEFB 241,4,16,16,17,49,241,241 60210 DEFB 224,32,120,252,206,230,246,246 60218 DEFB 252,252,0,16,1,1,0,2 60226 DEFB 15,63,63,63,255,1,170,255 60234 DEFB 1,192,126,185,221,236,224,160 60242 DEFB 193,1,97,49,25,237,72,252 60250 DEFB 254,255,5,0,16,31,0,7 60258 DEFB 110,247,119,57,6,127,237,127 60266 DEFB 117,121,29,221,1,249,181,249 60274 DEFB 254,254,254,252,252,252,252,252 60282 DEFB 0,10,2,14,30,62,54,32 60290 DEFB 112,218,250,218,250,218,250,112 60298 DEFB 0,1,255,6,0,1,1,61 60306 DEFB 220,238,246,246,250,10,252,252 60314 DEFB 252,252,252,252,252,252,0,1 60322 DEFB 3,3,2,7,7,7,2,31 60330 DEFB 255,2,170,255,3,170,143,255 60338 DEFB 2,170,255,3,170,255,3,170 60346 DEFB 255,3,170,248,255,2,170,255 60354 DEFB 3,170,252,252,248,168,252,252 60362 DEFB 252,168,3,0,7,255,2,170 60370 DEFB 14,14,6,7,25,255,2,170 60378 DEFB 127,127,63,127,255,3,170,255 60386 DEFB 7,170,251,243,227,254,248,252 60394 DEFB 240,128,128,0,8,1,3,7 60402 DEFB 7,30,12,30,30,238,254,254 60410 DEFB 252,2,1,0,3,3,31,127 60418 DEFB 170,252,248,248,248,254,255,2 60426 DEFB 0,6,192,240,0,8 ; (02 x 02) Wall-Mounted Plaque 60432 DEFB 31,127,127,255,4,213,248,254 60440 DEFB 254,255,4,87,128,234,255,3 60448 DEFB 127,127,31,9,171,255,3,254 60456 DEFB 254,248,0 ; (01 x 11) Left Edge of Viewscreen 60459 DEFB 0,5,1,3,7,6,6,6 60467 DEFB 6,6,6,6,6,6,6,6 60475 DEFB 6,6,6,6,6,6,6,6 60483 DEFB 6,6,6,6,6,15,31,63 60491 DEFB 117,235,213,235,255,3,129,129 60499 DEFB 129,129,255,4,129,129,129,129 60507 DEFB 255,3,235,213,235,117,63,31 60515 DEFB 15,6,6,6,6,6,6,6 60523 DEFB 6,6,6,6,6,6,6,6 60531 DEFB 6,6,6,6,6,6,6,6 60539 DEFB 6,84 ; (06 x 05) Face (shown upon Communicate command) 60541 DEFB 0,11,1,7,15,31,31,0 60549 DEFB 1,63,224,230,247,243,243,249 60557 DEFB 0,1 60559 DEFB 192,112,124,126,63,191,191,0 60567 DEFB 6,128,128,0,16,31,63,63 60575 DEFB 126,124,121,114,116,249,252,140 60583 DEFB 55,249,142,3,249,191,63,127 60591 DEFB 64,159,49,96,206,192,192,224 60599 DEFB 112,48,152,72,40,0,16,116 60607 DEFB 116,116,52,124,76,126,46,175 60615 DEFB 99,6,0,3,2,3,59,117 60623 DEFB 96,64,64,96,0,1,16,40 60631 DEFB 60,36,60,52,52,116,116,0 60639 DEFB 9,3,7,14,14,12,14,6 60647 DEFB 47,172,236,235,234,239,245,93 60655 DEFB 1,7,191,254,240,33,48,176 60663 DEFB 176,56,28,127,7,236,141,141 60671 DEFB 84,87,117,236,233,185,129,3 60679 DEFB 0,2,192,224,176,112,96,96 60687 DEFB 7,3,3,1,1,0,3,96 60695 DEFB 32,176,152,200,232,120,0,1 60703 DEFB 249,61,63,31,31,15,0,2 60711 DEFB 207,238,254,254,252,156,0,2 60719 DEFB 2,6,12,9,9,31,126,0 60727 DEFB 1,96,224,192,192,128,0,3 ; (04 x 05) Wall-Mounted Helmet 60735 DEFB 0,4,255,1,254,0,1,1 60743 DEFB 0,4,15,63,255,2,0,4 60751 DEFB 199,241,248,252,0,4,255,2 60759 DEFB 0,2,3,3,7,7,7,4 60767 DEFB 5,6,255,1,252,253,252,255 60775 DEFB 2,28,0,1,14,110,15,120 60783 DEFB 224,128,8,24,0,3,128,128 60791 DEFB 128,128,128,6,6,2,3,1 60799 DEFB 5,6,6,0,4,128,128,224 60807 DEFB 63,24,16,1,15,31,49,96 60815 DEFB 224,128,128,0,3,128,128,128 60823 DEFB 7,3,0,6,15,224,254,0 60831 DEFB 1,15,25,17,19,224,9,15 60839 DEFB 8,15,134,230,55,224,160,32 60847 DEFB 112,208,48,96,224,0,8,26 60855 DEFB 14,3,1,0,4,124,76,103 60863 DEFB 190,0,4,96,192,128,0,5 ; (04 x 04) Left Half of USS Pisces Picture 60871 DEFB 255,2,192,192,192,198,198,192 60879 DEFB 255,2,0,6,255,2,0,6 60887 DEFB 255,2,0,6,192,192,192,192 60895 DEFB 192,192,192,192,0,6,3,15 60903 DEFB 0,3,14,63,251,225,128,0 60911 DEFB 2,15,31,56,156,206,230,192 60919 DEFB 192,192,192,192,192,192,192,62 60927 DEFB 251,255,1,126,0,4,119,247 60935 DEFB 199,7,7,3,3,1,230,230 60943 DEFB 14,126,124,0,1,255,2,192 60951 DEFB 198,198,192,192,192,255,2,0 60959 DEFB 6,255,2,0,6,255,2,0 60967 DEFB 6,255,2 ; (03 x 03) Transputer Base (Left Half) 60970 DEFB 31,0,7,255,1,251,146,255 60978 DEFB 1,63,15,3,1,255,2,73 60986 DEFB 255,5,0,9,1,1,1,1 60994 DEFB 1,0,2,136,255,1,41,255 61002 DEFB 1,41,255,1,0,6,3,31 61010 DEFB 127,255,1,3,11,9,255,7 61018 DEFB 36,255,5 ; (06 x 05) Plant 61021 DEFB 0,13,15,31,63,0,4,96 61029 DEFB 248,252,204,0,7,7,0,6 61037 DEFB 254,255,1,0,7,128,0,8 61045 DEFB 51,51,1,0,2,124,254,254 61053 DEFB 204,206,198,3,3,225,249,252 61061 DEFB 15,15,31,60,60,60,108,108 61069 DEFB 255,1,251,249,249,121,121,121 61077 DEFB 96,192,224,240,240,248,248,216 61085 DEFB 216,0,8,255,1,239,231,71 61093 DEFB 7,0,3,252,204,140,204,72 61101 DEFB 96,32,32,108,96,224,192,128 61109 DEFB 0,1,63,255,1,0,6,224 61117 DEFB 252,8,8,0,7,15,63,111 61125 DEFB 78,78,28,28,0,1,240,247 61133 DEFB 255,3,251,243,49,17,203,227 61141 DEFB 247,231,183,183,255,3,223,158 61149 DEFB 190,190,62,255,3,127,115,121 61157 DEFB 121,125,0,1,128,128,128,192 61165 DEFB 192,192,192,29,29,1,1,0 61173 DEFB 4,243,243,243,227,3,0,3 61181 DEFB 183,148,152,8,12,6,2,0 61189 DEFB 1,30,24,192,192,192,128,224 61197 DEFB 0,1,124,124,28,0,5,192 61205 DEFB 64,64,0,5 ; (02 x 02) Plant Pot / Part of Control Column 61209 DEFB 255,2,0,1,255,5,243,243 61217 DEFB 0,1,255,1,241,241,241,241 61225 DEFB 255,7,127,241,241,241,241,241 61233 DEFB 241,241,254,0 ; (04 x 05) Balls Picture 61237 DEFB 255,1,188,190,255,1,251,243 61245 DEFB 190,156,255,2,0,3,56,124 61253 DEFB 230,255,2,0,3,28,62,127 61261 DEFB 255,2,3,3,3,3,3,3 61269 DEFB 192,192,192,192,192,192,192,192 61277 DEFB 246,254,124,56,0,1,1,3 61285 DEFB 7,125,121,62,28,0,1,192 61293 DEFB 224,240,3,3,3,3,3,3 61301 DEFB 3,3,192,156,190,255,1,253 61309 DEFB 249,190,156,7,7,3,1,0 61317 DEFB 4,208,144,224,192,0,4,3 61325 DEFB 57,125,255,1,253,249,125,57 61333 DEFB 192,192,192,192,192,192,192,192 61341 DEFB 0,1,56,124,254,250,242,124 61349 DEFB 56,0,8,3,3,3,3,3 61357 DEFB 3,3,3,192,192,192,192,192 61365 DEFB 192,255,2,0,1,1,1,0 61373 DEFB 3,255,2,0,1,140,140,0 61381 DEFB 3,255,2,3,99,99,3,3 61389 DEFB 3,255,2 ; Graphics Characters Part 1 ; ; All character graphics are (2 x 4). Sharon b61392 DEFB 0,0,33,194,55,242,62,218 61400 DEFB 56,206,57,198,63,254,63,254 61408 DEFB 31,252,7,240,14,208,24,216 61416 DEFB 17,232,51,236,34,100,34,100 61424 DEFB 35,196,51,132,17,140,25,188 61432 DEFB 9,152,121,176,57,128,113,128 61440 DEFB 1,128,1,192,0,192,0,224 61448 DEFB 0,224,1,192,15,128,30,0 ; Sharon (Mask) 61456 DEFB 140,24,128,0,128,0,128,0 61464 DEFB 128,0,128,0,128,0,128,0 61472 DEFB 128,1,192,1,192,3,192,3 61480 DEFB 128,1,128,1,128,1,128,1 61488 DEFB 128,1,128,1,128,1,192,1 61496 DEFB 0,1,0,3,0,7,0,63 61504 DEFB 4,31,252,31,252,15,252,15 61512 DEFB 252,15,224,15,192,31,192,63 ; S3 E3 / Klink 61520 DEFB 0,0,0,0,0,0,0,0 61528 DEFB 0,0,0,0,0,0,0,0 61536 DEFB 0,0,0,0,0,0,0,0 61544 DEFB 0,0,3,192,7,224,0,0 61552 DEFB 15,240,8,80,15,240,96,6 61560 DEFB 111,246,8,16,105,214,104,22 61568 DEFB 111,246,109,118,103,230,96,6 61576 DEFB 0,0,96,6,112,14,112,14 ; S3 E3 / Klink (Mask) 61584 DEFB 255,255,255,255,255,255,255,255 61592 DEFB 255,255,255,255,255,255,255,255 61600 DEFB 255,255,255,255,255,255,255,255 61608 DEFB 248,31,240,15,240,15,240,15 61616 DEFB 224,7,224,7,0,0,0,0 61624 DEFB 0,0,0,0,0,0,0,0 61632 DEFB 0,0,0,0,0,0,0,0 61640 DEFB 15,240,7,224,7,224,7,224 ; Swiftfoot 61648 DEFB 0,0,3,192,15,240,31,248 61656 DEFB 60,60,115,142,71,66,69,70 61664 DEFB 100,76,115,156,56,56,31,240 61672 DEFB 7,128,24,48,15,224,3,128 61680 DEFB 0,192,1,128,3,128,3,0 61688 DEFB 7,0,6,0,6,112,6,248 61696 DEFB 7,152,7,24,0,56,1,240 61704 DEFB 15,230,31,142,63,252,56,112 ; Swiftfoot (Mask) 61712 DEFB 248,31,224,7,192,3,128,1 61720 DEFB 0,0,0,0,0,0,0,0 61728 DEFB 0,1,0,1,0,1,128,3 61736 DEFB 192,7,192,7,192,7,224,15 61744 DEFB 252,31,248,31,248,63,240,63 61752 DEFB 240,255,240,7,240,3,240,3 61760 DEFB 240,3,240,3,240,3,224,0 61768 DEFB 192,0,128,0,128,0,128,1 ; Murphy / Julie 8 61776 DEFB 0,0,0,0,0,0,1,224 61784 DEFB 3,152,7,168,7,140,7,198 61792 DEFB 7,254,7,230,3,248,0,252 61800 DEFB 4,48,6,48,6,224,6,232 61808 DEFB 14,104,15,8,13,152,12,216 61816 DEFB 14,248,0,248,12,240,8,0 61824 DEFB 13,176,5,176,3,176,3,48 61832 DEFB 3,48,2,32,7,188,7,222 ; Murphy / Julie 8 (Mask) 61840 DEFB 255,255,255,255,252,15,248,3 61848 DEFB 240,3,240,1,240,0,240,0 61856 DEFB 240,0,240,0,240,0,240,1 61864 DEFB 240,1,240,7,240,3,224,3 61872 DEFB 224,3,224,3,224,3,224,3 61880 DEFB 224,3,224,3,224,3,224,7 61888 DEFB 224,7,224,7,240,7,248,7 61896 DEFB 248,7,240,1,240,0,240,0 ; Graphics (Compacted) Scenery Part 2 (04 x 05) Tyme Guardian b61904 DEFB 0,9,15,4,4,4,4,7 61912 DEFB 0,2,224,192,192,192,192,192 61920 DEFB 0,10,60,36,63,36,63,36 61928 DEFB 60,127,255,2,231,231,255,2 61936 DEFB 127,254,255,2,51,51,255,2 61944 DEFB 254,0,1,120,72,248,72,248 61952 DEFB 72,120,0,9,55,55,55,55 61960 DEFB 7,7,1,0,1,112,112,112 61968 DEFB 112,112,112,112,0,16,3,3 61976 DEFB 3,3,3,3,7,6,0,1 61984 DEFB 128,128,128,128,128,192,192,0 61992 DEFB 16,119,119,0,1,127,255,2 62000 DEFB 240,240,254,254,0,1,254,255 62008 DEFB 2,7,7,0,8 ; (04 x 05) Control Panel 62013 DEFB 127,255,1,192,207,207,192,255 62021 DEFB 4,0,1,255,2,0,1,255 62029 DEFB 4,0,1,255,2,0,1,255 62037 DEFB 2,254,255,1,3,243,243,3 62045 DEFB 255,4,192,207,207,207,207,207 62053 DEFB 255,2,0,1,255,1,142,6 62061 DEFB 6,6,255,2,0,1,255,1 62069 DEFB 0,1,254,254,0,1,255,2 62077 DEFB 3,243,243,243,243,243,207,207 62085 DEFB 207,207,207,207,207,207,143,255 62093 DEFB 1,142,6,6,6,143,255,3 62101 DEFB 0,1,254,254,0,1,255,2 62109 DEFB 243,243,243,243,243,243,243,243 62117 DEFB 207,207,207,207,207,207,193,193 62125 DEFB 128,0,1,63,63,63,63,0 62133 DEFB 1,128,1,0,1,252,252,252 62141 DEFB 252,0,1,1,243,243,243,243 62149 DEFB 243,243,131,131,255,3,192,207 62157 DEFB 192,255,5,0,1,255,1,0 62165 DEFB 1,255,5,0,1,255,1,0 62173 DEFB 1,255,5,3,243,3,255,2 ; (03 x 04) Wall-Mounted Device 62181 DEFB 127,199,131,131,131,199,255,1 62189 DEFB 4,254,227,193,193,193,227,255 62197 DEFB 1,32,60,126,106,106,106,126 62205 DEFB 126,126,255,2,213,213,255,1 62213 DEFB 213,213,213,255,2,87,87,255 62221 DEFB 1,87,87,87,126,126,94,94 62229 DEFB 78,66,70,60,213,213,213,213 62237 DEFB 213,255,2,127,87,87,87,87 62245 DEFB 87,255,2,254,0,1,8,8 62253 DEFB 8,8,8,8,24,0,8,8 62261 DEFB 8,8,12,4,6,3,0,1 62269 DEFB 16,16,16,48,32,96,192,0 62277 DEFB 1 ; Graphics Characters Part 2 ; ; All character graphics are (2 x 4). Forbin b62278 DEFB 0,0,0,0,0,0,0,0 62286 DEFB 7,128,31,224,63,240,127,248 62294 DEFB 127,248,127,128,126,60,124,252 62302 DEFB 125,240,99,240,47,224,31,0 62310 DEFB 24,0,7,0,19,128,27,192 62318 DEFB 27,192,24,0,3,224,24,0 62326 DEFB 27,224,7,192,15,128,15,128 62334 DEFB 7,0,0,224,7,248,7,248 ; Forbin (Mask) 62342 DEFB 255,255,255,255,255,255,240,63 62350 DEFB 192,15,128,7,0,3,0,3 62358 DEFB 0,3,0,1,0,1,0,1 62366 DEFB 0,1,0,7,0,7,128,15 62374 DEFB 192,127,192,63,192,31,192,31 62382 DEFB 192,31,192,15,192,15,192,15 62390 DEFB 192,7,192,15,224,31,224,63 62398 DEFB 224,15,240,3,240,3,240,3 ; Hectorr 62406 DEFB 0,0,7,224,31,248,63,252 62414 DEFB 123,222,119,238,107,214,126,126 62422 DEFB 124,62,125,190,99,198,47,244 62430 DEFB 31,248,15,240,15,240,29,184 62438 DEFB 31,248,31,248,63,252,111,246 62446 DEFB 103,230,115,206,121,158,61,188 62454 DEFB 31,248,15,240,3,192,3,192 62462 DEFB 3,192,119,238,126,126,126,126 ; Hectorr (Mask) 62470 DEFB 240,15,192,3,128,1,0,0 62478 DEFB 0,0,0,0,0,0,0,0 62486 DEFB 0,0,0,0,0,0,0,0 62494 DEFB 128,1,192,3,192,3,192,3 62502 DEFB 192,3,128,1,0,0,0,0 62510 DEFB 0,0,0,0,0,0,0,0 62518 DEFB 192,3,192,3,224,7,248,31 62526 DEFB 0,0,0,0,0,0,0,0 ; Graphics (Compacted) Scenery Part 3 (03 x 06) Patterned Column b62534 DEFB 0,8,126,0,1,126,255,5 62542 DEFB 0,13,1,1,1,243,243,255 62550 DEFB 3,199,131,131,0,5,128,128 62558 DEFB 128,1,1,1,1,1,1,3 62566 DEFB 3,131,199,255,5,248,128,128 62574 DEFB 128,128,128,128,192,192,3,3 62582 DEFB 3,3,3,3,3,3,240,240 62590 DEFB 240,152,159,255,2,199,64,64 62598 DEFB 64,192,192,192,192,192,3,3 62606 DEFB 3,3,3,3,3,0,1,131 62614 DEFB 1,1,1,131,199,255,1,0 62622 DEFB 1,192,192,192,192,192,192,192 62630 DEFB 0,2,3,7,7,15,15,15 62638 DEFB 0,2,255,1,193,248,254,254 62646 DEFB 255,1,0,2,192,192,224,32 62654 DEFB 48,240,0,1 ; (05 x 03) Picture (1) 62658 DEFB 255,2,192,192,192,192,205,205 62666 DEFB 255,2,0,4,128,192,255,2 62674 DEFB 0,5,7,255,2,0,5,240 62682 DEFB 255,2,3,3,3,3,3,3 62690 DEFB 192,192,192,192,192,192,192,192 62698 DEFB 240,120,63,0,5,31,0,1 62706 DEFB 255,1,0,1,63,7,7,31 62714 DEFB 220,0,1,254,0,1,255,2 62722 DEFB 128,240,3,3,3,3,243,131 62730 DEFB 3,3,192,192,192,192,192,192 62738 DEFB 255,2,0,6,255,2,0,6 62746 DEFB 255,2,0,6,255,2,3,3 62754 DEFB 3,3,3,3,255,2 ; (05 x 03) Picture (2) 62760 DEFB 255,2,192,192,193,193,193,192 62768 DEFB 255,2,0,1,224,240,176,240 62776 DEFB 248,255,2,0,6,255,2,0 62784 DEFB 1,28,62,54,62,60,255,2 62792 DEFB 3,3,3,3,3,3,192,192 62800 DEFB 192,192,192,192,192,192,13,3 62808 DEFB 3,0,1,15,15,0,2,254 62816 DEFB 205,205,0,1,255,3,0,1 62824 DEFB 96,128,128,0,1,240,240,0 62832 DEFB 2,3,3,3,3,3,3,3 62840 DEFB 3,192,192,192,192,192,192,255 62848 DEFB 2,0,6,255,2,0,6,255 62856 DEFB 2,0,6,255,2,3,3,3 62864 DEFB 3,3,3,255,2 ; (03 x 04) Left half of Reel-to-Reel Tape Device 62869 DEFB 3,7,5,5,5,5,5,5 62877 DEFB 255,2,128,182,182,191,128,255 62885 DEFB 3,0,1,219,219,255,1,0 62893 DEFB 1,255,1,5,5,5,5,5 62901 DEFB 5,5,5,255,1,248,224,192 62909 DEFB 128,160,112,120,255,1,63,207 62917 DEFB 247,251,251,253,253,5,5,5 62925 DEFB 5,5,5,5,5,124,120,96 62933 DEFB 128,128,192,224,248,1,1,129 62941 DEFB 195,227,247,207,0,1,5,5 62949 DEFB 5,5,5,6,3,0,1,255 62957 DEFB 1,252,248,248,248,252,255,1 62965 DEFB 0,1,255,1,124,56,56,56 62973 DEFB 124,255,1,0,1 ; (03 x 05) Left half of Tyme Guardians' Symbol (1) 62978 DEFB 0,4,1,3,7,15,0,1 62986 DEFB 15,63,255,4,248,0,1,240 62994 DEFB 248,252,252,252,240,0,1,31 63002 DEFB 31,63,63,126,126,126,126,224 63010 DEFB 128,0,2,1,3,7,15,0 63018 DEFB 1,15,63,255,4,248,126,126 63026 DEFB 126,126,127,63,63,31,31,31 63034 DEFB 63,63,126,126,254,254,224,192 63042 DEFB 0,1,1,1,3,3,7,31 63050 DEFB 15,7,3,1,0,3,254,254 63058 DEFB 254,254,255,2,63,31,7,15 63066 DEFB 15,15,7,3,128,192,0,8 63074 DEFB 31,15,7,3,1,0,3,224 63082 DEFB 248,255,4,63,15,1 ; (06 x 03) Tyme Guardians' Symbol (2) 63088 DEFB 0,4,31,63,63,63,0,4 63096 DEFB 255,4,0,4,63,3,1,60 63104 DEFB 0,4,60,128,192,252,0,4 63112 DEFB 127,127,127,127,0,4,248,252 63120 DEFB 252,252,63,63,31,31,15,7 63128 DEFB 3,1,128,192,224,241,251,255 63136 DEFB 3,0,2,126,255,2,231,199 63144 DEFB 135,0,2,63,127,127,123,121 63152 DEFB 120,0,1,1,3,199,239,255 63160 DEFB 3,252,252,248,248,240,224,192 63168 DEFB 128,0,5,1,1,0,1,126 63176 DEFB 0,3,255,4,15,31,63,126 63184 DEFB 254,252,248,192,120,124,126,63 63192 DEFB 63,31,15,1,62,0,3,255 63200 DEFB 4,0,5,128,128,0,1,128 ; (01 x 02 / 02 x 01) Unknown / Unused Graphic or 63208 DEFB 192,252,0,4,127,127,127,127 63216 DEFB 0,4,248,252 ; Graphics Magic Knight ; ; All Magic Knight frames are (3 x 4). Facing Right, Frame 1 b63220 DEFB 0,0,0,0,0,0,7,224 63228 DEFB 0,31,240,0,62,15,0,113 63236 DEFB 255,128,14,73,128,114,73,128 63244 DEFB 98,73,128,126,73,128,7,201 63252 DEFB 128,48,127,0,31,128,0,15 63260 DEFB 254,0,3,254,0,0,240,0 63268 DEFB 1,224,0,3,48,0,3,56 63276 DEFB 0,3,24,0,3,156,0,3 63284 DEFB 220,0,3,220,0,3,220,0 63292 DEFB 3,248,0,1,240,0,0,224 63300 DEFB 0,0,224,0,0,240,0,1 63308 DEFB 252,0,1,254,0,0,254,0 ; Facing Right, Frame 2 63316 DEFB 0,0,0,0,0,0,1,248 63324 DEFB 0,7,252,0,15,131,192,28 63332 DEFB 127,224,3,146,96,28,146,96 63340 DEFB 24,146,96,31,146,96,1,242 63348 DEFB 96,12,31,192,7,224,0,3 63356 DEFB 255,128,0,255,128,0,60,0 63364 DEFB 0,120,0,0,204,0,0,204 63372 DEFB 0,0,206,0,0,207,0,0 63380 DEFB 207,0,0,223,0,0,255,0 63388 DEFB 0,62,0,0,124,0,0,123 63396 DEFB 128,0,251,128,3,143,128,3 63404 DEFB 143,128,3,207,0,3,207,0 ; Facing Right, Frame 3 63412 DEFB 0,0,0,0,0,0,0,126 63420 DEFB 0,1,255,0,3,224,240,7 63428 DEFB 31,248,0,228,152,7,36,152 63436 DEFB 6,36,152,7,228,152,0,124 63444 DEFB 152,3,7,240,1,248,0,0 63452 DEFB 255,224,0,63,224,0,15,0 63460 DEFB 0,30,0,0,51,0,0,51 63468 DEFB 0,0,51,128,0,51,192,0 63476 DEFB 61,192,0,61,192,0,61,192 63484 DEFB 1,223,152,1,223,56,1,239 63492 DEFB 120,0,239,248,0,241,224,0 63500 DEFB 113,224,0,49,192,0,49,192 ; Facing Right, Frame 4 63508 DEFB 0,0,0,0,0,0,0,31 63516 DEFB 128,0,127,192,0,248,60,1 63524 DEFB 199,254,0,57,38,1,201,38 63532 DEFB 1,137,38,1,249,38,0,31 63540 DEFB 38,0,193,252,0,126,0,0 63548 DEFB 63,248,0,15,248,0,3,192 63556 DEFB 0,7,128,0,12,192,0,12 63564 DEFB 64,0,14,96,0,14,112,0 63572 DEFB 15,112,0,15,240,0,15,240 63580 DEFB 0,15,224,0,111,192,0,123 63588 DEFB 184,0,123,56,0,124,248,0 63596 DEFB 60,248,0,12,240,0,12,240 ; Facing Left, Frame 4 63604 DEFB 0,0,0,0,0,0,1,248 63612 DEFB 0,3,254,0,60,31,0,127 63620 DEFB 227,128,100,156,0,100,147,128 63628 DEFB 100,145,128,100,159,128,100,248 63636 DEFB 0,63,131,0,0,126,0,31 63644 DEFB 252,0,31,240,0,3,192,0 63652 DEFB 1,224,0,3,48,0,2,48 63660 DEFB 0,6,112,0,14,112,0,14 63668 DEFB 240,0,15,240,0,15,240,0 63676 DEFB 7,240,0,3,246,0,29,222 63684 DEFB 0,28,222,0,31,62,0,31 63692 DEFB 60,0,15,48,0,15,48,0 ; Facing Left, Frame 3 63700 DEFB 0,0,0,0,0,0,0,126 63708 DEFB 0,0,255,128,15,7,192,31 63716 DEFB 248,224,25,39,0,25,36,224 63724 DEFB 25,36,96,25,39,224,25,62 63732 DEFB 0,15,224,192,0,31,128,7 63740 DEFB 255,0,7,252,0,0,240,0 63748 DEFB 0,120,0,0,204,0,0,204 63756 DEFB 0,1,204,0,3,204,0,3 63764 DEFB 188,0,3,188,0,3,188,0 63772 DEFB 25,251,128,28,251,128,30,247 63780 DEFB 128,31,247,0,7,143,0,7 63788 DEFB 142,0,3,140,0,3,140,0 ; Facing Left, Frame 2 63796 DEFB 0,0,0,0,0,0,0,31 63804 DEFB 128,0,63,224,3,193,240,7 63812 DEFB 254,56,6,73,192,6,73,56 63820 DEFB 6,73,24,6,73,248,6,79 63828 DEFB 128,3,248,48,0,7,224,1 63836 DEFB 255,192,1,255,0,0,60,0 63844 DEFB 0,30,0,0,51,0,0,51 63852 DEFB 0,0,115,0,0,243,0,0 63860 DEFB 243,0,0,251,0,0,255,0 63868 DEFB 0,124,0,0,62,0,1,222 63876 DEFB 0,1,223,0,1,241,192,1 63884 DEFB 241,192,0,243,192,0,243,192 ; Facing Left, Frame 1 63892 DEFB 0,0,0,0,0,0,0,7 63900 DEFB 224,0,15,248,0,240,124,1 63908 DEFB 255,142,1,146,112,1,146,78 63916 DEFB 1,146,70,1,146,126,1,147 63924 DEFB 224,0,254,12,0,1,248,0 63932 DEFB 127,240,0,127,192,0,15,0 63940 DEFB 0,7,128,0,12,192,0,28 63948 DEFB 192,0,24,192,0,57,192,0 63956 DEFB 59,192,0,59,192,0,59,192 63964 DEFB 0,31,192,0,15,128,0,7 63972 DEFB 0,0,7,0,0,15,0,0 63980 DEFB 63,128,0,127,128,0,127,0 ; Facing Right, Frame 1 (Mask) 63988 DEFB 255,255,255,240,15,255,192,7 63996 DEFB 255,128,0,255,0,0,63,0 64004 DEFB 0,63,0,0,63,0,0,63 64012 DEFB 0,0,63,0,0,63,0,0 64020 DEFB 63,128,0,63,192,0,255,224 64028 DEFB 0,255,240,0,255,252,0,255 64036 DEFB 252,15,255,248,7,255,248,3 64044 DEFB 255,248,1,255,248,1,255,248 64052 DEFB 1,255,248,1,255,248,1,255 64060 DEFB 248,3,255,252,7,255,254,15 64068 DEFB 255,254,15,255,254,3,255,252 64076 DEFB 1,255,252,0,255,252,0,255 ; Facing Right, Frame 2 (Mask) 64084 DEFB 255,255,255,252,3,255,240,1 64092 DEFB 255,224,0,63,192,0,15,192 64100 DEFB 0,15,192,0,15,192,0,15 64108 DEFB 192,0,15,192,0,15,192,0 64116 DEFB 15,224,0,15,240,0,63,248 64124 DEFB 0,63,252,0,63,255,0,63 64132 DEFB 255,0,255,254,0,255,254,0 64140 DEFB 255,254,0,127,254,0,127,254 64148 DEFB 0,127,254,0,127,254,0,127 64156 DEFB 255,128,255,255,0,127,255,0 64164 DEFB 63,248,0,63,248,0,63,248 64172 DEFB 32,63,248,0,127,248,0,127 ; Facing Right, Frame 3 (Mask) 64180 DEFB 255,255,255,255,0,255,252,0 64188 DEFB 127,248,0,15,240,0,3,240 64196 DEFB 0,3,240,0,3,240,0,3 64204 DEFB 240,0,3,240,0,3,240,0 64212 DEFB 3,248,0,3,252,0,15,254 64220 DEFB 0,15,255,0,15,255,192,15 64228 DEFB 255,192,255,255,128,127,255,128 64236 DEFB 127,255,128,63,255,128,31,255 64244 DEFB 128,31,255,128,31,254,0,7 64252 DEFB 252,0,3,252,0,3,252,0 64260 DEFB 3,252,0,3,254,0,7,255 64268 DEFB 4,15,255,132,31,255,132,31 ; Facing Right, Frame 4 (Mask) 64276 DEFB 255,255,255,255,192,63,255,0 64284 DEFB 31,254,0,3,252,0,0,252 64292 DEFB 0,0,252,0,0,252,0,0 64300 DEFB 252,0,0,252,0,0,252,0 64308 DEFB 0,254,0,0,255,0,3,255 64316 DEFB 128,3,255,192,3,255,240,3 64324 DEFB 255,240,63,255,224,31,255,224 64332 DEFB 31,255,224,15,255,224,7,255 64340 DEFB 224,7,255,224,7,255,224,7 64348 DEFB 255,128,15,255,0,7,255,0 64356 DEFB 3,255,0,3,255,0,3,255 64364 DEFB 128,3,255,192,7,255,224,7 ; Facing Left, Frame 4 (Mask) 64372 DEFB 255,255,255,252,3,255,248,0 64380 DEFB 255,192,0,127,0,0,63,0 64388 DEFB 0,63,0,0,63,0,0,63 64396 DEFB 0,0,63,0,0,63,0,0 64404 DEFB 63,0,0,127,192,0,255,192 64412 DEFB 1,255,192,3,255,192,15,255 64420 DEFB 252,15,255,248,7,255,248,7 64428 DEFB 255,240,7,255,224,7,255,224 64436 DEFB 7,255,224,7,255,224,7,255 64444 DEFB 240,1,255,224,0,255,192,0 64452 DEFB 255,192,0,255,192,0,255,192 64460 DEFB 1,255,224,3,255,224,7,255 ; Facing Left, Frame 3 (Mask) 64468 DEFB 255,255,255,255,0,255,254,0 64476 DEFB 63,240,0,31,192,0,15,192 64484 DEFB 0,15,192,0,15,192,0,15 64492 DEFB 192,0,15,192,0,15,192,0 64500 DEFB 15,192,0,31,240,0,63,240 64508 DEFB 0,127,240,0,255,240,3,255 64516 DEFB 255,3,255,254,1,255,254,1 64524 DEFB 255,252,1,255,248,1,255,248 64532 DEFB 1,255,248,1,255,224,0,127 64540 DEFB 192,0,63,192,0,63,192,0 64548 DEFB 63,192,0,63,224,0,127,240 64556 DEFB 32,255,248,33,255,248,33,255 ; Facing Left, Frame 2 (Mask) 64564 DEFB 255,255,255,255,192,63,255,128 64572 DEFB 15,252,0,7,240,0,3,240 64580 DEFB 0,3,240,0,3,240,0,3 64588 DEFB 240,0,3,240,0,3,240,0 64596 DEFB 3,240,0,7,252,0,15,252 64604 DEFB 0,31,252,0,63,252,0,255 64612 DEFB 255,0,255,255,0,127,255,0 64620 DEFB 127,254,0,127,254,0,127,254 64628 DEFB 0,127,254,0,127,254,0,127 64636 DEFB 255,1,255,254,0,255,252,0 64644 DEFB 255,252,0,31,252,0,31,252 64652 DEFB 4,31,254,0,31,254,0,31 ; Facing Left, Frame 1 (Mask) 64660 DEFB 255,255,255,255,240,15,255,224 64668 DEFB 3,255,0,1,252,0,0,252 64676 DEFB 0,0,252,0,0,252,0,0 64684 DEFB 252,0,0,252,0,0,252,0 64692 DEFB 0,252,0,1,255,0,3,255 64700 DEFB 0,7,255,0,15,255,0,63 64708 DEFB 255,240,63,255,224,31,255,192 64716 DEFB 31,255,128,31,255,128,31,255 64724 DEFB 128,31,255,128,31,255,128,31 64732 DEFB 255,192,31,255,224,63,255,240 64740 DEFB 127,255,240,127,255,192,127,255 64748 DEFB 128,63,255,0,63,255,0,63 ; Graphics (01 x 96) Character Set b64756 DEFB 0,0,0,0,0,0,0,0 ; (032) - SPACE 64764 DEFB 0,48,48,48,48,0,48,48 ; (033) - ! 64772 DEFB 0,108,108,0,0,0,0,0 ; (034) - " 64780 DEFB 0,248,252,14,14,252,248,0 ; (035) - Room Name Bar Cap (right end) 64788 DEFB 0,31,63,112,112,63,31,0 ; (036) - Room Name Bar Cap (left end) 64796 DEFB 0,98,100,8,16,38,70,0 ; (037) - % 64804 DEFB 0,56,108,59,126,108,127,59 ; (038) - & 64812 DEFB 0,12,24,16,0,0,0,0 ; (039) - ' 64820 DEFB 0,12,24,24,24,24,12,4 ; (040) - ( 64828 DEFB 0,48,24,24,24,24,48,32 ; (041) - ) 64836 DEFB 0,0,36,24,126,24,36,0 ; (042) - * 64844 DEFB 0,24,24,126,126,24,24,0 ; (043) - + 64852 DEFB 0,0,0,0,0,12,12,24 ; (044) - , 64860 DEFB 0,0,0,62,62,0,0,0 ; (045) - - 64868 DEFB 0,0,0,0,0,0,24,24 ; (046) - . 64876 DEFB 0,6,14,28,56,112,96,0 ; (047) - / 64884 DEFB 0,60,126,110,126,118,126,60 ; (048) - 0 64892 DEFB 0,28,60,44,12,12,63,63 ; (049) - 1 64900 DEFB 0,60,126,14,60,112,126,126 ; (050) - 2 64908 DEFB 0,60,126,102,12,102,126,60 ; (051) - 3 64916 DEFB 0,28,60,108,126,126,12,12 ; (052) - 4 64924 DEFB 0,126,126,96,124,6,126,124 ; (053) - 5 64932 DEFB 0,60,124,96,124,102,126,60 ; (054) - 6 64940 DEFB 0,126,126,14,28,24,24,24 ; (055) - 7 64948 DEFB 0,60,126,102,60,102,126,60 ; (056) - 8 64956 DEFB 0,60,126,102,62,6,62,60 ; (057) - 9 64964 DEFB 0,0,24,24,0,0,24,24 ; (058) - : 64972 DEFB 0,0,24,24,0,24,24,48 ; (059) - ; 64980 DEFB 0,0,6,12,24,24,12,6 ; (060) - < 64988 DEFB 0,0,0,62,0,62,0,0 ; (061) - = 64996 DEFB 0,0,96,48,24,24,48,96 ; (062) - > 65004 DEFB 0,60,110,30,28,0,24,24 ; (063) - ? 65012 DEFB 0,60,126,227,223,227,126,60 ; (064) - COPYRIGHT 65020 DEFB 0,60,126,102,126,126,102,102 ; (065) - A 65028 DEFB 0,124,126,102,124,102,126,124 ; (066) - B 65036 DEFB 0,60,126,102,96,102,126,60 ; (067) - C 65044 DEFB 0,120,124,110,102,110,124,120 ; (068) - D 65052 DEFB 0,126,126,96,124,96,126,126 ; (069) - E 65060 DEFB 0,126,126,96,124,124,96,96 ; (070) - F 65068 DEFB 0,62,126,96,110,102,126,60 ; (071) - G 65076 DEFB 0,102,102,126,126,102,102,102 ; (072) - H 65084 DEFB 0,126,126,24,24,24,126,126 ; (073) - I 65092 DEFB 0,6,6,6,102,102,126,60 ; (074) - J 65100 DEFB 0,110,124,120,124,110,102,102 ; (075) - K 65108 DEFB 0,96,96,96,96,96,126,126 ; (076) - L 65116 DEFB 0,198,254,254,214,198,198,198 ; (077) - M 65124 DEFB 0,102,118,126,110,102,102,102 ; (078) - N 65132 DEFB 0,60,126,102,102,102,126,60 ; (079) - O 65140 DEFB 0,124,126,102,126,124,96,96 ; (080) - P 65148 DEFB 0,60,126,102,118,110,126,60 ; (081) - Q 65156 DEFB 0,124,126,102,124,126,102,102 ; (082) - R 65164 DEFB 0,60,124,96,60,6,126,124 ; (083) - S 65172 DEFB 0,254,254,48,48,48,48,48 ; (084) - T 65180 DEFB 0,102,102,102,102,102,126,60 ; (085) - U 65188 DEFB 0,102,102,102,102,102,60,24 ; (086) - V 65196 DEFB 0,102,102,102,102,126,126,36 ; (087) - W 65204 DEFB 0,231,255,60,60,126,231,195 ; (088) - X 65212 DEFB 0,195,231,126,60,24,24,24 ; (089) - Y 65220 DEFB 0,126,126,28,56,112,126,126 ; (090) - Z 65228 DEFB 255,255,0,120,88,88,88,88 ; (091) - Railings (USS Pisces Bridge) 65236 DEFB 255,0,255,255,0,255,255,255 ; (092) - USS Pisces Floor / bottom of transporter pad 65244 DEFB 0,255,255,0,0,255,255,0 ; (093) - Room Name Bar Body 65252 DEFB 0,0,127,255,255,0,63,0 ; (094) - Unused 65260 DEFB 0,0,255,255,255,0,255,0 ; (095) - Unused 65268 DEFB 0,36,126,36,36,126,36,0 ; (096) - # 65276 DEFB 126,126,126,0,239,239,239,0 ; (097) - Unused 65284 DEFB 31,103,207,207,207,103,31,0 ; (098) - Unused 65292 DEFB 240,252,254,254,254,252,240,0 ; (099) - Unused 65300 DEFB 153,0,34,8,160,4,24,146 ; (100) - Floor (Retreat / Monopole) 65308 DEFB 145,0,20,193,73,32,132,1 ; (101) - Unused 65316 DEFB 73,24,32,5,16,68,0,153 ; (102) - Unused 65324 DEFB 128,33,4,146,131,40,0,137 ; (103) - Unused 65332 DEFB 90,60,118,110,118,110,60,90 ; (104) - Unused 65340 DEFB 24,60,118,110,118,110,60,24 ; (105) - Unused 65348 DEFB 0,0,0,0,0,0,0,0 ; (106) - Unused 65356 DEFB 0,0,0,0,0,0,0,0 ; (107) - Unused 65364 DEFB 126,126,102,195,24,60,255,0 ; (108) - Starbase 1 Floor 65372 DEFB 255,60,24,195,102,126,60,129 ; (109) - Outpost Floor 65380 DEFB 126,66,153,36,36,153,66,126 ; (110) - Control Column Floor 65388 DEFB 255,85,85,170,170,85,85,170 ; (111) - Life Boat Floor 65396 DEFB 255,51,51,204,204,51,51,204 ; (112) - Unused 65404 DEFB 255,68,238,68,187,68,238,68 ; (113) - Unused 65412 DEFB 0,0,0,0,0,0,0,0 ; (114) - Unused 65420 DEFB 0,0,0,0,0,0,0,0 ; (115) - Unused 65428 DEFB 255,255,0,0,0,255,255,0 ; (116) - Window border (top edge) 65436 DEFB 0,255,255,0,0,0,255,255 ; (117) - Window border (bottom edge) 65444 DEFB 198,198,198,198,198,198,198,198 ; (118) - Window border (left edge) 65452 DEFB 99,99,99,99,99,99,99,99 ; (119) - Window border (right edge) 65460 DEFB 252,254,15,31,59,243,227,99 ; (120) - Window border (top right corner) 65468 DEFB 99,227,243,59,31,15,254,252 ; (121) - Window border (bottom right corner) 65476 DEFB 198,199,207,220,248,240,127,63 ; (122) - Window border (bottom left corner) 65484 DEFB 63,127,240,248,220,207,199,198 ; (123) - Window border (top left corner) 65492 DEFB 130,212,72,37,33,70,148,148 ; (124) - Unused 65500 DEFB 0,16,56,84,16,16,16,0 ; (125) - ^ 65508 DEFB 0,28,62,112,124,48,126,126 ; (126) - £ 65516 DEFB 224,128,239,41,239,8,8,8 ; (127) - SP (used to denote SPACE in Current Keyboard Controls text) ; Interrupt Routine (Jump 2) ; ; Note - original values here are 16, 16, 16. These are modified to the JP instruction by instructions between 26655 ; and 26663 @ssub=JP 53479 c65524 DEFB 16,16,16 ; Jump to main part of interrupt routine at #R53479 ; Unused b65527 DEFB 0,0,66,0,0,0,0,0 ; Interrupt Routine (Jump 1) ; ; Note - original value at 65535 is 0. This is modified to the JR instruction by instruction at 26652. The operand ; comes from next byte (location 0 in ROM.) @ssub=JR 65524 c65535 NOP ; Jump to next part of interrupt routine