; SkoolKit disassembly for Stormbringer (48k) ; ; Copyright (c) 2017 Philip M. Anderson (this disassembly) ; Copyright (c) 1987 David Jones / Mastertronic (Stormbringer) @start=37632 @org ; Miscellaneous Data 1 b23296 DEFB 0,0 ; Temporary storage (e.g. scrolling graphics) 23298 DEFB 0 ; Terrain Interaction Parameter Painting Bitmap for 2x2 block currently being drawn ; Temporary Storage Area for Background Graphics b23299 DEFB 0,0,0,0,0,0,0,0 23307 DEFB 0,0,0,0,0,0,0,0 23315 DEFB 0,0,0,0,0,0,0,0 23323 DEFB 0,0,0,0,0,0,0,0 23331 DEFB 0,0,0,0,0,0,0,0 23339 DEFB 0,0,0,0,0,0,0,0 23347 DEFB 0,0,0,0,0,0,0,0 23355 DEFB 0,0,0,0,0,0,0,0 ; Unused b23363 DEFB 0 ; Miscellaneous Data 2 b23364 DEFB 0 ; Unused (see trivia) 23365 DEFB 0 ; Wish Pending Flag (index of last object (egg) dropped down the Wishing Well) ; Unused b23366 DEFB 0 ; Miscellaneous Data 3 b23367 DEFB 0 ; Character Is Incoming Flag ; Table of Glowing Attribute File Addresses ; ; Up to fifteen WORDs can be stored here. Each entry is an address in Attribute File and represents a character ; block on the screen that is glowing (e.g. area of floor that leads to lower floor, flames etc.) b23368 DEFW 0 ; Glow 1 23370 DEFW 0 ; Glow 2 23372 DEFW 0 ; Glow 3 23374 DEFW 0 ; Glow 4 23376 DEFW 0 ; Glow 5 23378 DEFW 0 ; Glow 6 23380 DEFW 0 ; Glow 7 23382 DEFW 0 ; Glow 8 23384 DEFW 0 ; Glow 9 23386 DEFW 0 ; Glow 10 23388 DEFW 0 ; Glow 11 23390 DEFW 0 ; Glow 12 23392 DEFW 0 ; Glow 13 23394 DEFW 0 ; Glow 14 23396 DEFW 0 ; Glow 15 ; Miscellaneous Data 4 ; ; 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. b23398 DEFB 0 ; Text Printing Routine Recursion Depth Counter ; Unused b23399 DEFB 0,0,0 ; Main Lever Flags ; ; Seven bits, each one corresponding to a Main Lever. The eighth bit is unused. b23402 DEFB 0 ; Off-White Knight Sent To Sleep Flag ; ; This value is normally either 0 or 255. A value of 255 indicates that Off-White Knight has had the Magic Missile ; thrown at him. b23403 DEFB 0 ; Miscellaneous Data 5 b23404 DEFB 0 ; x-coordinate of left edge of region to scroll (characters) 23405 DEFB 0 ; x-coordinate of right edge of region to scroll (characters) 23406 DEFB 0 ; y-coordinate of top of region to scroll (pixels) 23407 DEFB 0 ; y-coordinate of bottom of region to scroll (pixels) 23408 DEFB 0 ; x-coordinate of left edge (of frame, or of interior) of current window to draw (characters) / ; graphic (room drawing) 23409 DEFB 0 ; y-coordinate of top edge (of frame, or of interior) of current window to draw (characters) / ; graphic (room drawing) 23410 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) 23411 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) 23412 DEFW 0 ; Pointer to entry in Table of Display File Addresses for pixel row at Magic Knight's current ; y-coordinate 23414 DEFB 0 ; Temporary store for Magic Knight's x-coordinate in characters 23415 DEFB 0 ; Temporary store for Magic Knight's x-coordinate in characters (stored by instruction at ; #R61897 but otherwise unused) 23416 DEFB 0 ; Temporary store for Magic Knight's y-coordinate in pixels (stored by instruction at #R61903 ; but otherwise unused) 23417 DEFB 0 ; Magic Knight Facing Left Flag 23418 DEFB 0 ; Temporary store for x-coordinate of left edge (of frame, or of interior) of current window to ; draw (characters) / graphic (room drawing) 23419 DEFB 0 ; Temporary store for y-coordinate of top edge (of frame, or of interior) of current window to ; draw (characters) / graphic (room drawing) 23420 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) 23421 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) ; Table of Characters in Room of Interest ; ; List of characters in a particular room, as set by the routine at #R46408 b23422 DEFB 0,0,0,0,0,0,0,0 ; Miscellaneous Data 6 b23430 DEFB 0,0,0,0,0 ; Storage space for ASCII string converted from numeric value ; Unused b23435 DEFB 0 ; Miscellaneous Data 7 b23436 DEFB 0 ; Compass Glow Update Flag (see trivia) 23437 DEFB 0 ; Do Not Draw Axes Flag 23438 DEFB 0 ; Current Disquise 23439 DEFB 0 ; Robin Has Been Paid Flag ; Unused b23440 DEFB 0 ; Miscellaneous Data 8 b23441 DEFB 0 ; Redraw Magic Knight On Next Interrupt Flag 23442 DEFW 0 ; Store for address of current position in Magic Knight's y-velocities sequence table at ; #R49019 23444 DEFB 0 ; x-coordinate of graphic to draw 23445 DEFB 0 ; y-coordinate of graphic to draw 23446 DEFB 0 ; Bonus Score 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 #R61214, #R61236, #R61267, #R61297, #R61336, #R61418 and #R61521 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 ; Miscellaneous Data 9 b23451 DEFB 0 ; Magic Knight's temporary movement flags 23452 DEFB 0 ; Drawing Layout Data Fragment Flag 23453 DEFB 0,0 ; Temporary store for current position in room layout data (fragment drawing) 23455 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 b23457 DEFB 0 ; Current Time Left - game hours (5 real-time minutes per game hour) 23458 DEFB 0 ; Minute Counter (Time Elapsed since last "hour") 23459 DEFB 0 ; Second Counter (Time Elapsed since last minute) 23460 DEFB 0 ; 1/50 Second Counter (Time Elapsed since last second) ; Draw 2x1 Blocks Flag ; ; Flag that determines whether or not to only draw the top two characters in 2x2 blocks. The instructions between ; #R41347 and #R41351 inclusive are set up to skip rendering of the lower two character cells in a 2x2 block if this ; value is not zero, however this flag is never modified, meaning that 2x1 blocks are never drawn. b23461 DEFB 0 ; Miscellaneous Data 10 b23462 DEFB 0 ; Current INK Colour of Glowing Blocks 23463 DEFW 0 ; Temporary store for coordinates for 2x2 block drawing 23465 DEFB 0 ; Current progress through cave (0 = rightmost room) 23466 DEFB 0 ; Index of next object to be laid by Chicken ; Unused b23467 DEFB 0,0,0,0 ; y- and x- coordinates of top-left corner of currently glowing Locate Compass sector ; ; (See trivia) b23471 DEFB 0,0 ; Miscellaneous Data 11 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 12 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) ; Animate Puff of Smoke Flag ; ; #TABLE(default,centre,:w) ; { =h Value | =h Effect } ; { 0 | Reset (don't animate smoke) } ; { Any other value | Set (animate smoke) } ; TABLE# b23480 DEFB 0 ; Miscellaneous Data 13 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 #R38585) 23483 DEFB 0 ; Magic Knight's predicted y-coordinate (used in routine at #R38585) 23484 DEFB 0 ; Current Password Number 23485 DEFB 0 ; Terrain interaction parameter to apply for 2x2 block currently being drawn 23486 DEFB 0 ; Unused (see trivia) 23487 DEFB 0 ; Store for currently active keyboard press / joystick action ; Visited Room Flags ; ; Fifty-two 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. b23488 DEFB 0 ; (00) - Limbo 23489 DEFB 0 ; (01) - Outdoors, 0 (Bearwoolf's Hoard) 23490 DEFB 0 ; (02) - Outdoors, 1 (Bearwoolf's Cave) 23491 DEFB 0 ; (03) - Outdoors, 2 (Beware Bearwoolf) 23492 DEFB 0 ; (04) - Outdoors, 3 (The Spooky Forest, 1) 23493 DEFB 0 ; (05) - Outdoors, 4 23494 DEFB 0 ; (06) - Outdoors, 5 (The Spooky Forest, 2) 23495 DEFB 0 ; (07) - Outdoors, 6 (The Sword in the Concrete) 23496 DEFB 0 ; (08) - Outdoors, 7 (Robin's Little Hut) 23497 DEFB 0 ; (09) - Outdoors, 8 (Exit from Limbo) 23498 DEFB 0 ; (10) - Outdoors, 9 (More Spooky Forest) 23499 DEFB 0 ; (11) - Outdoors, 10 (Entwood) 23500 DEFB 0 ; (12) - Outdoors, 11 (The Spooky Forest, 3) 23501 DEFB 0 ; (13) - Outdoors, 12 (The Spooky Forest, 4) 23502 DEFB 0 ; (14) - Outdoors, 13 (Wishing Well) 23503 DEFB 0 ; (15) - Outdoors, 14 23504 DEFB 0 ; (16) - Outdoors, 15 (The Castle Entrance) 23505 DEFB 0 ; (17) - Castle Ground Floor, 0 (One Axe Room) 23506 DEFB 0 ; (18) - Castle Ground Floor, 1 (Indoor Bowling Green) 23507 DEFB 0 ; (19) - Castle Ground Floor, 2 23508 DEFB 0 ; (20) - Castle Ground Floor, 3 23509 DEFB 0 ; (21) - Castle Ground Floor, 4 (More Axe Problems) 23510 DEFB 0 ; (22) - Castle Ground Floor, 5 (Even More Axes) 23511 DEFB 0 ; (23) - Castle Ground Floor, 6 (The First Jump Chute) 23512 DEFB 0 ; (24) - Castle First Floor, 0 (Main Lever 7) 23513 DEFB 0 ; (25) - Castle First Floor, 1 (Main Lever 6) 23514 DEFB 0 ; (26) - Castle First Floor, 2 (Security Door & Main Lever 5) 23515 DEFB 0 ; (27) - Castle First Floor, 3 (Main Lever 4) 23516 DEFB 0 ; (28) - Castle First Floor, 4 (Main Lever 3) 23517 DEFB 0 ; (29) - Castle First Floor, 5 (Main Lever 2) 23518 DEFB 0 ; (30) - Castle First Floor, 6 (Main Lever 1) 23519 DEFB 0 ; (31) - Castle Second Floor, 0 (The Broken Teleport) 23520 DEFB 0 ; (32) - Castle Second Floor, 1 (Terrible Twins) 23521 DEFB 0 ; (33) - Castle Second Floor, 2 (The Guardian Statues) 23522 DEFB 0 ; (34) - Castle Second Floor, 3 (One Way Corridor, 1) 23523 DEFB 0 ; (35) - Castle Second Floor, 4 (One Way Corridor, 2) 23524 DEFB 0 ; (36) - Castle Second Floor, 5 (One Way Corridor, 3) 23525 DEFB 0 ; (37) - Castle Second Floor, 6 23526 DEFB 0 ; (38) - Castle Third Floor, 0 (Big White Statue) 23527 DEFB 0 ; (39) - Castle Third Floor, 1 23528 DEFB 0 ; (40) - Castle Third Floor, 2 (Teleport Room, 1) 23529 DEFB 0 ; (41) - Castle Third Floor, 3 (One Way Corridor, 4) 23530 DEFB 0 ; (42) - Castle Third Floor, 4 (One Way Corridor, 5) 23531 DEFB 0 ; (43) - Castle Third Floor, 5 (One Way Corridor, 6) 23532 DEFB 0 ; (44) - Castle Third Floor, 6 23533 DEFB 0 ; (45) - Spaceship, 0 (The Control Room) 23534 DEFB 0 ; (46) - Spaceship, 1 (Many Screened Room) 23535 DEFB 0 ; (47) - Spaceship, 2 (Teleport Room, 2) 23536 DEFB 0 ; (48) - Spaceship, 3 23537 DEFB 0 ; (49) - Spaceship, 4 (The Power Plant) 23538 DEFB 0 ; (50) - Spaceship, 5 23539 DEFB 0 ; (51) - Spaceship, 6 ; Unused b23540 DEFB 0,0,0,0,0,0,0,0 23548 DEFB 0,0,0,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 24119 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 ; Miscellaneous Data 14 b23700 DEFB 0 ; Storm Cloud's actual current x-coordinate in its current room 23701 DEFB 0 ; Storm Cloud's apparent (i.e. for drawing) current x-coordinate in its current room ; Magic Knight's current room b23702 DEFB 0 ; Index of Required Disquise ; ; Index of disquise required in the current game in order to enter the Castle. b23703 DEFB 0 ; Store for Display File Address to Print Text to in Command Summary Window b23704 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# b23706 DEFB 0 ; Attribute File address for Virtual Text Cursor b23707 DEFW 0 ; Miscellaneous Data 15 b23709 DEFW 0 ; Address in Terrain Interaction Data at #R23808 for 2x2 block currently being drawn 23711 DEFW 0 ; Temporary storage used by the routine at #R63740 (Redefine Keyboard Controls) 23713 DEFB 0 ; Index of current Crystal Ball substring 23714 DEFB 0 ; Index of current Scroll substring 23715 DEFB 0 ; Storm Cloud's current room 23716 DEFB 0 ; Index of Current Command 23717 DEFB 0,0,0,0,0,0,0,0 23725 DEFB 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 ; Basic loader ; ; The basic loader is set to auto-run from line 0. Line 30 loads the loading screen, and a block of code of length ; 40360 bytes to address 25176. This code block contains the main game code, and after loading it, we jump to the ; start-up routine at 37632. b23755 DEFB 0,10,149 ; 10 CLEAR 25170: PAPER 0: BORDER 0: INK 7: BRIGHT 1: CLS : PRINT BRIGHT 1; INK 7;AT ; 9,3;"STORMBRINGER 48 IS LOADING";AT 12,10;"PLEASE WAIT" 20 PAPER 8: INK 8: BRIGHT 8: ; OVER 1 30 BEEP .1,1: BEEP .1,2: BEEP .1,3: BEEP .1,4: BEEP .1,5: PRINT AT 0,0;: LOAD ; ""CODE 16384: PRINT AT 0,0;: LOAD ""CODE 40 RANDOMIZE USR 37632 23758 DEFB 0,253,50,53,49 23763 DEFB 55,48,14 23766 DEFB 0,0,82,98,0 23771 DEFB 58,218,48 23774 DEFB 14,0,0,0,0 23779 DEFB 0,58,231 23782 DEFB 48,14,0,0,0 23787 DEFB 0,0,58 23790 DEFB 217,55,14,0,0 23795 DEFB 7,0,0 23798 DEFB 58,220,49,14,0 23803 DEFB 0,1,0 23806 DEFB 0,58 ; 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: b23808 DEFB 251,58,245 23811 DEFB 220,49,14,0,0,1,0,0 23819 DEFB 59,217,55,14,0,0,7,0 23827 DEFB 0,59,172,57,14,0,0,9 23835 DEFB 0,0,44,51,14,0,0,3 23843 DEFB 0,0,59,34,83,84,79,82 23851 DEFB 77,66,82,73,78,71,69,82 23859 DEFB 32,52,56,32,73,83,32,76 23867 DEFB 79,65,68,73,78,71,34,59 23875 DEFB 172,49,50,14,0,0,12,0 23883 DEFB 0,44,49,48,14,0,0,10 23891 DEFB 0,0,59,34,80,76,69,65 23899 DEFB 83,69,32,87,65,73,84,34 23907 DEFB 13,0,20,36,0,218,56,14 23915 DEFB 0,0,8,0,0,58,217,56 23923 DEFB 14,0,0,8,0,0,58,220 23931 DEFB 56,14,0,0,8,0,0,58 23939 DEFB 222,49,14,0,0,1,0,0 23947 DEFB 13,0,30,149,0,215,46,49 23955 DEFB 14,125,76,204,204,204,44,49 23963 DEFB 14,0,0,1,0,0,58,215 23971 DEFB 46,49,14,125,76,204,204,204 23979 DEFB 44,50,14,0,0,2,0,0 23987 DEFB 58,215,46,49,14,125,76,204 23995 DEFB 204,204,44,51,14,0,0,3 24003 DEFB 0,0,58,215,46,49,14,125 24011 DEFB 76,204,204,204,44,52,14,0 24019 DEFB 0,4,0,0,58,215,46,49 24027 DEFB 14,125,76,204,204,204,44,53 24035 DEFB 14,0,0,5,0,0,58,245 24043 DEFB 172,48,14,0,0,0,0,0 24051 DEFB 44,48,14,0,0,0,0,0 24059 DEFB 59,58,239,34,34,175,49,54 24067 DEFB 51,56,52,14,0,0,0,64 24075 DEFB 0,58,245,172,48,14,0,0 24083 DEFB 0,0,0,44,48,14,0,0 24091 DEFB 0,0,0,59,58,239,34,34 24099 DEFB 175,13,0,40,14,0,249,192 24107 DEFB 51,55,54,51,50,14,0,0 24115 DEFB 0,147,0,13 24119 DEFB 0,0,0,0,0,0,0,0 24127 DEFB 0,0,0,0,0,0,0,0 24135 DEFB 0,0,0,0,0,0,0,0 24143 DEFB 0,0,0,0,0,0,0,0 24151 DEFB 0,0,0,0,0,0,0,0 24159 DEFB 0,0,0,0,0,0,0,0 24167 DEFB 0,0,0,0,0,0,0,0 24175 DEFB 0,0,0,0,0,0,0,0 24183 DEFB 0,0,0,0,0,0,0,0 24191 DEFB 0,0,0,0,0,0,0,0 24199 DEFB 0,0,0,0,0,0,0,0 24207 DEFB 0,0,0,0,0,0,0,0 24215 DEFB 0,0,0,0,0,0,0,0 24223 DEFB 0,0,0,0,0,0,0,0 24231 DEFB 0,0,0,0,0,0,0,0 24239 DEFB 0,0,0,0,0,0,0,0 24247 DEFB 0,0,0,0,0,0,0,0 24255 DEFB 0,0,0,0,0,0,0,0 24263 DEFB 0,0,0,0,0,0,0,0 24271 DEFB 0,0,0,0,0,0,0,0 24279 DEFB 0,0,0,0,0,0,0,0 24287 DEFB 0,0,0,0,0,0,0,0 24295 DEFB 0,0,0,0,0,0,0,0 24303 DEFB 0,0,0,0,0,0,0,0 24311 DEFB 0,0,0,0,0,0,0,0 24319 DEFB 0,0,0,0,0,0,0,0 24327 DEFB 0,0,0,0,0,0,0,0 24335 DEFB 0,0,0,0,0,0,0,0 24343 DEFB 0,0,0,0,0,0,0,0 24351 DEFB 0,0,0,0,0,0,0,0 24359 DEFB 0,0,0,0,0,0,0,0 24367 DEFB 0,0,0,0,0,0,0,0 24375 DEFB 0,0,0,0,0,0,0,0 24383 DEFB 0,0,0,0,0,0,0,0 24391 DEFB 0,0,0,0,0,0,0,0 24399 DEFB 0,0,0,0,0,0,0,0 24407 DEFB 0,0,0,0,0,0,0,0 24415 DEFB 0,0,0,0,0,0,0,0 24423 DEFB 0,0,0,0,0,0,0,0 24431 DEFB 0,0,0,0,0,0,0,0 24439 DEFB 0,0,0,0,0,0,0,0 24447 DEFB 0,0,0,0,0,0,0,0 24455 DEFB 0,0,0,0,0,0,0,0 24463 DEFB 0,0,0,0,0,0,0,0 24471 DEFB 0,0,0,0,0,0,0,0 24479 DEFB 0,0,0,0,0,0,0,0 24487 DEFB 0,0,0,0,0,0,0,0 24495 DEFB 0,0,0,0,0,0,0,0 24503 DEFB 0,0,0,0,0,0,0,0 24511 DEFB 0,0,0,0,0,0,0,0 24519 DEFB 0,0,0,0,0,0,0,0 24527 DEFB 0,0,0,0,0,0,0,0 24535 DEFB 0,0,0,0,0,0,0,0 24543 DEFB 0,0,0,0,0,0,0,0 24551 DEFB 0,0,0,0,0,0,0,0 24559 DEFB 0,0,0,0,0,0,0,0 24567 DEFB 0,0,0,0,0,0,0,0 24575 DEFB 0 ; Table of Bitmap Data for Magic Knight at his Current Location ; ; Used by the routines at #R61638, #R61720 and #R61774. b24576 DEFB 0,0,0,0,0,0,0,0 24584 DEFB 0,0,0,0,0,0,0,0 24592 DEFB 0,0,0,0,0,0,0,0 24600 DEFB 0,0,0,0,0,0,0,0 24608 DEFB 0,0,0,0,0,0,0,0 24616 DEFB 0,0,0,0,0,0,0,0 24624 DEFB 0,0,0,0,0,0,0,0 24632 DEFB 0,0,0,0,0,0,0,0 24640 DEFB 0,0,0,0,0,0,0,0 24648 DEFB 0,0,0,0,0,0,0,0 24656 DEFB 0,0,0,0,0,0,0,0 24664 DEFB 0,0,0,0,0,0,0,0 ; Table of Background Bitmap Data ; ; Used by the routines at #R39553, #R61638 and #R61823. b24672 DEFB 0,0,0,0,0,0,0,0 24680 DEFB 0,0,0,0,0,0,0,0 24688 DEFB 0,0,0,0,0,0,0,0 24696 DEFB 0,0,0,0,0,0,0,0 24704 DEFB 0,0,0,0,0,0,0,0 24712 DEFB 0,0,0,0,0,0,0,0 24720 DEFB 0,0,0,0,0,0,0,0 24728 DEFB 0,0,0,0,0,0,0,0 24736 DEFB 0,0,0,0,0,0,0,0 24744 DEFB 0,0,0,0,0,0,0,0 24752 DEFB 0,0,0,0,0,0,0,0 24760 DEFB 0,0,0,0,0,0,0,0 ; Characters' Current Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are capped at 100: b24768 DEFB 0,0,0,0,0,0,0,0 ; Magic Knight 24776 DEFB 0,0,0,0,0,0,0,0 ; Off-White Knight 24784 DEFB 0,0,0,0,0,0,0,0 ; Aramis le Peux 24792 DEFB 0,0,0,0,0,0,0,0 ; Robin of Shylock 24800 DEFB 0,0,0,0,0,0,0,0 ; Reggie the Rat 24808 DEFB 0,0,0,0,0,0,0,0 ; Rachel of Amazonia 24816 DEFB 0,0,0,0,0,0,0,0 ; Barker the Ent 24824 DEFB 0,0,0,0,0,0,0,0 ; Organon the Guard 24832 DEFB 0,0,0,0,0,0,0,0 ; Grunter the Bearwoolf ; Magic Knight's Current Data ; ; See also #R48603 for Magic Knight's Initial Data b24840 DEFB 0 ; x-coordinate (pixels) 24841 DEFB 0 ; y-coordinate (pixels) 24842 DEFB 0 ; Unused (set to zero by instruction at #R44322) 24843 DEFB 0 ; Index of current frame 24844 DEFB 0 ; x-velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 24845 DEFB 0 ; y-velocity (pixels) [jumping] 24846 DEFB 0 ; Attribute 24847 DEFB 0 ; Unused ; Characters' Current Inventories ; ; See also #R48611 for Characters' Initial Inventories b24848 DEFB 0,0,0,0,0 ; Magic Knight (carrying) 24853 DEFB 0,0,0,0,0 ; Magic Knight (wearing) 24858 DEFB 0,0,0,0,0 ; Off-White Knight 24863 DEFB 0,0,0,0,0 ; Aramis le Peux 24868 DEFB 0,0,0,0,0 ; Robin of Shylock 24873 DEFB 0,0,0,0,0 ; Reggie the Rat 24878 DEFB 0,0,0,0,0 ; Rachel of Amazonia 24883 DEFB 0,0,0,0,0 ; Barker the Ent 24888 DEFB 0,0,0,0,0 ; Organon the Guard 24893 DEFB 0,0,0,0,0 ; Grunter the Bearwoolf ; Characters' Current Positions ; ; Eight groups of three bytes, one group per character (excluding Magic Knight). The values are: b24898 DEFB 0,0,0 ; Off-White Knight 24901 DEFB 0,0,0 ; Aramis le Peux 24904 DEFB 0,0,0 ; Robin of Shylock 24907 DEFB 0,0,0 ; Reggie the Rat 24910 DEFB 0,0,0 ; Rachel of Amazonia 24913 DEFB 0,0,0 ; Barker the Ent 24916 DEFB 0,0,0 ; Organon the Guard 24919 DEFB 0,0,0 ; Grunter the Bearwoolf ; Objects' Current Positions ; ; Forty-two groups of three bytes, one group per object. The values are: b24922 DEFB 0,0,0 ; (00) - Nothing at all 24925 DEFB 0,0,0 ; (01) - Disquise 24928 DEFB 0,0,0 ; (02) - Crystal Ball 24931 DEFB 0,0,0 ; (03) - Wand of Command 24934 DEFB 0,0,0 ; (04) - Teddy Bear 24937 DEFB 0,0,0 ; (05) - Stick of Dynamite 24940 DEFB 0,0,0 ; (06) - Magic Talisman 24943 DEFB 0,0,0 ; (07) - Broken Glass 24946 DEFB 0,0,0 ; (08) - Broken Glass 24949 DEFB 0,0,0 ; (09) - Broken Glass 24952 DEFB 0,0,0 ; (10) - Horse Feather 24955 DEFB 0,0,0 ; (11) - Power Boots 24958 DEFB 0,0,0 ; (12) - Glow Shield 24961 DEFB 0,0,0 ; (13) - Chicken 24964 DEFB 0,0,0 ; (14) - Boomerang 24967 DEFB 0,0,0 ; (15) - Sword 24970 DEFB 0,0,0 ; (16) - Brass Ankh 24973 DEFB 0,0,0 ; (17) - Bottle of Liquid 24976 DEFB 0,0,0 ; (18) - Bottle of Liquid 24979 DEFB 0,0,0 ; (19) - Torch 24982 DEFB 0,0,0 ; (20) - Mirror 24985 DEFB 0,0,0 ; (21) - Gadget X 24988 DEFB 0,0,0 ; (22) - Elf-Horn 24991 DEFB 0,0,0 ; (23) - Silver Arrow 24994 DEFB 0,0,0 ; (24) - Instruction Book 24997 DEFB 0,0,0 ; (25) - Magic Missile 25000 DEFB 0,0,0 ; (26) - Advert 25003 DEFB 0,0,0 ; (27) - Scroll 25006 DEFB 0,0,0 ; (28) - Empty Bottle 25009 DEFB 0,0,0 ; (29) - Empty Bottle 25012 DEFB 0,0,0 ; (30) - Shield 25015 DEFB 0,0,0 ; (31) - Teleport Key 25018 DEFB 0,0,0 ; (32) - Teleport Pad 25021 DEFB 0,0,0 ; (33) - Newspaper 25024 DEFB 0,0,0 ; (34) - List of Clues 25027 DEFB 0,0,0 ; (35) - Bow 25030 DEFB 0,0,0 ; (36) - Golden Egg 25033 DEFB 0,0,0 ; (37) - Silver Egg 25036 DEFB 0,0,0 ; (38) - Copper Egg 25039 DEFB 0,0,0 ; (39) - Golden Egg 25042 DEFB 0,0,0 ; (40) - Silver Egg 25045 DEFB 0,0,0 ; (41) - Copper Egg ; 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. b25048 DEFB 0,0,0 25051 DEFB 0,0,0 25054 DEFB 0,0,0 25057 DEFB 0,0,0 ; Temporary Text Buffer ; ; Used by the routines at #R46902 and #R48389 b25060 DEFB 0,0,0,0,0,0,0,0 25068 DEFB 0,0,0,0,0,0,0,0 25076 DEFB 0,0,0,0,0,0,0,0 25084 DEFB 0,0,0,0,0,0,0,0 25092 DEFB 0,0,0,0,0,0,0,0 25100 DEFB 0,0,0,0,0,0,0,0 25108 DEFB 0,0,0,0,0,0,0,0 25116 DEFB 0,0,0,0,0,0,0,0 25124 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 25156 DEFB 0,0,0,0,0,0,0,0 25164 DEFB 0,0,0,0,0,0,0,0 25172 DEFB 0,0,0,0 ; Graphics (Storm Cloud) ; ; All Storm Cloud frame graphics are (8 x 2). Frame 1 b25176 DEFB 0,0,7,240,7,192,0,0 25184 DEFB 0,0,31,252,63,224,0,0 25192 DEFB 0,0,191,255,191,240,0,0 25200 DEFB 0,7,223,254,127,240,0,0 25208 DEFB 0,31,239,255,255,232,0,0 25216 DEFB 0,120,255,255,255,252,0,0 25224 DEFB 0,254,255,255,243,254,0,0 25232 DEFB 0,255,255,255,247,254,0,0 25240 DEFB 0,255,255,255,255,254,0,0 25248 DEFB 0,255,255,231,255,252,0,0 25256 DEFB 0,127,255,223,255,252,0,0 25264 DEFB 0,127,112,63,231,248,0,0 25272 DEFB 0,60,128,7,195,224,0,0 25280 DEFB 0,0,0,0,0,0,0,0 25288 DEFB 0,0,0,0,0,0,0,0 25296 DEFB 0,0,0,0,0,0,0,0 ; Frame 2 25304 DEFB 0,0,3,248,3,224,0,0 25312 DEFB 0,0,15,254,31,240,0,0 25320 DEFB 0,0,95,255,223,248,0,0 25328 DEFB 0,3,239,255,63,248,0,0 25336 DEFB 0,15,247,255,255,244,0,0 25344 DEFB 0,60,127,255,255,254,0,0 25352 DEFB 0,127,127,255,249,255,0,0 25360 DEFB 0,127,255,255,251,255,0,0 25368 DEFB 0,127,255,255,255,255,0,0 25376 DEFB 0,127,255,243,255,254,0,0 25384 DEFB 0,63,255,239,255,254,0,0 25392 DEFB 0,63,184,31,243,252,0,0 25400 DEFB 0,30,64,3,225,240,0,0 25408 DEFB 0,0,0,0,0,0,0,0 25416 DEFB 0,0,0,0,0,0,0,0 25424 DEFB 0,0,0,0,0,0,0,0 ; Frame 3 25432 DEFB 0,0,1,252,1,240,0,0 25440 DEFB 0,0,7,255,15,248,0,0 25448 DEFB 0,0,47,255,239,252,0,0 25456 DEFB 0,1,247,255,159,252,0,0 25464 DEFB 0,7,251,255,255,250,0,0 25472 DEFB 0,30,63,255,255,255,0,0 25480 DEFB 0,63,191,255,252,255,128,0 25488 DEFB 0,63,255,255,253,255,128,0 25496 DEFB 0,63,255,255,255,255,128,0 25504 DEFB 0,63,255,249,255,255,0,0 25512 DEFB 0,31,255,247,255,255,0,0 25520 DEFB 0,31,220,15,249,254,0,0 25528 DEFB 0,15,32,1,240,248,0,0 25536 DEFB 0,0,0,0,0,0,0,0 25544 DEFB 0,0,0,0,0,0,0,0 25552 DEFB 0,0,0,0,0,0,0,0 ; Frame 4 25560 DEFB 0,0,0,254,0,248,0,0 25568 DEFB 0,0,3,255,135,252,0,0 25576 DEFB 0,0,23,255,247,254,0,0 25584 DEFB 0,0,251,255,207,254,0,0 25592 DEFB 0,3,253,255,255,253,0,0 25600 DEFB 0,15,31,255,255,255,128,0 25608 DEFB 0,31,223,255,254,127,192,0 25616 DEFB 0,31,255,255,254,255,192,0 25624 DEFB 0,31,255,255,255,255,192,0 25632 DEFB 0,31,255,252,255,255,128,0 25640 DEFB 0,15,255,251,255,255,128,0 25648 DEFB 0,15,238,7,252,255,0,0 25656 DEFB 0,7,144,0,248,124,0,0 25664 DEFB 0,0,0,0,0,0,0,0 25672 DEFB 0,0,0,0,0,0,0,0 25680 DEFB 0,0,0,0,0,0,0,0 ; Frame 5 25688 DEFB 0,0,0,127,0,124,0,0 25696 DEFB 0,0,1,255,195,254,0,0 25704 DEFB 0,0,11,255,251,255,0,0 25712 DEFB 0,0,125,255,231,255,0,0 25720 DEFB 0,1,254,255,255,254,128,0 25728 DEFB 0,7,143,255,255,255,192,0 25736 DEFB 0,15,239,255,255,63,224,0 25744 DEFB 0,15,255,255,255,127,224,0 25752 DEFB 0,15,255,255,255,255,224,0 25760 DEFB 0,15,255,254,127,255,192,0 25768 DEFB 0,7,255,253,255,255,192,0 25776 DEFB 0,7,247,3,254,127,128,0 25784 DEFB 0,3,200,0,124,62,0,0 25792 DEFB 0,0,0,0,0,0,0,0 25800 DEFB 0,0,0,0,0,0,0,0 25808 DEFB 0,0,0,0,0,0,0,0 ; Frame 6 25816 DEFB 0,0,0,63,128,62,0,0 25824 DEFB 0,0,0,255,225,255,0,0 25832 DEFB 0,0,5,255,253,255,128,0 25840 DEFB 0,0,62,255,243,255,128,0 25848 DEFB 0,0,255,127,255,255,64,0 25856 DEFB 0,3,199,255,255,255,224,0 25864 DEFB 0,7,247,255,255,159,240,0 25872 DEFB 0,7,255,255,255,191,240,0 25880 DEFB 0,7,255,255,255,255,240,0 25888 DEFB 0,7,255,255,63,255,224,0 25896 DEFB 0,3,255,254,255,255,224,0 25904 DEFB 0,3,251,129,255,63,192,0 25912 DEFB 0,1,228,0,62,31,0,0 25920 DEFB 0,0,0,0,0,0,0,0 25928 DEFB 0,0,0,0,0,0,0,0 25936 DEFB 0,0,0,0,0,0,0,0 ; Frame 7 25944 DEFB 0,0,0,31,192,31,0,0 25952 DEFB 0,0,0,127,240,255,128,0 25960 DEFB 0,0,2,255,254,255,192,0 25968 DEFB 0,0,31,127,249,255,192,0 25976 DEFB 0,0,127,191,255,255,160,0 25984 DEFB 0,1,227,255,255,255,240,0 25992 DEFB 0,3,251,255,255,207,248,0 26000 DEFB 0,3,255,255,255,223,248,0 26008 DEFB 0,3,255,255,255,255,248,0 26016 DEFB 0,3,255,255,159,255,240,0 26024 DEFB 0,1,255,255,127,255,240,0 26032 DEFB 0,1,253,192,255,159,224,0 26040 DEFB 0,0,242,0,31,15,128,0 26048 DEFB 0,0,0,0,0,0,0,0 26056 DEFB 0,0,0,0,0,0,0,0 26064 DEFB 0,0,0,0,0,0,0,0 ; Frame 8 26072 DEFB 0,0,0,15,224,15,128,0 26080 DEFB 0,0,0,63,248,127,192,0 26088 DEFB 0,0,1,127,255,127,224,0 26096 DEFB 0,0,15,191,252,255,224,0 26104 DEFB 0,0,63,223,255,255,208,0 26112 DEFB 0,0,241,255,255,255,248,0 26120 DEFB 0,1,253,255,255,231,252,0 26128 DEFB 0,1,255,255,255,239,252,0 26136 DEFB 0,1,255,255,255,255,252,0 26144 DEFB 0,1,255,255,207,255,248,0 26152 DEFB 0,0,255,255,191,255,248,0 26160 DEFB 0,0,254,224,127,207,240,0 26168 DEFB 0,0,121,0,15,135,192,0 26176 DEFB 0,0,0,0,0,0,0,0 26184 DEFB 0,0,0,0,0,0,0,0 26192 DEFB 0,0,0,0,0,0,0,0 ; Graphics Magic Knight ; ; All Magic Knight frames are (3 x 4). Facing Right, Frame 1 b26200 DEFB 0,0,0,0,0,0,7,224 26208 DEFB 0,31,240,0,62,15,0,113 26216 DEFB 255,128,14,73,128,114,73,128 26224 DEFB 98,73,128,126,73,128,7,201 26232 DEFB 128,48,127,0,31,128,0,15 26240 DEFB 254,0,3,254,0,0,240,0 26248 DEFB 1,224,0,3,48,0,3,56 26256 DEFB 0,3,24,0,3,156,0,3 26264 DEFB 220,0,3,220,0,3,220,0 26272 DEFB 3,248,0,1,240,0,0,224 26280 DEFB 0,0,224,0,0,240,0,1 26288 DEFB 252,0,1,254,0,0,254,0 ; Facing Right, Frame 2 26296 DEFB 0,0,0,0,0,0,1,248 26304 DEFB 0,7,252,0,15,131,192,28 26312 DEFB 127,224,3,146,96,28,146,96 26320 DEFB 24,146,96,31,146,96,1,242 26328 DEFB 96,12,31,192,7,224,0,3 26336 DEFB 255,128,0,255,128,0,60,0 26344 DEFB 0,120,0,0,204,0,0,204 26352 DEFB 0,0,206,0,0,207,0,0 26360 DEFB 207,0,0,223,0,0,255,0 26368 DEFB 0,62,0,0,124,0,0,123 26376 DEFB 128,0,251,128,3,143,128,3 26384 DEFB 143,128,3,207,0,3,207,0 ; Facing Right, Frame 3 26392 DEFB 0,0,0,0,0,0,0,126 26400 DEFB 0,1,255,0,3,224,240,7 26408 DEFB 31,248,0,228,152,7,36,152 26416 DEFB 6,36,152,7,228,152,0,124 26424 DEFB 152,3,7,240,1,248,0,0 26432 DEFB 255,224,0,63,224,0,15,0 26440 DEFB 0,30,0,0,51,0,0,51 26448 DEFB 0,0,51,128,0,51,192,0 26456 DEFB 61,192,0,61,192,0,61,192 26464 DEFB 1,223,152,1,223,56,1,239 26472 DEFB 120,0,239,248,0,241,224,0 26480 DEFB 113,224,0,49,192,0,49,192 ; Facing Right, Frame 4 26488 DEFB 0,0,0,0,0,0,0,31 26496 DEFB 128,0,127,192,0,248,60,1 26504 DEFB 199,254,0,57,38,1,201,38 26512 DEFB 1,137,38,1,249,38,0,31 26520 DEFB 38,0,193,252,0,126,0,0 26528 DEFB 63,248,0,15,248,0,3,192 26536 DEFB 0,7,128,0,12,192,0,12 26544 DEFB 64,0,14,96,0,14,112,0 26552 DEFB 15,112,0,15,240,0,15,240 26560 DEFB 0,15,224,0,111,192,0,123 26568 DEFB 184,0,123,56,0,124,248,0 26576 DEFB 60,248,0,12,240,0,12,240 ; Facing Left, Frame 4 26584 DEFB 0,0,0,0,0,0,1,248 26592 DEFB 0,3,254,0,60,31,0,127 26600 DEFB 227,128,100,156,0,100,147,128 26608 DEFB 100,145,128,100,159,128,100,248 26616 DEFB 0,63,131,0,0,126,0,31 26624 DEFB 252,0,31,240,0,3,192,0 26632 DEFB 1,224,0,3,48,0,2,48 26640 DEFB 0,6,112,0,14,112,0,14 26648 DEFB 240,0,15,240,0,15,240,0 26656 DEFB 7,240,0,3,246,0,29,222 26664 DEFB 0,28,222,0,31,62,0,31 26672 DEFB 60,0,15,48,0,15,48,0 ; Facing Left, Frame 3 26680 DEFB 0,0,0,0,0,0,0,126 26688 DEFB 0,0,255,128,15,7,192,31 26696 DEFB 248,224,25,39,0,25,36,224 26704 DEFB 25,36,96,25,39,224,25,62 26712 DEFB 0,15,224,192,0,31,128,7 26720 DEFB 255,0,7,252,0,0,240,0 26728 DEFB 0,120,0,0,204,0,0,204 26736 DEFB 0,1,204,0,3,204,0,3 26744 DEFB 188,0,3,188,0,3,188,0 26752 DEFB 25,251,128,28,251,128,30,247 26760 DEFB 128,31,247,0,7,143,0,7 26768 DEFB 142,0,3,140,0,3,140,0 ; Facing Left, Frame 2 26776 DEFB 0,0,0,0,0,0,0,31 26784 DEFB 128,0,63,224,3,193,240,7 26792 DEFB 254,56,6,73,192,6,73,56 26800 DEFB 6,73,24,6,73,248,6,79 26808 DEFB 128,3,248,48,0,7,224,1 26816 DEFB 255,192,1,255,0,0,60,0 26824 DEFB 0,30,0,0,51,0,0,51 26832 DEFB 0,0,115,0,0,243,0,0 26840 DEFB 243,0,0,251,0,0,255,0 26848 DEFB 0,124,0,0,62,0,1,222 26856 DEFB 0,1,223,0,1,241,192,1 26864 DEFB 241,192,0,243,192,0,243,192 ; Facing Left, Frame 1 26872 DEFB 0,0,0,0,0,0,0,7 26880 DEFB 224,0,15,248,0,240,124,1 26888 DEFB 255,142,1,146,112,1,146,78 26896 DEFB 1,146,70,1,146,126,1,147 26904 DEFB 224,0,254,12,0,1,248,0 26912 DEFB 127,240,0,127,192,0,15,0 26920 DEFB 0,7,128,0,12,192,0,28 26928 DEFB 192,0,24,192,0,57,192,0 26936 DEFB 59,192,0,59,192,0,59,192 26944 DEFB 0,31,192,0,15,128,0,7 26952 DEFB 0,0,7,0,0,15,0,0 26960 DEFB 63,128,0,127,128,0,127,0 ; Facing Right, Frame 1 (Mask) 26968 DEFB 255,255,255,240,15,255,192,7 26976 DEFB 255,128,0,255,0,0,63,0 26984 DEFB 0,63,0,0,63,0,0,63 26992 DEFB 0,0,63,0,0,63,0,0 27000 DEFB 63,128,0,63,192,0,255,224 27008 DEFB 0,255,240,0,255,252,0,255 27016 DEFB 252,15,255,248,7,255,248,3 27024 DEFB 255,248,1,255,248,1,255,248 27032 DEFB 1,255,248,1,255,248,1,255 27040 DEFB 248,3,255,252,7,255,254,15 27048 DEFB 255,254,15,255,254,3,255,252 27056 DEFB 1,255,252,0,255,252,0,255 ; Facing Right, Frame 2 (Mask) 27064 DEFB 255,255,255,252,3,255,240,1 27072 DEFB 255,224,0,63,192,0,15,192 27080 DEFB 0,15,192,0,15,192,0,15 27088 DEFB 192,0,15,192,0,15,192,0 27096 DEFB 15,224,0,15,240,0,63,248 27104 DEFB 0,63,252,0,63,255,0,63 27112 DEFB 255,0,255,254,0,255,254,0 27120 DEFB 255,254,0,127,254,0,127,254 27128 DEFB 0,127,254,0,127,254,0,127 27136 DEFB 255,128,255,255,0,127,255,0 27144 DEFB 63,248,0,63,248,0,63,248 27152 DEFB 32,63,248,0,127,248,0,127 ; Facing Right, Frame 3 (Mask) 27160 DEFB 255,255,255,255,0,255,252,0 27168 DEFB 127,248,0,15,240,0,3,240 27176 DEFB 0,3,240,0,3,240,0,3 27184 DEFB 240,0,3,240,0,3,240,0 27192 DEFB 3,248,0,3,252,0,15,254 27200 DEFB 0,15,255,0,15,255,192,15 27208 DEFB 255,192,255,255,128,127,255,128 27216 DEFB 127,255,128,63,255,128,31,255 27224 DEFB 128,31,255,128,31,254,0,7 27232 DEFB 252,0,3,252,0,3,252,0 27240 DEFB 3,252,0,3,254,0,7,255 27248 DEFB 4,15,255,132,31,255,132,31 ; Facing Right, Frame 4 (Mask) 27256 DEFB 255,255,255,255,192,63,255,0 27264 DEFB 31,254,0,3,252,0,0,252 27272 DEFB 0,0,252,0,0,252,0,0 27280 DEFB 252,0,0,252,0,0,252,0 27288 DEFB 0,254,0,0,255,0,3,255 27296 DEFB 128,3,255,192,3,255,240,3 27304 DEFB 255,240,63,255,224,31,255,224 27312 DEFB 31,255,224,15,255,224,7,255 27320 DEFB 224,7,255,224,7,255,224,7 27328 DEFB 255,128,15,255,0,7,255,0 27336 DEFB 3,255,0,3,255,0,3,255 27344 DEFB 128,3,255,192,7,255,224,7 ; Facing Left, Frame 4 (Mask) 27352 DEFB 255,255,255,252,3,255,248,0 27360 DEFB 255,192,0,127,0,0,63,0 27368 DEFB 0,63,0,0,63,0,0,63 27376 DEFB 0,0,63,0,0,63,0,0 27384 DEFB 63,0,0,127,192,0,255,192 27392 DEFB 1,255,192,3,255,192,15,255 27400 DEFB 252,15,255,248,7,255,248,7 27408 DEFB 255,240,7,255,224,7,255,224 27416 DEFB 7,255,224,7,255,224,7,255 27424 DEFB 240,1,255,224,0,255,192,0 27432 DEFB 255,192,0,255,192,0,255,192 27440 DEFB 1,255,224,3,255,224,7,255 ; Facing Left, Frame 3 (Mask) 27448 DEFB 255,255,255,255,0,255,254,0 27456 DEFB 63,240,0,31,192,0,15,192 27464 DEFB 0,15,192,0,15,192,0,15 27472 DEFB 192,0,15,192,0,15,192,0 27480 DEFB 15,192,0,31,240,0,63,240 27488 DEFB 0,127,240,0,255,240,3,255 27496 DEFB 255,3,255,254,1,255,254,1 27504 DEFB 255,252,1,255,248,1,255,248 27512 DEFB 1,255,248,1,255,224,0,127 27520 DEFB 192,0,63,192,0,63,192,0 27528 DEFB 63,192,0,63,224,0,127,240 27536 DEFB 32,255,248,33,255,248,33,255 ; Facing Left, Frame 2 (Mask) 27544 DEFB 255,255,255,255,192,63,255,128 27552 DEFB 15,252,0,7,240,0,3,240 27560 DEFB 0,3,240,0,3,240,0,3 27568 DEFB 240,0,3,240,0,3,240,0 27576 DEFB 3,240,0,7,252,0,15,252 27584 DEFB 0,31,252,0,63,252,0,255 27592 DEFB 255,0,255,255,0,127,255,0 27600 DEFB 127,254,0,127,254,0,127,254 27608 DEFB 0,127,254,0,127,254,0,127 27616 DEFB 255,1,255,254,0,255,252,0 27624 DEFB 255,252,0,31,252,0,31,252 27632 DEFB 4,31,254,0,31,254,0,31 ; Facing Left, Frame 1 (Mask) 27640 DEFB 255,255,255,255,240,15,255,224 27648 DEFB 3,255,0,1,252,0,0,252 27656 DEFB 0,0,252,0,0,252,0,0 27664 DEFB 252,0,0,252,0,0,252,0 27672 DEFB 0,252,0,1,255,0,3,255 27680 DEFB 0,7,255,0,15,255,0,63 27688 DEFB 255,240,63,255,224,31,255,192 27696 DEFB 31,255,128,31,255,128,31,255 27704 DEFB 128,31,255,128,31,255,128,31 27712 DEFB 255,192,31,255,224,63,255,240 27720 DEFB 127,255,240,127,255,192,127,255 27728 DEFB 128,63,255,0,63,255,0,63 ; Graphics (01 x 64) Character Set Part 1 b27736 DEFB 0,0,0,0,0,0,0,0 ; (032) - SPACE 27744 DEFB 0,48,48,48,48,0,48,48 ; (033) - ! 27752 DEFB 0,36,36,0,0,0,0,0 ; (034) - " 27760 DEFB 0,36,126,36,36,126,36,0 ; (035) - # 27768 DEFB 0,8,62,40,62,10,62,8 ; (036) - $ 27776 DEFB 0,98,100,8,16,38,70,0 ; (037) - % 27784 DEFB 0,56,108,59,126,108,127,59 ; (038) - & 27792 DEFB 0,12,24,16,0,0,0,0 ; (039) - ' 27800 DEFB 0,12,24,24,24,24,12,4 ; (040) - ( 27808 DEFB 0,48,24,24,24,24,48,32 ; (041) - ) 27816 DEFB 0,0,20,8,62,8,20,0 ; (042) - * 27824 DEFB 0,0,8,8,62,8,8,0 ; (043) - + 27832 DEFB 0,0,0,0,0,12,12,24 ; (044) - , 27840 DEFB 0,0,0,62,62,0,0,0 ; (045) - - 27848 DEFB 0,0,0,0,0,0,24,24 ; (046) - . 27856 DEFB 0,6,14,28,56,112,96,0 ; (047) - / 27864 DEFB 0,60,126,110,126,118,126,60 ; (048) - 0 27872 DEFB 0,28,60,44,12,12,63,63 ; (049) - 1 27880 DEFB 0,60,126,14,60,112,126,126 ; (050) - 2 27888 DEFB 0,60,126,102,28,102,126,60 ; (051) - 3 27896 DEFB 0,28,60,108,126,126,12,12 ; (052) - 4 27904 DEFB 0,126,126,96,124,6,126,124 ; (053) - 5 27912 DEFB 0,60,124,96,124,102,126,60 ; (054) - 6 27920 DEFB 0,126,126,14,28,24,24,24 ; (055) - 7 27928 DEFB 0,60,126,102,60,102,126,60 ; (056) - 8 27936 DEFB 0,60,126,102,62,6,62,60 ; (057) - 9 27944 DEFB 0,0,24,24,0,0,24,24 ; (058) - : 27952 DEFB 0,0,24,24,0,24,24,48 ; (059) - ; 27960 DEFB 0,0,6,12,24,24,12,6 ; (060) - < 27968 DEFB 0,0,0,62,0,62,0,0 ; (061) - = 27976 DEFB 0,0,96,48,24,24,48,96 ; (062) - > 27984 DEFB 0,60,110,30,28,0,24,24 ; (063) - ? 27992 DEFB 0,60,74,86,94,64,60,0 ; (064) - @ 28000 DEFB 0,60,126,102,126,126,102,102 ; (065) - A 28008 DEFB 0,124,126,102,124,102,126,124 ; (066) - B 28016 DEFB 0,60,126,102,96,102,126,60 ; (067) - C 28024 DEFB 0,120,124,110,102,110,124,120 ; (068) - D 28032 DEFB 0,126,126,96,124,96,126,126 ; (069) - E 28040 DEFB 0,126,126,96,124,124,96,96 ; (070) - F 28048 DEFB 0,62,126,96,110,102,126,60 ; (071) - G 28056 DEFB 0,102,102,126,126,102,102,102 ; (072) - H 28064 DEFB 0,126,126,24,24,24,126,126 ; (073) - I 28072 DEFB 0,6,6,6,102,102,126,60 ; (074) - J 28080 DEFB 0,110,124,120,124,110,102,102 ; (075) - K 28088 DEFB 0,96,96,96,96,96,126,126 ; (076) - L 28096 DEFB 0,198,254,254,214,198,198,198 ; (077) - M 28104 DEFB 0,102,118,126,110,102,102,102 ; (078) - N 28112 DEFB 0,60,126,102,102,102,126,60 ; (079) - O 28120 DEFB 0,124,126,102,126,124,96,96 ; (080) - P 28128 DEFB 0,60,126,102,118,110,126,60 ; (081) - Q 28136 DEFB 0,124,126,102,124,126,102,102 ; (082) - R 28144 DEFB 0,60,124,96,60,6,126,124 ; (083) - S 28152 DEFB 0,254,254,48,48,48,48,48 ; (084) - T 28160 DEFB 0,102,102,102,102,102,126,60 ; (085) - U 28168 DEFB 0,102,102,102,102,102,60,24 ; (086) - V 28176 DEFB 0,102,102,102,102,126,126,36 ; (087) - W 28184 DEFB 0,231,255,60,60,126,231,195 ; (088) - X 28192 DEFB 0,195,231,126,60,24,24,24 ; (089) - Y 28200 DEFB 0,126,126,28,56,112,126,126 ; (090) - Z 28208 DEFB 0,3,15,31,63,127,255,255 ; (091) - Unused 28216 DEFB 0,192,240,248,252,254,255,255 ; (092) - Unused 28224 DEFB 255,255,255,0,0,0,255,255 ; (093) - Window Border 1 (top edge) 28232 DEFB 255,255,0,0,0,255,255,255 ; (094) - Window Border 1 (bottom edge) 28240 DEFB 227,227,227,227,227,227,227,227 ; (095) - Window Border 1 (left edge) ; Graphics (01 x 32) Character Set Part 2 b28248 DEFB 199,199,199,199,199,199,199,199 ; (096) - Window Border 1 (right edge) 28256 DEFB 255,255,255,15,23,39,199,199 ; (097) - Window Border 1 (top right corner) 28264 DEFB 199,199,39,23,15,255,255,255 ; (098) - Window Border 1 (bottom right corner) 28272 DEFB 227,227,228,232,240,255,255,255 ; (099) - Window Border 1 (bottom left corner) 28280 DEFB 255,255,255,240,232,228,227,227 ; (100) - Window Border 1 (top left corner) 28288 DEFB 255,255,0,36,219,0,255,255 ; (101) - Window Border 2 (top edge) 28296 DEFB 255,255,0,219,36,0,255,255 ; (102) - Window Border 2 (bottom edge) 28304 DEFB 203,203,211,203,203,211,203,203 ; (103) - Window Border 2 (left edge) 28312 DEFB 211,211,203,211,211,203,211,211 ; (104) - Window Border 2 (right edge) 28320 DEFB 194,227,124,28,204,38,151,211 ; (105) - Window Border 2 (top right corner) 28328 DEFB 211,151,38,204,28,124,227,194 ; (106) - Window Border 2 (bottom right corner) 28336 DEFB 203,233,100,51,56,62,199,67 ; (107) - Window Border 2 (bottom left corner) 28344 DEFB 67,199,62,56,51,100,233,203 ; (108) - Window Border 2 (top left corner) 28352 DEFB 153,153,195,66,102,189,129,255 ; (109) - Window Border 3 (top edge) 28360 DEFB 255,129,189,102,66,195,153,153 ; (110) - Window Border 3 (bottom edge) 28368 DEFB 231,156,176,163,163,176,156,231 ; (111) - Window Border 3 (left edge) 28376 DEFB 231,57,13,197,197,13,57,231 ; (112) - Window Border 3 (right edge) 28384 DEFB 155,155,196,75,115,176,156,231 ; (113) - Window Border 3 (top right corner) 28392 DEFB 231,156,176,115,75,196,155,155 ; (114) - Window Border 3 (bottom right corner) 28400 DEFB 231,57,13,206,210,35,217,217 ; (115) - Window Border 3 (bottom left corner) 28408 DEFB 217,217,35,210,206,13,57,231 ; (116) - Window Border 3 (top left corner) 28416 DEFB 255,255,0,255,0,0,0,0 ; (117) - Window Border 4 (top edge) 28424 DEFB 0,0,0,0,255,0,255,255 ; (118) - Window Border 4 (bottom edge) 28432 DEFB 208,208,208,208,208,208,208,208 ; (119) - Window Border 4 (left edge) 28440 DEFB 11,11,11,11,11,11,11,11 ; (120) - Window Border 4 (right edge) 28448 DEFB 255,255,7,251,11,11,11,11 ; (121) - Window Border 4 (top right corner) 28456 DEFB 11,11,11,11,251,7,255,255 ; (122) - Window Border 4 (bottom right corner) 28464 DEFB 208,208,208,208,223,224,255,255 ; (123) - Window Border 4 (bottom left corner) 28472 DEFB 255,255,224,223,208,208,208,208 ; (124) - Window Border 4 (top left corner) 28480 DEFB 0,16,56,84,16,16,16,0 ; (125) - ^ 28488 DEFB 0,28,62,112,124,48,126,126 ; (126) - £ 28496 DEFB 0,60,126,227,223,227,126,60 ; (127) - COPYRIGHT ; Graphics - Brickwork Blocks (Part 1) ; ; Referenced by Table of Block Style Definitions at #R49794. b28504 DEFB 0,0,0,0,0,0,0,0 ; (00) - Blank 28512 DEFB 1,3,7,15,31,63,127,255 ; (01) - Unused 28520 DEFB 63,127,239,223,255,255,255,255 ; (02) - Unused 28528 DEFB 56,248,252,222,238,254,255,255 ; (03) - Unused 28536 DEFB 111,255,247,239,127,127,31,207 ; (04) - Unused 28544 DEFB 0,240,254,255,247,251,255,255 ; (05) - Unused 28552 DEFB 7,63,127,255,255,255,127,127 ; (06) - Unused 28560 DEFB 192,248,222,231,255,255,254,254 ; (07) - Unused 28568 DEFB 3,31,63,127,255,255,255,255 ; (08) - Unused 28576 DEFB 240,254,255,255,255,255,255,255 ; (09) - Unused 28584 DEFB 0,28,174,166,134,174,170,186 ; (10) - Unused 28592 DEFB 0,113,251,155,219,219,219,203 ; (11) - Unused 28600 DEFB 14,63,127,239,223,255,255,255 ; (12) - Unused 28608 DEFB 7,255,255,255,255,255,255,255 ; (13) - Unused 28616 DEFB 131,255,255,255,255,255,255,252 ; (14) - Unused 28624 DEFB 252,238,247,255,255,130,60,254 ; (15) - Unused 28632 DEFB 63,127,255,255,223,255,255,123 ; (16) - Unused 28640 DEFB 126,255,255,255,253,231,254,252 ; (17) - White bricks 28648 DEFB 63,63,103,111,127,127,127,62 ; (18) - White bricks 28656 DEFB 0,0,0,0,0,0,0,0 ; (19) - Unused 28664 DEFB 181,174,255,255,255,255,255,255 ; (20) - Floor UDG 52 (Outdoors) 28672 DEFB 63,127,255,255,255,255,255,255 ; (21) - Floor UDG 53 (Castle) 28680 DEFB 255,255,0,0,255,255,0,0 ; (22) - Floor UDG 54 (Spaceship) 28688 DEFB 56,255,239,254,239,255,253,255 ; (23) - Floor UDG 55 (Limbo / Caves) 28696 DEFB 126,126,126,0,239,239,239,0 ; (24) - Yellow bricks 28704 DEFB 255,255,255,255,255,255,255,255 ; (25) - Unused 28712 DEFB 127,127,127,127,255,255,127,63 ; (26) - Unused 28720 DEFB 255,255,255,238,158,254,252,24 ; (27) - Unused 28728 DEFB 247,251,249,252,126,119,123,63 ; (28) - Unused 28736 DEFB 255,254,254,250,246,126,60,24 ; (29) - Unused 28744 DEFB 127,121,126,255,247,238,124,56 ; (30) - Unused 28752 DEFB 240,238,223,123,255,255,254,112 ; (31) - Unused 28760 DEFB 127,119,121,63,71,243,125,28 ; (32) - Unused 28768 DEFB 255,255,255,255,254,255,240,224 ; (33) - Unused 28776 DEFB 186,248,93,77,45,239,199,0 ; (34) - Unused 28784 DEFB 202,234,202,203,203,203,235,107 ; (35) - Unused 28792 DEFB 127,127,127,111,119,127,63,28 ; (36) - Unused 28800 DEFB 255,255,238,221,243,207,30,14 ; (37) - Unused 28808 DEFB 49,199,255,255,255,255,63,0 ; (38) - Unused 28816 DEFB 255,255,255,255,246,206,254,252 ; (39) - Unused 28824 DEFB 0,190,254,255,255,247,255,252 ; (40) - Unused 28832 DEFB 0,63,127,127,111,103,115,63 ; (41) - Unused 28840 DEFB 0,124,255,255,255,254,238,124 ; (42) - Unused 28848 DEFB 0,0,0,0,0,0,0,0 ; (43) - Unused 28856 DEFB 0,0,0,0,0,0,0,0 ; (44) - Unused 28864 DEFB 0,0,0,0,0,0,0,0 ; (45) - Unused 28872 DEFB 0,0,0,0,0,0,0,0 ; (46) - Unused 28880 DEFB 0,0,0,0,0,0,0,0 ; (47) - Unused 28888 DEFB 7,15,63,119,239,255,255,255 ; (48) - Unused 28896 DEFB 240,248,254,255,255,255,255,255 ; (49) - Unused 28904 DEFB 255,146,146,147,150,154,106,73 ; (50) - Cobweb 28912 DEFB 255,91,101,203,83,37,95,137 ; (51) - Cobweb 28920 DEFB 255,255,192,193,193,193,223,223 ; (52) - Lever 28928 DEFB 255,255,3,131,131,131,251,251 ; (53) - Lever 28936 DEFB 255,255,255,156,63,115,109,54 ; (54) - Unused 28944 DEFB 255,255,255,57,252,206,182,108 ; (55) - Unused 28952 DEFB 54,54,54,54,54,54,63,63 ; (56) - Unused 28960 DEFB 108,108,108,108,108,108,252,252 ; (57) - Unused 28968 DEFB 54,54,54,54,54,54,54,54 ; (58) - Security door 28976 DEFB 108,108,108,108,108,108,108,108 ; (59) - Security door 28984 DEFB 60,126,255,255,251,243,126,60 ; (60) - Unused 28992 DEFB 60,126,255,255,223,207,126,60 ; (61) - Unused 29000 DEFB 60,126,207,223,255,255,126,60 ; (62) - Unused 29008 DEFB 60,126,243,251,255,255,126,60 ; (63) - Unused 29016 DEFB 0,7,31,63,63,127,127,255 ; (64) - Unused 29024 DEFB 0,131,227,247,255,255,254,252 ; (65) - Unused 29032 DEFB 128,192,224,240,248,252,254,255 ; (66) - Unused 29040 DEFB 255,255,0,0,255,255,0,0 ; (67) - Power Plant ceiling / bridge 29048 DEFB 181,174,255,255,255,255,255,255 ; (68) - Grass 29056 DEFB 214,186,255,255,255,255,255,255 ; (69) - Grass 29064 DEFB 255,195,165,153,153,165,195,255 ; (70) - Unused 29072 DEFB 255,255,255,0,0,255,255,255 ; (71) - Unused 29080 DEFB 255,127,127,231,231,115,63,15 ; (72) - Unused 29088 DEFB 255,246,238,252,250,247,239,134 ; (73) - Unused 29096 DEFB 73,38,38,25,24,6,1,0 ; (74) - Cobweb 29104 DEFB 137,127,17,161,127,65,193,63 ; (75) - Cobweb 29112 DEFB 217,217,217,217,217,192,255,255 ; (76) - Lever 29120 DEFB 155,155,155,155,155,3,255,255 ; (77) - Lever 29128 DEFB 62,29,195,255,127,54,54,54 ; (78) - Unused 29136 DEFB 124,184,195,255,254,108,108,108 ; (79) - Unused 29144 DEFB 63,0,127,127,0,255,255,255 ; (80) - Unused 29152 DEFB 252,0,254,254,0,255,255,255 ; (81) - Unused 29160 DEFB 24,12,10,7,10,20,58,217 ; (82) - Unused 29168 DEFB 16,24,44,52,40,20,46,77 ; (83) - Unused ; Graphics (Axes) b29176 DEFB 16,56,124,248,124,54,3,1 ; (84) - Frame 1 29184 DEFB 8,28,62,63,30,52,96,192 ; (85) - Frame 2 29192 DEFB 128,192,108,62,31,62,28,8 ; (86) - Frame 3 29200 DEFB 3,6,44,120,252,124,56,16 ; (87) - Frame 4 ; Graphics - Brickwork Blocks (Part 2) ; ; Referenced by Architecture Styles Table at #R49794. b29208 DEFB 255,127,127,63,63,31,7,0 ; (88) - Unused 29216 DEFB 252,254,255,255,247,227,131,0 ; (89) - Unused 29224 DEFB 231,231,231,231,231,231,231,231 ; (90) - Castle Entrance / steps for Power Plant bridge 29232 DEFB 0,0,0,0,0,0,0,0 ; (91) - Unused 29240 DEFB 5,69,37,21,0,247,4,245 ; (92) - Power Plant Core 29248 DEFB 160,162,164,168,0,239,32,175 ; (93) - Power Plant Core 29256 DEFB 245,4,247,0,21,37,69,5 ; (94) - Power Plant Core 29264 DEFB 175,32,239,0,168,164,162,160 ; (95) - Power Plant Core ; Graphic Lookup Data ; ; Table of addresses of start of graphic data for game graphics. b29272 DEFW 0,0 ; (00) - Unused 29276 DEFW 1795,29548 ; (01) - Graphics (Compacted): (03 x 07) Left half of Teleport 29280 DEFW 29681,29681 ; (02) - Graphics (Standard): (02 x 02) Menu Hand Cursor 29284 DEFW 29713,29745 ; (03) - Graphics (Standard): (02 x 02) Gadget X / Bow 29288 DEFW 29777,29809 ; (04) - Graphics (Standard): (02 x 02) Advert / Newspaper 29292 DEFW 29841,29809 ; (05) - Graphics (Standard): (02 x 02) Mirror 29296 DEFW 29873,29809 ; (06) - Graphics (Standard): (02 x 02) Scroll / List of Clues 29300 DEFW 29905,29937 ; (07) - Graphics (Standard): (02 x 02) Disquise 29304 DEFW 29969,30001 ; (08) - Graphics (Standard): (02 x 02) Teleport Pad 29308 DEFW 30033,30065 ; (09) - Graphics (Standard): (02 x 02) Golden Egg / Silver Egg / Copper Egg 29312 DEFW 30097,30129 ; (10) - Graphics (Standard): (02 x 02) Shield / Glow Shield 29316 DEFW 30161,30193 ; (11) - Graphics (Standard): (02 x 02) Magic Talisman 29320 DEFW 30225,30257 ; (12) - Graphics (Standard): (02 x 02) Chicken 29324 DEFW 30289,30321 ; (13) - Graphics (Standard): (02 x 02) Broken Glass 29328 DEFW 30353,30385 ; (14) - Graphics (Standard): (02 x 02) Bottle of Liquid / Empty Bottle 29332 DEFW 30417,30449 ; (15) - Graphics (Standard): (02 x 02) Instruction Book 29336 DEFW 30481,30513 ; (16) - Graphics (Standard): (02 x 02) Crystal Ball 29340 DEFW 30545,30577 ; (17) - Graphics (Standard): (02 x 02) Wand of Command 29344 DEFW 30609,30641 ; (18) - Graphics (Standard): (02 x 02) Torch 29348 DEFW 30673,30705 ; (19) - Graphics (Standard): (02 x 02) Brass Ankh 29352 DEFW 30737,30769 ; (20) - Graphics (Standard): (02 x 02) Teddy Bear 29356 DEFW 30801,30833 ; (21) - Graphics (Standard): (02 x 02) Teleport Key 29360 DEFW 30865,30897 ; (22) - Graphics (Standard): (02 x 02) Magic Missile 29364 DEFW 30929,30961 ; (23) - Graphics (Standard): (02 x 02) Elf-Horn 29368 DEFW 30993,31025 ; (24) - Graphics (Standard): (02 x 02) Silver Arrow 29372 DEFW 31057,31089 ; (25) - Graphics (Standard): (02 x 02) Boomerang 29376 DEFW 31121,31153 ; (26) - Graphics (Standard): (02 x 02) Stick of Dynamite 29380 DEFW 31185,31217 ; (27) - Graphics (Standard): (02 x 02) Power Boots 29384 DEFW 31249,31281 ; (28) - Graphics (Standard): (02 x 02) Horse Feather 29388 DEFW 31313,31345 ; (29) - Graphics (Standard): (02 x 02) Sword 29392 DEFW 31377,31425 ; (30) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 1 29396 DEFW 31473,31521 ; (31) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 2 29400 DEFW 31569,31617 ; (32) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 3 29404 DEFW 31665,31713 ; (33) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 4 29408 DEFW 31761,31809 ; (34) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 5 29412 DEFW 31857,31905 ; (35) - Graphics (Standard): (02 x 03) Puff of Smoke, frame 6 29416 DEFW 3083,31953 ; (36) - Graphics (Compacted): (11 x 12) Grunter / Statue 29420 DEFW 32705,32769 ; (37) - Graphics (Standard): (02 x 04) Magic Knight facing left / Off-White Knight 29424 DEFW 1804,32833 ; (38) - Graphics (Compacted): (12 x 07) Top of tree with face 29428 DEFW 1545,33126 ; (39) - Graphics (Compacted): (09 x 06) Top of tree without face 29432 DEFW 2567,33418 ; (40) - Graphics (Compacted): (07 x 10) Top of tree, bare 29436 DEFW 0,0 ; (41) - Unused 29440 DEFW 1797,33676 ; (42) - Graphics (Compacted): (05 x 07) Axe in tree stump 29444 DEFW 3332,33835 ; (43) - Graphics (Compacted): (04 x 13) Control console 29448 DEFW 772,34013 ; (44) - Graphics (Compacted): (04 x 03) Tree trunk 1 29452 DEFW 775,34087 ; (45) - Graphics (Compacted): (07 x 03) Tree trunk 2 29456 DEFW 0,0 ; (46) - Unused 29460 DEFW 774,34205 ; (47) - Graphics (Compacted): (06 x 03) Tree trunk 3 29464 DEFW 1029,34330 ; (48) - Graphics (Compacted): (05 x 04) Monitor showing castle 29468 DEFW 1029,34502 ; (49) - Graphics (Compacted): (05 x 04) Control panel 29472 DEFW 1029,34669 ; (50) - Graphics (Compacted): (05 x 04) Display screen 29476 DEFW 1285,34810 ; (51) - Graphics (Compacted): (05 x 05) Moon 29480 DEFW 34893,34957 ; (52) - Graphics (Standard): (02 x 04) Aramis Le Peux 29484 DEFW 35021,35085 ; (53) - Graphics (Standard): (02 x 04) Robin of Shylock 29488 DEFW 35149,35213 ; (54) - Graphics (Standard): (02 x 04) Rachel of Amazonia 29492 DEFW 1031,35277 ; (55) - Graphics (Compacted): (07 x 04) Flowers 29496 DEFW 1026,35443 ; (56) - Graphics (Compacted): (02 x 04) Organon the Guard 29500 DEFW 517,35512 ; (57) - Graphics (Compacted): (05 x 02) Reggie the Rat 29504 DEFW 778,35569 ; (58) - Graphics (Compacted): (10 x 03) Roof / Top of Well 29508 DEFW 2571,35790 ; (59) - Graphics (Compacted): (11 x 10) Well 29512 DEFW 516,36407 ; (60) - Graphics (Compacted): (04 x 02) Jump Chute / Corridor Pad 29516 DEFW 1796,36463 ; (61) - Graphics (Compacted): (04 x 07) Cracked Column Section 1 29520 DEFW 1540,36648 ; (62) - Graphics (Compacted): (04 x 06) Cracked Column Section 2 29524 DEFW 1799,36794 ; (63) - Graphics (Compacted): (07 x 07) Fire bowl 29528 DEFW 1027,37033 ; (64) - Graphics (Compacted): (03 x 04) Plinth 29532 DEFW 1540,37132 ; (65) - Graphics (Compacted): (04 x 06) Large stool 29536 DEFW 1282,37268 ; (66) - Graphics (Compacted): (02 x 05) Plant 29540 DEFW 1795,37343 ; (67) - Graphics (Compacted): (03 x 07) Torch 29544 DEFW 1286,37470 ; (68) - Graphics (Compacted): (06 x 05) Sword in Concrete ; Graphics (Compacted) Scenery Part 1 (03 x 07) Left half of Teleport b29548 DEFB 3,7,15,15,31,53,63,31 29556 DEFB 255,2,248,240,248,84,252,248 29564 DEFB 253,191,0,6,15,15,15,15 29572 DEFB 31,63,118,201,240,240,240,240 29580 DEFB 248,252,110,147,0,8,153,153 29588 DEFB 153,153,153,153,153,153,153,153 29596 DEFB 153,153,153,153,153,153,0,8 29604 DEFB 153,153,153,153,153,153,153,153 29612 DEFB 153,153,153,153,153,153,153,153 29620 DEFB 0,8,153,153,153,153,153,153 29628 DEFB 153,153,153,153,153,153,153,153 29636 DEFB 153,153,0,8,153,153,153,153 29644 DEFB 153,153,153,153,153,153,153,153 29652 DEFB 153,153,153,153,0,8,201,118 29660 DEFB 63,31,15,15,15,15,147,111 29668 DEFB 252,248,240,240,250,245,255,2 29676 DEFB 0,4,170,85,181 ; Graphics (02 x 02) Menu Hand Cursor b29681 DEFB 0,0,12,0,30,0,63,0 29689 DEFB 127,128,255,24,254,232,108,8 29697 DEFB 56,16,20,72,4,164,5,82 29705 DEFB 2,169,1,69,0,131,0,0 ; Graphics Objects ; ; All object graphics are (2 x 2). Gadget X / Bow b29713 DEFB 0,0,112,14,120,30,124,62 29721 DEFB 62,124,31,248,15,240,7,224 29729 DEFB 7,224,15,240,31,248,62,124 29737 DEFB 124,62,120,30,112,14,0,0 ; Gadget X / Bow (Mask) 29745 DEFB 7,224,3,192,1,128,0,0 29753 DEFB 0,0,128,1,192,3,224,7 29761 DEFB 224,7,192,3,128,1,0,0 29769 DEFB 0,0,1,128,3,192,7,224 ; Advert / Newspaper 29777 DEFB 0,0,127,254,64,138,72,254 29785 DEFB 92,130,78,254,64,130,127,138 29793 DEFB 68,178,127,178,72,130,127,254 29801 DEFB 64,146,127,254,68,130,127,254 ; Advert / Newspaper / Mirror / Scroll / List of Clues (Mask) 29809 DEFB 0,0,0,0,0,0,0,0 29817 DEFB 0,0,0,0,0,0,0,0 29825 DEFB 0,0,0,0,0,0,0,0 29833 DEFB 0,0,0,0,0,0,0,0 ; Mirror 29841 DEFB 0,0,82,74,76,50,63,252 29849 DEFB 48,12,81,10,18,8,84,10 29857 DEFB 48,12,81,10,18,8,84,10 29865 DEFB 48,12,63,252,76,50,82,74 ; Scroll / List of Clues 29873 DEFB 0,0,127,254,255,255,127,254 29881 DEFB 32,4,45,228,44,4,45,100 29889 DEFB 44,196,32,36,47,84,32,36 29897 DEFB 32,84,127,254,255,255,127,254 ; Disquise 29905 DEFB 0,0,0,0,0,0,10,80 29913 DEFB 21,168,8,16,5,160,15,240 29921 DEFB 26,88,56,28,114,78,100,38 29929 DEFB 96,6,114,78,63,252,31,248 ; Disquise (Mask) 29937 DEFB 255,255,255,255,224,7,192,3 29945 DEFB 192,3,192,3,224,7,192,3 29953 DEFB 128,1,0,0,0,0,0,0 29961 DEFB 0,0,0,0,0,0,128,1 ; Teleport Pad 29969 DEFB 0,0,0,0,0,0,0,0 29977 DEFB 0,0,0,0,0,0,0,0 29985 DEFB 0,0,0,0,0,0,0,0 29993 DEFB 0,0,63,252,102,102,63,252 ; Teleport Pad (Mask) 30001 DEFB 255,255,255,255,255,255,255,255 30009 DEFB 255,255,255,255,255,255,255,255 30017 DEFB 255,255,255,255,255,255,255,255 30025 DEFB 128,1,0,0,0,0,0,0 ; Golden Egg / Silver Egg / Copper Egg 30033 DEFB 0,0,0,0,3,192,7,224 30041 DEFB 15,240,31,248,31,248,63,252 30049 DEFB 53,172,42,84,63,252,63,252 30057 DEFB 31,248,31,248,15,240,3,192 ; Golden Egg / Silver Egg / Copper Egg (Mask) 30065 DEFB 255,255,248,31,240,15,224,7 30073 DEFB 192,3,192,3,128,1,128,1 30081 DEFB 128,1,128,1,128,1,128,1 30089 DEFB 128,1,192,3,192,3,224,7 ; Shield / Glow Shield 30097 DEFB 0,0,64,2,96,6,126,126 30105 DEFB 127,254,103,230,115,206,121,158 30113 DEFB 63,252,63,252,30,120,28,56 30121 DEFB 13,176,7,224,3,192,1,128 ; Shield / Glow Shield (Mask) 30129 DEFB 31,248,15,240,0,0,0,0 30137 DEFB 0,0,0,0,0,0,0,0 30145 DEFB 128,1,128,1,128,1,192,3 30153 DEFB 192,3,224,7,240,15,248,31 ; Magic Talisman 30161 DEFB 0,0,1,128,3,192,3,192 30169 DEFB 7,224,7,224,14,112,13,176 30177 DEFB 13,176,14,112,7,224,7,224 30185 DEFB 3,192,3,192,1,128,1,128 ; Magic Talisman (Mask) 30193 DEFB 252,63,248,31,248,31,240,15 30201 DEFB 240,15,224,7,224,7,224,7 30209 DEFB 224,7,224,7,224,7,240,15 30217 DEFB 240,15,248,31,248,31,252,63 ; Chicken 30225 DEFB 0,0,0,108,0,240,0,216 30233 DEFB 0,254,0,96,7,232,31,232 30241 DEFB 63,224,127,192,123,192,125,128 30249 DEFB 76,0,4,0,6,0,7,0 ; Chicken (Mask) 30257 DEFB 255,1,254,1,254,1,254,0 30265 DEFB 254,0,240,0,192,3,128,3 30273 DEFB 0,3,0,15,0,31,0,31 30281 DEFB 0,63,0,255,240,255,240,255 ; Broken Glass 30289 DEFB 0,0,0,0,0,0,0,0 30297 DEFB 0,0,0,0,0,0,0,0 30305 DEFB 0,0,0,0,0,0,0,0 30313 DEFB 0,0,13,84,50,204,127,254 ; Broken Glass (Mask) 30321 DEFB 255,255,255,255,255,255,255,255 30329 DEFB 255,255,255,255,255,255,255,255 30337 DEFB 255,255,255,255,255,255,255,255 30345 DEFB 224,1,128,1,0,0,0,0 ; Bottle of Liquid / Empty Bottle 30353 DEFB 0,0,0,60,0,24,0,24 30361 DEFB 0,0,0,60,0,44,0,110 30369 DEFB 0,126,0,126,0,66,0,74 30377 DEFB 0,82,0,74,0,66,0,60 ; Bottle of Liquid / Empty Bottle (Mask) 30385 DEFB 255,0,255,0,255,129,255,195 30393 DEFB 255,129,255,129,255,0,255,0 30401 DEFB 255,0,255,0,255,0,255,0 30409 DEFB 255,0,255,0,255,0,255,0 ; Instruction Book 30417 DEFB 0,0,0,0,63,252,64,8 30425 DEFB 127,252,127,248,127,248,98,88 30433 DEFB 127,248,127,248,127,248,127,248 30441 DEFB 127,248,120,124,127,248,63,252 ; Instruction Book (Mask) 30449 DEFB 255,255,128,1,0,1,0,1 30457 DEFB 0,1,0,1,0,3,0,3 30465 DEFB 0,3,0,3,0,3,0,3 30473 DEFB 0,1,0,1,0,1,0,1 ; Crystal Ball 30481 DEFB 0,0,3,192,15,240,30,248 30489 DEFB 60,252,57,252,123,254,115,254 30497 DEFB 127,254,127,254,127,254,63,252 30505 DEFB 63,252,31,248,15,240,3,192 ; Crystal Ball (Mask) 30513 DEFB 248,31,224,7,192,3,128,1 30521 DEFB 128,1,0,0,0,0,0,0 30529 DEFB 0,0,0,0,0,0,0,0 30537 DEFB 128,1,128,1,192,3,224,7 ; Wand of Command 30545 DEFB 0,0,1,0,32,0,8,0 30553 DEFB 17,0,72,0,16,32,2,0 30561 DEFB 3,128,8,192,64,96,0,48 30569 DEFB 0,24,0,12,0,6,0,3 ; Wand of Command (Mask) 30577 DEFB 0,31,0,31,0,31,0,31 30585 DEFB 0,31,0,31,0,31,0,31 30593 DEFB 0,31,0,15,0,7,255,3 30601 DEFB 255,129,255,192,255,224,255,240 ; Torch 30609 DEFB 0,0,0,60,0,60,0,62 30617 DEFB 0,62,0,62,0,62,0,60 30625 DEFB 0,60,0,60,0,110,0,94 30633 DEFB 0,94,0,94,0,94,0,126 ; Torch (Mask) 30641 DEFB 255,129,255,129,255,128,255,128 30649 DEFB 255,128,255,128,255,128,255,128 30657 DEFB 255,129,255,0,255,0,255,0 30665 DEFB 255,0,255,0,255,0,255,0 ; Brass Ankh 30673 DEFB 0,0,7,224,15,240,28,56 30681 DEFB 24,24,24,24,12,48,6,96 30689 DEFB 127,254,127,254,3,192,3,192 30697 DEFB 3,192,3,192,3,192,3,192 ; Brass Ankh (Mask) 30705 DEFB 240,15,224,7,192,3,192,3 30713 DEFB 193,131,193,131,192,3,224,7 30721 DEFB 0,0,0,0,0,0,248,31 30729 DEFB 248,31,248,31,248,31,248,31 ; Teddy Bear 30737 DEFB 0,0,48,12,88,22,91,150 30745 DEFB 55,204,13,104,15,224,12,96 30753 DEFB 38,204,115,156,116,88,7,192 30761 DEFB 55,216,118,220,115,156,96,12 ; Teddy Bear (Mask) 30769 DEFB 135,225,3,192,0,0,0,0 30777 DEFB 0,0,128,1,224,3,128,1 30785 DEFB 0,1,0,1,0,1,0,3 30793 DEFB 0,1,0,1,0,1,0,1 ; Teleport Key 30801 DEFB 0,0,0,0,0,0,0,0 30809 DEFB 0,0,0,0,0,0,0,0 30817 DEFB 0,124,0,254,127,206,64,206 30825 DEFB 127,206,0,254,124,124,108,0 ; Teleport Key (Mask) 30833 DEFB 255,255,255,255,255,255,255,255 30841 DEFB 255,255,255,255,255,255,255,1 30849 DEFB 254,0,0,0,0,0,0,0 30857 DEFB 0,0,0,0,1,0,1,1 ; Magic Missile 30865 DEFB 0,0,0,0,0,0,0,0 30873 DEFB 0,0,0,0,0,0,0,0 30881 DEFB 0,0,0,0,30,6,63,254 30889 DEFB 127,252,127,252,63,254,30,6 ; Magic Missile (Mask) 30897 DEFB 255,255,255,255,255,255,255,255 30905 DEFB 255,255,255,255,255,255,255,255 30913 DEFB 255,255,192,240,128,0,0,0 30921 DEFB 0,0,0,0,0,0,128,0 ; Elf-Horn 30929 DEFB 0,0,0,0,0,0,0,0 30937 DEFB 0,56,0,124,0,102,0,194 30945 DEFB 0,194,65,194,99,102,126,126 30953 DEFB 49,252,63,248,31,224,15,128 ; Elf-Horn (Mask) 30961 DEFB 255,255,255,255,255,255,255,131 30969 DEFB 255,1,255,0,254,0,254,0 30977 DEFB 28,0,8,0,0,0,0,0 30985 DEFB 0,0,128,1,128,3,192,15 ; Silver Arrow 30993 DEFB 0,0,0,0,0,0,0,0 31001 DEFB 0,0,0,0,0,0,0,0 31009 DEFB 0,0,0,0,0,0,16,2 31017 DEFB 48,6,127,252,48,6,16,2 ; Silver Arrow (Mask) 31025 DEFB 255,255,255,255,255,255,255,255 31033 DEFB 255,255,255,255,255,255,255,255 31041 DEFB 255,255,255,255,199,248,135,240 31049 DEFB 0,0,0,0,0,0,135,240 ; Boomerang 31057 DEFB 0,0,0,0,0,0,0,0 31065 DEFB 0,0,32,4,112,14,112,14 31073 DEFB 120,30,108,54,95,250,43,212 31081 DEFB 61,188,31,248,7,224,1,128 ; Boomerang (Mask) 31089 DEFB 255,255,255,255,255,255,255,255 31097 DEFB 143,241,7,224,7,224,3,192 31105 DEFB 1,128,0,0,0,0,0,0 31113 DEFB 128,1,128,1,192,3,240,15 ; Stick of Dynamite 31121 DEFB 0,0,0,8,0,16,0,8 31129 DEFB 0,126,0,126,0,110,0,110 31137 DEFB 0,110,0,110,0,110,0,110 31145 DEFB 0,110,0,110,0,110,0,126 ; Stick of Dynamite (Mask) 31153 DEFB 255,227,255,195,255,195,255,0 31161 DEFB 255,0,255,0,255,0,255,0 31169 DEFB 255,0,255,0,255,0,255,0 31177 DEFB 255,0,255,0,255,0,255,0 ; Power Boots 31185 DEFB 0,0,0,0,0,0,0,0 31193 DEFB 0,248,0,252,0,92,0,124 31201 DEFB 0,92,56,252,76,156,79,252 31209 DEFB 95,254,127,254,127,158,63,30 ; Power Boots (Mask) 31217 DEFB 255,255,255,255,255,255,255,3 31225 DEFB 255,1,255,1,255,1,255,1 31233 DEFB 131,1,1,1,0,1,0,0 31241 DEFB 0,0,0,0,0,0,0,0 ; Horse Feather 31249 DEFB 0,0,0,0,0,0,0,0 31257 DEFB 0,0,0,0,0,0,0,0 31265 DEFB 0,0,1,240,2,168,5,84 31273 DEFB 127,254,5,84,2,168,1,240 ; Horse Feather (Mask) 31281 DEFB 255,255,255,255,255,255,255,255 31289 DEFB 255,255,255,255,255,255,255,255 31297 DEFB 252,7,248,3,240,1,0,0 31305 DEFB 0,0,0,0,240,1,248,3 ; Sword 31313 DEFB 0,0,32,0,48,0,48,0 31321 DEFB 48,0,48,0,48,0,48,0 31329 DEFB 48,0,48,0,0,0,124,0 31337 DEFB 6,0,50,0,52,0,48,0 ; Sword (Mask) 31345 DEFB 159,255,143,255,135,255,135,255 31353 DEFB 135,255,135,255,135,255,135,255 31361 DEFB 135,255,135,255,1,255,0,255 31369 DEFB 0,255,128,255,128,255,129,255 ; Graphics (Puff of Smoke) ; ; All Puff of Smoke frame graphics are (2 x 3). Frame 1 b31377 DEFB 0,0,0,0,0,0,0,0 31385 DEFB 0,0,0,0,0,0,0,0 31393 DEFB 0,0,1,128,2,64,2,64 31401 DEFB 1,128,0,0,0,0,0,0 31409 DEFB 0,0,0,0,0,0,0,0 31417 DEFB 0,0,0,0,0,0,0,0 ; Frame 1 (Mask) 31425 DEFB 255,255,255,255,255,255,255,255 31433 DEFB 255,255,255,255,255,255,255,255 31441 DEFB 252,63,248,31,248,31,248,31 31449 DEFB 248,31,252,63,255,255,255,255 31457 DEFB 255,255,255,255,255,255,255,255 31465 DEFB 255,255,255,255,255,255,255,255 ; Frame 2 31473 DEFB 0,0,0,0,0,0,0,0 31481 DEFB 0,0,0,0,0,0,2,128 31489 DEFB 4,96,8,16,8,16,4,0 31497 DEFB 4,32,2,64,0,0,0,0 31505 DEFB 0,0,0,0,0,0,0,0 31513 DEFB 0,0,0,0,0,0,0,0 ; Frame 2 (Mask) 31521 DEFB 255,255,255,255,255,255,255,255 31529 DEFB 255,255,255,255,248,63,240,15 31537 DEFB 224,7,225,7,225,199,225,135 31545 DEFB 240,15,240,15,248,31,255,255 31553 DEFB 255,255,255,255,255,255,255,255 31561 DEFB 255,255,255,255,255,255,255,255 ; Frame 3 31569 DEFB 0,0,0,0,0,0,0,0 31577 DEFB 0,0,0,0,1,128,7,224 31585 DEFB 12,240,14,112,2,0,7,96 31593 DEFB 14,112,28,240,29,240,30,224 31601 DEFB 14,0,0,0,0,0,0,0 31609 DEFB 0,0,0,0,0,0,0,0 ; Frame 3 (Mask) 31617 DEFB 255,255,255,255,255,255,255,255 31625 DEFB 255,255,248,63,240,15,240,7 31633 DEFB 192,7,192,7,224,7,224,7 31641 DEFB 192,7,192,7,192,7,192,7 31649 DEFB 192,15,224,255,255,255,255,255 31657 DEFB 255,255,255,255,255,255,255,255 ; Frame 4 31665 DEFB 0,0,0,0,0,0,0,0 31673 DEFB 0,0,14,112,28,56,24,56 31681 DEFB 12,16,4,16,0,0,0,0 31689 DEFB 8,32,16,24,54,24,60,112 31697 DEFB 24,32,0,0,0,0,0,0 31705 DEFB 0,0,0,0,0,0,0,0 ; Frame 4 (Mask) 31713 DEFB 255,255,255,255,255,255,255,255 31721 DEFB 224,7,192,3,192,3,193,131 31729 DEFB 225,135,225,199,241,199,227,143 31737 DEFB 195,131,128,131,128,3,128,3 31745 DEFB 129,135,195,143,255,255,255,255 31753 DEFB 255,255,255,255,255,255,255,255 ; Frame 5 31761 DEFB 0,0,0,0,15,0,31,128 31769 DEFB 63,204,63,222,63,190,62,126 31777 DEFB 62,30,31,60,7,0,3,112 31785 DEFB 60,124,62,60,126,254,125,254 31793 DEFB 126,254,126,126,127,124,62,56 31801 DEFB 0,0,0,0,0,0,0,0 ; Frame 5 (Mask) 31809 DEFB 255,255,224,255,192,63,128,1 31817 DEFB 128,0,128,0,128,0,128,0 31825 DEFB 128,0,128,0,192,1,128,1 31833 DEFB 128,1,0,0,0,0,0,0 31841 DEFB 0,0,0,0,0,0,0,1 31849 DEFB 128,131,255,255,255,255,255,255 ; Frame 6 31857 DEFB 0,0,0,0,15,0,31,128 31865 DEFB 63,204,57,222,56,150,48,6 31873 DEFB 48,14,16,12,0,0,8,0 31881 DEFB 56,12,48,12,112,14,113,134 31889 DEFB 112,198,122,126,127,124,62,56 31897 DEFB 0,0,0,0,0,0,0,0 ; Frame 6 (Mask) 31905 DEFB 255,255,224,127,192,63,128,1 31913 DEFB 128,0,128,0,128,0,130,0 31921 DEFB 135,224,135,224,195,225,131,225 31929 DEFB 131,225,3,224,4,32,4,0 31937 DEFB 0,0,0,0,0,0,0,1 31945 DEFB 128,131,255,255,255,255,255,255 ; Graphics (Compacted) Scenery Part 2 ; ; (11 x 12) Grunter / Statue b31953 DEFB 0,9,1,1,1,1,0,5 31961 DEFB 128,128,192,224,248,126,0,3 31969 DEFB 15,63,255,2,63,0,3,224 31977 DEFB 240,248,254,255,1,0,2,28 31985 DEFB 56,112,240,56,199,0,7,1 31993 DEFB 0,4,64,64,192,192,0,40 32001 DEFB 63,159,231,241,28,78,109,238 32009 DEFB 136,253,255,3,63,135,240,35 32017 DEFB 185,253,237,239,239,206,24,255 32025 DEFB 3,227,252,254,15,3,239,231 32033 DEFB 251,217,158,191,248,246,192,128 32041 DEFB 128,0,37,1,0,7,198,18 32049 DEFB 51,113,108,14,30,48,119,51 32057 DEFB 59,242,247,143,3,51,252,254 32065 DEFB 127,25,131,195,231,231,193,80 32073 DEFB 4,253,255,1,253,248,226,176 32081 DEFB 3,249,37,143,255,1,247,251 32089 DEFB 0,2,128,128,128,56,142,199 32097 DEFB 0,36,3,31,127,255,1,39 32105 DEFB 31,32,15,255,4,251,248,30 32113 DEFB 194,255,3,254,247,243,123,63 32121 DEFB 159,207,231,1,218,182,230,199 32129 DEFB 199,199,226,248,255,1,63,0 32137 DEFB 1,7,31,31,61,249,151,35 32145 DEFB 99,35,195,207,143,143,128,192 32153 DEFB 224,224,240,240,240,224,0,17 32161 DEFB 1,1,1,1,1,1,0,1 32169 DEFB 255,9,207,239,231,247,243,248 32177 DEFB 248,255,6,63,255,1,192,254 32185 DEFB 255,7,63,159,199,243,248,255 32193 DEFB 1,241,255,4,240,14,255,1 32201 DEFB 225,199,227,243,243,35,3,225 32209 DEFB 240,232,220,254,254,255,4,0 32217 DEFB 6,128,128,0,10,1,1,3 32225 DEFB 7,15,31,255,1,127,31,199 32233 DEFB 255,4,243,247,247,247,239,200 32241 DEFB 129,7,255,3,251,243,127,28 32249 DEFB 193,247,243,224,227,207,31,127 32257 DEFB 255,1,199,159,62,255,5,254 32265 DEFB 255,1,31,207,255,4,120,56 32273 DEFB 152,192,252,254,254,255,1,127 32281 DEFB 31,31,6,1,3,3,1,192 32289 DEFB 224,144,56,252,252,254,246,0 32297 DEFB 8,31,63,63,127,127,127,127 32305 DEFB 63,254,254,60,156,216,192,224 32313 DEFB 224,31,63,63,63,63,63,31 32321 DEFB 7,255,5,127,63,159,255,29 32329 DEFB 254,254,254,1,1,1,0,5 32337 DEFB 230,239,239,239,247,247,254,254 32345 DEFB 0,8,63,63,55,55,23,27 32353 DEFB 27,27,224,224,192,192,192,128 32361 DEFB 128,128,1,24,62,63,63,63 32369 DEFB 55,55,223,79,47,135,231,247 32377 DEFB 243,251,255,15,247,255,8,252 32385 DEFB 253,249,251,243,231,159,63,0 32393 DEFB 1,192,224,240,240,249,251,250 32401 DEFB 254,126,126,126,62,190,243,119 32409 DEFB 0,8,27,15,15,15,7,15 32417 DEFB 31,63,192,192,192,192,224,248 32425 DEFB 191,128,51,27,25,13,25,31 32433 DEFB 159,31,233,229,245,229,230,230 32441 DEFB 246,246,255,4,127,15,97,124 32449 DEFB 253,225,243,255,4,127,255,1 32457 DEFB 254,252,252,248,240,224,128,127 32465 DEFB 255,1,225,3,15,63,127,127 32473 DEFB 252,255,2,191,190,220,224,193 32481 DEFB 63,63,63,63,127,119,119,197 32489 DEFB 128,128,128,128,192,192,192,192 32497 DEFB 63,127,126,62,30,95,110,239 32505 DEFB 192,192,192,224,120,31,0,1 32513 DEFB 48,63,63,63,63,63,191,127 32521 DEFB 111,252,252,252,253,249,248,248 32529 DEFB 224,127,255,1,254,252,188,56 32537 DEFB 120,120,0,9,1,1,0,4 32545 DEFB 1,255,3,239,239,239,231,247 32553 DEFB 131,3,2,6,4,6,130,128 32561 DEFB 205,141,4,4,12,120,1,3 32569 DEFB 224,224,224,224,192,192,128,0 32577 DEFB 1,230,198,231,227,107,123,1 32585 DEFB 1,224,192,0,1,1,129,131 32593 DEFB 231,55,98,248,255,1,254,254 32601 DEFB 222,176,6,0,1,192,224,224 32609 DEFB 224,240,112,112,216,24,56,104 32617 DEFB 28,54,6,14,0,8,1,1 32625 DEFB 3,3,3,7,7,7,255,3 32633 DEFB 199,243,255,1,199,146,128,128 32641 DEFB 128,192,192,224,240,240,6,0 32649 DEFB 23,5,8,11,29,16,38,46 32657 DEFB 46,25,97,140,190,62,127,127 32665 DEFB 127,184,248,248,252,28,44,120 32673 DEFB 48,4,12,56,0,13,7,15 32681 DEFB 15,15,8,2,6,2,58,57 32689 DEFB 124,124,126,254,255,2,48,56 32697 DEFB 200,12,32,115,115,55,0,16 ; Graphics (Characters) Part 1 ; ; All character graphics are (2 x 4). Magic Knight facing left / Off-White Knight b32705 DEFB 0,0,0,0,3,240,7,252 32713 DEFB 120,62,255,199,201,56,201,39 32721 DEFB 201,35,201,63,201,240,127,6 32729 DEFB 0,252,63,248,63,224,7,128 32737 DEFB 3,192,6,96,14,96,12,96 32745 DEFB 28,224,29,224,29,224,29,224 32753 DEFB 15,224,7,192,3,128,3,128 32761 DEFB 7,128,31,192,63,192,63,128 ; Magic Knight facing left / Off-White Knight (Mask) 32769 DEFB 255,255,248,7,240,1,0,0 32777 DEFB 0,0,0,0,0,0,0,0 32785 DEFB 0,0,0,0,0,0,0,0 32793 DEFB 128,0,128,1,128,3,128,15 32801 DEFB 240,15,224,15,224,15,192,15 32809 DEFB 192,15,192,15,192,15,192,15 32817 DEFB 192,15,224,15,240,31,240,63 32825 DEFB 192,31,128,31,128,31,128,31 ; Graphics (Compacted) Scenery Part 3 (12 x 07) Top of tree with face b32833 DEFB 0,65,224,176,128,128,192,192 32841 DEFB 96,0,70,7,4,0,9,6 32849 DEFB 2,1,1,1,0,2,96,112 32857 DEFB 48,48,48,240,97,97,0,4 32865 DEFB 96,240,152,8,0,52,1,3 32873 DEFB 15,14,4,8,8,8,144,208 32881 DEFB 240,240,0,5,1,3,31,0 32889 DEFB 4,1,249,255,1,207,99,102 32897 DEFB 232,208,192,192,128,128,28,50 32905 DEFB 39,111,111,62,62,28,0,31 32913 DEFB 64,0,10,7,0,1,1,1 32921 DEFB 0,2,28,120,224,192,128,0 32929 DEFB 3,112,120,59,59,27,23,23 32937 DEFB 23,255,1,254,248,224,224,224 32945 DEFB 192,192,131,1,0,41,8,8 32953 DEFB 4,4,3,64,98,34,51,31 32961 DEFB 60,112,224,0,3,128,255,1 32969 DEFB 31,11,8,128,192,64,32,48 32977 DEFB 224,248,124,0,2,8,12,31 32985 DEFB 31,63,127,7,7,15,15,15 32993 DEFB 15,143,206,240,240,240,248,248 33001 DEFB 248,252,116,14,15,31,63,127 33009 DEFB 127,252,252,0,1,128,192,227 33017 DEFB 255,3,127,24,60,254,255,2 33025 DEFB 199,1,0,4,8,152,208,209 33033 DEFB 243,0,6,192,0,17,28,50 33041 DEFB 103,111,127,127,62,0,1,126 33049 DEFB 62,63,31,31,15,15,7,127 33057 DEFB 243,243,243,193,193,193,128,228 33065 DEFB 245,255,1,254,254,254,255,2 33073 DEFB 37,143,87,35,103,35,119,255 33081 DEFB 1,248,248,248,248,240,240,240 33089 DEFB 240,28,0,15,114,54,28,15 33097 DEFB 4,0,5,240,152,0,28,7 33105 DEFB 2,0,6,128,0,4,1,1 33113 DEFB 1,255,11,252,248,248,240,240 33121 DEFB 224,224,192,0,37 ; (09 x 06) Top of tree without face 33126 DEFB 0,29,32,112,124,0,2,4 33134 DEFB 28,62,63,113,113,0,5,128 33142 DEFB 192,192,0,35,1,0,5,1 33150 DEFB 1,193,115,63,15,7,254,255 33158 DEFB 1,207,135,128,130,131,3,19 33166 DEFB 195,240,254,254,62,158,2,224 33174 DEFB 224,224,96,112,240,240,241,0 33182 DEFB 4,224,248,254,239,0,6,127 33190 DEFB 255,1,0,5,6,8,240,0 33198 DEFB 8,8,8,8,24,16,48,96 33206 DEFB 96,7,6,6,2,0,4,30 33214 DEFB 4,6,2,0,2,24,62,12 33222 DEFB 29,27,27,23,15,31,31,179 33230 DEFB 151,223,223,255,2,254,252,239 33238 DEFB 199,195,128,0,3,2,253,128 33246 DEFB 0,6,224,224,112,112,48,48 33254 DEFB 16,16,0,2,64,120,13,7 33262 DEFB 3,3,33,55,27,91,200,232 33270 DEFB 140,4,192,240,254,255,1,127 33278 DEFB 31,15,23,63,119,114,16,195 33286 DEFB 243,251,255,1,31,127,127,255 33294 DEFB 2,222,158,188,254,255,1,240 33302 DEFB 192,0,3,1,6,228,248,0 33310 DEFB 3,2,2,0,8,56,110,70 33318 DEFB 207,223,126,126,28,6,6,6 33326 DEFB 4,0,4,7,1,2,12,8 33334 DEFB 0,3,123,252,8,0,5,255 33342 DEFB 2,127,127,63,63,55,55,248 33350 DEFB 248,248,248,240,248,233,235,3 33358 DEFB 2,4,60,127,127,255,2,6 33366 DEFB 6,15,28,28,189,255,1,248 33374 DEFB 4,60,224,0,2,224,48,112 33382 DEFB 0,32,55,127,127,255,5,239 33390 DEFB 231,243,255,3,252,240,247,243 33398 DEFB 240,224,224,128,0,2,240,240 33406 DEFB 224,0,5,124,206,159,255,2 33414 DEFB 126,28,0,9 ; (07 x 10) Top of tree, bare 33418 DEFB 0,7,14,0,16,6,3,1 33426 DEFB 1,1,0,3,128,130,3,1 33434 DEFB 129,129,129,199,0,16,3,1 33442 DEFB 1,131,130,230,60,12,0,24 33450 DEFB 124,24,24,24,56,48,48,112 33458 DEFB 0,16,12,12,12,12,28,30 33466 DEFB 31,31,0,6,192,252,0,16 33474 DEFB 96,112,112,48,56,56,56,56 33482 DEFB 0,16,15,1,0,6,243,240 33490 DEFB 28,14,15,7,7,7,0,1 33498 DEFB 128,128,135,223,255,2,254,0 33506 DEFB 1,31,240,135,252,224,128,0 33514 DEFB 1,112,240,96,192,0,28,15 33522 DEFB 15,15,15,15,15,15,15,240 33530 DEFB 224,224,192,192,192,192,192,0 33538 DEFB 40,7,7,7,3,3,3,3 33546 DEFB 3,192,192,224,224,224,240,248 33554 DEFB 126,0,40,3,1,1,0,5 33562 DEFB 63,63,159,207,111,63,15,0 33570 DEFB 1,128,240,255,2,252,254,255 33578 DEFB 2,0,3,224,240,24,24,216 33586 DEFB 0,34,15,253,7,3,0,2 33594 DEFB 15,7,7,15,255,2,127,3 33602 DEFB 216,216,204,236,252,252,252,254 33610 DEFB 0,5,12,63,252,0,7,128 33618 DEFB 0,24,1,1,1,1,1,3 33626 DEFB 3,3,254,254,255,1,253,253 33634 DEFB 249,123,127,254,254,63,159,255 33642 DEFB 2,254,248,128,64,64,128,128 33650 DEFB 128,0,26,7,6,6,14,14 33658 DEFB 14,15,63,127,127,255,5,247 33666 DEFB 184,56,120,112,240,240,240,240 33674 DEFB 0,8 ; (05 x 07) Axe in tree stump 33676 DEFB 0,27,1,7,15,63,127,8 33684 DEFB 60,126,254,254,252,240,192,0 33692 DEFB 13,1,11,61,1,3,15,63 33700 DEFB 127,254,248,224,255,1,252,240 33708 DEFB 224,128,0,12,1,7,15,31 33716 DEFB 31,30,15,252,254,255,1,247 33724 DEFB 207,63,255,2,128,0,3,128 33732 DEFB 128,192,224,0,16,15,7,7 33740 DEFB 3,3,1,1,0,1,255,7 33748 DEFB 0,1,224,240,240,240,224,192 33756 DEFB 0,18,55,127,127,125,61,61 33764 DEFB 61,60,191,240,255,1,254,239 33772 DEFB 239,231,231,239,1,6,14,206 33780 DEFB 206,220,220,0,16,60,60,60 33788 DEFB 62,62,62,54,54,247,247,255 33796 DEFB 3,247,247,247,220,220,220,92 33804 DEFB 92,92,124,108,0,16,54,62 33812 DEFB 63,31,31,31,31,3,247,231 33820 DEFB 231,239,239,255,3,108,236,204 33828 DEFB 204,216,248,248,128,0,16 ; (04 x 13) Control console 33835 DEFB 224,240,240,0,1,252,240,230 33843 DEFB 238,0,24,238,238,238,238,238 33851 DEFB 238,238,238,0,24,238,238,239 33859 DEFB 238,239,238,239,238,0,24,239 33867 DEFB 230,240,254,254,254,254,252,0 33875 DEFB 25,240,248,56,184,184,188,188 33883 DEFB 0,24,184,188,184,188,56,248 33891 DEFB 240,0,26,216,220,220,220,222 33899 DEFB 223,223,0,24,207,239,239,239 33907 DEFB 7,240,255,2,0,1,128,128 33915 DEFB 128,128,0,1,216,223,0,7 33923 DEFB 192,0,8,1,252,254,254,254 33931 DEFB 0,1,255,2,199,240,255,3 33939 DEFB 0,1,255,2,254,63,128,254 33947 DEFB 255,1,0,1,255,2,0,1 33955 DEFB 240,255,1,0,1,255,1,0 33963 DEFB 1,255,2,0,1,255,1,193 33971 DEFB 207,204,204,216,216,0,1,254 33979 DEFB 254,224,0,20,208,208,208,240 33987 DEFB 240,224,224,224,0,24,224,224 33995 DEFB 224,224,224,224,224,224,0,24 34003 DEFB 224,224,224,224,224,240,248,236 34011 DEFB 0,24 ; (04 x 03) Tree trunk 1 34013 DEFB 0,8,1,3,3,7,15,15 34021 DEFB 31,63,255,6,231,243,240,240 34029 DEFB 224,240,240,248,248,60,0,8 34037 DEFB 63,63,63,63,63,31,31,15 34045 DEFB 248,252,254,255,5,124,120,248 34053 DEFB 112,160,224,240,240,0,4,1 34061 DEFB 7,31,255,1,15,15,7,7 34069 DEFB 231,63,255,1,15,255,6,252 34077 DEFB 224,240,240,248,248,252,252,120 34085 DEFB 24,8 ; (07 x 03) Tree trunk 2 34087 DEFB 0,16,1,3,3,15,31,127 34095 DEFB 127,255,3,254,255,5,240,240 34103 DEFB 96,96,48,188,52,70,0,22 34111 DEFB 1,3,0,4,240,252,255,1 34119 DEFB 223,255,5,127,31,239,254,254 34127 DEFB 254,254,254,254,255,2,66,131 34135 DEFB 131,130,134,196,107,63,0,6 34143 DEFB 128,192,0,8,3,7,6,6 34151 DEFB 6,12,12,12,7,11,8,30 34159 DEFB 24,24,28,12,239,239,247,55 34167 DEFB 119,63,127,15,255,2,240,199 34175 DEFB 159,255,1,252,224,158,254,124 34183 DEFB 28,204,227,127,30,224,0,1 34191 DEFB 60,255,1,247,193,49,56,0 34199 DEFB 4,128,128,192,192,2 ; (06 x 03) Tree trunk 3 34205 DEFB 0,9,1,3,3,15,63,255 34213 DEFB 2,127,199,207,223,255,1,253 34221 DEFB 249,251,231,239,255,1,254,254 34229 DEFB 252,253,255,1,224,224,128,124 34237 DEFB 255,1,253,252,248,0,5,128 34245 DEFB 128,128,1,1,1,7,15,63 34253 DEFB 63,127,255,1,223,159,191,63 34261 DEFB 255,5,254,254,239,207,159,159 34269 DEFB 191,63,127,255,1,254,254,252 34277 DEFB 252,248,241,241,251,126,0,3 34285 DEFB 128,128,0,6,127,127,127,63 34293 DEFB 63,63,31,15,255,2,252,241 34301 DEFB 255,1,252,252,128,31,15,7 34309 DEFB 135,231,127,124,0,1,252,252 34317 DEFB 252,248,252,125,127,31,0,5 34325 DEFB 192,224,96,0,8 ; (05 x 04) Monitor showing castle 34330 DEFB 127,255,4,127,0,1,127,191 34338 DEFB 191,191,159,192,255,1,0,1 34346 DEFB 255,5,0,1,255,1,0,1 34354 DEFB 255,4,254,0,1,255,1,0 34362 DEFB 1,255,1,126,127,127,127,255 34370 DEFB 1,254,0,1,254,127,127,127 34378 DEFB 127,127,255,1,191,159,128,63 34386 DEFB 96,64,64,64,69,71,0,1 34394 DEFB 255,1,0,1,16,0,2,69 34402 DEFB 199,1,252,6,2,18,2,66 34410 DEFB 194,254,254,254,254,254,253,249 34418 DEFB 249,159,159,191,255,1,127,127 34426 DEFB 127,127,70,70,67,67,67,99 34434 DEFB 63,128,199,134,254,135,183,183 34442 DEFB 255,1,0,1,194,194,130,130 34450 DEFB 130,134,252,1,249,253,254,254 34458 DEFB 254,254,254,254,120,112,103,103 34466 DEFB 103,112,120,63,255,1,126,61 34474 DEFB 61,61,126,255,3,60,219,219 34482 DEFB 219,60,255,3,127,190,190,190 34490 DEFB 127,255,2,142,6,114,114,114 34498 DEFB 6,142,252,224 ; (05 x 04) Control panel 34502 DEFB 31,127,96,192,193,195,195,195 34510 DEFB 255,2,0,2,255,1,192,192 34518 DEFB 255,3,0,2,224,241,241,241 34526 DEFB 255,2,0,2,255,2,199,187 34534 DEFB 252,254,6,3,227,243,243,19 34542 DEFB 195,194,194,194,227,113,208,208 34550 DEFB 0,1,235,235,235,28,255,1 34558 DEFB 0,2,113,177,177,177,113,225 34566 DEFB 1,1,171,187,199,255,2,199 34574 DEFB 187,171,19,243,243,246,245,245 34582 DEFB 21,21,208,209,211,211,210,210 34590 DEFB 243,98,0,1,255,3,0,2 34598 DEFB 255,1,73,1,225,241,241,17 34606 DEFB 17,241,49,187,199,255,2,199 34614 DEFB 187,171,187,245,245,245,245,247 34622 DEFB 19,18,243,194,195,193,192,192 34630 DEFB 224,127,31,73,255,2,0,1 34638 DEFB 10,10,255,2,49,241,224,0 34646 DEFB 1,170,170,255,2,199,255,2 34654 DEFB 0,1,10,10,255,2,243,243 34662 DEFB 227,3,163,166,254,248,114 ; (05 x 04) Display screen 34669 DEFB 127,255,1,248,248,192,204,192 34677 DEFB 204,255,2,0,2,15,63,127 34685 DEFB 127,255,2,0,2,255,6,0 34693 DEFB 2,254,255,3,254,255,1,31 34701 DEFB 31,3,131,195,195,204,192,204 34709 DEFB 204,192,204,204,0,1,255,11 34717 DEFB 254,253,251,247,239,255,1,191 34725 DEFB 127,255,3,253,251,227,227,227 34733 DEFB 227,227,227,227,227,254,130,130 34741 DEFB 130,130,254,254,254,255,4,254 34749 DEFB 253,255,2,239,223,191,127,255 34757 DEFB 1,254,255,2,247,239,223,191 34765 DEFB 127,255,3,227,227,227,227,227 34773 DEFB 227,227,227,214,214,214,214,214 34781 DEFB 214,214,124,127,127,63,15,0 34789 DEFB 2,255,6,0,2,255,6,0 34797 DEFB 2,255,2,227,195,195,3,31 34805 DEFB 31,255,1,254,49 ; (05 x 05) Moon 34810 DEFB 0,15,1,0,7,254,0,21 34818 DEFB 1,3,3,7,31,63,127,255 34826 DEFB 12,128,224,240,248,252,254,255 34834 DEFB 2,0,8,7,7,15,15,15 34842 DEFB 15,15,15,255,24,128,128,192 34850 DEFB 192,192,192,192,192,15,15,15 34858 DEFB 7,7,3,3,1,255,23,254 34866 DEFB 192,192,192,128,128,0,11,255 34874 DEFB 1,127,63,31,7,1,0,2 34882 DEFB 255,5,252,0,2,252,248,240 34890 DEFB 192,0,12 ; Graphics (Characters) Part 2 ; ; All character graphics are (2 x 4). Aramis Le Peux b34893 DEFB 0,0,0,0,0,0,7,224 34901 DEFB 15,240,31,248,53,172,63,252 34909 DEFB 56,28,54,108,17,136,17,136 34917 DEFB 12,48,11,208,4,32,7,224 34925 DEFB 3,192,59,220,123,222,123,222 34933 DEFB 123,222,107,214,107,214,107,214 34941 DEFB 107,214,111,246,46,116,14,112 34949 DEFB 14,112,14,112,30,120,62,124 ; Aramis Le Peux (Mask) 34957 DEFB 255,255,255,255,240,15,224,7 34965 DEFB 192,3,128,1,128,1,128,1 34973 DEFB 128,1,128,1,128,1,192,3 34981 DEFB 192,3,224,7,224,7,240,15 34989 DEFB 128,1,0,0,0,0,0,0 34997 DEFB 0,0,0,0,0,0,0,0 35005 DEFB 0,0,0,0,0,0,128,1 35013 DEFB 224,7,192,3,128,1,128,1 ; Robin of Shylock 35021 DEFB 0,0,1,224,7,252,7,252 35029 DEFB 14,6,28,2,24,218,56,138 35037 DEFB 60,60,44,126,44,47,38,0 35045 DEFB 18,124,31,228,3,248,9,248 35053 DEFB 38,160,126,160,118,160,118,32 35061 DEFB 119,32,123,96,115,224,35,224 35069 DEFB 3,224,3,224,1,192,1,192 35077 DEFB 1,192,1,224,1,240,1,112 ; Robin of Shylock (Mask) 35085 DEFB 252,15,240,1,240,1,224,0 35093 DEFB 192,0,192,0,128,0,128,0 35101 DEFB 128,0,128,0,128,0,128,0 35109 DEFB 128,1,192,1,192,1,224,3 35117 DEFB 0,15,0,15,0,15,0,15 35125 DEFB 0,15,0,15,0,15,0,15 35133 DEFB 136,15,248,15,248,15,252,31 35141 DEFB 252,15,252,7,252,7,252,7 ; Rachel of Amazonia 35149 DEFB 7,0,31,192,63,240,49,248 35157 DEFB 38,120,15,124,15,188,0,122 35165 DEFB 21,126,49,62,15,190,7,124 35173 DEFB 3,172,0,14,0,246,1,182 35181 DEFB 3,90,7,88,7,88,3,24 35189 DEFB 1,56,1,176,1,240,1,240 35197 DEFB 1,240,1,240,0,0,0,96 35205 DEFB 0,96,1,224,3,224,3,32 ; Rachel of Amazonia (Mask) 35213 DEFB 192,31,128,7,128,3,128,3 35221 DEFB 128,1,128,1,224,0,192,0 35229 DEFB 128,0,128,0,128,0,224,0 35237 DEFB 240,0,248,0,252,0,252,0 35245 DEFB 240,0,240,0,240,3,240,3 35253 DEFB 248,3,252,3,252,7,252,7 35261 DEFB 252,7,252,7,252,7,255,15 35269 DEFB 252,15,248,15,248,15,248,15 ; Graphics (Compacted) Scenery Part 4 (07 x 04) Flowers b35277 DEFB 0,25,7,31,1,0,1,1 35285 DEFB 7,15,0,1,192,241,251,255 35293 DEFB 1,230,224,248,0,2,224,248 35301 DEFB 252,112,96,112,0,23,15,0 35309 DEFB 3,30,255,1,127,127,255,1 35317 DEFB 30,24,16,0,1,1,1,124 35325 DEFB 255,1,59,7,48,224,128,128 35333 DEFB 0,2,56,248,252,124,60,60 35341 DEFB 28,220,0,10,1,3,7,6 35349 DEFB 8,0,1,63,255,2,241,131 35357 DEFB 7,7,7,255,1,198,224,224 35365 DEFB 194,190,255,1,239,255,1,31 35373 DEFB 15,127,255,1,240,96,240,135 35381 DEFB 223,239,236,246,244,23,15,200 35389 DEFB 203,103,127,15,156,248,252,0 35397 DEFB 1,240,252,196,0,12,15,15 35405 DEFB 14,12,12,8,8,0,1,135 35413 DEFB 11,29,25,24,56,48,48,240 35421 DEFB 248,248,248,240,240,96,96,62 35429 DEFB 49,99,99,71,70,6,6,124 35437 DEFB 28,142,6,6,0,11 ; (02 x 04) Organon the Guard 35443 DEFB 0,1,7,28,24,26,24,25 35451 DEFB 30,0,1,224,56,24,88,24 35459 DEFB 152,120,13,103,123,76,119,120 35467 DEFB 119,57,176,206,190,230,222,30 35475 DEFB 254,248,30,7,0,1,15,11 35483 DEFB 13,28,30,32,224,0,1,240 35491 DEFB 208,176,56,120,30,28,30,14 35499 DEFB 14,14,28,124,120,56,120,112 35507 DEFB 112,112,56,62,240 ; (05 x 02) Reggie the Rat 35512 DEFB 0,11,3,15,31,31,63,0 35520 DEFB 3,248,254,255,1,241,250,0 35528 DEFB 6,136,72,0,12,1,1,3 35536 DEFB 30,63,63,56,255,2,159,31 35544 DEFB 7,251,253,254,102,47,175,135 35552 DEFB 243,12,252,252,118,50,223,7 35560 DEFB 193,0,4,64,128,0,1,128 35568 DEFB 3 ; (10 x 03) Roof / Top of Well 35569 DEFB 0,8,15,31,31,0,1,31 35577 DEFB 31,62,60,255,3,0,1,127 35585 DEFB 127,126,254,255,2,252,0,1 35593 DEFB 59,115,119,231,255,2,0,1 35601 DEFB 255,1,254,254,252,253,255,2 35609 DEFB 0,1,127,127,255,5,3,236 35617 DEFB 207,223,223,159,0,1,255,2 35625 DEFB 0,1,243,247,247,239,0,1 35633 DEFB 252,254,2,248,250,251,247,0 35641 DEFB 4,128,192,64,96,0,5,1 35649 DEFB 1,3,125,96,15,255,4,224 35657 DEFB 128,47,207,223,159,191,63,0 35665 DEFB 2,251,251,243,247,231,239,3 35673 DEFB 125,0,1,255,5,254,255,1 35681 DEFB 0,1,159,191,63,127,127,96 35689 DEFB 191,0,1,253,253,249,251,243 35697 DEFB 0,1,224,15,255,5,15,7 35705 DEFB 247,239,239,239,207,223,223,160 35713 DEFB 160,176,208,208,216,232,232,0 35721 DEFB 1,3,7,7,7,0,3,15 35729 DEFB 255,3,254,8,94,94,207,223 35737 DEFB 159,191,0,4,248,254,254,252 35745 DEFB 1,0,4,127,255,3,0,3 35753 DEFB 14,254,254,252,248,0,3,127 35761 DEFB 255,3,0,4,224,255,3,63 35769 DEFB 0,3,31,159,159,63,60,0 35777 DEFB 1,13,13,236,244,244,246,192 35785 DEFB 0,1,192,192,0 ; (11 x 10) Well 35790 DEFB 0,8,94,94,94,94,92,95 35798 DEFB 91,91,0,4,1,253,253,253 35806 DEFB 0,3,74,181,181,181,181,0 35814 DEFB 3,72,188,182,182,182,0,5 35822 DEFB 255,1,199,255,1,0,5,252 35830 DEFB 255,2,0,5,255,3,13,13 35838 DEFB 13,13,13,236,237,237,192,192 35846 DEFB 192,192,192,0,1,252,254,0 35854 DEFB 16,92,94,94,90,94,94,94 35862 DEFB 94,1,0,7,181,74,0,6 35870 DEFB 176,70,6,6,2,6,4,6 35878 DEFB 0,24,12,12,13,13,13,13 35886 DEFB 13,13,6,198,198,198,198,198 35894 DEFB 198,198,0,16,110,94,94,92 35902 DEFB 92,92,88,92,0,14,1,3 35910 DEFB 6,6,15,22,32,192,255,1 35918 DEFB 128,0,3,128,64,32,208,120 35926 DEFB 0,16,5,13,13,13,13,13 35934 DEFB 13,13,198,198,198,198,199,195 35942 DEFB 192,192,0,3,62,255,1,163 35950 DEFB 62,0,9,92,92,94,94,94 35958 DEFB 78,110,78,0,8,3,2,3 35966 DEFB 3,3,3,3,3,128,127,64 35974 DEFB 255,1,63,63,63,63,24,224 35982 DEFB 24,248,248,248,248,184,0,16 35990 DEFB 13,12,12,12,12,13,13,13 35998 DEFB 192,192,192,192,192,192,192,192 36006 DEFB 0,16,94,94,94,94,94,94 36014 DEFB 92,92,0,8,3,3,1,1 36022 DEFB 1,0,3,63,191,159,159,159 36030 DEFB 227,127,0,1,184,248,248,248 36038 DEFB 240,240,192,0,17,13,13,13 36046 DEFB 13,13,13,13,13,192,192,192 36054 DEFB 128,128,128,128,192,0,13,1 36062 DEFB 1,1,92,94,94,14,238,206 36070 DEFB 238,238,0,3,128,192,224,224 36078 DEFB 7,0,6,3,255,1,0,6 36086 DEFB 255,2,0,6,255,2,0,6 36094 DEFB 128,255,1,0,8,13,13,13 36102 DEFB 13,13,13,13,1,192,192,192 36110 DEFB 192,192,208,208,216,0,8,1 36118 DEFB 3,3,3,3,7,7,7,238 36126 DEFB 204,220,220,220,156,156,156,63 36134 DEFB 252,191,135,224,254,223,223,254 36142 DEFB 0,1,255,2,6,112,217,137 36150 DEFB 0,3,255,1,0,1,255,3 36158 DEFB 0,3,255,1,6,240,25,137 36166 DEFB 127,0,1,127,255,1,6,240 36174 DEFB 249,249,240,254,251,227,15,255 36182 DEFB 1,63,125,29,29,29,29,29 36190 DEFB 29,29,28,216,216,216,216,220 36198 DEFB 220,220,204,0,8,7,15,15 36206 DEFB 15,14,30,30,30,156,28,92 36214 DEFB 92,44,108,92,92,255,1,127 36222 DEFB 127,159,195,248,252,252,201,233 36230 DEFB 249,249,240,0,1,127,159,255 36238 DEFB 2,127,63,249,0,1,240,249 36246 DEFB 233,233,249,249,240,0,1,251 36254 DEFB 191,249,241,249,248,240,1,15 36262 DEFB 159,249,254,252,241,3,255,3 36270 DEFB 60,60,60,57,57,57,57,57 36278 DEFB 204,204,204,206,206,206,207,207 36286 DEFB 0,8,30,60,60,60,60,120 36294 DEFB 120,120,92,92,92,92,92,120 36302 DEFB 0,2,252,125,57,193,252,127 36310 DEFB 127,63,191,255,2,248,0,1 36318 DEFB 241,251,59,249,233,201,240,0 36326 DEFB 1,255,2,254,63,127,255,1 36334 DEFB 254,0,1,199,108,109,153,155 36342 DEFB 143,0,1,7,239,255,2,254 36350 DEFB 252,225,3,206,238,236,224,57 36358 DEFB 57,57,57,57,121,121,113,207 36366 DEFB 199,199,198,192,192,192,128,0 36374 DEFB 8,240,0,15,15,0,7,243 36382 DEFB 1,0,6,255,2,0,6,239 36390 DEFB 199,0,6,255,1,248,0,6 36398 DEFB 128,0,7,112,112,112,96,0 36406 DEFB 20 ; (04 x 02) Jump Chute / Corridor Pad 36407 DEFB 31,63,63,63,55,48,31,0 36415 DEFB 1,255,5,0,1,255,1,0 36423 DEFB 1,255,5,0,1,255,1,0 36431 DEFB 1,248,204,228,228,196,12,248 36439 DEFB 0,1,127,255,7,31,191,191 36447 DEFB 191,191,191,191,191,241,251,251 36455 DEFB 251,251,187,155,195,254,255,7 ; (04 x 07) Cracked Column Section 1 36463 DEFB 3,3,6,6,7,7,7,7 36471 DEFB 0,2,128,240,126,255,3,0 36479 DEFB 1,24,60,126,14,231,251,252 36487 DEFB 0,6,128,192,7,7,7,7 36495 DEFB 7,7,7,7,255,10,254,254 36503 DEFB 254,254,254,254,0,1,64,64 36511 DEFB 192,192,192,192,192,3,1,1 36519 DEFB 0,1,2,2,2,2,255,7 36527 DEFB 127,254,254,254,254,254,255,3 36535 DEFB 192,192,192,192,64,64,64,64 36543 DEFB 3,3,3,3,3,3,0,1 36551 DEFB 1,127,127,127,127,127,127,127 36559 DEFB 191,255,8,64,64,64,128,128 36567 DEFB 192,224,224,7,15,15,15,15 36575 DEFB 15,15,15,223,223,239,239,239 36583 DEFB 211,188,63,255,8,224,240,240 36591 DEFB 240,240,240,240,240,14,14,15 36599 DEFB 15,15,3,1,4,255,7,127 36607 DEFB 255,8,240,240,112,112,176,192 36615 DEFB 176,48,7,7,7,7,7,7 36623 DEFB 7,0,1,127,127,63,143,239 36631 DEFB 239,247,0,1,255,7,0,1 36639 DEFB 240,240,240,240,240,240,240,0 36647 DEFB 1 ; (04 x 06) Cracked Column Section 2 36648 DEFB 0,3,1,1,1,0,4,240 36656 DEFB 254,255,2,127,0,3,7,127 36664 DEFB 255,3,0,3,224,224,224,224 36672 DEFB 192,0,3,1,1,1,3,3 36680 DEFB 3,63,255,7,251,251,249,253 36688 DEFB 253,253,252,254,192,192,192,192 36696 DEFB 192,192,192,192,3,3,3,3 36704 DEFB 3,3,3,3,255,8,254,248 36712 DEFB 247,247,207,191,255,2,192,64 36720 DEFB 64,0,1,128,192,192,192,3 36728 DEFB 3,3,3,3,7,7,7,255 36736 DEFB 3,251,251,247,247,199,255,8 36744 DEFB 192,192,192,192,192,224,224,224 36752 DEFB 7,6,0,1,7,7,7,7 36760 DEFB 7,55,123,251,251,255,12,224 36768 DEFB 224,224,224,224,224,224,224,7 36776 DEFB 7,7,7,7,7,7,7,255 36784 DEFB 16,224,224,224,224,192,192,128 36792 DEFB 128,8 ; (07 x 07) Fire bowl 36794 DEFB 0,13,1,1,0,3,8,12 36802 DEFB 14,14,15,15,0,9,128,128 36810 DEFB 0,2,64,64,64,0,24,2 36818 DEFB 2,3,3,3,3,1,1,7 36826 DEFB 7,7,7,135,207,207,239,0 36834 DEFB 2,135,143,159,223,215,215,64 36842 DEFB 192,192,192,192,192,144,144,0 36850 DEFB 24,1,1,3,2,2,3,1 36858 DEFB 0,1,237,109,121,57,49,49 36866 DEFB 16,0,1,215,179,163,161,161 36874 DEFB 33,1,0,1,24,56,184,172 36882 DEFB 204,196,196,0,17,255,1,0 36890 DEFB 1,63,60,28,14,7,3,255 36898 DEFB 1,0,1,255,1,31,15,15 36906 DEFB 7,195,255,1,0,1,255,7 36914 DEFB 0,1,255,7,0,1,255,7 36922 DEFB 0,1,255,7,0,1,252,252 36930 DEFB 248,240,224,192,1,0,7,225 36938 DEFB 248,60,15,0,4,255,2,127 36946 DEFB 255,1,0,1,255,1,31,7 36954 DEFB 255,4,0,1,255,7,0,1 36962 DEFB 255,1,248,224,255,2,252,240 36970 DEFB 0,4,128,0,25,1,1,0 36978 DEFB 3,1,0,1,255,1,159,159 36986 DEFB 255,1,0,1,255,1,207,0 36994 DEFB 2,128,128,0,3,128,0,32 37002 DEFB 7,15,30,30,62,63,0,1 37010 DEFB 63,159,31,63,127,127,255,1 37018 DEFB 0,1,255,1,224,240,248,248 37026 DEFB 252,252,0,1,252,0,16 ; (03 x 04) Plinth 37033 DEFB 0,1,255,2,0,1,255,3 37041 DEFB 0,2,255,2,0,1,255,3 37049 DEFB 0,2,255,2,0,1,255,3 37057 DEFB 0,1,63,63,63,63,95,79 37065 DEFB 113,119,255,2,253,253,254,254 37073 DEFB 255,2,252,252,252,252,252,112 37081 DEFB 142,126,127,127,127,127,0,1 37089 DEFB 63,127,127,254,255,3,0,1 37097 DEFB 255,3,254,254,254,254,0,1 37105 DEFB 252,254,254,0,1,252,254,254 37113 DEFB 254,254,254,254,0,1,126,255 37121 DEFB 6,0,1,63,127,127,127,127 37129 DEFB 127,127,60 ; (04 x 06) Large stool 37132 DEFB 127,255,4,0,1,31,0,1 37140 DEFB 239,247,255,3,0,1,127,0 37148 DEFB 1,255,4,251,0,1,254,0 37156 DEFB 1,254,255,4,0,1,248,0 37164 DEFB 1,31,31,31,30,30,30,30 37172 DEFB 30,0,16,248,240,240,240,248 37180 DEFB 248,120,248,31,31,31,31,31 37188 DEFB 31,31,31,0,4,63,255,2 37196 DEFB 63,0,4,252,255,2,252,248 37204 DEFB 248,248,248,248,248,248,248,31 37212 DEFB 31,15,31,31,31,31,31,0 37220 DEFB 16,248,248,248,152,120,120,248 37228 DEFB 248,31,31,31,31,31,31,30 37236 DEFB 30,0,16,248,248,248,248,248 37244 DEFB 248,240,240,29,31,31,31,31 37252 DEFB 31,0,1,14,0,16,248,248 37260 DEFB 248,248,248,0,1,112,0,1 ; (02 x 05) Plant 37268 DEFB 4,12,12,12,14,7,7,3 37276 DEFB 64,32,32,96,224,192,192,128 37284 DEFB 3,1,1,1,1,1,13,30 37292 DEFB 0,3,60,126,126,126,248,30 37300 DEFB 28,12,4,4,4,4,3,128 37308 DEFB 128,136,156,156,156,136,136,1 37316 DEFB 1,17,57,57,57,13,5,56 37324 DEFB 64,64,64,128,28,124,252,7 37332 DEFB 1,3,2,2,2,2,0,1 37340 DEFB 24,0,7 ; (03 x 07) Torch 37343 DEFB 0,8,4,0,2,4,4,6 37351 DEFB 7,7,0,4,16,0,1,96 37359 DEFB 224,0,8,3,1,1,3,15 37367 DEFB 11,11,11,192,128,192,72,216 37375 DEFB 120,184,224,0,8,15,6,14 37383 DEFB 10,15,13,7,0,1,192,192 37391 DEFB 224,224,240,224,192,0,2,3 37399 DEFB 3,3,1,1,0,2,31,31 37407 DEFB 0,1,191,224,223,223,0,1 37415 DEFB 224,227,3,243,30,238,236,0 37423 DEFB 9,15,15,15,14,6,7,0 37431 DEFB 1,7,192,64,64,192,128,128 37439 DEFB 0,1,128,0,8,31,7,14 37447 DEFB 7,6,7,6,3,224,128,192 37455 DEFB 128,128,128,128,0,9,3,3 37463 DEFB 3,3,3,3,3,0,9 ; (06 x 05) Sword in Concrete 37470 DEFB 0,6,14,15,0,40,13,12 37478 DEFB 6,3,1,0,3,128,193,97 37486 DEFB 48,134,207,27,54,192,224,160 37494 DEFB 144,144,224,0,26,3,7,4 37502 DEFB 6,3,0,3,44,249,51,38 37510 DEFB 230,195,1,0,1,64,192,64 37518 DEFB 96,32,48,216,252,0,35,7 37526 DEFB 31,60,125,103,111,63,31,15 37534 DEFB 135,130,129,7,0,1,128,224 37542 DEFB 199,63,255,3,0,3,192,224 37550 DEFB 248,252,243,0,9,3,15,25 37558 DEFB 19,63,62,31,60,147,199,207 37566 DEFB 207,75,79,135,252,224,251,255 37574 DEFB 8,251,248,240,195,254,248,252 37582 DEFB 255,3,31,143,7,224,48,144 37590 DEFB 248,248,248,248,224 ; Unused b37595 DEFB 0,0,0,0,0,0,0,0 37603 DEFB 0,0,0,0,0,0,0,0 37611 DEFB 0,0,0,0,0,0,0,0 37619 DEFB 0,0,0,0,0,0,0,0 37627 DEFB 0,0,0,0,0 ; Initialise Interrupt Code then Display and Handle Input Device Selection Menu c37632 LD SP,23808 ; Set Stack Pointer to 23808 37635 XOR A ; Load A with zero 37636 LD (23364),A ; Store zero at 23364 (see trivia) 37639 LD (IY+65),A ; Reset all Interrupt Routine flags 37642 LD (IY+87),3 ; Set P-FLAG bits 0 and 1 (OVER 1) (IY = 23610) 37646 LD (IY+48),8 ; 37650 LD A,24 ; Put JR instruction at 65535 for jumping to interrupt routine... 37652 LD (65535),A ; ... 37655 LD A,195 ; Load first byte of interrupt routine with 195... 37657 LD (65524),A ; ...representing "JP" 37660 LD HL,62178 ; Load following two bytes of interrupt routine with 62178... 37663 LD (65525),HL ; ...to make "JP 62178" 37666 LD A,59 ; Load A with 59 37668 DI ; Disable Interrupts 37669 LD I,A ; Load I register with 57 (for interrupt routine) 37671 EI ; Enable Interrupts 37672 HALT ; Wait for interrupt 37673 XOR A ; Reset all Interrupt Routine flags... 37674 LD (IY+65),A ; ... (IY = 23610) 37677 IM 2 ; Set Interrupt Mode 2 37679 LD A,1 ; Set Player Attribute Update Flag (Player Attribute Update mode)... 37681 LD (23706),A ; ... 37684 CALL 38003 ; Set border to black and clear temporary storage area of memory 37687 JR 37702 ; Display and handle Input Device Selection Menu ; Wait for Interrupt then Display and Handle Input Device Selection Menu ; ; Used by the routine at #R64582. c37689 HALT ; Wait for interrupt 37690 LD SP,23808 ; Set Stack Pointer to 23808 37693 XOR A ; Reset all Interrupt Routine flags... 37694 LD (IY+65),A ; ... (IY = 23610) 37697 IM 2 ; Set Interrupt Mode 2 37699 CALL 38003 ; Set border to black and clear temporary storage area of memory ; This entry point is used by the routine at 37632 *37702 CALL 37909 ; Draw Input Device Selection Menu and update currently selected input device *37705 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 37708 CP 4 ; If "CHANGE GAME OPTIONS" selected... 37710 JP Z,37758 ; ...then skip ahead to #R37758 37713 CP 5 ; If "INSTRUCTIONS" selected... 37715 JR Z,37752 ; ...then skip ahead to #R37752 37717 CP 6 ; If "PLAY GAME" selected... 37719 JP Z,38024 ; ...then jump to #R38024 (initialise data and start a new game) 37722 PUSH AF ; Store AF (A = index of selected menu item) 37723 LD A,(63653) ; Load A with index of currently selected input device (see trivia) 37726 PUSH AF ; Store AF (A = index of currently selected input device) 37727 LD C,A ; Load C with index of currently selected input device 37728 LD A,(49084) ; Load A with y-coordinate of top edge of Window 6 (Control Selection Window) 37731 ADD A,C ; Add index of currently selected input device... 37732 ADD A,2 ; ...and add two more to get y-coordinate of menu item for currently selected input device 37734 LD B,A ; Load value into B 37735 LD C,3 ; Load C with 3 37737 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) 37740 LD (HL),71 ; Set attribute at this location to 71 (white INK, black PAPER, BRIGHT) (see trivia) 37742 POP DE ; Restore DE (D = index of currently selected input device, previously in AF) 37743 POP AF ; Store AF (A = index of selected menu item) 37744 LD (63653),A ; Set new selected input device index at #R63653 37747 CALL 63598 ; Update currently selected input device... 37750 JR 37705 ; ...and loop back to #R37705 *37752 CALL 37951 ; Display Instructions windows 37755 JP 37702 ; Jump back to #R37702 to capture next menu selection *37758 CALL 37764 ; Display and handle Gadget X Menu 37761 JP 37702 ; Jump back to #R37702 to capture next menu selection ; Display and Handle Gadget X Menu ; ; Used by the routines at #R37689 and #R43494. c37764 LD A,11 ; Set y-coordinate of top edge (characters) of Window 7 to 11... 37766 LD (49092),A ; ... 37769 LD A,7 ; Load A with index of "REDEFINE THE GAME" Window 37771 CALL 47185 ; ...and draw 37774 LD HL,50449 ; Point HL at Gadget X menu text... 37777 CALL 46902 ; ...and print 37780 CALL 47897 ; Play upward scale sound 37783 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 37786 OR A ; If REDEFINE KEYBOARD selected... 37787 JP Z,37824 ; ...then skip ahead to #R37824 37790 CP 1 ; If PLAYER ATTRIBUTE IGNORE selected... 37792 JR Z,37815 ; ...then skip ahead to #R37815 37794 CP 2 ; If PLAYER ATTRIBUTE UPDATE selected... 37796 JR Z,37820 ; ...then skip ahead to #R37820 37798 CP 5 ; If DO NOTHING selected... 37800 RET Z ; ...then return 37801 BIT 0,(IY+65) ; If Game In Progress Flag is reset... (IY = 23610) 37805 JR Z,37863 ; ...then skip ahead to #R37863 37807 CP 3 ; If SAVE THE GAME selected... 37809 JR Z,37841 ; ...then skip ahead to #R37841 37811 CP 4 ; If LOAD AN OLD GAME selected... 37813 JR Z,37848 ; ...then skip ahead to #R37848 *37815 XOR A ; Reset Player Attribute Update Flag (Player Attribute Ignore mode)... *37816 LD (23706),A ; ... 37819 RET ; Return *37820 LD A,1 ; Set Player Attribute Update Flag (Player Attribute Update mode)... 37822 JR 37816 ; ...and return *37824 CALL 47897 ; Play upward scale sound 37827 LD A,8 ; Draw Window 8... 37829 CALL 47193 ; ... 37832 LD HL,50513 ; Point HL at "Redefine Keys Window" text... 37835 CALL 46902 ; ...and print to screen 37838 JP 63740 ; Redefine keyboard controls *37841 CALL 37880 ; Clear Stack and Prepare to Save Data 37844 CALL 1218 ; Jump to ROM routine to save game data 37847 RET ; Return (to start of Main Game Loop - see PUSH at #R37887) *37848 CALL 37880 ; Clear Stack and Prepare to Load Data 37851 SCF ; Set Carry Flag as we are LOADing, not VERIFYing 37852 LD SP,22528 ; Set Stack Pointer to 22528 37855 CALL 1366 ; Jump to ROM routine to load game data 37858 LD SP,(23613) ; Restore Stack Pointer from 23613 (set to 23808 in routine at #R37880) 37862 RET ; Return (to start of Main Game Loop - see PUSH at #R37887) *37863 LD A,5 ; Draw Window 5... 37865 CALL 47193 ; ... 37868 LD HL,50594 ; Point HL at "SAVE & LOAD ARE NOT ALLOWED HERE..." text... 37871 CALL 46902 ; ...and print to screen 37874 CALL 47897 ; Play upward scale sound 37877 JP 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed and return ; Clear Stack and Prepare to Load Data ; ; Used by the routine at #R37764. c37880 POP DE ; Remove return address of calling routine from top of Stack 37881 LD SP,23808 ; Set Stack Pointer to 23808 37884 LD HL,38205 ; Load HL with start address of Main Game Loop routine 37887 PUSH HL ; Store HL (address of Main Game Loop) 37888 LD (23613),SP ; Store Stack Pointer address at 23613 (System Variable ERR SP) 37892 PUSH DE ; Store HL (return address in routine that called this routine) 37893 CALL 47897 ; Play upward scale sound 37896 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 37899 LD IX,23296 ; Set base address for load to 23296 37903 LD DE,23808 ; Set data length to 23808 37906 LD A,255 ; Load A with 255 to denote a data block 37908 RET ; Return ; Draw Input Device Selection Menu and Update Currently Selected Input Device ; ; Used by the routine at #R37689. c37909 CALL 47856 ; Clear Display File 37912 LD A,70 ; Load system variable ATTR T with 70 (yellow INK, black PAPER, BRIGHT)... 37914 LD (23695),A ; ... 37917 CALL 47881 ; ...and flood Attribute File with this attribute 37920 LD A,5 ; Draw Window 5 ("STORMBRINGER A TRUE GRAPHIC ADVENTURE...")... 37922 CALL 47193 ; ... 37925 LD HL,50640 ; Point HL at "STORMBRINGER A TRUE GRAPHIC ADVENTURE..." text... 37928 CALL 46902 ; ...and print to screen 37931 LD A,6 ; Draw Control Selection Menu Window... 37933 CALL 47185 ; ... 37936 LD HL,50090 ; Point HL at Initial Control Selection Menu text... 37939 CALL 46902 ; ...and print to screen 37942 CALL 47930 ; Play downward scale sound 37945 LD A,(63653) ; Load index of currently selected input device into A 37948 JP 63598 ; Update currently selected input device and return ; Display Instructions Windows ; ; Used by the routines at #R37689 and #R43494. c37951 LD A,10 ; Set y-coordinate of top edge (characters) of Window 7 to 10... 37953 LD (49092),A ; ... 37956 LD A,7 ; Load A with 7 (index of window to draw) 37958 LD HL,50138 ; Point HL at Instructions Text 37961 CALL 37989 ; Print text at HL in Window 07 37964 LD A,8 ; Draw Window 8... 37966 CALL 47193 ; ... 37969 LD HL,50296 ; Point HL at "THE KEYS ARE :-..." text... 37972 CALL 46902 ; ...and print to screen 37975 CALL 63691 ; Print current control keys to screen 37978 CALL 47897 ; Play upward scale sound 37981 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 37984 LD A,9 ; Prepare to draw Window 9 37986 LD HL,50360 ; Point HL at Cast of Characters text *37989 PUSH HL ; Store HL (pointer to text to print) 37990 CALL 47193 ; Draw current Instructions Window 37993 POP HL ; Restore HL (pointer to text to print) 37994 CALL 46902 ; Print text 37997 CALL 47897 ; Play upward scale sound 38000 JP 64230 ; Wait for interrupt then 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 #R37689. c38003 LD A,7 ; Set System Variable BORDCR to 7 (black BORDER, white INK, black PAPER)... 38005 LD (23624),A ; ... 38008 XOR A ; Set border to black and reset EAR and MIC bits... 38009 OUT (254),A ; ... 38011 LD HL,23296 ; Load memory addresses from #R23296 to 23551 with zeroes... 38014 LD DE,23297 ; ... 38017 LD BC,255 ; ... 38020 LD (HL),A ; ... 38021 LDIR ; ... 38023 RET ; Return ; Initialise Data and Start a New Game ; ; Used by the routine at #R37689. c38024 LD A,(23672) ; Load A with LSB of System Variable FRAMES... 38027 AND 127 ; ...and clear bit 7 to leave random number between 0 and 127 38029 JR Z,38024 ; If number is zero then loop back to #R38024 38031 LD B,A ; Load B with generated number 38032 AND 96 ; If neither bit 5 not bit 6 is set (see trivia)... 38034 JR Z,38024 ; ...then loop back to #R38024 to generate another number 38036 LD A,B ; Load A with generated number... 38037 LD (23484),A ; ...and store at #R23484 as Current Password Number 38040 LD HL,51742 ; Point HL at start of "---" segment for Password Number in Rachel's help text at #R51709 38043 CALL 46837 ; Splice numeric Password data as a string into Rachel's help text 38046 CALL 47897 ; Play upward scale sound 38049 LD A,70 ; Set ATTR T system variable to 70 (yellow INK, black PAPER, BRIGHT)... 38051 LD (23695),A ; ... 38054 LD HL,49282 ; Copy data from #R49282 - 49353 (Characters' Initial Stats)... 38057 LD DE,24768 ; ...to #R24768 - 24839 (Characters' Current Stats)... 38060 LD BC,72 ; ... 38063 LDIR ; ... 38065 LD HL,48603 ; Copy data from #R48603 - 48610 (Magic Knight's Initial Data)... 38068 LD BC,8 ; ...to #R24840 - 24847 (Magic Knight's Current Data)... 38071 LDIR ; ... 38073 LD HL,48611 ; Copy data from #R48611 - 48660 (Characters' Initial Inventories)... 38076 LD BC,50 ; ...to #R24848 - 24897 (Characters' Current Inventories)... 38079 LDIR ; ... 38081 LD HL,48661 ; Copy data from #R48661 - 48684 (Characters' Initial Positions)... 38084 LD BC,24 ; ...to #R24898 - 24921 (Characters' Current Positions)... 38087 LDIR ; ... 38089 LD HL,48685 ; Copy data from #R48685 - 48810 (Objects' Initial Positions)... 38092 LD BC,126 ; ...to #R24922 - 25047 (Objects' Current Positions)... 38095 LDIR ; ... 38097 CALL 46183 ; Set Magic Knight's available action flags 38100 XOR A ; Load A and HL with zero... 38101 LD H,A ; ... 38102 LD L,A ; ... 38103 LD (23560),A ; Clear last pressed key 38106 LD (40605),A ; Reset Bearwoolf Removed Flag 38109 LD (23486),A ; Store zero at #R23486 (see trivia) 38112 LD (23460),A ; Set 1/50 Second Counter (Time Elapsed since last second) to zero 38115 LD (23458),HL ; Set Minute Counter and Second Counter to zero 38118 LD (23675),HL ; Reset all Interrupt Routine flags 38121 NOP ; Do nothing (see trivia)... 38122 NOP ; ... 38123 NOP ; ... 38124 LD (23673),HL ; Set two most significant bytes of system variable FRAMES to zero 38127 LD (23471),HL ; Set x- & y- coordinates of top-left character of currently glowing "Locate Compass" component ; to zero (see trivia) 38130 INC A ; Set Animate Puff of Smoke Flag... 38131 LD (23480),A ; ... 38134 LD (64688),A ; Set Do Not Draw Storm Cloud Flag 38137 LD A,36 ; Set number of hours left to 36... 38139 LD (23457),A ; ... 38142 LD A,135 ; Set room layout data instruction at #R59866... 38144 LD (59866),A ; ...to 135 (draw Security Door 1/3) 38147 INC A ; Set room layout data instruction at #R59867... 38148 LD (59867),A ; ...to 136 (draw Security Door 2/3) 38151 INC A ; Set room layout data instruction at #R59868... 38152 LD (59868),A ; ...to 137 (draw Security Door 3/3) 38155 LD HL,59006 ; Set Room Layout Data Pointer for Room 3 to #R59006... 38158 LD (58847),HL ; ...i.e. include Grunter graphic in room layout 38161 LD B,6 ; Load A with random number in range 0-5... 38163 CALL 64829 ; ... 38166 LD (23703),A ; ...and store as Index of Required Disquise 38169 LD A,(23672) ; Load A with LSB of System Variable FRAMES... 38172 AND 7 ; ...clear bits 3-7 to leave random number between 0 and 7... 38174 LD (23713),A ; ...and set index of current Crystal Ball substring to this value 38177 ADD A,4 ; Add four to A... 38179 AND 7 ; ...clear bits 3-7 to leave random number between 0 and 7... 38181 LD (23714),A ; ...and set index of current Scroll substring to this value 38184 LD A,36 ; Set index of next object to be laid by Chicken to 36 (Golden Egg)... 38186 LD (23466),A ; ... 38189 LD A,12 ; Set Storm Cloud's current room to 12 (Outdoors, 11, The Spooky Forest, 3)... 38191 LD (23715),A ; ... 38194 LD A,7 ; Move Magic Knight into Outdoors, 6 (The Sword in the Concrete), draw room and initialise ; room-specific data... 38196 CALL 38841 ; ... 38199 SET 0,(IY+65) ; Set Game In Progress Flag (IY = 23610) 38203 JR 38208 ; 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 #R41578 and #R64926. c38205 CALL 38844 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data ; This entry point is used by the routine at #R38024. *38208 CALL 40008 ; Set Magic Knight's velocity to zero, if appropriate move to new room, update state of Storm ; Cloud and execute room-specific routine 38211 CALL 38434 ; Handle Magic Knight's fall 38214 LD A,127 ; Reset Bit 7 in A to select the keyboard half-row SPACE - B 38216 IN A,(254) ; Read the keyboard 38218 RRA ; Reset Carry Flag if SPACE pressed, else set it 38219 JR C,38232 ; SPACE was not pressed, so skip ahead to #R38232 38221 LD A,254 ; Reset bit 0 in A to select the keyboard half-row SHIFT - V 38223 IN A,(254) ; Read the keyboard 38225 RRA ; Reset Carry Flag if SHIFT pressed, else set it 38226 LD HL,50809 ; Point HL at "BREAK KEY PRESSED" text 38229 JP NC,64582 ; If SHIFT was pressed (i.e. SHIFT-SPACE, or BREAK) jump to "Game over" window routine and ; return to Control Selection Menu *38232 CALL 38585 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 38235 CALL 64034 ; Capture keyboard or joystick input loading result into A 38238 BIT 0,A ; If "left" pressed then... 38240 JR NZ,38272 ; Skip ahead to "move left" subroutine 38242 BIT 1,A ; If "right" pressed then... 38244 JR NZ,38312 ; Skip ahead to "move right" subroutine 38246 BIT 2,A ; If "up" pressed then... 38248 JP NZ,38329 ; Skip ahead to "jump" subroutine 38251 BIT 3,A ; If "down" pressed then... 38253 CALL NZ,64836 ; ...select Magic Knight's Room if Cheat / Debug Mode is enabled 38256 BIT 4,A ; If "fire" pressed then... 38258 JR NZ,38266 ; ...skip ahead to #R38266 38260 CALL 61816 ; Wait for interrupt then erase Magic Knight from display, advance his current position then ; redraw 38263 JP 38208 ; Loop back for next key / control press ; Fire Pressed *38266 CALL 47592 ; Wait for Fire Button / Key to be Released 38269 JP 42494 ; Display and handle main in-game menu ; Left Pressed *38272 LD HL,23474 ; If "Magic Knight Can't Move Left" flag is set... 38275 BIT 0,(HL) ; ... 38277 JP NZ,38208 ; ...then loop back to start of keyboard check routine 38280 EX AF,AF' ; Switch AF and AF' 38281 LD A,1 ; Set Magic Knight Facing Left Flag... 38283 LD (23417),A ; ... 38286 LD A,254 ; Set Magic Knight's x-velocity to minus 2... *38288 LD (24844),A ; ... 38291 LD (38360),A ; Prepare to set Magic Knight's x-velocity to minus 2 38294 EX AF,AF' ; Switch AF and AF' (A now holds pressed controls bitmap) 38295 BIT 2,A ; If "up" was also pressed... 38297 JR NZ,38333 ; ...then skip ahead to #R38333 (jumping subroutine) 38299 XOR A ; Set Magic Knight's current y-velocity to zero... 38300 LD (24845),A ; ... 38303 CALL 61816 ; Wait for interrupt then erase Magic Knight from display, advance his current position then ; redraw 38306 CALL 38434 ; Handle Magic Knight's fall 38309 JP 38208 ; Loop back for next key / control press ; Right Pressed *38312 LD HL,23474 ; If "Magic Knight Can't Move Right" flag is set... 38315 BIT 1,(HL) ; ... 38317 JP NZ,38208 ; ...then loop back to start of keyboard check routine 38320 EX AF,AF' ; Switch AF and AF' 38321 XOR A ; Reset Magic Knight Facing Left Flag... 38322 LD (23417),A ; ... 38325 LD A,2 ; Jump to #R38288, setting Magic Knight's x-velocity to 2... 38327 JR 38288 ; ... ; Up Pressed *38329 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 38330 LD (38360),A ; ... *38333 LD HL,49019 ; Point HL at start of Magic Knight's y-velocities sequence table *38336 LD (23442),HL ; Store current position in Magic Knight's y-velocities sequence table at #R23442 38339 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 38342 CP 8 ; If y-coordinate is less than 8... 38344 JP C,38413 ; ...then jump to #R38413 (exit loop as Magic Knight can't get any higher!) 38347 LD HL,(23442) ; Load HL with current position in Magic Knight's y-velocities sequence table 38350 LD A,(HL) ; Load the current y-velocity in the sequence into A 38351 NEG ; Negate (as Magic Knight is jumping upwards) 38353 OR A ; If A is zero... 38354 JR Z,38413 ; ...jump to #R38413 (exit loop as we have reached the end of the sequence) 38356 LD (24845),A ; Load A into Magic Knight's y-velocity ; The operand of the instruction at #R38359 represents the x-velocity value stored previously. This is modified by ; the instructions at #R38291, #R38330 and #R38423. 38359 LD A,0 ; Set Magic Knight's x-velocity... 38361 LD (24844),A ; ... 38364 CALL 38585 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 38367 LD A,(24844) ; Load Magic Knight's x-velocity into B... 38370 LD B,A ; ... 38371 LD A,(23474) ; Load Magic Knight movement flags into A 38374 XOR B ; Check: 38375 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 38377 JP Z,38419 ; ...then jump ahead to #R38419 38380 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 38382 JP Z,38419 ; ...then jump ahead to #R38419 38385 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 38387 JP Z,38419 ; ...then jump ahead to #R38419 38390 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 38391 JP Z,38419 ; ...then jump ahead to #R38419 *38394 CALL 38724 ; Kill Magic Knight's jump if he cannot vertically pass through a block above him 38397 EX AF,AF' ; Switch AF and AF' 38398 CALL 61816 ; Wait for interrupt then erase Magic Knight from display, advance his current position then ; redraw 38401 EX AF,AF' ; Switch AF and AF' 38402 JR NZ,38413 ; If Magic Knight's jump was impeded by a block above him then jump to #R38413 38404 CALL 40008 ; Set Magic Knight's velocity to zero, if appropriate move to new room, update state of Storm ; Cloud and execute room-specific routine 38407 LD HL,(23442) ; Load HL with current position in Magic Knight's y-velocities sequence table 38410 INC HL ; Advance to next y-velocity in the sequence 38411 JR 38336 ; Loop back to #R38336 *38413 CALL 38429 ; Handle Magic Knight's fall, preserving x-velocity 38416 JP 38208 ; Loop back to start of keyboard check routine *38419 XOR A ; Set Magic Knight's x-velocity to zero... 38420 LD (24844),A ; ... 38423 LD (38360),A ; Prepare to set Magic Knight's x-velocity to zero 38426 JP 38394 ; Jump back to #R38394 ; Handle Magic Knight's Fall, Preserving x-Velocity ; ; Used by the routine at #R38205. c38429 LD A,(38360) ; Load Magic Knight's stored x-velocity 38432 JR 38435 ; Handle Magic Knight's fall ; Handle Magic Knight's Falls ; ; Used by the routine at #R38205. c38434 XOR A ; Set A to zero ; This entry point is used by the routine at #R38429. *38435 LD (38470),A ; Prepare to set Magic Knight's x-velocity to A 38438 LD HL,49032 ; Point HL at end of table of y-velocities sequence for jumping and falling 38441 LD (23442),HL ; Store current position at #R23442 *38444 LD A,(23474) ; If Magic Knight's movement flags are reset... 38447 OR A ; ... 38448 JR Z,38454 ; ...then skip ahead to #R38454 38450 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 38451 LD (38470),A ; ... *38454 LD HL,(23442) ; Load current position in y-velocities table into HL 38457 LD A,(HL) ; Load current y-velocity from table into A 38458 CP 7 ; If velocity is 7... 38460 JR Z,38466 ; ...then skip ahead to #R38466 38462 DEC HL ; Step pointer back one byte in y-velocities table 38463 LD (23442),HL ; Store pointer *38466 LD (24845),A ; Load last y-velocity read from table into Magic Knight's y-velocity ; The operand of the instruction at #R38469 represents the x-velocity value stored previously. This is modified by ; the instructions at #R38435, #R38451 and #R38579. 38469 LD A,0 ; Set Magic Knight's x-velocity... 38471 LD (24844),A ; ... 38474 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 38477 ADD A,4 ; Add 4 to x-coordinate 38479 CALL 40658 ; Divide x-coordinate by eight, rounding down to nearest integer 38482 LD C,A ; Load result (Magic Knight's x-coordinate in characters) into C, setting B to zero... 38483 LD B,0 ; ... 38485 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 38488 AND 7 ; If y-coordinate is a multiple of eight... 38490 JR Z,38494 ; ...then skip ahead to #R38494 38492 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] *38494 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 38497 ADD A,B ; Add B to current y-coordinate (i.e. y-coordinate of highest full character block spanned by ; Magic Knight) 38498 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) 38500 CALL 40658 ; Divide A by eight, rounding down to nearest integer 38503 LD B,A ; Load result (y-coordinate in characters) into B 38504 CALL 63233 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B (block that Magic ; Knight is "falling through") 38507 LD A,(HL) ; If this block, or the one to the right of it cannot be passed vertically (downwards)... 38508 INC HL ; ...(i.e. Magic Knight has landed)... 38509 OR (HL) ; ... 38510 BIT 7,A ; ... 38512 JR NZ,38553 ; ...then skip ahead to #R38553 38514 CALL 38585 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 38517 LD A,(24844) ; Load Magic Knight's x-velocity into B... 38520 LD B,A ; ... 38521 LD A,(23474) ; Load Magic Knight's movement flags into A 38524 XOR B ; Check: 38525 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 38527 JP Z,38575 ; ...then jump ahead to #R38575 38530 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 38532 JP Z,38575 ; ...then jump ahead to #R38575 38535 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 38537 JP Z,38575 ; ...then jump ahead to #R38575 38540 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 38541 JP Z,38575 ; ...then jump ahead to #R38575 *38544 CALL 61816 ; Wait for interrupt then erase Magic Knight from display, advance his current position then ; redraw 38547 CALL 40008 ; Set Magic Knight's velocity to zero, if appropriate move to new room, update state of Storm ; Cloud and execute room-specific routine 38550 JP 38444 ; Loop back to #R38444 *38553 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 38556 AND 7 ; Retain only pixel-within-character component (e.g. 5 pixels down the pair of character ; blocks) 38558 NEG ; Negate (i.e. -5 pixels) 38560 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) 38562 LD (24845),A ; Set Magic Knight's y-velocity so that it will take his feet to the ground 38565 CALL 61816 ; Wait for interrupt then erase Magic Knight from display, advance his current position then ; redraw 38568 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 38571 LD (24844),HL ; ... 38574 RET ; Return (Magic Knight has landed) *38575 XOR A ; Set Magic Knight's x-velocity to zero... 38576 LD (24844),A ; ... 38579 LD (38470),A ; Prepare to set Magic Knight's x-velocity to zero 38582 JP 38544 ; Loop back to #R38544 ; Kill Magic Knight's x-Velocity if he Cannot Horizontally Pass Through a Block Beside Him ; ; Used by the routines at #R38205 and #R38434. c38585 LD A,(23451) ; Load B with Magic Knight's "temporary store" movement flags... 38588 LD B,A ; ... 38589 LD A,(24840) ; Load Magic Knight's x-coordinate into A 38592 CP 5 ; If x-coordinate is less than 5... 38594 JP C,38604 ; ...then jump ahead to #R38604 38597 CP 230 ; If x-coordinate is 230 or greater... 38599 JP NC,38604 ; ...then jump ahead to #R38604 38602 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) *38604 LD A,B ; Load Magic Knight's Temporary Store Movement Flags into A 38605 LD (23474),A ; Set Magic Knight's movement flags 38608 LD A,(24841) ; Load Magic Knight's y-coordinate into B 38611 LD B,A ; ... 38612 LD A,(24845) ; Add Magic Knight's y-velocity to y-coordinate in A... 38615 ADD A,B ; ... 38616 LD (23483),A ; Store this new (predicted) y-coordinate at #R23483 38619 LD C,4 ; Set C to 4 (as Magic Knight is normally four characters tall) 38621 AND 7 ; If predicted y-coordinate is divisible by eight... 38623 JR Z,38626 ; ...then skip ahead to #R38626... 38625 INC C ; ...else Magic Knight must be airborne and at non-integer y-coordinate, and so spans five ; character blocks rather than four *38626 LD A,C ; Load A with number of vertical characters spanned by Magic Knight... 38627 LD (38659),A ; ...and update instructions at #R38658... 38630 LD (38698),A ; ...and #R38697 with this value 38633 LD A,(24840) ; Load Magic Knight's current x-coordinate into C... 38636 LD C,A ; ... 38637 LD A,(24844) ; Add Magic Knight's x-velocity to x-coordinate in A... 38640 ADD A,C ; ... 38641 LD (23482),A ; Store this new (predicted) x-coordinate at #R23482 38644 CALL 40658 ; Divide predicted x-coordinate by eight, rounding down to nearest integer... 38647 LD C,A ; ...and load into C 38648 LD A,(23483) ; Load predicted y-coordinate into A... 38651 CALL 40658 ; ...divide it by eight, rounding down to nearest integer... 38654 LD (23483),A ; ...store back at #R23483... 38657 LD B,A ; ...and load into B ; The operand of the instruction at #R38658 represents number of characters spanned by Magic Knight, vertically. ; This is modified by the instruction at #R38627. 38658 LD A,0 ; Load number of characters (vertically) to check for impassibility *38660 PUSH AF ; Store remaining number of character blocks spanned by Magic Knight vertically to check 38661 CALL 63233 ; Point HL at terrain interaction data for character coordinates x=C, y=B 38664 BIT 6,(HL) ; If Bit 6 of terrain data is set (i.e. Magic Knight cannot pass block horizontally)... 38666 JR NZ,38675 ; ...then jump ahead to #R38675 38668 INC B ; Advance check to next character down 38669 POP AF ; Restore remaining number of character blocks spanned by Magic Knight vertically to check 38670 DEC A ; Decrease count of remaining character blocks by one 38671 JR NZ,38660 ; Loop back to #R38660 to check next block down 38673 JR 38684 ; Skip over setting Magic Knight's Cannot Move Left Flag as there are no obstructions to the ; left *38675 POP AF ; Restore AF 38676 LD A,(23474) ; Set "Magic Knight Cannot Move Left" Flag... 38679 OR 1 ; ... 38681 LD (23474),A ; ... *38684 LD A,(23482) ; Load Magic Knight's predicted x-coordinate (pixels) into A... 38687 ADD A,15 ; ...and add 15... 38689 CALL 40658 ; ...divide by eight, rounding down to nearest integer... 38692 LD C,A ; ...and load into C 38693 LD A,(23483) ; Load Magic Knight's predicted y-coordinate (chars) into B... 38696 LD B,A ; ... ; The operand of the instruction at #R38697 represents number of characters spanned by Magic Knight, vertically. ; This is modified by the instruction at #R38630. 38697 LD A,0 ; Load number of characters (vertically) to check for impassibility *38699 PUSH AF ; Store AF (remaining number of vertical characters to check for impassibility) 38700 CALL 63233 ; Point HL at terrain interaction data for character coordinates x=C, y=B 38703 BIT 6,(HL) ; If Bit 6 is set (i.e. Magic Knight cannot pass block horizontally)... 38705 JR NZ,38714 ; ...jump ahead to #R38714 38707 INC B ; Increase y-coordinate by one character 38708 POP AF ; Restore AF 38709 DEC A ; Decrease number of remaining blocks to check 38710 JR NZ,38699 ; If number of remaining blocks to check is not zero then loop back to #R38699 38712 JR 38723 ; Exit routine *38714 POP AF ; Restore AF 38715 LD A,(23474) ; Set "Magic Knight Cannot Move Right" flag... 38718 OR 2 ; ... 38720 LD (23474),A ; ... *38723 RET ; Return ; Kill Magic Knight's Jump if he Cannot Vertically Pass Through a Block Above Him ; ; Used by the routine at #R38205. Output: A Zero (if Magic Knight's jump was not impeded) or 1 (if the jump was ; impeded) c38724 LD A,(24841) ; Load Magic Knight's current y-coordinate into B... 38727 LD B,A ; ... 38728 LD A,(24845) ; Load A with Magic Knight's y-velocity 38731 ADD A,B ; Add y-velocity to y-coordinate in A 38732 CALL 40658 ; Divide A by eight, rounding down to nearest integer 38735 LD B,A ; Load Magic Knight's y-coordinate (CHARS) into B 38736 LD A,(24840) ; Load Magic Knight's current x-coordinate into A 38739 ADD A,4 ; Add 4 to x-coordinate (to get point roughly quarter of the way through Magic Knight's total ; width) 38741 CALL 40658 ; Divide A by eight, rounding down to nearest integer 38744 LD C,A ; Load Magic Knight's current x-coordinate (CHARS) into C 38745 CALL 63233 ; Point HL at terrain interaction data for character coordinates x=C, y=B 38748 BIT 4,(HL) ; If Bit 4 of Magic Knight's current position's terrain data (block is impassable vertically, ; upwards) is set then... 38750 JR NZ,38772 ; ...kill Magic Knight's y-velocity and exit routine 38752 INC HL ; Advance to next character block along in "terrain interaction data" 38753 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 38755 JR NZ,38772 ; ...kill Magic Knight's y-velocity and exit routine 38757 DEC B ; Advance y-coordinate by one character (to get point roughly three quarters of the way through ; Magic Knight's total width) 38758 CALL 63233 ; Point HL at terrain interaction data for character coordinates x=C, y=B 38761 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 38763 JR NZ,38772 ; ...kill Magic Knight's y-velocity and exit routine 38765 INC HL ; Advance to next character block along in "terrain interaction data" 38766 BIT 4,(HL) ; If Bit 4 of this position's terrain data (block is impassable vertically, upwards) is set ; then... 38768 JR NZ,38772 ; ...kill Magic Knight's y-velocity and exit routine 38770 XOR A ; Set A to zero, as jump was not impeded 38771 RET ; Return *38772 XOR A ; Set Magic Knight's y-velocity to zero... 38773 LD (24845),A ; ... 38776 LD A,1 ; Set A to one 38778 OR A ; Reset Zero Flag 38779 RET ; Return ; Draw Top In-Game Window ; ; Used by the routine at #R38841. c38780 LD HL,50682 ; Point HL at Info Window Text (not carrying Mirror version) 38783 PUSH HL ; Store HL (address of Info Window Text) 38784 LD A,20 ; If Magic Knight is not carrying the Mirror (20)... 38786 CALL 45510 ; ... 38789 JR NZ,38796 ; ...then skip ahead to #R38796 38791 POP HL ; Restore HL (address of Info Window Text) 38792 LD HL,51050 ; Point HL at Info Window Text (carrying Mirror version) 38795 PUSH HL ; Store HL (address of Info Window Text) *38796 LD A,1 ; Draw Window 1... 38798 CALL 47193 ; ... 38801 LD HL,16394 ; Load HL with Display File address corresponding to (10, 0) (characters)... 38804 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 38807 LD HL,50805 ; Point HL at "STORMBRINGER" text... 38810 CALL 46902 ; ...and print to screen 38813 LD HL,16417 ; Load HL with Display File address corresponding to (1, 1) (characters)... 38816 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 38819 POP HL ; Store HL (address of Info Window Text) 38820 CALL 46902 ; Print window text 38823 CALL 46463 ; Print Magic Knight's current strength at (6, 2) as text if he is carrying the Mirror 38826 JP 46490 ; Draw objects in Magic Knight's inventory if he is carrying the Mirror then return ; Print "STORMBRINGER" Text at Top of Command Summary Window ; ; Used by the routine at #R63399. c38829 LD HL,16394 ; Load HL with Display File address corresponding to (10, 0) (characters)... 38832 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 38835 LD HL,50805 ; Point HL at "STORMBRINGER" text... 38838 JP 46902 ; ...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 #R38024, #R40406, #R40437 and #R40546. Input: A Index of room to move Magic Knight into c38841 LD (23702),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 #R38205, #R39714 and #R64878. *38844 LD A,(24768) ; Load Magic Knight's current strength into A... 38847 OR A ; ...and if not zero... 38848 JR NZ,38865 ; ...then skip ahead to #R38865 38850 LD A,16 ; If Magic Knight is wearing the Brass Ankh... 38852 CALL 45505 ; ... 38855 JR Z,38863 ; ...then skip ahead to #R38863 ; This entry point is used by the routines at #R40153 and #R40201. *38857 LD HL,51071 ; Point HL at "YOU DIED OF EXHAUSTION" text 38860 JP 64582 ; Jump to "Game over" window routine and return to Control Selection Menu *38863 LD A,61 ; Set Magic Knight's current strength to 60... *38865 DEC A ; ... 38866 LD (24768),A ; ... 38869 CALL 38780 ; Draw top in-game window 38872 LD A,71 ; Load A with 71 (white INK, black PAPER, BRIGHT)... 38874 LD (23695),A ; ...and load this value into system variables ATTR T... 38877 LD (23693),A ; ...and ATTR P 38880 LD A,32 ; Load 32 into "frame number" property of... 38882 LD (46756),A ; ...axe 1... 38885 LD (46764),A ; ...axe 2... 38888 LD (46772),A ; ...axe 3... 38891 LD (46780),A ; ...and axe 4... 38894 CALL 46784 ; Draw axe(s) to screen if Magic Knight is in an axe room 38897 LD A,(23702) ; Load A with Magic Knight's current room 38900 AND 3 ; Clear all but the lowest two bits to leave a value 0-3... 38902 ADD A,68 ; ...add this to 68... 38904 LD (49047),A ; ...and set the border attribute of Window 1 to this value 38907 LD HL,23808 ; Load character rows 0-4 in Terrain Interaction Table with 254... 38910 LD DE,23809 ; ...i.e. prevent Magic Knight jumping above ceilings... 38913 LD BC,160 ; ... 38916 LD (HL),254 ; ... 38918 LDIR ; ... 38920 LD BC,576 ; Load character rows 5-22 in Terrain Interaction Table with 0... 38923 LD (HL),0 ; ...i.e. allow Magic Knight to pass through freely... 38925 LDIR ; ... 38927 LD BC,31 ; Load character row 23 in Terrain Interaction Table with 254... 38930 LD (HL),254 ; ...i.e. prevent Magic Knight falling through floors... 38932 LDIR ; ... 38934 LD HL,22688 ; Starting at the beginning of the sixth character row (y=5)... 38937 LD DE,22689 ; ...fill the Attribute File to the end with... 38940 LD BC,607 ; ...white INK, black PAPER, BRIGHT... 38943 LD (HL),71 ; ... 38945 LDIR ; ... 38947 LD HL,23368 ; Set all entries in Table of Glowing Attribute File Addresses to zero... 38950 LD DE,23369 ; ... 38953 LD BC,29 ; ... 38956 LD (HL),0 ; ... 38958 LDIR ; ... 38960 LD A,(23702) ; Load A with Magic Knight's current room 38963 LD HL,58841 ; Point HL at start of Table of Room Layout Data Pointers 38966 CALL 64627 ; Load address of layout data for Magic Knight's current room into HL 38969 PUSH HL ; Store HL (pointer to room layout data for Magic Knight's current room) 38970 CALL 47833 ; Clear lower two thirds, and lower three character rows of upper third of Display File 38973 POP HL ; Restore HL (pointer to room layout data for Magic Knight's current room) 38974 LD (39065),HL ; Store address of start of room layout data by modifying instruction at #R39063 ; This entry point is used by the routines at #R39014, #R39036, #R39047, #R40729, #R40752, #R40765 and #R40784. *38977 LD A,(HL) ; Read byte of room layout data 38978 OR A ; If byte is a zero (i.e. marker for end of layout data)... 38979 JP Z,39047 ; ...then draw floor, paint attributes / Terrain Interaction Data, draw MK, characters and ; objects then return 38982 CP 126 ; If byte is 126 (i.e. vertical block drawing)... 38984 JP Z,39036 ; ...then skip ahead to #R39036 (skip over block drawing data to start of next instruction) 38987 CP 127 ; If byte is 127 (i.e. horizontal block drawing)... 38989 JP Z,39036 ; ...then skip ahead to #R39036 (skip over block drawing data to start of next instruction) 38992 BIT 7,A ; If Bit 7 (Draw Layout Data Fragment Flag) is set... 38994 JP NZ,39014 ; ...then jump to #R39014 (start drawing layout data fragment) 38997 INC HL ; Advance HL by three bytes to x- and y-coordinates... 38998 INC HL ; ... 38999 INC HL ; ... 39000 LD E,(HL) ; Load x- and y-coordinates (characters) for graphic into DE... 39001 INC HL ; ... 39002 LD D,(HL) ; ... 39003 INC HL ; Advance HL to Mirror Options... 39004 LD C,(HL) ; ...and load into C 39005 INC HL ; Advance HL to next byte (start of next entry) in Room Layout Data 39006 PUSH HL ; Store HL (current position in Room Layout Data) 39007 EX DE,HL ; Swap DE (now current position in Room Layout Data) and HL (x- and y-coordinates of graphic to ; draw) 39008 CALL 40664 ; Read Graphic Definition from Room Layout Data and Draw 39011 POP HL ; Restore HL (current position in Room Layout Data) 39012 JR 38977 ; Loop back to #R38977 for next byte of room layout data ; Room Drawing Start Drawing Layout Data Fragment ; ; Used by the routine at #R38841. Input: A Draw layout data fragment instruction c39014 PUSH AF ; Store AF (A = current byte from room layout data) 39015 LD A,1 ; Set Drawing Layout Data Fragment Flag to 1... 39017 LD (23452),A ; ... 39020 INC HL ; Advance HL by one byte 39021 LD (23453),HL ; Store current position in room layout data at #R23453 39024 LD HL,60925 ; Load HL with address of Room Layout Data Fragment Pointers 39027 POP AF ; Restore AF (A = current byte from room layout data) 39028 AND 127 ; Reset Bit 7 39030 CALL 64627 ; Load address of layout data for required fragment into HL 39033 JP 38977 ; Loop back to #R38977 to start drawing fragment ; Room Drawing Skip Over Block Drawing Data to Start of Next Instruction ; ; Used by the routine at #R38841. c39036 INC HL ; Advance data pointer by two bytes... 39037 INC HL ; ... *39038 LD A,(HL) ; Load A with current data byte... 39039 INC HL ; ...and advance data pointer by one byte 39040 CP 255 ; If byte was 255 (End Marker)... 39042 JP Z,38977 ; ...then loop back to #R38977 for next byte of room layout data 39045 JR 39038 ; Loop back to #R39038 to check next byte ; Room Drawing (000) - Draw Floor, Paint Attributes / Terrain Interaction Data, Draw MK, Characters and Objects then ; Return ; ; Used by the routine at #R38841. c39047 LD A,(23452) ; If Drawing Layout Data Fragment Flag is zero (reset)... 39050 OR A ; ... 39051 JR Z,39063 ; ...then skip ahead to #R39063 39053 XOR A ; Set Drawing Layout Data Fragment Flag to zero (reset)... 39054 LD (23452),A ; ... 39057 LD HL,(23453) ; Load HL with previously stored position in room layout data 39060 JP 38977 ; Loop back to #R38977 for next byte of room layout data ; The operand of the instruction at #R39063 represents the address of start of room layout data for the current ; room. This is modified by the instruction at #R38974. *39063 LD IX,0 ; Load IX with start address of room layout data for current room ; This entry point is used by the routines at #R39183, #R39189, #R39216, #R39291, #R39393 and #R41059. *39067 LD A,(IX+0) ; Load first byte of room layout data instruction 39070 OR A ; If this byte is zero (i.e. last entry so no more painting to do)... 39071 JP Z,39393 ; ...then finalise room drawing, draw objects and characters, and animate the arrival of any ; new characters, then return 39074 CP 127 ; If this byte is 127 (i.e. horizontal block drawing)... 39076 JP Z,39216 ; ...then draw run of 2x2 blocks horizontally 39079 CP 126 ; If this byte is 126 (i.e. vertical block drawing)... 39081 JP Z,39291 ; ...then draw run of 2x2 blocks vertically 39084 BIT 7,A ; If Bit 7 (Draw Layout Data Fragment Flag) is set... 39086 JP NZ,39189 ; ...then jump to #R39189 (start painting attribute / terrain interaction data for layout data ; fragment) 39089 INC IX ; Advance to RLE Attribute Data index and load into L... 39091 LD L,(IX+0) ; ... 39094 INC IX ; Advance to RLE Terrain Interaction Data index and load into E... 39096 LD E,(IX+0) ; ... 39099 INC IX ; Advance to x-coordinate... 39101 LD A,(IX+0) ; ... 39104 LD (23408),A ; ...and store at #R23408 39107 INC IX ; Advance to y-coordinate... 39109 LD A,(IX+0) ; ... 39112 LD (23409),A ; ...and store at #R23409 39115 LD H,0 ; Load H with zero (RLE Attribute Data index already in L)... 39117 ADD HL,HL ; ...and multiply by four... 39118 ADD HL,HL ; ... 39119 LD BC,60487 ; Point BC at start of Lookup Table for RLE Attribute Data (Room Layout Graphics)... 39122 ADD HL,BC ; ...and add HL as offset, loading result into HL 39123 EX DE,HL ; Swap DE (now points to entry in RLE Attribute Lookup Table at #R60487) and HL (L now RLE ; Terrain Interaction Data index) 39124 LD H,0 ; Load H with zero (RLE Terrain Interaction Data index already in L)... 39126 ADD HL,HL ; ...and multiply by four... 39127 ADD HL,HL ; ... 39128 LD BC,60889 ; Point BC at start of Lookup Table for RLE Terrain Interaction Data (Room Layout Graphics)... 39131 ADD HL,BC ; ...and add HL as offset, loading result into HL 39132 EX DE,HL ; Swap DE (now points to entry in RLE Terrain Interaction Lookup Table at #R60889) and HL (now ; points to entry in RLE Attribute Lookup Table at #R60487) 39133 PUSH DE ; Store DE (pointer to required entry in RLE Terrain Interaction Lookup Table) 39134 INC IX ; Advance to Mirror Options... 39136 LD A,(IX+0) ; ...and load into A 39139 PUSH IX ; Store IX (current position in room layout data) 39141 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 #R39067 occurs to process this next entry. 39142 JP Z,40937 ; ...then paint room layout data entry's attributes and terrain interaction data then process ; next entry 39145 CP 1 ; If Apply Vertical Mirror selected... 39147 JP Z,40905 ; ...then paint room layout data entry's attributes and terrain interaction data applying ; vertical mirror, then process next entry 39150 CP 2 ; If Apply Horizontal Mirror selected... 39152 JP Z,40873 ; ...then paint room layout data entry's attributes and terrain interaction data applying ; horizontal mirror, then process next entry 39155 JP 40845 ; 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 #R40937, which in turn is only jumped to by the routine at ; #R39047. In this latter routine, the instruction at #R39133 pushes DE (pointer to required entry in RLE Terrain ; Interaction Lookup Table) onto the stack, and then the instruction at #R39139 pushes IX (current position in room ; layout data) onto the stack. c39158 POP IX ; Restore IX (current position in room layout data) 39160 POP HL ; Restore HL (pointer to required entry in RLE Terrain Interaction Lookup Table, PUSHed by ; instruction at #R39133) 39161 LD A,(IX+0) ; Load Mirror Options into A 39164 PUSH IX ; Store IX (current position in room layout data) 39166 OR A ; If both mirror options are off... 39167 JP Z,41173 ; ...then paint room layout data entry's Terrain Interaction Parameters, then advance to next ; entry 39170 CP 1 ; If Apply Vertical Mirror selected... 39172 JP Z,41141 ; ...then paint room layout data entry's Terrain Interaction Parameters, applying vertical ; mirror, then advance to next entry 39175 CP 2 ; If Apply Horizontal Mirror selected... 39177 JP Z,41109 ; ...then paint room layout data entry's Terrain Interaction Parameters, applying horizontal ; mirror, then advance to next entry 39180 JP 41081 ; 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 #R41173. c39183 POP IX ; Restore IX (current position in room layout data, PUSHed by instruction at #R39164) 39185 INC IX ; Advance IX by one byte to start of next room layout data entry 39187 JR 39067 ; Process next room layout instruction (jump to #R39067) ; Room Drawing Start Painting Attribute / Terrain Interaction Data for Layout Data Fragment ; ; Used by the routine at #R39047. Input: A Draw layout data fragment instruction c39189 PUSH AF ; Store AF (A = current byte from room layout data) 39190 LD A,1 ; Set Drawing Layout Data Fragment Flag to 1... 39192 LD (23452),A ; ... 39195 INC IX ; Advance IX by one byte 39197 LD (23453),IX ; Store current position in room layout data at #R23453 39201 LD HL,60925 ; Load HL with address of Room Layout Data Fragment Pointers 39204 POP AF ; Restore AF (A = current byte from room layout data) 39205 AND 127 ; Reset Bit 7 39207 CALL 64627 ; Load address of layout data for required fragment into HL 39210 PUSH HL ; Transfer address from HL to IX... 39211 POP IX ; ... 39213 JP 39067 ; Loop back to #R38977 to start painting fragment ; Draw Run of 2x2 Blocks Horizontally ; ; The parameters for block drawing start at the byte after the address in IX. These are: Input: IX Current ; position in room layout data c39216 INC IX ; Advance IX to x-coordinate... 39218 LD C,(IX+0) ; ...and load into C 39221 INC IX ; Advance IX to y-coordinate... 39223 LD B,(IX+0) ; ...and load into B 39226 INC IX ; Advance IX to first block layout data byte 39228 PUSH BC ; Store BC (B = y-coordinate, C = x-coordinate) 39229 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 39232 POP BC ; Restore BC (B = y-coordinate, C = x-coordinate) 39233 CALL 63233 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B... 39236 LD (23709),HL ; ...and store at #R23709 *39239 LD A,(IX+0) ; Load A with next block layout data... 39242 CP 255 ; ...and if this is 255 (End Marker)... 39244 JR Z,39261 ; ...then skip ahead to #R39261 39246 BIT 7,A ; If Draw Run Flag is set... 39248 JR NZ,39266 ; ...then skip ahead to #R39266 39250 PUSH IX ; Store IX (current position in block layout data) 39252 CALL 41271 ; Draw 2x2 block with style index A at Bitmap Virtual Text Cursor then move right two ; characters 39255 POP IX ; Restore IX (current position in block layout data) 39257 INC IX ; Advance IX to next block layout data... 39259 JR 39239 ; ...and loop back to #R39239 to process ; End Marker encountered *39261 INC IX ; Advance IX to next byte in room layout data... 39263 JP 39067 ; ...and jump to #R39067 to process ; Draw Run Flag set *39266 AND 127 ; Reset Draw Run Flag... 39268 LD B,A ; ...and load B with run length 39269 INC IX ; Advance IX to block style index... 39271 LD A,(IX+0) ; ...and load into A 39274 INC IX ; Advance IX to next block layout data 39276 PUSH IX ; Store IX (current position in block layout data) *39278 PUSH BC ; Store BC (B = remaining number of blocks to draw) 39279 PUSH AF ; Store AF 39280 CALL 41271 ; Draw 2x2 block with style index A at Bitmap Virtual Text Cursor then move right two ; characters 39283 POP AF ; Restore AF 39284 POP BC ; Restore BC (B = remaining number of blocks to draw) 39285 DJNZ 39278 ; Decrease remaining number of blocks and loop back to #R39278 if not zero 39287 POP IX ; Restore IX (current position in block layout data) 39289 JR 39239 ; Loop back to #R39239 for next block layout data ; Draw Run of 2x2 Blocks Vertically ; ; The parameters for block drawing start at the byte after the address in IX. These are: Input: IX Current ; position in room layout data c39291 INC IX ; Advance IX to x-coordinate... 39293 LD L,(IX+0) ; ...and load into L 39296 INC IX ; Advance IX to y-coordinate... 39298 LD H,(IX+0) ; ...and load into H 39301 INC IX ; Advance IX to first block layout data byte 39303 LD (23463),HL ; Store coordinates of top-left of block at #R23463 *39306 LD A,(IX+0) ; Load A with next block layout data... 39309 CP 255 ; ...and if this is 255 (End Marker)... 39311 JR Z,39332 ; ...then skip ahead to #R39332 39313 BIT 7,A ; If Draw Run Flag is set... 39315 JR NZ,39337 ; ...then skip ahead to #R39337 39317 CALL 39366 ; Draw 2x2 block with style index A at coordinates stored at #R23463 then move right two ; characters 39320 INC IX ; Advance IX to next block layout data 39322 LD HL,(23463) ; Load HL with coordinates of top-left of block just drawn... 39325 INC H ; ...add two to y-coordinate... 39326 INC H ; ... 39327 LD (23463),HL ; ...and store updated coordinates at #R23463 39330 JR 39306 ; Loop back to #R39306 to process next block layout data ; End Marker encountered *39332 INC IX ; Advance IX to next byte in room layout data... 39334 JP 39067 ; ...and jump to #R39067 to process ; Draw Run Flag set *39337 AND 127 ; Reset Draw Run Flag... 39339 LD B,A ; ...and load B with run length 39340 INC IX ; Advance IX to block style index... 39342 LD A,(IX+0) ; ...and load into A 39345 INC IX ; Advance IX to next block layout data *39347 PUSH BC ; Store BC (B = remaining number of blocks to draw) 39348 PUSH AF ; Store AF 39349 CALL 39366 ; Draw 2x2 block with style index A at coordinates stored at #R23463 then move right two ; characters 39352 LD HL,(23463) ; Load HL with coordinates of top-left of block just drawn... 39355 INC H ; ...add two to y-coordinate... 39356 INC H ; ... 39357 LD (23463),HL ; ...and store updated coordinates at #R23463 39360 POP AF ; Restore AF 39361 POP BC ; Restore BC (B = remaining number of blocks to draw) 39362 DJNZ 39347 ; Decrease remaining number of blocks and loop back to #R39347 if not zero 39364 JR 39306 ; Loop back to #R39306 for next block layout data ; Draw 2x2 Block with Style Index A at Coordinates Stored at 23463 then move Right Two Characters ; ; Used by the routine at #R39291. Input: A Block style index c39366 PUSH IX ; Store IX (current position in block layout data) 39368 PUSH AF ; Store AF 39369 LD BC,(23463) ; Load BC with coordinates of top-left of block 39373 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 39376 LD BC,(23463) ; Load BC with coordinates of top-left of block 39380 CALL 63233 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B... 39383 LD (23709),HL ; ...and store address at #R23709 39386 POP AF ; Restore AF 39387 CALL 41271 ; Draw 2x2 block with style index A at Bitmap Virtual Text Cursor then move right two ; characters 39390 POP IX ; Restore IX (current position in block layout data) 39392 RET ; Return ; Finalise Room Drawing, Draw Objects and Characters, and Animate the Arrival of Any New Characters ; ; Used by the routine at #R39047. Input: IX Current position in room layout data Output: A Index of Magic ; Knight's current room c39393 LD A,(23452) ; If Drawing Layout Data Fragment Flag is zero (reset)... 39396 OR A ; ... 39397 JR Z,39410 ; ...then skip ahead to #R39410 39399 XOR A ; Set Drawing Layout Data Fragment Flag to zero (reset)... 39400 LD (23452),A ; ... 39403 LD IX,(23453) ; Load IX with previously stored position in room layout data 39407 JP 39067 ; Process next room layout instruction (jump to #R39067 to paint Attribute and Terrain ; Interaction data) *39410 LD A,(IX+1) ; Load A with floor UDG code... 39413 LD (63306),A ; ...and store at #R63305 39416 LD A,(IX+2) ; Load floor attribute into A... 39419 LD (23695),A ; ...and set ATTR T system variable to this value 39422 LD HL,20704 ; Load HL with Display File address corresponding to (0, 23) (characters)... 39425 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 39428 CALL 63488 ; Update character printing routine to use base address of Floor Character Set graphics 39431 LD HL,32 ; Draw run of 32 characters (i.e. draw the room's floor)... 39434 CALL 63302 ; ... 39437 CALL 63472 ; Update Character Printing Routine to use base address of Text Character Set graphics 39440 PUSH IX ; Transfer current position in room layout data from IX... 39442 POP HL ; ...to HL 39443 INC HL ; Advance HL by two bytes, to attribute parameter... 39444 INC HL ; ... 39445 CALL 41459 ; Read glowing character block definitions and add to current room 39448 CALL 39578 ; Print Magic Knight's current room's name at top of screen 39451 CALL 46784 ; Draw axe(s) to screen if Magic Knight is in an Axe Room 39454 CALL 39655 ; Prepare to execute room-specific routine for Magic Knight's current room 39457 CALL 48164 ; Draw all objects in Magic Knight's current room 39460 CALL 39795 ; Draw all characters in Magic Knight's current room 39463 LD A,(23702) ; Flag Magic Knight's current room as visited for scoring purposes... 39466 LD E,A ; ... 39467 LD D,0 ; ... 39469 LD HL,23488 ; ... 39472 ADD HL,DE ; ... 39473 LD (HL),1 ; ... 39475 LD A,7 ; Set system variable BORDCR to 7... 39477 LD (23624),A ; ... 39480 XOR A ; Set border to black and reset speaker state... 39481 OUT (254),A ; ... 39483 LD A,71 ; Set ATTR T system variable to 71 (white INK, black PAPER, BRIGHT)... 39485 LD (23695),A ; ... 39488 LD A,(23480) ; If Animate Puff of Smoke Flag is reset... 39491 OR A ; ... 39492 JR Z,39525 ; ...then skip ahead to #R39525 39494 LD A,(24840) ; Load Magic Knight's current x-coordinate into A 39497 RRCA ; Divide x-coordinate by eight, rounding down to nearest integer... 39498 RRCA ; ... 39499 RRCA ; ... 39500 AND 31 ; ... 39502 LD C,A ; Copy x-coordinate (characters) into C 39503 LD A,(24841) ; Load Magic Knight's current y-coordinate into A 39506 RRCA ; Divide y-coordinate by eight, rounding down to nearest integer... 39507 RRCA ; ... 39508 RRCA ; ... 39509 AND 31 ; ... 39511 LD B,A ; Copy y-coordinate (characters) into B 39512 LD IX,23296 ; Store Magic Knight's current character coordinates at #23296... 39516 LD (IX+1),C ; ... 39519 LD (IX+2),B ; ... 39522 CALL 39958 ; Animate Puff of Smoke at Magic Knight's current coordinates *39525 CALL 61860 ; Store background attributes if appropriate, then draw Magic Knight to display without drawing ; axes 39528 XOR A ; Reset Animate Puff of Smoke Flag... 39529 LD (23480),A ; ... 39532 CALL 39829 ; Animate arrival of any new character if in Magic Knight's current room 39535 CALL 39553 ; If a character has arrived then redraw Magic Knight and all characters in room 39538 CALL 46183 ; Set Magic Knight's available action flags 39541 RES 1,(IY+65) ; Reset Characters Movement Unrestricted Flag / Disable In-Game Glow Flag 39545 RES 2,(IY+65) ; Reset Characters Can't Move Flag 39549 LD A,(23702) ; Load A with index of Magic Knight's current room 39552 RET ; Return ; If a Character Has Arrived then Redraw Magic Knight and All Characters in Room ; ; Used by the routine at #R39393. c39553 LD A,(23367) ; If Character Is Incoming Flag is reset... 39556 OR A ; ... 39557 RET Z ; ...then return 39558 CALL 39795 ; Draw all characters in Magic Knight's current room 39561 LD DE,24672 ; Restore background bitmap data (i.e. remove Magic Knight bitmap data from display)... 39564 HALT ; ...and wait for interrupt... 39565 CALL 61777 ; ... 39568 LD A,(23706) ; If Player Attribute Update Flag is set (Player Attribute Update mode)... 39571 OR A ; ... 39572 CALL NZ,62003 ; ...then restore background attribute data at Magic Knight's current location 39575 JP 61860 ; Store background attributes if appropriate, then draw Magic Knight to display without drawing ; axes and return ; Print Magic Knight's Current Room's Name at Top of Screen ; ; The Room Name Bar displayed on the 5th character row takes as its attribute the inverse of the attribute at (0, ; 0), i.e. INK and PAPER colours exchanged. c39578 LD A,(22528) ; Load B with attribute at (0, 0), i.e. top-left of display... 39581 LD B,A ; ... 39582 AND 192 ; Clear all but BRIGHT and FLASH flags... 39584 LD C,A ; ...and load into C 39585 LD A,B ; Load A with attribute at (0, 0)... 39586 AND 7 ; ...and clear all but INK bits 39588 ADD A,A ; Shift INK bit values into PAPER bits... 39589 ADD A,A ; ...i.e. set PAPER to colour previously in INK... 39590 ADD A,A ; ... 39591 ADD A,C ; Set BRIGHT and FLASH flags to values stored previously... 39592 LD C,A ; ...and load C with new attribute value 39593 LD A,B ; Load A with attribute at (0, 0) 39594 RRCA ; Shift PAPER bit values into INK bits... 39595 RRCA ; ... 39596 RRCA ; ... 39597 AND 7 ; ...and clear all but INK bits 39599 ADD A,C ; Add new INK value to existing attribute in A 39600 LD (23695),A ; Set ATTR T system variable to attribute in A, which is now the inverse of attribute at (0, 0) 39603 LD HL,56843 ; Point HL at start of table of room names 39606 LD A,(23702) ; Load B with Magic Knight's current room... 39609 LD B,A ; ... 39610 CALL 63335 ; Advance HL to name entry for Magic Knight's current room 39613 LD A,(HL) ; Load first value (string length) into A 39614 OR A ; If string length value is zero (i.e. no room name defined)... 39615 RET Z ; ...then return 39616 INC HL ; Advance HL to first byte of string 39617 PUSH HL ; Store HL (pointer to first byte of room name string) 39618 ADD A,2 ; Add 2 to the string's length to accommodate space characters before and after... 39620 LD B,A ; ...and load value into B 39621 LD A,32 ; Load A with width of screen (characters) minus length of room name string and spaces... 39623 SUB B ; ... 39624 RRCA ; Divide value by two... 39625 AND 31 ; ...and cap at 31 39627 LD C,A ; Load this value (length of one half of Room Name string) into BC... 39628 LD B,0 ; ... 39630 LD HL,16512 ; Point HL at top pixel row of character block at coordinates (0, 4) 39633 ADD HL,BC ; Add value in BC as offset... 39634 LD (63018),HL ; ...and load this address into Bitmap Virtual Text Cursor 39637 LD HL,39653 ; Point HL at text code for SPACE 39640 CALL 46873 ; Print text at location HL to screen using full screen width 39643 POP HL ; Restore HL (pointer to first byte of room name string) 39644 CALL 46873 ; Print text at location HL to screen using full screen width 39647 LD HL,39653 ; Point HL at text code for SPACE 39650 JP 46873 ; Print text at location HL to screen using full screen width and return ; Miscellaneous Text 1 b39653 DEFM " ",0 ; (SPACE character for padding room names) ; Prepare to Execute Room-Specific Routine for Magic Knight's Current Room ; ; Used by the routine at #R39393. c39655 LD A,(23702) ; Load A with Magic Knight's current room 39658 LD HL,62072 ; Point HL at start of Table of Room-Specific Routine Addresses 39661 CALL 64627 ; Advance HL to entry for Magic Knight's current room and load into HL 39664 LD (40199),HL ; Update jump in routine at #R40190 to execute room-specific routine 39667 RET ; Return ; Check Whether Magic Knight is Moving into a New Room and React if so ; ; Used by the routine at #R40008. c39668 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 39671 CP 3 ; If less than 3... 39673 JP C,39714 ; ...then skip to #R39714 (move Magic Knight one room to the left if possible then return) 39676 CP 231 ; If more than 231... 39678 JP NC,39758 ; ...then skip to #R39758 (move Magic Knight one room to the right if possible then return) 39681 RET ; Return ; Change Magic Knight's Current Room if Possible ; ; Used by the routines at #R39714 and #R39758. 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 c39682 PUSH AF ; Store new x-coordinate for later 39683 XOR A ; Set Magic Knight's Temporary Movement Flags to zero (new room, so Magic Knight can move both ; left and right)... 39684 LD (23451),A ; ... 39687 LD HL,48811 ; Point HL to Room Connectivity Data Table 39690 LD A,(23702) ; Load Magic Knight's current room's index into A... 39693 ADD A,A ; ...double it... 39694 LD C,A ; ...and load into BC... 39695 LD B,0 ; ... 39697 ADD HL,BC ; Add BC as offset to HL 39698 ADD HL,DE ; Point to left or right exit from current room, as determined by DE 39699 LD A,(HL) ; Load new room number into A... 39700 CP 255 ; ...and if this is 255 (i.e. Magic Knight can't leave his current room)... 39702 JR Z,39711 ; ...set Zero Flag and exit routine... 39704 LD (23702),A ; ...else update Magic Knight's current room to be this new room index 39707 POP BC ; Restore new x-coordinate to B... 39708 LD A,B ; ...and load back into A 39709 OR A ; Reset Zero Flag 39710 RET ; Return *39711 POP BC ; Restore AF to BC... 39712 LD A,B ; ...and load A with contents of B to restore to what it was on entering this routine 39713 RET ; Return ; Move Magic Knight One Room to the Left if Possible ; ; Used by the routine at #R39668. Input: A (Entry at #R39746 only) Magic Knight's new x-coordinate (pixels) c39714 LD A,(23702) ; If Magic Knight's current room is not 2 (Outdoors, 1, Bearwoolf's Cave)... 39717 CP 2 ; ... 39719 JR NZ,39736 ; ...then skip ahead to #R39736 39721 LD A,(23465) ; If current progress through cave is 4... 39724 CP 4 ; ... 39726 JR Z,39736 ; ...then skip ahead to #R39736 39728 INC A ; Increase current progress through cave by one... 39729 LD (23465),A ; ... 39732 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) 39734 JR 39746 ; Skip ahead to #R39746 (move Magic Knight back to other side of the room) *39736 LD DE,0 ; Set DE to zero (dealing with current room's left exit) 39739 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) 39741 CALL 39682 ; Change Magic Knight's current room (if possible) based upon left exit of his current room 39744 JR Z,39752 ; If Magic Knight can't leave his current room then jump to #R39752 ; This entry point is used by the routine at #R39758. *39746 LD (24840),A ; Set Magic Knight's x-coordinate 39749 JP 38844 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data and return *39752 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)... 39754 LD (23451),A ; ... 39757 RET ; Return ; Move Magic Knight One Room to the Right if Possible ; ; Used by the routine at #R39668. c39758 LD A,(23702) ; If Magic Knight's current room is not 2 (Outdoors, 1, Bearwoolf's Cave)... 39761 CP 2 ; ... 39763 JR NZ,39779 ; ...then skip ahead to #R39779 39765 LD A,(23465) ; If current progress through cave is zero... 39768 OR A ; ... 39769 JR Z,39779 ; ...then skip ahead to #R39779 39771 DEC A ; Decrease current progress through cave by one... 39772 LD (23465),A ; ... 39775 LD A,4 ; Load A with Magic Knight's new x-coordinate when he arrives in new room (4 is near left-hand ; side of room) 39777 JR 39746 ; Set Magic Knight's x-coordinate, draw the room and return *39779 LD DE,1 ; Set DE to 1 (dealing with current room's right exit) 39782 LD A,4 ; Load A with Magic Knight's new x-coordinate when he arrives in new room (4 is near left-hand ; side of room) 39784 CALL 39682 ; Change Magic Knight's current room (if possible) based upon right exit of his current room 39787 JR NZ,39746 ; If Magic Knight's can leave his current room then set his x-coordinate, draw the room and ; return 39789 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)... 39791 LD (23451),A ; ... 39794 RET ; Return ; Draw all Characters in Magic Knight's Current Room ; ; Used by the routines at #R39393 and #R39553. c39795 SET 2,(IY+65) ; Set Characters Can't Move Flag 39799 LD IX,24898 ; Point IX at start of Table of Characters' Current Positions at #R24898 39803 LD BC,2048 ; Load B with 8 and C (current character) with 0 *39806 LD A,(23702) ; Load A with Magic Knight's current room 39809 CP (IX+0) ; If Magic Knight and current character are in the same room... 39812 CALL Z,39883 ; ...then draw character with index C 39815 INC C ; Increase C to advance to next character 39816 INC IX ; Advance IX to entry for next character... 39818 INC IX ; ... 39820 INC IX ; ... 39822 DJNZ 39806 ; Loop back to #R39806 for next character 39824 RES 2,(IY+65) ; Reset Characters Can't Move Flag 39828 RET ; Return ; Animate Arrival of Any New Character if in Magic Knight's Current Room ; ; Used by the routine at #R39393. c39829 XOR A ; Reset Character Is Incoming Flag... 39830 LD (23367),A ; ... 39833 SET 2,(IY+65) ; Set Characters Can't Move Flag 39837 LD IX,24898 ; Point IX at start of Table of Characters' Current Positions at #R24898 39841 LD BC,2048 ; Load B with 8 and C (current character) with 0 *39844 LD A,(23702) ; Load A with Magic Knight's current room 39847 BIT 7,(IX+0) ; If Arrival Pending Flag in character's current room (pointed to by IX) is reset... 39851 JR Z,39869 ; ...then skip ahead to #R39869 39853 LD E,(IX+0) ; Load E with character's current room 39856 RES 7,E ; Reset Arrival Pending Flag in E... 39858 CP E ; ...and if this is then the same as Magic Knight's current room... 39859 CALL Z,39958 ; ...then animate Puff of Smoke at character's current coordinates... 39862 CALL Z,39883 ; ...and draw the character 39865 RES 7,(IX+0) ; Reset character's Arrival Pending Flag *39869 INC C ; Increase C (index of current character) 39870 INC IX ; Advance IX to room of next character... 39872 INC IX ; ... 39874 INC IX ; ... 39876 DJNZ 39844 ; Decrease B (remaining number of characters to check) and loop back to #R39844 if not zero 39878 RES 2,(IY+65) ; Reset Characters Can't Move Flag 39882 RET ; Return ; Draw a Character ; ; Used by the routines at #R39795 and #R39829. Input: C Index of character to draw IX Pointer to position data c39883 PUSH BC ; Store BC 39884 PUSH IX ; Store IX 39886 LD A,C ; Load A with character's index... 39887 LD (39905),A ; ...store in operand of instruction at #R39904... 39890 LD E,4 ; ...and point HL at this character's Attribute value (in Characters' Current Stats Table)... 39892 CALL 45406 ; ... 39895 LD A,(HL) ; Load character's Attribute into A... 39896 LD (39943),A ; ...and modify instruction at #R39942 with this value 39899 INC HL ; Advance HL to Character Graphic Index... 39900 LD A,(HL) ; ...and load value into A 39901 OR A ; If this is not zero... 39902 JR NZ,39909 ; ...then skip ahead to #R39909 (i.e. draw the character) ; The operand of the instruction at #R39904 represents the index of the character to draw. This is modified by the ; instruction at #R39887. 39904 LD A,0 ; If character index is not zero (see trivia)... 39906 OR A ; ...i.e. not Off-White... 39907 JR NZ,39929 ; ...then skip ahead to #R39929 (i.e. don't draw the character) *39909 LD C,(IX+1) ; Load C with character's x-coordinate (characters) 39912 LD B,(IX+2) ; Load B with character's y-coordinate (characters) 39915 PUSH IX ; Store IX (pointer to character's entry in Table of Characters' Current Positions) 39917 CALL 63504 ; Draw the graphic with lookup index A at character coordinates (C, B) with width = 2 ; characters and height = 4 characters 39920 POP IX ; Restore IX (pointer to character's entry in Table of Characters' Current Positions) 39922 LD A,(23706) ; If Player Attribute Update Flag is set (Player Attribute Update mode)... 39925 OR A ; ... 39926 CALL NZ,39933 ; ...then paint the character's attributes *39929 POP IX ; Restore IX 39931 POP BC ; Restore BC 39932 RET ; Return ; Paint a character's attributes ; ; Used by the routine at #R39883. Input: IX A character's entry in Table of Characters' Current Positions at ; #R24898. c39933 LD C,(IX+1) ; Load C with character's x-coordinate (characters) 39936 LD B,(IX+2) ; Load B with character's y-coordinate (characters) 39939 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) ; The operand of the instruction at #R39942 represents the character's attribute value. This is modified by the ; instruction at #R39896. 39942 LD A,0 ; Load A with Attribute value 39944 LD B,4 ; Load B with 4 (as characters are four characters high) *39946 PUSH BC ; Store BC (B = remaining number of character rows to paint) 39947 LD (HL),A ; Paint character's attribute at coordinates (C, B)... 39948 INC HL ; ... 39949 LD (HL),A ; ...and at coordinates (C + 1, B) 39950 LD BC,31 ; Advance down one character row, and left one character to coordinates (C, B + 1)... 39953 ADD HL,BC ; ... 39954 POP BC ; Restore BC (B = remaining number of character rows to paint) 39955 DJNZ 39946 ; Decrease remaining number of character rows to paint and loop back to #R39946 39957 RET ; Return ; Animate Puff of Smoke at Coordinates Pointed to by IX ; ; Used by the routines at #R39393 and #R39829. Input: IX Address of position data for a character, or Magic Knight c39958 PUSH AF ; Store AF 39959 PUSH BC ; Store BC 39960 CALL 41504 ; Copy 2x4 (Characters) Region of Display File into Temporary Storage at #R23299 39963 LD A,(23367) ; Set Character Is Incoming Flag... 39966 INC A ; ... 39967 LD (23367),A ; ... 39970 LD C,30 ; Load C with 30 (graphic index of first Puff of Smoke frame) 39972 LD B,5 ; Load B with 5 (number of smoke frames to draw) [bug] *39974 PUSH BC ; Store BC (B = remaining number of frames to draw, C = current frame's lookup index) 39975 PUSH IX ; Store IX (address of position data) 39977 PUSH AF ; Store AF 39978 LD A,C ; Load A with current graphic index 39979 LD C,(IX+1) ; Load C with x-coordinate (characters) 39982 LD B,(IX+2) ; Load B with y-coordinate (characters) 39985 CALL 63494 ; Draw 2x3 graphic with lookup index A at character coordinates (C, B) 39988 PUSH BC ; Store BC (B = remaining number of frames to draw, C = current frame's lookup index) 39989 LD B,12 ; Load B with 12 (number of interrupt cycles to wait per frame) *39991 HALT ; Wait for interrupt 39992 DJNZ 39991 ; Decrease remaining number of interrupt cycles to wait and loop back to #R39991 if not zero 39994 POP BC ; Restore BC (B = remaining number of frames to draw, C = current frame's lookup index) 39995 CALL 41545 ; Copy 2x4 (Characters) Region from Temporary Storage at #R23299 into Display File 39998 POP AF ; Restore AF 39999 POP IX ; Restore IX (address of position data) 40001 POP BC ; Restore BC (B = remaining number of frames to draw, C = current frame's lookup index) 40002 INC C ; Advance to next Puff of Smoke frame 40003 DJNZ 39974 ; Decrease remaining number of frames to draw and loop back to #R39974 if not zero 40005 POP BC ; Restore BC 40006 POP AF ; Restore AF 40007 RET ; Return ; Set Magic Knight's Velocity to Zero, if Appropriate Move to New Room, Update State of Storm Cloud and Execute ; Room-Specific Routine ; ; Used by the routines at #R38205 and #R38434. c40008 LD HL,0 ; Set Magic Knight's current x- and y-velocities to zero... 40011 LD (24844),HL ; ... 40014 CALL 39668 ; Check whether Magic Knight is moving into a new room and react if so 40017 LD A,(23702) ; If Magic Knight is currently in Bearwoolf's cave or hoard, or in Limbo... 40020 CP 3 ; ... 40022 JP C,40190 ; ...then decrease Magic Knight's current strength by average of 1/4 if he is carrying the Glow ; Shield and jump to room-specific routine 40025 CP 17 ; If Magic Knight is currently in the Castle or the Spaceship... 40027 JP NC,40190 ; ...then decrease Magic Knight's current strength by average of 1/4 if he is carrying the Glow ; Shield and jump to room-specific routine 40030 LD A,(23702) ; If Magic Knight's current room... 40033 LD B,A ; ... 40034 LD A,(23715) ; ...is the same as the Storm Cloud's current room... 40037 CP B ; ... 40038 CALL Z,64637 ; ...then if Do Not Draw Storm Cloud Flag is set then prepare to draw Storm Cloud 40041 LD A,(23715) ; Load B with the Storm Cloud's current room as stored at #R23715... 40044 LD B,A ; ... 40045 LD A,(23700) ; Load C with Storm Cloud's current x-coordinate... 40048 LD C,A ; ... 40049 LD A,(23702) ; Load H with Magic Knight's current room... 40052 LD H,A ; ... 40053 LD A,(24840) ; Load L with Magic Knight's current x-coordinate (pixels)... 40056 LD L,A ; ... 40057 XOR A ; Set A to zero and reset Carry Flag 40058 SBC HL,BC ; If Magic Knight and Storm Cloud have the same horizontal position in the same room... 40060 JR Z,40102 ; ...then skip ahead to #R40102 (have a lightning bolt strike Magic Knight) 40062 JP P,40068 ; If Magic Knight is to the right of the Storm Cloud then skip ahead to #R40068 40065 DEC BC ; Move the Storm Cloud one pixel to the left, changing room if appropriate 40066 JR 40069 ; Skip ahead to #R40069 *40068 INC BC ; Move the Storm Cloud one pixel to the right, changing room if appropriate *40069 LD A,B ; Load A with Storm Cloud's current room in B... 40070 LD (23715),A ; ...and store at #R23715 40073 LD A,C ; Load A with Storm Cloud's current x-coordinate in C... 40074 LD (23700),A ; ...and store at #R23700 40077 CP 32 ; If Storm Cloud's current x-coordinate is less than 32... 40079 JP C,40091 ; ...then skip ahead to #R40091 40082 CP 223 ; If Storm Cloud's current x-coordinate is at least 223... 40084 JP NC,40094 ; ...then skip ahead to #R40094 40087 SUB 30 ; Subtract 30 from A (Storm Cloud's current x-coordinate) 40089 JR 40096 ; Skip ahead to #R40096 *40091 XOR A ; Load A with zero 40092 JR 40096 ; Skip ahead to #R40096 *40094 LD A,195 ; Load A with 195 *40096 LD (23701),A ; Store new apparent x-coordinate at #R23701 40099 JP 40190 ; Decrease Magic Knight's current strength by average of 1/4 if he is carrying the Glow Shield ; and jump to room-specific routine *40102 LD A,255 ; Set MASK P and MASK T system variables to 255... 40104 LD (23696),A ; ...to preserve attributes already on screen... 40107 LD (23694),A ; ... 40110 LD A,(23701) ; Load C with apparent x-coordinate stored previously... 40113 ADD A,30 ; ...and add 30... 40115 LD C,A ; ...to give x-coordinate of origin of lightning bolt 40116 LD B,119 ; Load B with 119 (y-coordinate of origin of lightning bolt) 40118 LD A,(24840) ; Load E with Magic Knight's current x-coordinate (pixels) plus eight... 40121 ADD A,8 ; ...(x-coordinate of target of lightning bolt)... 40123 LD E,A ; ... 40124 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 40127 SUB 175 ; Subtract y-coordinate from 175 to change y-origin to top of screen... 40129 NEG ; ...and have y-coordinate increase downwards rather than upwards 40131 LD D,A ; Load D with result 40132 PUSH BC ; Store BC (coordinates of lightning bolt origin) 40133 PUSH DE ; Store DE (coordinates of lightning bolt target) 40134 CALL 48360 ; Draw the lightning bolt 40137 LD B,20 ; Wait for 20 interrupts... *40139 HALT ; ... 40140 DJNZ 40139 ; ... 40142 POP DE ; Restore DE (coordinates of lightning bolt target) 40143 POP BC ; Restore BC (coordinates of lightning bolt origin) 40144 CALL 48360 ; Erase the lightning bolt drawn previously 40147 CALL 40153 ; Decrease Magic Knight's current strength by ten 40150 JP 40190 ; Decrease Magic Knight's current strength by average of 1/4 if he is carrying the Glow Shield ; and jump to room-specific routine ; Decrease Magic Knight's Current Strength by Ten ; ; Used by the routine at #R40008. c40153 LD B,10 ; Load B with 10 (as we are decreasing Magic Knight's strength by 10) ; This entry point is used by the routine at #R40177. *40155 LD A,(24768) ; Load Magic Knight's current strength into A... 40158 OR A ; ...and if zero... 40159 JR Z,40173 ; ...then skip ahead to #R40173 40161 DEC A ; Decrease Magic Knight's current strength by one... 40162 LD (24768),A ; ... 40165 PUSH BC ; Store BC 40166 CALL 46463 ; Print Magic Knight's current strength at (6, 2) as text if he is carrying the Mirror 40169 POP BC ; Restore BC 40170 DJNZ 40155 ; Loop back to #R40155 for next strength point ; This entry point is used by the routine at #R40190. It also serves as the room-specific routine for various rooms. *40172 RET ; Return *40173 POP AF ; Remove return address of calling routine from top of Stack 40174 JP 38857 ; Display "YOU DIED OF EXHAUSTION" Game Over window and return to Control Selection Menu ; Decrease Magic Knight's Current Strength By One Every Fourth Call ; ; The operand of the instruction at #R40177 represents the number of calls since the last time Magic Knight's ; strength was decreased, which happens once every four calls. This is modified by the instruction at #R40182. c40177 LD A,0 ; Load A with number of cycles since last call... 40179 INC A ; ...and increase by one 40180 AND 3 ; Clear all but bits 0 and 1... 40182 LD (40178),A ; ...and store at #R40177 40185 RET NZ ; If value is not zero (i.e. four cycles have not elapsed since last decrease) then return 40186 LD B,1 ; Decrease Magic Knight's strength by one and return... 40188 JR 40155 ; ... ; Decrease Magic Knight's Current Strength By Average of 1/4 if He Is Carrying the Glow Shield ; ; Used by the routine at #R40008. c40190 LD A,12 ; If Magic Knight is carrying the Glow Shield (12)... 40192 CALL 45510 ; ... 40195 CALL Z,40177 ; ...then decrease Magic Knight's current strength by one every fourth call ; The operand of the instruction at #R40198 (jump destination) is the address of a room-specific routine. This is ; modified by the instruction at #R39664. 40198 JP 40172 ; Jump to room-specific routine ; Room-Specific Routine Decrease Magic Knight's Strength by One Once Every Four Frames c40201 LD A,(23672) ; Load A with LSB of System Variable FRAMES... 40204 AND 3 ; ...clear bits 2-7 to leave random number between 0 and 3... 40206 RET NZ ; ...and if number is not zero then return 40207 LD A,(24768) ; Load A with unused bit... 40210 AND 128 ; ... 40212 LD (40223),A ; ...and store as operand of instruction at #R40222 40215 LD A,(24768) ; Load Magic Knight's current strength into A... 40218 AND 127 ; ... 40220 DEC A ; ...and decrease by one 40221 PUSH AF ; Store AF (A = Magic Knight's new strength) ; The operand of the instruction at #R40222 represents the unused bit from Magic Knight's current strength. This is ; modified by the instruction at #R40212. 40222 ADD A,0 ; Combine unused bit with new strength value in A... 40224 LD (24768),A ; ...and store as Magic Knight's current strength 40227 CALL 46463 ; Print Magic Knight's current strength at (6, 2) as text if he is carrying the Mirror 40230 POP AF ; Restore AF (A = Magic Knight's new strength)... 40231 JP Z,38857 ; ...and if zero then display "YOU DIED OF EXHAUSTION" Game Over window and return to Control ; Selection Menu 40234 RET ; Return ; Room-Specific Routine Update Position of 1 Axe and Display c40235 XOR A ; Set A to zero (axe 0) 40236 JP 46560 ; Update position of Axe 0, display, and decrease Magic Knight's strength if in contact, then ; return ; Room-Specific Routine Update Positions of 4 Axes and Display c40239 XOR A ; Set A to zero (axe 0) 40240 CALL 46560 ; Update position of Axe 0, display, and decrease Magic Knight's strength if in contact 40243 LD A,1 ; Set A to 1 (axe 1) 40245 CALL 46560 ; Update position of Axe 1, display, and decrease Magic Knight's strength if in contact 40248 LD A,2 ; Set A to 2 (axe 2) 40250 CALL 46560 ; Update position of Axe 2, display, and decrease Magic Knight's strength if in contact 40253 LD A,3 ; Set A to 3 (axe 3) 40255 JP 46560 ; Update position of Axe 3, display, and decrease Magic Knight's strength if in contact, then ; return ; Room-Specific Routine Kill Magic Knight if he is in a Dark Room Without Illumination c40258 LD A,19 ; If Magic Knight is carrying the Torch (19)... 40260 CALL 45510 ; ... 40263 RET Z ; ...then return 40264 LD A,12 ; If Magic Knight is carrying the Glow Shield (12)... 40266 CALL 45510 ; ... 40269 RET Z ; ...then return 40270 LD A,19 ; If the Torch is in Magic Knight's current room... 40272 CALL 40326 ; ... 40275 LD A,(23702) ; ... 40278 CP B ; ... 40279 RET Z ; ...then return 40280 LD A,12 ; If the Glow Shield is in Magic Knight's current room... 40282 CALL 40326 ; ... 40285 LD A,(23702) ; ... 40288 CP B ; ... 40289 RET Z ; ...then return 40290 RES 0,(IY+65) ; Reset Game In Progress Flag (IY = 23610) 40294 LD HL,22720 ; Load HL with Attribute File address for cell at (0, 6) 40297 LD DE,22721 ; Load DE with Attribute File address for cell at (1, 6) 40300 LD BC,575 ; Load BC with 575 (prepare to write to remainder of Attribute File) 40303 LD (HL),L ; Set Attribute File byte at HL to (L = 192) (black INK, black PAPER, BRIGHT, FLASH) 40304 LDIR ; Flood remainder of Attribute File with attribute value 192 40306 LD A,26 ; Draw Window 26... 40308 CALL 47193 ; ... 40311 LD HL,57269 ; Point HL at "SOMEBODY SWITCHED OUT THE LIGHT..." text... 40314 CALL 46902 ; ...and print 40317 CALL 64230 ; Wait for Interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 40320 LD HL,50817 ; Point HL at "YOU HURT YOURSELF MOVING AROUND IN THE DARK" text 40323 JP 64582 ; Display Cyan "Game Over" Window and Return to Control Selection Menu ; Load B with Room Index of Object A ; ; Used by the routine at #R40258. Input: A Index of an object Output: B Current room of object HL Address of ; current position data for object c40326 LD C,A ; Load BC with three times object index... 40327 ADD A,A ; ... 40328 ADD A,C ; ... 40329 LD C,A ; ... 40330 LD B,0 ; ... 40332 LD HL,24922 ; Load HL with start address of Table of Objects' Current Positions... 40335 ADD HL,BC ; ...and add BC as offset 40336 LD B,(HL) ; Load B with room index of object 40337 RET ; Return ; Room-Specific Routine Check for Egg Dropped down Wishing Well and Set Wish Pending Flag and Display Message If ; Appropriate c40338 LD A,(23365) ; If Wish Pending Flag is set... 40341 OR A ; ... 40342 RET NZ ; ...then return 40343 CALL 40357 ; Check whether an egg has been dropped down the Wishing Well and set Wish Pending Flag if so 40346 LD A,(23365) ; If Wish Pending Flag is reset... 40349 OR A ; ... 40350 RET Z ; ...then return 40351 LD HL,57442 ; Point HL at "SOMEBODY YELLS...YOU CAN HAVE A WISH IF YOU WANT..." text 40354 JP 64313 ; Display "...YOU CAN HAVE A WISH IF YOU WANT..." window (29), wait for Fire to be pressed then ; jump to Main Game Loop ; Check Whether an Egg Has Been Dropped Down the Wishing Well and Set Wish Pending Flag if So ; ; Used by the routine at #R40338. c40357 LD A,36 ; Load A with 36 (object index of Golden Egg) 40359 LD B,6 ; Load B with 6 (as there are six eggs) *40361 PUSH BC ; Store BC (B = remaining number of eggs to process) 40362 PUSH AF ; Store AF (A = object index of current egg) 40363 LD C,A ; Load BC with three times object index of current egg... 40364 ADD A,A ; ... 40365 ADD A,C ; ... 40366 LD C,A ; ... 40367 LD B,0 ; ... 40369 LD HL,24922 ; Point HL at start of Objects' Current Positions Table... 40372 ADD HL,BC ; ...and add BC as offset 40373 LD A,(HL) ; Load A with room of current egg... 40374 CP 14 ; ...and if this is not 14 (Outdoors, 13, Wishing Well)... 40376 JR NZ,40395 ; ...then skip ahead to #R40395 40378 INC HL ; Advance HL to y-coordinate of object... 40379 INC HL ; ... 40380 LD A,(HL) ; ...and load into A 40381 CP 19 ; If this is not 19... 40383 JR NZ,40395 ; ...then skip ahead to #R40395 ; The instructions between #R40385 and #R40392 are only executed when the current egg is both in room 14 (Outdoors, ; 13, Wishing Well) and has a y-coordinate of 19, i.e. the egg has been dropped on top of (down) the well. The index ; of the dropped object (egg) is stored at #R23365. 40385 POP AF ; Restore AF (A = object index of current egg) 40386 LD (23365),A ; Store object index of current egg at #R23365, i.e. set Wish Pending Flag 40389 PUSH AF ; Store AF (A = object index of current egg) 40390 DEC HL ; Move HL back to room of object... 40391 DEC HL ; ... 40392 LD (40401),HL ; ...and store address in operand of instruction at #R40400 *40395 POP AF ; Restore AF (A = object index of current egg) 40396 POP BC ; Restore BC (B = remaining number of eggs to process) 40397 INC A ; Advance A to next egg 40398 DJNZ 40361 ; Decrease remaining number of eggs to process and loop back to #R40361 if not zero ; The operand of the instruction at #R40400 represents the start address of the current position data for the object ; of interest. This is modified by the instruction at #R40392. 40400 LD HL,0 ; Load HL with address of current position data for dropped egg... 40403 LD (HL),99 ; ...and set its current room to 99 40405 RET ; Return ; Room-Specific Routine Move Magic Knight Down a Room if Appropriate ; ; Move Magic Knight "down" a room if he is at 128 < x < 153 and y = 152. c40406 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is not 152... 40409 CP 152 ; ...i.e. he is not at floor-level... 40411 RET NZ ; ...then return 40412 LD A,(24840) ; If Magic Knight's current x-coordinate (pixels) is 153 or greater... 40415 CP 153 ; ... 40417 RET NC ; ...then return 40418 CP 128 ; If Magic Knight's current x-coordinate (pixels) is less than 128... 40420 RET C ; ...then return 40421 LD A,48 ; Set Magic Knight's current y-coordinate (pixels) to 48... 40423 LD (24841),A ; ... 40426 LD A,(23702) ; Load A with index of Magic Knight's current room... 40429 SUB 7 ; ...minus 7 40431 LD (23702),A ; Set this as Magic Knight's current room (see trivia) 40434 JP 38841 ; Move Magic Knight into room A, draw room, objects and characters and initialise room-specific ; data ; Room-Specific Routine Move Magic Knight Between Teleport Rooms if Appropriate c40437 XOR A ; Set BORDER to black and reset speaker state (see trivia)... 40438 OUT (254),A ; ... 40440 LD A,(23484) ; Load B with Current Password Number... 40443 LD B,A ; ... 40444 LD A,(23402) ; If value encoded in Main Lever Flags... 40447 CP B ; ...is not the same as Current Password Number... 40448 RET NZ ; ...then return 40449 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is not 144... 40452 CP 144 ; ... 40454 RET NZ ; ...then return 40455 LD A,(24840) ; If Magic Knight's current x-coordinate (pixels) is not 112... 40458 CP 112 ; ... 40460 RET NZ ; ...then return 40461 LD A,144 ; Set Magic Knight's current x-coordinate (pixels) to 144... 40463 LD (24840),A ; ... 40466 LD B,40 ; Load B with 40 (index of Castle Third Floor, 2, Teleport Room, 1) 40468 LD A,(23702) ; If Magic Knight's current room... 40471 CP 47 ; ...is 47 (Spaceship, 2, Teleport Room, 2)... 40473 JR Z,40477 ; ...then skip ahead to #R40477 40475 LD B,47 ; Load B with 47 (index of Spaceship, 2, Teleport Room, 2) *40477 LD A,1 ; Set Animate Puff of Smoke Flag... 40479 LD (23480),A ; ... 40482 LD A,B ; Load A with destination room index in B 40483 LD (23702),A ; Set this as Magic Knight's current room (see trivia) 40486 JP 38841 ; Move Magic Knight into room A, draw room, objects and characters and initialise room-specific ; data ; Room-Specific Routine Display Cave Progress and Set Magic Knight's x-Velocity to 2 if at Floor Level c40489 LD A,(23465) ; Load A with current progress through cave 40492 LD HL,51067 ; Point HL at "---" text 40495 CALL 46837 ; Splice numeric cave progress data as a string into "---" text 40498 LD HL,16558 ; Load HL with Display File address corresponding to (14, 5) (characters)... 40501 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 40504 LD HL,51067 ; Point HL at "---" text... 40507 CALL 46902 ; ...and print 40510 LD A,2 ; Prepare to set Magic Knight's x-velocity to 2... 40512 LD (40539),A ; ... 40515 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is not 152... 40518 CP 152 ; ... 40520 RET NZ ; ...then return 40521 JR 40538 ; Set Magic Knight's x-velocity to 2, redraw and return ; Room-Specific Routine Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 c40523 LD A,2 ; Load A with 2 40525 JR 40529 ; Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 ; Room-Specific Routine Set Magic Knight's x-Velocity to -2 if his y-Coordinate is 136 c40527 LD A,254 ; Load A with -2 ; This entry point is used by the routine at #R40523. *40529 LD (40539),A ; Prepare to set Magic Knight's x-velocity to A 40532 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is not 136... 40535 CP 136 ; ... 40537 RET NZ ; ...then return ; This entry point is used by the routine at #R40489. The operand of the instruction at #R40538 represents the ; x-velocity given to Magic Knight due to a conveyor-belt-like force. This is modified by the instructions at ; #R40512 and #R40529. *40538 LD A,0 ; Load A with new x-velocity... 40540 LD (24844),A ; ...and set this as Magic Knight's x-velocity 40543 JP 61816 ; Set Redraw Magic Knight On Next Interrupt Flag, wait for interrupt and return ; Room-Specific Routine Move Magic Knight Up or Down a Room if Appropriate and Boost Jumps if Wearing Power Boots ; ; The CALL at #R40546 will move Magic Knight "down" a room if he is at 128 < x < 153 and y = 152. c40546 CALL 40406 ; Move Magic Knight down a room if appropriate ; This entry point serves as the room-specific routine for moving Magic Knight up a room if appropriate, and ; boosting jumps if wearing Power Boots. 40549 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is 152... 40552 CP 152 ; ... 40554 RET Z ; ...then return 40555 LD A,(24840) ; If Magic Knight's current x-coordinate (pixels) is less than 204... 40558 CP 204 ; ... 40560 RET C ; ...then return 40561 LD A,11 ; If Magic Knight is not wearing the Power Boots (11)... 40563 CALL 45505 ; ... 40566 RET NZ ; ...then return 40567 LD A,(24841) ; If Magic Knight's current y-coordinate (pixels) is less than 62... 40570 CP 62 ; ... 40572 JR C,40582 ; ...then skip ahead to #R40582 40574 LD A,252 ; Set Magic Knight's y-velocity to -4... 40576 LD (24845),A ; ... 40579 JP 61816 ; Set Redraw Magic Knight On Next Interrupt Flag, wait for interrupt and return *40582 LD A,136 ; Set Magic Knight's current y-coordinate (pixels) to 136... 40584 LD (24841),A ; ... 40587 LD A,(23702) ; Load A with index of Magic Knight's current room... 40590 ADD A,7 ; ...plus 7 40592 LD (23702),A ; Set this as Magic Knight's current room (see trivia) 40595 JP 38841 ; Move Magic Knight into room A, draw room, objects and characters and initialise room-specific ; data ; Room-Specific Routine Kill Magic Knight if he is Too Close to Bearwoolf c40598 LD A,(24840) ; If Magic Knight's current x-coordinate (pixels) is 128 or greater... 40601 CP 128 ; ... 40603 RET NC ; ...then return ; The operand of the instruction at #R40604 represents the Bearwoolf Removed Flag. This is modified by the ; instructions at #R38106 and #R45290. 40604 LD A,0 ; Load A with Bearwoolf Removed Flag... 40606 OR A ; ...and if this is set... 40607 RET NZ ; ...then return 40608 LD HL,57374 ; Point HL at "YOU STOOD FAR TOO CLOSE TO BEARWOOLF..." text 40611 JP 64582 ; Display Cyan "Game Over" Window and Return to Control Selection Menu ; Room-Specific Routine Enable / Disable Entry to Castle Depending Upon Disquise Worn and Whether Newspaper is Held c40614 NOP ; Do nothing... 40615 NOP ; ... 40616 NOP ; ... 40617 NOP ; ... 40618 NOP ; ... 40619 LD A,255 ; Set right exit from Outdoors, 15 (The Castle Entrance) to 255... 40621 LD (48844),A ; ...i.e. disable right exit 40624 LD A,1 ; If Magic Knight is not wearing the Disquise... 40626 CALL 45505 ; ... 40629 RET NZ ; ...then return 40630 LD A,(23438) ; Load B with zero-based index of current disquise... 40633 DEC A ; ... 40634 LD B,A ; ... 40635 LD A,(23703) ; Load A with Index of Required Disquise... 40638 CP B ; ...and if this is not the same as the disquise currently being worn... 40639 RET NZ ; ...then return 40640 LD A,33 ; If Magic Knight is not carrying the Newspaper (33)... 40642 CALL 45510 ; ... 40645 RET NZ ; ...then return 40646 LD A,(23702) ; Load A with index Magic Knight's current room... 40649 INC A ; ...plus one... 40650 LD (48844),A ; ...and set right exit from Outdoors, 15 (The Castle Entrance) to A 40653 XOR A ; Set Magic Knight's Temporary Movement Flags to zero (so Magic Knight can move both left and ; right)... 40654 LD (23451),A ; ... 40657 RET ; Return ; Divide A by Eight, Rounding Down to Nearest Integer ; ; Used by the routines at #R38434, #R38585, #R38724, #R45584 and #R47731. c40658 RRCA ; Divide by eight... 40659 RRCA ; ... 40660 RRCA ; ... 40661 AND 31 ; ...and remove remainder 40663 RET ; Return ; Room Drawing Read Graphic Definition from Room Layout Data and Draw ; ; Used by the routine at #R38841. 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) c40664 PUSH BC ; Store BC (C = horizontal / vertical mirror options) 40665 PUSH HL ; Store HL (H = y-coordinate, L = x-coordinate) 40666 LD L,A ; Load four times index of graphic to draw into HL... 40667 LD H,0 ; ... 40669 ADD HL,HL ; ... 40670 ADD HL,HL ; ... 40671 LD BC,29272 ; ...and add (in HL) to address of start of Graphics Data Lookup Table at #R29272 as an ; offset... 40674 ADD HL,BC ; ... 40675 LD C,(HL) ; Load width & height at this location into BC... 40676 INC HL ; ... 40677 LD B,(HL) ; ... 40678 INC HL ; ... 40679 LD A,(HL) ; Load address of graphic data into HL... 40680 INC HL ; ... 40681 LD H,(HL) ; ... 40682 LD L,A ; ... 40683 LD (23447),HL ; ...and store at #R23447 40686 POP HL ; Restore HL (H = y-coordinate, L = x-coordinate)... 40687 LD (23408),HL ; ...and store at #R23408 40690 ADD HL,BC ; Add width and height to get coordinates (x+1, y+1) of bottom right of graphic to draw... 40691 LD (23410),HL ; ...and store at #R23410 40694 POP BC ; Restore BC (C = horizontal / vertical mirror options) 40695 LD A,C ; If both mirror options are switched off... 40696 AND 3 ; ... 40698 JP Z,40717 ; ...then skip ahead to #R40717 40701 CP 1 ; If only the "apply vertical mirror" option is switched on... 40703 JP Z,40720 ; ...then skip ahead to #R40720 40706 CP 2 ; If only the "apply horizontal mirror" option is switched on... 40708 JP Z,40723 ; ...then skip ahead to #R40723 40711 CP 3 ; If both mirror options are switched on... 40713 JP Z,40726 ; ...then skip ahead to #R40726 40716 RET ; Return *40717 JP 61214 ; Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode off, draw the graphic ; and return *40720 JP 61236 ; Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode off, draw the graphic and ; return *40723 JP 61267 ; Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode on, draw the graphic and ; return *40726 JP 61297 ; Set "Apply Vertical Mirror" Mode on, "Apply Horizontal Mirror" Mode on, draw the graphic and ; return ; Unused routine ; ; This is a room drawing routine. It reads start co-ordinates, repeat count and UDG code and prints a run of ; characters. c40729 CALL 40832 ; Move Virtual Bitmap Cursor to Co-Ordinates Specified in Layout Data 40732 LD B,(HL) ; Load repeat count into B... 40733 INC HL ; ...and advance HL to next parameter 40734 LD A,(HL) ; Load UDG code to print into A... 40735 INC HL ; ...and advance HL to next parameter 40736 PUSH HL ; Store HL (current position in room layout data) *40737 PUSH BC ; Store BC (B = remaining number of UDGs to print) 40738 PUSH AF ; Store AF (A = UDG code to print) 40739 PUSH HL ; Store HL (current position in room layout data) 40740 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 40743 POP HL ; Restore HL (current position in room layout data) 40744 POP AF ; Restore AF (A = UDG code to print) 40745 POP BC ; Restore BC (B = remaining number of UDGs to print) 40746 DJNZ 40737 ; Decrease remaining number of UDGs to print and loop back to #R40737 40748 POP HL ; Restore HL (current position in room layout data) 40749 JP 38977 ; Jump back to #R38977 for next byte of room layout data ; Unused routine ; ; This is a room drawing routine. It reads start co-ordinates and UDG code and prints the UDG. c40752 CALL 40832 ; Move Virtual Bitmap Cursor to Co-Ordinates Specified in Layout Data 40755 LD A,(HL) ; Load UDG code to print into A... 40756 INC HL ; ...and advance HL to next parameter 40757 PUSH HL ; Store HL (current position in room layout data) 40758 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 40761 POP HL ; Restore HL (current position in room layout data) 40762 JP 38977 ; Jump back to #R38977 for next byte of room layout data ; Unused routine ; ; This is a room drawing routine. It draws a line. c40765 INC HL ; Advance data pointer by three bytes... 40766 INC HL ; ... 40767 INC HL ; ... 40768 LD C,(HL) ; Load x-coordinate of start of line into C 40769 INC HL ; Advance HL to y-coordinate of start of line... 40770 LD B,(HL) ; ...and load into B 40771 INC HL ; Advance HL to x-coordinate of end of line... 40772 LD E,(HL) ; ...and load into E 40773 INC HL ; Advance HL to y-coordinate of end of line... 40774 LD D,(HL) ; ...and load into D 40775 INC HL ; Advance HL to start of next room layout data entry 40776 PUSH HL ; Store HL (current position in room layout data) 40777 CALL 48360 ; Draw a line from (C, B) to (E, D) 40780 POP HL ; Restore HL (current position in room layout data) 40781 JP 38977 ; Jump back to #R38977 for next byte of room layout data ; Unused routine ; ; This is a room drawing routine. It draws a horizontal line. c40784 INC HL ; Advance data pointer by three bytes... 40785 INC HL ; ... 40786 INC HL ; ... 40787 PUSH HL ; Transfer current position in room layout data from HL to IX... 40788 POP IX ; ... 40790 LD L,(IX+0) ; Load HL with y-coordinate (pixels)... 40793 LD H,0 ; ... 40795 ADD HL,HL ; ...and double 40796 LD BC,65140 ; Point BC at Table of Display File Addresses of Start of Each Pixel Row... 40799 ADD HL,BC ; ...and add doubled y-coordinate as offset in HL 40800 CALL 64632 ; Load address corresponding to start of pixel row at this coordinate into HL 40803 INC IX ; Advance layout data pointer to next byte 40805 LD C,(IX+0) ; Load BC with x-coordinate of start of line (characters)... 40808 LD B,0 ; ... 40810 ADD HL,BC ; ...and add to HL as offset 40811 INC IX ; Advance layout data pointer to next byte 40813 LD A,(IX+0) ; Load A with x-coordinate of end of line (characters) 40816 SUB C ; Subtract start coord. from end coord. and add one to get width... 40817 INC A ; ... 40818 LD B,A ; ...and load into B 40819 LD A,255 ; Load A with 255 (i.e. all bits set) *40821 LD (HL),A ; Write a row of eight set pixels to the Display File... 40822 INC HL ; ...and advance to next character to the right 40823 DJNZ 40821 ; Decrease B (remaining number of character blocks to draw to) and loop back to #R40821 40825 PUSH IX ; Transfer current position in room layout data from IX to HL... 40827 POP HL ; ... 40828 INC HL ; Advance room layout data pointer to next instruction in layout data 40829 JP 38977 ; Jump back to #R38977 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 #R40729 and #R40752. Input: HL Pointer to an instruction in room layout data Output: HL ; Pointer to next instruction in room layout data c40832 INC HL ; Advance HL by three bytes... 40833 INC HL ; ... 40834 INC HL ; ... 40835 LD C,(HL) ; Load x- and y-coordinates into BC... 40836 INC HL ; ... 40837 LD B,(HL) ; ... 40838 INC HL ; ...advancing to next position in room layout data 40839 PUSH HL ; Store HL (current position in room layout data) 40840 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 40843 POP HL ; Restore HL (current position in room layout data) 40844 RET ; Return ; Paint Room Layout Data Entry's Attributes, Applying Horizontal and Vertical Mirrors (Room Drawing) ; ; Used by the routine at #R39047. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) at #R60487 Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's right c40845 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 40846 LD HL,23408 ; Modify instruction at #R40983 to load x-coordinate of graphic's left edge into A... 40849 LD (40984),HL ; ...i.e. set end x-coordinate for painting right-to-left 40852 LD HL,41025 ; Modify instruction at #R40987 to jump to #R41025... 40855 LD (40988),HL ; ...i.e. advance HL up one character row in Attribute File 40858 LD A,43 ; Modify instruction at #R40990 with opcode 43 (DEC HL)... 40860 LD (40990),A ; ... 40863 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 40864 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 40867 LD BC,(23410) ; Load BC with coordinates of graphic's bottom-right 40871 JR 40963 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes, Applying Horizontal Mirror (Room Drawing) ; ; Used by the routine at #R39047. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) at #R60487 Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's left c40873 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 40874 LD HL,23410 ; Modify instruction at #R40983 to load x-coordinate of graphic's right edge into A... 40877 LD (40984),HL ; ...i.e. set end x-coordinate for painting left-to-right 40880 LD HL,41025 ; Modify instruction at #R40987 to jump to #R41025... 40883 LD (40988),HL ; ...i.e. advance HL up one character row in Attribute File 40886 LD A,35 ; Modify instruction at #R40990 with opcode 35 (INC HL)... 40888 LD (40990),A ; ... 40891 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 40892 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 40895 LD A,(23408) ; Load C with x-coordinate of graphic's left edge... 40898 LD C,A ; ... 40899 LD A,(23411) ; Load B with y-coordinate of graphic's bottom edge... 40902 LD B,A ; ... 40903 JR 40963 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes, Applying Vertical Mirror (Room Drawing) ; ; Used by the routine at #R39047. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) at #R60487 Output: B y-coordinate of graphic's top C x-coordinate of graphic's right c40905 PUSH HL ; Store HL (current entry in Lookup Table for RLE Attribute Data) 40906 LD HL,23408 ; Modify instruction at #R40983 to load x-coordinate of graphic's left edge into A... 40909 LD (40984),HL ; ...i.e. set end x-coordinate for painting right-to-left 40912 LD HL,41004 ; Modify instruction at #R40987 to jump to #R41004... 40915 LD (40988),HL ; ...i.e. advance HL down one character row in Attribute File 40918 LD A,43 ; Modify instruction at #R40990 with opcode 43 (DEC HL)... 40920 LD (40990),A ; ... 40923 POP HL ; Restore HL (current entry in Lookup Table for RLE Attribute Data) 40924 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 40927 LD A,(23410) ; Load C with x-coordinate of graphic's right edge... 40930 LD C,A ; ... 40931 LD A,(23409) ; Load B with y-coordinate of graphic's top edge... 40934 LD B,A ; ... 40935 JR 40963 ; Jump to attribute painting routine ; Paint Room Layout Data Entry's Attributes (Room Drawing) ; ; Used by the routine at #R39047. Input: HL Points to entry in Lookup Table for RLE Attribute Data (Room Layout ; Graphics) at #R60487 DE Points to entry in Lookup Table for RLE Terrain Interaction Data (Room Layout Graphics) ; at #R60889 c40937 PUSH HL ; Store HL (Pointer to entry in Lookup Table for RLE Attribute Data) 40938 LD HL,23410 ; Modify instruction at #R40983 to load x-coordinate of graphic's right edge into A... 40941 LD (40984),HL ; ...i.e. set end x-coordinate for painting left-to-right 40944 LD HL,41004 ; Modify instruction at #R40987 to jump to #R41004... 40947 LD (40988),HL ; ...i.e. advance HL down one character row in Attribute File 40950 LD A,35 ; Modify instruction at #R40990 with opcode 35 (INC HL)... 40952 LD (40990),A ; ... 40955 POP HL ; Restore HL (Pointer to entry in Lookup Table for RLE Attribute Data) 40956 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Attribute Data 40959 LD BC,(23408) ; 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 #R40845, #R40873 and #R40905. At this point, BC holds the initial ; coordinates in characters, from which to start painting attributes. IX points to the required RLE attribute data. *40963 PUSH BC ; Store BC (B = current y-coordinate, C = initial x-coordinate) 40964 CALL 63219 ; Point HL at Attribute File address for character coordinates (C, B) *40967 LD A,(IX+0) ; Load A with repeat count value 40970 OR A ; If repeat count is zero... 40971 JP Z,41000 ; ...then jump to #R41000 40974 LD B,A ; Load B with repeat count 40975 LD C,(IX+1) ; Load C with attribute to paint *40978 LD (HL),C ; Apply attribute in C to current Attribute File location in HL 40979 LD A,L ; Load E with x-coordinate (characters) of current Attribute File location... 40980 AND 31 ; ... 40982 LD E,A ; ... ; The operand of the instruction at #R40983 is modified by instructions at #R40849, #R40877, #R40909, #R40941, to ; #R23408 (x-coordinate of left edge), #R23410 (x-coordinate of right edge), #R23408 (x-coordinate of left edge), or ; #R23410 (x-coordinate of right edge) respectively. 40983 LD A,(23410) ; Load A with end x-coordinate for painting... 40986 CP E ; ...and if this is the same as the x-coordinate... ; The operand of the instruction at #R40987 (i.e. the destination of the jump) is modified by the instructions at ; #R40855, #R40883, #R40915 and #R40947 to be #R41025 (move up one character row), #R41025 (move up one character ; row), #R41004 (move down one character row) or #R41004 (move down one character row) respectively. 40987 JP Z,41004 ; ...then jump to routine to move up or down one character row ; The instruction at #R40990 is modified by the instructions at #R40860, #R40888, #R40920 and #R40952 to 43 (DEC ; HL), 35 (INC HL), 43 (DEC HL) or 35 (INC HL) respectively. 40990 INC HL ; Advance HL to next (or previous) byte in Attribute File *40991 DJNZ 40978 ; Decrease B (repeat count) and loop back to #R40978 if not zero 40993 INC IX ; Advance IX by two bytes in RLE attribute data... 40995 INC IX ; ... 40997 JP 40967 ; Loop back to #R40967 for this new data *41000 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41001 JP 39158 ; Advance to next Room Layout Data entry and paint its attributes ; Move down one character row *41004 EXX ; Switch registers 41005 LD A,(23411) ; Load A with one more than y-coordinate of bottom edge of area to paint... 41008 INC A ; ... 41009 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41010 INC B ; Increase B (i.e. move down a character row) *41011 PUSH BC ; Store BC (B = updated y-coordinate, C = initial x-coordinate) 41012 CP B ; If B is the same as A (i.e. we are now outside the area to be painted)... 41013 JP Z,41000 ; ...then jump to #R41000 41016 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) and load E with x-coordinate ; (characters) 41019 PUSH HL ; Store HL (new Attribute File Address) 41020 EXX ; Switch registers 41021 POP HL ; Restore HL (new Attribute File Address) 41022 JP 40991 ; Jump back to #R40991 and continue painting ; Move up one character row 41025 EXX ; Switch registers 41026 LD A,(23409) ; Load A with one less than y-coordinate of top edge of area to paint... 41029 DEC A ; ... 41030 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41031 DEC B ; Increase B (i.e. move down a character row) 41032 JP 41011 ; Jump back to #R41011 ; Store Coordinates of Area to be Coloured and Point IX at RLE Attribute (or Terrain Interaction) Data (Room ; Drawing) ; ; Used by the routines at #R40845, #R40873, #R40905, #R40937, #R41081, #R41109, #R41141 and #R41173. Input: HL ; Pointer to entry in Lookup Table for Attribute Data or Terrain Interaction Data Output: IX Points to start of RLE ; attribute data c41035 LD BC,(23408) ; Load BC with x- and y-coordinates (top-left) defined in current room layout data entry 41039 LD A,(HL) ; Load width as defined in attribute lookup data into A... 41040 ADD A,C ; ...add to x-coordinate... 41041 DEC A ; ...subtract one to get x-coordinate of right of graphic... 41042 LD (23410),A ; ...and store at #R23410 41045 INC HL ; Advance HL to height value in attribute lookup data... 41046 LD A,(HL) ; ...load into A... 41047 ADD A,B ; ...add to y-coordinate... 41048 LD (23411),A ; ...and store at #R23411 41051 INC HL ; Advance HL to address of attribute data... 41052 CALL 64632 ; ...load this address into HL... 41055 PUSH HL ; ...and copy the address from HL to IX... 41056 POP IX ; ... 41058 RET ; Return ; Unused routine ; ; Skip IX over room layout data entry for which painting (attribute / terrain interaction) is inappropriate. Input: ; IX Points to start of an instruction in room layout data A First byte of the instruction c41059 INC IX ; Advance by six bytes to start of next instruction... 41061 INC IX ; ... 41063 INC IX ; ... 41065 INC IX ; ... 41067 INC IX ; ... 41069 INC IX ; ... 41071 BIT 0,A ; If instruction number is even (i.e. instruction which has five parameters)... 41073 JP Z,39067 ; ...then process next room layout instruction (jump to #R39067)... 41076 INC IX ; ...otherwise, advance by one more byte to skip over sixth parameter... 41078 JP 39067 ; ...and process next room layout instruction (jump to #R39067) ; Paint Room Layout Data Entry's Terrain Interaction Parameters, Applying Horizontal and Vertical Mirrors (Room ; Drawing) ; ; Used by the routine at #R39158. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) at #R60889 Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's right c41081 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41082 LD HL,23408 ; Modify instruction at #R41219 to load x-coordinate of graphic's left edge into A... 41085 LD (41220),HL ; ...i.e. set end x-coordinate for painting right-to-left 41088 LD HL,41261 ; Modify instruction at #R41223 to jump to #R41261... 41091 LD (41224),HL ; ...i.e. advance HL up one character row in Terrain Interaction Data Table at #R23808 41094 LD A,43 ; Modify instruction at #R41226 with opcode 43 (DEC HL)... 41096 LD (41226),A ; ... 41099 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41100 CALL 41035 ; Store coordinates of area to be painted and point IX at RLE Terrain Interaction data 41103 LD BC,(23410) ; Load BC with coordinates of graphic's bottom-right 41107 JR 41199 ; 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 #R39158. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) at #R60889 Output: B y-coordinate of graphic's bottom C x-coordinate of graphic's left c41109 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41110 LD HL,23410 ; Modify instruction at #R41219 to load x-coordinate of graphic's right edge into A... 41113 LD (41220),HL ; ...i.e. set end x-coordinate for painting left-to-right 41116 LD HL,41261 ; Modify instruction at #R41223 to jump to #R41261... 41119 LD (41224),HL ; ...i.e. advance HL up one character row in Terrain Interaction Data Table at #R23808 41122 LD A,35 ; Modify instruction at #R41226 with opcode 35 (INC HL)... 41124 LD (41226),A ; ... 41127 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41128 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 41131 LD A,(23408) ; Load C with x-coordinate of graphic's left edge... 41134 LD C,A ; ... 41135 LD A,(23411) ; Load B with y-coordinate of graphic's bottom edge... 41138 LD B,A ; ... 41139 JR 41199 ; 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 #R39158. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) at #R60889 Output: B y-coordinate of graphic's top C x-coordinate of graphic's right c41141 PUSH HL ; Store HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41142 LD HL,23408 ; Modify instruction at #R41219 to load x-coordinate of graphic's left edge into A... 41145 LD (41220),HL ; ...i.e. set end x-coordinate for painting right-to-left 41148 LD HL,41240 ; Modify instruction at #R41223 to jump to #R41240... 41151 LD (41224),HL ; ...i.e. advance HL down one character row in Terrain Interaction Data Table at #R23808 41154 LD A,43 ; Modify instruction at #R41226 with opcode 43 (DEC HL)... 41156 LD (41226),A ; ... 41159 POP HL ; Restore HL (current entry in Lookup Table for RLE Terrain Interaction Data) 41160 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 41163 LD A,(23410) ; Load C with x-coordinate of graphic's right edge... 41166 LD C,A ; ... 41167 LD A,(23409) ; Load B with y-coordinate of graphic's top edge... 41170 LD B,A ; ... 41171 JR 41199 ; 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 #R39158. Input: HL Points to entry in Lookup Table for RLE Terrain Interaction Data (Room ; Layout Graphics) at #R60889 c41173 PUSH HL ; Store HL (Pointer to entry in Lookup Table for RLE Terrain Interaction Data) 41174 LD HL,23410 ; Modify instruction at #R41219 to load x-coordinate of graphic's right edge into A... 41177 LD (41220),HL ; ...i.e. set end x-coordinate for painting left-to-right 41180 LD HL,41240 ; Modify instruction at #R41223 to jump to #R41240... 41183 LD (41224),HL ; ...i.e. advance HL down one character row in Terrain Interaction Data Table at #R23808 41186 LD A,35 ; Modify instruction at #R41226 with opcode 35 (INC HL)... 41188 LD (41226),A ; ... 41191 POP HL ; Restore HL (Pointer to entry in Lookup Table for RLE Terrain Interaction Data) 41192 CALL 41035 ; Store coordinates of area to be coloured and point IX at RLE Terrain Interaction Data 41195 LD BC,(23408) ; 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 #R41081, #R41109 and #R41141. 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. *41199 PUSH BC ; Store BC (B = current y-coordinate, C = initial x-coordinate) 41200 CALL 63233 ; Point HL at Terrain Interaction Data Table address for character coordinates x=C, y=B *41203 LD A,(IX+0) ; Load A with repeat count value 41206 OR A ; If repeat count is zero... 41207 JP Z,41236 ; ...then jump to #R41236 41210 LD B,A ; Load B with repeat count 41211 LD C,(IX+1) ; Load C with terrain interaction parameter to paint *41214 LD (HL),C ; Apply terrain interaction parameter in C to current Terrain Interaction Data Table location ; in HL 41215 LD A,L ; Load E with x-coordinate (characters) of current Terrain Interaction Data location... 41216 AND 31 ; ... 41218 LD E,A ; ... ; The operand of the instruction at #R41219 is modified by instructions at #R41085, #R41113, #R41145, #R41177, to ; #R23408 (x-coordinate of left edge), #R23410 (x-coordinate of right edge), #R23408 (x-coordinate of left edge), or ; #R23410 (x-coordinate of right edge) respectively. 41219 LD A,(23410) ; Load A with end x-coordinate for painting... 41222 CP E ; ...and if this is the same as the x-coordinate... ; The operand of the instruction at #R41223 (i.e. the destination of the jump) is modified by the instructions at ; #R41091, #R41119, #R41151 and #R41183 to be #R41261 (move up one character row), #R41261 (move up one character ; row), #R41240 (move down one character row) or #R41240 (move down one character row) respectively. 41223 JP Z,41240 ; ...then jump to routine to move up or down one character row ; The instruction at #R41226 is modified by the instructions at #R41096, #R41124, #R41156 and #R41188 to 43 (DEC ; HL), 35 (INC HL), 43 (DEC HL) or 35 (INC HL) respectively. 41226 INC HL ; Advance HL to next (or previous) byte in Terrain Interaction Data Table *41227 DJNZ 41214 ; Decrease B (repeat count) and loop back to #R41214 if not zero 41229 INC IX ; Advance IX by two bytes in RLE terrain interaction data... 41231 INC IX ; ... 41233 JP 41203 ; Loop back to #R41203 for this new data *41236 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41237 JP 39183 ; Advance IX to start of next Room Layout Data entry and jump back to #R39067 to paint its ; attributes / terrain interaction data ; Move down one character row *41240 EXX ; Switch registers 41241 LD A,(23411) ; Load A with one more than y-coordinate of bottom edge of area to paint... 41244 INC A ; ... 41245 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41246 INC B ; Increase B (i.e. move down a character row) *41247 PUSH BC ; Store BC (B = updated y-coordinate, C = initial x-coordinate) 41248 CP B ; If B is the same as A (i.e. we are now outside the area to be painted)... 41249 JP Z,41236 ; ...then jump to #R41236 41252 CALL 63233 ; Load HL with Terrain Interaction Data Table address for coordinates (C, B) and load E with ; x-coordinate (characters) 41255 PUSH HL ; Store HL (new Terrain Interaction Data Table Address) 41256 EXX ; Switch registers 41257 POP HL ; Restore HL (new Terrain Interaction Data Table Address) 41258 JP 41227 ; Jump back to #R41227 and continue painting ; Move up one character row 41261 EXX ; Switch registers 41262 LD A,(23409) ; Load A with one less than y-coordinate of top edge of area to paint... 41265 DEC A ; ... 41266 POP BC ; Restore BC (B = current y-coordinate, C = initial x-coordinate) 41267 DEC B ; Increase B (i.e. move down a character row) 41268 JP 41247 ; Jump back to #R41247 ; Draw 2x2 Block with Style Index A at Bitmap Virtual Text Cursor then move Right Two Characters ; ; Used by the routines at #R39216 and #R39366. Input: A Block style index c41271 EXX ; Switch registers 41272 LD H,0 ; Load HL with eight times block style index... 41274 LD L,A ; ...(see trivia)... 41275 ADD A,A ; ... 41276 LD L,A ; ... 41277 ADD HL,HL ; ... 41278 ADD HL,HL ; ... 41279 LD DE,49794 ; Load DE with start address of Table of Block Style Definitions... 41282 ADD HL,DE ; ...and add to HL as offset in HL 41283 LD A,(HL) ; Load system variable ATTR T with attribute value in selected style... 41284 LD (23695),A ; ... 41287 INC HL ; Advance HL to terrain interaction parameter to apply... 41288 LD A,(HL) ; ... 41289 LD (23485),A ; ...and store at #R23485 41292 INC HL ; Advance HL to Terrain Interaction Parameter Painting Bitmap... 41293 LD A,(HL) ; ... 41294 LD (23298),A ; ...and store at #R23298 41297 INC HL ; Advance HL to index of top-left block UDG... 41298 INC HL ; ... 41299 LD DE,(63018) ; Store Display File address of Bitmap Virtual Text Cursor to #R23296... 41303 LD (23296),DE ; ... 41307 LD A,(HL) ; Load A with index of top-left block UDG... 41308 CALL 63162 ; ...and draw at location of Bitmap Virtual Text Cursor 41311 PUSH HL ; Store HL (pointer to index of top-left block UDG) 41312 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by one character 41315 POP HL ; Restore HL (pointer to index of top-left block UDG) 41316 INC HL ; Advance HL to index of top-right block UDG... 41317 LD A,(HL) ; ...load into A... 41318 CALL 63162 ; ...and draw at location of Bitmap Virtual Text Cursor 41321 PUSH HL ; Store HL (pointer to index of top-right block UDG) 41322 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by one character (see trivia) 41325 LD A,(23298) ; Load B with Terrain Interaction Parameter Painting Bitmap... 41328 LD B,A ; ... 41329 LD A,(23485) ; Load A with terrain interaction parameter to apply 41332 LD HL,(23709) ; Load HL with address of terrain interaction data for top-left character 41335 BIT 0,B ; If Bit 0 of Terrain Interaction Parameter Painting Bitmap is reset... 41337 JR Z,41340 ; ...then skip ahead to #R41340 41339 LD (HL),A ; Apply current terrain interaction parameter to address in HL *41340 INC HL ; Advance HL (i.e. move right one character) 41341 BIT 1,B ; If Bit 1 of Terrain Interaction Parameter Painting Bitmap is reset... 41343 JR Z,41346 ; ...then skip ahead to #R41346 41345 LD (HL),A ; Apply current terrain interaction parameter to address in HL *41346 POP HL ; Restore HL (pointer to index of top-right block UDG) 41347 LD A,(23461) ; If Draw 2x1 Blocks Flag is set (see trivia)... 41350 OR A ; ... 41351 JR NZ,41457 ; ...then skip ahead to #R41457 41353 INC HL ; Advance HL to index of bottom-left block UDG 41354 EX DE,HL ; Swap DE (now points to index of bottom-left block UDG) and HL 41355 LD HL,(23296) ; Restore Display File address of Bitmap Virtual Text Cursor (top-left character) from ; #R23296... 41358 LD (63018),HL ; ... 41361 CALL 63263 ; Advance Bitmap Virtual Text Cursor to start of next character row 41364 LD A,(23296) ; Load A with LSB of Bitmap Virtual Text Cursor Display File address stored previously... 41367 AND 31 ; ...and clear bits 5, 6 and 7 to leave x-coordinate in characters 41369 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor... 41372 OR L ; ...and add x-coordinate in characters to move to bottom-left character in 2x2 block... 41373 LD L,A ; ... 41374 LD (63018),HL ; Store updated address of Bitmap Virtual Text Cursor 41377 EX DE,HL ; Swap DE and HL (now points to index of bottom-left block UDG) 41378 LD A,(HL) ; Load A with index of bottom-left block UDG... 41379 CALL 63162 ; ...and draw at location of Bitmap Virtual Text Cursor 41382 PUSH HL ; Store HL (pointer to index of bottom-left block UDG) 41383 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by one character 41386 POP HL ; Restore HL (pointer to index of bottom-left block UDG) 41387 INC HL ; Advance HL to index of bottom-right block UDG... 41388 LD A,(HL) ; ...load into A... 41389 CALL 63162 ; ...and draw at location of Bitmap Virtual Text Cursor 41392 LD HL,(23296) ; Restore Display File address of Bitmap Virtual Text Cursor (top-left character) from ; #R23296... 41395 LD (63018),HL ; ... 41398 LD A,(23298) ; Load B with Terrain Interaction Parameter Painting Bitmap... 41401 LD B,A ; ... 41402 LD A,(23485) ; Load A with terrain interaction parameter to apply 41405 LD HL,(23709) ; Load HL with address of terrain interaction data for top-left character... 41408 LD BC,32 ; ...and add 32 to point to bottom-left character... 41411 ADD HL,BC ; ... 41412 BIT 2,B ; If Bit 2 of Terrain Interaction Parameter Painting Bitmap is reset (bug)... 41414 JR Z,41417 ; ...then skip ahead to #R41417 41416 LD (HL),A ; Apply current terrain interaction parameter to address in HL *41417 INC HL ; Advance HL (i.e. move right one character) 41418 BIT 3,B ; If Bit 3 of Terrain Interaction Parameter Painting Bitmap is reset (bug)... 41420 JR Z,41423 ; ...then skip ahead to #R41423 41422 LD (HL),A ; Apply current terrain interaction parameter to address in HL *41423 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by two characters... 41426 CALL 63247 ; ...i.e. move to top-left character of next 2x2 block to the right 41429 LD HL,(23709) ; Load HL with address of terrain interaction data for top-left character... 41432 INC HL ; ...advance by two characters... 41433 INC HL ; ... 41434 LD (23709),HL ; ...and store at #R23709 41437 LD A,(63018) ; Load A with LSB of Bitmap Virtual Text Cursor Display File address... 41440 AND 31 ; ...and if at least one of bits 0-4 are set (i.e. we are not at the start of a new character ; row)... 41442 JR NZ,41457 ; ...then skip ahead to #R41457 41444 CALL 63263 ; Advance Bitmap Virtual Text Cursor to start of next character row 41447 LD BC,32 ; Add 32 to address of terrain interaction data to move to next character row... 41450 LD HL,(23709) ; ... 41453 ADD HL,BC ; ... 41454 LD (23709),HL ; ... *41457 EXX ; Switch registers 41458 RET ; Return ; Read Glowing Character Block Definitions and Add to Current Room ; ; Used by the routine at #R39393. Input: HL Current position in room layout data c41459 INC HL ; Advance HL by one byte... 41460 LD A,(HL) ; ...and if value here is 255 (end marker)... 41461 CP 255 ; ... 41463 RET Z ; ...then return 41464 LD C,A ; Load C with x-coordinate 41465 INC HL ; Advance HL to y-coordinate... 41466 LD B,(HL) ; ...and load into B 41467 PUSH HL ; Store HL (current position in room layout data) 41468 CALL 63219 ; Point HL at Attribute File address for character coordinates x=C, y=B 41471 CALL 41477 ; Add a glowing character block to the current room 41474 POP HL ; Restore HL (current position in room layout data) 41475 JR 41459 ; Loop back to #R41459 for next entry ; Add a Glowing Character Block to the Current Room ; ; Used by the routine at #R41459. Input: HL Attribute File address to add Output: IX Points to entry in the table ; created on the last pass of this routine c41477 LD IX,23368 ; Point IX at table of Attribute File addresses of glowing characters in current room 41481 DEC IX ; Move IX back two bytes... 41483 DEC IX ; ... *41485 INC IX ; Advance IX by two bytes... 41487 INC IX ; ... 41489 LD A,(IX+0) ; If two bytes at IX are non-zero... 41492 OR (IX+1) ; ... 41495 JR NZ,41485 ; ...then loop back to check next two bytes 41497 LD (IX+0),L ; Store HL at first empty pair of bytes after 23368... 41500 LD (IX+1),H ; ... 41503 RET ; Return ; Copy 2x4 (Characters) Region of Display File into Temporary Storage at 23299 ; ; Used by the routine at #R39958. Input: IX Address of position data for a character, or Magic Knight c41504 LD DE,23299 ; Load DE with start address of temporary storage area 41507 LD C,(IX+1) ; Load C with x-coordinate of area to copy 41510 LD B,(IX+2) ; Load B with y-coordinate of area to copy... 41513 DEC B ; ...and decrease by one 41514 LD (41549),BC ; Store x- and y-coordinates as operand of instruction at #R41548 41518 LD A,4 ; Load A with 4 (as Magic Knight and other characters span four character blocks in height) *41520 PUSH AF ; Store AF (A = remaining height in characters to copy) 41521 INC B ; Increase y-coordinate by one 41522 PUSH BC ; Store BC (B = current y-coordinate, C = current x-coordinate) 41523 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 41526 LD B,8 ; Load B with 8 (as there are eight pixel rows per character) *41528 LD A,(HL) ; Copy byte from current location in Display File... 41529 LD (DE),A ; ...to temporary storage area starting at #R23299 41530 INC HL ; Advance right one character in Display File 41531 INC DE ; Advance to next byte in temporary storage area 41532 LD A,(HL) ; Copy byte from current location in Display File... 41533 LD (DE),A ; ...to temporary storage area starting at #R23299 41534 INC DE ; Advance to next byte in temporary storage area 41535 DEC HL ; Move left one character... 41536 INC H ; ...and down one pixel in Display File 41537 DJNZ 41528 ; Decrease B (remaining number of pixel rows) and loop back to #R41528 if not zero 41539 POP BC ; Restore BC (B = current y-coordinate, C = current x-coordinate) 41540 POP AF ; Restore AF (A = remaining height in characters to copy) 41541 DEC A ; Decrease remaining number of character blocks to copy... 41542 JR NZ,41520 ; ...and loop back to #R41520 if not zero 41544 RET ; Return ; Copy 2x4 (Characters) Region from Temporary Storage at 23299 into Display File ; ; Used by the routine at #R39958. c41545 LD DE,23299 ; Load DE with start address of temporary storage area ; The operand of the instruction at #R41548 represents the x- and y-coordinates at which to copy the previously ; stored bitmap data into the Display File. This is modified by the instruction at #R41514. 41548 LD BC,0 ; Load B and C with the y- and x-coordinates to copy to, respectively 41551 LD A,4 ; Load A with 4 (as characters are 4 characters high) *41553 PUSH AF ; Store AF (A = remaining height in characters to copy) 41554 INC B ; Increase destination y-coordinate by one 41555 PUSH BC ; Store BC (B = current y-coordinate, C = current x-coordinate) 41556 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 41559 LD B,8 ; Load B with 8 (as there are eight pixel rows per character) *41561 LD A,(DE) ; Copy byte from temporary storage area starting at #R23299... 41562 LD (HL),A ; ...to current location in Display File 41563 INC HL ; Advance right one character in Display File 41564 INC DE ; Advance to next byte in temporary storage area 41565 LD A,(DE) ; Copy byte from temporary storage area starting at #R23299... 41566 LD (HL),A ; ...to current location in Display File 41567 INC DE ; Advance to next byte in temporary storage area 41568 DEC HL ; Move left one character... 41569 INC H ; ...and down one pixel in Display File 41570 DJNZ 41561 ; Decrease B (remaining number of pixel rows) and loop back to #R41561 if not zero 41572 POP BC ; Restore BC (B = current y-coordinate, C = current x-coordinate) 41573 POP AF ; Restore AF (A = remaining height in characters to copy) 41574 DEC A ; Decrease remaining height to copy... 41575 JR NZ,41553 ; ...and loop back to #R41553 if not zero 41577 RET ; Return ; Process Command to Pick Up an Object c41578 CALL 63399 ; Print or update Command Summary Window at top of screen 41581 LD DE,51811 ; Point DE at "PICK UP THE" text... 41584 CALL 63349 ; ...and print in Command Summary Window at top of screen 41587 LD HL,24922 ; Point HL at start of Objects' Current Positions Table 41590 LD BC,10752 ; Load B with 42 (as there are 42 objects) and C with 0 *41593 LD A,(23702) ; Load A with Magic Knight's current room 41596 CP (HL) ; If current object's room is not the same as Magic Knight's then... 41597 JR NZ,41600 ; ...skip ahead to #R41600 41599 INC C ; Increase C (count of objects in Magic Knight's current room) *41600 INC HL ; Advance HL to next object's position... 41601 INC HL ; ... 41602 INC HL ; ... 41603 DJNZ 41593 ; Decrease B and loop back for next object 41605 LD A,C ; Copy total number of objects into A... 41606 OR A ; ...and if this value is zero then set Zero Flag 41607 LD HL,51822 ; Load HL with address of "THERE IS NOTHING IN THIS ROOM" text 41610 JP Z,64261 ; Display "THERE IS NOTHING IN THIS ROOM" Window (13), wait for Fire to be pressed then jump to ; Main Game Loop 41613 LD HL,24922 ; Point HL at start of Objects' Current Positions Table 41616 LD A,(23702) ; Load A with Magic Knight's current room 41619 LD C,A ; ...and copy into C 41620 CALL 45584 ; Load Magic Knight's coordinates (in characters) into DE 41623 XOR A ; Set A to zero 41624 EX AF,AF' ; Switch A register 41625 LD B,42 ; Load B with 42 (as there are 42 objects) *41627 LD A,C ; Load Magic Knight's current room into A 41628 CP (HL) ; If room of current object is not the same as Magic Knight's current room... 41629 JR NZ,41652 ; ...then skip ahead to #R41652 [advance to next object] 41631 LD A,D ; Copy Magic Knight's y-coordinate into A 41632 INC HL ; Advance HL to current object's y-coordinate... 41633 INC HL ; ... 41634 CP (HL) ; ...and if this is not the same as Magic Knight's y-coordinate... 41635 JR NZ,41654 ; ...then skip ahead to #R41654 [advance to next object] 41637 DEC HL ; Move HL back to object's x-coordinate 41638 LD A,E ; Load Magic Knight's x-coordinate into A 41639 DEC A ; Decrease x-coordinate by two... 41640 DEC A ; ... 41641 PUSH BC ; Store BC 41642 LD B,5 ; Load B with 5 (as we are going to test 5 different x-coordinates) *41644 CP (HL) ; If x-coordinate of object is the same as current x-coordinate value... 41645 JR Z,41666 ; ...then skip ahead to #R41666 41647 INC A ; Increase value of current x-coordinate (to test next x-coordinate in range -2 to +2) 41648 DJNZ 41644 ; Decrease B (remaining number of x-coordinates to test) and loop back to #R41644 41650 POP BC ; Restore BC 41651 DEC HL ; Move HL back one byte to start of position data for current object *41652 INC HL ; Advance HL by three bytes to move to next object... 41653 INC HL ; ... *41654 INC HL ; ... 41655 EX AF,AF' ; Switch A register back (so now contains the index of the object to test next) 41656 INC A ; Increase A [index of current object to test] 41657 EX AF,AF' ; Switch A register 41658 DJNZ 41627 ; Loop back to #R41627 for next object 41660 LD HL,51833 ; Display "THERE IS NOTHING NEAR ENOUGH" Window (13), wait for Fire to be pressed then jump to ; Main Game Loop... 41663 JP 64261 ; ... ; An object has been found within Magic Knight's reach so make this the current object *41666 POP BC ; Restore BC 41667 EX AF,AF' ; Switch A register (so now contains index of first object that is within Magic Knight's reach) 41668 LD (41779),A ; Load index of this object into instruction at #R41778 (i.e. set as Current Object) 41671 LD DE,45779 ; Point DE at character code to print name of Current Object 41674 CALL 63349 ; ...and print in Command Summary Window at top of screen 41677 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 41680 LD A,(41779) ; Load A with index of Current Object... 41683 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 41686 LD HL,24852 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 41689 LD A,(HL) ; ... 41690 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 41691 JP NZ,64258 ; ...then display "YOUR HANDS ARE FULL" window, wait for Fire to be pressed then jump to Main ; Game Loop 41694 CALL 45466 ; Check whether object has a weight greater than Magic Knight's surplus strength... 41697 JP P,64265 ; ...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 41700 LD A,(41779) ; Load A with index of Current Object... 41703 LD C,A ; ...and copy into C 41704 LD B,5 ; Load B with 5 (five inventory slots) 41706 LD HL,24848 ; Wait for interrupt then load object in C into Magic Knight's first empty inventory (carrying) ; slot... 41709 CALL 45380 ; ... 41712 LD A,(41779) ; Load A with index of Current Object... 41715 LD C,A ; ...and copy into C 41716 ADD A,A ; Multiply index by three in A... 41717 ADD A,C ; ... 41718 LD B,0 ; Load three times object index into BC... 41720 LD C,A ; ... 41721 LD HL,24922 ; Point HL at start of Objects' Current Positions Table 41724 ADD HL,BC ; Add BC as offset to point HL at position data for current object 41725 LD (HL),99 ; Set object's room to 99 ; This entry point is used by the routines at #R41748, #R42036, #R42395 and #R44635. *41727 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 41731 LD B,5 ; Load B with 5 (five inventory slots) 41733 LD HL,51794 ; Point HL at "YOU ARE NOW CARRYING" text 41736 CALL 45802 ; Display "Magic Knight's current inventory" window as an information window ; This entry point is used by the routines at #R42638 and #R45552. *41739 CALL 64230 ; Wait for Interrupt then display "PRESS FIRE TO CONTINUE" window and wait for Fire to be ; pressed ; This entry point is used by the routines at #R41748, #R41924, #R42257, #R42638, #R43043, #R43494, #R43636, ; #R44635, #R44861, #R44933, #R64207 and #R64317. *41742 CALL 46183 ; Set Magic Knight's available action flags 41745 JP 38205 ; Jump to start of Main Game Loop ; Process Command to Drop an Object c41748 CALL 45641 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 41751 JP Z,41742 ; If MK's inventory (carrying) is empty then set his available action flags and jump to start ; of Main Game Loop 41754 LD IX,24848 ; Point IX at start of Magic Knight's current inventory (carrying) 41758 LD B,5 ; Load B with 5 (five inventory slots) 41760 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 41763 LD DE,51928 ; Point DE at "[Current Command] THE " text 41766 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 41769 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 41772 CALL 45766 ; Print name of selected object in Magic Knight's current inventory (carrying) in Command ; Summary Window 41775 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop ; The operand of the instruction at #R41778 represents the index of the Current Object used in multiple routines. ; This is modified by the instructions at #R41668 and #R45771. 41778 LD A,0 ; Load index of Current Object into A [Operand is index of Current Object] 41780 LD HL,51933 ; Point HL at "THE [name of Current Object] BLEW UP..." text 41783 CP 5 ; If Current Object is 5 (Stick of Dynamite)... 41785 JP Z,64582 ; ...then jump to "Game over" window routine and return to Control Selection Menu 41788 CALL 45685 ; If Current Object is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire ; to be pressed 41791 LD E,0 ; Load E with 0 (prepare to check Drop Status Flag) 41793 CALL 45390 ; Point HL to byte 0 of the A-th record in Object Properties Table 41796 BIT 4,(HL) ; Reset Zero Flag if object's Drop Status Flag is set 41798 LD HL,51970 ; Point HL at "YOU CANNOT [Current Command] THE [name of Current Object]" text 41801 JP NZ,64261 ; ...then display "YOU CANNOT [Current Command] THE [object]" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 41804 LD A,(41779) ; Load A with index of Current Object 41807 LD C,A ; Copy into C 41808 LD B,5 ; Load B with 5 (five inventory slots) 41810 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 41813 CALL 48341 ; Remove object C from Magic Knight's current inventory (carrying) 41816 LD A,(23702) ; Load A with Magic Knight's current room 41819 CP 2 ; If room is not 2 (Outdoors, 1, Bearwoolf's Cave)... 41821 JR NZ,41850 ; ...then skip ahead to #R41850 41823 LD A,(41779) ; Load A with index of Current Object 41826 LD C,A ; Multiply object index by 3... 41827 ADD A,A ; ... 41828 ADD A,C ; ... 41829 LD C,A ; ...and load into C 41830 LD B,0 ; Load B with zero 41832 LD HL,24922 ; Point HL at start of Objects' Current Positions Table at #R24922 41835 ADD HL,BC ; Add three times Current Object's index as offset to point HL at position data of current ; object 41836 XOR A ; Set object's current room... 41837 LD (HL),A ; ...to be zero (Limbo) 41838 INC HL ; Advance HL to x-coordinate of object... 41839 LD (HL),15 ; ...and set to 15 41841 INC HL ; Advance HL to y-coordinate of object... 41842 LD (HL),22 ; ...and set to 22 41844 LD HL,51981 ; Display "THE MAD JANITOR..." Window (12), wait for Fire to be pressed then jump to Main Game ; Loop... 41847 JP 64297 ; ... *41850 LD A,(41779) ; Load C with index of Current Object... 41853 LD C,A ; ... 41854 CP 20 ; If Current Object is 20 (Mirror)... 41856 CALL Z,41915 ; ...then load C with 7 (index of Broken Glass) 41859 CP 17 ; If Current Object is 17 (Bottle of Liquid)... 41861 CALL Z,41918 ; ...then load C with 8 (index of Broken Glass) 41864 CP 18 ; If Current Object is 18 (Bottle of Liquid)... 41866 CALL Z,41921 ; ...then load C with 9 (index of Broken Glass) 41869 CP 28 ; If Current Object is 28 (Empty Bottle)... 41871 CALL Z,41918 ; ...then load C with 8 (index of Broken Glass) 41874 CP 29 ; If Current Object is 29 (Empty Bottle)... 41876 CALL Z,41921 ; ...then load C with 9 (index of Broken Glass) 41879 LD A,C ; Load object's index into A 41880 ADD A,A ; Multiply object index by 3... 41881 ADD A,C ; ... 41882 LD C,A ; ...and load back into C 41883 LD B,0 ; Load B with zero 41885 LD HL,24922 ; Point HL at start of Objects' Current Positions Table at #R24922 41888 ADD HL,BC ; Add three times Current Object's index as offset to point HL at position data of current ; object 41889 LD A,(23702) ; Load A with Magic Knight's current room 41892 LD (HL),A ; Set object's current room to be same as Magic Knight's 41893 INC HL ; Advance HL to x-coordinate of object 41894 LD B,0 ; Set B to zero 41896 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 41899 AND 7 ; Get x-coordinate in terms of pixels within current character block (i.e. lowest 3 bits of ; x-coordinate) 41901 JR Z,41904 ; If this is zero (i.e. Magic Knight at left-most pixel in character block) then skip ahead to ; #R41904... 41903 INC B ; ...else increase B *41904 CALL 45584 ; Load Magic Knight's Coordinates (in Characters) into DE 41907 LD A,B ; Load B into A 41908 ADD A,E ; Add Magic Knight's x-coordinate to A 41909 LD (HL),A ; Set this as object's x-coordinate 41910 INC HL ; Advance HL to y-coordinate of object 41911 LD (HL),D ; Set this to same as Magic Knight's y-coordinate 41912 JP 41727 ; Show Magic Knight's current inventory and jump back to Main Game Loop ; Load C with 7 (Index of Broken Glass) ; ; Used by the routines at #R41748 and #R43636. c41915 LD C,7 ; Load C with 7 (Broken Glass) 41917 RET ; Return ; Load C with 8 (Index of Broken Glass) ; ; Used by the routines at #R41748 and #R43636. c41918 LD C,8 ; Load C with 8 (Broken Glass) 41920 RET ; Return ; Load C with 9 (Index of Broken Glass) ; ; Used by the routines at #R41748 and #R43636. c41921 LD C,9 ; Load C with 9 (Broken Glass) 41923 RET ; Return ; Process Command to Take an Object c41924 LD HL,51392 ; Point HL at "[Current Command] AN OBJECT FROM ?" text (end of sub-menu title, after "WHO DO ; YOU WANT TO ") 41927 LD DE,52034 ; Point DE (Command Summary Text Pointer) at "[Current Command] SOMETHING FROM " text 41930 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 41933 JP Z,41742 ; If there are no characters in the room then set MK's available action flags and jump to start ; of Main Game Loop (#R41742) ; The operand of the instruction at #R41936 represents the index of the Current Character used in multiple routines. ; This is modified by the instructions at #R42686, #R45789, #R46067, #R46147 and #R46177. 41936 LD A,0 ; Point IX at current inventory of Current Character... 41938 CALL 45450 ; ... 41941 LD A,(IX+0) ; If the first inventory slot of the character is empty... 41944 OR A ; ...then set Zero Flag 41945 LD HL,52042 ; Point HL at "[Current Character's short name]'S HANDS ARE EMPTY" text 41948 JP Z,64261 ; If Zero Flag is set then display "[Character]'S HANDS ARE EMPTY" Window (13), wait for Fire ; to be pressed then jump to Main Game Loop 41951 PUSH IX ; Store IX (start of inventory) 41953 LD B,5 ; Load B with 5 (five inventory slots) 41955 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 41958 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 41961 CALL 45809 ; Show list of objects in character's inventory as a menu and load A with selected item index 41964 PUSH AF ; Store AF (A = index of chosen object's inventory slot) 41965 CALL 63399 ; Print or update Command Summary Window at top of screen 41968 LD DE,51928 ; Point DE at "[Current Command] THE " text... 41971 CALL 63349 ; ...and print in Command Summary Window at top of screen 41974 POP AF ; Restore AF (A = index of chosen object's inventory slot) 41975 POP HL ; Restore HL (previously IX, pointer to current inventory of current character) 41976 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 41979 LD DE,52039 ; Point DE at " FROM " text... 41982 CALL 63349 ; ...and print in Command Summary Window at top of screen 41985 LD A,(41937) ; Load A with index of Current Character 41988 CALL 45792 ; Print character's name 41991 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 41994 LD A,(41779) ; Load A with index of Current Object... 41997 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 42000 LD A,253 ; Decrease Current Character's happiness by 3... 42002 CALL 45434 ; ... 42005 LD HL,24852 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 42008 LD A,(HL) ; ... 42009 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 42010 JP NZ,64258 ; ...then display "YOUR HANDS ARE FULL" window, wait for Fire to be pressed then jump to Main ; Game Loop 42013 CALL 45466 ; Check whether object has a weight greater than Magic Knight's surplus strength... 42016 JP P,64265 ; ...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 42019 CALL 45364 ; Load A with Current Character's Happiness Level... 42022 CP 30 ; and if this is less than 30... 42024 JP C,64270 ; ...then display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 42027 LD A,(41937) ; Load A with index of Current Character 42030 LD HL,42069 ; Load HL with start address of Table of Start Addresses of Routines for Characters Having ; Objects Taken 42033 JP 64623 ; Load HL with address of Current Character's "Take an Object" routine and jump to it ; Remove Current Object from Current Character's Inventory and Add it to Magic Knight's then Return to Main Game ; Loop ; ; Used by the routines at #R42085, #R42091, #R42105, #R42220, #R42226, #R42232 and #R42238. c42036 LD A,(41937) ; Point IX at current inventory of Current Character... 42039 CALL 45450 ; ... 42042 PUSH IX ; Copy value from IX... 42044 POP HL ; ...to HL 42045 LD A,(41779) ; Load C with index of Current Object... 42048 LD C,A ; ... 42049 LD B,5 ; Load B with 5 (five inventory slots) 42051 CALL 48341 ; Remove object C from Current Character's inventory 42054 LD A,(41779) ; Load C with index of Current Object... 42057 LD C,A ; ... 42058 LD B,5 ; Load B with 5 (five inventory slots) 42060 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying)... 42063 CALL 45380 ; ...and wait for interrupt then load object C into the first empty slot 42066 JP 41727 ; Show Magic Knight's current inventory and jump back to Main Game Loop ; Table of Start Addresses of Routines for Characters Having Objects Taken b42069 DEFW 42085 ; Off-White Knight (bug) 42071 DEFW 42091 ; Aramis le Peux 42073 DEFW 42105 ; Robin of Shylock 42075 DEFW 42220 ; Reggie the Rat 42077 DEFW 42226 ; Rachel of Amazonia 42079 DEFW 42232 ; Barker the Ent 42081 DEFW 42238 ; Organon the Guard 42083 DEFW 42244 ; Grunter the Bearwoolf ; Take an Object Routine Off-White Knight ; ; Off-White will refuse to surrender any egg he may have (bug). c42085 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42088 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Aramis le Peux ; ; Aramis will refuse to surrender the List of Clues or any egg he may have. c42091 LD A,(41779) ; If Current Object is 34 (List of Clues)... 42094 CP 34 ; ... 42096 JP Z,64270 ; ...then display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 42099 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42102 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Robin of Shylock ; ; Robin will refuse to surrender the Bow or any egg he may have. He will only surrender the Newspaper in exchange ; for an egg. When surrendering the Newspaper, he will always take the most valuable egg Magic Knight currently has, ; i.e. Golden Egg > Silver Egg > Copper Egg. c42105 LD A,(41779) ; If Current Object is 33 (Newspaper)... 42108 CP 33 ; ... 42110 JP Z,42124 ; ...then skip ahead to #R42124 42113 CP 35 ; If Current Object is 35 (Bow)... 42115 JP Z,64270 ; Display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for Fire to be pressed ; then jump to Main Game Loop 42118 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42121 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop *42124 LD A,36 ; Have current character try to take object 36 (Golden Egg) in exchange for Newspaper... 42126 CALL 42157 ; ...returning to Main Game Loop if successful 42129 LD A,39 ; Have current character try to take object 39 (Golden Egg) in exchange for Newspaper... 42131 CALL 42157 ; ...returning to Main Game Loop if successful 42134 LD A,37 ; Have current character try to take object 37 (Silver Egg) in exchange for Newspaper... 42136 CALL 42157 ; ...returning to Main Game Loop if successful 42139 LD A,40 ; Have current character try to take object 40 (Silver Egg) in exchange for Newspaper... 42141 CALL 42157 ; ...returning to Main Game Loop if successful 42144 LD A,38 ; Have current character try to take object 38 (Copper Egg) in exchange for Newspaper... 42146 CALL 42157 ; ...returning to Main Game Loop if successful 42149 LD A,41 ; Have current character try to take object 41 (Copper Egg) in exchange for Newspaper... 42151 CALL 42157 ; ...returning to Main Game Loop if successful ; At this point, Robin will have failed to take an egg. In this case, he will refuse to surrender the Newspaper. 42154 JP 64270 ; Display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for Fire to be pressed ; then jump to Main Game Loop ; Take an Object Routine Have Current Character Take Object A in Exchange for Newspaper ; ; Used by the routine at #R42105. Input: A Index of object of interest c42157 LD (42208),A ; Store index of object of interest as operand of instruction at #R42207 42160 CALL 45510 ; If Magic Knight is not carrying the object of interest... 42163 RET NZ ; ...then return 42164 POP AF ; Remove return address of calling routine from top of Stack 42165 LD A,(42208) ; Load C with index of object of interest... 42168 LD C,A ; ... 42169 LD B,5 ; Load B with 5 (five inventory slots) 42171 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 42174 CALL 48341 ; Remove object of interest from Magic Knight's current inventory (carrying) 42177 LD A,33 ; Load C with 33 (index of Newspaper)... 42179 LD C,A ; ... 42180 LD B,5 ; Load B with 5 (five inventory slots) 42182 LD HL,24848 ; Wait for interrupt then load object in C into Magic Knight's first empty inventory (carrying) ; slot... 42185 CALL 45380 ; ... 42188 LD A,(41937) ; Point IX at current inventory of Current Character... 42191 CALL 45450 ; ... 42194 PUSH IX ; Copy address from IX to HL... 42196 POP HL ; ... 42197 PUSH HL ; Store HL (address of Current Character's current inventory) 42198 LD A,33 ; Load C with 33 (index of Newspaper)... 42200 LD C,A ; ... 42201 LD B,5 ; Load B with 5 (five inventory slots) 42203 CALL 48341 ; Remove object of interest from Current Character's current inventory 42206 POP HL ; Restore HL (address of Current Character's current inventory) ; The operand of the instruction at #R42207 represents the index of the object of interest. This is modified by the ; instruction at #R42157. 42207 LD C,0 ; Load C with index of object of interest 42209 LD B,5 ; Load B with 5 (five inventory slots) 42211 CALL 45380 ; Wait for interrupt then load object in C into Current Character's first empty inventory slot 42214 LD HL,52076 ; Point HL at "[Current Character's short name] HAS [Current Command]N AN EGG..." text 42217 JP 64261 ; Display "[Current Character's short name] HAS [Current Command]N AN EGG..." Window (13), wait ; for Fire to be pressed then jump to Main Game Loop ; Take an Object Routine Reggie the Rat ; ; Reggie will refuse to surrender any egg he may have. c42220 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42223 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Rachel of Amazonia ; ; Rachel will refuse to surrender any egg she may have. c42226 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42229 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Barker the Ent ; ; Barker will refuse to surrender any egg he may have. c42232 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42235 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Organon the Guard ; ; Organon will refuse to surrender any egg he may have. c42238 CALL 42247 ; If Current Object is an egg then display "[Character] WANTS TO KEEP THE [Object]" Window (13) ; and return to Main Game Loop 42241 JP 42036 ; Remove Current Object from Current Character's inventory and add it to Magic Knight's then ; return to Main Game Loop ; Take an Object Routine Grunter the Bearwoolf c42244 JP 45723 ; End the game if Current Character is Off-White or Grunter ; If Current Object is an Egg then Display "[Character] WANTS TO KEEP THE [Object]" Window (13) and Return to Main ; Game Loop ; ; Used by the routines at #R42085, #R42091, #R42105, #R42220, #R42226, #R42232 and #R42238. c42247 LD A,(41779) ; If index of Current Object... 42250 CP 36 ; ...is less than 36 (i.e. is not an egg)... 42252 RET C ; ...then return 42253 POP AF ; Remove return address of calling routine from top of Stack 42254 JP 64270 ; Display "[Character] WANTS TO KEEP THE [Object]" Window (13), wait for Fire to be pressed ; then jump to Main Game Loop ; Process Command to Give an Object c42257 CALL 45641 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 42260 JP Z,41742 ; If MK's inventory (carrying) is empty then set his available action flags and jump to start ; of Main Game Loop (#R41742) 42263 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 42267 LD B,5 ; Load B with 5 (five inventory slots) 42269 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 42272 LD DE,51928 ; Point DE at "[Current Command] THE " text 42275 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 42278 LD HL,24848 ; Point HL at Magic Knight's current inventory (carrying) 42281 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 42284 LD DE,52105 ; Point DE at " TO " text... 42287 CALL 63349 ; ...and print in Command Summary Window at top of screen 42290 LD HL,51400 ; Point HL at "[Current Command] AN OBJECT TO ?" text 42293 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 42296 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 42299 JP Z,41742 ; If there are no characters in the room then set his available action flags and jump to start ; of Main Game Loop (#R41742) 42302 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 42305 LD A,(41779) ; Load A with index of Current Object... 42308 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 42311 LD A,4 ; Increase Current Character's happiness by 4... 42313 CALL 45434 ; ... 42316 LD A,(41937) ; Point IX at current inventory of Current Character... 42319 CALL 45450 ; ... 42322 LD A,(IX+4) ; If last inventory slot of character is not zero... 42325 OR A ; ...(i.e. last inventory slot is occupied) then reset Zero Flag 42326 LD HL,52108 ; Point HL at "[Current Character's short name]'S HANDS ARE FULL" text 42329 JP NZ,64261 ; If Zero Flag is reset then display "[Character]'S HANDS ARE FULL" Window (13), wait for Fire ; to be pressed then jump to Main Game Loop 42332 LD BC,1280 ; Load B with 5 (five inventory slots) and C with zero *42335 LD A,(IX+0) ; Load content of current inventory slot into A 42338 OR A ; If this inventory slot is empty... 42339 JR Z,42350 ; ...then skip ahead to #R42350 42341 CALL 45351 ; Load A with weight of object in current slot... 42344 ADD A,C ; ...and add to C (running total weight)... 42345 LD C,A ; ... 42346 INC IX ; Advance to next inventory slot 42348 DJNZ 42335 ; Loop back to #R42335 for next slot *42350 LD A,(41779) ; Load A with index of Current Object 42353 CALL 45351 ; Load A with weight of object being given... 42356 ADD A,C ; ...and add this to total in C also... 42357 LD C,A ; ... 42358 LD A,(41937) ; Load A with index of Current Character 42361 LD E,0 ; Point HL at character's current strength... 42363 CALL 45406 ; ... 42366 LD A,(HL) ; Load strength into A... 42367 AND 127 ; ...and reset Bit 7 (unused) 42369 CP C ; If character's strength is not less than total weight of objects... 42370 JR NC,42378 ; ...then skip ahead to #R42378 42372 LD HL,52126 ; Point HL at "[Current Character's short name] IS NOT STRONG ENOUGH" text 42375 JP 64261 ; Display "[Character] IS NOT STRONG ENOUGH" Window (13), wait for Fire to be pressed then jump ; to Main Game Loop *42378 CALL 45364 ; Load A with Current Character's Happiness Level... 42381 CP 20 ; ...and if this is less than 20... 42383 JP C,64275 ; ...then display "[Character] DOES NOT WANT THE [Object]" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 42386 LD A,(41937) ; Load A with index of Current Character 42389 LD HL,42413 ; Load HL with start address of Table of Start Addresses of Routines for Characters Having ; Objects Given 42392 JP 64623 ; Load HL with address of Current Character's "Give an Object" routine and jump to it ; Remove Current Object from Magic Knight's Inventory and Add it to a Character's then Return to Main Game Loop ; ; Used by the routines at #R42441, #R42479, #R42482, #R42485 and #R42488. Input: IX Address of first empty entry ; in a character's current inventory c42395 LD A,(41779) ; Load Current Object into first empty entry in character's current inventory... 42398 LD (IX+0),A ; ... 42401 LD C,A ; Load C with index of Current Object 42402 LD B,5 ; Load B with 5 (five inventory slots) 42404 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying)... 42407 CALL 48341 ; Remove Current Object from Magic Knight's current inventory (carrying) and tidy up remaining ; entries 42410 JP 41727 ; Show Magic Knight's current inventory and jump back to Main Game Loop ; Table of Start Addresses of Routines for Characters Having Objects Given b42413 DEFW 42429 ; Off-White Knight (bug) 42415 DEFW 42479 ; Aramis le Peux 42417 DEFW 42441 ; Robin of Shylock 42419 DEFW 42479 ; Reggie the Rat 42421 DEFW 42482 ; Rachel of Amazonia 42423 DEFW 42485 ; Barker the Ent 42425 DEFW 42485 ; Organon the Guard 42427 DEFW 42488 ; Grunter the Bearwoolf (bug) ; Give an Object Routine Off-White Knight ; ; Off-White will refuse to take the Brass Ankh (bug). c42429 LD A,(41779) ; If Current Object is 16 (Brass Ankh)... 42432 CP 16 ; ... 42434 JP Z,64275 ; ...then display "[Character] DOES NOT WANT THE [Object]" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 42437 JP 39875 ; Jump to non-existent address (bug) ; Unused b42440 DEFB 165 ; Give an Object Routine Robin of Shylock c42441 LD A,(41779) ; If Current Object is not 23 (Silver Arrow)... 42444 CP 23 ; ... 42446 JR NZ,42459 ; ...then skip ahead to #R42459 42448 LD A,(24795) ; Set Robin's Can Help Flag... 42451 OR 128 ; ... 42453 LD (24795),A ; ... 42456 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop *42459 CP 36 ; If Current Object is 36 (Golden Egg)... 42461 JR Z,42468 ; ...then skip ahead to #R42468 42463 CP 39 ; If Current Object is not 39 (Golden Egg)... 42465 JP NZ,42395 ; ...then remove Current Object from Magic Knight's inventory and add it to a character's then ; return to Main Game Loop *42468 LD A,(23439) ; Set Robin Has Been Paid Flag... 42471 OR 1 ; ... 42473 LD (23439),A ; ... 42476 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop ; Give an Object Routine Aramis le Peux and Reggie the Rat c42479 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop ; Give an Object Routine Rachel of Amazonia c42482 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop ; Give an Object Routine Barker the Ent and Organon the Guard c42485 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop ; Give an Object Routine Grunter the Bearwoolf c42488 JP 42395 ; Remove Current Object from Magic Knight's inventory and add it to a character's then return ; to Main Game Loop ; Unused routine ; ; Give an object routine. Input: This routine is related to a bug c42491 JP 45723 ; End the game if Current Character is Off-White or Grunter ; Display and Handle Main In-Game Menu (When Fire is Pressed) ; ; Used by the routine at #R38205. c42494 CALL 47930 ; Play downward scale sound 42497 CALL 46183 ; Set Magic Knight's available action flags 42500 LD BC,2048 ; Set B = 8 (eight action flags) and C = 0 (count of set flags) 42503 LD A,(23698) ; Load A with Available In-Game Menu Command Flags (part 1) *42506 RLCA ; Pop a bit into Carry Flag 42507 JR NC,42510 ; If Magic Knight action flag is not set then skip ahead to #R42510 to repeat loop for next ; flag... 42509 INC C ; ...else increase count of set flags *42510 DJNZ 42506 ; Loop back for next bit until all eight are done 42512 LD B,8 ; Set B = 8 (another eight action flags) 42514 LD A,(23699) ; Load A with Available In-Game Menu Command Flags (part 2) *42517 RLCA ; Pop a bit into Carry Flag 42518 JR NC,42521 ; If Magic Knight action flag is not set then skip ahead to #R42521 to repeat loop for next ; flag... 42520 INC C ; ...else increase count of set flags *42521 DJNZ 42517 ; Loop back for next bit until all eight are done 42523 LD A,8 ; Load A with 8 (as minimal command window has bottom y-coordinate of 8) 42525 ADD A,C ; Increase A by number of extra commands available 42526 LD C,A ; Load value back into C 42527 LD A,(49036) ; Load A with y-coordinate (characters) of top of menu window 42530 ADD A,C ; Update y-coordinate of bottom of window according to number of extra commands... 42531 LD (49037),A ; ... 42534 LD A,0 ; Display main in-game menu window (window number zero)... 42536 CALL 47185 ; ... 42539 LD HL,51434 ; Print "COMMANDS AVAILABLE:-" followed by first five commands (Pick up, drop, etc.) that are ; always available... 42542 CALL 46902 ; ... 42545 LD HL,51486 ; Point HL at zero immediately preceding list of conditional entry (Main in-Game Menu) texts 42548 LD A,(23698) ; Load A with Available In-Game Menu Command Flags (part 1) 42551 CALL 42616 ; Print currently available additional In-Game Menu command options (part 1) 42554 LD A,(23699) ; Load A with Available In-Game Menu Command Flags (part 2) 42557 CALL 42616 ; Print currently available additional In-Game Menu command options (part 2) 42560 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 42563 CP 5 ; If index of selected item is less than 5 (i.e. is a permanent, yellow entry)... 42565 JR C,42587 ; ...then skip ahead to #R42587 42567 SUB 4 ; Subtract 4 from index to get index within currently available conditional entries... 42569 LD B,A ; ...and load this value into B 42570 LD C,0 ; Load C with zero 42572 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. *42575 RR H ; Perform 16-bit rotation (right) through HL and into Carry Flag... 42577 RR L ; ...so that Carry Flag contains "current" Action Flag 42579 INC C ; Increase C (index of current Action Flag) 42580 JR NC,42575 ; If current Action Flag is not set then loop back to #R42575... 42582 DJNZ 42575 ; ...otherwise decrease B then loop back to #R42575 42584 LD A,C ; Load index of appropriate Action Flag into A 42585 ADD A,4 ; Add 4, to restore original index value (i.e. reverse of instruction at #R42567) ; 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 ; #R42587 and #R42595 is not necessary; see trivia. *42587 LD HL,48535 ; Point HL at List of Command Indices 42590 LD B,A ; Load index of selected command into B, setting C to zero... 42591 LD C,0 ; ... *42593 LD A,(HL) ; If current entry in List of Command Indices is the same as the index of the selected ; command... 42594 CP B ; ... 42595 JR Z,42601 ; ...then skip ahead to #R42601 42597 INC C ; Increase C (index of command index) 42598 INC HL ; Advance HL to next command index in list 42599 JR 42593 ; Loop back to #R42593 *42601 PUSH BC ; Store BC (B = selected command index, C = index of selected command index) 42602 CALL 47897 ; Play upward scale sound 42605 POP BC ; Restore BC (B = selected command index, C = index of selected command index) 42606 LD A,C ; Load index (of selected command index) into A... 42607 LD (23716),A ; ...and set as Current Command 42610 LD HL,48553 ; Point HL at start of Table of Command Routine Addresses 42613 JP 64623 ; 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 #R42494. Input: A Available In-Game Menu Command Flags (part 1 or part 2) HL Points to ; #R51486 if dealing with Flags part 1. Points to #R51527 if dealing with Flags part 2. c42616 LD B,8 ; Load B with 8 (as there are 8 flags) *42618 PUSH BC ; Store BC (B = remaining number of flags to process) 42619 RRCA ; Rotate least significant bit of A (i.e. current flag) into Carry Flag 42620 PUSH AF ; Store AF (current flag in Carry and remaining flags in A) 42621 CALL 63313 ; Advance HL to byte after first zero from address in HL onwards 42624 POP AF ; Restore AF (current flag in Carry and remaining flags in A) 42625 JR NC,42634 ; If current flag is reset then skip ahead to #R42634 42627 PUSH HL ; Store HL (current position in Additional Menu Items texts) 42628 PUSH AF ; Store AF (current flag in Carry and remaining flags in A) 42629 CALL 46902 ; Print text at HL (current additional menu item) 42632 POP AF ; Restore AF (current flag in Carry and remaining flags in A) 42633 POP HL ; Restore HL (current position in Additional Menu Items texts) *42634 POP BC ; Restore BC (B = remaining number of flags to process) 42635 DJNZ 42618 ; Decrease B and loop back to #R42618 for next flag 42637 RET ; Return ; Process Command to Examine Yourself / A Character / An Object c42638 CALL 63399 ; Print or update Command Summary Window at top of screen 42641 LD DE,52158 ; Point DE at "[Current Command] " text... 42644 CALL 63349 ; ...and print in Command Summary Window at top of screen 42647 LD A,16 ; Draw "EXAMINE WHAT?" Menu Window... 42649 CALL 47185 ; ... 42652 LD HL,52162 ; Point HL at "[Current Command] WHAT ?" menu text... 42655 CALL 46902 ; ...and print to screen 42658 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 42661 OR A ; If "OBJECT" selected... 42662 JP Z,42834 ; ...then skip ahead to #R42834 42665 CP 1 ; If "CHARACTER" selected... 42667 JP Z,42715 ; ...then skip ahead to #R42715 ; Examine Yourself 42670 LD DE,52521 ; Point DE at "YOURSELF " text... 42673 CALL 63349 ; ...and print in Command Summary Window at top of screen 42676 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 42679 LD A,18 ; Draw Window 18... 42681 CALL 47193 ; ... 42684 LD A,32 ; Set Current Character index to 32... 42686 LD (41937),A ; ...as index of "MAGIC KNIGHT" text is 32 relative to start of characters' names at #R58544 42689 LD HL,52311 ; Point HL at percentage completion text 42692 LD DE,52323 ; Point DE at time left text 42695 CALL 45522 ; Insert current time and score into "Time Left" and "Percentage Completion" texts 42698 LD HL,24768 ; Point HL at start of Magic Knight's Current Stats 42701 LD A,37 ; Set Graphic Index to 37... 42703 LD (42827),A ; ...and store as operand to instruction at #R42826 42706 LD A,(24846) ; Load Magic Knight's Attribute value into... 42709 LD (49193),A ; ...content attribute slot of Window 19 (EXAMINE Portrait Frame) 42712 JP 42763 ; Skip ahead to #R42763 (display window as in Examine Character) ; Examine Character *42715 LD HL,51408 ; Point HL at "[Current Command] ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 42718 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 42721 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 42724 JP Z,41742 ; If there are no characters in the room then set MK's available action flags and jump to start ; of Main Game Loop (#R41742) 42727 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 42730 LD A,5 ; Increase Current Character's happiness by 5... 42732 CALL 45434 ; ... 42735 LD A,18 ; Draw Window 18... 42737 CALL 47193 ; ... 42740 LD A,(41937) ; Load A with index of Current Character 42743 LD E,0 ; Point HL at start of character's stats... 42745 CALL 45406 ; ... 42748 PUSH HL ; Transfer address from HL... 42749 POP IX ; ...into IX 42751 LD A,(IX+5) ; Load Character Graphic Index into A... 42754 LD (42827),A ; ...and modify operand of instruction at #R42826 to match 42757 LD A,(IX+4) ; Load character's Attribute value into... 42760 LD (49193),A ; ...content attribute slot of Window 19 (EXAMINE Portrait Frame) *42763 CALL 42938 ; Insert numeric stats (at HL) of a character into "EXAMINE CHARACTER" window text 42766 PUSH HL ; Store HL (points to start of character's current stats) 42767 LD HL,52180 ; Print Examine Character window text (i.e. "EXAMINE [CHARACTER] ... STRENGTH XX..." text)... 42770 CALL 46902 ; ... 42773 POP IX ; Restore IX (points to start of character's current stats) 42775 LD B,10 ; Load B with 10 (index of "[Current Character's short name] IS ASLEEP" text) 42777 BIT 7,(IX+6) ; If character's Asleep Flag is set... 42781 JR NZ,42786 ; ...then skip ahead to #R42786 42783 LD B,(IX+7) ; Load B with index of character's Current Status Text *42786 LD A,(41937) ; If Current Character index is not 32 (Magic Knight, i.e. EXAMINE YOURSELF)... 42789 CP 32 ; ... 42791 JR NZ,42795 ; ...then skip ahead to #R42795 42793 LD B,1 ; Load B with 1 (index of Magic Knight's current status text) *42795 RES 7,B ; Reset Bit 7 of status text index (see trivia) 42797 LD HL,52301 ; Point HL at start of characters' "current status" texts 42800 CALL 63335 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL... 42803 CALL 46902 ; ...and print 42806 LD A,(42827) ; If Character Graphic Index is zero... 42809 OR A ; ... 42810 JR Z,42831 ; ...then skip ahead to #R42831 42812 LD A,19 ; Draw Window 19 (EXAMINE Portrait Frame)... 42814 CALL 47193 ; ... 42817 LD BC,(23408) ; Load BC with top-left coordinate of current window 42821 LD A,71 ; Load ATTR T system variable with 71 (white INK, black PAPER, BRIGHT)... 42823 LD (23695),A ; ... ; The operand of the instruction at #R42826 represents the Character's Graphic Index. This is modified by the ; instructions at #R42703 and #R42754. 42826 LD A,0 ; Load A with character's Graphic Index... 42828 CALL 63504 ; ...and draw this graphic at character coordinates (C, B) with width = 2 characters and height ; = 4 characters *42831 JP 41739 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Examine Object *42834 CALL 45641 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 42837 JP Z,41742 ; If MK's inventory (carrying) is empty then set his available action flags and jump to start ; of Main Game Loop (#R41742) 42840 LD A,15 ; Set bottom edge of Window 20 to 15... 42842 LD (49197),A ; ... 42845 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 42849 LD B,5 ; Load B with 5 (five inventory slots) 42851 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 42854 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 42857 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 42860 LD HL,24848 ; Point HL at start of Characters' Current Inventories Table 42863 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 42866 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 42869 LD A,(41779) ; Load A with index of Current Object... 42872 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 42875 LD E,0 ; Point HL to the start of the Current Object's record in Object Properties Table... 42877 CALL 45390 ; ... 42880 PUSH HL ; Store HL (pointer to Current Object's properties) 42881 CALL 43000 ; Insert numeric / text properties of the object into "Examine Object" Window Text 42884 LD A,20 ; Draw Window 20 ("EXAMINE OBJECT" Window)... 42886 CALL 47193 ; ... 42889 LD HL,52251 ; Point HL at "      [Current Command]" text 42892 CALL 46902 ; ...and print to screen 42895 LD A,(41779) ; Load B with index of Current Object... 42898 LD B,A ; ... 42899 CALL 63332 ; ...and point HL at its entry in Table of Object Names 42902 CALL 46902 ; Print the Current Object's name 42905 LD HL,52256 ; Point HL at Object Properties text... 42908 CALL 46902 ; ...and print to screen 42911 POP IX ; Restore IX (pointer to Current Object's properties) 42913 LD A,(IX+6) ; Set content attribute of Window 21 (frame around object in "EXAMINE OBJECT" Window)... 42916 LD (49209),A ; ...to match attribute of object 42919 LD A,21 ; Draw Window 21... 42921 CALL 47193 ; ... 42924 LD BC,(23408) ; Load BC with top-left coordinate of current window 42928 INC B ; Increase y-coordinate by 1 (as object positions are based upon their bottom-left corner) 42929 LD A,(41779) ; Load A with index of Current Object 42932 CALL 48191 ; Set Terrain Interaction Data for character blocks spanned by object and draw the object 42935 JP 41739 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop ; Insert Numeric Stats (at HL) of a Character into "Examine Character" Window Text ; ; Used by the routine at #R42638. Input: HL Address of start of a character's current stats c42938 PUSH HL ; Store HL (address of start of character's stats) 42939 LD A,(HL) ; Load character's Strength into A... 42940 AND 127 ; ...and remove bit 7 (unused) 42942 PUSH HL ; Store HL (Strength position in character's stats) 42943 LD HL,52187 ; Point HL at start of " 99 " segment for Strength in Character's Stats Text at #R52180 42946 CALL 46837 ; Splice numeric Strength data as a string into Character's Stats Text 42949 POP HL ; Restore HL (Strength position in character's stats) 42950 INC HL ; Advance HL to Happiness position 42951 LD A,(HL) ; Load character's Happiness into A... 42952 AND 127 ; ...and remove bit 7 (unused) 42954 PUSH HL ; Store HL (Happiness position in character's stats) 42955 LD HL,52203 ; Point HL at start of " 99 " segment for Happiness in Character's Stats Text at #R52180 42958 CALL 46837 ; Splice numeric Happiness data as a string into Character's Stats Text 42961 POP HL ; Restore HL (Happiness position in character's stats) 42962 INC HL ; Advance HL to Stamina position 42963 LD A,(HL) ; Load character's Stamina into A... 42964 AND 127 ; ...and remove bit 7 (unused) 42966 PUSH HL ; Store HL (Stamina position in character's stats) 42967 LD HL,52217 ; Point HL at start of " 99 " segment for Stamina in Character's Stats Text at #R52180 42970 CALL 46837 ; Splice numeric Stamina data as a string into Character's Stats Text 42973 POP HL ; Restore HL (Stamina position in character's stats) 42974 INC HL ; Advance HL to Magic Level position 42975 LD A,(HL) ; Load character's Magic Level into A... 42976 AND 127 ; ...and remove bit 7 (Can Help Flag) 42978 PUSH HL ; Store HL (Magic Level position in character's stats) 42979 LD HL,52229 ; Point HL at start of " 99 " segment for Magic Level in Character's Stats Text at #R52180 42982 CALL 46837 ; Splice numeric Magic Level data as a string into Character's Stats Text 42985 POP HL ; Restore HL (Magic Level position in character's stats) 42986 INC HL ; Advance HL to Food Level position... 42987 INC HL ; ... 42988 INC HL ; ... 42989 LD A,(HL) ; Load character's Food Level into A... 42990 AND 127 ; ...and remove bit 7 (Asleep Flag) 42992 LD HL,52245 ; Point HL at start of " 99 " segment for Magic Level in Character's Stats Text at #R52180 42995 CALL 46837 ; Splice numeric Magic Level data as a string into Character's Stats Text 42998 POP HL ; Restore HL (address of start of character's stats) 42999 RET ; Return ; Insert Numeric / Text Stats of an Object into "Examine Object" Window Text ; ; Used by the routine at #R42638. Input: HL Address of start of an object's properties c43000 LD A,(HL) ; Load A with weight of the object... 43001 AND 15 ; ...stripping out flag values 43003 PUSH HL ; Store HL (address of start of object's properties) 43004 LD HL,52267 ; Point HL at numeric part of "WEIGHT" string... 43007 CALL 46837 ; ...and overwrite with weight value 43010 POP HL ; Restore HL (address of start of object's properties) 43011 LD A,147 ; Load A with (Common Word Index for text "YES") 43013 BIT 6,(HL) ; If Can Blow Flag is set... 43015 JR NZ,43018 ; ...then skip ahead to #R43018 43017 INC A ; Increase A to 148 (Common Word Index for text "NO") *43018 LD (52279),A ; Insert Common Word Index in A into the "BLOW" field of the string 43021 LD A,147 ; Load A with (Common Word Index for text "YES") 43023 BIT 5,(HL) ; If Can Read Flag is set... 43025 JR NZ,43028 ; ...then skip ahead to #R43028 43027 INC A ; Increase A to 148 (Common Word Index for text "NO") *43028 LD (52288),A ; Insert Common Word Index in A into the "READ" field of the string 43031 INC HL ; Advance HL to second byte in record 43032 LD A,147 ; Load A with (Common Word Index for text "YES") 43034 BIT 3,(HL) ; If Can Be Worn Flag is set... 43036 JR NZ,43039 ; ...then skip ahead to #R43039 43038 INC A ; Increase A to 148 (Common Word Index for text "NO") *43039 LD (52297),A ; Insert Common Word Index in A into the "WEAR" field of the string 43042 RET ; Return ; Process Command to Command a Character c43043 LD HL,51408 ; Point HL at "[Current Command] ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 43046 LD DE,52523 ; Point DE (Command Summary Text Pointer) at "COMMAND " text 43049 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 43052 JP Z,41742 ; If there are no characters in the room then set MK's available action flags and jump to start ; of Main Game Loop (#R41742) 43055 LD DE,52105 ; Point DE at " TO " text... 43058 CALL 63349 ; ...and print in Command Summary Window at top of screen 43061 LD A,23 ; Draw "WHICH COMMAND DO YOU WANT TO USE?" Menu Window... 43063 CALL 47185 ; ... 43066 LD HL,52526 ; Print "WHICH COMMAND DO YOU WANT TO USE" Menu text... 43069 CALL 46902 ; ... 43072 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 43075 LD (43098),A ; Load index of selected command into operand of instruction at #R43097... 43078 LD B,A ; ...and into B 43079 CALL 63327 ; Point HL at start of B-th entry in list of "COMMAND A CHARACTER" commands at #R52590 43082 EX DE,HL ; Swap HL and DE (Command Summary Text Pointer, now at selected command string) 43083 CALL 63349 ; Print text at DE in Command Summary Window at top of screen 43086 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 43089 CALL 45723 ; End the game if Current Character is Off-White or Grunter 43092 LD A,2 ; Increase Current Character's happiness by 2 (see trivia)... 43094 CALL 45434 ; ... ; The operand of the instruction at #R43097 is the index of the currently selected command from the "COMMAND A ; CHARACTER TO" menu. This is modified by the instruction at #R43075. 43097 LD A,0 ; Load A with index of selected "COMMAND A CHARACTER TO" command 43099 LD HL,43105 ; Point HL at start of Table of "Command a Character" Routine Addresses 43102 JP 64623 ; 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 b43105 DEFW 43117 ; Send Current Character to Sleep if Possible 43107 DEFW 43158 ; Wake Current Character Up if Possible 43109 DEFW 43199 ; Make Current Character Go Away if Possible 43111 DEFW 43250 ; Have a Character Help if Possible 43113 DEFW 43318 ; Make Current Character Eat & Drink if Possible 43115 DEFW 43428 ; Make Current Character Be Happy if Possible ; Send Current Character to Sleep if Possible c43117 CALL 45411 ; Point IX at Current Character's current stats 43120 BIT 7,(IX+6) ; If character's Asleep Flag is set then reset Zero Flag 43124 LD HL,52655 ; Point HL at "[Current Character's short name] IS ALREADY ASLEEP" text 43127 JP NZ,64313 ; If character is asleep then display "[Character] IS ALREADY ASLEEP" window (29), wait for ; Fire to be pressed then jump to Main Game Loop 43130 LD A,(IX+2) ; If character's stamina is 70 or more... 43133 AND 127 ; ... 43135 CP 70 ; ...then reset Carry Flag, otherwise set it 43137 LD HL,52668 ; Point HL at "[Current Character's short name] IS TOO WAKEFUL TO SLEEP" text 43140 JP NC,64313 ; If Carry Flag is reset then display "[Character] IS TOO WAKEFUL TO SLEEP" window (29), wait ; for Fire to be pressed then jump to Main Game Loop 43143 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... 43145 CALL 45423 ; ... 43148 SET 7,(IX+6) ; Set character's Asleep Flag 43152 LD HL,52691 ; Point HL at "[Current Character's short name] HAS GONE TO SLEEP" text 43155 JP 64313 ; 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 c43158 CALL 45411 ; Point IX at Current Character's current stats 43161 BIT 7,(IX+6) ; If character's Asleep Flag is set then reset Zero Flag 43165 LD HL,52707 ; Point HL at "[Current Character's short name] IS ALREADY AWAKE" text 43168 JP Z,64313 ; If character is awake then display "[Character] IS ALREADY AWAKE" Window (29), wait for Fire ; to be pressed then jump to Main Game Loop 43171 LD A,(IX+2) ; If character's stamina is less than 30... 43174 AND 127 ; ... 43176 CP 30 ; ...then set Carry Flag, otherwise reset it 43178 LD HL,52719 ; Point HL at "[Current Character's short name] IS TOO TIRED TO WAKE UP" text 43181 JP C,64313 ; If Carry Flag is set then display "[Character] IS TOO TIRED TO WAKE UP" window (29), wait for ; Fire to be pressed then jump to Main Game Loop 43184 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... 43186 CALL 45423 ; ... 43189 RES 7,(IX+6) ; Reset character's Asleep Flag 43193 LD HL,52731 ; Point HL at "[Current Character's short name] HAS WOKEN UP" text 43196 JP 64313 ; Display "[Character] HAS WOKEN UP" Window (29), wait for Fire to be pressed then jump to Main ; Game Loop ; Make Current Character Go Away if Possible c43199 LD A,(41937) ; If index of Current Character is 6 (Organon the Guard)... 43202 CP 6 ; ...then set Zero Flag, otherwise reset 43204 LD HL,56124 ; Point HL at "[Current Character's short name] SAYS 'I THINK YOU ARE THE ONE..." text 43207 JP Z,64293 ; If Current Character is Organon then display "I THINK YOU ARE THE ONE..." Window (15), wait ; for Fire to be pressed then jump to Main Game Loop 43210 LD A,253 ; Decrease Current Character's happiness by 3... 43212 CALL 45434 ; ... 43215 CALL 45552 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 43218 CALL 45411 ; Point IX at Current Character's current stats 43221 LD A,(IX+2) ; If character's stamina is less than 20... 43224 AND 127 ; ... 43226 CP 20 ; ...then set Carry Flag, otherwise reset it 43228 LD HL,52744 ; Point HL at "[Current Character's short name] IS TOO TIRED TO GO AWAY" text 43231 JP C,64313 ; If Carry Flag is set then display "[Character] IS TOO TIRED TO GO AWAY" window (29), wait for ; Fire to be pressed then jump to Main Game Loop 43234 LD B,20 ; If character's happiness is less than 20 then Show "[Character] DOES NOT WANT TO BE ; COMMANDED..." and Jump to Main Game Loop... 43236 CALL 45423 ; ... 43239 CALL 45601 ; Point HL at current position data for Current Character 43242 LD (HL),99 ; Change current room number for Current Character to 99 43244 LD HL,52756 ; Point HL at "[Current Character's short name] HAS GONE AWAY" text 43247 JP 64313 ; Display "[Character] HAS GONE AWAY" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; Have a Character Help if Possible c43250 CALL 45552 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 43253 LD A,32 ; Set last character in "[Current Character's short name] CANNOT HELP YOU  " text at #R52770... 43255 LD (52779),A ; ...to 32 (SPACE) (see trivia) 43258 LD A,(41937) ; If index of Current Character is 7 (Grunter the Bearwoolf)... 43261 CP 7 ; ... 43263 JR Z,43293 ; ...then skip ahead to #R43293 43265 CALL 45411 ; Point IX at Current Character's current stats 43268 BIT 7,(IX+3) ; If character's Can Help Flag is reset... 43272 JP Z,64285 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then ; jump to Main Game Loop 43275 LD A,(IX+2) ; If character's stamina is less than 10... 43278 AND 127 ; ... 43280 CP 10 ; ...the set Carry Flag, otherwise reset 43282 LD HL,52781 ; Point HL at "[Current Character's short name] IS TOO TIRED TO HELP YOU " text 43285 JP C,64313 ; ...then display "[Character] IS TOO TIRED TO HELP YOU" Window (29), wait for Fire to be ; pressed then jump to Main Game Loop 43288 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... 43290 CALL 45423 ; ... *43293 LD A,(41937) ; Load A with index of Current Character 43296 LD HL,43302 ; Point HL at start of Table of Addressed of Characters' Help Routines 43299 JP 64623 ; 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 b43302 DEFW 45224 ; Off-White Knight 43304 DEFW 45227 ; Aramis le Peux 43306 DEFW 45256 ; Robin of Shylock 43308 DEFW 45333 ; Reggie the Rat 43310 DEFW 45336 ; Rachel of Amazonia 43312 DEFW 45342 ; Barker the Ent 43314 DEFW 45345 ; Organon the Guard 43316 DEFW 45348 ; Grunter the Bearwoolf ; Make Current Character Eat & Drink if Possible c43318 CALL 45552 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 43321 LD A,(41937) ; Load A with index of Current Character 43324 LD E,0 ; Point HL at character's current strength... 43326 CALL 45406 ; ... 43329 PUSH HL ; Transfer address from HL... 43330 POP IX ; ...into IX 43332 LD A,(IX+6) ; Load A with character's food level stripping out Asleep Flag... 43335 AND 127 ; ...and set Zero Flag if food level is zero 43337 LD HL,52788 ; Point HL at "[Current Character's short name] HAS NO FOOD LEFT" text 43340 JP Z,64313 ; If Zero Flag is set then display "[Character] HAS NO FOOD LEFT" window (29), wait for Fire to ; be pressed then jump to Main Game Loop 43343 LD A,(IX+2) ; If character's stamina is less than 20... 43346 CP 20 ; ...then set Carry Flag 43348 LD HL,52804 ; Point HL at "[Current Character's short name] IS TOO TIRED TO EAT OR DRINK" text 43351 JP C,64313 ; If Carry Flag is set then display "[Character] IS TOO TIRED TO EAT OR DRINK" window (29), ; wait for Fire to be pressed then jump to Main Game Loop 43354 LD A,(IX+1) ; If character's happiness is less than 30... 43357 CP 30 ; ... 43359 JP C,64280 ; ...then display "[Character] DOES NOT WANT TO BE COMMANDED BY YOU" Window (29), wait for Fire ; to be pressed then Jump to Main Game Loop 43362 LD A,(IX+6) ; Load A with character's Asleep Flag... 43365 AND 128 ; ... 43367 LD (43407),A ; ...and store in operand of instruction at #R43406 43370 RES 7,(IX+6) ; Reset character's Asleep Flag 43374 LD A,(IX+0) ; Load A with character's unused flag... 43377 AND 128 ; ... 43379 LD (43415),A ; ...and store in operand of instruction at #R43414 43382 RES 7,(IX+0) ; Reset character's unused flag *43386 LD A,(IX+0) ; If character's strength is 100... 43389 CP 100 ; ... 43391 JP Z,43406 ; ...then skip ahead to #R43406 43394 DEC (IX+6) ; Decrease character's food level by one 43397 INC (IX+0) ; Increase character's strength by one 43400 LD A,(IX+6) ; If character's food level is not zero... 43403 OR A ; ... 43404 JR NZ,43386 ; ...then loop back to #R43386 ; The operand of the instruction at #R43406 represents the character's Asleep Flag (128 for asleep or 0 for awake). ; This is modified by the instruction at #R43367. *43406 LD A,0 ; Load A with Asleep Flag value... 43408 OR (IX+6) ; ...merge with food level... 43411 LD (IX+6),A ; ...and store ; The operand of the instruction at #R43414 represents the character's unused flag (bit 7 of strength). This is ; modified by the instruction at #R43379. 43414 LD A,0 ; Load A with unused flag value... 43416 OR (IX+0) ; ...merge with strength... 43419 LD (IX+0),A ; ...and store 43422 LD HL,52817 ; Point HL at "[Current Character's short name] HAS TAKEN REFRESHMENT" text 43425 JP 64313 ; Display "[Character] HAS TAKEN REFRESHMENT" window (29), wait for Fire to be pressed then ; jump to Main Game Loop ; Make Current Character Be Happy if Possible c43428 CALL 45552 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 43431 LD A,(41937) ; Load A with index of Current Character 43434 LD E,0 ; Point HL at start of character's current stats... 43436 CALL 45406 ; ... 43439 PUSH HL ; Transfer address from HL... 43440 POP IX ; ...into IX 43442 LD A,(IX+2) ; If character's stamina is less than 30... 43445 CP 30 ; ...then set Carry Flag 43447 LD HL,52836 ; Point HL at "[Current Character's short name] IS TOO TIRED TO BE HAPPY" text 43450 JP C,64313 ; If Carry Flag is set then display "[Character] IS TOO TIRED TO BE HAPPY" window (29), wait ; for Fire to be pressed then jump to Main Game Loop 43453 LD A,(IX+1) ; If character's happiness is less than 5... 43456 CP 5 ; ... 43458 JP C,64280 ; ...then display "[Character] DOES NOT WANT TO BE COMMANDED BY YOU" Window (29), wait for Fire ; to be pressed then jump to Main Game Loop 43461 LD A,(41937) ; Load DE with index of Current Character... 43464 LD E,A ; ... 43465 LD D,0 ; ... 43467 LD HL,43486 ; Load HL with start address of Table of Characters' Default Happiness Levels... 43470 ADD HL,DE ; ...and add DE as offset 43471 LD A,(IX+1) ; Load A with character's current happiness... 43474 AND 128 ; ...and reset all but Bit 7 (unused) 43476 OR (HL) ; Add in character's default happiness... 43477 LD (IX+1),A ; ...and set as character's current happiness 43480 LD HL,52845 ; Point HL at "[Current Character's short name] WILL TRY TO BE HAPPY" text 43483 JP 64313 ; Display "[Character] WILL TRY TO BE HAPPY" window (29), wait for Fire to be pressed then jump ; to Main Game Loop ; Table of Characters' Default Happiness Levels ; ; (See trivia) b43486 DEFB 100 ; Off-White Knight 43487 DEFB 70 ; Aramis le Peux 43488 DEFB 80 ; Robin of Shylock 43489 DEFB 40 ; Reggie the Rat 43490 DEFB 50 ; Rachel of Amazonia 43491 DEFB 98 ; Barker the Ent 43492 DEFB 90 ; Organon the Guard 43493 DEFB 0 ; Grunter the Bearwoolf ; Process Command to Read an Object c43494 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 43498 LD B,5 ; Load B with 5 (five inventory slots) 43500 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 43503 LD DE,51928 ; Point DE at "[Current Command] THE " text 43506 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 43509 LD HL,24848 ; Point IX at Magic Knight's current inventory (carrying) 43512 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 43515 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 43518 LD A,(41779) ; Load A with index of Current Object... 43521 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 43524 CP 24 ; If Current Object is the Instruction Book (24)... 43526 JP Z,43624 ; ...then skip ahead to #R43624 43529 CP 21 ; If Current Object is the Gadget X (21)... 43531 JP Z,43630 ; ...then skip ahead to #R43630 43534 LD A,2 ; If Magic Knight is not carrying the Crystal Ball (2)... 43536 CALL 45510 ; ... 43539 JR NZ,43592 ; ...then skip ahead to #R43592 43541 LD A,(41779) ; Load A with index of Current Object... 43544 LD B,21 ; Load B with 21 (index of read-text for Wand of Command with Crystal Ball) 43546 CP 3 ; If Current Object is the Wand of Command (3)... 43548 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43550 LD B,23 ; Load B with 23 (index of read-text for Magic Talisman with Crystal Ball) 43552 CP 6 ; If Current Object is the Magic Talisman (6)... 43554 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43556 LD B,24 ; Load B with 24 (index of read-text for Glow Shield with Crystal Ball) 43558 CP 12 ; If Current Object is the Glow Shield (12)... 43560 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43562 LD B,25 ; Load B with 25 (index of read-text for Boomerang with Crystal Ball) 43564 CP 14 ; If Current Object is the Boomerang (14)... 43566 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43568 LD B,3 ; Load B with 3 (index of read-text for unreadable magic language) (see trivia) 43570 CP 15 ; If Current Object is the Sword (15)... 43572 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43574 LD B,27 ; Load B with 27 (index of read-text for Brass Ankh with Crystal Ball) 43576 CP 16 ; If Current Object is the Brass Ankh (16)... 43578 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43580 LD B,28 ; Load B with 28 (index of read-text for Elf-Horn with Crystal Ball) 43582 CP 22 ; If Current Object is the Elf-Horn (22)... 43584 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) 43586 LD B,29 ; Load B with 29 (index of read-text for Silver Arrow with Crystal Ball) 43588 CP 23 ; If Current Object is the Silver Arrow (23)... 43590 JR Z,43617 ; ...then skip ahead to #R43617 (display text with index B) *43592 LD A,(41779) ; Load A with index of Current Object... 43595 LD E,0 ; Point HL at start of record for object with index A in Object Properties Table... 43597 CALL 45390 ; ... 43600 BIT 5,(HL) ; If Can Read Flag is set... 43602 JR NZ,43610 ; ...then skip ahead to #R43610 43604 LD HL,52859 ; Point HL at "THERE IS NO WRITING FOR ME TO [Current Command]" text 43607 JP 64297 ; Display "THERE IS NO WRITING FOR ME TO [Current Command]" Window (12), wait for Fire to be ; pressed then jump to Main Game Loop *43610 INC HL ; Advance HL to read-text index for object... 43611 INC HL ; ... 43612 INC HL ; ... 43613 LD A,(HL) ; ...and load into A 43614 AND 31 ; Clear bits 5, 6 and 7... 43616 LD B,A ; ...and load index into B ; At this point, B holds the index of the read-text to print *43617 CALL 63322 ; Point HL at start of B-th entry in List of Read-Texts of Readable Objects 43620 CALL 64317 ; Display Window 02 with object's read-text, wait for Fire to be pressed then jump to Main Game ; Loop... ; Data block at 43623 b43623 DEFB 2 ; ... ; Routine at 43624 ; ; Used by the routine at #R43494. c43624 CALL 37951 ; Display Instructions windows 43627 JP 41742 ; Set Magic Knight's available action flags and jump to start of Main Game Loop ; This entry point is used by the routine at #R43494. *43630 CALL 37764 ; Display and handle Gadget X Menu 43633 JP 41742 ; Set Magic Knight's available action flags and jump to start of Main Game Loop ; Process Command to Throw an Object c43636 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 43640 LD B,5 ; Load B with 5 (five inventory slots) 43642 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 43645 LD DE,51928 ; Point DE at "[Current Command] THE " text 43648 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 43651 LD HL,24848 ; Point HL at Magic Knight's current inventory (carrying) 43654 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 43657 LD DE,55959 ; Point DE at " AT " text... 43660 CALL 63349 ; ...and print in Command Summary Window at top of screen 43663 LD HL,51418 ; Point HL at "THROW AN OBJECT AT ?" text 43666 LD DE,0 ; Load DE with zero (i.e. no Command Summary Text) 43669 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 43672 JP Z,41742 ; If there are no characters in the room then set his available action flags and jump to start ; of Main Game Loop (#R41742) 43675 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 43678 LD A,(41779) ; Load A with index of Current Object... 43681 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 43684 LD HL,51933 ; Point HL at "THE [name of Current Object] BLEW UP..." text 43687 CP 5 ; If Current Object is the Stick of Dynamite (5)... 43689 JP Z,64582 ; ...then jump to "Game over" window routine and return to Control Selection Menu 43692 CP 14 ; If Current Object is the Boomerang (14)... 43694 JP Z,43868 ; ...then skip ahead to #R43868 (Game Over) 43697 CP 25 ; If Current Object is not the Magic Missile (25)... 43699 JR NZ,43715 ; ...then skip ahead to #R43715 43701 LD A,(41937) ; If Current Character is not Off-White Knight (0)... 43704 OR A ; ... 43705 JR NZ,43712 ; ...then skip ahead to #R43712 43707 LD A,255 ; Set Off-White Knight Sent To Sleep Flag to 255... 43709 LD (23403),A ; ... *43712 LD A,(41779) ; Load A with index of Current Object... *43715 LD E,0 ; Point HL to the start of the Current Object's record in Object Properties Table... 43717 CALL 45390 ; ... 43720 PUSH HL ; Copy address into IX... 43721 POP IX ; ... 43723 LD A,(IX+0) ; Load A with Current Object's weight... 43726 AND 15 ; ... 43728 CP 12 ; ...and if this is 12 or greater... 43730 JP NC,43856 ; ...then skip ahead to #R43856 (Game Over) 43733 BIT 6,(IX+1) ; If Current Object's Is Lethal if Thrown Flag is set... 43737 JP NZ,43862 ; ...then skip ahead to #R43862 43740 LD A,(41779) ; Load C with index of Current Object... 43743 LD C,A ; ... 43744 LD B,5 ; Load B with 5 (five inventory slots) 43746 LD HL,24848 ; Point IX at Magic Knight's current inventory (carrying) 43749 CALL 48341 ; Remove object C from Magic Knight's current inventory (carrying) 43752 LD A,(41779) ; Load C with index of Current Object... 43755 LD C,A ; ... 43756 CP 20 ; If Current Object is the Mirror (20)... 43758 CALL Z,41915 ; ...then load C with 7 (index of Broken Glass) 43761 CP 17 ; If Current Object is Bottle of Liquid (17)... 43763 CALL Z,41918 ; ...then load C with 8 (index of Broken Glass) 43766 CP 18 ; If Current Object is Bottle of Liquid (18)... 43768 CALL Z,41921 ; ...then load C with 9 (index of Broken Glass) 43771 CP 28 ; If Current Object is Empty Bottle (28)... 43773 CALL Z,41918 ; ...then load C with 8 (index of Broken Glass) 43776 CP 29 ; If Current Object is Empty Bottle (29)... 43778 CALL Z,41921 ; ...then load C with 9 (index of Broken Glass) 43781 LD A,C ; Load BC with three times index of Current Object... 43782 ADD A,A ; ... 43783 ADD A,C ; ... 43784 LD C,A ; ... 43785 LD B,0 ; ... 43787 LD HL,24922 ; Point HL at start of Objects' Current Positions Table at #R24922 43790 ADD HL,BC ; Add three times Current Object's index as offset to point HL at position data of current ; object 43791 LD A,(23702) ; Set object's room to be Magic Knight's current room... 43794 LD (HL),A ; ... 43795 INC HL ; Advance HL to object's x-coordinate 43796 PUSH HL ; Store HL (pointer to x-coordinate) 43797 LD A,(41937) ; Load BC with three times index of character who was target of throw... 43800 LD C,A ; ... 43801 ADD A,A ; ... 43802 ADD A,C ; ... 43803 LD B,0 ; ... 43805 LD C,A ; ... 43806 LD HL,24899 ; Point HL at x-coordinate of first entry in characters' current positions table 43809 ADD HL,BC ; Add BC (three times character index) as offset 43810 EX DE,HL ; Swap DE (now pointer to Current Character's x-coordinate) and HL (now undefined) 43811 POP HL ; Restore HL (pointer to object's x-coordinate) 43812 LD A,(DE) ; Copy character's x-coordinate... 43813 LD (HL),A ; ...into object's x-coordinate 43814 INC DE ; Advance to character's y-coordinate 43815 INC HL ; Advance to object's y-coordinate 43816 LD A,(DE) ; Copy character's y-coordinate plus three... 43817 ADD A,3 ; ... 43819 LD (HL),A ; ...into object's y-coordinate 43820 CALL 46183 ; Set Magic Knight's available action flags 43823 LD A,(41779) ; Load A with index of Current Object 43826 CP 25 ; If Current Object is the Magic Missile (25)... 43828 JR Z,43840 ; ...then skip ahead to #R43840 43830 CP 20 ; If Current Object is not the Mirror (20)... 43832 JR NZ,43850 ; ...then skip ahead to #R43850 43834 LD HL,55986 ; Point HL at "THE [object] LANDED ON THE FLOOR BY [character] AND SMASHED..." text (see ; trivia) 43837 JP 64293 ; Display Smashed Object Window (15), wait for Fire to be pressed then jump to Main Game Loop ; Magic Missile thrown *43840 LD A,(41937) ; Load A with index of Current Character 43843 LD E,6 ; Point HL at character's Flags... 43845 CALL 45406 ; ... 43848 SET 7,(HL) ; ...and set Asleep Flag *43850 LD HL,55964 ; Point HL at "THE [object] LANDED ON THE FLOOR BY [character]" text 43853 JP 64293 ; Display "THE [object] LANDED ON THE FLOOR BY [character]" Window (15), wait for Fire to be ; pressed then jump to Main Game Loop ; Weight of 12 or more *43856 LD HL,50845 ; Point HL at "YOU KILLED YOURSELF TRYING TO THROW..." text 43859 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Lethal if thrown *43862 LD HL,50864 ; Point HL at "YOU THREW THE [Object] AND KILLED [Character]" text 43865 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Boomerang *43868 LD HL,56035 ; Point HL at thrown Boomerang Game Over text 43871 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Process Command to Cast a Spell c43874 LD B,5 ; Print or update Command Summary Window at top of screen... 43876 CALL 45206 ; ...with "CAST A SPELL" text 43879 LD HL,55513 ; Point HL at "WHICH SPELL DO YOU WANT TO [Current Command] ?" full menu text 43882 LD DE,49276 ; Adjust height of window 30 to accommodate text... 43885 CALL 45617 ; ... 43888 PUSH HL ; Store HL (pointer to menu text to print) 43889 LD A,30 ; Draw Menu Window 30... 43891 CALL 47185 ; ... 43894 POP HL ; Restore HL (pointer to menu text to print) 43895 CALL 46902 ; Print text to screen 43898 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 43901 LD (43929),A ; Store index of spell selected in this routine at #R43928 43904 CP 4 ; If selected spell is 4 (TRAVEL TO PERSON)... 43906 JR Z,43928 ; ...then skip ahead to #R43928 43908 CALL 63399 ; Print or update Command Summary Window at top of screen 43911 LD HL,55926 ; Point HL at "CAST DIMENSION MERGE" text (i.e. first in list of "CAST [SPELL]" strings) 43914 LD A,(43929) ; Load index of spell selected into B... 43917 LD B,A ; ... 43918 CALL 63335 ; ...and advance HL to relevant "CAST [SPELL]" string 43921 EX DE,HL ; Swap DE (now points to "CAST [SPELL]" text) and HL... 43922 CALL 63349 ; ...and print in Command Summary Window at top of screen 43925 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop ; The operand of the instruction at #R43928 represents the index of the selected spell. This is modified by the ; instruction at #R43901. *43928 LD A,0 ; Load A with index of selected spell 43930 LD HL,43936 ; Point HL at Table of Cast a Spell Routine Addresses 43933 JP 64623 ; Load HL with address of appropriate Cast a Spell Routine and jump to it ; Table of Cast a Spell Routine Addresses b43936 DEFW 43950 ; Dimension Merge 43938 DEFW 43998 ; Melt Granite 43940 DEFW 44001 ; Pass Plant 43942 DEFW 44063 ; Spell of Wonder 43944 DEFW 44100 ; Travel to Person 43946 DEFW 44198 ; Magic Fulcrum 43948 DEFW 44216 ; Quiticus Gamus ; Cast Dimension Merge if Possible, else Display Failure Message c43950 LD A,(23438) ; If Current Disquise is not zero... 43953 OR A ; ...i.e. a disquise is being worn... 43954 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 43957 LD HL,24898 ; Load HL with address of Off-White Knight's current position data 43960 LD A,(23702) ; If Magic Knight's current room is not the same as Off-White Knight's... 43963 CP (HL) ; ... 43964 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 43967 LD A,(24840) ; If Magic Knight's current x-coordinate (characters)... 43970 RRCA ; ... 43971 RRCA ; ... 43972 RRCA ; ... 43973 AND 31 ; ... 43975 INC HL ; ... 43976 CP (HL) ; ...is not the same as Off-White Knight's... 43977 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 43980 LD A,(23403) ; If Off-White Knight Sent To Sleep Flag is zero... 43983 OR A ; ...i.e. Off-White has not yet been sent to sleep... 43984 JP Z,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 43987 LD C,99 ; If Magic Knight's magic level is at least 99... 43989 CALL 44225 ; ...then flash border and screen and decrease Magic Knight's magic level by 99... 43992 JP C,64290 ; ...otherwise display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for ; Fire to be pressed then jump to Main Game Loop 43995 JP 44253 ; Show "WELL DONE" screen, jumping to Game Over when Fire is pressed ; Display Failure Message (When Attempting to Cast Melt Granite) ; ; See trivia c43998 JP 64290 ; Display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire to be ; pressed then jump to Main Game Loop ; Cast Pass Plant if Possible, else Display Failure Message c44001 LD B,49 ; Load B with 49 (destination plant's room on Spaceship) 44003 LD A,(23702) ; If Magic Knight's current room is 4 (Outdoors, 3, The Spooky Forest, 1)... 44006 CP 4 ; ... 44008 JR Z,44021 ; ...then skip ahead to #R44021 44010 CP 17 ; If Magic Knight's current room is 17 (Castle Ground Floor, 0, One Axe Room)... 44012 JR Z,44021 ; ...then skip ahead to #R44021 44014 LD B,4 ; Load B with 4 (destination plant's room in Spooky Forest) 44016 CP 49 ; If Magic Knight's current room is not 49 (Spaceship, 4, The Power Plant)... 44018 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop ; At this point, B holds the room to which Magic Knight will travel when Pass Plant spell is cast. *44021 LD A,B ; Load A with destination room 44022 LD (44053),A ; Update operand to instruction at #R44052 to hold destination room 44025 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (characters)... 44028 RRCA ; ... 44029 RRCA ; ... 44030 RRCA ; ... 44031 RRCA ; ... 44032 AND 15 ; ... 44034 CP 7 ; ...and if this is 7... 44036 JR Z,44044 ; ...then skip ahead to #R44044 44038 LD HL,55589 ; Point HL at "YOU ARE NOT NEAR ENOUGH TO THE RIGHT TYPE OF PLANT" text 44041 JP 64305 ; Display "YOU ARE NOT NEAR ENOUGH TO THE RIGHT TYPE OF PLANT" Window (27), wait for Fire to be ; pressed then jump to Main Game Loop *44044 LD C,30 ; If Magic Knight's magic level is at least 30... 44046 CALL 44225 ; ...then flash border and screen and decrease Magic Knight's magic level by 30... 44049 JP C,64290 ; ...otherwise display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for ; Fire to be pressed then jump to Main Game Loop ; The operand of the instruction at #R44052 represents the destination room for Pass Plant spell. This is modified ; by the instruction at #R44022. 44052 LD A,0 ; Set Magic Knight's room to destination room... 44054 LD (23702),A ; ... 44057 LD HL,55625 ; Point HL at "YOU FIND YOURSELF STANDING BESIDE A SIMILAR PLANT..." text 44060 JP 64305 ; Display "YOU FIND YOURSELF STANDING BESIDE A SIMILAR PLANT..." Window (27), wait for Fire to ; be pressed then jump to Main Game Loop ; Cast Spell of Wonder if Possible, else Display Failure Message ; ; See trivia c44063 LD C,60 ; If Magic Knight's magic level is at least 60... 44065 CALL 44225 ; ...then flash border and screen and decrease Magic Knight's magic level by 60... 44068 JP C,64290 ; ...otherwise display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for ; Fire to be pressed then jump to Main Game Loop 44071 LD A,(24768) ; Load B with unused bit... 44074 AND 128 ; ... 44076 LD B,A ; ... 44077 LD A,(24768) ; Load Magic Knight's current strength into A... 44080 AND 127 ; ... 44082 ADD A,10 ; ...add 10... 44084 CP 101 ; ...and if less than 101... 44086 JR C,44090 ; ...then skip ahead to #R44090 44088 LD A,100 ; Load A with 100 *44090 OR B ; Combine unused bit with value in A... 44091 LD (24768),A ; ...and store as Magic Knight's new strength 44094 LD HL,55685 ; Point HL at "YOU FEEL THE USUAL MAGIC ENERGY DRAIN..." text 44097 JP 64305 ; Display "YOU FEEL THE USUAL MAGIC ENERGY DRAIN..." Window (27), wait for Fire to be pressed ; then jump to Main Game Loop ; Cast Travel to Person if Possible, else Display Failure Message c44100 CALL 63399 ; Print or update Command Summary Window at top of screen 44103 LD DE,55955 ; Point DE at "TRAVEL TO " text... 44106 CALL 63349 ; ...and print in Command Summary Window at top of screen 44109 LD HL,51428 ; Point HL at "TRAVEL TO ?" text 44112 PUSH HL ; Store HL (pointer to "TRAVEL TO ?" text) 44113 LD HL,48589 ; Load HL with start address of list of characters for "TRAVEL TO" Character Selection Menu 44116 CALL 46106 ; Display and process input for character selection menu ("TRAVEL TO") 44119 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44122 LD A,2 ; If Magic Knight is not carrying the Crystal Ball (2)... 44124 CALL 45510 ; ... 44127 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 44130 LD A,25 ; If Magic Knight is not carrying the Magic Missile (25)... 44132 CALL 45510 ; ... 44135 JP NZ,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 44138 LD A,(41937) ; Load BC with three times index of Current Character... 44141 LD C,A ; ... 44142 ADD A,A ; ... 44143 ADD A,C ; ... 44144 LD B,0 ; ... 44146 LD C,A ; ... 44147 LD HL,24898 ; Point IX at start of Table of Characters' Current Positions at #R24898... 44150 ADD HL,BC ; ...and add BC as offset 44151 LD A,(HL) ; If character's current room is 99... 44152 CP 99 ; ... 44154 JP Z,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 44157 CP 100 ; If character's current room is 100... 44159 JP Z,64290 ; ...then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire ; to be pressed then jump to Main Game Loop 44162 LD C,30 ; Load C with 30 (as spell reduces magic level by 30) 44164 PUSH HL ; Store HL (pointer to character's current room) 44165 CALL 44225 ; If MK's Magic Level is at least 30 then flash border and screen and decrease Magic Knight's ; magic level by 30, otherwise set Carry Flag 44168 POP HL ; Restore HL (pointer to character's current room) 44169 JP C,64290 ; If Carry Flag set then display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), ; wait for Fire to be pressed then jump to Main Game Loop 44172 LD A,(HL) ; Set Magic Knight's current room to be the same as the character's... 44173 LD (23702),A ; ... 44176 INC HL ; Advance HL to character's x-coordinate... 44177 LD A,(HL) ; ...and load into A 44178 ADD A,A ; Multiply A by eight to get x-coordinate in pixels... 44179 ADD A,A ; ... 44180 ADD A,A ; ... 44181 LD (24840),A ; ...and set Magic Knight's current x-coordinate to this value 44184 INC HL ; Advance HL to character's y-coordinate... 44185 LD A,(HL) ; ...and load into A 44186 ADD A,A ; Multiply A by eight to get y-coordinate in pixels... 44187 ADD A,A ; ... 44188 ADD A,A ; ... 44189 LD (24841),A ; ...and set Magic Knight's current y-coordinate to this value 44192 LD HL,55846 ; Point HL at "YOU FEEL YOUR BODY SUCKED THROUGH A BYPASS..." text 44195 JP 64293 ; Display "YOU FEEL YOUR BODY SUCKED THROUGH A BYPASS..." Window (15), wait for Fire to be ; pressed then jump to Main Game Loop ; Cast Magic Fulcrum if Possible, else Display Failure Message c44198 LD C,55 ; If Magic Knight's magic level is at least 55... 44200 CALL 44225 ; ...then flash border and screen and decrease Magic Knight's magic level by 55... 44203 JP C,64290 ; ...otherwise display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for ; Fire to be pressed then jump to Main Game Loop 44206 XOR A ; Reset all Main Lever Flags... 44207 LD (23402),A ; ... 44210 LD HL,55775 ; Point HL at "YOU FEEL SEVEN LEVERS ALL MOVING TO THEIR START POSITIONS..." text 44213 JP 64305 ; Display "YOU FEEL SEVEN LEVERS..." Window (27), wait for Fire to be pressed then jump to Main ; Game Loop ; Cast Quiticus Gamus and Jump to Game Over c44216 CALL 64548 ; Flash border and screen (as in Cast a Spell) 44219 LD HL,50879 ; Point HL at "I SUPPOSE YOU REALISED..." text 44222 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Flash Border and Screen and Decrease Magic Knight's Magic Level if Level is at Least C ; ; Used by the routines at #R43950, #R44001, #R44063, #R44100 and #R44198. Input: C Cost of spell Output: A Magic ; Knight's magic level if less than C, otherwise zero F Carry Flag set if Magic Knight's magic level is less than ; C, reset otherwise c44225 LD A,(24771) ; Load Magic Knight's current magic level into A... 44228 AND 127 ; ... 44230 CP C ; If this is less than C... 44231 RET C ; ...then return 44232 LD A,(24771) ; Load B with unused bit... 44235 AND 128 ; ... 44237 LD B,A ; ... 44238 LD A,(24771) ; Load Magic Knight's current magic level into A... 44241 AND 127 ; ... 44243 SUB C ; ...subtract C... 44244 OR B ; ...combine with unused bit... 44245 LD (24771),A ; ...and store 44248 CALL 64548 ; Flash border and screen (as in Cast a Spell) 44251 XOR A ; Set A to zero 44252 RET ; Return ; Show "WELL DONE" Screen, Jumping to Game Over when Fire is Pressed ; ; Used by the routine at #R43950. c44253 IM 1 ; Set Interrupt Mode 1 44255 LD A,(23446) ; Increase Bonus Score by 17... 44258 ADD A,17 ; ... 44260 LD (23446),A ; ... 44263 CALL 64548 ; Flash border and screen (as in Cast a Spell) 44266 LD A,10 ; Draw Window 10... 44268 CALL 47193 ; ... 44271 LD HL,50947 ; Point HL at "WELL DONE..." text 44274 CALL 46902 ; ...and print to screen 44277 LD HL,16384 ; Blank out top two thirds of Display File... 44280 LD DE,16385 ; ... 44283 LD BC,4095 ; ... 44286 LD (HL),L ; ... 44287 LDIR ; ... 44289 LD A,71 ; Load A with 71 (white INK, black PAPER, BRIGHT)... 44291 LD (23695),A ; ...and set system variables ATTR T... 44294 LD (23693),A ; ...and ATTR P to this value 44297 LD HL,22528 ; Load HL with start of attribute section of video memory 44300 LD DE,22529 ; Load DE with next byte up 44303 LD BC,511 ; Load BC with length of data to copy (511 bytes = length of 16 rows of attribute area of video ; memory minus one) 44306 LD (HL),A ; Load memory at HL with this attribute... 44307 LDIR ; ...and repeat 511 times 44309 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 44312 LD (24844),HL ; ... 44315 LD HL,19320 ; Set Magic Knight's x-coordinate to 120 and y-coordinate to 75... 44318 LD (24840),HL ; ... 44321 XOR A ; Set unused data at #R24842 to zero... 44322 LD (24842),A ; ... 44325 CALL 61860 ; Store background attributes if appropriate, then draw Magic Knight to display without drawing ; axes 44328 CALL 64230 ; Wait for Interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 44331 LD HL,51006 ; Point HL at "YOU HAVE COMPLETED YOUR TASK..." text 44334 JP 64582 ; Display Cyan "Game Over" Window and Return to Control Selection Menu ; Process Command to Blow an Object c44337 LD IX,24848 ; Point IX at start of Magic Knight's current inventory (carrying) 44341 LD B,5 ; Load B with 5 (five inventory slots) 44343 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 44346 LD DE,51928 ; Point DE at "[Current Command] THE " text 44349 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 44352 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 44355 CALL 45766 ; Print name of selected object in Magic Knight's current inventory (carrying) in Command ; Summary Window 44358 LD A,(41779) ; Load A with index of Current Object 44361 CP 22 ; If the selected object is not the Elf-Horn... 44363 JP NZ,44557 ; ...then skip ahead to #R44557 44366 LD A,(23702) ; Load BC with double index of Magic Knight's current room... 44369 ADD A,A ; ... 44370 LD C,A ; ... 44371 LD B,0 ; ... 44373 LD HL,48915 ; Load HL with start address of Character Movement Restriction Data 44376 ADD HL,BC ; Add BC as offset 44377 LD A,(HL) ; Load current room's movement restriction data... 44378 LD (44454),A ; ...into operand of instruction at #R44453 44381 CALL 63399 ; Print or update Command Summary Window at top of Screen 44384 LD DE,56163 ; Point DE at "SUMMON " text... 44387 CALL 63349 ; ...and print in Command Summary Window at top of screen 44390 LD HL,51413 ; Point HL at "SUMMON ?" text 44393 PUSH HL ; Store HL (address of "SUMMON ?" text) 44394 LD HL,48598 ; Load HL with start address of list of characters for "SUMMON" Character Selection Menu 44397 CALL 46106 ; Display and process input for character selection menu ("SUMMON") 44400 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44403 LD A,(41779) ; Load A with index of Current Object (see trivia) 44406 CALL 45601 ; Point HL at current position data for Current Character 44409 LD A,(23702) ; Load A with Magic Knight's current room... 44412 CP (HL) ; ...and set Zero Flag if this is the same as the Current Character's current room 44413 LD HL,56275 ; Point HL at "[Current Character's full name] IS ALREADY HERE!" text 44416 JP Z,64309 ; If Zero Flag is set then display "[Character] IS ALREADY HERE!" Window (28), wait for Fire to ; be pressed then jump to Main Game Loop 44419 LD A,(41937) ; Point HL at Current Character's strength... 44422 LD E,0 ; ... 44424 CALL 45406 ; ... 44427 PUSH HL ; Load IX with address of Current Character's strength... 44428 POP IX ; ... 44430 BIT 7,(IX+6) ; Set Zero Flag to inverse of Current Character's Asleep Flag (i.e. Awake Flag) 44434 LD HL,56213 ; Point HL at "[Current Character's full name] IS ASLEEP" text 44437 JP NZ,64309 ; If Zero Flag is not set then display "[Character] IS ASLEEP" Window (28), wait for Fire to be ; pressed then jump to Main Game Loop 44440 LD A,(IX+1) ; If character's happiness is less than 35... 44443 AND 127 ; ... 44445 CP 35 ; ...then set Carry Flag 44447 LD HL,56224 ; Point HL at "[Current Character's full name] DOES NOT WANT TO BE SUMMONED" text 44450 JP C,64309 ; If Carry Flag is set then display "[Character] DOES NOT WANT TO BE SUMMONED" Window (28), ; wait for Fire to be pressed then jump to Main Game Loop ; The operand of the instruction at #R44453 represents the movement restriction data for the current room. This is ; modified by the instruction at #R44378. 44453 LD A,0 ; If movement restriction data is 98 (i.e. room not accessible by character)... 44455 CP 98 ; ... 44457 JP Z,64309 ; ...then display "[Character] DOES NOT WANT TO BE SUMMONED" Window (28), wait for Fire to be ; pressed then jump to Main Game Loop 44460 LD A,(IX+2) ; If Current Character's stamina is less than 25... 44463 AND 127 ; ... 44465 CP 25 ; ...then set Carry Flag 44467 LD HL,56248 ; Point HL at "[Current Character's full name] IS TOO TIRED TO BE SUMMONED" text 44470 JP C,64309 ; If Carry Flag is set then display "[Character] IS TOO TIRED TO BE SUMMONED" Window (28), wait ; for Fire to be pressed then jump to Main Game Loop 44473 CALL 45601 ; Point HL at current position data for Current Character 44476 CALL 44615 ; Load BC with coordinates of character's arrival point when summoned to current room and set ; Zero Flag if character refuses to come 44479 JP Z,44585 ; If character does not want to come here then skip ahead to #R44585 44482 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (characters)... 44485 RRCA ; ... 44486 RRCA ; ... 44487 RRCA ; ... 44488 AND 31 ; ... 44490 SUB C ; Subtract arrival x-coordinate to give horizontal distance from Magic Knight... 44491 JP Z,44591 ; ...and if zero then skip ahead to #R44591 (check vertical distance to Magic Knight) 44494 CP 1 ; If horizontal distance is 1... 44496 JP Z,44591 ; ...then skip ahead to #R44591 (check vertical distance to Magic Knight) 44499 CP 255 ; If horizontal distance is -1... 44501 JP Z,44591 ; ...then skip ahead to #R44591 (check vertical distance to Magic Knight) 44504 CP 254 ; If horizontal distance is -2... 44506 JP Z,44591 ; ...then skip ahead to #R44591 (check vertical distance to Magic Knight) ; Have character arrive in new room *44509 LD A,(23702) ; Load A with index of Magic Knight's current room... 44512 OR 128 ; ...and set MSB 44514 LD (HL),A ; Set this as character's current room 44515 INC HL ; Advance to character's x-coordinate... 44516 LD (HL),C ; ...and set to value in C 44517 INC HL ; Advance to character's y-coordinate... 44518 LD (HL),B ; ...and set to value in B 44519 LD A,(IX+0) ; Decrease character's strength by 4... 44522 SUB 4 ; ... 44524 LD (IX+0),A ; ... 44527 LD A,(IX+1) ; Decrease character's happiness by 3... 44530 SUB 3 ; ... 44532 LD (IX+1),A ; ... 44535 LD A,(IX+2) ; Decrease character's stamina by 7... 44538 SUB 7 ; ... 44540 LD (IX+2),A ; ... 44543 LD A,(24771) ; Decrease Magic Knight's current magic level by 3... 44546 SUB 3 ; ... 44548 LD (24771),A ; ... 44551 LD HL,56347 ; Point HL at "[Current Character's full name] APPEARS IN A THICK PUFF OF SMOKE" text 44554 JP 64309 ; Display "[Character] APPEARS IN A THICK PUFF OF SMOKE" Window (28), wait for Fire to be ; pressed then jump to Main Game Loop ; Blown object is not the Elf-Horn *44557 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44560 LD A,(41779) ; Load A with index of Current Object... 44563 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 44566 LD E,0 ; Load E with 0 (prepare to check Blow Status Flag) 44568 CALL 45390 ; Point HL to byte 0 of the A-th record in Object Properties Table 44571 BIT 6,(HL) ; Set Zero Flag if object's Blow Status Flag is reset, otherwise reset 44573 LD HL,56304 ; Point HL at "WHAT A LOT OF DUST..." text 44576 JP Z,64305 ; If Zero Flag is set then display "WHAT A LOT OF DUST..." Window (27), wait for Fire to be ; pressed then jump to Main Game Loop 44579 LD HL,56165 ; Point HL at "I THINK YOU SHOULD GIVE UP TRYING TO PLAY THE [name of Current Object]..." text 44582 JP 64305 ; Display "I THINK YOU SHOULD GIVE UP..." Window (27), wait for Fire to be pressed then jump to ; Main Game Loop ; Character does not want to come to current room *44585 LD HL,56284 ; Point HL at "[Current Character's short name] DOES NOT WANT TO COME HERE!" text 44588 JP 64305 ; Display "[Character] DOES NOT WANT TO COME HERE!" Window (27), wait for Fire to be pressed ; then jump to Main Game Loop ; Magic Knight is within two characters horizontally of character's intended arrival point *44591 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (characters)... 44594 RRCA ; ... 44595 RRCA ; ... 44596 RRCA ; ... 44597 AND 31 ; ... 44599 SUB B ; Subtract arrival y-coordinate to give vertical distance from Magic Knight... 44600 AND 252 ; If bits 2-7 are all reset (i.e. distance was 0 - 3)... 44602 JR Z,44609 ; ...then skip ahead to #R44609 44604 CP 252 ; If bits 2-7 are not all set (i.e. distance was not -1 - -4)... 44606 JP NZ,44509 ; ...then jump back to #R44509 (have character arrive) *44609 LD HL,56070 ; Point HL at "[Current Character's short name] SAYS 'I CANNOT COME TO THAT ROOM ... YOU ARE IN ; MY WAY!'" text 44612 JP 64293 ; Display "[Character] SAYS 'I CANNOT COME TO THAT ROOM...'" Window (15), wait for Fire to be ; pressed then jump to Main Game Loop ; Load BC with Coordinates of Character's Arrival Point When Summoned and Set Zero Flag if Character Refuses ; ; Used by the routine at #R44337. Output: B Destination y-coordinate C Destination x-coordinate F Zero Flag set ; if character does not want to come to room, otherwise reset c44615 LD A,(23702) ; Load A with index of Magic Knight's current room 44618 PUSH HL ; Store HL 44619 ADD A,A ; Double index of Magic Knight's current room 44620 LD HL,49690 ; Load HL with start address of Table of x- and y-Coordinates of Positions Taken by Summoned ; Characters in Each Room... 44623 LD C,A ; ...and add double room index as offset... 44624 LD B,0 ; ... 44626 ADD HL,BC ; ... 44627 LD C,(HL) ; Load C with destination x-coordinate 44628 INC HL ; Advance HL to destination y-coordinate... 44629 LD B,(HL) ; ...and load into B 44630 POP HL ; Restore HL 44631 LD A,C ; If destination x-coordinate is 99... 44632 CP 99 ; ...then set Zero Flag 44634 RET ; Return ; Process Command to Wear / Unwear an Object c44635 LD A,11 ; Draw Window 11... 44637 CALL 47185 ; ... 44640 LD HL,56380 ; Point HL at Wear/Unwear Menu text... 44643 CALL 46902 ; ...and print to screen 44646 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 44649 JR NZ,44745 ; If UNWEAR selected then skip ahead to #R44745 44651 CALL 45641 ; Display "YOU ARE NOT CARRYING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (carrying) is empty 44654 JP Z,41742 ; If MK's inventory (carrying) is empty then set his available action flags and jump to start ; of Main Game Loop (#R41742) 44657 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 44661 LD B,5 ; Load B with 5 (five inventory slots) 44663 LD HL,56397 ; Point HL at "[Current Command] WHICH OBJECT ?" text 44666 LD DE,56391 ; Point DE at "UN[Current Command] THE " text 44669 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 44672 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 44675 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 44678 LD A,(41779) ; If Current Object (selected object) is the Disquise (1)... 44681 CP 1 ; ... 44683 JP Z,44824 ; ...then skip ahead to #R44824 44686 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop *44689 LD A,(41779) ; Load A with index of Current Object... 44692 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 44695 LD HL,24857 ; If last slot in Magic Knight's current inventory (wearing) is not empty... 44698 LD A,(HL) ; ... 44699 OR A ; ...then reset Zero Flag, otherwise set 44700 LD HL,56404 ; Point HL at "YOU ARE [Current Command]ING TOO MUCH" text 44703 JP NZ,64261 ; If Zero Flag is reset then display "YOU ARE [Command]ING TOO MUCH" Window (13), wait for Fire ; to be pressed then jump to Main Game Loop 44706 LD A,(41779) ; Load A with index of Current Object 44709 LD E,1 ; If object's Can Be Worn Flag is reset... 44711 CALL 45390 ; ... 44714 BIT 3,(HL) ; ...then set Zero Flag, otherwise reset 44716 LD HL,56419 ; Point HL at "YOU CANNOT [Current Command] THAT " text 44719 JP Z,64261 ; If Zero Flag is set then display "YOU CANNOT [Command] THAT" Window (13), wait for Fire to be ; pressed then jump to Main Game Loop 44722 LD A,(41779) ; Load C with index of Current Object... 44725 LD C,A ; ... 44726 LD B,5 ; Load B with 5 (five inventory slots) 44728 PUSH BC ; Store BC (B = number of slots to process, C = Current Object) 44729 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 44732 CALL 48341 ; Remove object C from this inventory 44735 POP BC ; Restore BC (B = number of slots to process, C = Current Object) 44736 LD HL,24853 ; Point HL at Magic Knight's current inventory (wearing)... 44739 CALL 45380 ; ...and wait for interrupt then load object C into the first empty slot 44742 JP 41727 ; Show Magic Knight's current inventory and jump back to Main Game Loop *44745 CALL 45631 ; Display "YOU ARE NOT WEARING ANYTHING" Window and set Zero Flag if Magic Knight's inventory ; (wearing) is empty 44748 JP Z,41742 ; If MK's inventory (wearing) is empty then set his available action flags and jump to start of ; Main Game Loop (#R41742) 44751 LD IX,24853 ; Point IX at Magic Knight's current inventory (wearing) 44755 LD B,5 ; Load B with 5 (five inventory slots) 44757 LD HL,56395 ; Point HL at "UN[Current Command] WHICH OBJECT ?" text 44760 LD DE,56389 ; Point DE at "UN[Current Command] THE " text 44763 CALL 45809 ; Show list of objects in Magic Knight's inventory (wearing) as a menu and load A with selected ; item index 44766 LD HL,24853 ; Point HL at Magic Knight's current inventory (wearing) 44769 CALL 45766 ; Print name of object in inventory slot A of inventory data at HL in Command Summary Window 44772 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44775 LD A,(41779) ; Load A with index of Current Object... 44778 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed (see trivia) 44781 LD HL,24852 ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 44784 LD A,(HL) ; ... 44785 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 44786 JP NZ,64258 ; ...then display "YOUR HANDS ARE FULL" Window (13), wait for Fire to be pressed then jump to ; Main Game Loop 44789 LD A,(41779) ; Load C with index of Current Object... 44792 LD C,A ; ... 44793 LD B,5 ; Load B with 5 (five inventory slots) 44795 PUSH BC ; Store BC (B = number of slots to process, C = Current Object) 44796 LD HL,24853 ; Point HL at Magic Knight's current inventory (wearing) 44799 CALL 48341 ; Remove object C from Magic Knight's current inventory (wearing) 44802 POP BC ; Restore BC (B = number of slots to process, C = Current Object) 44803 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying)... 44806 CALL 45380 ; ...and wait for interrupt then load Object C into the first empty slot 44809 LD A,(41779) ; If Current Object (selected object) is not the Disquise (1)... 44812 CP 1 ; ... 44814 JP NZ,41727 ; ...then show Magic Knight's current inventory and jump back to Main Game Loop 44817 XOR A ; Set Current Disquise to zero... 44818 LD (23438),A ; ... 44821 JP 41727 ; Show Magic Knight's current inventory and jump back to Main Game Loop *44824 LD HL,56429 ; Point HL at "WHICH DISQUISE DO YOU WANT TO [Current Command]?" full menu text 44827 LD DE,49140 ; Adjust height of window 13 to accommodate text... 44830 CALL 45617 ; ... 44833 PUSH HL ; Store HL (pointer to menu text to print) 44834 LD A,13 ; Draw Menu Window 13... 44836 CALL 47185 ; ... 44839 POP HL ; Restore HL (pointer to menu text to print) 44840 CALL 46902 ; Print text to screen 44843 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 44846 INC A ; Add one to selected item index to give selected disquise index... 44847 LD (44854),A ; ...and store as operand to instruction at #R44853 44850 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop ; The operand of the instruction at #R44853 represents the index of the selected disquise to wear. This is modified ; by the instruction at #R44847. 44853 LD A,0 ; Load A with selected disquise index... 44855 LD (23438),A ; ...and store at #R23438 as Current Disquise 44858 JP 44689 ; Jump back to #R44689 (i.e. try to wear selected disquise) ; Process Command to Teleport c44861 LD B,2 ; Print or update Command Summary Window at top of screen... 44863 CALL 45206 ; ...with "TELEPORT" text 44866 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44869 LD A,(25018) ; If the Teleport Pad's current room is not 99... 44872 CP 99 ; ... 44874 JR NZ,44900 ; ...then skip ahead to #R44900 44876 XOR A ; Set Magic Knight's current room... 44877 LD (23702),A ; ...to be zero (Limbo) 44880 LD A,120 ; Set Magic Knight's x- and y-coordinates to be 120... 44882 LD (24840),A ; ... 44885 LD (24841),A ; ... 44888 LD A,1 ; Set Animate Puff of Smoke Flag... 44890 LD (23480),A ; ... 44893 LD HL,56462 ; Point HL at "IT WAS NOT SAFE TO TELEPORT SO YOU HAVE WOUND UP IN LIMBO" text 44896 CALL 64317 ; Display "IT WAS NOT SAFE TO TELEPORT..." Window (17), wait for Fire to be pressed then jump ; to Main Game Loop... ; Data block at 44899 b44899 DEFB 17 ; ... ; Teleport Pad's room is not 99 ; ; Used by the routine at #R44861. c44900 LD HL,25018 ; Point HL to current position data of Teleport Pad 44903 LD A,(HL) ; Load A with current room of Teleport Pad... 44904 LD (23702),A ; ...and update Magic Knight's current room to match 44907 INC HL ; Advance HL to x-coordinate of Teleport Pad... 44908 LD A,(HL) ; ...and load this into A 44909 ADD A,A ; Multiply x-coordinate by eight... 44910 ADD A,A ; ... 44911 ADD A,A ; ... 44912 LD (24840),A ; ...and update Magic Knight's current x-coordinate to match 44915 INC HL ; Advance HL to y-coordinate of Teleport Pad... 44916 LD A,(HL) ; ...and load this into A 44917 SUB 3 ; Subtract three (because Magic Knight is four character blocks tall)... 44919 ADD A,A ; ...multiply by eight... 44920 ADD A,A ; ... 44921 ADD A,A ; ... 44922 LD (24841),A ; ...and update Magic Knight's current y-coordinate to match 44925 LD A,1 ; Set Animate Puff of Smoke Flag... 44927 LD (23480),A ; ... 44930 JP 41742 ; Set Magic Knight's available action flags and jump to start of Main Game Loop ; Process Command to Tickle a Character c44933 LD HL,51408 ; Point HL at "[Current Command] ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ") 44936 LD DE,56502 ; Point DE at "TICKLE " text 44939 CALL 45963 ; Display and process input for Character Selection Menu (current room's characters only), ; setting Current Character 44942 JP Z,41742 ; If there are no characters in the room then set MK's available action flags and jump to start ; of Main Game Loop (#R41742) 44945 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44948 CALL 45723 ; End the game if Current Character is Off-White or Grunter 44951 CALL 45552 ; Display "[Character] IS ASLEEP" Window and jump to Main Game Loop if Current Character is ; asleep, else return here and continue 44954 LD A,(41937) ; Load A with index of Current Character 44957 LD E,0 ; Point HL at character's current strength... 44959 CALL 45406 ; ... 44962 PUSH HL ; Transfer address from HL... 44963 POP IX ; ...into IX 44965 LD A,(41937) ; Load DE with index of Current Character... 44968 LD E,A ; ... 44969 LD D,0 ; ... 44971 LD HL,43486 ; Load HL with start address of Table of Characters' Default Happiness Levels... 44974 ADD HL,DE ; ...and add DE as offset 44975 LD A,(IX+1) ; Load A with character's current happiness... 44978 AND 128 ; ...and reset all but Bit 7 (unused) 44980 OR (HL) ; Add in character's default happiness... 44981 LD (IX+1),A ; ...and set as character's current happiness 44984 LD HL,56505 ; Point HL at "[Current Character's short name] GIGGLES AND BURSTS INTO LAUGHTER..." text 44987 JP 64313 ; Display "[Character's] GIGGLES AND BURSTS INTO LAUGHTER..." window (29), wait for Fire to be ; pressed then jump to Main Game Loop ; Process Command to Pull Lever c44990 LD B,9 ; Print or update Command Summary Window at top of screen... 44992 CALL 45206 ; ...with "PULL LEVER" text 44995 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 44998 LD A,(23702) ; Load A with Magic Knight's current room 45001 CP 20 ; If current room is 20 (Castle Ground Floor, 3)... 45003 JP Z,45073 ; ...then skip ahead to #R45073 45006 CP 38 ; If current room is 38 (Castle Third Floor, 0, Big White Statue)... 45008 JP Z,45080 ; ...then skip ahead to #R45080 45011 CP 34 ; If current room is 34 (Castle Second Floor, 3, One Way Corridor, 1)... 45013 JP Z,45087 ; ...then skip ahead to #R45087 45016 LD B,64 ; Prepare to set Main Lever 7 Flag 45018 CP 24 ; If current room is 24 (Castle First Floor, 0, Main Lever 7)... 45020 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45022 LD B,32 ; Prepare to set Main Lever 6 Flag 45024 CP 25 ; If current room is 25 (Castle First Floor, 1, Main Lever 6)... 45026 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45028 LD B,16 ; Prepare to set Main Lever 5 Flag 45030 CP 26 ; If current room is 26 (Castle First Floor, 2, Security Door & Main Lever 5)... 45032 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45034 LD B,8 ; Prepare to set Main Lever 4 Flag 45036 CP 27 ; If current room is 27 (Castle First Floor, 3, Main Lever 4)... 45038 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45040 LD B,4 ; Prepare to set Main Lever 3 Flag 45042 CP 28 ; If current room is 28 (Castle First Floor, 4, Main Lever 3)... 45044 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45046 LD B,2 ; Prepare to set Main Lever 2 Flag 45048 CP 29 ; If current room is 29 (Castle First Floor, 5, Main Lever 2)... 45050 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) 45052 LD B,1 ; Prepare to set Main Lever 1 Flag 45054 CP 30 ; If current room is 30 (Castle First Floor, 6, Main Lever 1)... 45056 JR Z,45064 ; ...then skip ahead to #R45064 (set prepared Main Lever Flag) *45058 LD HL,57552 ; Point HL at "THE LEVER SPRUNG BACK INTO POSITION..." text 45061 JP 64297 ; Display "THE LEVER SPRUNG BACK INTO POSITION..." Window (12), wait for Fire to be pressed ; then jump to Main Game Loop ; Set Prepared Main Lever Flag *45064 LD A,(23402) ; Load current Main Lever Flags... 45067 XOR B ; ...merge in set flag prepared in B... 45068 LD (23402),A ; ...and store back at #R23402 45071 JR 45058 ; Jump back to #R45058 (show "THE LEVEL SPRUNG BACK..." message and return to Main Game Loop ; Room 20 (Castle Ground Floor, 3) *45073 LD A,138 ; Load A with 138 (instruction to draw layout data fragment 10, i.e. blank)... 45075 LD (59866),A ; ...and replace Security Door (1/3) instruction at #R59866 45078 JR 45058 ; Jump back to #R45058 (show "THE LEVEL SPRUNG BACK..." message and return to Main Game Loop ; Room 38 (Castle Third Floor, 0, Big White Statue) *45080 LD A,138 ; Load A with 138 (instruction to draw layout data fragment 10, i.e. blank)... 45082 LD (59867),A ; ...and replace Security Door (2/3) instruction at #R59867 45085 JR 45058 ; Jump back to #R45058 (show "THE LEVEL SPRUNG BACK..." message and return to Main Game Loop ; Room 34 (Castle Second Floor, 3, One Way Corridor, 1) *45087 LD A,138 ; Load A with 138 (instruction to draw layout data fragment 10, i.e. blank)... 45089 LD (59868),A ; ...and replace Security Door (3/3) instruction at #R59868 45092 JR 45058 ; Jump back to #R45058 (show "THE LEVEL SPRUNG BACK..." message and return to Main Game Loop ; Unused routine ; ; Do nothing (return). c45094 RET ; Return ; Process Command to Smell Something c45095 LD IX,24848 ; Point IX at start of Magic Knight's current inventory (carrying) 45099 LD B,5 ; Load B with 5 (five inventory slots) 45101 LD HL,51920 ; Point HL at "[Current Command] WHICH OBJECT ?" text 45104 LD DE,51928 ; Point DE at "[Current Command] THE " text 45107 CALL 45809 ; Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with ; selected item index 45110 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 45113 CALL 45766 ; Print name of selected object in Magic Knight's current inventory (carrying) in Command ; Summary Window 45116 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 45119 LD A,(41779) ; Load A with index of Current Object... 45122 CALL 45685 ; ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for Fire to ; be pressed 45125 LD HL,57501 ; Point HL at "YOU CAN SMELL NOTHING BECAUSE YOUR NOSE IS BLOCKED!" text 45128 JP 64297 ; Display "YOU CAN SMELL NOTHING..." Window (12), wait for Fire to be pressed then jump to Main ; Game Loop ; Process Command to Have a Wish c45131 LD B,11 ; Print or update Command Summary Window at top of screen... 45133 CALL 45206 ; ...with "HAVE A WISH" text 45136 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 45139 XOR A ; Reset Wish Pending Flag... 45140 LD (23365),A ; ... 45143 LD HL,57533 ; Point HL at "YOUR [Current Command] HAS BEEN GRANTED!" text 45146 JP 64297 ; Display "YOUR [Current Command] HAS BEEN GRANTED!" Window (12), wait for Fire to be pressed ; then jump to Main Game Loop ; Process Command to Have a Drink c45149 LD B,12 ; Print or update Command Summary Window at top of screen... 45151 CALL 45206 ; ...with "HAVE A DRINK" text 45154 CALL 64207 ; Display Execute / Reject Command window and return here if Execute chosen, else exit to Main ; Game Loop 45157 LD A,17 ; If Magic Knight is carrying the Bottle of Liquid (17)... 45159 CALL 45510 ; ...then set Zero Flag, otherwise reset 45162 LD C,17 ; Load C with 17 (index of first Bottle of Liquid) 45164 JR Z,45168 ; If Zero Flag is set (i.e. Magic Knight is carrying the Bottle of Liquid) then skip ahead to ; #R45168 45166 LD C,18 ; Load C with 18 (index of second Bottle of Liquid) *45168 LD B,5 ; Load B with 5 (five inventory slots) 45170 PUSH BC ; Store BC (C = index of appropriate Bottle of Liquid) 45171 LD HL,24848 ; Point HL at Magic Knight's current inventory (carrying) 45174 CALL 48341 ; Remove object C from Current Character's inventory 45177 POP BC ; Restore BC (C = index of appropriate Bottle of Liquid) 45178 LD A,C ; Load A with index of Bottle of Liquid drank... 45179 SUB 17 ; ...subtract 17... 45181 ADD A,28 ; ...add 28 to give index of appropriate Empty Bottle... 45183 LD C,A ; ...and load into C 45184 LD HL,24848 ; Point HL at Magic Knight's current inventory (carrying) 45187 CALL 45380 ; Wait for interrupt then load appropriate Empty Bottle into Magic Knight's inventory 45190 LD A,(24768) ; Load A with unused bit in Magic Knight's current Strength field... 45193 AND 128 ; ...clear all strength bits... 45195 ADD A,100 ; ...set new strength to 100... 45197 LD (24768),A ; ...and store 45200 LD HL,57636 ; Point HL at "MMMMM.. TASTY. YOU CAN FEEL NEW STRENGTH " text 45203 JP 64297 ; Display "MMMMM.. TASTY..." Window (12), wait for Fire to be pressed then jump to Main Game ; Loop ; Print Name of B-th Conditional Command in Command Summary Window ; ; Used by the routines at #R43874, #R44861, #R44990, #R45131 and #R45149. Input: B Index of conditional command to ; print in Command Summary Window c45206 PUSH BC ; Store BC (B = index of conditional command to print) 45207 CALL 63399 ; Print or update Command Summary Window at top of screen 45210 POP BC ; Restore BC (B = index of conditional command to print) 45211 LD HL,51487 ; Point HL at text for first of conditional Main Menu options 45214 CALL 63335 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL 45217 INC HL ; Skip over formatting codes to first text character... 45218 INC HL ; ... 45219 PUSH HL ; Transfer address from HL... 45220 POP DE ; ...to DE 45221 JP 63349 ; Print text at DE (Command Summary) in Command Summary Window at top of screen and return ; "Command Character to Help" Routine for Off-White Knight c45224 JP 64285 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; "Command Character to Help" Routine for Aramis le Peux c45227 LD A,34 ; Set Zero Flag if Aramis le Peux is carrying the List of Clues, reset otherwise... 45229 LD HL,24863 ; ... 45232 CALL 45513 ; ...(see trivia) 45235 JP NZ,64285 ; If Zero Flag is reset then display "[Character] CANNOT HELP YOU" Window (29), wait for Fire ; to be pressed then jump to Main Game Loop ; The operand of the instruction at #R45238 represents the index of the Current Clue. This is modified by the ; instruction at #R45243. 45238 LD A,0 ; Increase index of Current Clue... 45240 INC A ; ... 45241 AND 7 ; ...resetting to zero if greater than 7... 45243 LD (45239),A ; ...and store at #R45238 45246 LD B,A ; Load B with index of Current Clue 45247 LD HL,55198 ; Point HL at start of list of Clue Texts 45250 CALL 63335 ; Advance HL to B-th entry in list of zero-terminated strings starting at HL 45253 JP 64301 ; Display Current Clue Window (24), wait for Fire to be pressed then jump to Main Game Loop ; "Command Character to Help" Routine for Robin of Shylock c45256 LD A,(23439) ; If Robin Has Been Paid Flag is set... 45259 AND 1 ; ... 45261 JR NZ,45269 ; ...then skip ahead to #R45269 45263 LD HL,51588 ; Point HL at "[Current Character's short name] SAYS "I WILL REQUIRE A GOLDEN EGG..."" text 45266 JP 64301 ; Display "[Character] SAYS "I WILL REQUIRE A GOLDEN EGG..."" Window (24), wait for Fire to be ; pressed then jump to Main Game Loop *45269 LD A,(23702) ; If Magic Knight's current room is not 3... 45272 CP 3 ; ...(Outdoors, 2, Beware Bearwoolf)... 45274 JP NZ,64285 ; ...then display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then ; jump to Main Game Loop 45277 LD A,3 ; Set the Teddy Bear's current room to 3... 45279 LD (24934),A ; ... 45282 LD HL,59012 ; Set Room Layout Data Pointer for Room 3 to #R59012... 45285 LD (58847),HL ; ...i.e. exclude Grunter graphic from room layout 45288 LD A,255 ; Set Bearwoolf Removed Flag... 45290 LD (40605),A ; ... 45293 LD C,23 ; Remove Silver Arrow from Robin's current inventory... 45295 LD B,5 ; ... 45297 LD HL,24868 ; ... 45300 CALL 48341 ; ... 45303 LD HL,24991 ; Set Silver Arrow's current room to 3... 45306 LD (HL),3 ; ... 45308 INC HL ; Set Silver Arrow's x-coordinate to 14... 45309 LD (HL),14 ; ... 45311 INC HL ; Set Silver Arrow's y-coordinate to 22... 45312 LD (HL),22 ; ... 45314 LD A,(23446) ; Add 20 to Bonus Score... 45317 ADD A,20 ; ... 45319 LD (23446),A ; ... 45322 LD A,99 ; Set Grunter's current room to 99... 45324 LD (24919),A ; ... 45327 LD HL,51619 ; Point HL at "BRAVE [Current Character's short name] HAS SHOT BEARWOOLF..." text 45330 JP 64301 ; Display "BRAVE [Character] HAS SHOT BEARWOOLF..." Window (24), wait for Fire to be pressed ; then jump to Main Game Loop ; "Command Character to Help" Routine for Reggie the Rat c45333 JP 64285 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; "Command Character to Help" Routine for Rachel of Amazonia c45336 LD HL,51709 ; Point HL at "[Current Character's short name] SAYS "THE PASSWORD NUMBER..."" text 45339 JP 64301 ; Display "[Character] SAYS "THE PASSWORD NUMBER..."" Window (24), wait for Fire to be pressed ; then jump to Main Game Loop ; "Command Character to Help" Routine for Barker the Ent c45342 JP 64285 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; "Command Character to Help" Routine for Organon the Guard c45345 JP 64285 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; "Command Character to Help" Routine for Grunter the Bearwoolf c45348 JP 64285 ; Display "[Character] CANNOT HELP YOU" Window (29), wait for Fire to be pressed then jump to ; Main Game Loop ; Load A with weight of object A ; ; Used by the routines at #R42257 and #R45466. Input: A Index of object of interest Output: A Weight of object of ; interest c45351 PUSH HL ; Store HL 45352 PUSH DE ; Store DE 45353 LD E,0 ; Point HL to the first byte of the A-th record in Object Properties Table... 45355 CALL 45390 ; ... 45358 LD A,(HL) ; Load data at this location into A 45359 AND 15 ; Discard all but the Weight bits 45361 POP DE ; Restore DE 45362 POP HL ; Restore HL 45363 RET ; Return ; Load A with Current Character's Happiness Level ; ; Used by the routines at #R41924 and #R42257. Output: A Happiness of Current Character c45364 LD A,(41937) ; Load A with index of Current Character 45367 PUSH HL ; Store HL 45368 PUSH DE ; Store DE 45369 LD E,1 ; Point HL at Current Character's Happiness... 45371 CALL 45406 ; ... 45374 LD A,(HL) ; ...and load Happiness into A 45375 AND 127 ; Reset Bit 7 (unused) 45377 POP DE ; Restore DE 45378 POP HL ; Restore HL 45379 RET ; Return ; Wait for Interrupt then Load Object C into the First Empty Inventory Slot of a Character ; ; Used by the routines at #R41578, #R42036, #R42157, #R44635 and #R45149. 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 #R24848 c45380 HALT ; Wait for interrupt ; This entry point is used by the routine at #R62443. *45381 LD A,(HL) ; If current inventory slot is empty... 45382 OR A ; ... 45383 JR Z,45388 ; ...then skip ahead to #R45388 45385 INC HL ; Advance to next inventory slot 45386 DJNZ 45381 ; If there are still slots to process then loop back to #R45381 *45388 LD (HL),C ; Load item into current inventory slot 45389 RET ; Return ; Point HL to the E-th byte of the A-th record in Object Properties Table ; ; Used by the routines at #R41748, #R42638, #R43494, #R43636, #R44337, #R44635, #R45351, #R46380 and #R46490. 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 #R45393 only) Points to Table of Characters' Current Stats ; (Off-White's entry, i.e. not including Magic Knight) Output: HL Points to required field within record of ; interest c45390 LD HL,49354 ; Point HL at start of Table of Object Properties ; This entry point is used by the routine at #R45406. *45393 PUSH HL ; Store HL (points to current position in a table of 8-byte-wide records) 45394 ADD A,A ; Multiply A (record number) by eight and load into HL... 45395 ADD A,A ; ... 45396 LD L,A ; ... 45397 LD H,0 ; ... 45399 ADD HL,HL ; ... 45400 LD D,0 ; Set D to zero (DE = field number) 45402 ADD HL,DE ; Add field number to HL to give exact offset to record and field of interest 45403 POP DE ; Restore DE (points to current position in a table of 8-byte-wide records)... 45404 ADD HL,DE ; ...and add to offset value already in HL 45405 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 #R39883, #R42257, #R42638, #R43318, #R43428, #R43636, #R44337, #R44933, #R45364, #R45411, ; #R45552 and #R62622. c45406 LD HL,24776 ; Point HL at Table of Characters' Current Stats (Off-White's entry, i.e. not including Magic ; Knight)... 45409 JR 45393 ; ...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 #R43117, #R43158, #R43199, #R43250 and #R45434. Output: HL Address of start of Current ; Character's stats IX Address of start of Current Character's stats c45411 LD A,(41937) ; Load A with index of Current Character 45414 LD E,0 ; Point HL at Current Character's current strength... 45416 CALL 45406 ; ... 45419 PUSH HL ; Transfer address from HL... 45420 POP IX ; ...to IX 45422 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 #R43117, #R43158, #R43199 and #R43250. Input: IX Pointer to start of a character's ; current stats B Happiness threshold c45423 LD A,(IX+1) ; If character's current happiness is at or above the threshold value... 45426 AND 127 ; ... 45428 CP B ; ... 45429 RET NC ; ...then return 45430 POP AF ; Remove return value from top of stack as we are not RETurning 45431 JP 64280 ; 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 #R41924, #R42257, #R42638, #R43043 and #R43199. Input: A Value by which to change ; character's Happiness c45434 PUSH AF ; Store AF (A = increment value) 45435 CALL 45411 ; Point IX at Current Character's current stats 45438 POP AF ; Restore AF (A = increment value) 45439 LD C,A ; Load increment value into C 45440 LD A,(IX+1) ; Add increment value to Current Character's Happiness... 45443 CALL 62594 ; ... 45446 LD (IX+1),A ; ...and store 45449 RET ; Return ; Point IX at Current Inventory of Character A ; ; Used by the routines at #R41924, #R42036, #R42157, #R42257 and #R45670. Input: A Index of a character Output: IX ; Points to current inventory of character A c45450 PUSH DE ; Store DE 45451 LD E,A ; Multiply character index by five (as each character has five inventory slots)... 45452 ADD A,A ; ... 45453 ADD A,A ; ... 45454 ADD A,E ; ... 45455 LD E,A ; ...and load into DE... 45456 LD D,0 ; ... 45458 LD IX,24858 ; Point IX at Off-White Knight's entry in Characters' Current Inventories Table (i.e. first ; entry for non-player characters) 45462 ADD IX,DE ; Add five times character index to this as offset 45464 POP DE ; Restore DE 45465 RET ; Return ; Test Whether Current Object is too Heavy for Magic Knight to Pick Up (or Take) ; ; Used by the routines at #R41578 and #R41924. Output: F S Flag set if object is light enough to be picked up, ; reset otherwise c45466 LD IX,24848 ; Point IX at start of Magic Knight's current inventory 45470 LD A,(24768) ; Load Magic Knight's current strength into A 45473 PUSH AF ; Store AF (A = Magic Knight's current strength) 45474 LD BC,1280 ; Load B with 5 (as five inventory slots to check) and C (total weight carried) with zero *45477 LD A,(IX+0) ; Load object in current inventory slot 45480 OR A ; If no object present... 45481 JR Z,45492 ; ...skip ahead to #R45492... 45483 CALL 45351 ; Load A with weight of object A 45486 ADD A,C ; Add C to this... 45487 LD C,A ; ...and load result into C (total weight so far) 45488 INC IX ; Advance to next inventory slot 45490 DJNZ 45477 ; Loop back for next inventory slot *45492 POP AF ; Restore AF (A = Magic Knight's current strength) 45493 AND 127 ; Ensure that strength is capped at 127 and that Sign Flag is reset 45495 SUB C ; Subtract total weight of Magic Knight's carried objects from his strength to get "surplus" ; strength... 45496 LD C,A ; ...and load into C 45497 LD A,(41779) ; Load A with index of Current Object (i.e. object Magic Knight is trying to pick up) 45500 CALL 45351 ; Load A with weight of object A 45503 CP C ; Set Sign Flag if surplus strength exceeds weight of object, otherwise reset 45504 RET ; Return ; Check Whether Magic Knight is Wearing an Object ; ; Used by the routines at #R38841, #R40546, #R40614, #R46560 and #R62330. Input: A Index of an object Output: F ; Zero Flag set if object is present in inventory, reset otherwise c45505 LD HL,24853 ; Point HL at start of Magic Knight's Inventory (Wearing) 45508 JR 45513 ; Jump to #R45513 (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 #R38780, #R40190, #R40258, #R40614, #R42157, #R43494, #R44100, #R45149, #R46183, #R46326, ; #R46463, #R46490 and #R62443. Input: A Index of an object HL (entry at #R45513) Pointer to start of a ; character's inventory Output: F Zero Flag set if object is present in inventory, reset otherwise c45510 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) ; This entry point is used by the routines at #R45227, #R45505 and #R45670. *45513 LD B,5 ; Load B with 5 (as characters have five inventory slots) *45515 CP (HL) ; If object at current inventory slot is the object of interest... 45516 RET Z ; ...then return with zero flag set 45517 INC HL ; Advance HL to next inventory slot 45518 DJNZ 45515 ; Decrease B (remaining number of inventory slots to check) and loop back to #R33650 45520 OR A ; Reset zero flag, as object is not present 45521 RET ; Return ; Insert Current Time and Score into "Time Left" and "Percentage Completion" Texts ; ; Used by the routines at #R42638 and #R64582. Input: HL Points to percentage completion text (#R52302 or #R50756) ; DE Points to time left text (#R52302 or #R50756) c45522 PUSH DE ; Store DE (address of time left text) 45523 PUSH HL ; Store HL (address of percentage completion text) 45524 LD HL,23488 ; Point HL at Visited Rooms table 45527 LD BC,13312 ; Set B=52, C=0 *45530 LD A,(HL) ; Load A with value at HL 45531 ADD A,C ; Add this to C... 45532 LD C,A ; ... 45533 INC HL ; Advance to next byte 45534 DJNZ 45530 ; Loop back to #R45530 (adding together 52 values from #R23488 onwards to get score for ; exploring rooms) 45536 DEC C ; Decrease exploration score by one (due to no score for The Sword in the Concrete) 45537 LD A,(23446) ; Add Bonus Score to total... 45540 ADD A,C ; ... 45541 POP HL ; Restore HL (address of percentage completion text) 45542 CALL 46837 ; Splice numeric data A as a string into a string at HL 45545 LD A,(23457) ; Load A with number of hours left 45548 POP HL ; Restore HL (originally DE, address of time left text) 45549 JP 46837 ; Splice numeric data A as a string into a string at HL and return ; Display "[Character] IS ASLEEP" Window and Jump to Main Game Loop if Current Character is Asleep, else Return ; ; Used by the routines at #R43199, #R43250, #R43318, #R43428 and #R44933. Output: A Zero if character is awake c45552 PUSH HL ; Store HL 45553 LD A,(41937) ; Load A with index of Current Character 45556 LD E,6 ; Point HL at character's Flags... 45558 CALL 45406 ; ... 45561 BIT 7,(HL) ; If character is awake... 45563 JR Z,45581 ; ...then skip ahead to #R45581 45565 LD A,25 ; Draw Window 25... 45567 CALL 47193 ; ... 45570 LD HL,50937 ; Point HL at "[Current Character's short name] IS ASLEEP" text 45573 CALL 46902 ; ...and print to screen 45576 POP HL ; Restore HL 45577 POP HL ; Remove value from top of stack as we are not RETurning 45578 JP 41739 ; Display "PRESS FIRE TO CONTINUE" Window and wait for input and return to Main Game Loop *45581 POP HL ; Restore HL 45582 XOR A ; Set A to zero 45583 RET ; Return ; Load Magic Knight's Coordinates (in Characters) into DE ; ; Used by the routines at #R41578 and #R41748. Output: D y-coordinate (characters) E x-coordinate (characters) c45584 LD A,(24841) ; Load Magic Knight's current y-coordinate into A 45587 CALL 40658 ; Divide A by eight, rounding down to nearest integer 45590 ADD A,3 ; Add 3 (as Magic Knight is four characters tall) 45592 LD D,A ; And load result into D 45593 LD A,(24840) ; Load Magic Knight's current x-coordinate into A 45596 CALL 40658 ; Divide A by eight, rounding down to nearest integer 45599 LD E,A ; Load result into E 45600 RET ; Return ; Point HL at Current Position Data for Current Character ; ; Used by the routines at #R43199 and #R44337. Output: HL Address of Current Character's entry in Table of ; Characters' Current Positions c45601 PUSH BC ; Store BC 45602 LD A,(41937) ; Load BC index of Current Character... 45605 LD C,A ; ...multiply by three... 45606 ADD A,A ; ... 45607 ADD A,C ; ... 45608 LD C,A ; ...and load into BC... 45609 LD B,0 ; ... 45611 LD HL,24898 ; Load HL with start address of Table of Characters' Current Positions... 45614 ADD HL,BC ; ...and add BC as offset 45615 POP BC ; Restore BC 45616 RET ; Return ; Adjust Height (at DE) of a Window to Accommodate Text ; ; Used by the routines at #R43874, #R44635, #R45641, #R45685, #R45723, #R45963, #R64317 and #R64582. Input: HL ; Points to height byte preceding text data DE Points to third byte of an entry in table at #R49034 (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) c45617 LD A,(HL) ; Load height data into C... 45618 LD C,A ; ... 45619 LD A,(DE) ; Load y-coordinate in characters of window of interest into A 45620 ADD A,C ; Add height to window's top y-coordinate to get required bottom y-coordinate 45621 INC DE ; Advance DE to y-coordinate of bottom edge of window... 45622 LD (DE),A ; ...and load calculated bottom y-coordinate into address in DE 45623 INC HL ; Advance HL to first byte of actual text data 45624 RET ; Return ; Set a Window's Height to A ; ; Used by the routine at #R46106. Input: A A window height DE Location of a window's top y-coordinate data c45625 LD C,A ; Load window height into C 45626 LD A,(DE) ; Load window's top y-coordinate into A 45627 ADD A,C ; Add C to give bottom y-coordinate 45628 INC DE ; Advance DE to window's bottom y-coordinate data... 45629 LD (DE),A ; ...and update with new height value in A 45630 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 #R44635. c45631 LD A,(24853) ; If Magic Knight's first inventory slot (wearing) is not empty... 45634 OR A ; ... 45635 RET NZ ; ...then return 45636 LD HL,51353 ; Point HL at "YOU ARE NOT WEARING ANYTHING" text 45639 JR 45649 ; 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 #R41748, #R42257, #R42638 and #R44635. Output: F Zero Flag set if Magic Knight's (first) ; inventory (slot) is empty. Reset otherwise c45641 LD A,(24848) ; Load A with index of first object in Magic Knight's (Carrying) inventory... 45644 OR A ; ...and if this is zero... 45645 RET NZ ; ...then return 45646 LD HL,51335 ; Point HL at "YOU ARE NOT CARRYING ANYTHING" text ; This entry point is used by the routine at #R45631. *45649 LD DE,49140 ; Adjust height of window 13 to accommodate text... 45652 CALL 45617 ; ... 45655 PUSH HL ; Store HL (pointer to text to print) 45656 LD A,13 ; Draw Window 13... 45658 CALL 47193 ; ... 45661 POP HL ; Restore HL (pointer to text to print) 45662 CALL 46902 ; Print text to screen 45665 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 45668 XOR A ; Load A with zero 45669 RET ; Return ; Unused routine ; ; Check whether Current Character is carrying an object. Input: E Index of an object Output: F (via jumped-to ; routine at #R45510) Zero Flag set if object is present in inventory, reset otherwise c45670 LD A,(41937) ; Load A with index of Current Character 45673 PUSH DE ; Store DE (E = index of object to check for) 45674 CALL 45450 ; Point IX at current inventory of character with index A... 45677 PUSH IX ; ...and copy into HL... 45679 POP HL ; ... 45680 POP DE ; Restore DE (E = index of object to check for) 45681 LD A,E ; Load index of object to check for into A 45682 JP 45513 ; Check if object is in inventory data at HL and (re)set Zero Flag accordingly ; If A is 4 then Display "THE BEAR SAYS..." Message and wait for Fire to be pressed ; ; Used by the routines at #R41578, #R41748, #R41924, #R42257, #R42638, #R43494, #R43636, #R44337, #R44635 and ; #R45095. Input: A Index of an object Output: A Index of an object (same as input value) c45685 CP 4 ; If object of interest is not 4 (Teddy Bear)... 45687 RET NZ ; ...then return 45688 PUSH HL ; Store HL 45689 PUSH DE ; Store DE 45690 PUSH BC ; Store BC 45691 PUSH IX ; Store IX 45693 LD HL,51885 ; Load HL with address of "THE BEAR SAYS..." text 45696 LD DE,49212 ; Adjust height of a Window 22 to accommodate text... 45699 CALL 45617 ; ... 45702 PUSH HL ; Store HL (address of text to print) 45703 LD A,22 ; Draw Window 22... 45705 CALL 47193 ; ... 45708 POP HL ; Restore HL (address of text to print) 45709 CALL 46902 ; Print "THE BEAR SAYS..." text 45712 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 45715 LD A,4 ; Load A with 4 (restore original value of A) 45717 POP IX ; Restore IX 45719 POP BC ; Restore BC 45720 POP DE ; Restore DE 45721 POP HL ; Restore HL 45722 RET ; Return ; End the Game if Current Character is Off-White or Grunter ; ; Used by the routines at #R42244, #R42491, #R43043 and #R44933. c45723 LD A,(41937) ; If Current Character is 7 (Grunter)... 45726 CP 7 ; ... 45728 JR Z,45760 ; ...then skip ahead to #R45760 45730 OR A ; If Current Character is not 0 (Off-White)... 45731 RET NZ ; ...then return ; Current Character is Off-White 45732 LD HL,51164 ; Point HL at "OFF-WHITE KNIGHT SAYS " text 45735 LD DE,49228 ; Adjust height of window 24 ("Game Over" Window) to accommodate text... 45738 CALL 45617 ; ... 45741 PUSH HL ; Store HL (points to first character of text to display) 45742 LD A,24 ; Draw Window 24 ("Game Over" Window)... 45744 CALL 47193 ; ... 45747 POP HL ; Restore HL (points to first character of text to display) 45748 CALL 46902 ; Print text to screen 45751 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 45754 LD HL,51310 ; Point HL at "YOU WERE KILLED BY OFF-WHITE KNIGHT." text 45757 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Current Character is Grunter *45760 LD HL,51090 ; Point HL at "[Current Character's full name] KILLED YOU AS YOU APPROACHED." text 45763 JP 64582 ; Display cyan "Game Over" Window and return to Control Selection Menu ; Print Name of Object in Inventory Slot A of Inventory Data at HL in Command Summary Window ; ; Used by the routines at #R41748, #R41924, #R42257, #R42638, #R43494, #R43636, #R44337, #R44635 and #R45095. Input: ; A Index of an inventory slot, with first slot being zero HL Points to start of a character's inventory c45766 LD E,A ; Load inventory slot number into DE... 45767 LD D,0 ; ... 45769 ADD HL,DE ; Add to HL as offset 45770 LD A,(HL) ; Load index of object in that slot into A 45771 LD (41779),A ; Set this object as the Current Object 45774 LD DE,45779 ; Point DE at instruction to print name of Current Object... 45777 JR 45795 ; ...print in Command Summary Window at top of screen and return ; Code for Printing Routine to Display Name of Current Object b45779 DEFM 29,0 ; name of Current Object ; Update Current Character Based Upon Selection Made in Menu ; ; Used by the routine at #R45963. Input: A Index of selected character from a character-selection menu c45781 LD HL,23422 ; Point HL at list of characters in room of interest 45784 LD E,A ; Load DE with index of selected item in menu... 45785 LD D,0 ; ... 45787 ADD HL,DE ; Add this as offset in table of characters in room to point to character of interest 45788 LD A,(HL) ; Load index of this character into A 45789 LD (41937),A ; Modify operand of instruction at #R41936 to use this particular character (i.e. set Current ; Character) ; This entry point is used by the routines at #R41924 and #R46106. *45792 LD DE,45798 ; Point DE at instruction to print short name of Current Character ; This entry point is used by the routine at #R45766. *45795 JP 63349 ; Print text at DE in Command Summary Window at top of screen and return ; Code for Printing Routine to Display Short Name of Current Character b45798 DEFM 31,0 ; short name of Current Character ; Code for Printing Routine to Display Full Name of Current Character b45800 DEFM 30,0 ; full name of Current Character ; Display a Character's Inventory Window as an Information Window ; ; Used by the routine at #R41578. Input: IX Points to a character's inventory (usually Magic Knight) c45802 LD A,111 ; Modify instruction at #R45867 to display as information window, rather than menu window... 45804 LD (45868),A ; ... 45807 JR 45834 ; Jump into inventory window drawing routine ; Show List of Objects (Window or Menu) and Handle Selection if a Menu ; ; Used by the routines at #R41748, #R41924, #R42257, #R42638, #R43494, #R43636, #R44337, #R44635 and #R45095. 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 #R45809) Points to full command text ; (e.g. "DROP WHICH OBJECT?", or "YOU ARE NOW CARRYING") HL (entry via #R45834) Points to "YOU ARE NOW CARRYING" ; text IX Points to a character's inventory Output: A Zero-based index of selected menu item c45809 CALL 62959 ; Store all registers on the stack 45812 CALL 47930 ; Play downward scale sound 45815 CALL 62987 ; Restore all registers from the stack 45818 LD A,105 ; Modify instruction at #R45867 with 105, denoting window as a menu rather than information ; window... 45820 LD (45868),A ; ... 45823 PUSH BC ; Store BC (B = number of inventory slots) 45824 PUSH HL ; Store HL 45825 PUSH IX ; Store IX 45827 CALL 63388 ; Print Command Summary Text at DE (e.g. "DROP THE ") in Command Summary Window 45830 POP IX ; Restore IX 45832 POP HL ; Restore HL 45833 POP BC ; Restore BC ; This entry point is used by the routine at #R45802. *45834 LD C,0 ; Load C (object counter) with zero 45836 PUSH BC ; Store BC (B = number of inventory slots) 45837 PUSH IX ; Store IX (points to start of inventory) *45839 LD A,(IX+0) ; Load object from character's inventory (slot number C) into A 45842 OR A ; If nothing in this slot... 45843 JR Z,45850 ; ...then jump ahead to #R45850 45845 INC C ; Increase count of objects in inventory 45846 INC IX ; Advance IX to next slot 45848 DJNZ 45839 ; Loop back to #R45839 for next slot *45850 POP IX ; Restore IX (points to start of inventory) 45852 LD A,C ; Copy number of objects into A 45853 OR A ; If number of objects is zero... 45854 JP Z,45937 ; ...then jump ahead to #R45937 45857 LD A,(49068) ; Load A with y-coordinate of top edge of Window 04 45860 ADD A,C ; Add number of objects to this y-coordinate 45861 ADD A,3 ; Add an additional 3 to this total (menu window padding) 45863 LD (49069),A ; Set y-coordinate of bottom edge of Window 04 to accommodate list of C objects 45866 PUSH HL ; Store HL (e.g. pointer to "DROP WHICH OBJECT?" text) ; The operand of the instruction at #R45867 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instructions at #R45804 and #R45820. 45867 LD A,0 ; Load A with menu / static window value 45869 CP 105 ; If this is not 105 (i.e. window is not a menu, but a simple information window)... 45871 JR NZ,45880 ; ...then skip ahead to #R45880 45873 LD A,4 ; Draw Window 4 as a menu window... 45875 CALL 47185 ; ... 45878 JR 45885 ; ...and skip over "draw an information window" section *45880 LD A,4 ; Draw Window 4 as an information window... 45882 CALL 47193 ; ... *45885 POP HL ; Restore HL (pointer to full command text)... 45886 PUSH IX ; Store IX (points to start of inventory) 45888 CALL 46902 ; Print text to screen 45891 POP IX ; Restore IX (points to start of inventory) 45893 POP BC ; Restore BC (B = number of remaining inventory slots) *45894 PUSH BC ; Store BC (B = number of remaining inventory slots) 45895 LD A,(IX+0) ; Load index of object in current inventory into A 45898 OR A ; If index is zero (i.e. inventory slot is empty)... 45899 JP Z,45927 ; ...then skip ahead to #R45927 45902 LD B,A ; Copy index into B 45903 PUSH IX ; Store IX (pointer to start of inventory) 45905 LD HL,50753 ; Point HL to text printing instruction to move cursor to start of next character row within ; window, then right by two characters 45908 PUSH BC ; Store BC (B = index of an object) 45909 CALL 46902 ; Print text to screen (i.e. move text printing cursor right by two characters) 45912 POP BC ; Restore BC (B = index of an object) 45913 CALL 63332 ; Point HL at object B's name in Table of Object Names... 45916 CALL 46902 ; ...and print to screen 45919 POP IX ; Restore IX (pointer to start of inventory) 45921 INC IX ; Advance IX to next inventory slot 45923 POP BC ; Restore BC (B = number of remaining inventory slots) 45924 DJNZ 45894 ; Repeat loop for next object in inventory, decreasing B (number of remaining inventory slots) 45926 PUSH BC ; Store BC (B = 0) *45927 POP BC ; Restore BC (B = number of remaining inventory slots 45928 LD A,(45868) ; If window is a menu, rather than information window... 45931 CP 105 ; ... 45933 CALL Z,47502 ; ...process keyboard / joystick input on a menu and load A with selected item index 45936 RET ; ...and return *45937 PUSH HL ; Store HL (pointer to "YOU ARE NOW CARRYING" text) 45938 LD A,(49068) ; Load A with y-coordinate of top edge of Window 04 45941 ADD A,4 ; Add 4 to this y-coordinate 45943 LD (49069),A ; Set y-coordinate of bottom edge of Window 04 to accommodate three rows of text 45946 LD A,4 ; Draw Window 4... 45948 CALL 47193 ; ... 45951 POP HL ; Restore HL (pointer to "YOU ARE NOW CARRYING" text) 45952 CALL 46902 ; ...and print to screen 45955 LD HL,56565 ; Point HL at "NOTHING AT ALL" text... 45958 CALL 46902 ; ...and print to screen 45961 POP BC ; Restore BC (number of inventory slots, PUSHed by instruction at #R45836) 45962 RET ; Return ; Display and Process Input for Character Selection Menu (Current Room's Characters Only) ; ; Used by the routines at #R41924, #R42257, #R42638, #R43043, #R43636 and #R44933. 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 c45963 PUSH HL ; Store HL (pointer to text to append to menu's title string) 45964 PUSH BC ; Store BC 45965 PUSH IX ; Store IX 45967 PUSH DE ; Store DE (Command Summary Text Pointer) 45968 CALL 47938 ; Play Short Downward Scale Sound 45971 POP DE ; Restore DE (Command Summary Text Pointer) 45972 CALL 63388 ; Print text at Command Summary Text Pointer (e.g. "COMMAND ") in Command Summary Window 45975 LD A,(23702) ; Load A with Magic Knight's current room... 45978 CALL 46408 ; ...and create list of characters in this room at #R23422, loading A with number of characters 45981 JR NZ,46011 ; If there are characters in this room then skip ahead to #R46011 45983 LD HL,51381 ; Point HL at "THERE IS NOBODY IN THIS ROOM" text 45986 LD DE,49140 ; Adjust height of window 13 to accommodate text... 45989 CALL 45617 ; ... 45992 PUSH HL ; Store HL (pointer to start of text to print) 45993 LD A,13 ; Draw Window 13... 45995 CALL 47193 ; ... 45998 POP HL ; Restore HL (pointer to start of text to print) 45999 CALL 46902 ; Print text at HL 46002 CALL 64230 ; Wait for Interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 46005 POP IX ; Restore IX 46007 POP BC ; Restore BC 46008 POP HL ; Restore HL (pointer to text to append to menu's title string) 46009 XOR A ; Set A to zero and set Zero Flag 46010 RET ; Return *46011 ADD A,4 ; Add four to number of characters in current room (for menu size padding)... 46013 LD C,A ; ...and load value into C 46014 LD A,(49060) ; Load A with window's top y-coordinate 46017 ADD A,C ; Add 4 + number of characters... 46018 LD (49061),A ; ...and set window's bottom y-coordinate to this value 46021 POP IX ; Restore IX 46023 POP BC ; Restore BC 46024 LD A,3 ; Draw Window 3 as a menu window... 46026 CALL 47185 ; ... 46029 LD HL,51367 ; Point HL at "WHO DO YOU WANT TO " text... 46032 CALL 46902 ; ...and print to screen 46035 POP HL ; Restore HL (pointer to text to append to menu's title string, as at beginning of this ; routine) 46036 CALL 46902 ; Append this text to menu's title 46039 LD IX,23422 ; Point IX at list of characters in room 46043 LD B,8 ; Load B with 8 (8 characters) *46045 PUSH BC ; Store BC (B = remaining characters to process) 46046 LD A,(IX+0) ; Load A with index of current character in list... 46049 CP 255 ; ...and if this is 255 (End Marker)... 46051 JP Z,46095 ; ...then skip ahead to #R46095 46054 LD HL,50753 ; Point HL at text printing instructions to move cursor to start of next character row within ; window, then right by two characters 46057 PUSH IX ; Store IX (current position in list of characters in room) 46059 CALL 46902 ; Print text at HL to screen (i.e. move cursor) 46062 POP IX ; Restore IX (current position in list of characters in room) 46064 LD A,(IX+0) ; Load A with index of current character in list... 46067 LD (41937),A ; Set this character as the Current Character 46070 LD HL,45800 ; Point HL at instruction to print full name of Current Character 46073 PUSH IX ; Store IX (current position in list of characters in room) 46075 CALL 46902 ; Print text to screen 46078 POP IX ; Restore IX (current position in list of characters in room) 46080 INC IX ; Advance IX to next character in list 46082 POP BC ; Restore BC (B = remaining characters to process) 46083 DJNZ 46045 ; Decrease B and loop back to #R46045 46085 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 46088 CALL 45781 ; Update Current Character based upon selection made in menu 46091 LD A,1 ; Load A with 1 46093 OR A ; Reset Zero Flag 46094 RET ; Return *46095 POP BC ; Restore BC (B = remaining characters to process) 46096 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 46099 CALL 45781 ; Update Current Character based upon selection made in menu 46102 LD A,1 ; Load A with 1 46104 OR A ; Reset Zero Flag 46105 RET ; Return ; Display and Process Input for Character Selection Menu (Character List Defined at HL) ; ; This routine is called at #R44116 and #R44397. In both cases, the address of a piece of text ("TRAVEL TO" or ; "SUMMON") is PUSHed onto the Stack just before the call. Input: HL Start address of list of characters for a ; character selection menu c46106 LD (46138),HL ; Load list start address into operand of instruction at #R46137 46109 PUSH HL ; Store HL (start address of list of characters) 46110 CALL 47938 ; Play Short Downward Scale Sound 46113 POP HL ; Restore HL (start address of list of characters) 46114 LD DE,49060 ; Point DE at y-coordinate of top edge of Window 3 in Window Data Table at #R49034... 46117 LD A,(HL) ; Load required window height from start of list of characters... 46118 CALL 45625 ; ...and set window's height to this value 46121 LD A,3 ; Display character selection menu... 46123 CALL 47185 ; ... 46126 LD HL,51367 ; Print "WHO DO YOU WANT TO " text... 46129 CALL 46902 ; ... 46132 POP HL ; Restore HL (address to return to upon RET instruction)... 46133 EX (SP),HL ; ...and swap with next value on stack (pointer to text that was PUSHed before this routine was ; called) 46134 CALL 46902 ; Print the text ("TRAVEL TO" or "SUMMON") ; The operand of the instruction at #R46137 represents the start address of the list of characters. This is modified ; by the instruction at #R46106. 46137 LD HL,0 ; Load HL with start address of list of characters *46140 INC HL ; Advance HL by one byte 46141 LD A,(HL) ; If value at HL is 255 (End Marker)... 46142 CP 255 ; ... 46144 JR Z,46165 ; ...then skip ahead to #R46165 46146 PUSH HL ; Store HL (current position in list of characters) 46147 LD (41937),A ; Set character at current position in list to be Current Character 46150 LD HL,50753 ; Point HL to text printing instruction to move cursor to start of next character row within ; window, then right by two characters... 46153 CALL 46902 ; ...and print 46156 LD HL,45800 ; Point HL at instruction to print full name of Current Character... 46159 CALL 46902 ; ...and print 46162 POP HL ; Restore HL (current position in list of characters) 46163 JR 46140 ; Loop back to #R46140 for next entry in list *46165 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index 46168 INC A ; Add one to selected item index (as first entry in list is window height)... 46169 LD C,A ; ...and load into BC... 46170 LD B,0 ; ... 46172 LD HL,(46138) ; Load HL with list start address... 46175 ADD HL,BC ; ...and add BC as offset 46176 LD A,(HL) ; Load A with entry at position HL in list (i.e. index of selected character)... 46177 LD (41937),A ; ...and set as Current Character 46180 JP 45792 ; Print character's name and return ; Set Magic Knight's Available Action Flags ; ; Used by the routines at #R38024, #R39393, #R41578, #R42494 and #R43636. c46183 LD HL,0 ; Reset all Available In-Game Menu Command Flags... 46186 LD (23698),HL ; ... 46189 LD A,3 ; If Magic Knight is not carrying the Wand of Command... 46191 CALL 45510 ; ... 46194 JR NZ,46200 ; ...then skip ahead to #R46200 46196 SET 0,(IY+88) ; Set "COMMAND A CHARACTER" Menu Command Flag (IY = 23610) *46200 LD A,(24771) ; Load A with Magic Knight's current Magic Level... 46203 AND 127 ; ...stripping out unused bit 46205 JR Z,46211 ; If Magic Level is zero then skip ahead to #R46211 46207 SET 5,(IY+88) ; Set "CAST A SPELL" Menu Command Flag (IY = 23610) *46211 LD A,(23702) ; If Magic Knight's current room is 1 (Outdoors, 0, Bearwoolf's Hoard)... 46214 CP 1 ; ... 46216 JR Z,46233 ; ...then skip ahead to #R46233 46218 CP 2 ; If Magic Knight's current room is 2 (Outdoors, 1, Bearwoolf's Cave)... 46220 JR Z,46233 ; ...then skip ahead to #R46233 46222 LD A,31 ; If Magic Knight is not carrying the Teleport Key... 46224 CALL 45510 ; ... 46227 JR NZ,46233 ; ...then skip ahead to #R46233 46229 SET 2,(IY+88) ; Set "TELEPORT" Menu Command Flag (IY = 23610) *46233 LD A,10 ; If Magic Knight is not carrying the Horse Feather... 46235 CALL 45510 ; ... 46238 JR NZ,46244 ; ...then skip ahead to #R46244 46240 SET 0,(IY+89) ; Set "TICKLE A CHARACTER" Menu Command Flag (IY = 23610) *46244 XOR A ; Load C with weights / flags of all Magic Knight's carried objects, OR-ed Together... 46245 CALL 46380 ; ... 46248 BIT 5,C ; ...and if Can Be Read Flag is not set for any of the objects... 46250 JR Z,46256 ; ...then skip ahead to #R46256 46252 SET 3,(IY+88) ; Set "READ SOMETHING" Menu Command Flag (IY = 23610) *46256 BIT 6,C ; If Can Be Blown Flag is not set for any of the objects... 46258 JR Z,46264 ; ...then skip ahead to #R46264 46260 SET 6,(IY+88) ; Set "BLOW SOMETHING" Menu Command Flag (IY = 23610) *46264 LD A,1 ; Load C with flags (2) of all Magic Knight's carried objects, OR-ed Together... 46266 CALL 46380 ; ... 46269 BIT 3,C ; ...and if Can Be Worn Flag is set for at least one of the objects... 46271 JR NZ,46279 ; ...then skip ahead to #R46279 46273 LD A,(24853) ; If Magic Knight's first inventory slot (wearing) is empty... 46276 OR A ; ... 46277 JR Z,46283 ; ...then skip ahead to #R46283 *46279 SET 7,(IY+88) ; Set "WEAR/UNWEAR OBJECT" Menu Command Flag (IY = 23610) *46283 LD A,1 ; Load A with flags (2) of all Magic Knight's carried objects, OR-ed Together... 46285 CALL 46380 ; ... 46288 LD A,C ; ... 46289 AND 224 ; If bits 5 (Can Be Thrown Flag) 6 (Can Be Thrown and is Lethal Flag) and 7 (Can Be Thrown ; Flag) are all reset... 46291 JR Z,46297 ; ...then skip ahead to #R46297 46293 SET 4,(IY+88) ; Set "THROW SOMETHING" Menu Command Flag (IY = 23610) *46297 LD A,(23702) ; Load B with Magic Knight's current room... 46300 LD B,A ; ... 46301 LD HL,46315 ; Load HL with start address of List of Indices of Rooms with Levers *46304 LD A,(HL) ; If current index is the same as Magic Knight's current room... 46305 CP B ; ... 46306 JR Z,46326 ; ...then set additional action flags including "PULL LEVER" and return 46308 CP 255 ; If current index is 255 (End Marker)... 46310 JR Z,46330 ; ...then set additional action flags excluding "PULL LEVER" and return 46312 INC HL ; Advance HL to next room in list 46313 JR 46304 ; Loop back to #R46304 ; List of Indices of Rooms with Levers b46315 DEFB 20 ; Castle Ground Floor, 3 46316 DEFB 24 ; Castle First Floor, 0 (Main Lever 7) 46317 DEFB 25 ; Castle First Floor, 1 (Main Lever 6) 46318 DEFB 26 ; Castle First Floor, 2 (Security Door & Main Lever 5) 46319 DEFB 27 ; Castle First Floor, 3 (Main Lever 4) 46320 DEFB 28 ; Castle First Floor, 4 (Main Lever 3) 46321 DEFB 29 ; Castle First Floor, 5 (Main Lever 2) 46322 DEFB 30 ; Castle First Floor, 6 (Main Lever 1) 46323 DEFB 34 ; Castle Second Floor, 3 (One Way Corridor, 1) 46324 DEFB 38 ; Castle Second Floor, 6 46325 DEFB 255 ; End Marker ; Set Magic Knight's Available Action Flags (Additional) ; ; Used by the routine at #R46183. c46326 SET 1,(IY+89) ; Set "PULL LEVER" Menu Command Flag (IY = 23610) ; This entry point is used by the routine at #R46183. *46330 LD A,4 ; Load A with Attribute Flags and Can Smell flags of all Magic Knight's carried objects, OR-ed ; Together... 46332 CALL 46380 ; ... 46335 LD A,C ; ... 46336 AND 240 ; Reset all but bits 4, 5, 6 and 7 (the four Can Smell flags)... 46338 JR Z,46344 ; ...and if these flags are all reset then skip ahead to #R46344 46340 SET 2,(IY+89) ; Set "SMELL SOMETHING" Menu Command Flag (IY = 23610) *46344 LD A,(23365) ; If Wish Pending Flag is reset... 46347 OR A ; ... 46348 JR Z,46361 ; ...then skip ahead to #R46361 46350 LD A,(23702) ; If Magic Knight's current room is not 14... 46353 CP 14 ; ... 46355 JR NZ,46361 ; ...then skip ahead to #R46361 46357 SET 3,(IY+89) ; Set "HAVE A WISH" Menu Command Flag (IY = 23610) *46361 LD A,17 ; If Magic Knight is carrying the Bottle of Liquid (17)... 46363 CALL 45510 ; ... 46366 JR Z,46375 ; ...then skip ahead to #R46375 46368 LD A,18 ; If Magic Knight is not carrying the Bottle of Liquid (18)... 46370 CALL 45510 ; ... 46373 JR NZ,46379 ; ...then skip ahead to #R46379 *46375 SET 4,(IY+89) ; Set "HAVE A DRINK" Menu Command Flag (IY = 23610) *46379 RET ; Return ; Load C with Property of Index A for All Magic Knight's Carried Objects, OR-ed Together ; ; Used by the routines at #R46183 and #R46326. Input: A Index of required property of objects Output: C Flags of ; all objects held, OR-ed together c46380 LD (46396),A ; Modify instruction at #R46395 with index of required property 46383 LD IX,24848 ; Point IX at Magic Knight's current inventory (carrying) 46387 LD BC,1280 ; Load B with 5 and C with 0 (i.e. reset all bits in C) *46390 LD A,(IX+0) ; If Magic Knight's current inventory slot is empty... 46393 OR A ; ... 46394 RET Z ; ...then return ; The operand of the instruction at #R46395 represents the index of the required property. This is modified by the ; instruction at #R46380. 46395 LD E,1 ; Load E with index of required property 46397 CALL 45390 ; Point HL to the E-th byte of the A-th record in Object Properties Table 46400 LD A,(HL) ; Load A with value of required property (flags)... 46401 OR C ; ...and set corresponding bits of C... 46402 LD C,A ; ... 46403 INC IX ; Advance IX to next inventory slot... 46405 DJNZ 46390 ; ...and loop back to #R46390 for next object 46407 RET ; Return ; Create List of Characters in Room A at 23422 and Load A with Number of Characters ; ; Used by the routine at #R45963. Input: A Room index Output: A Number of characters in room F Zero Flag set if ; no characters in room, reset otherwise c46408 LD (46437),A ; Modify instruction at #R46436 with room index 46411 PUSH HL ; Store HL 46412 PUSH BC ; Store BC 46413 PUSH DE ; Store DE 46414 PUSH IX ; Store IX 46416 LD A,255 ; Set A to 255 (End Marker) 46418 LD HL,23429 ; Point HL at end of Table of Characters in Room of Interest 46421 LD B,8 ; Load B with 8 (as we are clearing 8 entries in the list) *46423 LD (HL),A ; Set value at address in HL to 255 46424 DEC HL ; Move HL back one byte 46425 DJNZ 46423 ; Loop back to #R46423 46427 LD IX,24898 ; Point IX at start of Table of Characters' Current Positions at #R24898 46431 LD D,0 ; Set D (index of current character) to zero 46433 LD B,8 ; Load B with 8 (as there are 8 characters in the game) 46435 LD C,D ; Set C (count of characters in room of interest) to zero ; The operand of the instruction at #R46436 represents a room index. This is modified by the instruction at #R46408. *46436 LD A,0 ; Load A with room index 46438 CP (IX+0) ; If current character's current room is not the room of interest... 46441 JR NZ,46446 ; ...then skip ahead to #R46446 46443 INC C ; Increase C (count of number of characters in room of interest) 46444 INC HL ; Advance HL by one byte 46445 LD (HL),D ; Load index of current character into address in HL *46446 INC IX ; Advance IX to next character's position data... 46448 INC IX ; ... 46450 INC IX ; ... 46452 INC D ; Increase index of current character (i.e. advance to next character) 46453 DJNZ 46436 ; Loop back to #R46436 46455 LD A,C ; Load number of characters in room of interest into A 46456 OR A ; Set zero flag is there are no characters in room, otherwise reset 46457 POP IX ; Restore IX 46459 POP DE ; Restore DE 46460 POP BC ; Restore BC 46461 POP HL ; Restore HL 46462 RET ; Return ; Print Magic Knight's Current Strength at (6, 2) as Text if he is Carrying the Mirror ; ; Used by the routines at #R38780, #R40153, #R40201 and #R46560. c46463 LD A,20 ; If Magic Knight is not carrying the Mirror (20)... 46465 CALL 45510 ; ... 46468 RET NZ ; ...then return 46469 CALL 64935 ; Set left and right x-coordinates (#R23408 and #R23410) to edges of screen and load A with ; Magic Knight's current strength 46472 LD HL,51067 ; Point HL at "---" text... 46475 CALL 46837 ; ...and overwrite with Magic Knight's current strength as a string 46478 LD HL,16454 ; Load HL with Display File address corresponding to (6, 2) (characters)... 46481 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 46484 LD HL,51067 ; Load HL with address of text containing Magic Knight's current strength... 46487 JP 46902 ; ...print to screen and return ; Draw Objects in Magic Knight's Inventory if he is Carrying the Mirror ; ; Used by the routine at #R38780. c46490 LD A,20 ; If Magic Knight is not carrying the Mirror (20)... 46492 CALL 45510 ; ... 46495 RET NZ ; ...then return 46496 LD HL,24848 ; Point HL at start of Magic Knight's current inventory (carrying) 46499 LD B,5 ; Load B with 5 (five inventory slots) 46501 LD DE,528 ; Load DE with x- and y-coordinates respectively to start drawing object graphics (D, or x = 2, ; E, or y = 16) *46504 PUSH BC ; Store BC (B = remaining number of inventory slots to process) 46505 PUSH HL ; Store HL (pointer to current position in Magic Knight's current inventory) 46506 PUSH DE ; Store DE (coordinates in characters to draw object) 46507 LD A,(HL) ; Load index of object in current slot in Magic Knight's inventory into A 46508 OR A ; If this is zero... 46509 JR Z,46556 ; ...then restore registers and return 46511 LD E,6 ; Load 6 (index of objects' attribute property) into E 46513 CALL 45390 ; Point HL at the attribute property of the object in the current inventory slot 46516 LD A,(HL) ; Load attribute into ATTR T system variable... 46517 LD (23695),A ; ... 46520 INC HL ; Advance HL to point to graphic index property... 46521 LD A,(HL) ; ...and load into A 46522 POP BC ; Restore BC (coordinates in characters to draw object, was in DE) 46523 PUSH BC ; Store BC (coordinates in characters to draw object) 46524 PUSH BC ; Store BC (coordinates in characters to draw object) 46525 CALL 63499 ; Draw 2x2 graphic with lookup index A at character coordinates (C, B) 46528 POP BC ; Restore BC (coordinates in characters to draw object) 46529 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) 46532 LD A,(23695) ; Load A with value stored in ATTR T system variable... 46535 LD (HL),A ; ...and apply this attribute to Attribute File at coordinates (C, B)... 46536 INC HL ; ... 46537 LD (HL),A ; ...(C + 1, B)... 46538 LD BC,31 ; ... 46541 ADD HL,BC ; ... 46542 LD (HL),A ; ...(C, B + 1)... 46543 INC HL ; ... 46544 LD (HL),A ; ...and (C + 1, B + 1) 46545 POP DE ; Restore DE (coordinates in characters to draw object) 46546 LD A,E ; Advance right by three characters (i.e. add three to x-coordinate in E)... 46547 ADD A,3 ; ... 46549 LD E,A ; ... 46550 POP HL ; Restore HL (pointer to current position in Magic Knight's current inventory) 46551 INC HL ; Advance HL to next inventory slot 46552 POP BC ; Restore BC (B = remaining number of inventory slots to process) 46553 DJNZ 46504 ; Decrease B, and loop back to #R46504 if not zero 46555 RET ; Return *46556 POP DE ; Restore DE (coordinates in characters to draw object) 46557 POP HL ; Restore HL (pointer to current position in Magic Knight's current inventory) 46558 POP BC ; Restore BC (B = remaining number of inventory slots to process) 46559 RET ; Return ; Update Position of Axe, Display, and Decrease Magic Knight's Strength if in Contact ; ; Used by the routines at #R40235 and #R40239. Input: A Axe number (0, 1, 2 or 3) c46560 ADD A,A ; Multiply value of A by eight... 46561 ADD A,A ; ... 46562 ADD A,A ; ... 46563 LD C,A ; Store in C 46564 LD B,0 ; Set B to zero 46566 LD IX,46752 ; Set IX to point to data for axes 46570 ADD IX,BC ; Add eight times axe number as offset to IX pointer 46572 LD C,(IX+0) ; Load axe's x-coordinate into C 46575 LD B,(IX+1) ; Load axe's y-coordinate into B 46578 PUSH BC ; Store BC 46579 LD (23677),BC ; Load BC into system variable "COORDS" 46583 LD A,(IX+4) ; Load A with axe's current frame number 46586 PUSH IX ; Store IX 46588 CALL 63040 ; Draw axe to screen 46591 POP IX ; Restore IX 46593 POP BC ; Restore BC 46594 LD A,(IX+2) ; Load x-velocity into A 46597 ADD A,C ; Add x-coordinate to A 46598 LD C,A ; Load new x-coordinate back into C 46599 LD A,(IX+3) ; Load y-velocity into A 46602 ADD A,B ; Add y-coordinate to A 46603 LD B,A ; Load new y-coordinate back into B 46604 LD (IX+0),C ; Update data with new x-... 46607 LD (IX+1),B ; ...and y-coordinates 46610 LD (23677),BC ; Update "COORDS" system variable 46614 LD A,(IX+4) ; Load A with axe frame data 46617 SUB 116 ; Subtract 116 (i.e. frame number of first axe frame) to get "absolute frame number" (see ; trivia) 46619 INC A ; Advance absolute frame number by one 46620 AND 3 ; Cap absolute frame number to 3, and wrap round from 3 to 0 as there are only four frames 46622 ADD A,116 ; Add 116 to absolute frame number to give relative frame number again 46624 LD (IX+4),A ; Store new frame number 46627 PUSH IX ; Store IX 46629 CALL 63040 ; Draw axe to screen 46632 POP IX ; Restore IX 46634 LD A,(IX+0) ; Load x-coordinate of axe 46637 OR A ; If x-coordinate is zero... 46638 CALL Z,46742 ; ...multiply x "velocity" by minus one 46641 CP 244 ; If x-coordinate is 244... 46643 CALL Z,46742 ; ...multiply x "velocity" by minus one 46646 INC IX ; Temporarily advance IX pointer to work with y "velocities" 46648 LD A,(IX+0) ; Load y-coordinate of axe 46651 CP 172 ; If y-coordinate is 172... 46653 CALL Z,46742 ; ...multiply y "velocity" by minus one 46656 CP 100 ; If y-coordinate is 100... 46658 CALL Z,46742 ; ...multiply y "velocity" by minus one 46661 DEC IX ; Move IX back one again (reversing instruction at #R46646) 46663 LD A,(24840) ; Load A with Magic Knight's current x-coordinate 46666 LD B,A ; Copy into B 46667 LD A,(IX+0) ; Load A with x-coordinate of axe 46670 ADD A,6 ; Add 6 to x-coordinate of axe 46672 SUB B ; Subtract B to get x-distance between Magic Knight and the axe, plus 6 46673 CP 21 ; If this value is not less than 21 then... 46675 JP NC,46741 ; ...return 46678 LD A,(24841) ; Else, load B with Magic Knight's y-coordinate... 46681 LD B,A ; ... 46682 LD A,(IX+1) ; Load A with y-coordinate of axe (uses same coordinate system as PLOT command, i.e. y=0 is at ; bottom of screen) 46685 SUB B ; Subtract B to get y-distance between Magic Knight and the axe 46686 CP 39 ; If this value is not less than 39 then... 46688 JP NC,46741 ; ...return 46691 LD A,30 ; If Magic Knight is wearing the Shield... 46693 CALL 45505 ; ... 46696 JP Z,46719 ; ...then skip ahead to #R46719 46699 LD A,(24768) ; Else, decrease Magic Knight's current strength by one... 46702 DEC A ; ... 46703 LD (24768),A ; ... 46706 CALL 46463 ; Print Magic Knight's current strength at (6, 2) as text if he is carrying the Mirror 46709 LD A,(24768) ; Load Magic Knight's current strength into A... 46712 OR A ; If Magic Knight's strength is zero... 46713 LD HL,51071 ; ...point HL to "YOU DIED OF EXHAUSTION" text... 46716 JP Z,64582 ; ...and jump to "Game over" window routine and exit *46719 LD C,32 ; Set C to 32 (number of times to repeat loop below) *46721 LD A,16 ; Set speaker bit... 46723 OUT (254),A ; ... 46725 LD A,R ; Load A with random number between 0 - 15 (as R register increases with each instruction ; executed)... 46727 AND 15 ; ... 46729 LD B,A ; Load value into B *46730 DJNZ 46730 ; Pause by repeating this line B times 46732 XOR A ; Set A to zero 46733 OUT (254),A ; Reset speaker bit 46735 DEC C ; Decrease C... 46736 JR NZ,46721 ; ...and repeat loop if C is not zero 46738 XOR A ; Reset speaker bit... 46739 OUT (254),A ; ... *46741 RET ; Return ; Multiply x or y Velocity of axe by Minus One ; ; Used by the routine at #R46560. Input: IX Address of x or y "velocity" of axe minus two c46742 LD A,(IX+2) ; Load A with x "velocity" of axe 46745 NEG ; Multiply velocity by minus one 46747 LD (IX+2),A ; Load back into data block 46750 XOR A ; Set A to zero 46751 RET ; Return ; Properties of the Axes ; ; Up to four axes may exist in a room, therefore there are four entries in this table. Each axe's properties are ; encoded in eight bytes with the following meanings: b46752 DEFB 12,112,4,2,116,0,0,0 ; Axe 1 46760 DEFB 12,112,2,252,116,0,0,0 ; Axe 2 46768 DEFB 200,120,252,2,116,0,0,0 ; Axe 3 46776 DEFB 200,120,254,252,116,0,0,0 ; Axe 4 ; Draw Axe(s) to Screen if Magic Knight is in an Axe Room ; ; Used by the routines at #R38841, #R39393, #R61823 and #R61860. c46784 LD A,(23702) ; If Magic Knight's current room's index is less than 17... 46787 CP 17 ; ...i.e. he is outside the Castle / Spaceship... 46789 RET C ; ...then return 46790 CP 23 ; If Magic Knight's current room's index is 23 or more (not in any, except last, Castle ground ; floor room)... 46792 RET NC ; ...then return 46793 LD HL,46752 ; Load HL with start address of properties of axe 0 46796 CALL 46823 ; Draw axe 0 46799 LD A,(23702) ; If Magic Knight's current room's index is less than 21... 46802 CP 21 ; ...i.e. he is on the Castle ground floor, in room 0, 1, 2 or 3... 46804 RET C ; ...then return (only one axe in these rooms) 46805 LD BC,4 ; Advance HL to start of properties of axe 1... 46808 ADD HL,BC ; ... 46809 CALL 46823 ; Draw axe 0 46812 LD BC,4 ; Advance HL to start of properties of axe 2... 46815 ADD HL,BC ; ... 46816 CALL 46823 ; Draw axe 0 46819 LD BC,4 ; Advance HL to start of properties of axe 3... 46822 ADD HL,BC ; ... *46823 LD E,(HL) ; Load E with current axe's x-coordinate... 46824 INC HL ; ... 46825 LD D,(HL) ; Load D with current axe's y-coordinate... 46826 LD (23677),DE ; ...and store coordinates in system variable COORDS 46830 INC HL ; Advance HL to axe frame number... 46831 INC HL ; ... 46832 INC HL ; ... 46833 LD A,(HL) ; ...and load into A 46834 JP 63040 ; Draw axe to screen and return ; Splice Numeric Data A as a String into a String at HL ; ; Used by the routines at #R38024, #R40489, #R42938, #R43000, #R45522 and #R46463. Input: A Numeric value to put ; into string HL Address of string to modify c46837 PUSH HL ; Store HL (address of string to modify) 46838 LD HL,23430 ; Point HL at destination location for ASCII string 46841 LD B,0 ; Load numeric value into BC... 46843 LD C,A ; ... 46844 CALL 47797 ; Convert numeric value BC to ASCII string at address in HL (#R23430) 46847 LD HL,23432 ; Point HL at third digit in converted five-digit string 46850 LD C,2 ; Load C with 2 (as we can have up to two leading zeroes on a three-digit number) *46852 LD A,(HL) ; Load ASCII character at HL into A 46853 CP 48 ; If character is not a zero ("0")... 46855 JR NZ,46863 ; ...then skip ahead to #R46863 46857 LD (HL),32 ; Replace the zero character with a space (i.e. remove leading zeroes from number) 46859 INC HL ; Advance to next character in string 46860 DEC C ; Decrease C (number of remaining digits to process) 46861 JR NZ,46852 ; Loop back to #R46852 if there are still digits to process *46863 POP DE ; Restore pointer to "numeric text" (originally in HL at start of this routine) into DE 46864 LD HL,23432 ; Point HL at string just created 46867 LD BC,3 ; Splice ASCII string number just generated into "numeric data" text 46870 LDIR ; ... 46872 RET ; Return ; Print Text at Location HL to Screen Using Full Screen Width ; ; Used by the routines at #R39578 and #R63598. Input: HL Text to print c46873 LD A,(23410) ; Load A with x-coordinate of right edge of current window to draw (characters) 46876 PUSH AF ; Store AF (A = x-coordinate of right edge of current window) 46877 LD A,31 ; Set right-edge x-coordinate value at #R23410 to 31... 46879 LD (23410),A ; ... 46882 LD A,(23408) ; Load A with x-coordinate of left edge of current window to draw (characters) 46885 PUSH AF ; Store AF (A = x-coordinate of left edge of current window) 46886 XOR A ; Set left-edge x-coordinate value at #R23408 to zero... 46887 LD (23408),A ; ... 46890 CALL 46902 ; Print text at location HL to screen 46893 POP AF ; Restore x-coordinate of left edge of current window... 46894 LD (23408),A ; ...to #R23408 46897 POP AF ; Restore x-coordinate of right edge of current window... 46898 LD (23410),A ; ...to #R23410 46901 RET ; Return ; Print Text at Location HL to Screen ; ; Used by the routines at #R37764, #R37909, #R37951, #R38780, #R38829, #R40258, #R40489, #R42494, #R42616, #R42638, ; #R43043, #R43874, #R44253, #R44635, #R45552, #R45641, #R45685, #R45723, #R45809, #R45963, #R46106, #R46463, ; #R46873, #R63349, #R63399, #R64207, #R64230, #R64317 and #R64582. Input: HL Points to text data to print c46902 LD IX,25060 ; Point IX at start of Temporary Text Buffer 46906 LD A,255 ; Prepare Recursion Depth Counter for loop... 46908 LD (23398),A ; ... ; This entry point is used by the routine at #R47049. *46911 LD A,(23398) ; Increase Recursion Depth Counter... 46914 INC A ; ... 46915 LD (23398),A ; ... 46918 PUSH HL ; Store HL 46919 CALL 63286 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 46922 POP HL ; Restore HL 46923 DEC HL ; Prepare pointer to text to print for loop ; This entry point is used by the routines at #R47020, #R47096 and #R48389. *46924 LD A,(23398) ; Load A with value in Recursion Depth Counter... 46927 CP 255 ; ...and if this is 255 (i.e. no more text to print)... 46929 JP Z,47178 ; ...then return (see trivia) 46932 INC HL ; Advance to next character code to be printed... 46933 LD A,(HL) ; ...and load into A 46934 OR A ; If character code is a zero (i.e. End Marker)... 46935 JP Z,47023 ; ...then return from current level of text printing 46938 CP 32 ; If the character is a "32" (SPACE)... 46940 JP Z,48389 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R46924 to load next word 46943 CP 31 ; If the character is a "31"... 46945 JP Z,47170 ; ...then print the Current Character's short name 46948 CP 30 ; If the character is a "30"... 46950 JP Z,47162 ; ...then print the Current Character's full name 46953 CP 29 ; If the character is a "29"... 46955 JP Z,47110 ; ...then print the Current Object's name 46958 CP 28 ; If the character is a "28"... 46960 JP Z,47121 ; ... then print appropriate Newspaper substring for current required disquise 46963 CP 27 ; If the character is a "27"... 46965 JP Z,47132 ; ...then print current Crystal Ball substring 46968 CP 26 ; If the character is a "26"... 46970 JP Z,47143 ; ...then print current Scroll substring 46973 CP 25 ; If the character is a "25"... 46975 JP Z,47154 ; ...then print the name of the Current Command 46978 CP 19 ; If the character is a "19"... 46980 JP Z,47080 ; ...then toggle BRIGHT Flag then loop back to #R46924 for next data 46983 CP 18 ; If the character is a "18"... 46985 JP Z,47084 ; ...then toggle FLASH Flag then loop back to #R46924 for next data 46988 CP 17 ; If the character is a "17"... 46990 JP Z,47092 ; ...then change PAPER colour based upon following data byte then loop back to #R46924 for next ; data 46993 CP 16 ; If the character is a "16"... 46995 JP Z,47096 ; ...then change INK colour based upon following data byte then loop back to #R46924 for next ; data 46998 CP 14 ; If the character is a "14" (Carriage return / line feed to start of next character row down ; within window)... 47000 JP Z,48389 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R46924 to load next word 47003 CP 13 ; If the character is a "13" (Carriage return / line feed to start of next character row ; down)... 47005 JP Z,48389 ; ...then print word in Temporary Text Buffer to screen, wrapping text if necessary, then jump ; to #R46924 to load next word 47008 CP 91 ; If value is 91 or greater (i.e. special character)... 47010 JP NC,47049 ; ...then print an entry from the Common Words Table 47013 LD (IX+0),A ; Load character into Temporary Text Buffer 47016 INC IX ; Advance to next position in temporary text buffer 47018 JR 46924 ; Loop back to #R46924 ; Return from recursive text-printing ; ; Used by the routine at #R47049. c47020 POP HL ; Restore HL (pointer to current position in text to print) 47021 JR 46924 ; 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 #R46902. c47023 PUSH AF ; Store AF 47024 LD A,(23398) ; Load Recursion Depth Counter into B... 47027 LD B,A ; ... 47028 POP AF ; Restore AF 47029 OR B ; If Recursion Depth Counter is not zero (i.e. we are not at the end of the top-level ; string)... 47030 JR NZ,47041 ; ...then skip ahead to #R47041 47032 DEC A ; Decrease Recursion Depth Counter to 255, as we have reached the end of the top-level ; string... 47033 LD (23398),A ; ... 47036 LD A,255 ; Load A with 255 (End Marker) 47038 JP 48389 ; Print word in Temporary Text Buffer to screen, wrapping text if necessary, then process next ; word *47041 LD A,(23398) ; Decrease Recursion Depth Counter... 47044 DEC A ; ... 47045 LD (23398),A ; ... 47048 RET ; Return ; Text Printing Print an entry from the Common Words Table ; ; Used by the routines at #R46902, #R47154, #R47162 and #R47170. Input: A (Entry at #R47049 only) 91 + Index of ; required entry in Common Words Table A (Entry at #R47055 only) Index of required entry in list of texts HL (Entry ; at #R47055 only) Start address of a list of texts c47049 PUSH HL ; Store HL (pointer to current position in text to print) 47050 LD HL,57693 ; Point HL at start of Common Words Table 47053 SUB 91 ; Subtract 91 to get absolute index of required entry in table ; This entry point is used by the routines at #R47110, #R47121, #R47132 and #R47143. *47055 JR Z,47075 ; If index is zero (i.e. first entry is required) then skip ahead to #R47075 47057 CP 100 ; If index is at least 100... 47059 CALL NC,47179 ; ...then advance HL to second part of Common Words Table and subtract 100 from required index ; (see trivia) 47062 JR Z,47075 ; If index is zero (i.e. first entry is required) then skip ahead to #R47075 47064 LD B,A ; Load index into B *47065 PUSH BC ; Store BC (B = Remaining number of strings to skip, initially set to index of required entry ; in Common Words Table) 47066 LD BC,65535 ; Set BC to 65535 (repeat count for CPIR) 47069 XOR A ; Set A to zero 47070 CPIR ; Advance HL until (HL) = A, i.e. a zero (end of string) is found 47072 POP BC ; Restore BC (B = Remaining number of strings to skip) 47073 DJNZ 47065 ; Loop back to #R47065 *47075 CALL 46911 ; Call text printing routine recursively to print the common word 47078 JR 47020 ; 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 #R46902. c47080 LD B,64 ; Load B with 64 (BRIGHT flag) 47082 JR 47086 ; Skip ahead to 47086 (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 #R46902. c47084 LD B,128 ; Load B with 128 (FLASH flag) ; This entry point is used by the routine at #R47080. *47086 LD A,(23695) ; Load A with current ATTR T system variable value 47089 XOR B ; Toggle FLASH flag 47090 JR 47104 ; 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 #R46902. c47092 LD B,199 ; Load B with attribute mask (FLASH, BRIGHT and all INK bits set, all PAPER bits reset) 47094 JR 47098 ; 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 #R46902. c47096 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 #R47092. *47098 INC HL ; Advance HL pointer to next byte in text data 47099 LD A,(23695) ; Load ATTR T system variable value into A 47102 AND B ; Apply mask to reset all INK bits 47103 OR (HL) ; Set INK bits as defined in next text data byte ; This entry point is used by the routine at #R47084. *47104 LD (23695),A ; Store new value of ATTR T 47107 JP 46924 ; Jump back to start of text printing loop to process next data byte ; Print the Current Object's Name ; ; Used by the routine at #R46902. c47110 PUSH HL ; Store HL (current position in text data) 47111 LD HL,56565 ; Point HL at start of Table of Object Names 47114 LD A,(41779) ; Load A with index of Current Object 47117 OR A ; Set Zero Flag is object index is zero 47118 JP 47055 ; Jump back to print this object's name ; Print Appropriate Newspaper Substring for Current Required Disquise ; ; Used by the routine at #R46902. c47121 PUSH HL ; Store HL 47122 LD HL,54027 ; Load HL with start address for Newspaper Substrings 47125 LD A,(23703) ; Load A with Index of Required Disquise... 47128 OR A ; ...and set Zero Flag if index is zero 47129 JP 47055 ; Jump back to print this newspaper string ; Print Current Crystal Ball Substring ; ; Used by the routine at #R46902. c47132 PUSH HL ; Store HL 47133 LD HL,54586 ; Load HL with start address for Crystal Ball Substrings 47136 LD A,(23713) ; Load A with index of current Crystal Ball substring... 47139 OR A ; ...and set Zero Flag if index is zero 47140 JP 47055 ; Jump back to print this Crystal Ball substring ; Print Current Scroll Substring ; ; Used by the routine at #R46902. c47143 PUSH HL ; Store HL 47144 LD HL,54902 ; Load HL with start address for Scroll Substrings 47147 LD A,(23714) ; Load A with index of current Scroll substring... 47150 OR A ; ...and set Zero Flag if index is zero 47151 JP 47055 ; Jump back to print this scroll substring ; Print the Name of the Current Command ; ; Used by the routine at #R46902. c47154 LD A,(23716) ; Load A with index of Current Command 47157 ADD A,234 ; Add 234 (as 234 is the index of the first of the list of command names in the Common Words ; Table) 47159 JP 47049 ; Print an entry (A) from the Common Words Table ; Print the Current Character's Full Name ; ; Used by the routine at #R46902. c47162 LD A,(41937) ; Load A with index of Current Character 47165 ADD A,217 ; Add 217 (as 217 is the index of the first of the list of characters' full names in the Common ; Words Table) 47167 JP 47049 ; Print an entry (A) from the Common Words Table ; Print the Current Character's Short Name ; ; Used by the routine at #R46902. c47170 LD A,(41937) ; Load A with index of Current Character 47173 ADD A,201 ; Add 201 (as 201 is the index of the first of the list of characters' short names in the ; Common Words Table) 47175 JP 47049 ; Print an entry (A) from the Common Words Table ; Return ; ; See trivia c47178 RET ; Return ; 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 #R47179) 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) c47179 LD HL,58459 ; Advance to second part of Common Words Table 47182 SUB 100 ; Subtract 100 from index required 47184 RET ; Return ; Draw a Menu Window ; ; Used by the routines at #R37764, #R37909, #R42494, #R42638, #R43043, #R43874, #R44635, #R45809, #R45963, #R46106 ; and #R64207. c47185 EX AF,AF' ; Swap AF register (A holds index of window to draw) 47186 LD A,105 ; Load the value 105 into #R47289 (i.e. set "Draw Menu (Hand) Cursor" 'flag' to true)... 47188 LD (47290),A ; ... 47191 JR 47199 ; Draw the window ; Draw a Window ; ; Used by the routines at #R37764, #R37909, #R37951, #R38780, #R40258, #R42638, #R44253, #R45552, #R45641, #R45685, ; #R45723, #R45809, #R45963, #R63399, #R64230, #R64317 and #R64582. Input: A Index of window to draw c47193 EX AF,AF' ; Switch AF and AF' 47194 LD A,111 ; Reset "Draw Hand Menu Cursor" Flag (later in this routine)... 47196 LD (47290),A ; ... ; This entry point is used by the routine at #R47185. *47199 SET 1,(IY+65) ; Set Characters Movement Unrestricted Flag / Disable In-Game Glow Flag (IY = 23610) 47203 EX AF,AF' ; Restore original AF (with A being index of window) 47204 LD (63400),A ; Set this index as the "current" window index 47207 LD L,A ; Load HL with A value (index of required window)... 47208 LD H,0 ; ... 47210 ADD HL,HL ; Multiply index by eight (as each window's data takes up eight bytes in table at #R49034)... 47211 ADD HL,HL ; ... 47212 ADD HL,HL ; ... 47213 LD BC,49034 ; Set BC to start of window data table 47216 ADD HL,BC ; Calculate location of start of required window's data 47217 LD E,(HL) ; Load E with x-coordinate of left edge (characters) 47218 INC HL ; Load C with x-coordinate of right edge (characters)... 47219 LD C,(HL) ; ... 47220 INC HL ; Load D with y-coordinate of top edge (characters)... 47221 LD D,(HL) ; ... 47222 INC HL ; Load B with y-coordinate of bottom edge (characters)... 47223 LD B,(HL) ; ... 47224 LD (23408),DE ; Store values for later use... 47228 LD (23410),BC ; ... 47232 INC HL ; Load A with window's upper edge border style... 47233 LD A,(HL) ; ... 47234 LD (63306),A ; Store for later use in routine at #R63302 47237 INC HL ; Load A with window's border attribute... 47238 LD A,(HL) ; ... 47239 EX AF,AF' ; Exchange AF and AF' 47240 INC HL ; Load A with starting y-coordinate of hand cursor... 47241 LD A,(HL) ; ... 47242 LD (23456),A ; Store for later use 47245 INC HL ; Load A with window's content attribute... 47246 LD A,(HL) ; ... 47247 LD (23481),A ; Store for later use 47250 EX AF,AF' ; Exchange AF and AF' (restoring border attribute to A and putting background colour in A') 47251 CALL 47326 ; Draw window frame 47254 LD HL,23408 ; Point HL at previously stored values 47257 INC (HL) ; Increase top-left x-coordinate 47258 INC HL ; Increase top-left y-coordinate... 47259 INC (HL) ; ... 47260 INC HL ; Decrease bottom-right x-coordinate... 47261 DEC (HL) ; ... 47262 INC HL ; Decrease bottom-right y-coordinate... 47263 DEC (HL) ; ... 47264 LD A,(23481) ; Load window content attribute into A 47267 LD (48035),A ; Prepare to fill a region with the attribute in A 47270 LD (23695),A ; Update ATTR T system variable with window content attribute 47273 CALL 48027 ; Fill a region of Attribute File with specified attribute 47276 CALL 48081 ; Blank the interior of the window (Display File) 47279 LD HL,23408 ; Load x-coordinate of left of interior of window into C... 47282 LD C,(HL) ; ... 47283 INC HL ; Load y-coordinate of top of interior of window into B... 47284 LD B,(HL) ; ... 47285 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47288 PUSH HL ; Store HL (address in Display File of top-left of interior of window) ; The operand of the instruction at #R47289 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instructions at #R47188 and #R47196. 47289 LD A,0 ; Load A with "Draw Hand Menu Cursor" Flag 47291 CP 105 ; If value is not 105... 47293 JP NZ,47317 ; ...then jump to #R47317 (i.e. don't draw the hand cursor) ; Window is a menu (105) 47296 LD BC,(23408) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 47300 LD A,(23456) ; Load A with starting y-coordinate of hand cursor 47303 ADD A,B ; Add y-coordinate of top of area to this... 47304 LD B,A ; ...and place back into B 47305 LD A,2 ; Load A with 2 (graphic lookup index of Menu Hand Cursor graphic in table at #R29272) 47307 LD DE,514 ; Load D (graphic width) with 2 and E (graphic height) with 2 47310 PUSH IX ; Store IX 47312 CALL 63507 ; Draw a Graphic with Lookup Index A at Character Coordinates (C, B) with width = E characters ; and height = D characters 47315 POP IX ; Restore IX *47317 XOR A ; Set A to zero 47318 LD (23479),A ; Set hand cursor's current y-coordinate to zero (i.e. defaults to top of its movement range ; within current window) 47321 POP HL ; Restore HL (address in Display File of top-left of interior of window) 47322 LD (63018),HL ; Set memory location to start printing character in character printing routine 47325 RET ; Return ; Draw a Window Frame ; ; Used by the routine at #R47193. c47326 LD (23695),A ; Store border attribute in ATTR T system variable 47329 LD A,(23408) ; Load A with x-coordinate of left of window 47332 LD C,A ; Copy into C 47333 LD A,(23410) ; Load A with x-coordinate of right of window 47336 SUB C ; Get distance between left and right coordinates 47337 DEC A ; Subtract 1 to get width of window top-edge (not including corner pieces) 47338 LD C,A ; Transfer this to BC... 47339 LD B,0 ; ... 47341 PUSH BC ; Store BC (width of top edge of window, not including corner pieces) 47342 LD BC,(23408) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 47346 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) 47347 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47350 POP HL ; Restore HL (width of top edge of window, not including corner pieces) 47351 PUSH HL ; Store HL (width of top edge of window, not including corner pieces) 47352 HALT ; Wait for interrupt 47353 CALL 47491 ; Draw upper window frame edge then increment the border character index in routine at #R63302 47356 LD A,(23408) ; Load C with x-coordinate of left of window... 47359 LD C,A ; ... 47360 LD A,(23411) ; Load B with y-coordinate of bottom of window... 47363 LD B,A ; ... 47364 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) 47365 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47368 POP HL ; Restore HL (width of bottom edge of window)... 47369 CALL 47491 ; Draw lower window frame edge then increment the border character index in routine at #R63302 47372 LD A,(23409) ; Load y-coordinate of top of window into B... 47375 LD B,A ; ... 47376 LD A,(23411) ; Load y-coordinate of bottom of window into A 47379 SUB B ; Subtract B... 47380 DEC A ; ...and decrease by one to get length of left-edge (not including corner pieces) *47381 PUSH AF ; Store AF (A = remaining length of left / right edges) 47382 LD BC,(23408) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 47386 ADD A,B ; Add A and B to get y-coordinate of character to draw in left edge... 47387 LD B,A ; ...and load into B 47388 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47391 LD A,(63306) ; Load A with index of character (left edge) to draw 47394 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47397 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 47400 LD A,L ; Load A with LSB of Display File address (virtual attribute cursor location) 47401 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of character row)... 47403 LD L,A ; ...and place back in L 47404 LD A,(23410) ; Load A with x-coordinate of right edge of window (characters) 47407 OR L ; Add this x-coordinate to value in HL... 47408 LD L,A ; ... 47409 LD (63018),HL ; ...and update address of Bitmap Virtual Text Cursor 47412 LD A,(63306) ; Load A with index of character (left edge) to draw... 47415 INC A ; ...and increment index to get index of right-edge character 47416 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47419 POP AF ; Restore AF (A = remaining length of left / right edges) 47420 DEC A ; Decrease remaining length 47421 JP NZ,47381 ; If remaining length is not zero then loop back to #R47381 47424 LD A,(23410) ; Load C with x-coordinate of right edge of window (characters)... 47427 LD C,A ; ... 47428 LD A,(23409) ; Load y-coordinate of top edge of window into B... 47431 LD B,A ; ... 47432 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47435 LD A,(63306) ; Load A with index of character (left-edge) to draw... 47438 INC A ; ...and increment (to get right-edge character) 47439 CALL 47497 ; Increment index again (to get top-right corner character) and store at #R63305 47442 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47445 LD BC,(23410) ; Load B with y-coordinate of window's bottom edge and C with x-coordinate of window's ; right-edge 47449 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47452 CALL 47494 ; Increment index of window frame character currently in use to get bottom-right corner ; character 47455 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47458 LD A,(23408) ; Load C with x-coordinate of left edge of current window to draw (characters)... 47461 LD C,A ; ... 47462 LD A,(23411) ; Load B with y-coordinate of window's bottom edge... 47465 LD B,A ; ... 47466 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47469 CALL 47494 ; Increment index of window frame character currently in use to get bottom-left corner ; character 47472 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47475 LD BC,(23408) ; Load B with y-coordinate of top-edge of window and C with x-coordinate of left-edge of window 47479 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 47482 CALL 47494 ; Increment index of window frame character currently in use to get top-left corner character 47485 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 47488 JP 63472 ; Update Character Printing Routine to use base address of Text Character Set graphics and ; return ; Draw an upper or lower window frame edge then increment the border character index ; ; Used by the routine at #R47326. Input: A (Input, #R47497) Previous border edge character index used HL (Input, ; #R47491) Width of window edge to draw (characters, minus 1) c47491 CALL 63302 ; Draw an Edge of Frame of a Window ; This entry point is used by the routine at #R47326. *47494 LD A,(63306) ; Load A with window edge border character previously used ; This entry point is used by the routine at #R47326. *47497 INC A ; Increase index of window edge border character to use next... 47498 LD (63306),A ; ...and store at #R63305 47501 RET ; Return ; Process Keyboard / Joystick Input on a Menu and Load A with Selected Item Index ; ; Used by the routines at #R37689, #R37764, #R42494, #R42638, #R43043, #R43874, #R44635, #R45809, #R45963, #R46106 ; and #R64207. Output: A Selected menu item index (zero-based) c47502 LD A,(47290) ; Check whether to draw hand cursor on menu... 47505 CP 105 ; ...and if not... 47507 RET NZ ; ...then return 47508 LD A,(23408) ; Load A with x-coordinate of left edge of current window to draw (characters)... 47511 LD (23404),A ; ...and store at #R23404 47514 INC A ; Increase by one character... 47515 LD (23405),A ; ...and store for later use 47518 LD A,(23456) ; Load starting y-coordinate of hand cursor into A... 47521 LD B,A ; and copy into B 47522 LD A,(23409) ; Load y-coordinate of current window's top-left corner into A... 47525 ADD A,B ; ...add to B... 47526 ADD A,A ; ...and multiply by 8 to get y-coordinate of top of hand cursor in pixels... 47527 ADD A,A ; ... 47528 ADD A,A ; ... 47529 LD (23406),A ; Then store for later use 47532 LD A,(23411) ; Load y-coordinate of current window's bottom edge into A... 47535 ADD A,A ; ...multiply by eight... 47536 ADD A,A ; ... 47537 ADD A,A ; ... 47538 ADD A,7 ; ...then add 7 to get y-coordinate of absolute bottom of window in pixels 47540 LD (23407),A ; ...and store for later 47543 LD A,(23409) ; Load y-coordinate of current window's top-left corner into A... 47546 LD B,A ; ...and copy into B 47547 LD A,(23411) ; Load y-coordinate of current window's bottom-right corner into A... 47550 SUB B ; ...subtract B... 47551 DEC A ; ...then subtract one to get height of window, not including frame 47552 LD B,A ; Copy this into B 47553 LD A,(23456) ; Load A with initial y-coordinate of hand cursor relative to current window... 47556 SUB B ; ...subtract B... 47557 NEG ; ...and negate to give vertical distance available to hand cursor to move 47559 ADD A,A ; Multiply this by eight to convert from characters to pixels... 47560 ADD A,A ; ... 47561 ADD A,A ; ... 47562 LD (23475),A ; ...and store at 23475 47565 LD A,(23479) ; Load A with current y-coordinate of hand cursor relative to its starting position (pixels)... 47568 CALL 47731 ; ...and invert INK and PAPER bits to highlight currently active menu item at this position ; This entry point is used by the routines at #R47603 and #R47665. *47571 CALL 64034 ; Capture keyboard or joystick input loading result into A 47574 HALT ; Wait for interrupt 47575 BIT 2,A ; If "up" pressed then... 47577 JP NZ,47603 ; ...jump to routine to move Hand Cursor up and update menu item highlighting 47580 BIT 3,A ; If "down" pressed then... 47582 JP NZ,47665 ; ...jump to routine to move Hand Cursor down and update menu item highlighting 47585 BIT 4,A ; If "fire" has not been pressed then... 47587 JR Z,47571 ; Loop back to #R47571 47589 JP 47703 ; 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 #R38205, #R47703 and #R64230. c47592 PUSH AF ; Store AF *47593 HALT ; Wait for interrupt 47594 CALL 64034 ; Capture keyboard or joystick input loading result into A 47597 BIT 4,A ; If fire button / key pressed... 47599 JR NZ,47593 ; ...loop back to #R47593 47601 POP AF ; Restore AF 47602 RET ; Return ; Move Hand Cursor Up and Update Menu Item Highlighting ; ; Used by the routine at #R47502. c47603 LD A,(23479) ; Load menu hand cursor's current y-coordinate into A 47606 OR A ; If coordinate is zero... 47607 JP Z,47571 ; ...then jump to #R47571 (return to menu input handling routine) 47610 LD (23478),A ; Store y-coordinate (pixels) at #R23478 47613 PUSH AF ; Store AF (A = Menu Hand Cursor's y-coordinate, in pixels) 47614 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 47616 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 47617 RRCA ; ... 47618 RRCA ; ... 47619 AND 31 ; ... 47621 LD C,A ; Load this y-coordinate into C 47622 POP AF ; Restore AF (A = Menu Hand Cursor's y-coordinate, in pixels) 47623 DEC A ; Decrease y-coordinate (pixels) by two... 47624 DEC A ; ... 47625 LD (23479),A ; Store new y-coordinate (in pixels) 47628 PUSH BC ; Store BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 47629 CALL 64354 ; Scroll a region of the Display File up two pixel rows without wrapping... 47632 CALL 64354 ; ... ; This entry point is used by the routine at #R47665. *47635 POP BC ; Restore BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 47636 LD A,(23479) ; Load menu hand cursor's new y-coordinate (in pixels) into A 47639 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 47641 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 47642 RRCA ; ... 47643 RRCA ; ... 47644 AND 31 ; ... 47646 CP C ; If new y-coordinate of Menu Hand Cursor (in characters) is the same as its previous ; y-coordinate... 47647 JP Z,47571 ; ...then jump to #R47571 (return to menu input handling routine) 47650 LD A,(23478) ; Load A with previous y-coordinate in pixels... 47653 CALL 47731 ; ...and invert INK and PAPER bits to remove highlighting at this location 47656 LD A,(23479) ; Load A with new y-coordinate in pixels... 47659 CALL 47731 ; and invert INK and PAPER bits to apply highlighting at this location 47662 JP 47571 ; Jump to #R47571 (return to menu input handling routine) ; Move Hand Cursor Down and Update Menu Item Highlighting ; ; Used by the routine at #R47502. c47665 LD A,(23479) ; Load menu hand cursor's current y-coordinate into A 47668 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... 47671 CP (HL) ; ...i.e. the cursor cannot move any further down... 47672 JP Z,47571 ; ...then jump to #R47571 (return to menu input handling routine) 47675 LD (23478),A ; Store y-coordinate (pixels) at #R23478 47678 PUSH AF ; Store AF (A = Menu Hand Cursor's y-coordinate, in pixels) 47679 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 47681 RRCA ; Divide this new y-coordinate by eight to get y-coordinate in characters... 47682 RRCA ; ... 47683 RRCA ; ... 47684 AND 31 ; ... 47686 LD C,A ; Load this y-coordinate into C 47687 POP AF ; Restore AF (A = Menu Hand Cursor's y-coordinate, in pixels) 47688 INC A ; Increase y-coordinate (pixels) by two... 47689 INC A ; ... 47690 LD (23479),A ; Store new y-coordinate (in pixels) 47693 PUSH BC ; Store BC (C = y-coordinate, in characters and before move, of Menu Hand Cursor's finger) 47694 CALL 64361 ; Scroll a region of the Display File down two pixel rows without wrapping... 47697 CALL 64361 ; ... 47700 JP 47635 ; Jump to #R47635 (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 #R47502. Output: A Selected menu item index (zero-based) c47703 CALL 47592 ; Wait for Fire Button / Key to be Released 47706 LD BC,(23476) ; Load BC with absolute coordinates (characters) of start of row of text of interest in menu 47710 LD A,(23456) ; Load C with initial y-coordinate of top of Hand Cursor relative to current window ; (characters)... 47713 LD C,A ; ... 47714 LD A,(23409) ; Load A with y-coordinate of top edge of current window (characters)... 47717 ADD A,C ; ...add C... 47718 INC A ; ...and add 1 to get absolute y-coordinate of first item in menu 47719 LD C,A ; Store y-coordinate in C 47720 LD A,B ; Load A with y-coordinate of row of text of interest in menu 47721 SUB C ; Subtract absolute y-coordinate of first item in menu to give zero-based index of selected ; item 47722 PUSH AF ; Store AF (A = selected item index) 47723 LD A,(23479) ; Load A with current y-coordinate of hand cursor relative to its starting position (pixels)... 47726 CALL 47731 ; ...and use to de-highlight selected menu item 47729 POP AF ; Restore AF (A = selected item index) 47730 RET ; Return ; Invert INK and PAPER bits to (De-)Highlight Currently Active Menu Item ; ; Used by the routines at #R47502, #R47603 and #R47703. Input: A y-coordinate of Menu Hand Cursor (pixels) c47731 PUSH AF ; Store AF (A = y-coordinate of Menu Hand Cursor) 47732 LD A,(23408) ; Load A with x-coordinate of left edge of current window to draw (characters) 47735 ADD A,2 ; Add 2, as Menu Hand Cursor is two characters wide... 47737 LD C,A ; ...and load into C (x-coordinate of start of row of text in menu) 47738 POP AF ; Restore AF (A = y-coordinate of Menu Hand Cursor) 47739 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 47741 CALL 40658 ; Divide this new y-coordinate by eight to get y-coordinate in characters 47744 LD B,A ; Load this y-coordinate into B 47745 LD A,(23456) ; Load initial y-coordinate of top of hand cursor relative to current window, into A 47748 ADD A,B ; Add this to y-coordinate of "finger" 47749 LD B,A ; Load this into B, so that B now contains y-coordinate of "finger" relative to top of window ; (characters) 47750 LD A,(23409) ; Load y-coordinate of top edge of current window into A 47753 ADD A,B ; Add... 47754 INC A ; ...then add one (for window frame at top) so we now have absolute y-coordinate of "finger" 47755 LD B,A ; Load into B 47756 LD (23476),BC ; Store coordinates at #R23476 47760 CALL 63219 ; Point HL at Attribute File address for character coordinates x=C, y=B 47763 LD A,(23408) ; Load B with x-coordinate of left edge of current window to draw (characters)... 47766 LD B,A ; ... 47767 LD A,(23410) ; Load A with x-coordinate of right edge of current window... 47770 SUB B ; ...and subtract x-coordinate of left edge to get width 47771 DEC A ; Decrease width by one to take into account window frame width... 47772 LD B,A ; ...and load into B 47773 LD A,(HL) ; Load attribute at current position in Attribute File into A 47774 AND 56 ; Reset INK, BRIGHT and FLASH bits, preserving PAPER only 47776 RRCA ; Shift PAPER bits into INK bit slots... 47777 RRCA ; ... 47778 RRCA ; ... 47779 LD C,A ; Store this value (new INK colour) in C 47780 LD A,(HL) ; Load attribute at current position in Attribute File into A 47781 RLCA ; Shift all bits right by three (i.e. INK bits now contain former PAPER colour)... 47782 RLCA ; ... 47783 RLCA ; ... 47784 AND 56 ; Reset INK, BRIGHT and FLASH bits, preserving PAPER only (i.e. PAPER bits now contain former ; INK colour) 47786 OR C ; Merge modified PAPER value back in, to give new attribute (i.e. swapped INK and PAPER ; colours)... 47787 LD C,A ; ...and load into C 47788 LD A,(HL) ; Load attribute at current position in Attribute File into A 47789 AND 192 ; Reset INK and PAPER bits, preserving BRIGHT and FLASH only... 47791 OR C ; ...and merge in swapped INK and PAPER values *47792 LD (HL),A ; Write this new attribute value back to the Attribute File 47793 INC HL ; Advance HL to next byte in Attribute File 47794 DJNZ 47792 ; Decrease B (remaining number of characters to invert) and loop back to #R47792 for next ; character block 47796 RET ; Return ; Convert Numeric Value BC to ASCII String at Location HL ; ; Used by the routine at #R46837. Input: BC A numeric value HL Points to location to hold a five-character string c47797 PUSH DE ; Store DE 47798 LD DE,62062 ; Point DE at table of powers of ten 47801 PUSH BC ; Store BC (value) 47802 PUSH HL ; Store HL (location to hold string) 47803 PUSH HL ; Store HL (location to hold string) 47804 LD H,B ; Load BC (value) into HL... 47805 LD L,C ; ... *47806 EX DE,HL ; Swap DE (now value) and HL (now pointer to table of powers of ten) 47807 LD C,(HL) ; Read WORD at HL (power of ten) into BC... 47808 INC HL ; ...and advance HL by two bytes... 47809 LD B,(HL) ; ... 47810 INC HL ; ... 47811 EX DE,HL ; Swap DE (now pointer to next power of ten) and HL (now value) 47812 LD A,47 ; Load A with 47 (ASCII code immediately prior to that for zero, "0") *47814 INC A ; Increase A to next ASCII character 47815 OR A ; (Re)Set carry flag 47816 SBC HL,BC ; Subtract (BC [power of ten] + carry flag) from HL (value) 47818 JR NC,47814 ; If carry flag was not set then loop back to #R47814 47820 ADD HL,BC ; Add power of ten back to HL 47821 EX (SP),HL ; Swap value on top of stack (now remaining value) with HL (now location to hold string) 47822 LD (HL),A ; Store ASCII code in string and advance HL to next slot... 47823 INC HL ; ... 47824 EX (SP),HL ; Swap value on top of stack (pointer to current position in string) with HL (now remaining ; value) 47825 DEC C ; Decrease C to check if last power of ten (i.e. 1) has been reached... 47826 JR NZ,47806 ; ...and if not, then loop back to #R47806 for next power of ten 47828 POP HL ; Restore HL 47829 POP HL ; Restore HL 47830 POP BC ; Restore BC 47831 POP DE ; Restore DE 47832 RET ; Return ; Clear Lower Two Thirds, and Lower Three Character Rows of Upper Third of Display File ; ; Used by the routine at #R38841. c47833 LD HL,16544 ; Load HL with Display File address corresponding to (0, 5) (characters) 47836 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 47839 LD HL,96 ; Load HL with 96 (repeat count) 47842 LD A,32 ; Load A with 32 (character code for SPACE)... 47844 LD (63306),A ; ...and store at #R63305 47847 CALL 63302 ; Draw three rows of SPACE characters and set HL to zero 47850 LD BC,8 ; Load B with 0 (repeat inner loop 256 times) and C with 8 (repeat outer loop 8 times) 47853 JP 47862 ; Clear lower two thirds of Display File and return ; Clear Display File ; ; When this routine is entered via #R47856 and #R47862, B is set to zero. Upon reaching the DJNZ instruction (end of ; inner loop) at #R47871, 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). c47856 LD HL,0 ; Load zero (all bits reset) into HL 47859 LD BC,12 ; Load B with 0 (repeat inner loop 256 times) and C with 12 (repeat outer loop 12 times) ; This entry point is used by the routine at #R47833. *47862 DI ; Disable interrupts 47863 LD (47877),SP ; Store stack pointer at #R47876 47867 LD SP,22528 ; Point stack pointer at start of attribute section of video memory *47870 PUSH HL ; Decrease current stack pointer position by two and load two zeroes into it 47871 DJNZ 47870 ; Loop back for next iteration 47873 DEC C ; Decrease C... 47874 JR NZ,47870 ; ...and repeat if C is still greater than zero, to clear the remaining eleven twelfths of the ; Display File 47876 LD SP,0 ; Restore stack pointer to original value [Operand set by instruction at #R47863] 47879 EI ; Enable interrupts 47880 RET ; Return ; Flood Attribute File with Value in ATTR T System Variable ; ; Used by the routine at #R37909. c47881 LD A,(23695) ; Load ATTR T system variable into A 47884 LD HL,22528 ; Load HL with start of attribute section of video memory 47887 LD DE,22529 ; Load DE with next byte up 47890 LD BC,767 ; Load BC with length of data to copy (767 bytes = length of attribute area of video memory ; minus one) 47893 LD (HL),A ; Load memory at HL with this attribute... 47894 LDIR ; ...and repeat 767 times 47896 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 ; #R47902) is a delay constant that determines the speed at which the sound is played. Input: A (Entry at #R47902 ; only) Delay constant c47897 XOR A ; Set A to 0 47898 LD B,13 ; Set B to 13 (DEC C) 47900 LD H,A ; Set HL to 0... 47901 LD L,A ; ... ; This entry point is used by the routines at #R47930 and #R47938. *47902 LD (47916),A ; Modify instruction at #R47915 with value of delay constant 47905 LD A,B ; Load B into A 47906 LD (47924),A ; Set instruction at #R47924 47909 LD (47925),HL ; Set instructions at #R47925 and #R47926 47912 CALL 48018 ; Load A with current border colour ; The operand of the instruction at #R47915 represents the value of the delay constant. This is modified by the ; instruction at #R47902. 47915 LD C,0 ; Load C with delay constant *47917 OUT (254),A ; Set border colour, and reset ear/speaker 47919 XOR 16 ; Invert ear/speaker bit of A 47921 LD B,C ; Load C (delay constant) into B... *47922 DJNZ 47922 ; ...and delay ; The instructions at #R47924 - #R47926 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 #R47906 and #R47909. 47924 DEC C ; Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone ; respectively 47925 NOP ; Do nothing, or increase delay constant 47926 NOP ; Do nothing, or increase delay constant 47927 JR NZ,47917 ; If delay constant is not zero, then loop back to continue playing tone 47929 RET ; Return ; Set Parameters for and Play Downward Scale Sound ; ; Used by the routines at #R37909, #R42494 and #R45809. c47930 XOR A ; Set parameters... 47931 LD B,12 ; ...(INC C)... 47933 LD H,A ; ... 47934 LD L,A ; ... 47935 INC A ; ... 47936 JR 47902 ; ...and play sound ; Set Parameters for and Play Short Downward Scale Sound ; ; Used by the routines at #R45963 and #R46106. c47938 LD A,1 ; Set parameters... 47940 LD B,12 ; ...(INC C)... 47942 LD H,B ; ... 47943 LD L,B ; ... 47944 JR 47902 ; ...and play sound ; Play Hiss-Type Sound ; ; Used by the routines at #R64207 and #R64230. c47946 CALL 48018 ; 47949 EX AF,AF' ; 47950 LD H,0 ; 47952 LD BC,128 ; *47955 EX AF,AF' ; 47956 OUT (254),A ; 47958 XOR 16 ; 47960 EX AF,AF' ; 47961 LD L,0 ; 47963 LD D,L ; 47964 LD E,H ; 47965 AND A ; 47966 SBC HL,DE ; 47968 SBC HL,DE ; 47970 LD DE,254 ; 47973 ADD HL,DE ; 47974 LD A,L ; 47975 SUB H ; 47976 JR C,47979 ; 47978 DEC A ; *47979 LD H,A ; *47980 DEC A ; 47981 JR NZ,47980 ; 47983 DEC BC ; 47984 LD A,B ; 47985 OR C ; 47986 JR NZ,47955 ; 47988 RET ; ; Set Parameters (for Cheat / Debug Routine Sound) and Play ; ; Used by the routine at #R64836. c47989 LD HL,1222 ; Load HL with bytecodes for instruction "ADD A,4" 47992 LD DE,0 ; Load D with 0 and E with 0 47995 CALL 48018 ; Load A with current border colour 47998 LD (48010),HL ; Set instruction at #R48010 to "ADD A,4" (opcodes in HL) *48001 OUT (254),A ; Set current border colour and reset speaker state 48003 XOR 16 ; Flip "speaker" bit 48005 LD B,E ; Copy E into B *48006 DJNZ 48006 ; Delay for period determined by B 48008 EX AF,AF' ; Switch AF and AF' 48009 LD A,E ; Copy E into A 48010 XOR 128 ; Change E (delay constant)... 48012 LD E,A ; ... 48013 EX AF,AF' ; Switch AF and AF' again 48014 DEC D ; Decrease D (initially zero)... 48015 JR NZ,48001 ; ...and repeat loop (256 times) 48017 RET ; Return ; Get Current Border Colour in A ; ; Used by the routines at #R47897, #R47946 and #R47989. Output: A Current border colour (0 - 7) c48018 LD A,(23624) ; Get border & BASIC cursor area attribute 48021 RRCA ; Clear bits for 1, 2 and 4 to leave (border colour * 8) only... 48022 RRCA ; ... 48023 RRCA ; ... 48024 AND 7 ; Ensure all other bits are cleared 48026 RET ; Return ; Fill a Region of Attribute File with Specified Attribute (e.g. Background Colour and Colour of Text Within) ; ; Used by the routine at #R47193. c48027 LD BC,(23408) ; Load BC with the coordinates of the top-left corner of the area to fill 48031 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) ; The operand of the instruction at #R48034 is an attribute value. This is modified by the instruction at #R47267. *48034 LD A,0 ; Load attribute to place into A 48036 LD (HL),A ; Apply attribute data to Attribute File address in HL 48037 LD A,(23410) ; Load A with x-coordinate of right side of area to fill 48040 CP C ; Check if left and right edges are at same x-coordinate (i.e. zero width)... 48041 JP Z,48057 ; ...and if so, skip to #R48057 48044 INC C ; Increase C 48045 LD A,C ; Copy C into A 48046 AND 31 ; Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen) 48048 LD C,A ; Place back into C 48049 LD A,L ; Get LSB of Attribute File address 48050 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of character row in Attribute File) 48052 ADD A,C ; Add x-offset (i.e. current x-coordinate, C) 48053 LD L,A ; Update HL with x-offset 48054 JP 48034 ; Loop back to #R48034 to print next attribute block *48057 LD A,(23408) ; Get x-coordinate of left of area to fill 48060 LD C,A ; Store in C 48061 LD A,(23411) ; Get y-coordinate of bottom of area to fill 48064 CP B ; Compare with y-coordinate of top of area to fill 48065 RET Z ; If no difference between current y-coordinate and y-coordinate of bottom of area to fill then ; exit function and return 48066 INC B ; Advance current y-coordinate down one unit 48067 LD A,B ; Copy current y-coordinate into A... 48068 CP 24 ; ...and ensure it doesn't exceed 24 (i.e. height of screen)... 48070 JP NZ,48075 ; ...if it doesn't then skip ahead to #R48075... 48073 LD B,0 ; ...else set current y-coord to zero (top of screen) *48075 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) 48078 JP 48034 ; 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 #R47193. c48081 PUSH IX ; Store IX 48083 LD BC,(23408) ; Load B with y-coordinate of top, and C with x-coordinate of left of area to fill 48087 LD DE,(23410) ; Load D with y-coordinate of bottom, and E with x-coordinate of right of area to fill 48091 LD L,C ; Load HL with x-coordinate of left of area to fill... 48092 LD H,0 ; ... 48094 LD (48141),HL ; ...and store as operand of instruction at #R48140 48097 LD A,D ; Load A with y-coordinate of bottom of area to fill... 48098 SUB B ; ...subtract B (y-coordinate of top of area to fill)... 48099 INC A ; ...and add one to give number of rows to fill 48100 ADD A,A ; Multiply A by eight to get number of pixel rows to fill... 48101 ADD A,A ; ... 48102 ADD A,A ; ... 48103 LD (48132),A ; ...and store as operand of instruction at #R48131 48106 LD A,B ; Load A with y-coordinate of top of area to fill (characters)... 48107 ADD A,A ; ...and multiply by eight to get y-coordinate in pixels... 48108 ADD A,A ; ... 48109 ADD A,A ; ... 48110 LD L,A ; Load y-coordinate (pixels) into HL... 48111 LD H,0 ; ... 48113 ADD HL,HL ; Double HL (as entries in table at #R65140 are two bytes wide) 48114 PUSH DE ; Store DE (coordinates of bottom right of area to fill) 48115 LD DE,65140 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 48118 ADD HL,DE ; Add HL as offset, in HL 48119 POP DE ; Restore DE (coordinates of bottom right of area to fill) 48120 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... 48121 POP IX ; ... 48123 LD A,E ; Load A with x-coordinate of right of area to fill (characters)... 48124 SUB C ; ...subtract C (x-coordinate of left of area to fill)... 48125 LD L,A ; ...and load into HL... 48126 LD H,0 ; ... 48128 LD (48148),HL ; ...and store as operand of instruction at #R48147 ; The operand of the instruction at #R48131 represents the number of pixel rows to fill. This is modified by the ; instruction at #R48103. 48131 LD B,0 ; Load B with number of pixel rows to fill *48133 PUSH BC ; Store BC (B = remaining number of pixel rows to fill) 48134 LD L,(IX+0) ; Load HL with Display File address of start of current pixel row... 48137 LD H,(IX+1) ; ... ; The operand of the instruction at #R48140 represents the x-coordinate of the area to fill (characters). This is ; modified by the instruction at #R48094. 48140 LD BC,0 ; Load BC with x-coordinate of area to fill (characters)... 48143 ADD HL,BC ; ...and add to HL as offset 48144 PUSH HL ; Copy Display File address of left-most byte of top pixel row of area to fill from HL to DE... 48145 POP DE ; ... 48146 INC DE ; Advance DE to next address in Display File ; The operand of the instruction at #R48147 represents the width, minus 1, of the area to fill (characters). This is ; modified by the instruction at #R48128. 48147 LD BC,0 ; Load BC with width, minus 1, of area to fill (characters) 48150 LD (HL),0 ; Set content of this address to zero... 48152 LDIR ; ...and repeat for remaining BC addresses, clearing entire pixel row within specified ; x-coordinates 48154 POP BC ; Restore BC (B = remaining number of pixel rows to fill) 48155 INC IX ; Advance IX by two bytes to point to start address of next pixel row down in Display File... 48157 INC IX ; ... 48159 DJNZ 48133 ; Decrease B (remaining number of pixel rows to fill) and loop back to #R48133 if not zero 48161 POP IX ; Restore IX 48163 RET ; Return ; Draw all Objects in Magic Knight's Current Room ; ; Used by the routine at #R39393. c48164 LD IX,24922 ; Point IX at start of Objects' Current Positions Table 48168 LD C,0 ; Set current object to zero 48170 LD B,42 ; Set counter to 42 (as there are 42 objects, including "Nothing at All") *48172 LD A,(23702) ; Load A with Magic Knight's current room 48175 CP (IX+0) ; If object and Magic Knight are in the same room... 48178 CALL Z,48202 ; ...then set Terrain Interaction Data for character blocks spanned by that object and draw 48181 INC C ; Increase C 48182 INC IX ; Advance to next object... 48184 INC IX ; ... 48186 INC IX ; ... 48188 DJNZ 48172 ; ...and loop back to #R48172 for next object 48190 RET ; Return ; Set Terrain Interaction Data for Character Blocks Spanned by an Object and Draw the Object ; ; Used by the routine at #R42638. Input: A Index of object to draw (entry at #R48191 only) B y-coordinate (entry ; at #R48191 only) C x-coordinate (entry at #R48191 only) IX Position data for an object (entry at #R48202 only) c48191 LD IX,23296 ; Store object's position data temporarily at 23296 - 23298... 48195 LD (IX+1),C ; ...x-coordinate... 48198 LD (IX+2),B ; ...y-coordinate... 48201 LD C,A ; Load index of object of interest into C ; This entry point is used by the routine at #R48164. *48202 PUSH BC ; Store BC 48203 PUSH IX ; Store IX 48205 LD A,C ; Load HL with eight times current object index... 48206 ADD A,A ; ... 48207 ADD A,A ; ... 48208 LD L,A ; ... 48209 LD H,0 ; ... 48211 ADD HL,HL ; ... 48212 LD DE,49361 ; Point DE at last byte (graphic index) of "Nothing at All" properties 48215 ADD HL,DE ; Add eight times current object index as offset 48216 LD A,(HL) ; Load graphic index into A 48217 PUSH AF ; Store AF (A = graphic index) 48218 DEC HL ; Move pointer back one byte to point at attribute of object... 48219 LD A,(HL) ; ... 48220 LD (23695),A ; ...and copy into System Variable ATTR T 48223 DEC HL ; Move pointer back one byte to point at object's Terrain Interaction Parameter... 48224 LD A,(HL) ; ...and store at #R23473... 48225 LD (23473),A ; ... 48228 DEC HL ; Move pointer back one byte to point at object's Attribute Flags... 48229 LD A,(HL) ; ...load into A... 48230 AND 15 ; ...clear upper four bits... 48232 LD (48271),A ; ...and store as operand of instruction at #R48270 48235 LD C,(IX+1) ; Load C with x-coordinate of current object 48238 LD B,(IX+2) ; Load B with y-coordinate of current object 48241 DEC B ; Decrease y-coordinate by one to point to object's top-left character block 48242 POP AF ; Restore AF (A = graphic index) 48243 PUSH IX ; Store IX (pointer to position data for object) 48245 PUSH BC ; Store BC (x- and y-coordinates of object's top-left character block) 48246 CALL 63499 ; Draw 2x2 graphic with lookup index A at character coordinates (C, B) 48249 POP BC ; Restore BC (x- and y-coordinates of object's top-left character block) 48250 PUSH BC ; Store BC (x- and y-coordinates of object's top-left character block) 48251 LD A,B ; If object's y-coordinate is 4 (i.e. drawn in window at top while carrying mirror)... 48252 CP 4 ; ... 48254 JR Z,48263 ; ...then skip ahead to #R48263 48256 LD A,(23706) ; If Player Attribute Update Flag is reset (Player Attribute Ignore mode)... 48259 OR A ; ... 48260 JP Z,48298 ; ...then skip ahead to #R48298 *48263 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) 48266 LD A,(23695) ; Load E with value of system variable ATTR T... 48269 LD E,A ; ... ; The operand of the instruction at #R48270 represents the object's Attribute Flags. This is modified by the ; instruction at #R48232. 48270 LD A,0 ; Load A with object's Attribute Flags 48272 BIT 0,A ; If Paint Top-Left Flag is reset... 48274 JR Z,48277 ; ...then skip ahead to #R36190 48276 LD (HL),E ; Paint top-left character block of object with object attribute *48277 INC HL ; Increase HL to move to top-right character block 48278 BIT 1,A ; If Paint Top-Right Flag is reset... 48280 JR Z,48283 ; ...then skip ahead to #R48283 48282 LD (HL),E ; Paint top-right character block of object with object attribute *48283 LD BC,31 ; Advance HL by 31 bytes... 48286 ADD HL,BC ; ...to point to bottom-left character block of object 48287 BIT 2,A ; If Paint Bottom-Left Flag is reset... 48289 JR Z,48292 ; ...then skip ahead to #R48292 48291 LD (HL),E ; Paint bottom-left character block of object with object attribute *48292 INC HL ; Increase HL to move to bottom-right character block 48293 BIT 3,A ; If Paint Bottom-Right Flag is reset... 48295 JR Z,48298 ; ...then skip ahead to #R48298 48297 LD (HL),E ; Paint bottom-right character block of object with object attribute *48298 POP BC ; Store BC (x- and y-coordinates of object's top-left character block) 48299 CALL 63233 ; Point HL at terrain interaction data for character coordinates x=C, y=B 48302 LD A,(23473) ; Load E with object's Terrain Interaction Parameter... 48305 LD E,A ; ... 48306 LD A,(48271) ; Load A with object's Attribute Flags 48309 BIT 0,A ; If Paint Top-Left Flag is reset... 48311 JR Z,48314 ; ...then skip ahead to #R48314 48313 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; top-left character block *48314 INC HL ; Increase HL to move to top-right character block 48315 BIT 1,A ; If Paint Top-Right Flag is reset... 48317 JR Z,48320 ; ...then skip ahead to #R48320 48319 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; top-right character block *48320 LD BC,31 ; Advance HL by 31 bytes... 48323 ADD HL,BC ; ...to point to bottom-left character block of object 48324 BIT 2,A ; If Paint Bottom-Left Flag is reset... 48326 JR Z,48329 ; ...then skip ahead to #R48329 48328 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; bottom-left character block *48329 INC HL ; Increase HL to move to bottom-right character block 48330 BIT 3,A ; If Paint Bottom-Right Flag is reset... 48332 JR Z,48335 ; ...then skip ahead to #R48335 48334 LD (HL),E ; "Paint" object's Terrain Interaction Parameter into Terrain Interaction Data Table for ; bottom-right character block *48335 POP IX ; Restore IX (pointer to position data for object) 48337 POP IX ; Restore IX 48339 POP BC ; Restore BC 48340 RET ; Return ; Remove Object C from a Character's Inventory and Tidy Up Remaining Entries ; ; Used by the routines at #R41748, #R42036, #R42157, #R42395, #R43636, #R44635, #R45149 and #R45256. Input: B ; Number of inventory slots to check C Index of object to be removed HL Pointer to a character's current inventory c48341 LD A,(HL) ; Load A with inventory object 48342 CP C ; If this matches index in C... 48343 JR Z,48349 ; ...then skip ahead to #R48349 48345 INC HL ; Advance to next inventory slot... 48346 DJNZ 48341 ; ...and loop back to #R48341 for next slot 48348 RET ; Return if object not found *48349 INC HL ; Advance to next inventory slot 48350 LD A,(HL) ; Load object at this slot into A 48351 DEC HL ; Move back to previous slot again 48352 LD (HL),A ; Place object from next slot into current one 48353 INC HL ; Advance to next slot again 48354 DJNZ 48349 ; Loop back to #R48349 (i.e. repeat for all remaining slots) 48356 DEC HL ; Move back to previous slot (i.e. final slot for this character)... 48357 XOR A ; ...and set to empty... 48358 LD (HL),A ; ... 48359 RET ; Return ; Draw a Line From (C, B) to (E, D) ; ; Used by the routines at #R40008 and #R40765. 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 c48360 LD (23677),DE ; Load contents of DE into system variable COORDS (start point of line) 48364 LD A,B ; Subtract y-coordinate of start of line from y-coordinate of end of line... 48365 SUB D ; ...to get delta-y 48366 LD D,1 ; Set direction of vertical change to +1 (upward) 48368 JR NC,48374 ; If delta-y is positive (i.e. upward) then skip ahead to #R48374 48370 CPL ; Multiply delta-y by -1 (downward) to get absolute magnitude... 48371 INC A ; ... 48372 LD D,255 ; Set direction of vertical change to -1 (downward) *48374 LD B,A ; Load B with magnitude of difference in y-coordinate between start and end of line 48375 LD A,C ; Subtract x-coordinate of start of line from y-coordinate of end of line... 48376 SUB E ; ...to get delta-x 48377 LD E,1 ; Set direction of horizontal change to +1 (rightward) 48379 JR NC,48385 ; If delta-x is positive (i.e. rightward) then skip ahead to #R48385 48381 CPL ; Multiply delta-x by -1 (leftward) to get absolute magnitude... 48382 INC A ; ... 48383 LD E,255 ; Set direction of vertical change to -1 (leftward) *48385 LD C,A ; Load C with magnitude of difference in x-coordinate between start and end of line 48386 JP 9402 ; Draw the line (ROM routine) and 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 #R25060 c48389 LD (IX+0),A ; Store character in temporary text buffer 48392 PUSH HL ; Store HL (pointer to current position in text to print) 48393 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 48396 LD A,L ; Load x-coordinate of the cursor into B, decreasing by one... 48397 DEC A ; ... 48398 AND 31 ; ... 48400 LD B,A ; ... 48401 LD A,(23410) ; Load x-coordinate of right edge of current window into A 48404 SUB B ; Subtract B to get distance to right-edge of window in A 48405 PUSH AF ; Store AF (A = distance to right-edge of window) 48406 LD HL,25060 ; Point HL at start of Temporary Text Buffer 48409 LD C,0 ; Set C to zero *48411 LD A,(HL) ; Load character from current position in Temporary Text Buffer into A 48412 CP 32 ; If character is 32 (SPACE)... 48414 JR Z,48432 ; ...then skip ahead to #R48432 as end of word reached 48416 CP 13 ; If character is 13 (Carriage return / line feed to start of next character row down)... 48418 JR Z,48432 ; ...then skip ahead to #R48432 as end of word reached 48420 CP 14 ; If character is 14 (Carriage return / line feed to start of next character row down within ; window)... 48422 JR Z,48432 ; ...then skip ahead to #R48432 as end of word reached 48424 CP 255 ; If character is 255 (End Marker)... 48426 JR Z,48432 ; ...then skip ahead to #R48432 as end of word reached 48428 INC C ; Increase C (number of characters to print) 48429 INC HL ; Advance to next character in Temporary Text Buffer 48430 JR 48411 ; Loop back to #R48411 *48432 POP AF ; Restore AF (A = distance to right-edge of window) 48433 SUB C ; Subtract C (number of characters) 48434 CALL C,48518 ; 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 48437 LD HL,25059 ; Point HL at byte before start of Temporary Text Buffer *48440 INC HL ; Advance to next byte in Temporary Text Buffer 48441 LD A,(HL) ; Load character from current position in Temporary Text Buffer into A 48442 CP 255 ; If character is 255 (End Marker)... 48444 JR Z,48510 ; ...then skip ahead to #R48510 (reset Temporary Text Buffer and load next word into it) 48446 CP 32 ; If character is 32 (SPACE)... 48448 JR Z,48491 ; ...then skip ahead to #R48491 48450 CP 13 ; If character is 13 (Carriage return / line feed to start of next character row down)... 48452 JP Z,48478 ; ...then skip ahead to #R48478 48455 CP 14 ; If character is 14 (Carriage return / line feed to start of next character row down within ; window)... 48457 JP Z,48486 ; ...then skip ahead to #R48486 48460 CP 9 ; If character is 9 (Move Virtual Text Cursor right one character)... 48462 JP Z,48470 ; ...then skip ahead to #R48470 48465 CALL 63005 ; Print the character 48468 JR 48440 ; Loop back to #R48440 ; Move Virtual Text Cursor right one character (9) *48470 PUSH HL ; Store HL (current position in Temporary Text Buffer) 48471 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by one character 48474 POP HL ; Restore HL (current position in Temporary Text Buffer) 48475 JP 48440 ; Jump to #R48440 for next character ; Carriage return / line feed to start of next character row down (13) *48478 CALL 63263 ; Advance Bitmap Virtual Text Cursor to start of next character row 48481 CALL 63286 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 48484 JR 48510 ; Skip ahead to #R48510 (reset Temporary Text Buffer and load next word into it) ; Carriage return / line feed to start of next character row down within window (14) *48486 CALL 48518 ; Move Virtual Text Cursors (Attribute and Bitmap) down to left edge of next row of window 48489 JR 48510 ; Skip ahead to #R48510 (reset Temporary Text Buffer and load next word into it) ; Print a SPACE (32) *48491 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 48494 LD A,L ; Strip out higher-order bits in L to leave only x-coordinate component... 48495 AND 31 ; ... 48497 LD L,A ; ... 48498 LD A,(23410) ; Load A with x-coordinate of right edge of current window plus one... 48501 INC A ; ... 48502 CP L ; If this is the same as the x-coordinate of the Bitmap Virtual Text Cursor... 48503 JR Z,48510 ; ...then skip ahead to #R48510 (reset Temporary Text Buffer and load next word into it, i.e. ; no need to print a SPACE) 48505 LD A,32 ; Print a SPACE character (chr. 32)... 48507 CALL 63005 ; ... ; End Marker (255) *48510 POP HL ; Restore HL (pointer to current position in text to print) 48511 LD IX,25060 ; Point IX at start of Temporary Text Buffer 48515 JP 46924 ; Jump back to #R46924 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 #R48389. c48518 CALL 63263 ; Advance Bitmap Virtual Text Cursor to start of next character row 48521 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 48524 LD A,(23408) ; Load A with x-coordinate of left edge of window 48527 ADD A,L ; Add this to address in HL to move cursor to left edge of window... 48528 LD L,A ; ... 48529 LD (63018),HL ; ...and place the result back at #R63017 48532 JP 63286 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor and return ; List of Command Indices ; ; See trivia b48535 DEFB 0,1,2,3,4,5,6,7 48543 DEFB 8,9,10,11,12,13,14,15 48551 DEFB 16,17 ; Routine Start Addresses for Magic Knight's Commands (Main Menu) b48553 DEFW 41578 ; (00) - Process Command to Pick Up an Object 48555 DEFW 41748 ; (01) - Process Command to Drop an Object 48557 DEFW 41924 ; (02) - Process Command to Take an Object 48559 DEFW 42257 ; (03) - Process Command to Give an Object 48561 DEFW 42638 ; (04) - Process Command to Examine Yourself / A Character / An Object 48563 DEFW 43043 ; (05) - Process Command to Command a Character 48565 DEFW 41742 ; (06) - Unused [Set MK's available action flags and jump to start of Main Game Loop] 48567 DEFW 44861 ; (07) - Process Command to Teleport 48569 DEFW 43494 ; (08) - Process Command to Read an Object 48571 DEFW 43636 ; (09) - Process Command to Throw an Object 48573 DEFW 43874 ; (10) - Process Command to Cast a Spell 48575 DEFW 44337 ; (11) - Process Command to Blow an Object 48577 DEFW 44635 ; (12) - Process Command to Wear / Unwear an Object 48579 DEFW 44933 ; (13) - Process Command to Tickle a Character 48581 DEFW 44990 ; (14) - Process Command to Pull Lever 48583 DEFW 45095 ; (15) - Process Command to Smell Something 48585 DEFW 45131 ; (16) - Process Command to Have a Wish 48587 DEFW 45149 ; (17) - Process Command to Have a Drink ; List of Characters for "TRAVEL TO" Character Selection Menu b48589 DEFB 11 ; Height = 10 48590 DEFB 1 ; Aramis le Peux 48591 DEFB 2 ; Robin of Shylock 48592 DEFB 3 ; Reggie the Rat 48593 DEFB 4 ; Rachel of Amazonia 48594 DEFB 5 ; Barker the Ent 48595 DEFB 6 ; Organon the Guard 48596 DEFB 7 ; Grunter the Bearwoolf 48597 DEFB 255 ; End Marker ; List of Characters for "SUMMON" Character Selection Menu b48598 DEFB 7 ; Height = 6 48599 DEFB 1 ; Aramis le Peux 48600 DEFB 2 ; Robin of Shylock 48601 DEFB 4 ; Rachel of Amazonia 48602 DEFB 255 ; End Marker ; Magic Knight's Initial Data ; ; See also #R24840 for Magic Knight's Current Data b48603 DEFB 120 ; x-coordinate (pixels) 48604 DEFB 152 ; y-coordinate (pixels) 48605 DEFB 0 ; Unused 48606 DEFB 0 ; Index of current frame 48607 DEFB 0 ; x-velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 48608 DEFB 0 ; y-velocity (pixels) [jumping] 48609 DEFB 71 ; Attribute 48610 DEFB 0 ; Unused ; Characters' Initial Inventories ; ; See also #R24848 for Characters' Current Inventories b48611 DEFB 26,21,0,0,0 ; Magic Knight (carrying) 48616 DEFB 0,0,0,0,0 ; Magic Knight (wearing) 48621 DEFB 0,0,0,0,0 ; Off-White Knight 48626 DEFB 3,2,0,0,0 ; Aramis le Peux 48631 DEFB 35,14,33,27,0 ; Robin of Shylock 48636 DEFB 0,0,0,0,0 ; Reggie the Rat 48641 DEFB 20,0,0,0,0 ; Rachel of Amazonia 48646 DEFB 6,34,16,0,0 ; Barker the Ent 48651 DEFB 0,0,0,0,0 ; Organon the Guard 48656 DEFB 0,0,0,0,0 ; Grunter the Bearwoolf ; Characters' Initial Positions ; ; Eight groups of three bytes, one group per character (excluding Magic Knight). The values are: b48661 DEFB 45,16,19 ; Off-White Knight 48664 DEFB 10,4,19 ; Aramis le Peux 48667 DEFB 8,12,19 ; Robin of Shylock 48670 DEFB 27,2,19 ; Reggie the Rat 48673 DEFB 31,22,19 ; Rachel of Amazonia 48676 DEFB 11,10,19 ; Barker the Ent 48679 DEFB 16,18,19 ; Organon the Guard 48682 DEFB 3,12,19 ; Grunter the Bearwoolf ; Objects' Initial Positions ; ; Forty-two groups of three bytes, one group per object. The values are: b48685 DEFB 99,0,22 ; (00) - Nothing at all 48688 DEFB 7,20,22 ; (01) - Disquise 48691 DEFB 99,0,22 ; (02) - Crystal Ball 48694 DEFB 99,0,22 ; (03) - Wand of Command 48697 DEFB 99,12,22 ; (04) - Teddy Bear 48700 DEFB 25,28,22 ; (05) - Stick of Dynamite 48703 DEFB 99,0,22 ; (06) - Magic Talisman 48706 DEFB 99,0,22 ; (07) - Broken Glass 48709 DEFB 99,0,22 ; (08) - Broken Glass 48712 DEFB 99,0,22 ; (09) - Broken Glass 48715 DEFB 32,16,22 ; (10) - Horse Feather 48718 DEFB 0,22,22 ; (11) - Power Boots 48721 DEFB 23,2,22 ; (12) - Glow Shield 48724 DEFB 8,9,22 ; (13) - Chicken 48727 DEFB 99,0,22 ; (14) - Boomerang 48730 DEFB 5,17,19 ; (15) - Sword 48733 DEFB 99,0,22 ; (16) - Brass Ankh 48736 DEFB 6,20,22 ; (17) - Bottle of Liquid 48739 DEFB 20,16,22 ; (18) - Bottle of Liquid 48742 DEFB 24,5,22 ; (19) - Torch 48745 DEFB 99,0,22 ; (20) - Mirror 48748 DEFB 99,0,22 ; (21) - Gadget X 48751 DEFB 49,6,22 ; (22) - Elf-Horn 48754 DEFB 38,3,18 ; (23) - Silver Arrow 48757 DEFB 20,3,22 ; (24) - Instruction Book 48760 DEFB 1,2,14 ; (25) - Magic Missile 48763 DEFB 99,0,22 ; (26) - Advert 48766 DEFB 99,0,22 ; (27) - Scroll 48769 DEFB 99,0,22 ; (28) - Empty Bottle 48772 DEFB 99,0,22 ; (29) - Empty Bottle 48775 DEFB 0,10,22 ; (30) - Shield 48778 DEFB 17,20,22 ; (31) - Teleport Key 48781 DEFB 17,18,22 ; (32) - Teleport Pad 48784 DEFB 99,0,22 ; (33) - Newspaper 48787 DEFB 99,0,22 ; (34) - List of Clues 48790 DEFB 99,0,22 ; (35) - Bow 48793 DEFB 99,16,22 ; (36) - Golden Egg 48796 DEFB 99,18,22 ; (37) - Silver Egg 48799 DEFB 99,20,22 ; (38) - Copper Egg 48802 DEFB 99,22,22 ; (39) - Golden Egg 48805 DEFB 99,24,22 ; (40) - Silver Egg 48808 DEFB 99,26,22 ; (41) - Copper Egg ; Room Connectivity Data ; ; Two values per room: b48811 DEFB 9,9 ; (00) - Limbo 48813 DEFB 255,2 ; (01) - Outdoors, 0 (Bearwoolf's Hoard) 48815 DEFB 1,3 ; (02) - Outdoors, 1 (Bearwoolf's Cave) 48817 DEFB 2,4 ; (03) - Outdoors, 2 (Beware Bearwoolf) 48819 DEFB 3,5 ; (04) - Outdoors, 3 (The Spooky Forest, 1) 48821 DEFB 4,6 ; (05) - Outdoors, 4 48823 DEFB 5,7 ; (06) - Outdoors, 5 (The Spooky Forest, 2) 48825 DEFB 6,8 ; (07) - Outdoors, 6 (The Sword in the Concrete) 48827 DEFB 7,9 ; (08) - Outdoors, 7 (Robin's Little Hut) 48829 DEFB 8,10 ; (09) - Outdoors, 8 (Exit from Limbo) 48831 DEFB 9,11 ; (10) - Outdoors, 9 (More Spooky Forest) 48833 DEFB 10,12 ; (11) - Outdoors, 10 (Entwood) 48835 DEFB 11,13 ; (12) - Outdoors, 11 (The Spooky Forest, 3) 48837 DEFB 12,14 ; (13) - Outdoors, 12 (The Spooky Forest, 4) 48839 DEFB 13,15 ; (14) - Outdoors, 13 (Wishing Well) 48841 DEFB 14,16 ; (15) - Outdoors, 14 48843 DEFB 15,255 ; (16) - Outdoors, 15 (The Castle Entrance) 48845 DEFB 16,18 ; (17) - Castle Ground Floor, 0 (One Axe Room) 48847 DEFB 17,19 ; (18) - Castle Ground Floor, 1 (Indoor Bowling Green) 48849 DEFB 18,20 ; (19) - Castle Ground Floor, 2 48851 DEFB 19,21 ; (20) - Castle Ground Floor, 3 48853 DEFB 20,22 ; (21) - Castle Ground Floor, 4 (More Axe Problems) 48855 DEFB 21,23 ; (22) - Castle Ground Floor, 5 (Even More Axes) 48857 DEFB 22,255 ; (23) - Castle Ground Floor, 6 (The First Jump Chute) 48859 DEFB 255,25 ; (24) - Castle First Floor, 0 (Main Lever 7) 48861 DEFB 24,26 ; (25) - Castle First Floor, 1 (Main Lever 6) 48863 DEFB 25,27 ; (26) - Castle First Floor, 2 (Security Door & Main Lever 5) 48865 DEFB 26,28 ; (27) - Castle First Floor, 3 (Main Lever 4) 48867 DEFB 27,29 ; (28) - Castle First Floor, 4 (Main Lever 3) 48869 DEFB 28,30 ; (29) - Castle First Floor, 5 (Main Lever 2) 48871 DEFB 29,31 ; (30) - Castle First Floor, 6 (Main Lever 1) 48873 DEFB 30,32 ; (31) - Castle Second Floor, 0 (The Broken Teleport) 48875 DEFB 31,33 ; (32) - Castle Second Floor, 1 (Terrible Twins) 48877 DEFB 32,34 ; (33) - Castle Second Floor, 2 (The Guardian Statues) 48879 DEFB 33,35 ; (34) - Castle Second Floor, 3 (One Way Corridor, 1) 48881 DEFB 34,36 ; (35) - Castle Second Floor, 4 (One Way Corridor, 2) 48883 DEFB 35,37 ; (36) - Castle Second Floor, 5 (One Way Corridor, 3) 48885 DEFB 36,38 ; (37) - Castle Second Floor, 6 48887 DEFB 37,39 ; (38) - Castle Third Floor, 0 (Big White Statue) 48889 DEFB 38,40 ; (39) - Castle Third Floor, 1 48891 DEFB 39,41 ; (40) - Castle Third Floor, 2 (Teleport Room, 1) 48893 DEFB 40,42 ; (41) - Castle Third Floor, 3 (One Way Corridor, 4) 48895 DEFB 41,43 ; (42) - Castle Third Floor, 4 (One Way Corridor, 5) 48897 DEFB 42,44 ; (43) - Castle Third Floor, 5 (One Way Corridor, 6) 48899 DEFB 43,255 ; (44) - Castle Third Floor, 6 48901 DEFB 255,46 ; (45) - Spaceship, 0 (The Control Room) 48903 DEFB 45,47 ; (46) - Spaceship, 1 (Many Screened Room) 48905 DEFB 46,48 ; (47) - Spaceship, 2 (Teleport Room, 2) 48907 DEFB 47,49 ; (48) - Spaceship, 3 48909 DEFB 48,50 ; (49) - Spaceship, 4 (The Power Plant) 48911 DEFB 49,51 ; (50) - Spaceship, 5 48913 DEFB 50,255 ; (51) - Spaceship, 6 ; Character Movement Restriction Data ; ; The values in this table serve to restrict the movement of characters in two ways: b48915 DEFB 99,99 ; (00) - Limbo 48917 DEFB 98,99 ; (01) - Outdoors, 0 (Bearwoolf's Hoard) 48919 DEFB 98,99 ; (02) - Outdoors, 1 (Bearwoolf's Cave) 48921 DEFB 18,99 ; (03) - Outdoors, 2 (Beware Bearwoolf) 48923 DEFB 99,99 ; (04) - Outdoors, 3 (The Spooky Forest, 1) 48925 DEFB 26,8 ; (05) - Outdoors, 4 48927 DEFB 99,99 ; (06) - Outdoors, 5 (The Spooky Forest, 2) 48929 DEFB 99,99 ; (07) - Outdoors, 6 (The Sword in the Concrete) 48931 DEFB 99,99 ; (08) - Outdoors, 7 (Robin's Little Hut) 48933 DEFB 99,99 ; (09) - Outdoors, 8 (Exit from Limbo) 48935 DEFB 99,99 ; (10) - Outdoors, 9 (More Spooky Forest) 48937 DEFB 99,99 ; (11) - Outdoors, 10 (Entwood) 48939 DEFB 99,99 ; (12) - Outdoors, 11 (The Spooky Forest, 3) 48941 DEFB 99,99 ; (13) - Outdoors, 12 (The Spooky Forest, 4) 48943 DEFB 99,99 ; (14) - Outdoors, 13 (Wishing Well) 48945 DEFB 99,99 ; (15) - Outdoors, 14 48947 DEFB 99,16 ; (16) - Outdoors, 15 (The Castle Entrance) 48949 DEFB 98,99 ; (17) - Castle Ground Floor, 0 (One Axe Room) 48951 DEFB 98,99 ; (18) - Castle Ground Floor, 1 (Indoor Bowling Green) 48953 DEFB 98,99 ; (19) - Castle Ground Floor, 2 48955 DEFB 98,99 ; (20) - Castle Ground Floor, 3 48957 DEFB 98,99 ; (21) - Castle Ground Floor, 4 (More Axe Problems) 48959 DEFB 98,99 ; (22) - Castle Ground Floor, 5 (Even More Axes) 48961 DEFB 98,99 ; (23) - Castle Ground Floor, 6 (The First Jump Chute) 48963 DEFB 2,99 ; (24) - Castle First Floor, 0 (Main Lever 7) 48965 DEFB 99,99 ; (25) - Castle First Floor, 1 (Main Lever 6) 48967 DEFB 20,10 ; (26) - Castle First Floor, 2 (Security Door & Main Lever 5) 48969 DEFB 22,8 ; (27) - Castle First Floor, 3 (Main Lever 4) 48971 DEFB 99,99 ; (28) - Castle First Floor, 4 (Main Lever 3) 48973 DEFB 99,99 ; (29) - Castle First Floor, 5 (Main Lever 2) 48975 DEFB 22,14 ; (30) - Castle First Floor, 6 (Main Lever 1) 48977 DEFB 20,12 ; (31) - Castle Second Floor, 0 (The Broken Teleport) 48979 DEFB 99,99 ; (32) - Castle Second Floor, 1 (Terrible Twins) 48981 DEFB 99,20 ; (33) - Castle Second Floor, 2 (The Guardian Statues) 48983 DEFB 98,99 ; (34) - Castle Second Floor, 3 (One Way Corridor, 1) 48985 DEFB 98,99 ; (35) - Castle Second Floor, 4 (One Way Corridor, 2) 48987 DEFB 98,99 ; (36) - Castle Second Floor, 5 (One Way Corridor, 3) 48989 DEFB 22,14 ; (37) - Castle Second Floor, 6 48991 DEFB 22,99 ; (38) - Castle Third Floor, 0 (Big White Statue) 48993 DEFB 99,99 ; (39) - Castle Third Floor, 1 48995 DEFB 20,10 ; (40) - Castle Third Floor, 2 (Teleport Room, 1) 48997 DEFB 98,99 ; (41) - Castle Third Floor, 3 (One Way Corridor, 4) 48999 DEFB 98,99 ; (42) - Castle Third Floor, 4 (One Way Corridor, 5) 49001 DEFB 98,99 ; (43) - Castle Third Floor, 5 (One Way Corridor, 6) 49003 DEFB 22,14 ; (44) - Castle Third Floor, 6 49005 DEFB 2,2 ; (45) - Spaceship, 0 (The Control Room) 49007 DEFB 99,99 ; (46) - Spaceship, 1 (Many Screened Room) 49009 DEFB 20,10 ; (47) - Spaceship, 2 (Teleport Room, 2) 49011 DEFB 16,16 ; (48) - Spaceship, 3 49013 DEFB 98,99 ; (49) - Spaceship, 4 (The Power Plant) 49015 DEFB 14,14 ; (50) - Spaceship, 5 49017 DEFB 99,25 ; (51) - Spaceship, 6 ; 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. b49019 DEFB 7,7 49021 DEFB 6,6 49023 DEFB 5,5 49025 DEFB 4,4 49027 DEFB 3,3 49029 DEFB 2,2 49031 DEFB 1,1 49033 DEFB 0 ; Window Data ; ; Eight bytes per window. The meaning of the data is: b49034 DEFB 4,27,4,20,117,79,1,79 ; (00) Main Menu (Game) Window 49042 DEFB 0,31,0,4,101,67,0,71 ; (01) Command Summary Window 49050 DEFB 0,25,5,15,117,68,0,79 ; (02) 49058 DEFB 0,26,5,18,117,68,2,79 ; (03) Character Selection Window 49066 DEFB 0,25,5,20,117,70,1,79 ; (04) List of objects window (menu or info) 49074 DEFB 4,24,1,6,101,66,0,70 ; (05) "STORMBRINGER A TRUE GRAPHIC ADVENTURE..." window above Control Selection ; Window 49082 DEFB 4,27,10,19,101,70,0,69 ; (06) Control Selection Window 49090 DEFB 0,31,10,20,117,70,1,79 ; (07) "REDEFINE THE GAME" Window 49098 DEFB 3,28,10,20,117,84,0,14 ; (08) Redefine Keys / Instructions Window 49106 DEFB 5,26,10,20,117,115,0,69 ; (09) Instructions Window 49114 DEFB 0,31,16,23,101,67,0,79 ; (10) "WELL DONE..." Window 49122 DEFB 0,19,5,9,117,76,0,70 ; (11) 49130 DEFB 0,16,5,10,117,98,0,104 ; (12) 49138 DEFB 0,18,5,9,117,67,2,70 ; (13) 49146 DEFB 4,27,21,23,117,70,0,205 ; (14) "PRESS FIRE TO CONTINUE" Window 49154 DEFB 0,23,5,9,117,68,0,71 ; (15) 49162 DEFB 0,15,5,11,117,98,1,112 ; (16) "EXAMINE WHAT?" Window 49170 DEFB 0,18,5,14,117,68,5,120 ; (17) 49178 DEFB 0,22,5,17,117,67,0,120 ; (18) "EXAMINE YOURSELF" / "EXAMINE CHARACTER" Window 49186 DEFB 17,20,8,13,117,68,0,71 ; (19) Frame around portrait of character on "EXAMINE CHARACTER" and "EXAMINE ; YOURSELF" windows 49194 DEFB 0,22,5,14,117,67,0,120 ; (20) "EXAMINE OBJECT" Window 49202 DEFB 2,5,9,12,117,69,0,69 ; (21) Frame around object in "EXAMINE OBJECT" Window 49210 DEFB 0,11,5,12,117,78,0,71 ; (22) "THE BEAR SAYS..." Window 49218 DEFB 0,22,5,15,117,77,2,78 ; (23) "WHICH COMMAND DO YOU WANT TO USE?" ("COMMAND [CHARACTER] TO...") Window 49226 DEFB 4,27,8,18,117,104,0,104 ; (24) Game Over Window 49234 DEFB 0,12,5,9,117,104,0,104 ; (25) "[CHARACTER] IS ASLEEP" Window 49242 DEFB 4,27,7,18,117,87,0,79 ; (26) "SOMEBODY SWITCHED OUT THE LIGHT..." Window 49250 DEFB 0,15,5,11,117,115,0,112 ; (27) 49258 DEFB 0,22,6,9,117,68,2,71 ; (28) 49266 DEFB 0,19,5,9,117,68,2,71 ; (29) 49274 DEFB 0,26,5,16,117,87,2,79 ; (30) Spell Selection Window ; Characters' Initial Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are capped at 100: b49282 DEFB 70,17,82,62,0,37,0,1 ; Magic Knight 49290 DEFB 100,100,100,127,7,37,100,2 ; Off-White Knight 49298 DEFB 70,50,20,178,69,52,100,3 ; Aramis le Peux 49306 DEFB 60,45,75,60,68,53,100,4 ; Robin of Shylock 49314 DEFB 80,40,76,5,0,0,100,5 ; Reggie the Rat 49322 DEFB 90,70,30,178,70,54,100,6 ; Rachel of Amazonia 49330 DEFB 90,70,100,100,0,0,100,7 ; Barker the Ent 49338 DEFB 90,70,30,0,0,0,100,8 ; Organon the Guard 49346 DEFB 90,70,30,100,0,0,100,9 ; Grunter the Bearwoolf ; Table of Object Properties ; ; Forty-two groups of eight bytes, one group per object (including "Nothing at All"). The values are: b49354 DEFB 0,0,0,0,0,0,0,0 ; (00) - Nothing at all 49362 DEFB 33,8,0,0,15,0,70,7 ; (01) - Disquise 49370 DEFB 34,0,35,11,15,0,71,16 ; (02) - Crystal Ball 49378 DEFB 33,0,37,6,9,0,70,17 ; (03) - Wand of Command 49386 DEFB 33,0,0,2,31,0,70,20 ; (04) - Teddy Bear 49394 DEFB 33,0,0,8,26,0,69,26 ; (05) - Stick of Dynamite 49402 DEFB 33,40,85,3,15,0,70,11 ; (06) - Magic Talisman 49410 DEFB 1,32,0,0,12,0,71,13 ; (07) - Broken Glass 49418 DEFB 1,32,0,0,12,0,71,13 ; (08) - Broken Glass 49426 DEFB 1,32,0,0,12,0,71,13 ; (09) - Broken Glass 49434 DEFB 1,0,0,0,12,0,70,28 ; (10) - Horse Feather 49442 DEFB 33,8,0,10,31,0,66,27 ; (11) - Power Boots 49450 DEFB 33,8,0,3,15,0,66,10 ; (12) - Glow Shield 49458 DEFB 1,0,0,0,31,0,70,12 ; (13) - Chicken 49466 DEFB 33,32,0,3,12,0,68,25 ; (14) - Boomerang 49474 DEFB 33,32,0,3,21,0,71,29 ; (15) - Sword 49482 DEFB 33,8,0,3,15,0,70,19 ; (16) - Brass Ankh 49490 DEFB 33,32,0,14,26,0,68,14 ; (17) - Bottle of Liquid 49498 DEFB 33,32,0,15,26,0,68,14 ; (18) - Bottle of Liquid 49506 DEFB 33,32,0,17,10,0,70,18 ; (19) - Torch 49514 DEFB 1,0,0,0,15,0,71,5 ; (20) - Mirror 49522 DEFB 33,32,0,0,15,0,69,3 ; (21) - Gadget X 49530 DEFB 97,0,0,3,15,0,68,23 ; (22) - Elf-Horn 49538 DEFB 33,32,0,3,12,0,71,24 ; (23) - Silver Arrow 49546 DEFB 34,0,0,0,15,0,67,15 ; (24) - Instruction Book 49554 DEFB 1,32,0,0,12,0,70,22 ; (25) - Magic Missile 49562 DEFB 33,0,0,7,15,128,70,4 ; (26) - Advert 49570 DEFB 33,0,0,12,15,0,7,6 ; (27) - Scroll 49578 DEFB 33,0,0,14,26,0,69,14 ; (28) - Empty Bottle 49586 DEFB 33,0,0,15,26,0,70,14 ; (29) - Empty Bottle 49594 DEFB 1,8,0,0,15,0,71,10 ; (30) - Shield 49602 DEFB 1,0,0,0,12,0,67,21 ; (31) - Teleport Key 49610 DEFB 1,32,0,0,12,0,69,8 ; (32) - Teleport Pad 49618 DEFB 33,0,0,1,15,0,71,4 ; (33) - Newspaper 49626 DEFB 33,0,0,31,15,0,71,6 ; (34) - List of Clues 49634 DEFB 1,0,0,0,12,0,69,3 ; (35) - Bow 49642 DEFB 3,32,0,0,15,0,70,9 ; (36) - Golden Egg 49650 DEFB 2,0,0,0,15,0,71,9 ; (37) - Silver Egg 49658 DEFB 1,0,0,0,15,0,6,9 ; (38) - Copper Egg 49666 DEFB 3,32,0,0,15,0,70,9 ; (39) - Golden Egg 49674 DEFB 2,0,0,0,15,0,71,9 ; (40) - Silver Egg 49682 DEFB 1,0,0,0,15,0,6,9 ; (41) - Copper Egg ; Table of x- and y-Coordinates of Positions Taken by Summoned Characters in Each Room ; ; x- and y-coordinates at which a summoned character will initially appear for each room. Values are: b49690 DEFB 99,19 ; (00) - Limbo 49692 DEFB 18,19 ; (01) - Outdoors, 0 (Bearwoolf's Hoard) 49694 DEFB 12,19 ; (02) - Outdoors, 1 (Bearwoolf's Cave) 49696 DEFB 26,19 ; (03) - Outdoors, 2 (Beware Bearwoolf) 49698 DEFB 16,19 ; (04) - Outdoors, 3 (The Spooky Forest, 1) 49700 DEFB 12,19 ; (05) - Outdoors, 4 49702 DEFB 16,19 ; (06) - Outdoors, 5 (The Spooky Forest, 2) 49704 DEFB 16,19 ; (07) - Outdoors, 6 (The Sword in the Concrete) 49706 DEFB 26,19 ; (08) - Outdoors, 7 (Robin's Little Hut) 49708 DEFB 20,19 ; (09) - Outdoors, 8 (Exit from Limbo) 49710 DEFB 16,19 ; (10) - Outdoors, 9 (More Spooky Forest) 49712 DEFB 22,19 ; (11) - Outdoors, 10 (Entwood) 49714 DEFB 16,19 ; (12) - Outdoors, 11 (The Spooky Forest, 3) 49716 DEFB 6,19 ; (13) - Outdoors, 12 (The Spooky Forest, 4) 49718 DEFB 20,19 ; (14) - Outdoors, 13 (Wishing Well) 49720 DEFB 26,19 ; (15) - Outdoors, 14 49722 DEFB 12,19 ; (16) - Outdoors, 15 (The Castle Entrance) 49724 DEFB 16,19 ; (17) - Castle Ground Floor, 0 (One Axe Room) 49726 DEFB 16,17 ; (18) - Castle Ground Floor, 1 (Indoor Bowling Green) 49728 DEFB 16,19 ; (19) - Castle Ground Floor, 2 49730 DEFB 16,19 ; (20) - Castle Ground Floor, 3 49732 DEFB 16,19 ; (21) - Castle Ground Floor, 4 (More Axe Problems) 49734 DEFB 16,19 ; (22) - Castle Ground Floor, 5 (Even More Axes) 49736 DEFB 16,19 ; (23) - Castle Ground Floor, 6 (The First Jump Chute) 49738 DEFB 16,19 ; (24) - Castle First Floor, 0 (Main Lever 7) 49740 DEFB 16,19 ; (25) - Castle First Floor, 1 (Main Lever 6) 49742 DEFB 26,19 ; (26) - Castle First Floor, 2 (Security Door & Main Lever 5) 49744 DEFB 20,19 ; (27) - Castle First Floor, 3 (Main Lever 4) 49746 DEFB 16,19 ; (28) - Castle First Floor, 4 (Main Lever 3) 49748 DEFB 99,19 ; (29) - Castle First Floor, 5 (Main Lever 2) 49750 DEFB 16,19 ; (30) - Castle First Floor, 6 (Main Lever 1) 49752 DEFB 16,19 ; (31) - Castle Second Floor, 0 (The Broken Teleport) 49754 DEFB 99,19 ; (32) - Castle Second Floor, 1 (Terrible Twins) 49756 DEFB 22,19 ; (33) - Castle Second Floor, 2 (The Guardian Statues) 49758 DEFB 99,19 ; (34) - Castle Second Floor, 3 (One Way Corridor, 1) 49760 DEFB 99,19 ; (35) - Castle Second Floor, 4 (One Way Corridor, 2) 49762 DEFB 99,19 ; (36) - Castle Second Floor, 5 (One Way Corridor, 3) 49764 DEFB 20,19 ; (37) - Castle Second Floor, 6 49766 DEFB 99,19 ; (38) - Castle Third Floor, 0 (Big White Statue) 49768 DEFB 16,19 ; (39) - Castle Third Floor, 1 49770 DEFB 2,19 ; (40) - Castle Third Floor, 2 (Teleport Room, 1) 49772 DEFB 99,19 ; (41) - Castle Third Floor, 3 (One Way Corridor, 4) 49774 DEFB 99,19 ; (42) - Castle Third Floor, 4 (One Way Corridor, 5) 49776 DEFB 99,19 ; (43) - Castle Third Floor, 5 (One Way Corridor, 6) 49778 DEFB 16,19 ; (44) - Castle Third Floor, 6 49780 DEFB 16,19 ; (45) - Spaceship, 0 (The Control Room) 49782 DEFB 16,19 ; (46) - Spaceship, 1 (Many Screened Room) 49784 DEFB 6,19 ; (47) - Spaceship, 2 (Teleport Room, 2) 49786 DEFB 16,19 ; (48) - Spaceship, 3 49788 DEFB 16,19 ; (49) - Spaceship, 4 (The Power Plant) 49790 DEFB 16,19 ; (50) - Spaceship, 5 49792 DEFB 16,19 ; (51) - Spaceship, 6 ; Table of 2x2 Block Style Definitions ; ; #TABLE(default,centre,:w) ; { =h Offset | =h Meaning } ; { 0 | Attribute } ; { 1 | Terrain interaction parameter to apply } ; { 2 | Terrain Interaction Parameter Painting Bitmap } ; { 3 | Unused } ; { 4 | Index of top-left udg } ; { 5 | Index of top-right udg } ; { 6 | Index of bottom-left udg } ; { 7 | Index of bottom-right udg } ; TABLE# b49794 DEFB 71,0,15,0,0,0,0,0 49802 DEFB 70,208,15,0,24,24,24,24 49810 DEFB 68,208,15,0,2,3,26,27 ; (unused) 49818 DEFB 68,208,15,0,4,5,28,29 ; (unused) 49826 DEFB 68,208,15,0,68,69,0,0 49834 DEFB 68,208,15,0,8,9,32,33 ; (unused) 49842 DEFB 68,208,15,0,10,11,34,35 ; (unused) 49850 DEFB 68,208,15,0,12,13,36,37 ; (unused) 49858 DEFB 68,208,15,0,14,15,38,39 ; (unused) 49866 DEFB 68,208,15,0,48,49,72,73 ; (unused) 49874 DEFB 22,208,15,0,67,67,67,67 ; (unused) 49882 DEFB 71,0,15,0,54,55,78,79 ; (unused) 49890 DEFB 71,0,15,0,56,57,80,81 ; (unused) 49898 DEFB 71,208,15,0,58,59,58,59 49906 DEFB 70,0,15,0,70,71,94,95 ; (unused) 49914 DEFB 71,0,15,0,52,53,76,77 49922 DEFB 127,208,15,0,0,0,0,0 ; (unused) 49930 DEFB 71,0,15,0,0,0,0,0 ; (unused) 49938 DEFB 71,0,15,0,0,0,0,0 ; (unused) 49946 DEFB 194,208,15,0,92,93,94,95 49954 DEFB 22,0,15,0,90,90,90,90 49962 DEFB 7,208,3,0,66,67,0,0 ; (unused) 49970 DEFB 71,208,3,0,67,67,24,24 ; (unused) 49978 DEFB 22,208,3,0,67,67,67,67 49986 DEFB 38,208,15,0,67,67,67,67 ; (unused) 49994 DEFB 38,208,15,0,90,90,90,90 50002 DEFB 3,0,15,0,0,0,0,0 ; (unused) 50010 DEFB 71,0,15,0,50,51,74,75 50018 DEFB 71,0,15,0,0,0,0,0 ; (unused) 50026 DEFB 70,0,15,0,24,24,24,24 50034 DEFB 68,0,15,0,66,0,25,66 ; (unused) 50042 DEFB 68,0,15,0,25,25,25,25 ; (unused) 50050 DEFB 68,208,15,0,25,25,25,25 ; (unused) 50058 DEFB 71,208,15,0,17,18,18,17 50066 DEFB 71,208,3,0,17,18,0,0 ; (unused) 50074 DEFB 71,0,15,0,25,26,27,28 ; (unused) 50082 DEFB 71,0,15,0,29,30,31,32 ; (unused) ; Initial Control Selection Menu Text b50090 DEFM 16,7,14 ; KEYBOARD KEMPSTON JOYSTICK CURSOR JOYSTICK SINCLAIR JOYSTICK 1 ; CHANGE GAME OPTIONS INSTRUCTIONS PLAY GAME 50093 DEFM 93,196,14 50096 DEFM 93,197,14 50099 DEFM 93,198,14 50102 DEFM 93,199,14 50105 DEFM 16,6,93,"CHANGE ",106,"OPTIONS",14 50124 DEFM 16,5,93,95,"S",14 50130 DEFM 93,"PLAY ",106 50137 DEFM 0 ; Instructions Text b50138 DEFM "AFTER RETURN",123,102,111 ; AFTER RETURNING FROM THE STARSHIP USS PISCES IN THE 25TH ; CENTURY MAGIC KNIGHT FINDS THAT THE OTHERWISE QUIET VILLAGE OF ; CORNHAMP-ON-MARSH HAS BEEN ATTACKED BY A DESPOT CALLING HIMSELF ; THE OFF-WHITE KNIGHT. OFF-WHITE IS THE DREADED STORMBRINGER! 50153 DEFM "STARSHIP USS PISCES IN ",111 50177 DEFM "25TH CENTURY ",233," " 50192 DEFM "FINDS ",151,111,"OTHERWISE QUIET " 50216 DEFM "VILLAGE ",122,"CORNHAMP-ON-MARSH " 50243 DEFM 152,"BEEN ATTACKED BY ",97,"DESPOT " 50269 DEFM "C",141,123,"HIMSELF ",111 50281 DEFM 217,". " 50284 DEFM 201," ",117,111 50288 DEFM "D",242,"ED ",165,"!" 50295 DEFM 0 50296 DEFM 110," ",111,109,"S ",116," :-",91,14 ; THE KEYS ARE :- N = LEFT M = RIGHT A = JUMP/UP Z = DOWN - ; = MENU (FIRE) 50308 DEFM " N",96,"LEFT",110," M",96,"RIGHT",91 50326 DEFM " A",96,"JUMP/UP Z",96,"DOWN",91 50345 DEFM " -",96,"MENU (FIRE)" 50359 DEFM 0 50360 DEFM " ",139,106,"FEATURES",14 ; THIS GAME FEATURES WINDIMATION+ STARRING YOU AS MAGIC KNIGHT ; WITH ARAMIS, ROBIN, REGGIE, RACHEL, BARKER, ORGANON, AND ; GRUNTER (see trivia) 50372 DEFM 110," WINDIMATION+",14 50387 DEFM 110," ",16,4,18," STARR",123,18,92,14 50403 DEFM 16,7," ",105,"AS ",233,14 50412 DEFM 110,110," ",16,5,"W",100,"H",14 50422 DEFM 16,7," ",202,", ",203,",",14 50431 DEFM " ",204,", ",205,",",14 50438 DEFM " ",206,", ",207,",",14 50445 DEFM " ",104,208 50448 DEFM 0 ; "REDEFINE THE GAME" Window Text b50449 DEFM 110,110,189,111,106,14,14 ; REDEFINE THE GAME REDEFINE KEYBOARD PLAYER ATTRIBUTE IGNORE ; PLAYER ATTRIBUTE UPDATE SAVE THE GAME LOAD AN OLD GAME DO ; NOTHING 50456 DEFM 93,189,196,14 50460 DEFM 93,186,164," IG",148,"RE",14 50470 DEFM 93,186,164," UPDATE",14 50481 DEFM 16,6,93,"SAVE ",111,106,14 50492 DEFM 93,"LOAD ",98,"OLD ",106,14 50505 DEFM 16,7,93,"DO ",140 50512 DEFM 0 ; "Redefine Keys Window" Text 50513 DEFM "ENTER NEW ",109," CHOICE",14 ; ENTER NEW KEY CHOICE OR PRESS ENTER TO EXIT N = LEFT M = ; RIGHT A = JUMP/UP Z = DOWN 0 = MAIN MENU 50532 DEFM "OR ",162," ENTER ",99,"EX",100,91 50548 DEFM " N",96,"LEFT",110," M",96,"RIGHT",91 50566 DEFM " A",96,"JUMP/UP Z",96,"DOWN",91 50585 DEFM " 0",96,174,"MENU" 50593 DEFM 0 50594 DEFM "SAVE & LOAD ",116," ",120 ; SAVE & LOAD ARE NOT ALLOWED HERE. START A GAME THEN READ GADGET ; X 50609 DEFM 141,"OWED ",169,".",14 50618 DEFM "START ",97,106,"THEN " 50631 DEFM 242," GAD",234," X" 50639 DEFM 0 ; Miscellaneous Text 2 b50640 DEFM 92,165,16,6 ; STORMBRINGER A TRUE GRAPHIC ADVENTURE BY DAVID JONES COPYRIGHT 1987 ; (see trivia) 50644 DEFM " ",97,"TRUE",14 50651 DEFM " GRAPHIC ADVENTURE",14 50670 DEFM 16,7,110,"BY ",129,14 50678 DEFM 110,166,253 50681 DEFM 0 50682 DEFM 16,6,110,110," ",165," 48K",14 ; STORMBRINGER 48K COPYRIGHT DAVID JONES 1987 FROM MASTERTRONIC 1987 50693 DEFM 16,7,19," ",166,129," ",253,14 50703 DEFM 19," ",110,"FROM ",190,253 50713 DEFM 0 50714 DEFM 162," FIRE ",99,"CONTINUE" ; PRESS FIRE TO CONTINUE 50730 DEFM 0 50731 DEFM 14 ; EXECUTE COMMAND REJECT COMMAND 50732 DEFM 93,"EXECUTE ",239,14 50743 DEFM 93,"REJECT ",239 50752 DEFM 0 50753 DEFM 14 ; carriage return / line feed}{move text cursor right by two characters 50754 DEFM 93 50755 DEFM 0 50756 DEFM 106,"OVER",14 ; GAME OVER TOTAL COMPLETION 000 % TIME LEFT 30 HOURS 50762 DEFM "TOTAL COMPLETION 000 % " 50785 DEFM 193," LEFT 30 HOURS",91 50801 DEFM 0 50802 DEFM 239,14 ; COMMAND 50804 DEFM 0 50805 DEFM 16,6,165 ; STORMBRINGER 50808 DEFM 0 50809 DEFM 6 ; Height = 5 50810 DEFM 153,109," ",162,"ED" ; BREAK KEY PRESSED 50816 DEFM 0 50817 DEFM 8 ; Height = 7 50818 DEFM 105,"HURT ",121 ; YOU HURT YOURSELF MOVING AROUND IN THE DARK 50825 DEFM "MOV",123,"AROUND IN ",111 50840 DEFM "DARK" 50844 DEFM 0 50845 DEFM 9 ; Height = 8 50846 DEFM 105,163,121 ; YOU KILLED YOURSELF TRYING TO THROW THE {name of Current Object} AT ; {short name of Current Character} 50849 DEFM "TRY",123,99,243," ",111 50857 DEFM 29," AT ",31 50863 DEFM 0 50864 DEFM 7 ; Height = 6 50865 DEFM 105,"THREW ",111,29," " ; YOU THREW THE {name of Current Object} AND KILLED {short name of ; Current Character} 50875 DEFM 104,163,31 50878 DEFM 0 50879 DEFM 10 ; Height = 9 50880 DEFM "I SUPPOSE ",105,"REALISED " ; I SUPPOSE YOU REALISED THAT THIS IS A SPELL TO QUIT THE GAME BUT ; PRESSING THE BREAK KEY IS MUCH QUICKER ! 50900 DEFM 151,139,117,97,175," " 50906 DEFM 99,"QU",100," ",111,106,113," " 50915 DEFM 162,123,111,153,109," " 50921 DEFM 117,"MUCH QUICKER !" 50936 DEFM 0 ; Miscellaneous Text 3 b50937 DEFM 31," ",117,"ASLEEP" ; short name of Current Character} IS ASLEEP 50946 DEFM 0 50947 DEFM "WELL DONE!",14 ; WELL DONE! MAGIC KNIGHT IS WHOLE AGAIN! MAGIC KNIGHT IS NOW IN NEED ; OF A NICE LONG REST. 50958 DEFM 233," ",117,"WHOLE AGAIN! " 50974 DEFM 233," ",117,148,"W IN NEED ",122 50989 DEFM 97,"NICE LONG REST." 51005 DEFM 0 51006 DEFM 9 ; Height = 8 51007 DEFM 105,"HAVE COMPLETED " ; YOU HAVE COMPLETED YOUR TASK AND MAGIC KNIGHT HAS DECIDED TO RETIRE. 51023 DEFM 119,"TASK ",104,233," " 51032 DEFM 152,"DECIDED ",99,"RETIRE." 51049 DEFM 0 51050 DEFM 110,144,110,"1 2 3 4 5" ; STRENGTH 1 2 3 4 5 51066 DEFM 0 ; Placeholder for three-digit number (Magic Knight's strength and/or cave progress) 51067 DEFM "---" ; --- 51070 DEFM 0 51071 DEFM 6 ; Height = 5 51072 DEFM 105,"DIED ",122,"EXHAUSTION" ; YOU DIED OF EXHAUSTION 51089 DEFM 0 51090 DEFM 11 ; Height = 10 51091 DEFM 30," " ; full name of Current Character} KILLED YOU AS YOU APPROACHED. GREAT ; CARE IS NEEDED WITH {short name of Current Character} BECAUSE IT DOES ; NOT KNOW ITS OWN STRENGTH 51093 DEFM 163,105,"AS ",105 51099 DEFM "APPROACHED. GREAT C",116," " 51120 DEFM 117,"NEEDED W",100,"H ",31," " 51134 DEFM "BECAUSE ",100," DOES ",120 51150 DEFM "K",148,"W ",100,"S OWN ",144 51162 DEFM 0 51163 DEFM 0 ; Unused 51164 DEFM 11 ; Height = 10 51165 DEFM 217," ",118 ; OFF-WHITE KNIGHT SAYS "YOU FOOL! NOW I WILL TRULY BE THE MASTER OF ; ALL CREATION! WITHOUT YOU TO STOP ME I AM INVINCIBLE!" AS HE SPOKE ; OFF-WHITE PULLED A BLASTER FROM A CONCEALED POCKET AND DISINTEGRATED ; YOU 51168 DEFM 34,105,"FOOL! ",148,"W I ",154 51182 DEFM "TRULY BE ",111,"MASTER ",122 51200 DEFM 141," CREATION! W",100,"HOUT " 51219 DEFM 105,99,"STOP ME I AM " 51234 DEFM "INVINCIBLE!",34,14 51247 DEFM "AS HE SPOKE ",201," " 51261 DEFM 248,"ED ",97,"BLASTER ",102 51275 DEFM 97,"CONCEALED POCKET ",104 51294 DEFM "DISINTEGRATED ",105 51309 DEFM 0 51310 DEFM 7 ; Height = 6 51311 DEFM 105,"WERE ",163,"BY " ; YOU WERE KILLED BY OFF-WHITE KNIGHT. 51321 DEFM 217,"." 51323 DEFM 0 51324 DEFM 6 ; Height = 5 51325 DEFM 105,"R",98,"OUT ",122,193 ; YOU RAN OUT OF TIME 51334 DEFM 0 51335 DEFM 3 ; Height = 2 51336 DEFM 105,116," ",120 ; YOU ARE NOT CARRYING ANYTHING 51340 DEFM "CARRY",123,"ANYTH",123 51352 DEFM 0 51353 DEFM 3 ; Height = 2 51354 DEFM 105,116," ",120 ; YOU ARE NOT WEARING ANYTHING 51358 DEFM 246,123,"ANYTH",123 51366 DEFM 0 51367 DEFM 16,6 ; WHO DO YOU WANT TO 51369 DEFM "WHO DO ",105,155," ",99 51380 DEFM 0 51381 DEFM 3 ; Height = 2 51382 DEFM 142,117,148,157 ; THERE IS NOBODY IN THIS ROOM 51386 DEFM "IN ",139,178 51391 DEFM 0 51392 DEFM 25," ",98,103,102,"?",14 ; name of Current Command} AN OBJECT FROM ? 51399 DEFM 0 51400 DEFM 25," ",98,103,99,"?",14 ; name of Current Command} AN OBJECT TO ? 51407 DEFM 0 51408 DEFM 25," ?",14 ; name of Current Command} ? 51412 DEFM 0 51413 DEFM 14 ; SUMMON ? 51414 DEFM 115,"?",14 51417 DEFM 0 51418 DEFM 243," ",98,103,"AT ?",14 ; THROW AN OBJECT AT ? 51427 DEFM 0 51428 DEFM 156," ",99,"?",14 ; TRAVEL TO ? 51433 DEFM 0 ; Main In-Game Menu Strings Permanent entries: b51434 DEFM 16,4,239,"S AVAILABLE :-",91 ; COMMANDS AVAILABLE :- PICK UP AN OBJECT DROP AN OBJECT TAKE AN OBJECT ; GIVE AN OBJECT EXAMINE 51452 DEFM 16,6,93,"PICK UP ",98,103,14 51466 DEFM 93,235," ",98,103,14 51472 DEFM 93,236," ",98,103,14 51478 DEFM 93,237," ",98,103,14 51484 DEFM 93,238 51486 DEFM 0 ; Conditional entries: 51487 DEFM 94,93,239," ",97,101,0 ; COMMAND A CHARACTER 51494 DEFM 94,93,"A",0 ; A (see trivia) 51498 DEFM 94,93,241,0 ; TELEPORT 51502 DEFM 94,93,242," ",125,0 ; READ SOMETHING 51508 DEFM 94,93,243," ",125,0 ; THROW SOMETHING 51514 DEFM 94,93,244," ",97,175,0 ; CAST A SPELL 51521 DEFM 94,93,245," ",125,0 ; BLOW SOMETHING 51527 DEFM 94,93,246,47,"UN",246," ",103,0 ; WEAR/UNWEAR OBJECT 51537 DEFM 94,93,247," ",97,101,0 ; TICKLE A CHARACTER 51544 DEFM 94,93,248," ",107,0 ; PULL LEVER 51550 DEFM 94,93,249," ",125,0 ; SMELL SOMETHING 51556 DEFM 94,93,"HAVE ",97,250,0 ; HAVE A WISH 51566 DEFM 94,93,"HAVE ",97,251,0 ; HAVE A DRINK 51576 DEFM 94,93,"D",0 ; D (see trivia) 51580 DEFM 94,93,"E",0 ; E (see trivia) 51584 DEFM 94,93,"F",0 ; F (see trivia) ; Text Relating to "COMMAND A CHARACTER TO HELP" Command b51588 DEFM 4 ; Height = 3 51589 DEFM 31," ",118,34,"I ",154 ; short name of Current Character} SAYS "I WILL REQUIRE A GOLDEN EGG ; FOR MY SERVICES" 51596 DEFM 161," ",97,127,114," " 51602 DEFM "FOR MY SERVICES",34 51618 DEFM 0 51619 DEFM 7 ; Height = 6 51620 DEFM "BRAVE ",31," ",152,"SHOT " ; BRAVE {short name of Current Character} HAS SHOT BEARWOOLF FROM A ; NICE SAFE DISTANCE! IT HAS BEEN RETURNED TO ITS ORIGINAL FORM, A CUTE ; LITTLE TEDDY BEAR! 51634 DEFM 158," ",102,97,"NICE SAFE " 51648 DEFM "DISTANCE! ",100," ",152,"BEEN " 51666 DEFM "RETURNED ",99,100,"S ORIGINAL " 51688 DEFM "FORM, ",97,"CUTE L",100,"TLE " 51706 DEFM 159,"!" 51708 DEFM 0 51709 DEFM 8 ; Height = 7 51710 DEFM 31," ",118,34,111 ; short name of Current Character} SAYS "THE PASSWORD NUMBER FOR TODAY ; IS ---. YOU WILL NEED TO ENTER THIS NUMBER TO ACTIVATE THE CASTLE ; TELEPORT SYSTEM" 51715 DEFM "PASSWORD NUMBER FOR " 51735 DEFM "TODAY ",117,"---. ",105,154 51749 DEFM "NEED ",99,"ENTER ",139 51762 DEFM "NUMBER ",99,"ACTIVATE ",111 51780 DEFM 244,"LE ",241," " 51786 DEFM "SYSTEM",34 51793 DEFM 0 ; Text Relating to "PICK UP" Command b51794 DEFM 92,105,116," ",148,"W CARRYING",94 ; YOU ARE NOW CARRYING 51810 DEFM 0 51811 DEFM 92,"PICK UP ",111 ; PICK UP THE 51821 DEFM 0 51822 DEFM 3 ; Height = 2 51823 DEFM 142,117,140," " ; THERE IS NOTHING IN THIS ROOM 51827 DEFM "IN ",139,178 51832 DEFM 0 51833 DEFM 3 ; Height = 2 51834 DEFM 142,117,140," " ; THERE IS NOTHING NEAR ENOUGH 51838 DEFM "NEAR E",148,"UGH" 51848 DEFM 0 51849 DEFM 3 ; Height = 2 51850 DEFM 119,"HANDS ",116," " ; YOUR HANDS ARE FULL 51859 DEFM "FULL" 51863 DEFM 0 51864 DEFM 4 ; Height = 3 51865 DEFM 111,29," " ; THE {name of Current Object} IS TOO HEAVY FOR YOU 51868 DEFM 117,"TOO HEAVY FOR " 51883 DEFM 105 51884 DEFM 0 ; Teddy Bear is Scared Text b51885 DEFM 7 ; Height = 6 51886 DEFM 111,"BEAR " ; THE BEAR SAYS 'MAMA! MAMA! TEDDY IS SCARED!' 51892 DEFM 118 51893 DEFM "'MAMA! " 51900 DEFM "MAMA! " 51906 DEFM "TEDDY ",117 51913 DEFM "SC",116,"D!'" 51919 DEFM 0 ; Text Relating to All Commands that Manipulate Objects b51920 DEFM 92,25," ",112,103,"?",94 ; name of Current Command} WHICH OBJECT ? 51927 DEFM 0 51928 DEFM 92,25," ",111 ; name of Current Command} THE 51932 DEFM 0 ; Text Relating to "DROP" Command b51933 DEFM 9 ; Height = 8 51934 DEFM 111,29," " ; THE {name of Current Object} BLEW UP! IT WAS NOT A VERY SAFE STICK OF {name of ; Current Object} 51937 DEFM "BLEW UP! ",100," " 51948 DEFM 160,120,97 51951 DEFM "VERY SAFE STICK ",122 51968 DEFM 29 51969 DEFM 0 51970 DEFM 3 ; Height = 2 51971 DEFM 105,"CAN",120,25," " ; YOU CANNOT {name of Current Command} THE {name of Current Object} 51978 DEFM 111,29 51980 DEFM 0 51981 DEFM 8 ; Height = 7 51982 DEFM 111,"MAD JANITOR " ; THE MAD JANITOR HAS SWEPT UP THE {name of Current Object} IT IS NOT ADVISED ; THAT YOU DROP THINGS HERE 51995 DEFM 152,"SWEPT UP " 52005 DEFM 111,29,14 52008 DEFM "IT ",117,120 52013 DEFM "ADVISED ",151 52022 DEFM 105,235," THINGS " 52032 DEFM 169 52033 DEFM 0 ; Text Relating to "TAKE" Command b52034 DEFM 25," ",125,102 ; name of Current Command} SOMETHING FROM 52038 DEFM 0 52039 DEFM " ",102 ; FROM 52041 DEFM 0 52042 DEFM 3 ; Height = 2 52043 DEFM 31,"'S HANDS " ; short name of Current Character}'S HANDS ARE EMPTY 52053 DEFM 116," EMPTY" 52060 DEFM 0 52061 DEFM 4 ; Height = 3 52062 DEFM 31," ",155,"S " ; short name of Current Character} WANTS TO KEEP THE {name of Current Object 52067 DEFM 99,"KEEP ",111 52074 DEFM 29 52075 DEFM 0 52076 DEFM 5 ; Height = 4 52077 DEFM 31," ",152 ; short name of Current Character} HAS {name of Current Command}N AN EGG IN ; EXCHANGE FOR THE {name of Current Object 52080 DEFM 25,"N ",98,114," IN " 52089 DEFM "EXCHANGE FOR ",111 52103 DEFM 29 52104 DEFM 0 ; Text Relating to "GIVE" Command b52105 DEFM " ",99 ; TO 52107 DEFM 0 52108 DEFM 3 ; Height = 2 52109 DEFM 31,"'S HANDS " ; short name of Current Character}'S HANDS ARE FULL 52119 DEFM 116," FULL" 52125 DEFM 0 52126 DEFM 3 ; Height = 2 52127 DEFM 31," ",117,120 ; short name of Current Character} IS NOT STRONG ENOUGH 52131 DEFM "STRONG E",148,"UGH" 52143 DEFM 0 52144 DEFM 4 ; Height = 3 52145 DEFM 31," DOES " ; short name of Current Character} DOES NOT WANT THE {name of Current Object 52152 DEFM 120,155," ",111 52156 DEFM 29 52157 DEFM 0 ; Text Relating to "EXAMINE" Command b52158 DEFM 92,25," " ; name of Current Command 52161 DEFM 0 52162 DEFM 25," WHAT ?",91 ; name of Current Command} WHAT ? OBJECT CHARACTER YOURSELF 52171 DEFM 93,103,14 52174 DEFM 93,101,14 52177 DEFM 93,121 52179 DEFM 0 52180 DEFM 25," ",31,91 ; name of Current Command} {short name of Current Character} STRENGTH ; 99 HAPPINESS 99 STAMINA 99 MAGIC LVL. 99 FOOD LVL. 99 52184 DEFM 144," 99 ",14 52192 DEFM "HAPPINESS 99 ",14 52208 DEFM "STAMINA",110," 99 ",14 52222 DEFM 194," LVL. 99 ",14 52234 DEFM "FOOD LVL. 99 ",91 52250 DEFM 0 52251 DEFM 110,110,25,14 ; name of Current Command 52255 DEFM 0 52256 DEFM 91 ; WEIGHT 99 BLOW . READ . WEAR . 52257 DEFM 110,110,"WEIGHT",110," 99 ",14 52273 DEFM 110,110,245,110,110," . ",14 52282 DEFM 110,110,242," ",110,110,". ",14 52291 DEFM 110,110,246,110,110," . ",91 52300 DEFM 0 ; Characters' "Current Status" Texts b52301 DEFM 0 ; Unused ; (01) Magic Knight 52302 DEFM "PROGRESS 000 %",14 ; PROGRESS 000 % TIME LEFT 48 HOURS 52317 DEFM 193," LEFT 48 HOURS" 52332 DEFM 0 ; (02) Off-White Knight 52333 DEFM 201," ",117,111,"OTHER HALF ",122,105 ; OFF-WHITE IS THE OTHER HALF OF YOU 52350 DEFM 0 ; (03) Aramis Le Peux 52351 DEFM 202," CAN'T WORK OUT W",169," ",111,249," ",117,"COM",123,"FROM!" ; ARAMIS CAN'T WORK OUT WHERE THE ; SMELL IS COMING FROM! 52384 DEFM 0 ; (04) Robin of Shylock 52385 DEFM 203," ",117,97,"GOOD SHOT W",100,"H POINTED STICKS" ; ROBIN IS A GOOD SHOT WITH POINTED ; STICKS 52417 DEFM 0 ; (05) Reggie the Rat 52418 DEFM 204," ",117,120,"VERY CLEAN" ; REGGIE IS NOT VERY CLEAN 52432 DEFM 0 ; (06) Rachel of Amazonia 52433 DEFM 205," ",117,"GOOD AT MATHS" ; RACHEL IS GOOD AT MATHS 52449 DEFM 0 ; (07) Barker the Ent 52450 DEFM 206," ",117,"INCREDIBLY OLD ",104,"GNARLED" ; BARKER IS INCREDIBLY OLD AND GNARLED 52476 DEFM 0 ; (08) Organon the Guard 52477 DEFM 207," ",117,"VERY TOUGH" ; ORGANON IS VERY TOUGH 52490 DEFM 0 ; (09) Grunter the Bearwoolf 52491 DEFM 208," ",117,97,"REAL TOUGH DUDE" ; GRUNTER IS A REAL TOUGH DUDE 52510 DEFM 0 52511 DEFM 31," ",117,"ASLEEP" ; short name of Current Character} IS ; ASLEEP 52520 DEFM 0 ; Miscellaneous Text 4 b52521 DEFM 121 ; YOURSELF 52522 DEFM 0 ; Text Relating to "COMMAND" Command b52523 DEFM 239," " ; COMMAND 52525 DEFM 0 52526 DEFM 112,239," DO ",105,155," ",99,"USE ?",14,14 ; WHICH COMMAND DO YOU WANT TO USE ? GO TO SLEEP WAKE UP GO ; AWAY HELP EAT & DRINK BE HAPPY 52543 DEFM 93,"GO ",99,"SLEEP",14 52554 DEFM 93,"WAKE UP",14 52563 DEFM 93,"GO AWAY",14 52572 DEFM 93,128,14 52575 DEFM 93,"EAT & ",251,14 52584 DEFM 93,"BE ",184 52589 DEFM 0 52590 DEFM "GO ",99,"SLEEP" ; GO TO SLEEP 52599 DEFM 0 52600 DEFM "WAKE UP" ; WAKE UP 52607 DEFM 0 52608 DEFM "GO AWAY" ; GO AWAY 52615 DEFM 0 52616 DEFM 128 ; HELP 52617 DEFM 0 52618 DEFM "EAT & ",251 ; EAT & DRINK 52625 DEFM 0 52626 DEFM "BE ",184 ; BE HAPPY 52630 DEFM 0 52631 DEFM 4 ; Height = 3 52632 DEFM 31," DOES ",120 ; short name of Current Character} DOES NOT WANT TO BE ; COMMANDED BY YOU 52640 DEFM 155," ",99,"BE " 52646 DEFM 239,"ED BY ",105 52654 DEFM 0 52655 DEFM 3 ; Height = 2 52656 DEFM 31," ",117 ; short name of Current Character} IS ALREADY ASLEEP 52659 DEFM 188," ASLEEP" 52667 DEFM 0 52668 DEFM 4 ; Height = 3 52669 DEFM 31," ",117,"TOO " ; short name of Current Character} IS TOO WAKEFUL TO SLEEP 52676 DEFM "WAKEFUL ",99,"SLEEP" 52690 DEFM 0 52691 DEFM 3 ; Height = 2 52692 DEFM 31," ",152,"GONE " ; short name of Current Character} HAS GONE TO SLEEP 52700 DEFM 99,"SLEEP" 52706 DEFM 0 52707 DEFM 3 ; Height = 2 52708 DEFM 31," ",117 ; short name of Current Character} IS ALREADY AWAKE 52711 DEFM 188," AWAKE" 52718 DEFM 0 52719 DEFM 3 ; Height = 2 52720 DEFM 31,167," " ; short name of Current Character} IS TOO TIRED TO WAKE UP 52723 DEFM "WAKE UP" 52730 DEFM 0 52731 DEFM 3 ; Height = 2 52732 DEFM 31," ",152 ; short name of Current Character} HAS WOKEN UP 52735 DEFM "WOKEN UP" 52743 DEFM 0 52744 DEFM 3 ; Height = 2 52745 DEFM 31,167," " ; short name of Current Character} IS TOO TIRED TO GO AWAY 52748 DEFM "GO AWAY" 52755 DEFM 0 52756 DEFM 3 ; Height = 2 52757 DEFM 31," ",152 ; short name of Current Character} HAS GONE AWAY 52760 DEFM "GONE AWAY" 52769 DEFM 0 52770 DEFM 3 ; Height = 2 52771 DEFM 31," CAN",120 ; short name of Current Character} CANNOT HELP YOU (see ; trivia) 52777 DEFM 128,105," " 52780 DEFM 0 52781 DEFM 4 ; Height = 3 52782 DEFM 31,167," " ; short name of Current Character} IS TOO TIRED TO HELP YOU 52785 DEFM 128,105 52787 DEFM 0 52788 DEFM 3 ; Height = 2 52789 DEFM 31," ",152 ; short name of Current Character} HAS NO FOOD LEFT 52792 DEFM 148," FOOD LEFT" 52803 DEFM 0 52804 DEFM 4 ; Height = 3 52805 DEFM 31,167," " ; short name of Current Character} IS TOO TIRED TO EAT OR ; DRINK 52808 DEFM "EAT OR " 52815 DEFM 251 52816 DEFM 0 52817 DEFM 3 ; Height = 2 52818 DEFM 31," ",152 ; short name of Current Character} HAS TAKEN REFRESHMENT 52821 DEFM 236,"N REFRESHMENT" 52835 DEFM 0 52836 DEFM 4 ; Height = 3 52837 DEFM 31,167," " ; short name of Current Character} IS TOO TIRED TO BE HAPPY 52840 DEFM "BE " 52843 DEFM 184 52844 DEFM 0 52845 DEFM 3 ; Height = 2 52846 DEFM 31," ",154 ; short name of Current Character} WILL TRY TO BE HAPPY 52849 DEFM "TRY ",99,"BE ",184 52858 DEFM 0 ; Text Relating to "READ" Command b52859 DEFM 4 ; Height = 3 52860 DEFM 142,117,148," " ; THERE IS NO WRITING FOR ME TO {name of Current Command} 52864 DEFM "WR",100,123,"FOR ME " 52875 DEFM 99,25 52877 DEFM 0 ; List of Read-Texts of Readable Objects 00: Disquise b52878 DEFM 12 ; Height = 11 52879 DEFM 92,29,14,14 ; name of Current Object} MAGIC DISQUISE KIT. THIS KIT ; CONTAINS 6 DISQUISES 1. FOOTMAN 2. GUARD 3. WIZARD 4. ; CHAMBERMAID 5. WHITE WITCH 6. WARRIOR 52883 DEFM 194," ",124," K",100,".",14 52891 DEFM 139,"K",100," CONTAINS 6 ",124,"S",14 52909 DEFM "1. ",130,14 52914 DEFM "2. ",131,14 52919 DEFM "3. ",132,14 52924 DEFM "4. ",133,14 52929 DEFM "5. ",134,14 52934 DEFM "6. ",135 52938 DEFM 0 ; 01: Newspaper 52939 DEFM 12 ; Height = 11 52940 DEFM 92,29,14 ; name of Current Object} SITUATIONS VACANT : {Current ; Newspaper substring 52943 DEFM "S",100,"UATIONS VACANT :",14 52962 DEFM 28 52963 DEFM 0 ; 02: Teddy Bear 52964 DEFM 5 ; Height = 4 52965 DEFM 92,29,14 ; name of Current Object} TNORF OT KCAB 52968 DEFM "T",148,"RF OT KCAB" 52980 DEFM 0 ; 03: Magic Talisman / Glow Shield / Boomerang / Sword / Brass Ankh / Elf-Horn / Silver Arrow 52981 DEFM 6 ; Height = 5 52982 DEFM 92,29,14 ; name of Current Object} THERE IS WRITING HERE BUT IT IS ; WRITTEN IN A MAGIC LANGUAGE THAT YOU CANNOT {name of Current ; Command 52985 DEFM 142,117,"WR",100,123,169," " 52993 DEFM 113," ",100," ",117,"WR",100,"TEN " 53005 DEFM "IN ",97,194," LANGUAGE " 53020 DEFM 151,105,"CAN",120,25 53027 DEFM 0 ; 04: Unused 53028 DEFM 0 ; 05: Unused 53029 DEFM 0 ; 06: Wand of Command 53030 DEFM 7 ; Height = 6 53031 DEFM 92,29,14 ; name of Current Object} THERE ARE A WHOLE SERIES OF REALLY ; TASTY LOOKING RUNES CARVED ON THIS RATHER FLASH LOOKING WAND ; ! 53034 DEFM 142,116," ",97,"WHOLE SERIES " 53051 DEFM 122,"RE",141,"Y TASTY LOOK",123 53068 DEFM "RUNES CARVED ON ",139 53085 DEFM "RATHER FLASH LOOK",123 53103 DEFM "W",104,"!" 53106 DEFM 0 ; 07: Advert 53107 DEFM 12 ; Height = 11 53108 DEFM 92,29,14,14 ; name of Current Object} GAME CONCEPT AND PROGRAM BY DAVID ; JONES. GRAPHICS BY RAY OWEN. THIS GAME CONTINUES THE ; ADVENTURES OF MAGIC KNIGHT, FOR EARLIER EPISODES SEE FINDERS ; KEEPERS, SPELLBOUND AND KNIGHT-TYME. 53112 DEFM 16,7,106,"CONCEPT ",104,"PROGRAM",14 53132 DEFM "BY ",16,6,18,129,". ",18 53142 DEFM 16,7,14,"GRAPHICS BY RAY OWEN.",14 53167 DEFM 139,106,"CONTINUES ",111 53180 DEFM "ADVENTURES ",122,233,", " 53195 DEFM "FOR EARLIER EPISODES SEE FINDERS " 53228 DEFM "KEEPERS, ",175,"BOUND ",104 53245 DEFM "KNIGHT-TYME." 53257 DEFM 0 ; 08: Stick of Dynamite 53258 DEFM 5 ; Height = 4 53259 DEFM 92,29,14 ; name of Current Object} {name of Current Object}, HANDLE ; WITH EXTREEME CAUTION! (bug) 53262 DEFM 29,", " 53265 DEFM "HANDLE W",100,"H EXTREEME " 53285 DEFM "CAUTION!" 53293 DEFM 0 ; 09: Unused (see trivia) 53294 DEFM 4 ; Height = 3 53295 DEFM 92,29,14 ; name of Current Object} CHEAPO PLASTIC PRODUCTS LTD. MADE IN ; HONG KONG 53298 DEFM "CHEAPO PLASTIC PRODUCTS " 53322 DEFM "LTD. MADE IN HONG KONG" 53344 DEFM 0 ; 10: Power Boots 53345 DEFM 5 ; Height = 4 53346 DEFM 92,29,14 ; name of Current Object} THE LABEL {name of Current Command}S ; 'SIZE 7 SOFT SOLE SPECIAL JUMPING BOOTS' 53349 DEFM 111,"LABEL ",25,"S 'SIZE 7 " 53367 DEFM "SOFT SOLE SPECIAL " 53385 DEFM "JUMP",123,"BOOTS'" 53396 DEFM 0 ; 11: Crystal Ball 53397 DEFM 7 ; Height = 6 53398 DEFM 92,29,14,14 ; name of Current Object} {Current Crystal Ball substring 53402 DEFM 27 53403 DEFM 0 ; 12: Scroll 53404 DEFM 10 ; Height = 9 53405 DEFM 92,29,14 ; name of Current Object} {Current Scroll substring 53408 DEFM 26 53409 DEFM 0 ; 13: Unused 53410 DEFM 0 ; 14: Bottle of Liquid / Empty Bottle 53411 DEFM 5 ; Height = 4 53412 DEFM 92,29,14 ; name of Current Object} OLDE GROG. BOTTLED AND DISTRIBUTED ; BY P ARTIST & SON 53415 DEFM "OLDE GROG. ",149,"D ",104 53430 DEFM "DISTRI",113,"ED BY P ARTIST " 53452 DEFM "& SON" 53457 DEFM 0 ; 15: Bottle of Liquid / Empty Bottle 53458 DEFM 5 ; Height = 4 53459 DEFM 92,29,14 ; name of Current Object} SUPERSTRONG LIQUID BOTTLED AND ; DISTRIBUTED BY A POTHECARY & SON 53462 DEFM "SUPERSTRONG LIQUID " 53481 DEFM 149,"D ",104,"DISTRI",113,"ED " 53495 DEFM "BY ",97,"POTHECARY & SON" 53514 DEFM 0 ; 16: Unused 53515 DEFM 0 ; 17: Torch 53516 DEFM 5 ; Height = 4 53517 DEFM 92,29,14 ; name of Current Object} BRITELITE MEGA-TORCH 53520 DEFM "BR",100,"EL",100,"E MEGA-TORCH" 53538 DEFM 0 ; 18: Unused 53539 DEFM 0 ; 19: Unused 53540 DEFM 0 ; 20: Unused 53541 DEFM 0 ; 21: Wand of Command (with Crystal Ball) 53542 DEFM 6 ; Height = 5 53543 DEFM 92,29,14 ; name of Current Object} THE RUNES WHEN {name of Current ; Command} EXPLAIN THAT THIS OBJECT IS JOLLY USEFUL FOR ; BOSSING PEOPLE ABOUT 53546 DEFM 111,"RUNES WHEN ",25," " 53560 DEFM "EXPLAIN ",151,139,103 53571 DEFM 117,"JOLLY USEFUL FOR " 53589 DEFM "BOSS",123,"PEOPLE ABOUT" 53606 DEFM 0 ; 22: Unused (see trivia) 53607 DEFM 11 ; Height = 10 53608 DEFM 92,29,14 ; name of Current Object} THE LABEL {name of Current Command}S ; 'I AM MILNE THE BEAR SO PLEASE TREAT ME WITH CARE, AND WASH ; ME WITH WARM WATER IF I GET HORRIBLY DIRTY, AND IF YOU FIND ; ANY HUNNEY LYING ABOUT I AM QUITE HAPPY TO SCOFF IT FOR YOU ; ' (see trivia) 53611 DEFM 111,"LABEL ",25,"S 'I AM " 53627 DEFM "MILNE ",111,"BEAR SO PLEASE " 53649 DEFM "TREAT ME W",100,"H C",116,", ",104 53667 DEFM "WASH ME W",100,"H WARM WATER " 53690 DEFM "IF I ",234," HORRIBLY DIRTY, " 53713 DEFM 104,"IF ",105,"FIND ",108 53724 DEFM "HUNNEY LY",123,"ABOUT I AM " 53745 DEFM "QU",100,"E ",184," ",99,"SCOFF ",100," " 53761 DEFM "FOR ",105,"'" 53767 DEFM 0 ; 23: Magic Talisman (with Crystal Ball) 53768 DEFM 4 ; Height = 3 53769 DEFM 92,29,14 ; name of Current Object} WEAR ME FOR FAST MAGIC POWER RESTORE 53772 DEFM 246," ME FOR FAST ",194," " 53788 DEFM "POWER RESTORE" 53801 DEFM 0 ; 24: Glow Shield (with Crystal Ball) 53802 DEFM 6 ; Height = 5 53803 DEFM 92,29,14 ; name of Current Object} HIGHEST QUALITY PLUTONIUM {name of ; Current Object}. CREATED BY THE LEAD MEN FOR SEEING IN THE ; DARK 53806 DEFM "HIGHEST QUAL",100,"Y " 53821 DEFM "PLUTONIUM ",29,". " 53834 DEFM "CREATED BY ",111,"LEAD MEN " 53855 DEFM "FOR SEE",123,"IN ",111,"DARK" 53871 DEFM 0 ; 25: Boomerang (with Crystal Ball) 53872 DEFM 6 ; Height = 5 53873 DEFM 92,29,14 ; name of Current Object} MAGIC {name of Current Object}. ; WARNING :- CAN BE DANGEROUS. USE WITH CARE 53876 DEFM 194," ",29,".",14 53881 DEFM "WARN",123,":- C",98,"BE " 53894 DEFM "DANGEROUS. USE WITH CARE" 53918 DEFM 0 ; 26: Unused 53919 DEFM 0 ; 27: Brass Ankh (with Crystal Ball) 53920 DEFM 3 ; Height = 2 53921 DEFM 92,29,14 ; name of Current Object} LIVE LONG AND PROSPER 53924 DEFM "LIVE LONG ",104,"PROSPER" 53942 DEFM 0 ; 28: Elf-Horn (with Crystal Ball) 53943 DEFM 4 ; Height = 3 53944 DEFM 92,29,14 ; name of Current Object} HORN OF SUMMONING 53947 DEFM "HORN ",122,"SUMMON",123 53960 DEFM 0 ; 29: Silver Arrow (with Crystal Ball) 53961 DEFM 6 ; Height = 5 53962 DEFM 92,29,14 ; name of Current Object} ANTI-POLLYMORPH ARROW 53965 DEFM "ANTI-POLLYMORPH ARROW" 53986 DEFM 0 ; 30: Unused 53987 DEFM 0 ; 31: List of Clues 53988 DEFM 8 ; Height = 7 53989 DEFM 92,29,14 ; name of Current Object} THIS WRITING APPEARS TO BE VERY OLD ; AND YOU CAN NOT READ IT 53992 DEFM 139,"WR",100,123,"APPEARS ",99 54006 DEFM "BE VERY OLD ",104,105,"C",98 54022 DEFM 120,242," ",100 54026 DEFM 0 ; Newspaper Substrings Newspaper Substring 0 b54027 DEFM 14,14 ; A FOOTMAN IS REQUIRED URGENTLY AT CASTLE STORMM. SALARY IS ; NEGOTIABLE. 54029 DEFM 97,130,117,161,"D " 54035 DEFM "URGENTLY AT ",244,"LE " 54051 DEFM "STORMM. SALARY ",117 54067 DEFM "NEGOTIABLE." 54078 DEFM 0 ; Newspaper Substring 1 54079 DEFM 14 ; THE OFF-WHITE KNIGHT REQUIRES THE SERVICES OF AN ADDITIONAL GUARD ; AT THE CASTLE DUE TO EXPANSION OF THE TAX COLLECTION RACKET. PLEASE ; APPLY IN PERSON WITH THIS ADVERT. 54080 DEFM 111,217," " 54083 DEFM 161,"S ",111,"SERVICES ",122 54097 DEFM 98,"ADD",100,"IONAL ",131,"AT " 54112 DEFM 111,244,"LE DUE ",99 54122 DEFM "EXPANSION ",122,111,"TAX " 54138 DEFM "COLLECTION RACKET. " 54157 DEFM "PLEASE APPLY IN PERSON " 54180 DEFM "W",100,"H ",139,"ADVERT." 54192 DEFM 0 ; Newspaper Substring 2 54193 DEFM 14 ; A NEW COURT WIZARD IS NOW REQUIRED. APPLY TO CASTLE STORMM IN ; PERSON WITH THIS ADVERT. PLEASE NOTE THAT 1ST LEVEL ADEPTS NEED NOT ; APPLY 54194 DEFM 97,"NEW COURT ",132,117 54207 DEFM 148,"W ",161,"D. APPLY ",99 54221 DEFM 244,"LE STORMM IN PERSON " 54242 DEFM "W",100,"H ",139,"ADVERT. PLEASE " 54262 DEFM 148,"TE ",151,"1ST LEVEL " 54277 DEFM "ADEPTS NEED ",120,"APPLY" 54295 DEFM 0 ; Newspaper Substring 3 54296 DEFM 14,14 ; THERE IS A VACANCY AT THE CASTLE FOR ONE CHAMBERMAID WITH A MINIMUM ; EDUCATION OF CLASS 1 HONOURS DEGREE. PLEASE APPLY IN PERSON. 54298 DEFM 142,117,97,"VACANCY AT " 54312 DEFM 111,244,"LE FOR ONE " 54325 DEFM 133,"W",100,"H ",97 54331 DEFM "MINIMUM EDUCATION ",122 54350 DEFM "CLASS 1 HO",148,"URS DEGREE.",14 54373 DEFM "PLEASE APPLY IN PERSON." 54396 DEFM 0 ; Newspaper Substring 4 54397 DEFM 14,14 ; A VACANCY NOW EXISTS FOR A WHITE WITCH AT CASTLE STORMM DUE TO THE ; SUDDEN RESIGNATION OF GRETOL THE SEER. 54399 DEFM 97,"VACANCY ",148,"W EXISTS FOR " 54422 DEFM 97,134,"AT ",244,"LE " 54431 DEFM "STORMM DUE ",99,111,"SUDDEN " 54451 DEFM "RESIGNATION ",122,"GRETOL " 54471 DEFM 111,"SEER." 54477 DEFM 0 ; Newspaper Substring 5 54478 DEFM 14 ; A STRONG WARRIOR IS REQUIRED AT THE CASTLE FOR THE NEW POST OF ; BOUNCER. DUTIES TO INCLUDE KEEPING HUNGRY PEASANTS AWAY FROM THEIR ; LORD AND MASTER THE OFF-WHITE KNIGHT. 54479 DEFM 97,"STRONG ",135,117 54489 DEFM 161,"D AT ",111,244,"LE " 54500 DEFM "FOR ",111,"NEW POST ",122 54515 DEFM "BOUNCER. DUTIES ",99 54532 DEFM "INCLUDE KEEP",123,"HUNGRY " 54552 DEFM "PEASANTS AWAY ",102,143," " 54569 DEFM "LORD ",104,"MASTER ",111 54583 DEFM 217,"." 54585 DEFM 0 ; Crystal Ball Substrings Crystal Ball Substring 0 b54586 DEFM 105,154,"NEED SPECIAL " ; YOU WILL NEED SPECIAL JUMPING BOOTS TO REACH THE UPPER LEVELS OF ; CASTLE STORMM 54601 DEFM "JUMP",123,"BOOTS ",99,"REACH " 54619 DEFM 111,"UPPER LEVELS ",122 54634 DEFM 244,"LE STORMM" 54644 DEFM 0 ; Crystal Ball Substring 1 54645 DEFM 100," ",117,"VERY EASY ",99 ; IT IS VERY EASY TO RETURN FROM LIMBO 54659 DEFM "RETURN ",102,"LIMBO" 54672 DEFM 0 ; Crystal Ball Substring 2 54673 DEFM 105,"DO ",120,"NEED ",111 ; YOU DO NOT NEED THE CRYSTAL BALL BUT IT COULD HELP 54684 DEFM 138," B",141," ",113," ",100," " 54693 DEFM "COULD HELP" 54703 DEFM 0 ; Crystal Ball Substring 3 54704 DEFM 105,"MUST USE ",119,"BINARY " ; YOU MUST USE YOUR BINARY KNOWLEDGE TO LEVER YOUR WAY TO THE STARS.. 54722 DEFM "K",148,"WLEDGE ",99,107," ",119 54735 DEFM "WAY ",99,111,"STARS.. " 54749 DEFM 0 ; Crystal Ball Substring 4 54750 DEFM 217," MUST BE " ; OFF-WHITE KNIGHT MUST BE ASLEEP BEFORE YOU CAN MERGE WITH HIM 54760 DEFM "ASLEEP BEFORE ",105,"C",98 54777 DEFM "MERGE W",100,"H HIM" 54790 DEFM 0 ; Crystal Ball Substring 5 54791 DEFM "DO ",125,"SILLY W",100,"H " ; DO SOMETHING SILLY WITH THE TELEPORT PAD AND TELEPORT KEY AND YOU ; WILL WIND UP IN LIMBO 54805 DEFM 111,241," PAD ",104 54813 DEFM 241," ",109," ",104,105 54819 DEFM 154,"WIND UP IN LIMBO" 54836 DEFM 0 ; Crystal Ball Substring 6 54837 DEFM 111,194," MISSILE ",154 ; THE MAGIC MISSILE WILL INDUCE SLEEP IN ANYBODY THAT IT IS THROW AT ; (bug) 54849 DEFM "INDUCE SLEEP IN ANY",157 54869 DEFM 151,100," ",117,243," AT" 54877 DEFM 0 ; Crystal Ball Substring 7 54878 DEFM 218," C",98,"READ " ; ARAMIS LE PEUX CAN READ THE LIST OF CLUES 54887 DEFM 111,"LIST OF CLUES" 54901 DEFM 0 ; Scroll Substrings Scroll Substring 0 b54902 DEFM 14,14,14,14 ; WATCH OUT FOR THE STORM CLOUD! 54906 DEFM "WATCH OUT FOR ",111,"STORM " 54927 DEFM "CLOUD!" 54933 DEFM 0 ; Scroll Substring 1 54934 DEFM 14,14,14 ; OFF-WHITE KNIGHT IS THE BAD HALF OF MAGIC KNIGHT 54937 DEFM 217," ",117,111 54941 DEFM "BAD HALF ",122,233 54952 DEFM 0 ; Scroll Substring 2 54953 DEFM 14,14 ; TO TRAVEL TO PEOPLE YOU WILL NEED TO CARRY TWO SPECIAL OBJECTS 54955 DEFM 99,156," ",99,"PEOPLE ",105 54967 DEFM 154,"NEED ",99,"CARRY TWO " 54984 DEFM "SPECIAL OBJECTS" 54999 DEFM 0 ; Scroll Substring 3 55000 DEFM 14,14,14 ; OFF-WHITE KNIGHT IS TRYING TO KILL YOU 55003 DEFM 217," ",117 55006 DEFM "TRY",123,99,"KILL ",105 55017 DEFM 0 ; Scroll Substring 4 55018 DEFM 14,14,14 ; YOU MUST NOT KILL OFF-WHITE KNIGHT 55021 DEFM 105,"MUST ",120,"KILL " 55033 DEFM 217 55034 DEFM 0 ; Scroll Substring 5 55035 DEFM 14,14 ; YOU MUST MERGE WITH OFF-WHITE KNIGHT TO BECOME A WHOLE PERSON AGAIN 55037 DEFM 105,"MUST MERGE W",100,"H " 55053 DEFM 217," ",99 55056 DEFM "BECOME ",97,"WHOLE PERSON " 55077 DEFM "AGAIN" 55082 DEFM 0 ; Scroll Substring 6 55083 DEFM 14,14,14,14 ; DISQUISE CAN BE USEFUL SOMETIMES (bug) 55087 DEFM 124," C",98,"BE USEFUL " 55101 DEFM 146,193,"S" 55104 DEFM 0 ; Scroll Substring 7 55105 DEFM 14,14,14 ; THE MAGIC MISSILE CAN PROVIDE TRAVELLING ENERGY 55108 DEFM 111,194," MISSILE C",98 55121 DEFM "PROVIDE ",156,"L",123 55132 DEFM "ENERGY" 55138 DEFM 0 ; Scroll Substring 8 [bug] 55139 DEFM 105,154,"NEED SPECIAL " ; YOU WILL NEED SPECIAL JUMPING BOOTS TO REACH THE UPPER LEVELS OF ; CASTLE STORMM 55154 DEFM "JUMP",123,"BOOTS ",99,"REACH " 55172 DEFM 111,"UPPER LEVELS ",122 55187 DEFM 244,"LE STORMM" 55197 DEFM 0 ; Clue Texts Clue 0 b55198 DEFM 5 ; Height = 4 55199 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "THE MAGIC MISSILE IS SOMEWHERE IN THE CAVES" 55202 DEFM 34,111,194," MISSILE ",117 55215 DEFM 146,"W",169," IN ",111 55223 DEFM "CAVES",34 55229 DEFM 0 ; Clue 1 55230 DEFM 4 ; Height = 3 55231 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "THE ELF-HORN CAN BE USED TO SUMMON PEOPLE" 55234 DEFM 34,111,"ELF-HORN C",98,"BE " 55250 DEFM "USED ",99,115,"PEOPLE",34 55264 DEFM 0 ; Clue 2 55265 DEFM 5 ; Height = 4 55266 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "THE CRYSTAL BALL IS NEEDED TO READ MAGIC WRITING " 55269 DEFM 34,111,138," B",141," ",117 55277 DEFM "NEEDED ",99,242," ",194," " 55289 DEFM "WR",100,123,34 55294 DEFM 0 ; Clue 3 55295 DEFM 6 ; Height = 5 55296 DEFM 218," ",118,34,97 ; ARAMIS LE PEUX SAYS "A YELLOW STREAK MIGHT NOT HELP BUT A BIRD WITH ; SIMILAR ATTRIBUTES MIGHT!" 55301 DEFM "YELLOW STREAK MIGHT " 55321 DEFM 120,128,113," ",97,"BIRD " 55331 DEFM "W",100,"H SIMILAR " 55343 DEFM 164,"S MIGHT!",34 55353 DEFM 0 ; Clue 4 55354 DEFM 5 ; Height = 4 55355 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "AN ADVERT CAN HELP GET THE POINT FOR ROBIN" 55358 DEFM 34,98,"ADVERT C",98,128 55370 DEFM 234," ",111,"POINT FOR " 55383 DEFM "ROBIN",34 55389 DEFM 0 ; Clue 5 55390 DEFM 5 ; Height = 4 55391 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "COPPER, SILVER, GOLD. JUST WAIT AND YOU WILL ; BEHOLD!" 55394 DEFM 34,137,", ",136,", GOLD. " 55407 DEFM "JUST WA",100," ",104,105,154 55419 DEFM "BEHOLD!",34 55427 DEFM 0 ; Clue 6 55428 DEFM 5 ; Height = 4 55429 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "SPECIAL JUMPING BOOTS ARE AVAILABLE IN LIMBO" 55432 DEFM 34,"SPECIAL JUMP",123,"BOOTS " 55452 DEFM 116," AVAILABLE IN " 55467 DEFM "LIMBO",34 55473 DEFM 0 ; Clue 7 55474 DEFM 5 ; Height = 4 55475 DEFM 218," ",118 ; ARAMIS LE PEUX SAYS "DANGEROUS USE OF TELEPORT PADS WILL TAKE YOU TO ; LIMBO" 55478 DEFM 34,"DANGEROUS USE ",122 55494 DEFM 241," PADS ",154 55502 DEFM 236," ",105,99,"LIMBO",34 55512 DEFM 0 ; Text Relating to "CAST A SPELL" Command b55513 DEFM 11 ; Height = 10 55514 DEFM 112,175," DO ",105,155," " ; WHICH SPELL DO YOU WANT TO {name of Current Command} ? DIMENSION MERGE ; MELT GRANITE PASS PLANT SPELL OF WONDER TRAVEL TO PERSON MAGIC FULCRUM ; QUITICUS GAMUS 55523 DEFM 99,25," ?",91 55528 DEFM 93,179,14 55531 DEFM 93,180,14 55534 DEFM 93,181,14 55537 DEFM 93,176,14 55540 DEFM 93,182,14 55543 DEFM 93,183,14 55546 DEFM 93,173 55548 DEFM 0 55549 DEFM 4 ; Height = 3 55550 DEFM 105,"CAN",120,25," " ; YOU CANNOT {name of Current Command} THAT SPELL NOW. MAYBE YOU NEED ; MORE SPELL POWER 55557 DEFM 151,175," ",148,"W. MAYBE ",105 55571 DEFM "NEED MORE ",175," POWER" 55588 DEFM 0 55589 DEFM 5 ; Height = 4 55590 DEFM 105,116," ",120 ; YOU ARE NOT NEAR ENOUGH TO THE RIGHT TYPE OF PLANT 55594 DEFM "NEAR E",148,"UGH ",99 55606 DEFM 111,"RIGHT TYPE " 55618 DEFM 122,"PLANT" 55624 DEFM 0 55625 DEFM 10 ; Height = 9 55626 DEFM 105,"FIND " ; YOU FIND YOURSELF STANDING BESIDE A SIMILAR PLANT BUT YOU HAVE ; TRAVELLED TO SOMEWHERE ELSE! 55632 DEFM 121 55633 DEFM "STAND",123 55639 DEFM "BESIDE ",97 55647 DEFM "SIMILAR PLANT " 55661 DEFM 113," ",105,"HAVE " 55669 DEFM 156,"LED ",99 55675 DEFM 146,"W",169," " 55679 DEFM "ELSE!" 55684 DEFM 0 55685 DEFM 13 ; Height = 12 55686 DEFM 105,"FEEL ",111 ; YOU FEEL THE USUAL MAGIC ENERGY DRAIN OF SPELL {name of Current ; Command}ING BUT YOU WONDER WHAT HAS ACTUALLY HAPPENED! NOTHING SEEMS ; TO HAVE CHANGED! 55693 DEFM "USUAL ",194," " 55701 DEFM "ENERGY DRAIN " 55714 DEFM 122,175," " 55717 DEFM 25,123,113," " 55721 DEFM 105,"WONDER " 55729 DEFM "WHAT ",152 55735 DEFM "ACTU",141,"Y " 55742 DEFM "HAPPENED! " 55752 DEFM 140," SEEMS " 55760 DEFM 99,"HAVE " 55766 DEFM "CHANGED!" 55774 DEFM 0 55775 DEFM 10 ; Height = 9 55776 DEFM 105,"FEEL SEVEN " ; YOU FEEL SEVEN LEVERS ALL MOVING TO THEIR START POSITIONS. BALANCE IS ; RESTORED SOMEWHERE NEARBY. 55788 DEFM 107,"S ",141," " 55793 DEFM "MOV",123,99 55798 DEFM 143," START " 55806 DEFM "POS",100,"IONS. " 55816 DEFM "BALANCE ",117 55825 DEFM "RESTORED " 55834 DEFM 146,"W",169," " 55838 DEFM "NEARBY." 55845 DEFM 0 55846 DEFM 7 ; Height = 6 55847 DEFM 105,"FEEL ",119,157 ; YOU FEEL YOUR BODY SUCKED THROUGH A BYPASS IN NULL-SPACE AND SUDDENLY ; FIND YOURSELF STANDING IN FRONT OF {short name of Current Character} 55855 DEFM "SUCKED THROUGH ",97 55871 DEFM "BYPASS IN NULL-SPACE " 55892 DEFM 104,"SUDDENLY FIND " 55907 DEFM 121,"STAND",123,"IN " 55917 DEFM "FRONT ",122,31 55925 DEFM 0 55926 DEFM 244," ",179,0 ; CAST DIMENSION MERGE 55930 DEFM 244," ",180,0 ; CAST MELT GRANITE 55934 DEFM 244," ",181,0 ; CAST PASS PLANT 55938 DEFM 244," ",176,0 ; CAST SPELL OF WONDER 55942 DEFM 156," ",99,14,0 ; TRAVEL TO 55947 DEFM 244," ",183,0 ; CAST MAGIC FULCRUM 55951 DEFM 244," ",173,0 ; CAST QUITICUS GAMUS 55955 DEFM 156," ",99,0 ; TRAVEL TO ; Text Relating to "THROW" Command b55959 DEFM " AT ",0 ; AT 55964 DEFM 4 ; Height = 3 55965 DEFM 111,29," " ; THE {name of Current Object} LANDED ON THE FLOOR BY {short name ; of Current Character} 55968 DEFM "LANDED ON ",111,177," BY " 55984 DEFM 31 55985 DEFM 0 55986 DEFM 5 ; Height = 4 55987 DEFM 111,29," " ; THE {name of Current Object} LANDED ON THE FLOOR BY {short name ; of Current Character} AND SMASHED INTO TINY LITTLE BITS 55990 DEFM "LANDED ON ",111,177," BY " 56006 DEFM 31," ",104,"SMASHED " 56017 DEFM "IN",99,"TINY L",100,"TLE B",100,"S" 56034 DEFM 0 56035 DEFM 9 ; Height = 8 56036 DEFM 105,"THREW ",111,29," " ; YOU THREW THE {name of Current Object} AT {short name of Current ; Character} BUT IT CAME BACK AND KILLED YOU ! 56046 DEFM "AT ",31," " 56051 DEFM 113," ",100," CAME BACK ",104 56066 DEFM 163,105,"!" 56069 DEFM 0 ; Text Relating to "BLOW" Command b56070 DEFM 5 ; Height = 4 56071 DEFM 31," ",118,"'I CAN",120 ; short name of Current Character} SAYS 'I CANNOT COME TO THAT ROOM AT ; THE MOMENT BECAUSE YOU ARE IN MY WAY!' 56081 DEFM "COME ",99,151,178," AT " 56093 DEFM 111,"MOMENT BECAUSE ",105 56110 DEFM 116," IN MY WAY!'" 56123 DEFM 0 56124 DEFM 4 ; Height = 3 56125 DEFM 31," ",118,"'I " ; short name of Current Character} SAYS 'I THINK YOU ARE THE ONE THAT ; SHOULD GO AWAY!' 56131 DEFM "THINK ",105,116," ",111,"ONE " 56145 DEFM 151,"SHOULD GO AWAY!'" 56162 DEFM 0 56163 DEFM 115,0 ; SUMMON 56165 DEFM 8 ; Height = 7 56166 DEFM "I THINK ",105 ; I THINK YOU SHOULD GIVE UP TRYING TO PLAY THE {name of Current Object} ; THAT WAS TERRIBLE ! 56175 DEFM "SHOULD ",237," UP " 56187 DEFM "TRY",123,99,"PLAY " 56197 DEFM 111,29," " 56200 DEFM 151,160,"TERRIBLE !" 56212 DEFM 0 56213 DEFM 3 ; Height = 2 56214 DEFM 30," ",117 ; full name of Current Character} IS ASLEEP 56217 DEFM "ASLEEP" 56223 DEFM 0 56224 DEFM 4 ; Height = 3 56225 DEFM 30,14 ; full name of Current Character} DOES NOT WANT TO BE SUMMONED 56227 DEFM "DOES ",120,155," ",99,"BE " 56239 DEFM "SUMMONED" 56247 DEFM 0 56248 DEFM 4 ; Height = 3 56249 DEFM 30," ",117 ; full name of Current Character} IS TOO TIRED TO BE SUMMONED 56252 DEFM "TOO TIRED ",99,"BE " 56266 DEFM "SUMMONED" 56274 DEFM 0 56275 DEFM 3 ; Height = 2 56276 DEFM 30," ",117 ; full name of Current Character} IS ALREADY HERE! 56279 DEFM 188," ",169,"!" 56283 DEFM 0 56284 DEFM 3 ; Height = 2 56285 DEFM 31," DOES " ; short name of Current Character} DOES NOT WANT TO COME HERE! 56292 DEFM 120,155," ",99 56296 DEFM "COME ",169,"!" 56303 DEFM 0 56304 DEFM 5 ; Height = 4 56305 DEFM "WHAT ",97,"LOT ",122 ; WHAT A LOT OF DUST. DOESN'T ANYBODY CLEAN THIS PLACE ? 56316 DEFM "DUST. DOESN'T " 56330 DEFM "ANY",157,"CLE",98 56338 DEFM 139,"PLACE ?" 56346 DEFM 0 56347 DEFM 4 ; Height = 3 56348 DEFM 30," " ; full name of Current Character} APPEARS IN A THICK PUFF OF SMOKE 56350 DEFM "APPEARS IN ",97,"THICK " 56368 DEFM "PUFF ",122,"SMOKE" 56379 DEFM 0 ; Text Relating to "WEAR/UNWEAR OBJECT" Command b56380 DEFM 14 ; name of Current Command} UN{name of Current Command 56381 DEFM 93,25,14 56384 DEFM 93,"UN",25 56388 DEFM 0 56389 DEFM "UN",25," ",111,0 ; UN{name of Current Command} THE 56395 DEFM "UN",25," ",112,103,"?",14,0 ; UN{name of Current Command} WHICH OBJECT ? 56404 DEFM 3 ; Height = 2 56405 DEFM 105,116," ",25,123 ; YOU ARE {name of Current Command}ING TOO MUCH 56410 DEFM "TOO MUCH" 56418 DEFM 0 56419 DEFM 3 ; Height = 2 56420 DEFM 105,"CAN",120,25," " ; YOU CANNOT {name of Current Command} THAT 56427 DEFM 151 56428 DEFM 0 56429 DEFM 10 ; Height = 9 56430 DEFM 112,124," DO " ; WHICH DISQUISE DO YOU WANT TO {name of Current Command}? FOOTMAN GUARD ; WIZARD CHAMBERMAID WHITE WITCH WARRIOR 56436 DEFM 105,155," ",99,25,"?",14,14 56444 DEFM 93,130,14 56447 DEFM 93,131,14 56450 DEFM 93,132,14 56453 DEFM 93,133,14 56456 DEFM 93,134,14 56459 DEFM 93,135 56461 DEFM 0 ; Text Relating to "TELEPORT" Command b56462 DEFM 5 ; Height = 4 56463 DEFM 100," ",160,120,"SAFE " ; IT WAS NOT SAFE TO TELEPORT SO YOU HAVE WOUND UP IN LIMBO 56472 DEFM 99,241," SO " 56478 DEFM 105,"HAVE WOUND UP " 56493 DEFM "IN LIMBO" 56501 DEFM 0 ; Text Relating to "TICKLE" Command b56502 DEFM 247," ",0 ; TICKLE 56505 DEFM 6 ; Height = 5 56506 DEFM 31," GIGGLES " ; short name of Current Character} GIGGLES AND BURSTS INTO LAUGHTER. WHAT A NICE ; WAY TO CHEER SOMEBODY UP! 56516 DEFM 104,"BURSTS IN",99 56527 DEFM "LAUGHTER. WHAT ",97 56543 DEFM "NICE WAY ",99,"CHEER " 56559 DEFM 146,157,"UP!" 56564 DEFM 0 ; Object names ; ; Zero-terminated strings b56565 DEFM 140," AT ",141,0 ; NOTHING AT ALL 56572 DEFM 124,0 ; DISQUISE 56574 DEFM 138," B",141,0 ; CRYSTAL BALL 56579 DEFM "W",104,122,239,0 ; WAND OF COMMAND 56584 DEFM 159,0 ; TEDDY BEAR 56586 DEFM "STICK ",122,"DYNAM",100,"E",0 ; STICK OF DYNAMITE 56601 DEFM 194," TALISMAN",0 ; MAGIC TALISMAN 56612 DEFM 126,0 ; BROKEN GLASS 56614 DEFM 126,0 ; BROKEN GLASS 56616 DEFM 126,0 ; BROKEN GLASS 56618 DEFM "HORSE FEATHER",0 ; HORSE FEATHER 56632 DEFM "POWER BOOTS",0 ; POWER BOOTS 56644 DEFM "GLOW SHIELD",0 ; GLOW SHIELD 56656 DEFM "CHICKEN",0 ; CHICKEN 56664 DEFM "BOOMERANG",0 ; BOOMERANG 56674 DEFM "SWORD",0 ; SWORD 56680 DEFM "BRASS ANKH",0 ; BRASS ANKH 56691 DEFM 150,0 ; BOTTLE OF LIQUID 56693 DEFM 150,0 ; BOTTLE OF LIQUID 56695 DEFM "TORCH",0 ; TORCH 56701 DEFM "MIRROR",0 ; MIRROR 56708 DEFM "GAD",234," X",0 ; GADGET X 56715 DEFM "ELF-HORN",0 ; ELF-HORN 56724 DEFM 136," ARROW",0 ; SILVER ARROW 56732 DEFM 95," ",145,0 ; INSTRUCTION BOOK 56736 DEFM 194," MISSILE",0 ; MAGIC MISSILE 56746 DEFM "ADVERT",0 ; ADVERT 56753 DEFM "SCROLL",0 ; SCROLL 56760 DEFM "EMPTY ",149,0 ; EMPTY BOTTLE 56768 DEFM "EMPTY ",149,0 ; EMPTY BOTTLE 56776 DEFM "SHIELD",0 ; SHIELD 56783 DEFM 241," ",109,0 ; TELEPORT KEY 56787 DEFM 241," PAD",0 ; TELEPORT PAD 56793 DEFM "NEWSPAPER",0 ; NEWSPAPER 56803 DEFM "LIST ",122,"CLUES",0 ; LIST OF CLUES 56815 DEFM "BOW",0 ; BOW 56819 DEFM 127,114,0 ; GOLDEN EGG 56822 DEFM 136," ",114,0 ; SILVER EGG 56826 DEFM 137," ",114,0 ; COPPER EGG 56830 DEFM 127,114,0 ; GOLDEN EGG 56833 DEFM 136," ",114,0 ; SILVER EGG 56837 DEFM 137," ",114,0 ; COPPER EGG 56841 DEFM "X",0 ; Unused (see trivia) ; Room names ; ; Strings are zero-terminated. For rooms without a name, the entry is a single zero byte. For rooms with names, the ; first byte of the entry is data, and the text string itself starts at the second byte. The data structure is: b56843 DEFM 5,"LIMBO",0 ; LIMBO 56850 DEFM 16,158,"S HOARD",0 ; BEARWOOLFS HOARD (bug) 56860 DEFM 15,171,0 ; BEARWOOLFS CAVE 56863 DEFM 16,"BEW",116," ",158,0 ; BEWARE BEARWOOLF 56871 DEFM 17,111,185,172,0 ; THE SPOOKY FOREST 56876 DEFM 0 ; Unused 56877 DEFM 17,111,185,172,0 ; THE SPOOKY FOREST 56882 DEFM 25,111,"SWORD IN ",111,"CONCRETE",0 ; THE SWORD IN THE CONCRETE 56903 DEFM 18,"ROBIN'S L",100,"TLE HUT",0 ; ROBIN'S LITTLE HUT 56922 DEFM 15,"EX",100," ",102,"LIMBO",0 ; EXIT FROM LIMBO 56934 DEFM 18,"MORE ",185,172,0 ; MORE SPOOKY FOREST 56943 DEFM 7,"ENTWOOD",0 ; ENTWOOD 56952 DEFM 17,111,185,172,0 ; THE SPOOKY FOREST 56957 DEFM 17,111,185,172,0 ; THE SPOOKY FOREST 56962 DEFM 12,250,123,"WELL",0 ; WISHING WELL 56970 DEFM 0 ; Unused 56971 DEFM 19,111,244,"LE ENTRANCE",0 ; THE CASTLE ENTRANCE 56986 DEFM 12,"ONE AXE ",178,0 ; ONE AXE ROOM 56997 DEFM 20,"INDOOR BOWLING GREEN",0 ; INDOOR BOWLING GREEN 57019 DEFM 0 ; Unused 57020 DEFM 0 ; Unused 57021 DEFM 17,"MORE AXE PROBLEMS",0 ; MORE AXE PROBLEMS 57040 DEFM 14,"EVEN MORE AXES",0 ; EVEN MORE AXES 57056 DEFM 20,111,"FIRST JUMP CHUTE",0 ; THE FIRST JUMP CHUTE 57075 DEFM 12,174,107," 7",0 ; MAIN LEVER 7 57081 DEFM 12,174,107," 6",0 ; MAIN LEVER 6 57087 DEFM 28,"SECUR",100,"Y DOOR & ",174,107," 5",0 ; SECURITY DOOR & MAIN LEVER 5 57108 DEFM 12,174,107," 4",0 ; MAIN LEVER 4 57114 DEFM 12,174,107," 3",0 ; MAIN LEVER 3 57120 DEFM 12,174,107," 2",0 ; MAIN LEVER 2 57126 DEFM 12,174,107," 1",0 ; MAIN LEVER 1 57132 DEFM 19,111,"BROKEN ",241,0 ; THE BROKEN TELEPORT 57143 DEFM 14,"TERRIBLE TWINS",0 ; TERRIBLE TWINS 57159 DEFM 20,111,"GUARDIAN STATUES",0 ; THE GUARDIAN STATUES 57178 DEFM 16,168,0 ; ONE WAY CORRIDOR 57181 DEFM 16,168,0 ; ONE WAY CORRIDOR 57184 DEFM 16,168,0 ; ONE WAY CORRIDOR 57187 DEFM 0 ; Unused 57188 DEFM 16,"BIG WH",100,"E STATUE",0 ; BIG WHITE STATUE 57205 DEFM 0 ; Unused 57206 DEFM 13,241," ",178,0 ; TELEPORT ROOM 57211 DEFM 16,168,0 ; ONE WAY CORRIDOR 57214 DEFM 16,168,0 ; ONE WAY CORRIDOR 57217 DEFM 16,168,0 ; ONE WAY CORRIDOR 57220 DEFM 0 ; Unused 57221 DEFM 16,111,"CONTROL ",178,0 ; THE CONTROL ROOM 57233 DEFM 18,"M",108,"SCREENED ",178,0 ; MANY SCREENED ROOM 57247 DEFM 13,241," ",178,0 ; TELEPORT ROOM 57252 DEFM 0 ; Unused 57253 DEFM 15,111,"POWER PLANT",0 ; THE POWER PLANT 57267 DEFM 0 ; Unused 57268 DEFM 0 ; Unused ; Miscellaneous Text 5 b57269 DEFM 146,157,"SW",100,"CHED OUT " ; SOMEBODY SWITCHED OUT THE LIGHT. YOU FALL AND INJURE YOURSELF ; FATALLY ON YOUR ARMOUR WHY NOT CARRY A TORCH OR SOMETHING SIMILAR ; NEXT TIME ? HARD LUCK MAGIC KNIGHT 57283 DEFM 111,"LIGHT. ",105,"F",141," " 57295 DEFM 104,"INJURE ",121 57304 DEFM "FAT",141,"Y ON ",119,"ARMOUR",14,14 57322 DEFM "WHY ",120,"CARRY ",97,"TORCH " 57340 DEFM "OR ",125,"SIMILAR " 57352 DEFM "NEXT ",193," ?",14,14 57362 DEFM "HARD LUCK ",233 57373 DEFM 0 57374 DEFM 10 ; Height = 9 57375 DEFM 105,"STOOD FAR TOO " ; YOU STOOD FAR TOO CLOSE TO BEARWOOLF AND IT LASHED OUT AT YOU ; WITH ITS ENORMOUS GREEN ARM 57390 DEFM "CLOSE ",99,158," ",104 57400 DEFM 100," LASHED OUT AT ",105 57417 DEFM "W",100,"H ",100,"S E",148,"RMOUS " 57432 DEFM "GREEN ARM" 57441 DEFM 0 57442 DEFM 6 ; Height = 5 57443 DEFM 146,157,"YELLS ",34,"T",97 ; SOMEBODY YELLS "TA FOR THE EGG MATE. YOU CAN HAVE A WISH IF YOU ; WANT!" IN A DEEP VOICE 57454 DEFM "FOR ",111,114," MATE. " 57467 DEFM 105,"C",98,"HAVE ",97 57476 DEFM 250," IF ",105,155,"!",34," " 57486 DEFM "IN ",97,"DEEP VOICE" 57500 DEFM 0 57501 DEFM 5 ; Height = 4 57502 DEFM 105,"C",98,249," " ; YOU CAN SMELL NOTHING BECAUSE YOUR NOSE IS BLOCKED! 57507 DEFM 140," BECAUSE " 57517 DEFM 119,"NOSE ",117 57524 DEFM "BLOCKED!" 57532 DEFM 0 57533 DEFM 3 ; Height = 2 57534 DEFM 119,25," " ; YOUR {name of Current Command} HAS BEEN GRANTED! 57537 DEFM 152,"BEEN GRANTED!" 57551 DEFM 0 57552 DEFM 10 ; Height = 9 57553 DEFM 111,107," " ; THE LEVER SPRUNG BACK INTO POSITION. NOTHING SEEMS TO HAVE ; HAPPENED BUT THAT DOES NOT MAKE MUCH SENSE DOES IT? 57556 DEFM "SPRUNG BACK " 57568 DEFM "IN",99,"POS",100,"ION. " 57580 DEFM 140," SEEMS " 57588 DEFM 99,"HAVE " 57594 DEFM "HAPPENED ",113," " 57605 DEFM 151,"DOES ",120 57612 DEFM "MAKE MUCH SENSE " 57628 DEFM "DOES ",100,"?" 57635 DEFM 0 57636 DEFM 7 ; Height = 6 57637 DEFM "MMMMM.. TASTY. " ; MMMMM.. TASTY. YOU CAN FEEL NEW STRENGTH AND VITALITY SURGING ; THROUGH YOUR VEINS 57652 DEFM 105,"C",98,"FEEL " 57660 DEFM "NEW ",144 57665 DEFM 104,"V",100,"AL",100,"Y " 57673 DEFM "SURG",123,"THROUGH " 57686 DEFM 119,"VEINS" 57692 DEFM 0 ; 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. b57693 DEFM 14,14,0 ; carriage return / line feed}{carriage return / line feed 57696 DEFM 16,6,0 ; change INK colour to yellow 57699 DEFM 9,9,0 ; move text cursor right by two characters 57702 DEFM 14,16,7,0 ; carriage return / line feed}{change INK colour to white 57706 DEFM "INSTRUCTION",0 ; INSTRUCTION 57718 DEFM " = ",0 ; = 57722 DEFM "A ",0 ; A 57725 DEFM "AN ",0 ; AN 57729 DEFM "TO ",0 ; TO 57733 DEFM "IT",0 ; IT 57736 DEFM "CHARACTER",0 ; CHARACTER 57746 DEFM "FROM ",0 ; FROM 57752 DEFM "OBJECT ",0 ; OBJECT 57760 DEFM "AND ",0 ; AND 57765 DEFM "YOU ",0 ; YOU 57770 DEFM "GAME ",0 ; GAME 57776 DEFM "LEVER",0 ; LEVER 57782 DEFM "ANY ",0 ; ANY 57787 DEFM "KEY",0 ; KEY 57791 DEFM " ",0 57795 DEFM "THE ",0 ; THE 57800 DEFM "WHICH ",0 ; WHICH 57807 DEFM "BUT",0 ; BUT 57811 DEFM "EGG",0 ; EGG 57815 DEFM "SUMMON ",0 ; SUMMON 57823 DEFM "ARE",0 ; ARE 57827 DEFM "IS ",0 ; IS 57831 DEFM "SAYS ",0 ; SAYS 57837 DEFM "YOUR ",0 ; YOUR 57843 DEFM "NOT ",0 ; NOT 57848 DEFM "YOURSELF ",0 ; YOURSELF 57858 DEFM "OF ",0 ; OF 57862 DEFM "ING ",0 ; ING 57867 DEFM "DISQUISE",0 ; DISQUISE (bug) 57876 DEFM "SOMETHING ",0 ; SOMETHING 57887 DEFM "BROKEN GLASS",0 ; BROKEN GLASS 57900 DEFM "GOLDEN ",0 ; GOLDEN 57908 DEFM "HELP ",0 ; HELP 57914 DEFM "DAVID JONES",0 ; DAVID JONES 57926 DEFM "FOOTMAN ",0 ; FOOTMAN 57935 DEFM "GUARD ",0 ; GUARD 57942 DEFM "WIZARD ",0 ; WIZARD 57950 DEFM "CHAMBERMAID ",0 ; CHAMBERMAID 57963 DEFM "WHITE WITCH ",0 ; WHITE WITCH 57976 DEFM "WARRIOR ",0 ; WARRIOR 57985 DEFM "SILVER",0 ; SILVER 57992 DEFM "COPPER",0 ; COPPER 57999 DEFM "CRYSTAL",0 ; CRYSTAL 58007 DEFM "THIS ",0 ; THIS 58013 DEFM "NOTHING",0 ; NOTHING 58021 DEFM "ALL",0 ; ALL 58025 DEFM "THERE ",0 ; THERE 58032 DEFM "THEIR",0 ; THEIR 58038 DEFM "STRENGTH ",0 ; STRENGTH 58048 DEFM "BOOK",0 ; BOOK 58053 DEFM "SOME",0 ; SOME 58058 DEFM "YES",0 ; YES 58062 DEFM "NO",0 ; NO 58065 DEFM "BOTTLE",0 ; BOTTLE 58072 DEFM "BOTTLE OF LIQUID",0 ; BOTTLE OF LIQUID (see trivia) 58089 DEFM "THAT ",0 ; THAT 58095 DEFM "HAS ",0 ; HAS 58100 DEFM "BREAK ",0 ; BREAK 58107 DEFM "WILL ",0 ; WILL 58113 DEFM "WANT",0 ; WANT 58118 DEFM "TRAVEL",0 ; TRAVEL 58125 DEFM "BODY ",0 ; BODY 58131 DEFM "BEARWOOLF",0 ; BEARWOOLF 58141 DEFM "TEDDY BEAR",0 ; TEDDY BEAR 58152 DEFM "WAS ",0 ; WAS 58157 DEFM "REQUIRE",0 ; REQUIRE 58165 DEFM "PRESS",0 ; PRESS 58171 DEFM "KILLED ",0 ; KILLED 58179 DEFM "ATTRIBUTE",0 ; ATTRIBUTE 58189 DEFM "STORMBRINGER",0 ; STORMBRINGER 58202 DEFM "COPYRIGHT ",0 ; COPYRIGHT 58213 DEFM " IS TOO TIRED TO",0 ; IS TOO TIRED TO 58230 DEFM "ONE WAY CORRIDOR",0 ; ONE WAY CORRIDOR 58247 DEFM "HERE",0 ; HERE 58252 DEFM "YET",0 ; YET 58256 DEFM "BEARWOOLFS CAVE",0 ; BEARWOOLFS CAVE (bug) 58272 DEFM "FOREST",0 ; FOREST 58279 DEFM "QUITICUS GAMUS",0 ; QUITICUS GAMUS 58294 DEFM "MAIN ",0 ; MAIN 58300 DEFM "SPELL",0 ; SPELL 58306 DEFM 175," OF WONDER",0 ; SPELL OF WONDER 58318 DEFM "FLOOR",0 ; FLOOR 58324 DEFM "ROOM",0 ; ROOM 58329 DEFM "DIMENSION MERGE",0 ; DIMENSION MERGE 58345 DEFM "MELT GRANITE",0 ; MELT GRANITE 58358 DEFM "PASS PLANT",0 ; PASS PLANT 58369 DEFM "TRAVEL ",99,"PERSON",0 ; TRAVEL TO PERSON 58384 DEFM "MAGIC FULCRUM",0 ; MAGIC FULCRUM (see trivia) 58398 DEFM "HAPPY",0 ; HAPPY 58404 DEFM "SPOOKY ",0 ; SPOOKY 58412 DEFM "PLAYER ",0 ; PLAYER 58420 DEFM "CANDLE",0 ; CANDLE 58427 DEFM "ALREADY",0 ; ALREADY 58435 DEFM "REDEFINE ",0 ; REDEFINE 58445 DEFM "MASTERTRONIC ",0 ; MASTERTRONIC ; 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. b58459 DEFM "*191*",0 ; *191* (see trivia) 58465 DEFM "*192*",0 ; *192* (see trivia) 58471 DEFM "TIME",0 ; TIME 58476 DEFM "MAGIC",0 ; MAGIC 58482 DEFM "CONTROL : ",0 ; CONTROL : 58493 DEFM "KEYBOARD",0 ; KEYBOARD 58502 DEFM "KEMPSTON ",200,0 ; KEMPSTON JOYSTICK 58513 DEFM "CURSOR ",200,0 ; CURSOR JOYSTICK 58522 DEFM "SINCLAIR ",200,"1",0 ; SINCLAIR JOYSTICK 1 58534 DEFM "JOYSTICK ",0 ; JOYSTICK 58544 DEFM "OFF-WHITE",0 ; OFF-WHITE 58554 DEFM "ARAMIS",0 ; ARAMIS 58561 DEFM "ROBIN",0 ; ROBIN 58567 DEFM "REGGIE",0 ; REGGIE 58574 DEFM "RACHEL",0 ; RACHEL 58581 DEFM "BARKER",0 ; BARKER 58588 DEFM "ORGANON",0 ; ORGANON 58596 DEFM "GRUNTER",0 ; GRUNTER 58604 DEFM 0 ; Unused 58605 DEFM 0 ; Unused 58606 DEFM 0 ; Unused 58607 DEFM 0 ; Unused 58608 DEFM 0 ; Unused 58609 DEFM 0 ; Unused 58610 DEFM 0 ; Unused 58611 DEFM 0 ; Unused 58612 DEFM 201," KNIGHT",0 ; OFF-WHITE KNIGHT 58621 DEFM 202," LE PEUX",0 ; ARAMIS LE PEUX 58631 DEFM 203," OF SHYLOCK",0 ; ROBIN OF SHYLOCK 58644 DEFM 204," ",111,"RAT",0 ; REGGIE THE RAT 58651 DEFM 205," OF AMAZONIA",0 ; RACHEL OF AMAZONIA 58665 DEFM 206," ",111,"ENT",0 ; BARKER THE ENT 58672 DEFM 207," ",111,"GUARD",0 ; ORGANON THE GUARD 58681 DEFM 208," ",111,"BEARWOOLF",0 ; GRUNTER THE BEARWOOLF 58694 DEFM 0 ; Unused 58695 DEFM 0 ; Unused 58696 DEFM 0 ; Unused 58697 DEFM 0 ; Unused 58698 DEFM 0 ; Unused 58699 DEFM 0 ; Unused 58700 DEFM 0 ; Unused 58701 DEFM 0 ; Unused 58702 DEFM "MAGIC KNIGHT",0 ; MAGIC KNIGHT (see trivia) 58715 DEFM "GET",0 ; GET 58719 DEFM "DROP",0 ; DROP 58724 DEFM "TAKE",0 ; TAKE 58729 DEFM "GIVE",0 ; GIVE 58734 DEFM "EXAMINE",0 ; EXAMINE 58742 DEFM "COMMAND",0 ; COMMAND 58750 DEFM "LOCATE",0 ; LOCATE 58757 DEFM "TELEPORT",0 ; TELEPORT 58766 DEFM "READ",0 ; READ 58771 DEFM "THROW",0 ; THROW 58777 DEFM "CAST",0 ; CAST 58782 DEFM "BLOW",0 ; BLOW 58787 DEFM "WEAR",0 ; WEAR 58792 DEFM "TICKLE",0 ; TICKLE 58799 DEFM "PULL",0 ; PULL 58804 DEFM "SMELL",0 ; SMELL 58810 DEFM "WISH",0 ; WISH 58815 DEFM "DRINK",0 ; DRINK 58821 DEFM "*FC*",0 ; *FC* (see trivia) 58826 DEFM "1987",0 ; 1987 58831 DEFM "*FE*",0 ; *FE* (see trivia) 58836 DEFM "*FF*",0 ; *FF* (see trivia) ; Room Layout Data Pointers b58841 DEFW 58945 ; (00) - Limbo 58843 DEFW 58949 ; (01) - Outdoors, 0 (Bearwoolf's Hoard) 58845 DEFW 58979 ; (02) - Outdoors, 1 (Bearwoolf's Cave) 58847 DEFW 59006 ; (03) - Outdoors, 2 (Beware Bearwoolf) 58849 DEFW 59028 ; (04) - Outdoors, 3 (The Spooky Forest, 1) 58851 DEFW 59052 ; (05) - Outdoors, 4 58853 DEFW 59091 ; (06) - Outdoors, 5 (The Spooky Forest, 2) 58855 DEFW 59125 ; (07) - Outdoors, 6 (The Sword in the Concrete) 58857 DEFW 59148 ; (08) - Outdoors, 7 (Robin's Little Hut) 58859 DEFW 59198 ; (09) - Outdoors, 8 (Exit from Limbo) 58861 DEFW 59233 ; (10) - Outdoors, 9 (More Spooky Forest) 58863 DEFW 59274 ; (11) - Outdoors, 10 (Entwood) 58865 DEFW 59320 ; (12) - Outdoors, 11 (The Spooky Forest, 3) 58867 DEFW 59366 ; (13) - Outdoors, 12 (The Spooky Forest, 4) 58869 DEFW 59412 ; (14) - Outdoors, 13 (Wishing Well) 58871 DEFW 59446 ; (15) - Outdoors, 14 58873 DEFW 59492 ; (16) - Outdoors, 15 (The Castle Entrance) 58875 DEFW 59566 ; (17) - Castle Ground Floor, 0 (One Axe Room) 58877 DEFW 59627 ; (18) - Castle Ground Floor, 1 (Indoor Bowling Green) 58879 DEFW 59644 ; (19) - Castle Ground Floor, 2 58881 DEFW 59690 ; (20) - Castle Ground Floor, 3 58883 DEFW 59696 ; (21) - Castle Ground Floor, 4 (More Axe Problems) 58885 DEFW 59731 ; (22) - Castle Ground Floor, 5 (Even More Axes) 58887 DEFW 59759 ; (23) - Castle Ground Floor, 6 (The First Jump Chute) 58889 DEFW 59772 ; (24) - Castle First Floor, 0 (Main Lever 7) 58891 DEFW 59798 ; (25) - Castle First Floor, 1 (Main Lever 6) 58893 DEFW 59841 ; (26) - Castle First Floor, 2 (Security Door & Main Lever 5) 58895 DEFW 59874 ; (27) - Castle First Floor, 3 (Main Lever 4) 58897 DEFW 59936 ; (28) - Castle First Floor, 4 (Main Lever 3) 58899 DEFW 59979 ; (29) - Castle First Floor, 5 (Main Lever 2) 58901 DEFW 59987 ; (30) - Castle First Floor, 6 (Main Lever 1) 58903 DEFW 60003 ; (31) - Castle Second Floor, 0 (The Broken Teleport) 58905 DEFW 60010 ; (32) - Castle Second Floor, 1 (Terrible Twins) 58907 DEFW 60026 ; (33) - Castle Second Floor, 2 (The Guardian Statues) 58909 DEFW 60069 ; (34) - Castle Second Floor, 3 (One Way Corridor, 1) 58911 DEFW 60070 ; (35) - Castle Second Floor, 4 (One Way Corridor, 2) 58913 DEFW 60070 ; (36) - Castle Second Floor, 5 (One Way Corridor, 3) 58915 DEFW 60078 ; (37) - Castle Second Floor, 6 58917 DEFW 60106 ; (38) - Castle Third Floor, 0 (Big White Statue) 58919 DEFW 60133 ; (39) - Castle Third Floor, 1 58921 DEFW 60139 ; (40) - Castle Third Floor, 2 (Teleport Room, 1) 58923 DEFW 60147 ; (41) - Castle Third Floor, 3 (One Way Corridor, 4) 58925 DEFW 60147 ; (42) - Castle Third Floor, 4 (One Way Corridor, 5) 58927 DEFW 60147 ; (43) - Castle Third Floor, 5 (One Way Corridor, 6) 58929 DEFW 60078 ; (44) - Castle Third Floor, 6 58931 DEFW 60155 ; (45) - Spaceship, 0 (The Control Room) 58933 DEFW 60184 ; (46) - Spaceship, 1 (Many Screened Room) 58935 DEFW 60296 ; (47) - Spaceship, 2 (Teleport Room, 2) 58937 DEFW 60313 ; (48) - Spaceship, 3 58939 DEFW 60370 ; (49) - Spaceship, 4 (The Power Plant) 58941 DEFW 60407 ; (50) - Spaceship, 5 58943 DEFW 60464 ; (51) - Spaceship, 6 ; Room Layout Data (00) - Limbo b58945 DEFB 0,55,71 ; Draw floor with floor character set UDG 55 and attribute 71 (white INK, black PAPER, BRIGHT) 58948 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (01) - Outdoors, 0 (Bearwoolf's Hoard) b58949 DEFB 133 ; Draw layout data fragment 5 (Left Wall) 58950 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 58953 DEFB 144,1 ; Draw 16 blocks of style 1 58955 DEFB 255 ; End Marker 58956 DEFB 127,2,17 ; Start horizontal block drawing at (2, 17) 58959 DEFB 1,1,0,1,0,1,1,0,1,1,0,1,0,1,1 ; Draw pattern of blocks 58974 DEFB 255 ; End Marker 58975 DEFB 0,55,71 ; Draw floor with floor character set UDG 55 and attribute 71 (white INK, ; black PAPER, BRIGHT) 58978 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (02) - Outdoors, 1 (Bearwoolf's Cave) b58979 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 58982 DEFB 144,1 ; Draw 16 blocks of style 1 58984 DEFB 255 ; End Marker 58985 DEFB 127,0,17 ; Start horizontal block drawing at (0, 17) 58988 DEFB 131,1,0,131,1,0,1,0,1,1,0,131,1 ; Draw pattern of blocks 59001 DEFB 255 ; End Marker 59002 DEFB 0,55,71 ; Draw floor with floor character set UDG 55 and attribute 71 (white ; INK, black PAPER, BRIGHT) 59005 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (03) - Outdoors, 2 (Beware Bearwoolf) b59006 DEFB 36,28,0,7,11,0 ; Draw Grunter (36) with attribute data index of 28, terrain interaction data index of 0 ; at (7, 11) 59012 DEFB 51,5,0,26,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (26, 6) 59018 DEFB 55,23,0,0,19,1 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (0, 19), and apply vertical mirror (1) 59024 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59027 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (04) - Outdoors, 3 (The Spooky Forest, 1) b59028 DEFB 51,5,0,24,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (24, 6) 59034 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59035 DEFB 45,20,0,4,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (4, 20) 59041 DEFB 55,23,0,22,19,0 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (22, 19) 59047 DEFB 130 ; Draw layout data fragment 2 (Plant) 59048 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59051 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (05) - Outdoors, 4 b59052 DEFB 51,5,0,22,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (22, 6) 59058 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59059 DEFB 45,20,0,4,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (4, 20) 59065 DEFB 127,15,20 ; Start horizontal block drawing at (15, 20) 59068 DEFB 131,4 ; Draw 3 blocks of style 4 59070 DEFB 255 ; End Marker 59071 DEFB 127,13,21 ; Start horizontal block drawing at (13, 21) 59074 DEFB 4,131,20,4 ; Draw pattern of blocks 59078 DEFB 255 ; End Marker 59079 DEFB 127,11,22 ; Start horizontal block drawing at (11, 22) 59082 DEFB 4,133,20,4 ; Draw pattern of blocks 59086 DEFB 255 ; End Marker 59087 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59090 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (06) - Outdoors, 5 (The Spooky Forest, 2) b59091 DEFB 51,5,0,20,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (20, 6) 59097 DEFB 39,25,0,18,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (18, 14) 59103 DEFB 45,20,0,18,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (18, 20) 59109 DEFB 55,23,0,9,19,0 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (9, 19) 59115 DEFB 42,9,2,2,16,0 ; Draw axe in tree stump (42) with attribute data index of 9, terrain interaction data ; index of 2 at (2, 16) 59121 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59124 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (07) - Outdoors, 6 (The Sword in the Concrete) b59125 DEFB 51,5,0,18,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (18, 6) 59131 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59132 DEFB 44,19,0,5,20,0 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (5, 20) 59138 DEFB 68,31,0,12,18,0 ; Draw Sword in Concrete (68) with attribute data index of 31, terrain interaction data ; index of 0 at (12, 18) 59144 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59147 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (08) - Outdoors, 7 (Robin's Little Hut) b59148 DEFB 51,5,0,16,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (16, 6) 59154 DEFB 58,10,0,11,14,0 ; Draw hut roof (58) with attribute data index of 10, terrain interaction data index of ; 0 at (11, 14) 59160 DEFB 39,25,0,23,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (23, 14) 59166 DEFB 45,20,0,23,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (23, 20) 59172 DEFB 127,12,17 ; Start horizontal block drawing at (12, 17) 59175 DEFB 132,29 ; Draw 4 blocks of style 29 59177 DEFB 255 ; End Marker (block drawing) 59178 DEFB 127,12,19 ; Start horizontal block drawing at (12, 19) 59181 DEFB 29,20,29,29 ; Draw pattern of blocks 59185 DEFB 255 ; End Marker (block drawing) 59186 DEFB 127,12,21 ; Start horizontal block drawing at (12, 21) 59189 DEFB 29,20,29,29 ; Draw pattern of blocks 59193 DEFB 255 ; End Marker (block drawing) 59194 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59197 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (09) - Outdoors, 8 (Exit from Limbo) b59198 DEFB 51,5,0,14,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (14, 6) 59204 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59205 DEFB 45,20,0,4,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (4, 20) 59211 DEFB 39,25,0,14,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (14, 14) 59217 DEFB 45,20,0,14,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (14, 20) 59223 DEFB 55,23,0,23,19,0 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (23, 19) 59229 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59232 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (10) - Outdoors, 9 (More Spooky Forest) b59233 DEFB 51,5,0,12,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (12, 6) 59239 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59240 DEFB 44,19,0,5,20,0 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (5, 20) 59246 DEFB 39,25,0,14,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (14, 14) 59252 DEFB 45,20,0,14,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (14, 20) 59258 DEFB 40,26,0,23,10,0 ; Draw top of tree, bare (40) with attribute data index of 26, terrain interaction data ; index of 0 at (23, 10) 59264 DEFB 47,22,0,24,20,0 ; Draw tree trunk 3 (47) with attribute data index of 22, terrain interaction data index ; of 0 at (24, 20) 59270 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59273 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (11) - Outdoors, 10 (Entwood) b59274 DEFB 51,5,0,10,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (10, 6) 59280 DEFB 38,24,0,0,13,1 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (0, 13), and apply vertical mirror (1) 59286 DEFB 39,25,0,12,14,1 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (12, 14), and apply vertical mirror (1) 59292 DEFB 40,26,0,24,10,1 ; Draw top of tree, bare (40) with attribute data index of 26, terrain interaction data ; index of 0 at (24, 10), and apply vertical mirror (1) 59298 DEFB 44,19,0,5,20,1 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (5, 20), and apply vertical mirror (1) 59304 DEFB 45,20,0,14,20,1 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (14, 20), and apply vertical mirror (1) 59310 DEFB 47,22,0,24,20,1 ; Draw tree trunk 3 (47) with attribute data index of 22, terrain interaction data index ; of 0 at (24, 20), and apply vertical mirror (1) 59316 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59319 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (12) - Outdoors, 11 (The Spooky Forest, 3) b59320 DEFB 51,5,0,8,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (8, 6) 59326 DEFB 39,25,0,2,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (2, 14) 59332 DEFB 38,24,0,12,13,0 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (12, 13) 59338 DEFB 40,26,0,23,10,0 ; Draw top of tree, bare (40) with attribute data index of 26, terrain interaction data ; index of 0 at (23, 10) 59344 DEFB 44,19,0,3,20,0 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (3, 20) 59350 DEFB 45,20,0,14,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (14, 20) 59356 DEFB 47,22,0,24,20,0 ; Draw tree trunk 3 (47) with attribute data index of 22, terrain interaction data index ; of 0 at (24, 20) 59362 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59365 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (13) - Outdoors, 12 (The Spooky Forest, 4) b59366 DEFB 51,5,0,6,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (6, 6) 59372 DEFB 38,24,0,19,13,0 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (19, 13) 59378 DEFB 39,25,0,1,14,0 ; Draw top of tree without face (39) with attribute data index of 25, terrain ; interaction data index of 0 at (1, 14) 59384 DEFB 40,26,0,12,10,0 ; Draw top of tree, bare (40) with attribute data index of 26, terrain interaction data ; index of 0 at (12, 10) 59390 DEFB 44,19,0,22,20,0 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (22, 20) 59396 DEFB 45,20,0,1,20,0 ; Draw tree trunk 2 (45) with attribute data index of 20, terrain interaction data index ; of 0 at (1, 20) 59402 DEFB 47,22,0,13,20,0 ; Draw tree trunk 3 (47) with attribute data index of 22, terrain interaction data index ; of 0 at (13, 20) 59408 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59411 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (14) - Outdoors, 13 (Wishing Well) b59412 DEFB 51,5,0,4,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (4, 6) 59418 DEFB 58,10,0,11,11,0 ; Draw top of well (58) with attribute data index of 10, terrain interaction data index ; of 0 at (11, 11) 59424 DEFB 59,11,4,11,14,0 ; Draw well (59) with attribute data index of 11, terrain interaction data index of 4 at ; (11, 14) 59430 DEFB 55,23,0,1,19,0 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (1, 19) 59436 DEFB 55,23,0,21,19,0 ; Draw flowers (55) with attribute data index of 23, terrain interaction data index of 0 ; at (21, 19) 59442 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59445 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (15) - Outdoors, 14 b59446 DEFB 51,5,0,2,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 at ; (2, 6) 59452 DEFB 38,24,0,1,13,1 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (1, 13), and apply vertical mirror (1) 59458 DEFB 38,24,0,13,13,0 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (13,13) 59464 DEFB 40,26,0,25,10,0 ; Draw top of tree, bare (40) with attribute data index of 26, terrain interaction data ; index of 0 at (25, 10) 59470 DEFB 44,19,0,6,20,1 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (6, 20), and apply vertical mirror (1) 59476 DEFB 44,19,0,17,20,1 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data index ; of 0 at (17, 20), and apply vertical mirror (1) 59482 DEFB 47,22,0,26,20,0 ; Draw tree trunk 3 (47) with attribute data index of 22, terrain interaction data index ; of 0 at (26, 20) 59488 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59491 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (16) - Outdoors, 15 (The Castle Entrance) b59492 DEFB 51,5,0,0,6,0 ; Draw Moon (51) with attribute data index of 5, terrain interaction data index of 0 ; at (0, 6) 59498 DEFB 56,7,0,18,19,0 ; Draw Organon (56) with attribute data index of 7, terrain interaction data index of ; 0 at (18, 19) 59504 DEFB 132 ; Draw layout data fragment 4 (Top of Tree with Face) 59505 DEFB 44,19,0,5,20,0 ; Draw tree trunk 1 (44) with attribute data index of 19, terrain interaction data ; index of 0 at (5, 20) 59511 DEFB 127,18,9 ; Start horizontal block drawing at (18, 9) 59514 DEFB 29,0,29,0,29,0,29 ; Draw pattern of blocks 59521 DEFB 255 ; End Marker (block drawing) 59522 DEFB 127,18,11 ; Start horizontal block drawing at (18, 11) 59525 DEFB 135,29 ; Draw 7 blocks of style 29 59527 DEFB 255 ; End Marker (block drawing) 59528 DEFB 127,20,13 ; Start horizontal block drawing at (20, 13) 59531 DEFB 134,29 ; Draw 6 blocks of style 29 59533 DEFB 255 ; End Marker (block drawing) 59534 DEFB 127,20,15 ; Start horizontal block drawing at (20, 15) 59537 DEFB 134,29 ; Draw 6 blocks of style 29 59539 DEFB 255 ; End Marker (block drawing) 59540 DEFB 127,20,17 ; Start horizontal block drawing at (20, 17) 59543 DEFB 134,29 ; Draw 6 blocks of style 29 59545 DEFB 255 ; End Marker (block drawing) 59546 DEFB 127,20,19 ; Start horizontal block drawing at (20, 19) 59549 DEFB 132,29,20,20 ; Draw pattern of blocks 59553 DEFB 255 ; End Marker (block drawing) 59554 DEFB 127,20,21 ; Start horizontal block drawing at (20, 21) 59557 DEFB 132,29,20,20 ; Draw pattern of blocks 59561 DEFB 255 ; End Marker (block drawing) 59562 DEFB 0,52,68 ; Draw floor with floor character set UDG 52 and attribute 68 (green INK, black PAPER, ; BRIGHT) 59565 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (17) - Castle Ground Floor, 0 (One Axe Room) b59566 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59567 DEFB 130 ; Draw layout data fragment 2 (Plant) 59568 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 59571 DEFB 160,1 ; Draw 32 blocks of style 1 59573 DEFB 255 ; End Marker (block drawing) 59574 DEFB 127,12,15 ; Start horizontal block drawing at (12, 15) 59577 DEFB 1,1,0,1,1 ; Draw pattern of blocks 59582 DEFB 255 ; End Marker (block drawing) 59583 DEFB 127,10,17 ; Start horizontal block drawing at (10, 17) 59586 DEFB 1,1 ; Draw pattern of blocks 59588 DEFB 255 ; End Marker (block drawing) 59589 DEFB 127,20,17 ; Start horizontal block drawing at (20, 17) 59592 DEFB 1,1,136,0,1,1 ; Draw pattern of blocks 59598 DEFB 255 ; End Marker (block drawing) 59599 DEFB 127,22,19 ; Start horizontal block drawing at (22, 19) 59602 DEFB 1,1,134,0,131,1 ; Draw pattern of blocks 59608 DEFB 255 ; End Marker (block drawing) 59609 DEFB 127,22,21 ; Start horizontal block drawing at (22, 21) 59612 DEFB 133,1 ; Draw 5 blocks of style 1 59614 DEFB 255 ; End Marker (block drawing) 59615 DEFB 126,0,5 ; Start vertical block drawing at (0, 5) 59618 DEFB 135,29,20,20 ; Draw pattern of blocks 59622 DEFB 255 ; End Marker (block drawing) 59623 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59626 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (18) - Castle Ground Floor, 1 (Indoor Bowling Green) b59627 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59628 DEFB 127,0,21 ; Start horizontal block drawing at (0, 21) 59631 DEFB 144,4 ; Draw 16 blocks of style 4 59633 DEFB 255 ; End Marker (block drawing) 59634 DEFB 127,0,22 ; Start horizontal block drawing at (0, 22) 59637 DEFB 144,20 ; Draw 16 blocks of style 20 59639 DEFB 255 ; End Marker (block drawing) 59640 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59643 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (19) - Castle Ground Floor, 2 b59644 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59645 DEFB 63,16,0,12,12,0 ; Draw fire bowl (63) with attribute data index of 16, terrain interaction data index of ; 0 at (12, 12) 59651 DEFB 64,15,0,14,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (14, 19) 59657 DEFB 127,0,21 ; Start horizontal block drawing at (0, 21) 59660 DEFB 1 ; Draw 1 block of style 1 59661 DEFB 255 ; End Marker 59662 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59665 DEFB 13,12 ; Paint glowing blocks at (13,12)... 59667 DEFB 14,12 ; ...(14,12)... 59669 DEFB 15,12 ; ...(15,12)... 59671 DEFB 16,12 ; ...(16,12)... 59673 DEFB 13,13 ; ...(13,13)... 59675 DEFB 14,13 ; ...(14,13)... 59677 DEFB 15,13 ; ...(15,13)... 59679 DEFB 16,13 ; ...(16,13)... 59681 DEFB 13,14 ; ...(13,14)... 59683 DEFB 14,14 ; ...(14,14)... 59685 DEFB 15,14 ; ...(15,14)... 59687 DEFB 16,14 ; ...and (16,14) 59689 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (20) - Castle Ground Floor, 3 b59690 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59691 DEFB 139 ; Draw layout data fragment 11 (Lever) 59692 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59695 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (21) - Castle Ground Floor, 4 (More Axe Problems) b59696 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59697 DEFB 60,14,0,15,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 14, terrain ; interaction data index of 0 at (15, 21) 59703 DEFB 61,12,0,15,14,0 ; Draw Cracked Column Section 1 (61) with attribute data index of 12, terrain ; interaction data index of 0 at (15, 14) 59709 DEFB 60,14,0,25,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 14, terrain ; interaction data index of 0 at (25, 21) 59715 DEFB 61,12,0,25,14,0 ; Draw Cracked Column Section 1 (61) with attribute data index of 12, terrain ; interaction data index of 0 at (25, 14) 59721 DEFB 62,13,0,25,9,0 ; Draw Cracked Column Section 2 (62) with attribute data index of 13, terrain ; interaction data index of 0 at (25, 9) 59727 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59730 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (22) - Castle Ground Floor, 5 (Even More Axes) b59731 DEFB 63,16,0,22,12,0 ; Draw fire bowl (63) with attribute data index of 16, terrain interaction data index of ; 0 at (22, 12) 59737 DEFB 64,15,0,24,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (24, 19) 59743 DEFB 63,16,0,4,12,0 ; Draw fire bowl (63) with attribute data index of 16, terrain interaction data index of ; 0 at (4, 12) 59749 DEFB 64,15,0,6,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (6, 19) 59755 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59758 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (23) - Castle Ground Floor, 6 (The First Jump Chute) b59759 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59760 DEFB 65,17,3,15,17,0 ; Draw large stool (65) with attribute data index of 17, terrain interaction data index ; of 3 at (15, 17) 59766 DEFB 140 ; Draw layout data fragment 12 (Ceiling, Floor and Jump Chute) 59767 DEFB 134 ; Draw layout data fragment 6 (Right Wall) 59768 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59771 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (24) - Castle First Floor, 0 (Main Lever 7) b59772 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59773 DEFB 133 ; Draw layout data fragment 5 (Left Wall) 59774 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59775 DEFB 65,17,3,9,17,0 ; Draw large stool (65) with attribute data index of 17, terrain interaction data index ; of 3 at (9, 17) 59781 DEFB 65,17,3,13,17,0 ; Draw large stool (65) with attribute data index of 17, terrain interaction data index ; of 3 at (13, 17) 59787 DEFB 65,17,3,17,17,0 ; Draw large stool (65) with attribute data index of 17, terrain interaction data index ; of 3 at (17, 17) 59793 DEFB 139 ; Draw layout data fragment 11 (Lever) 59794 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59797 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (25) - Castle First Floor, 1 (Main Lever 6) b59798 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59799 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59800 DEFB 139 ; Draw layout data fragment 11 (Lever) 59801 DEFB 63,16,0,12,12,0 ; Draw fire bowl (63) with attribute data index of 16, terrain interaction data index of ; 0 at (12, 12) 59807 DEFB 64,15,0,14,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (14, 19) 59813 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59816 DEFB 13,12 ; Paint glowing blocks at (13,12)... 59818 DEFB 14,12 ; ...(14,12)... 59820 DEFB 15,12 ; ...(15,12)... 59822 DEFB 16,12 ; ...(16,12)... 59824 DEFB 13,13 ; ...(13,13)... 59826 DEFB 14,13 ; ...(14,13)... 59828 DEFB 15,13 ; ...(15,13)... 59830 DEFB 16,13 ; ...(16,13)... 59832 DEFB 13,14 ; ...(13,14)... 59834 DEFB 14,14 ; ...(14,14)... 59836 DEFB 15,14 ; ...(15,14)... 59838 DEFB 16,14 ; ...and (16,14) 59840 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (26) - Castle First Floor, 2 (Security Door & Main Lever 5) b59841 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59842 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59843 DEFB 127,11,7 ; Start horizontal block drawing at (11, 7) 59846 DEFB 27 ; Draw 1 block of style 27 59847 DEFB 255 ; End Marker (block drawing) 59848 DEFB 126,13,5 ; Start vertical block drawing at (13, 5) 59851 DEFB 135,33 ; Draw 7 blocks of style 33 59853 DEFB 255 ; End Marker (block drawing) 59854 DEFB 126,15,5 ; Start vertical block drawing at (15, 5) 59857 DEFB 135,33 ; Draw 7 blocks of style 33 59859 DEFB 255 ; End Marker (block drawing) 59860 DEFB 126,17,5 ; Start vertical block drawing at (17, 5) 59863 DEFB 135,33 ; Draw 7 blocks of style 33 59865 DEFB 255 ; End Marker (block drawing) 59866 DEFB 135 ; Draw Security Door (1/3) (layout data fragment 7) 59867 DEFB 136 ; Draw Security Door (2/3) (layout data fragment 8) 59868 DEFB 137 ; Draw Security Door (3/3) (layout data fragment 9) 59869 DEFB 139 ; Draw layout data fragment 11 (Lever) 59870 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59873 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (27) - Castle First Floor, 3 (Main Lever 4) b59874 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59875 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59876 DEFB 57,0,0,2,21,0 ; Draw Reggie (57) with attribute data index of 0, terrain interaction data index of 0 ; at (2, 21) 59882 DEFB 127,12,5 ; Start horizontal block drawing at (12, 5) 59885 DEFB 132,33 ; Draw 4 blocks of style 33 59887 DEFB 255 ; End Marker (block drawing) 59888 DEFB 127,12,7 ; Start horizontal block drawing at (12, 7) 59891 DEFB 132,33 ; Draw 4 blocks of style 33 59893 DEFB 255 ; End Marker (block drawing) 59894 DEFB 127,12,9 ; Start horizontal block drawing at (12, 9) 59897 DEFB 132,33 ; Draw 4 blocks of style 33 59899 DEFB 255 ; End Marker (block drawing) 59900 DEFB 127,12,11 ; Start horizontal block drawing at (12, 11) 59903 DEFB 132,33 ; Draw 4 blocks of style 33 59905 DEFB 255 ; End Marker (block drawing) 59906 DEFB 127,12,13 ; Start horizontal block drawing at (12, 13) 59909 DEFB 132,33 ; Draw 4 blocks of style 33 59911 DEFB 255 ; End Marker (block drawing) 59912 DEFB 145 ; Draw layout data fragment 17 (Middle Section of Corridor) 59913 DEFB 60,18,1,10,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (10, 21) 59919 DEFB 60,18,1,14,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (14, 21) 59925 DEFB 60,18,1,18,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (18, 21) 59931 DEFB 139 ; Draw layout data fragment 11 (Lever) 59932 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59935 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (28) - Castle First Floor, 4 (Main Lever 3) b59936 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59937 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59938 DEFB 139 ; Draw layout data fragment 11 (Lever) 59939 DEFB 64,15,0,10,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (10, 19) 59945 DEFB 64,15,0,14,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (14, 19) 59951 DEFB 64,15,0,18,19,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (18, 19) 59957 DEFB 64,15,0,12,15,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (12, 15) 59963 DEFB 64,15,0,16,15,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (16, 15) 59969 DEFB 64,15,0,14,11,0 ; Draw plinth (64) with attribute data index of 15, terrain interaction data index of 0 ; at (14, 11) 59975 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59978 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (29) - Castle First Floor, 5 (Main Lever 2) b59979 DEFB 141 ; Draw layout data fragment 13 (Ceiling) 59980 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59981 DEFB 139 ; Draw layout data fragment 11 (Lever) 59982 DEFB 146 ; Draw layout data fragment 18 (Cracked Column) 59983 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59986 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (30) - Castle First Floor, 6 (Main Lever 1) b59987 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 59988 DEFB 139 ; Draw layout data fragment 11 (Lever) 59989 DEFB 134 ; Draw layout data fragment 6 (Right Wall) 59990 DEFB 140 ; Draw layout data fragment 12 (Ceiling, Floor and Jump Chute) 59991 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 59994 DEFB 17,23 ; Paint glowing blocks at (17,23)... 59996 DEFB 18,23 ; ...(18,23)... 59998 DEFB 19,23 ; ...(19,23)... 60000 DEFB 20,23 ; ...and (20,23) 60002 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (31) - Castle Second Floor, 0 (The Broken Teleport) b60003 DEFB 133 ; Draw layout data fragment 5 (Left Wall) 60004 DEFB 129 ; Draw layout data fragment 1 (Teleport) 60005 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60006 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60009 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (32) - Castle Second Floor, 1 (Terrible Twins) b60010 DEFB 36,28,0,5,11,1 ; Draw Grunter-like statue (36) with attribute data index of 28, terrain interaction ; data index of 0 at (5, 11), and apply vertical mirror (1) 60016 DEFB 36,28,0,16,11,0 ; Draw Grunter-like statue (36) with attribute data index of 28, terrain interaction ; data index of 0 at (16, 11) 60022 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60025 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (33) - Castle Second Floor, 2 (The Guardian Statues) b60026 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60027 DEFB 56,7,0,3,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (3, 19) 60033 DEFB 56,7,0,6,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (6, 19) 60039 DEFB 56,7,0,9,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (9, 19) 60045 DEFB 56,7,0,12,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (12, 19) 60051 DEFB 56,7,0,15,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (15, 19) 60057 DEFB 56,7,0,18,19,0 ; Draw Organon-like statue (56) with attribute data index of 7, terrain interaction data ; index of 0 at (18, 19) 60063 DEFB 142 ; Draw layout data fragment 14 (Right Wall Section) 60064 DEFB 143 ; Draw layout data fragment 15 (Right Section of Corridor) 60065 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60068 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (34) - Castle Second Floor, 3 (One Way Corridor, 1) ; ; This room also uses the following data block (at #R60070) as part of its layout definition. b60069 DEFB 139 ; Draw layout data fragment 11 (Lever) ; Room Layout Data (35 / 36) - Castle Second Floor, 4 / 5 (One Way Corridor, 2 / 3) b60070 DEFB 131 ; Draw layout data fragment 3 (Corridor with Partial Floor and Ceiling) 60071 DEFB 143 ; Draw layout data fragment 15 (Right Section of Corridor) 60072 DEFB 144 ; Draw layout data fragment 16 (Left Section of Corridor) 60073 DEFB 145 ; Draw layout data fragment 17 (Middle Section of Corridor) 60074 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60077 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (37 / 44) - Castle Second Floor, 6 / Castle Third Floor, 6 b60078 DEFB 140 ; Draw layout data fragment 12 (Ceiling, Floor and Jump Chute) 60079 DEFB 126,0,5 ; Start vertical block drawing at (0, 5) 60082 DEFB 133,1 ; Draw 5 blocks of style 1 60084 DEFB 255 ; End Marker (block drawing) 60085 DEFB 126,2,5 ; Start vertical block drawing at (2, 5) 60088 DEFB 133,1 ; Draw 5 blocks of style 1 60090 DEFB 255 ; End Marker (block drawing) 60091 DEFB 144 ; Draw layout data fragment 16 (Left Section of Corridor) 60092 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60093 DEFB 134 ; Draw layout data fragment 6 (Right Wall) 60094 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60097 DEFB 17,23 ; Paint glowing blocks at (17,23)... 60099 DEFB 18,23 ; ...(18,23)... 60101 DEFB 19,23 ; ...(19,23)... 60103 DEFB 20,23 ; ...and (20,23) 60105 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (38) - Castle Third Floor, 0 (Big White Statue) b60106 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60107 DEFB 36,30,0,6,9,0 ; Draw Grunter-like statue (36) with attribute data index of 30, terrain interaction data ; index of 0 at (6, 9) 60113 DEFB 127,0,21 ; Start horizontal block drawing at (0, 21) 60116 DEFB 136,1 ; Draw 8 blocks of style 1 60118 DEFB 255 ; End Marker 60119 DEFB 139 ; Draw layout data fragment 11 (Lever) 60120 DEFB 133 ; Draw layout data fragment 5 (Left Wall) 60121 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60124 DEFB 17,23 ; Paint glowing blocks at (17,23)... 60126 DEFB 18,23 ; ...(18,23)... 60128 DEFB 19,23 ; ...(19,23)... 60130 DEFB 20,23 ; ...and (20,23) 60132 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (39) - Castle Third Floor, 1 b60133 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60134 DEFB 146 ; Draw layout data fragment 18 (Cracked Column) 60135 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60138 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (40) - Castle Third Floor, 2 (Teleport Room, 1) b60139 DEFB 142 ; Draw layout data fragment 14 (Right Wall Section) 60140 DEFB 143 ; Draw layout data fragment 15 (Right Section of Corridor) 60141 DEFB 128 ; Draw layout data fragment 0 (Two Torches) 60142 DEFB 129 ; Draw layout data fragment 1 (Teleport) 60143 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60146 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (41 / 42 / 43) - Castle Third Floor, 3 / 4 / 5 (One Way Corridor, 4 / 5 / 6) b60147 DEFB 131 ; Draw layout data fragment 3 (Corridor with Partial Floor and Ceiling) 60148 DEFB 143 ; Draw layout data fragment 15 (Right Section of Corridor) 60149 DEFB 144 ; Draw layout data fragment 16 (Left Section of Corridor) 60150 DEFB 145 ; Draw layout data fragment 17 (Middle Section of Corridor) 60151 DEFB 0,53,7 ; Draw floor with floor character set UDG 53 and attribute 7 (white INK, black PAPER) 60154 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (45) - Spaceship, 0 (The Control Room) b60155 DEFB 43,4,0,2,10,0 ; Draw control console (43) with attribute data index of 4, terrain interaction data ; index of 0 at (2, 10) 60161 DEFB 48,1,0,10,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (10, 12) 60167 DEFB 49,2,0,17,12,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (17, 12) 60173 DEFB 50,3,0,24,12,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (24, 12) 60179 DEFB 133 ; Draw layout data fragment 5 (Left Wall) 60180 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60183 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (46) - Spaceship, 1 (Many Screened Room) b60184 DEFB 48,1,0,1,9,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (1, 9) 60190 DEFB 49,2,0,6,9,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (6, 9) 60196 DEFB 50,3,0,11,9,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (11, 9) 60202 DEFB 48,1,0,16,9,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (16, 9) 60208 DEFB 49,2,0,21,9,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (21, 9) 60214 DEFB 50,3,0,26,9,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (26, 9) 60220 DEFB 49,2,0,1,13,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (1, 13) 60226 DEFB 50,3,0,6,13,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (6, 13) 60232 DEFB 48,1,0,11,13,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (11, 13) 60238 DEFB 49,2,0,16,13,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (16, 13) 60244 DEFB 50,3,0,21,13,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (21, 13) 60250 DEFB 48,1,0,26,13,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (26, 13) 60256 DEFB 48,1,0,1,17,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (1, 17) 60262 DEFB 49,2,0,6,17,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (6, 17) 60268 DEFB 50,3,0,11,17,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (11, 17) 60274 DEFB 48,1,0,16,17,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (16, 17) 60280 DEFB 49,2,0,21,17,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (21, 17) 60286 DEFB 50,3,0,26,17,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (26, 17) 60292 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60295 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (47) - Spaceship, 2 (Teleport Room, 2) b60296 DEFB 48,1,0,1,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (1, 12) 60302 DEFB 50,3,0,25,12,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (25, 12) 60308 DEFB 129 ; Draw layout data fragment 1 (Teleport) 60309 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60312 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (48) - Spaceship, 3 b60313 DEFB 49,2,0,3,12,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (3, 12) 60319 DEFB 48,1,0,16,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (16, 12) 60325 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 60328 DEFB 144,23 ; Draw 16 blocks of style 23 60330 DEFB 255 ; End Marker (block drawing) 60331 DEFB 127,20,21 ; Start horizontal block drawing at (20, 21) 60334 DEFB 25 ; Draw 1 block of style 25 60335 DEFB 255 ; End Marker (block drawing) 60336 DEFB 126,22,19 ; Start vertical block drawing at (22, 19) 60339 DEFB 130,25 ; Draw 2 blocks of style 25 60341 DEFB 255 ; End Marker (block drawing) 60342 DEFB 126,24,17 ; Start vertical block drawing at (24, 17) 60345 DEFB 131,25 ; Draw 3 blocks of style 25 60347 DEFB 255 ; End Marker (block drawing) 60348 DEFB 126,26,15 ; Start vertical block drawing at (26, 15) 60351 DEFB 132,25 ; Draw 4 blocks of style 25 60353 DEFB 255 ; End Marker (block drawing) 60354 DEFB 126,28,13 ; Start vertical block drawing at (28, 13) 60357 DEFB 133,25 ; Draw 5 blocks of style 25 60359 DEFB 255 ; End Marker (block drawing) 60360 DEFB 126,30,13 ; Start vertical block drawing at (30, 13) 60363 DEFB 133,25 ; Draw 5 blocks of style 25 60365 DEFB 255 ; End Marker (block drawing) 60366 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60369 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (49) - Spaceship, 4 (The Power Plant) b60370 DEFB 130 ; Draw layout data fragment 2 (Plant) 60371 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 60374 DEFB 144,23,176,0,160,23 ; Draw pattern of blocks 60380 DEFB 255 ; End Marker (block drawing) 60381 DEFB 127,4,19 ; Start horizontal block drawing at (4, 19) 60384 DEFB 19 ; Draw 1 block of style 19 60385 DEFB 255 ; End Marker (block drawing) 60386 DEFB 127,26,19 ; Start horizontal block drawing at (26, 19) 60389 DEFB 19 ; Draw 1 block of style 19 60390 DEFB 255 ; End Marker (block drawing) 60391 DEFB 126,0,15 ; Start vertical block drawing at (0, 15) 60394 DEFB 132,25 ; Draw 4 blocks of style 25 60396 DEFB 255 ; End Marker (block drawing) 60397 DEFB 126,30,15 ; Start vertical block drawing at (30, 15) 60400 DEFB 132,25 ; Draw 4 blocks of style 25 60402 DEFB 255 ; End Marker (block drawing) 60403 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow ; PAPER, BRIGHT) 60406 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (50) - Spaceship, 5 b60407 DEFB 50,3,0,16,12,0 ; Draw display screen (50) with attribute data index of 3, terrain interaction data index ; of 0 at (16, 12) 60413 DEFB 48,1,0,25,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (25, 12) 60419 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 60422 DEFB 144,23 ; Draw 16 blocks of style 23 60424 DEFB 255 ; End Marker (block drawing) 60425 DEFB 126,0,13 ; Start vertical block drawing at (0, 13) 60428 DEFB 133,25 ; Draw 5 blocks of style 25 60430 DEFB 255 ; End Marker (block drawing) 60431 DEFB 126,2,13 ; Start vertical block drawing at (2, 13) 60434 DEFB 133,25 ; Draw 5 blocks of style 25 60436 DEFB 255 ; End Marker (block drawing) 60437 DEFB 126,4,15 ; Start vertical block drawing at (4, 15) 60440 DEFB 132,25 ; Draw 4 blocks of style 25 60442 DEFB 255 ; End Marker (block drawing) 60443 DEFB 126,6,17 ; Start vertical block drawing at (6, 17) 60446 DEFB 131,25 ; Draw 3 blocks of style 25 60448 DEFB 255 ; End Marker (block drawing) 60449 DEFB 126,8,19 ; Start vertical block drawing at (8, 19) 60452 DEFB 130,25 ; Draw 2 blocks of style 25 60454 DEFB 255 ; End Marker (block drawing) 60455 DEFB 126,10,21 ; Start vertical block drawing at (10, 21) 60458 DEFB 25 ; Draw 1 block of style 25 60459 DEFB 255 ; End Marker (block drawing) 60460 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60463 DEFB 255 ; End Marker (room layout data) ; Room Layout Data (51) - Spaceship, 6 b60464 DEFB 48,1,0,5,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (5, 12) 60470 DEFB 49,2,0,14,12,0 ; Draw control panel (49) with attribute data index of 2, terrain interaction data index ; of 0 at (14, 12) 60476 DEFB 48,1,0,23,12,0 ; Draw monitor showing castle (48) with attribute data index of 1, terrain interaction ; data index of 0 at (23, 12) 60482 DEFB 134 ; Draw layout data fragment 6 (Right Wall) 60483 DEFB 0,54,114 ; Draw floor with floor character set UDG 54 and attribute 114 (red INK, yellow PAPER, ; BRIGHT) 60486 DEFB 255 ; End Marker (room layout data) ; Lookup Table for RLE Attribute Data (Room Layout Graphics) ; ; Each entry is comprised of four bytes: b60487 DEFB 1,1,199,236 ; (00) - #R60615 - No colouring 60491 DEFB 5,4,200,236 ; (01) - #R60616 - Monitor Showing Castle 60495 DEFB 5,4,211,236 ; (02) - #R60627 - Control Panel 60499 DEFB 5,4,214,236 ; (03) - #R60630 - Display Screen 60503 DEFB 4,13,225,236 ; (04) - #R60641 - Control Console 60507 DEFB 5,5,12,237 ; (05) - #R60684 - Moon 60511 DEFB 3,7,15,237 ; (06) - #R60687 - Torch 60515 DEFB 2,4,20,237 ; (07) - #R60692 - Organon / Organon-like statue 60519 DEFB 2,5,23,237 ; (08) - #R60695 - Plant 60523 DEFB 5,7,28,237 ; (09) - #R60700 - Axe in Tree Stump 60527 DEFB 11,3,41,237 ; (10) - #R60713 - Hut Roof / Top of Well 60531 DEFB 11,10,44,237 ; (11) - #R60716 - Well 60535 DEFB 4,7,97,237 ; (12) - #R60769 - Cracked Column Section 1 60539 DEFB 4,6,100,237 ; (13) - #R60772 - Cracked Column Section 2 60543 DEFB 4,2,103,237 ; (14) - #R60775 - Jump Chute / Corridor Pad 60547 DEFB 3,4,106,237 ; (15) - #R60778 - Plinth 60551 DEFB 7,6,113,237 ; (16) - #R60785 - Fire Bowl 60555 DEFB 4,6,118,237 ; (17) - #R60790 - Large Stool 60559 DEFB 4,2,123,237 ; (18) - #R60795 - Jump Chute / Corridor Pad 60563 DEFB 4,3,128,237 ; (19) - #R60800 - Tree Trunk 1 60567 DEFB 7,3,131,237 ; (20) - #R60803 - Tree Trunk 2 60571 DEFB 4,3,134,237 ; (21) - #R60806 - Unused 60575 DEFB 6,3,137,237 ; (22) - #R60809 - Tree Trunk 3 60579 DEFB 7,4,140,237 ; (23) - #R60812 - Flowers 60583 DEFB 12,7,147,237 ; (24) - #R60819 - Top of Tree With Face 60587 DEFB 9,6,168,237 ; (25) - #R60840 - Top of Tree Without Face 60591 DEFB 7,10,177,237 ; (26) - #R60849 - Top of Tree, Bare 60595 DEFB 6,7,180,237 ; (27) - #R60852 - Unused 60599 DEFB 11,12,183,237 ; (28) - #R60855 - Grunter / Grunter-like Statue (Green) 60603 DEFB 3,7,192,237 ; (29) - #R60864 - Half of Teleport 60607 DEFB 11,12,201,237 ; (30) - #R60873 - Grunter-like Statue (White) 60611 DEFB 6,5,210,237 ; (31) - #R60882 - Sword in Concrete ; 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 b60615 DEFB 0 ; End Marker ; (01) - Monitor Showing Castle 60616 DEFB 6,68 ; 6 x 68 (green INK, black PAPER, BRIGHT) 60618 DEFB 3,70 ; 3 x 70 (yellow INK, black PAPER, BRIGHT) 60620 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 60622 DEFB 3,70 ; 3 x 70 (yellow INK, black PAPER, BRIGHT) 60624 DEFB 6,68 ; 6 x 68 (green INK, black PAPER, BRIGHT) 60626 DEFB 0 ; End Marker ; (02) - Control Panel 60627 DEFB 20,71 ; 20 x 71 (white INK, black PAPER, BRIGHT) 60629 DEFB 0 ; End Marker ; (03) - Display Screen 60630 DEFB 10,71 ; 10 x 71 (white INK, black PAPER, BRIGHT) 60632 DEFB 1,68 ; 1 x 68 (green INK, black PAPER, BRIGHT) 60634 DEFB 4,71 ; 4 x 71 (white INK, black PAPER, BRIGHT) 60636 DEFB 1,68 ; 1 x 68 (green INK, black PAPER, BRIGHT) 60638 DEFB 4,71 ; 4 x 71 (white INK, black PAPER, BRIGHT) 60640 DEFB 0 ; End Marker ; (04) - Control Console 60641 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 60643 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60645 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 60647 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60649 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 60651 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60653 DEFB 1,71 ; 1 x 71 (white INK, black PAPER, BRIGHT) 60655 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60657 DEFB 1,68 ; 1 x 68 (green INK, black PAPER, BRIGHT) 60659 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60661 DEFB 1,68 ; 1 x 68 (green INK, black PAPER, BRIGHT) 60663 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60665 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 60667 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60669 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60671 DEFB 2,69 ; 2 x 69 (cyan INK, black PAPER, BRIGHT) 60673 DEFB 9,70 ; 9 x 70 (yellow INK, black PAPER, BRIGHT) 60675 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60677 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 60679 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60681 DEFB 1,70 ; 1 x 70 (yellow INK, black PAPER, BRIGHT) 60683 DEFB 0 ; End Marker ; (05) - Moon 60684 DEFB 25,71 ; 25 x 71 (white INK, black PAPER, BRIGHT) 60686 DEFB 0 ; End Marker ; (06) - Torch 60687 DEFB 9,70 ; 9 x 70 (yellow INK, black PAPER, BRIGHT) 60689 DEFB 12,67 ; 12 x 67 (magenta INK, black PAPER, BRIGHT) 60691 DEFB 0 ; End Marker ; (07) - Organon / Organon-like statue 60692 DEFB 8,71 ; 8 x 71 (white INK, black PAPER, BRIGHT) 60694 DEFB 0 ; End Marker ; (08) - Plant 60695 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 60697 DEFB 8,68 ; 8 x 68 (green INK, black PAPER, BRIGHT) 60699 DEFB 0 ; End Marker ; (09) - Axe in Tree Stump 60700 DEFB 10,70 ; 10 x 70 (yellow INK, black PAPER, BRIGHT) 60702 DEFB 3,66 ; 3 x 66 (red INK, black PAPER, BRIGHT) 60704 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60706 DEFB 3,66 ; 3 x 66 (red INK, black PAPER, BRIGHT) 60708 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60710 DEFB 15,68 ; 15 x 68 (green INK, black PAPER, BRIGHT) 60712 DEFB 0 ; End Marker ; (10) - Hut Roof / Top of Well 60713 DEFB 33,70 ; 33 x 70 (yellow INK, black PAPER, BRIGHT) 60715 DEFB 0 ; End Marker ; (11) - Well 60716 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 60718 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60720 DEFB 7,71 ; 7 x 71 (white INK, black PAPER, BRIGHT) 60722 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 60724 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60726 DEFB 7,71 ; 7 x 71 (white INK, black PAPER, BRIGHT) 60728 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60730 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60732 DEFB 5,71 ; 5 x 71 (white INK, black PAPER, BRIGHT) 60734 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60736 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60738 DEFB 5,71 ; 5 x 71 (white INK, black PAPER, BRIGHT) 60740 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60742 DEFB 3,69 ; 3 x 69 (cyan INK, black PAPER, BRIGHT) 60744 DEFB 5,71 ; 5 x 71 (white INK, black PAPER, BRIGHT) 60746 DEFB 11,71 ; 11 x 71 (white INK, black PAPER, BRIGHT) 60748 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 60750 DEFB 6,7 ; 6 x 7 (white INK, black PAPER) 60752 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60754 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 60756 DEFB 6,7 ; 6 x 7 (white INK, black PAPER) 60758 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60760 DEFB 2,71 ; 2 x 71 (white INK, black PAPER, BRIGHT) 60762 DEFB 6,7 ; 6 x 7 (white INK, black PAPER) 60764 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60766 DEFB 11,39 ; 11 x 39 (white INK, green PAPER) 60768 DEFB 0 ; End Marker ; (12) - Cracked Column Section 1 60769 DEFB 28,70 ; 28 x 70 (yellow INK, black PAPER, BRIGHT) 60771 DEFB 0 ; End Marker ; (13) - Cracked Column Section 2 60772 DEFB 24,70 ; 24 x 70 (yellow INK, black PAPER, BRIGHT) 60774 DEFB 0 ; End Marker ; (14) - Jump Chute / Corridor Pad 60775 DEFB 8,71 ; 8 x 71 (white INK, black PAPER, BRIGHT) 60777 DEFB 0 ; End Marker ; (15) - Plinth 60778 DEFB 3,67 ; 3 x 67 (magenta INK, black PAPER, BRIGHT) 60780 DEFB 6,70 ; 6 x 70 (yellow INK, black PAPER, BRIGHT) 60782 DEFB 3,68 ; 3 x 68 (green INK, black PAPER, BRIGHT) 60784 DEFB 0 ; End Marker ; (16) - Fire Bowl 60785 DEFB 21,70 ; 21 x 70 (yellow INK, black PAPER, BRIGHT) 60787 DEFB 28,4 ; 28 x 4 (green INK, black PAPER) 60789 DEFB 0 ; End Marker ; (17) - Large Stool 60790 DEFB 4,67 ; 4 x 67 (magenta INK, black PAPER, BRIGHT) 60792 DEFB 20,70 ; 20 x 70 (yellow INK, black PAPER, BRIGHT) 60794 DEFB 0 ; End Marker ; (18) - Jump Chute / Corridor Pad 60795 DEFB 4,69 ; 4 x 69 (cyan INK, black PAPER, BRIGHT) 60797 DEFB 4,71 ; 4 x 71 (white INK, black PAPER, BRIGHT) 60799 DEFB 0 ; End Marker ; (19) - Tree Trunk 1 60800 DEFB 12,68 ; 12 x 68 (green INK, black PAPER, BRIGHT) 60802 DEFB 0 ; End Marker ; (20) - Tree Trunk 2 60803 DEFB 21,68 ; 21 x 68 (green INK, black PAPER, BRIGHT) 60805 DEFB 0 ; End Marker ; (21) - Unused 60806 DEFB 12,68 ; 12 x 68 (green INK, black PAPER, BRIGHT) 60808 DEFB 0 ; End Marker ; (22) - Tree Trunk 3 60809 DEFB 18,68 ; 18 x 68 (green INK, black PAPER, BRIGHT) 60811 DEFB 0 ; End Marker ; (23) - Flowers 60812 DEFB 16,68 ; 16 x 68 (green INK, black PAPER, BRIGHT) 60814 DEFB 1,84 ; 1 x 84 (green INK, red PAPER, BRIGHT) 60816 DEFB 11,68 ; 11 x 68 (green INK, black PAPER, BRIGHT) 60818 DEFB 0 ; End Marker ; (24) - Top of Tree With Face 60819 DEFB 24,68 ; 24 x 68 (green INK, black PAPER, BRIGHT) 60821 DEFB 9,68 ; 9 x 68 (green INK, black PAPER, BRIGHT) 60823 DEFB 1,66 ; 1 x 66 (red INK, black PAPER, BRIGHT) 60825 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 60827 DEFB 12,68 ; 12 x 68 (green INK, black PAPER, BRIGHT) 60829 DEFB 12,68 ; 12 x 68 (green INK, black PAPER, BRIGHT) 60831 DEFB 2,68 ; 2 x 68 (green INK, black PAPER, BRIGHT) 60833 DEFB 1,66 ; 1 x 66 (red INK, black PAPER, BRIGHT) 60835 DEFB 9,68 ; 9 x 68 (green INK, black PAPER, BRIGHT) 60837 DEFB 12,68 ; 12 x 68 (green INK, black PAPER, BRIGHT) 60839 DEFB 0 ; End Marker ; (25) - Top of Tree Without Face 60840 DEFB 35,68 ; 35 x 68 (green INK, black PAPER, BRIGHT) 60842 DEFB 1,66 ; 1 x 66 (red INK, black PAPER, BRIGHT) 60844 DEFB 16,68 ; 16 x 68 (green INK, black PAPER, BRIGHT) 60846 DEFB 2,66 ; 2 x 66 (red INK, black PAPER, BRIGHT) 60848 DEFB 0 ; End Marker ; (26) - Top of Tree, Bare 60849 DEFB 70,68 ; 70 x 68 (green INK, black PAPER, BRIGHT) 60851 DEFB 0 ; End Marker ; (27) - Unused 60852 DEFB 42,68 ; 42 x 68 (green INK, black PAPER, BRIGHT) 60854 DEFB 0 ; End Marker ; (28) - Grunter / Grunter-like Statue (Green) 60855 DEFB 122,68 ; 122 x 68 (green INK, black PAPER, BRIGHT) 60857 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60859 DEFB 4,68 ; 4 x 68 (green INK, black PAPER, BRIGHT) 60861 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60863 DEFB 0 ; End Marker ; (29) - Half of Teleport 60864 DEFB 3,7 ; 3 x 7 (white INK, black PAPER) 60866 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60868 DEFB 12,69 ; 12 x 69 (cyan INK, black PAPER, BRIGHT) 60870 DEFB 3,71 ; 3 x 71 (white INK, black PAPER, BRIGHT) 60872 DEFB 0 ; End Marker ; (30) - Grunter-like Statue (White) 60873 DEFB 122,71 ; 122 x 71 (white INK, black PAPER, BRIGHT) 60875 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60877 DEFB 4,71 ; 4 x 71 (white INK, black PAPER, BRIGHT) 60879 DEFB 2,70 ; 2 x 70 (yellow INK, black PAPER, BRIGHT) 60881 DEFB 0 ; End Marker ; (31) - Sword in Concrete 60882 DEFB 14,68 ; 14 x 68 (green INK, black PAPER, BRIGHT) 60884 DEFB 4,7 ; 4 x 7 (white INK, black PAPER) 60886 DEFB 12,71 ; 12 x 71 (white INK, black PAPER, BRIGHT) 60888 DEFB 0 ; End Marker ; Lookup Table for RLE Terrain Interaction Parameter Data (Room Layout Graphics) ; ; Each entry is comprised of four bytes: b60889 DEFB 1,1,199,236 ; (00) - #R60615 - No interaction 60893 DEFB 4,2,237,237 ; (01) - #R60909 - Jump Chute / Corridor Pad 60897 DEFB 5,7,240,237 ; (02) - #R60912 - Axe in Tree Stump 60901 DEFB 4,1,245,237 ; (03) - #R60917 - Large Stool 60905 DEFB 11,10,248,237 ; (04) - #R60920 - Well ; 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: (01) - Jump Chute / Corridor Pad b60909 DEFB 4,255 ; 4 x 255 (impassable horizontally, upwards and downwards / preserve attribute) 60911 DEFB 0 ; End Marker ; (02) - Axe in Tree Stump 60912 DEFB 20,0 ; 20 x 0 (no interaction) 60914 DEFB 3,128 ; 3 x 128 (impassable downwards) 60916 DEFB 0 ; End Marker ; (03) - Large Stool 60917 DEFB 4,128 ; 4 x 128 (impassable downwards) 60919 DEFB 0 ; End Marker ; (04) - Well 60920 DEFB 68,0 ; 68 x 0 (no interaction) 60922 DEFB 7,128 ; 7 x 128 (impassable downwards) 60924 DEFB 0 ; End Marker ; Room Layout Data Fragment Pointers b60925 DEFW 60963 ; (00) - Two Torches 60927 DEFW 60976 ; (01) - Teleport 60929 DEFW 60995 ; (02) - Plant 60931 DEFW 61002 ; (03) - Corridor with Partial Floor and Ceiling 60933 DEFW 61057 ; (04) - Top of Tree with Face 60935 DEFW 61064 ; (05) - Left Wall 60937 DEFW 61071 ; (06) - Right Wall 60939 DEFW 61078 ; (07) - Security Door (1/3) 60941 DEFW 61085 ; (08) - Security Door (2/3) 60943 DEFW 61092 ; (09) - Security Door (3/3) 60945 DEFW 61098 ; (10) - Blank 60947 DEFW 61099 ; (11) - Lever 60949 DEFW 61105 ; (12) - Ceiling, Floor and Jump Chute 60951 DEFW 61124 ; (13) - Ceiling 60953 DEFW 61131 ; (14) - Right Wall Section 60955 DEFW 61144 ; (15) - Right Section of Corridor 60957 DEFW 61163 ; (16) - Left Section of Corridor 60959 DEFW 61182 ; (17) - Middle Section of Corridor 60961 DEFW 61195 ; (18) - Cracked Column ; Room Layout Data Fragment (00) - Two Torches b60963 DEFB 67,6,0,6,10,0 ; Draw torch (67) with attribute data index of 6, terrain interaction data index of 0 at ; (6, 10) 60969 DEFB 67,6,0,22,10,0 ; Draw torch (67) with attribute data index of 6, terrain interaction data index of 0 at ; (22, 10) 60975 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (01) - Teleport b60976 DEFB 1,29,0,14,15,0 ; Draw left half of Teleport (1) with attribute data index of 29, terrain interaction ; data index of 0 at (14, 15) 60982 DEFB 1,29,0,17,15,1 ; Draw left half of Teleport (1) with attribute data index of 29, terrain interaction ; data index of 0 at (17, 15), and apply vertical mirror (1) 60988 DEFB 127,14,22 ; Start horizontal block drawing at (14, 22) 60991 DEFB 131,1 ; Draw 3 blocks of style 1 60993 DEFB 255 ; End Marker (block drawing) 60994 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (02) - Plant b60995 DEFB 66,8,0,15,18,0 ; Draw plant (66) with attribute data index of 8, terrain interaction data index of 0 at ; (15, 18) 61001 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (03) - Corridor with Partial Floor and Ceiling b61002 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 61005 DEFB 208,1 ; Draw 80 blocks of style 1 61007 DEFB 255 ; End Marker (block drawing) 61008 DEFB 60,18,1,8,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (8, 21) 61014 DEFB 60,18,1,12,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (12, 21) 61020 DEFB 60,18,1,16,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (16, 21) 61026 DEFB 60,18,1,20,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (20, 21) 61032 DEFB 60,18,1,4,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (4, 14), and apply horizontal mirror (2) 61038 DEFB 60,18,1,8,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (8, 14), and apply horizontal mirror (2) 61044 DEFB 60,18,1,20,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (20, 14), and apply horizontal mirror (2) 61050 DEFB 60,18,1,24,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (24, 14), and apply horizontal mirror (2) 61056 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (04) - Top of Tree with Face b61057 DEFB 38,24,0,2,13,0 ; Draw top of tree with face (38) with attribute data index of 24, terrain interaction ; data index of 0 at (2, 13) 61063 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (05) - Left Wall b61064 DEFB 126,0,5 ; Start vertical block drawing at (0, 5) 61067 DEFB 137,1 ; Draw 9 blocks of style 1 61069 DEFB 255 ; End Marker (block drawing) 61070 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (06) - Right Wall b61071 DEFB 126,30,5 ; Start vertical block drawing at (30, 5) 61074 DEFB 137,1 ; Draw 9 blocks of style 1 61076 DEFB 255 ; End Marker (block drawing) 61077 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (07) - Security Door (1/3) b61078 DEFB 126,13,19 ; Start vertical block drawing at (13, 19) 61081 DEFB 130,13 ; Draw 2 blocks of style 13 61083 DEFB 255 ; End Marker (block drawing) 61084 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (08) - Security Door (2/3) b61085 DEFB 126,15,19 ; Start vertical block drawing at (15, 19) 61088 DEFB 130,13 ; Draw 2 blocks of style 13 61090 DEFB 255 ; End Marker (block drawing) 61091 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (09) - Security Door (3/3) b61092 DEFB 126,17,19 ; Start vertical block drawing at (17, 19) 61095 DEFB 130,13 ; Draw 2 blocks of style 13 61097 DEFB 255 ; End Marker (block drawing) ; Room Layout Data Fragment (10) - Blank b61098 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (11) - Lever b61099 DEFB 127,21,17 ; Start horizontal block drawing at (21, 17) 61102 DEFB 15 ; Draw 1 block of style 15 61103 DEFB 255 ; End Marker (block drawing) 61104 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (12) - Ceiling, Floor and Jump Chute b61105 DEFB 60,18,1,26,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (26, 21) 61111 DEFB 60,18,1,26,4,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (26, 4), and apply horizontal mirror (2) 61117 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 61120 DEFB 141,33 ; Draw 13 blocks of style 33 61122 DEFB 255 ; End Marker (block drawing) 61123 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (13) - Ceiling b61124 DEFB 127,0,5 ; Start horizontal block drawing at (0, 5) 61127 DEFB 144,33 ; Draw 16 blocks of style 33 61129 DEFB 255 ; End Marker (block drawing) 61130 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (14) - Right Wall Section b61131 DEFB 126,28,5 ; Start vertical block drawing at (28, 5) 61134 DEFB 133,1 ; Draw 5 blocks of style 1 61136 DEFB 255 ; End Marker (block drawing) 61137 DEFB 126,30,5 ; Start vertical block drawing at (30, 5) 61140 DEFB 133,1 ; Draw 5 blocks of style 1 61142 DEFB 255 ; End Marker (block drawing) 61143 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (15) - Right Section of Corridor b61144 DEFB 60,18,1,24,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (24, 21) 61150 DEFB 60,18,1,28,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (28, 21) 61156 DEFB 60,18,1,28,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (28, 14), and apply horizontal mirror (2) 61162 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (16) - Left Section of Corridor b61163 DEFB 60,18,1,0,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (0, 21) 61169 DEFB 60,18,1,4,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (4, 21) 61175 DEFB 60,18,1,0,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (0, 14), and apply horizontal mirror (2) 61181 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (17) - Middle Section of Corridor b61182 DEFB 60,18,1,12,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (12, 14), and apply horizontal mirror (2) 61188 DEFB 60,18,1,16,14,2 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 18, terrain ; interaction data index of 1 at (16, 14), and apply horizontal mirror (2) 61194 DEFB 0 ; End Marker (room layout data fragment) ; Room Layout Data Fragment (18) - Cracked Column b61195 DEFB 60,14,0,10,21,0 ; Draw Jump Chute / Corridor Pad (60) with attribute data index of 14, terrain ; interaction data index of 0 at (10, 21) 61201 DEFB 61,12,0,10,14,0 ; Draw Cracked Column Section 1 (61) with attribute data index of 12, terrain ; interaction data index of 0 at (10, 14) 61207 DEFB 62,13,0,10,9,0 ; Draw Cracked Column Section 2 (62) with attribute data index of 13, terrain ; interaction data index of 0 at (10, 9) 61213 DEFB 0 ; End Marker (room layout data fragment) ; Room Drawing Set "Apply Vertical Mirror" Mode off, "Apply Horizontal Mirror" Mode off and Draw a Graphic ; ; Used by the routine at #R40664. c61214 XOR A ; Load #R61373 with opcode for "NOP"... 61215 LD (61373),A ; ... 61218 LD H,A ; Load #R61373 and #R61373 with opcode for "NOP" 61219 LD L,A ; ... 61220 LD (61374),HL ; ... 61223 LD (23450),A ; Reset both Horizontal and Vertical Mirror Flags 61226 LD (23449),A ; Set Pixel Row Counter to zero 61229 LD BC,(23408) ; Load BC with x- and y-coordinates of graphic to draw 61233 JP 61336 ; Jump to #R61336 (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 #R40664. c61236 LD A,205 ; Load #R61373 with opcode for "CALL"... 61238 LD (61373),A ; ... 61241 LD HL,61625 ; Load #R61373 (i.e. operand of instruction at #R61373) with address of start of "Reverse the ; order of the bits in A" routine... 61244 LD (61374),HL ; ... 61247 XOR A ; Set Pixel Row Counter to zero... 61248 LD (23449),A ; ... 61251 INC A ; Set Apply Vertical Mirror Flag and reset Apply Horizontal Mirror Flag... 61252 LD (23450),A ; ... 61255 LD A,(23409) ; Load B with y-coordinate of graphic to draw... 61258 LD B,A ; ... 61259 LD A,(23410) ; Load C with x-coordinate of graphic to draw... 61262 DEC A ; ...and decrease by one... 61263 LD C,A ; ... 61264 JP 61336 ; Jump to #R61336 (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 #R40664. c61267 XOR A ; Load #R61373 with opcode for "NOP"... 61268 LD (61373),A ; ... 61271 LD H,A ; Load #R61373 and #R61373 with opcode for "NOP" 61272 LD L,A ; ... 61273 LD (61374),HL ; ... 61276 LD A,2 ; Reset Apply Vertical Mirror Flag and set Apply Horizontal Mirror Flag... 61278 LD (23450),A ; ... 61281 LD A,7 ; Set Pixel Row Counter to 7... 61283 LD (23449),A ; ... 61286 LD A,(23408) ; Load C with x-coordinate of left edge of current graphic to draw... 61289 LD C,A ; ... 61290 LD A,(23411) ; Load B with y-coordinate + 1 for current graphic... 61293 LD B,A ; ... 61294 JP 61323 ; Jump to #R61323 (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 #R40664. c61297 LD A,205 ; Load #R61373 with opcode for "CALL"... 61299 LD (61373),A ; ... 61302 LD HL,61625 ; Load #R61373 (i.e. operand of instruction at #R61373) with address of start of "Reverse the ; order of the bits in A" routine... 61305 LD (61374),HL ; ... 61308 LD A,7 ; Set Pixel Row Counter to 7... 61310 LD (23449),A ; ... 61313 LD A,3 ; Set both Horizontal and Vertical Mirror Flags... 61315 LD (23450),A ; ... 61318 LD BC,(23410) ; Load BC with coordinates (each +1) of bottom-right of graphic to draw 61322 DEC C ; Decrease x-coordinate by one ; This entry point is used by the routine at #R61267. *61323 LD (23444),BC ; Store coordinates at which to draw graphic at #R23444 61327 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 61330 LD A,7 ; Advance HL down to bottom pixel row in its current character block (as we are drawing up from ; the bottom)... 61332 ADD A,H ; ... 61333 LD H,A ; ... 61334 JR 61343 ; Jump to #R61343 (draw the graphic then return) ; Room Drawing Draw a Graphic ; ; Used by the routines at #R61214 and #R61236. Input: BC x- and y-coordinates HL (Entry at #R61343 only) Address ; in Display File to start drawing c61336 LD (23444),BC ; Store x- and y-coordinates of character block currently being drawn at #R23444 61340 CALL 63203 ; 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 #R61297. *61343 PUSH HL ; Store HL (address in Display File to print character) 61344 LD HL,61418 ; Load HL with 61418 (address of "Advance HL to next Display File Address to be drawn to (Apply ; Horizontal Mirror Flag reset)" routine) 61347 LD A,(23450) ; Load A with Apply Horizontal and Apply Vertical Mirror Flags 61350 AND 2 ; If Apply Horizontal Mirror Flag is reset... 61352 JR Z,61357 ; ...then skip ahead to #R61357 61354 LD HL,61521 ; Load HL with 61521 (address of "Advance HL to next Display File Address to be drawn to (Apply ; Horizontal Mirror Flag set)" routine) *61357 LD (61416),HL ; Change destination for JP instruction at #R61415 to value in HL... 61360 POP HL ; Restore HL (address in Display File to print character) 61361 LD DE,(23447) ; Load DE with graphic data address ; This entry point is used by the routine at #R61390. *61365 LD A,(DE) ; Load A with a byte of graphic data 61366 OR A ; If data is zero... 61367 JR Z,61390 ; ...then read repeat counter value, x, and draw x rows of reset pixels 61369 CP 255 ; If data is 255... 61371 JR Z,61411 ; ...then read repeat counter value, x, and draw x rows of set pixels ; The three-byte instruction at #R61373 is modified by the instructions at #R61215, #R61238, #R61268 and #R61299. ; 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 } ; { #R61215 | None | NOP / NOP / NOP (do nothing) } ; { #R61238 | Apply Vertical | CALL #R61625 (Reverse the order of the bits in A) } ; { #R61268 | Apply Horizontal | NOP / NOP / NOP (do nothing) } ; { #R61299 | Both | CALL #R61625 (Reverse the order of the bits in A) } ; TABLE# 61373 CALL 61625 ; Reverse the order of the bits in A [This instruction is modified by the instructions at ; #R61215, #R61238, #R61268 and #R61299] 61376 CALL 61387 ; Load byte of graphic data in A into Display File address in HL 61379 INC DE ; Advance DE to next byte of graphic data 61380 CALL 61415 ; Advance HL to next location in Display File (up or down one pixel)... 61383 JP Z,61365 ; ...and if this new location is not outside dimensions of the graphic then loop back to ; #R61365 ; This entry point is used by the routine at #R61390. *61386 RET ; Return ; Load Contents of A into Memory Location Pointed to by HL ; ; Used by the routines at #R61336 and #R61390. Input: A A byte of (e.g. graphic) data HL An address (e.g. in ; Display File) c61387 NOP ; Do nothing (see trivia) 61388 LD (HL),A ; Load byte of graphic data into Display File address HL 61389 RET ; Return ; Read (From Graphic Data) Repeat Counter Value, x, and Draw x Rows of Reset Pixels ; ; Used by the routine at #R61336. Input: DE Current position in graphic data c61390 LD C,0 ; Set C to zero (all bits reset) ; This entry point is used by the routine at #R61411. *61392 INC DE ; Advance graphic data pointer 61393 LD A,(DE) ; Load next data byte (repeat counter) into A 61394 INC DE ; Advance graphic data pointer 61395 LD B,A ; Load B (repeat counter) with value in A *61396 LD A,C ; Load A with zero (i.e. all eight pixel bits reset) 61397 CALL 61387 ; Load byte of graphic data in A into Display File address in HL 61400 CALL 61415 ; Advance HL to next location in Display File (up or down one pixel)... 61403 JP NZ,61386 ; ...and if this new location is outside dimensions of the graphic then jump to #R61386 ; (return) 61406 DJNZ 61396 ; Decrease repeat counter and loop back to #R61396 if not zero 61408 JP 61365 ; Jump back to #R61365 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 #R61336. c61411 LD C,255 ; Load C with 255 (all bits set) 61413 JR 61392 ; 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 61416) depends upon whether or not the Apply Horizontal Mirror Flag is ; set. If the flag is set, then the jump destination is #R61521, otherwise, the jump destination is #R61418. Input: ; HL A Display File address c61415 JP 61418 ; 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 ; #R61493, drawing complete), otherwise zero F Zero Flag reset (if returning via #R61493, drawing complete) c61418 LD A,(23449) ; Increase Pixel Row Counter... 61421 INC A ; ... 61422 AND 7 ; ...and reset to zero if it exceeds 7... 61424 LD (23449),A ; ... 61427 JR Z,61432 ; 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 61429 INC H ; Increase Display File address by 256 bytes (i.e. move to next pixel row down) 61430 XOR A ; Set A to zero 61431 RET ; Return ; This next section advances HL to next character block to be drawn *61432 LD A,(23450) ; Load A with Horizontal and Vertical Mirror Flags 61435 AND 1 ; If Apply Vertical Mirror Flag is set... 61437 JP NZ,61494 ; ...then skip ahead to #R61494 61440 PUSH BC ; Store BC 61441 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 61444 INC A ; ...increase by one... 61445 LD B,A ; ...and load into B 61446 LD A,(23410) ; Load (x-coordinate + 1) of right of graphic being drawn into A 61449 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)... 61450 JR Z,61466 ; ...then jump to #R61466 61452 LD A,B ; Store increased x-coordinate at #R23444... 61453 LD (23444),A ; ... *61456 LD BC,(23444) ; Load BC with coordinates of new character block to draw 61460 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 61463 XOR A ; Set A to zero 61464 POP BC ; Restore BC 61465 RET ; Return ; This next section advances HL to next character row to be drawn *61466 LD A,(23408) ; Load A with x-coordinate of left of graphic to draw... *61469 LD (23444),A ; ...and set current x-coordinate to match 61472 LD A,(23445) ; Load current y-coordinate into C, increasing by one... 61475 INC A ; ... 61476 LD C,A ; ... 61477 LD A,(23411) ; Load (y-coordinate + 1) of bottom of graphic being drawn into A 61480 CP C ; If both y-coordinates are the same (i.e. we have moved beyond graphic's bottom edge)... 61481 JR Z,61489 ; ...then skip ahead to #R61489 61483 LD A,C ; Store increased y-coordinate at #R23445... 61484 LD (23445),A ; ... 61487 JR 61456 ; 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 #R61521. *61489 LD A,1 ; Load A with 1 61491 OR A ; Reset Zero Flag 61492 POP BC ; Restore BC 61493 RET ; Return ; This next section advances HL to next character block to be drawn where the Apply Vertical Mirror Flag is set *61494 PUSH BC ; Store BC 61495 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 61498 DEC A ; ...decrease by one... 61499 LD B,A ; ...and load into B 61500 LD A,(23408) ; Load x-coordinate of left of graphic being drawn into A... 61503 DEC A ; ...and decrease by one 61504 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)... 61505 JR Z,61514 ; ...then jump to #R61514 61507 LD A,B ; Store decreased x-coordinate at #R23444... 61508 LD (23444),A ; ... 61511 JP 61456 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return *61514 LD A,(23410) ; Load x-coordinate of right of graphic being drawn into A... 61517 DEC A ; ... 61518 JP 61469 ; 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 ; #R61493, drawing complete), otherwise zero F Zero Flag reset (if returning via #R61493, drawing complete) c61521 LD A,(23449) ; Increase Pixel Row Counter... 61524 DEC A ; ... 61525 AND 7 ; ...and reset to 7 if it falls below zero... 61527 LD (23449),A ; ... 61530 CP 7 ; If new value of Pixel Row Counter is 7 (i.e. we have rolled over to a new character block)... 61532 JR Z,61537 ; ...then advance HL to next character block to be drawn and return 61534 DEC H ; Decrease Display File address by 256 bytes (i.e. move to next pixel row up) 61535 XOR A ; Set A to zero 61536 RET ; Return ; This next section advances HL to next character block to be drawn *61537 LD A,(23450) ; Load A with Horizontal and Vertical Mirror Flags 61540 AND 1 ; If Apply Vertical Mirror Flag is set... 61542 JP NZ,61598 ; ...then skip ahead to #R61598 61545 PUSH BC ; Store BC 61546 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 61549 INC A ; ...increase by one... 61550 LD B,A ; ...and load into B 61551 LD A,(23410) ; Load (x-coordinate + 1) of right of graphic being drawn into A 61554 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)... 61555 JR Z,61575 ; ...then jump to #R61575 61557 LD A,B ; Store increased x-coordinate at #R23444... 61558 LD (23444),A ; ... *61561 LD BC,(23444) ; Load BC with coordinates of new character block to draw 61565 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 61568 LD A,7 ; Advance HL down seven pixel rows to bottom of character block... 61570 ADD A,H ; ... 61571 LD H,A ; ... 61572 XOR A ; Set A to zero 61573 POP BC ; Restore BC 61574 RET ; Return ; This next section advances HL to next character row to be drawn *61575 LD A,(23408) ; Load A with x-coordinate of left of graphic to draw... *61578 LD (23444),A ; ...and set current x-coordinate to match 61581 LD A,(23445) ; Load current y-coordinate into C, decreasing by one... 61584 DEC A ; ... 61585 LD C,A ; ... 61586 LD A,(23409) ; Load y-coordinate of top of graphic being drawn into A 61589 CP C ; If both y-coordinates are the same (i.e. we have moved beyond graphic's top edge)... 61590 JR Z,61489 ; ...then jump to #R61489 (load A with 1, reset Zero Flag and return) 61592 LD A,C ; Store increased y-coordinate at #R23445... 61593 LD (23445),A ; ... 61596 JR 61561 ; 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 *61598 PUSH BC ; Store BC 61599 LD A,(23444) ; Load x-coordinate of character block currently being drawn into A... 61602 DEC A ; ...decrease by one... 61603 LD B,A ; ...and load into B 61604 LD A,(23408) ; Load x-coordinate of left of graphic being drawn into A... 61607 DEC A ; ...and decrease by one 61608 CP B ; If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)... 61609 JR Z,61618 ; ...then jump to #R61618 61611 LD A,B ; Store decreased x-coordinate at #R23444... 61612 LD (23444),A ; ... 61615 JP 61561 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL then return *61618 LD A,(23410) ; Load x-coordinate of right of graphic being drawn into A... 61621 DEC A ; ... 61622 JP 61578 ; 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 c61625 PUSH BC ; Store BC 61626 LD B,8 ; Load B with 8 (eight bits) 61628 LD C,0 ; Load C with zero *61630 RRA ; Shift bit right out of A and into Carry Flag 61631 RL C ; Shift bit left out of Carry Flag and into C 61633 DJNZ 61630 ; Loop back to #R61630 for next bit 61635 LD A,C ; Load modified bitmap back into A 61636 POP BC ; Restore BC 61637 RET ; Return ; Store Background Bitmap Data at Magic Knight's Current Location ; ; Used by the routine at #R61860. c61638 LD DE,24576 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location 61641 LD A,(24841) ; Load HL with double Magic Knight's current y-coordinate (pixels)... 61644 LD L,A ; ... 61645 LD H,0 ; ... 61647 ADD HL,HL ; ... 61648 LD BC,65140 ; Point BC at Table of Display File Addresses of Start of Each Pixel Row 61651 ADD HL,BC ; Add double y-coordinate as offset in HL 61652 LD (23412),HL ; Store pointer to entry for pixel row at Magic Knight's current y-coordinate 61655 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 61658 RRCA ; Divide by two 61659 PUSH AF ; Store AF (A = Magic Knight's current x-coordinate in pixels, divided by two) 61660 AND 3 ; Clear all but the lowest three bits... 61662 LD (24843),A ; ...and store the remaining value as Magic Knight's current frame index 61665 POP AF ; Restore AF (A = Magic Knight's current x-coordinate in pixels, divided by two) 61666 RRCA ; Divide Magic Knight's current x-coordinate in pixels by eight and remove remainder... 61667 RRCA ; ... 61668 AND 31 ; ... 61670 LD (23414),A ; Store value (Magic Knight's current x-coordinate in characters) at #R23414... 61673 LD C,A ; ...and load into C 61674 LD B,32 ; Load B with 32 (as Magic Knight is 32 pixels tall) 61676 LD IX,(23412) ; Load IX with pointer to entry for pixel row at Magic Knight's current y-coordinate *61680 PUSH BC ; Store BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 61681 LD L,(IX+0) ; Load Display File address of pixel row at IX into HL... 61684 INC IX ; ...and advance IX to entry for next pixel row down... 61686 LD H,(IX+0) ; ... 61689 INC IX ; ... 61691 LD B,0 ; Set B to zero (BC = Magic Knight's current x-coordinate in characters) 61693 ADD HL,BC ; Add BC to HL as offset 61694 LD A,(HL) ; Copy three bytes of graphic data from Display File address... 61695 LD (DE),A ; ...into Table of Background Bitmap Data... 61696 INC HL ; ...as Magic Knight can only occupy three consecutive character blocks horizontally... 61697 INC DE ; ... 61698 LD A,(HL) ; ... 61699 LD (DE),A ; ... 61700 INC HL ; ... 61701 INC DE ; ... 61702 LD A,(HL) ; ... 61703 LD (DE),A ; ... 61704 INC DE ; ... 61705 POP BC ; Restore BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 61706 DJNZ 61680 ; Decrease B (remaining number of pixel rows to store) and loop back to #R61680 if non-zero for ; next pixel row 61708 LD HL,24576 ; Copy contents of Table of Bitmap Data for Magic Knight at his Current Location to Table of ; Background Bitmap Data #R24672... 61711 LD DE,24672 ; ... 61714 LD BC,96 ; ... 61717 LDIR ; ... 61719 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 #R61860. c61720 LD A,(24843) ; Load Magic Knight's current frame index into A... 61723 LD B,A ; ...multiply by 48... 61724 ADD A,A ; ... 61725 ADD A,B ; ... 61726 ADD A,A ; ... 61727 ADD A,A ; ... 61728 ADD A,A ; ... 61729 ADD A,A ; ... 61730 LD L,A ; ...load into HL... 61731 LD H,0 ; ... 61733 ADD HL,HL ; ...and double again to give 96 times original value, as graphic data for MK's frames are 96 ; bytes each 61734 LD A,(23417) ; If Magic Knight Facing Left Flag is reset... 61737 OR A ; ... 61738 JR Z,61744 ; ...then skip ahead to #R61744 61740 LD BC,384 ; Advance HL by 384 bytes... 61743 ADD HL,BC ; ...i.e. prepare to use left-facing graphic data, rather than right-facing... *61744 PUSH HL ; Copy value in HL to IX... 61745 POP IX ; ... 61747 LD DE,26968 ; Point DE at start of graphic data for Magic Knight facing right, frame 1 (mask) 61750 ADD HL,DE ; Add HL as offset in HL (HL now points to start of graphic data for Magic Knight's current ; frame mask) 61751 LD DE,26200 ; Point DE at start of graphic data for Magic Knight facing right, frame 1 61754 ADD IX,DE ; Add IX as offset in IX (IX now points to start of graphic data for Magic Knight's current ; frame) 61756 LD DE,24576 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location 61759 LD B,96 ; Load B with 96, as Magic Knight's bitmap graphic data is 96 bytes per frame *61761 LD A,(DE) ; Load current background bitmap byte into A 61762 AND (HL) ; Apply mask to bitmap data 61763 OR (IX+0) ; Overlay Magic Knight bitmap graphic data 61766 LD (DE),A ; Store result back into Table of Background Bitmap Data 61767 INC HL ; Advance HL to next byte in Magic Knight mask bitmap data 61768 INC DE ; Advance DE to next byte in background graphic bitmap data 61769 INC IX ; Advance IX to next byte in Magic Knight graphic bitmap data 61771 DJNZ 61761 ; Decrease B (remaining number of bytes to process) and loop back to #R61761 61773 RET ; Return ; Draw Bitmap Data for Magic Knight Overlaid on Background to Display File ; ; Used by the routine at #R61860. Input: DE (Entry at #R61777 only) Address of Table of Background Bitmap Data ; (#R24672) c61774 LD DE,24576 ; Point DE at Table of Bitmap Data for Magic Knight at his Current Location ; This entry point is used by the routines at #R39553 and #R61823. *61777 LD IX,(23412) ; Load IX with pointer to entry in Table of Display File Addresses for pixel row at Magic ; Knight's current y-coordinate 61781 LD A,(23414) ; Load C with Magic Knight's current x-coordinate (characters)... 61784 LD C,A ; ... 61785 LD B,32 ; Load B with 32 (as Magic Knight is 32 pixels tall) *61787 PUSH BC ; Store BC (B = remaining number of pixel rows to draw, C = MK's x-coordinate in characters) 61788 LD L,(IX+0) ; Load Display File address of pixel row at IX into HL... 61791 INC IX ; ...and advance IX to entry for next pixel row down... 61793 LD H,(IX+0) ; ... 61796 INC IX ; ... 61798 LD B,0 ; Set B to zero (BC = Magic Knight's current x-coordinate in characters) 61800 ADD HL,BC ; Add BC to HL as offset 61801 LD A,(DE) ; Copy three bytes of graphic data from Table of Bitmap Data for Magic Knight at his Current ; Location... 61802 LD (HL),A ; ...into Display File... 61803 INC HL ; ...as Magic Knight can only occupy three consecutive character blocks horizontally... 61804 INC DE ; ... 61805 LD A,(DE) ; ... 61806 LD (HL),A ; ... 61807 INC HL ; ... 61808 INC DE ; ... 61809 LD A,(DE) ; ... 61810 LD (HL),A ; ... 61811 INC DE ; ... 61812 POP BC ; Restore BC (B = remaining number of pixel rows to store, C = MK's x-coordinate in characters) 61813 DJNZ 61787 ; Decrease B (remaining number of pixel rows to draw) and loop back to #R61787 if non-zero for ; next pixel row 61815 RET ; Return ; Set Redraw Magic Knight On Next Interrupt Flag and Wait for Interrupt ; ; Used by the routines at #R38205, #R38434, #R40527 and #R40546. c61816 LD A,1 ; Set Redraw Magic Knight On Next Interrupt Flag... 61818 LD (23441),A ; ... 61821 HALT ; Wait for interrupt (i.e. redraw Magic Knight, etc.) 61822 RET ; Return ; Erase Magic Knight from Display, Advance his Current Position then Redraw ; ; Used by the routine at #R62178. c61823 PUSH IX ; Store IX 61825 CALL 46784 ; Draw axe(s) to screen if Magic Knight is in an axe room 61828 LD DE,24672 ; Point DE at Table of Background Bitmap Data 61831 CALL 61777 ; Restore background bitmap data (i.e. remove Magic Knight bitmap data from display) 61834 LD A,(23706) ; If Player Attribute Update Flag is set... 61837 OR A ; ... 61838 CALL NZ,62003 ; ...then restore background attribute data at Magic Knight's current location 61841 POP IX ; Restore IX 61843 LD HL,24840 ; Point HL at Magic Knight's current x-coordinate 61846 LD A,(24844) ; Load A with Magic Knight's current x-velocity... 61849 ADD A,(HL) ; ...and add to this Magic Knight's current x-coordinate 61850 LD (HL),A ; Set this as Magic Knight's new x-coordinate 61851 INC HL ; Advance HL to Magic Knight's y-coordinate 61852 LD A,(24845) ; Load A with Magic Knight's current y-velocity... 61855 ADD A,(HL) ; ...and add to this Magic Knight's current y-coordinate 61856 LD (HL),A ; Set this as Magic Knight's new y-coordinate 61857 XOR A ; Load A with 0 (prepare to reset Do Not Draw Axes Flag) 61858 JR 61866 ; Store background attributes if appropriate, then draw Magic Knight (and axes if appropriate) ; to display, then return ; Store Background Attributes if Appropriate, then Draw Magic Knight to Display Without Drawing Axes ; ; Used by the routines at #R39393, #R39553 and #R44253. Input: A (Entry at #R61866 only) Value for Do Not Draw ; Axes Flag c61860 XOR A ; Reset Redraw Magic Knight On Next Interrupt Flag... 61861 LD (23441),A ; ... 61864 LD A,1 ; Load A with 1 (prepare to set Do Not Draw Axes Flag) ; This entry point is used by the routine at #R61823. *61866 PUSH IX ; Store IX 61868 LD (23437),A ; (Re)set Do Not Draw Axes Flag to value in A 61871 LD A,(23706) ; If Player Attribute Update Flag is set (Player Attribute Update mode)... 61874 OR A ; ... 61875 CALL NZ,61913 ; ...then store background attribute data at Magic Knight's current location 61878 CALL 61638 ; Store background bitmap data at Magic Knight's current location 61881 CALL 61720 ; Overlay graphic data for MK's current frame on Table of Bitmap Data for MK at his Current ; Location 61884 CALL 61774 ; Draw bitmap data for Magic Knight overlaid on background to Display File 61887 LD A,(23437) ; If Do Not Draw Axes Flag is reset... 61890 OR A ; ... 61891 CALL Z,46784 ; ...then draw axe(s) to screen if Magic Knight is in an axe room 61894 LD A,(23414) ; Store Magic Knight's current x-coordinate (characters) at #R23415... 61897 LD (23415),A ; ... 61900 LD A,(24841) ; Store Magic Knight's current y-coordinate (pixels) at #R23416... 61903 LD (23416),A ; ... 61906 POP IX ; Restore IX 61908 XOR A ; Reset Redraw Magic Knight On Next Interrupt Flag... 61909 LD (23441),A ; ... 61912 RET ; Return ; Store Background Attribute Data at Magic Knight's Current Location ; ; Used by the routine at #R61860. c61913 LD DE,25048 ; Point DE at Table of Background Attribute data 61916 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 61919 AND 248 ; Clear lowest three bits to round down to nearest multiple of 8 61921 LD L,A ; Load this value into HL... 61922 LD H,0 ; ... 61924 ADD HL,HL ; Multiply by four to obtain 32 x y-coordinate (characters)... 61925 ADD HL,HL ; ... 61926 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 61929 RRCA ; Divide this by eight, rounding down to nearest integer... 61930 RRCA ; ...to convert from pixels to characters... 61931 RRCA ; ... 61932 AND 31 ; ... 61934 LD C,A ; Load x-coordinate (characters) into BC... 61935 LD B,0 ; ... 61937 ADD HL,BC ; Add x-coordinate to 32 x y-coordinate in HL 61938 PUSH HL ; Store HL (32 x y-coordinate in characters) 61939 LD BC,22528 ; Add this to start address of Attribute File... 61942 ADD HL,BC ; ...so that HL points to required byte in Attribute File 61943 EX (SP),HL ; Put Attribute File address on top of stack and load HL with 32 x y-coordinate 61944 LD BC,23808 ; Point BC at start of Terrain Interaction Data Table... 61947 ADD HL,BC ; ...and add 32 x y-coordinate as offset in HL 61948 EX (SP),HL ; Restore Attribute File address to HL... 61949 POP IX ; ...and load IX with Terrain Interaction address 61951 LD A,(24846) ; Load C with Magic Knight's attribute... 61954 LD C,A ; ... 61955 LD B,4 ; Load B with 4 as Magic Knight is four characters tall *61957 PUSH BC ; Store BC (B = remaining number of character rows) 61958 LD A,(HL) ; Copy byte from Attribute File... 61959 LD (DE),A ; ...into Table of Background Attribute Data 61960 BIT 5,(IX+0) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 61964 JR NZ,61967 ; ...then skip ahead to #R61967 61966 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *61967 INC HL ; Advance current position in Attribute File 61968 INC DE ; Advance current position in Table of Background Attribute Data 61969 LD A,(HL) ; Copy byte from Attribute File... 61970 LD (DE),A ; ...into Table of Background Attribute Data 61971 BIT 5,(IX+1) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 61975 JR NZ,61978 ; ...then skip ahead to #R61978 61977 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *61978 INC HL ; Advance current position in Attribute File 61979 INC DE ; Advance current position in Table of Background Attribute Data 61980 LD A,(HL) ; Copy byte from Attribute File... 61981 LD (DE),A ; ...into Table of Background Attribute Data 61982 BIT 5,(IX+2) ; If Preserve Attribute Terrain Interaction Flag is set for this character... 61986 JR NZ,61989 ; ...then skip ahead to #R61989 61988 LD (HL),C ; Set current Attribute File byte to match Magic Knight's attribute *61989 INC DE ; Advance current position in Table of Background Attribute Data 61990 LD BC,30 ; Advance current position in Attribute File by 30 bytes... 61993 ADD HL,BC ; ...i.e. down one character and left two characters 61994 LD BC,32 ; Advance current position in Terrain Interaction Data Table by 32 bytes... 61997 ADD IX,BC ; ...i.e. down one character 61999 POP BC ; Restore BC (B = remaining number of character rows) 62000 DJNZ 61957 ; If character rows remain then loop back to #R61957 62002 RET ; Return ; Restore Background Attribute Data at Magic Knight's Current Location ; ; Used by the routines at #R39553 and #R61823. c62003 LD DE,25048 ; Point DE at Table of Background Attribute Data 62006 LD A,(24841) ; Load A with Magic Knight's current y-coordinate (pixels) 62009 AND 248 ; Clear lowest three bits to round down to nearest multiple of 8 62011 LD L,A ; Load this value into HL... 62012 LD H,0 ; ... 62014 ADD HL,HL ; Multiply by four to obtain 32 x y-coordinate (characters)... 62015 ADD HL,HL ; ... 62016 LD A,(24840) ; Load A with Magic Knight's current x-coordinate (pixels) 62019 RRCA ; Divide this by eight, rounding down to nearest integer... 62020 RRCA ; ...to convert from pixels to characters... 62021 RRCA ; ... 62022 AND 31 ; ... 62024 LD C,A ; Load x-coordinate (characters) into BC... 62025 LD B,0 ; ... 62027 ADD HL,BC ; Add x-coordinate to 32 x y-coordinate in HL... 62028 LD BC,22528 ; ...then add this to start address of Attribute File... 62031 ADD HL,BC ; ...so that HL points to required byte in Attribute File 62032 LD B,4 ; Load B with 4 as Magic Knight is four characters tall *62034 PUSH BC ; Store BC (B = remaining number of character rows) 62035 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 62036 LD (HL),A ; ...into Attribute File 62037 INC HL ; Advance current position in Attribute File 62038 INC DE ; Advance current position in Table of Background Attribute Data 62039 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 62040 LD (HL),A ; ...into Attribute File 62041 INC HL ; Advance current position in Attribute File 62042 INC DE ; Advance current position in Table of Background Attribute Data 62043 LD A,(DE) ; Copy byte from Table of Background Attribute Data... 62044 LD (HL),A ; ...into Attribute File 62045 INC DE ; Advance current position in Table of Background Attribute Data 62046 LD BC,30 ; Advance current position in Attribute File by 30 bytes... 62049 ADD HL,BC ; ...i.e. down one character and left two characters 62050 POP BC ; Restore BC (B = remaining number of character rows) 62051 DJNZ 62034 ; If character rows to be coloured remain then loop back to #R62034 62053 RET ; Return ; Table of Start Addresses of Input Device Reading Routines b62054 DEFW 64042 ; Address of keyboard reading routine 62056 DEFW 64091 ; Address of Kempston Joystick reading routine 62058 DEFW 64122 ; Address of Cursor Joystick reading routine 62060 DEFW 64159 ; Address of Sinclair Joystick 1 reading routine ; Powers of Ten (Used by Routine at 47797) for Converting Numbers to ASCII String b62062 DEFW 10000 62064 DEFW 1000 62066 DEFW 100 62068 DEFW 10 62070 DEFW 1 ; Addresses of Room-Specific Routines b62072 DEFW 40172 ; (00) - Do Nothing - Limbo 62074 DEFW 40172 ; (01) - Do Nothing - Outdoors, 0 (Bearwoolf's Hoard) 62076 DEFW 40489 ; (02) - Display Cave Progress and Set Magic Knight's x-Velocity to 2 if at Floor Level - ; Outdoors, 1 (Bearwoolf's Cave) 62078 DEFW 40598 ; (03) - Kill Magic Knight if he is Too Close to Bearwoolf - Outdoors, 2 (Beware Bearwoolf) 62080 DEFW 40172 ; (04) - Do Nothing - Outdoors, 3 (The Spooky Forest, 1) 62082 DEFW 40172 ; (05) - Do Nothing - Outdoors, 4 62084 DEFW 40172 ; (06) - Do Nothing - Outdoors, 5 (The Spooky Forest, 2) 62086 DEFW 40172 ; (07) - Do Nothing - Outdoors, 6 (The Sword in the Concrete) 62088 DEFW 40172 ; (08) - Do Nothing - Outdoors, 7 (Robin's Little Hut) 62090 DEFW 40172 ; (09) - Do Nothing - Outdoors, 8 (Exit from Limbo) 62092 DEFW 40172 ; (10) - Do Nothing - Outdoors, 9 (More Spooky Forest) 62094 DEFW 40172 ; (11) - Do Nothing - Outdoors, 10 (Entwood) 62096 DEFW 40172 ; (12) - Do Nothing - Outdoors, 11 (The Spooky Forest, 3) 62098 DEFW 40172 ; (13) - Do Nothing - Outdoors, 12 (The Spooky Forest, 4) 62100 DEFW 40338 ; (14) - Check for Egg Dropped down Wishing Well and Set Wish Pending Flag and Display Message ; If Appropriate - Outdoors, 13 (Wishing Well) 62102 DEFW 40172 ; (15) - Do Nothing - Outdoors, 14 62104 DEFW 40614 ; (16) - Enable / Disable Entry to Castle Depending Upon Disquise Worn and Whether Newspaper is ; Held - Outdoors, 15 (The Castle Entrance) 62106 DEFW 40235 ; (17) - Update Position of 1 Axe and Display - Castle Ground Floor, 0 (One Axe Room) 62108 DEFW 40235 ; (18) - Update Position of 1 Axe and Display - Castle Ground Floor, 1 (Indoor Bowling Green) 62110 DEFW 40235 ; (19) - Update Position of 1 Axe and Display - Castle Ground Floor, 2 62112 DEFW 40235 ; (20) - Update Position of 1 Axe and Display - Castle Ground Floor, 3 62114 DEFW 40239 ; (21) - Update Positions of 4 Axes and Display - Castle Ground Floor, 4 (More Axe Problems) 62116 DEFW 40239 ; (22) - Update Positions of 4 Axes and Display - Castle Ground Floor, 5 (Even More Axes) 62118 DEFW 40549 ; (23) - Moving Magic Knight Up a Room if Appropriate and Boost Jumps if Wearing Power Boots - ; Castle Ground Floor, 6 (The First Jump Chute) 62120 DEFW 40172 ; (24) - Do Nothing - Castle First Floor, 0 (Main Lever 7) 62122 DEFW 40172 ; (25) - Do Nothing - Castle First Floor, 1 (Main Lever 6) 62124 DEFW 40172 ; (26) - Do Nothing - Castle First Floor, 2 (Security Door & Main Lever 5) 62126 DEFW 40523 ; (27) - Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 - Castle First Floor, 3 ; (Main Lever 4) 62128 DEFW 40172 ; (28) - Do Nothing - Castle First Floor, 4 (Main Lever 3) 62130 DEFW 40258 ; (29) - Kill Magic Knight if he is in a Dark Room Without Illumination - Castle First Floor, 5 ; (Main Lever 2) 62132 DEFW 40546 ; (30) - Move Magic Knight Up or Down a Room if Appropriate and Boost Jumps if Wearing Power ; Boots - Castle First Floor, 6 (Main Lever 1) 62134 DEFW 40172 ; (31) - Do Nothing - Castle Second Floor, 0 (The Broken Teleport) 62136 DEFW 40172 ; (32) - Do Nothing - Castle Second Floor, 1 (Terrible Twins) 62138 DEFW 40172 ; (33) - Do Nothing - Castle Second Floor, 2 (The Guardian Statues) 62140 DEFW 40523 ; (34) - Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 - Castle Second Floor, 3 ; (One Way Corridor, 1) 62142 DEFW 40523 ; (35) - Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 - Castle Second Floor, 4 ; (One Way Corridor, 2) 62144 DEFW 40523 ; (36) - Set Magic Knight's x-Velocity to 2 if his y-Coordinate is 136 - Castle Second Floor, 5 ; (One Way Corridor, 3) 62146 DEFW 40546 ; (37) - Move Magic Knight Up or Down a Room if Appropriate and Boost Jumps if Wearing Power ; Boots - Castle Second Floor, 6 62148 DEFW 40406 ; (38) - Move Magic Knight Down a Room if Appropriate - Castle Third Floor, 0 (Big White ; Statue) 62150 DEFW 40172 ; (39) - Do Nothing - Castle Third Floor, 1 62152 DEFW 40437 ; (40) - Move Magic Knight Between Teleport Rooms if Appropriate - Castle Third Floor, 2 ; (Teleport Room, 1) 62154 DEFW 40527 ; (41) - Set Magic Knight's x-Velocity to -2 if his y-Coordinate is 136 - Castle Third Floor, 3 ; (One Way Corridor, 4) 62156 DEFW 40527 ; (42) - Set Magic Knight's x-Velocity to -2 if his y-Coordinate is 136 - Castle Third Floor, 4 ; (One Way Corridor, 5) 62158 DEFW 40527 ; (43) - Set Magic Knight's x-Velocity to -2 if his y-Coordinate is 136 - Castle Third Floor, 5 ; (One Way Corridor, 6) 62160 DEFW 40406 ; (44) - Move Magic Knight Down a Room if Appropriate - Castle Third Floor, 6 62162 DEFW 40172 ; (45) - Do Nothing - Spaceship, 0 (The Control Room) 62164 DEFW 40172 ; (46) - Do Nothing - Spaceship, 1 (Many Screened Room) 62166 DEFW 40437 ; (47) - Move Magic Knight Between Teleport Rooms if Appropriate - Spaceship, 2 (Teleport Room, ; 2) 62168 DEFW 40172 ; (48) - Do Nothing - Spaceship, 3 62170 DEFW 40201 ; (49) - Decrease Magic Knight's Strength by One Once Every Four Frames - Spaceship, 4 (The ; Power Plant) 62172 DEFW 40172 ; (50) - Do Nothing - Spaceship, 5 62174 DEFW 40172 ; (51) - Do Nothing - Spaceship, 6 62176 DEFW 40172 ; (52) - Do Nothing - Unused (see trivia) ; Call Time-Dependent Routines [Main Interrupt Routine] ; ; Used by the routine at #R65524. c62178 CALL 62959 ; Store all registers on the stack 62181 BIT 0,(IY+65) ; If Game In Progress Flag is reset... (IY = 23610) 62185 JP Z,62288 ; ...then skip ahead to #R62288 62188 CALL 64687 ; If Do Not Draw Storm Cloud Flag is reset then draw Storm Cloud 62191 LD A,(23441) ; If Redraw Magic Knight On Next Interrupt Flag is set... 62194 OR A ; ... 62195 CALL NZ,61823 ; ...then erase Magic Knight from display, advance his current position then redraw 62198 CALL 62330 ; Update game time, time left and move characters if appropriate 62201 LD A,(23403) ; Load B with MSB of Off-White Knight Sent To Sleep Flag... 62204 AND 128 ; ... 62206 LD B,A ; ... 62207 LD A,(24782) ; Set Off-White Knight's Asleep Flag... 62210 OR B ; ...if MSB of Off-White Knight Sent To Sleep Flag is set... 62211 LD (24782),A ; ... ; The instructions between #R62214 and #R62252 (inclusive) are not used in the 48k version of Stormbringer. These ; instructions relate to the LOCATE A CHARACTER functionality that is present in the 128k version of Stormbringer - ; see trivia 62214 LD BC,(23471) ; Load x- & y- coordinate of top-left character of currently glowing "Locate Compass" component ; into BC 62218 LD A,B ; If this is zero (i.e. compass not glowing because Magic Knight isn't "locating")... 62219 OR C ; ... 62220 JR Z,62255 ; ...then skip ahead to #R62255 62222 LD A,(23436) ; Load "Compass Glow Update Flag" into A 62225 INC A ; Invert Compass Glow Update Flag 62226 AND 1 ; Store back at #R23436 and if Compass Glow Update Flag is set... 62228 LD (23436),A ; ... 62231 JR NZ,62255 ; ...then skip over glow attribute update section to #R62255 (don't update glowing attributes ; this time) 62233 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B) 62236 CALL 62317 ; Update glowing blocks' attribute to next colour in sequence and load into E 62239 CALL 62310 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 62242 CALL 62310 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 62245 LD BC,30 ; Advance Attribute File address (HL) down to next row, to the block immediately below the ; first one updated at instruction #R62239... 62248 ADD HL,BC ; ... 62249 CALL 62310 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 62252 CALL 62310 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL *62255 BIT 1,(IY+65) ; If "Disable In-Game Glow" flag is set... 62259 JP NZ,62302 ; ...then skip to end of interrupt routine 62262 LD IX,23368 ; Point IX at Table of Glowing Attribute File Addresses 62266 CALL 62317 ; Update glowing blocks' attribute to next colour in sequence and load into E *62269 LD L,(IX+0) ; Load a glowing Attribute File address into HL... 62272 LD H,(IX+1) ; ... 62275 LD A,L ; If HL is zero... 62276 OR H ; ... 62277 JR Z,62288 ; ...then jump to #R62288 (to exit loop) 62279 CALL 62310 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 62282 INC IX ; Advance to next Attribute File address in list of glowing blocks... 62284 INC IX ; ... 62286 JR 62269 ; Jump back to #R62269 to update next block *62288 LD HL,(23672) ; Load HL with current value in lowest two bytes of System Variable FRAMES... 62291 INC HL ; ...increase... 62292 LD (23672),HL ; ...and write back to memory 62295 LD A,H ; If lowest two bytes of FRAMES are not both zero... 62296 OR L ; ... 62297 JR NZ,62302 ; ...then skip ahead to #R62302 62299 INC (IY+64) ; Increase most significant byte of System Variable FRAMES (23674) *62302 CALL 703 ; Call ROM routine to read keyboard 62305 CALL 62987 ; Restore all registers from the Stack 62308 EI ; Enable interrupts 62309 RET ; Return ; Interrupt Routine Write Current Attribute for a Glowing Block to Attribute File ; ; Used by the routine at #R62178. Input: HL Attribute File address that is glowing E Current attribute of glowing ; blocks Output: HL Next Attribute File address on from that in HL on input c62310 LD A,(HL) ; Load current attribute of this memory location into A 62311 AND 248 ; Reset all INK bits 62313 OR E ; Set required INK bits for current colour 62314 LD (HL),A ; Write data to Attribute File to display the colour 62315 INC HL ; Advance to next Attribute File address 62316 RET ; Return ; Interrupt Routine Update Glowing Blocks' Attribute to Next Colour in Sequence ; ; Used by the routine at #R62178. Output: E New attribute of glowing blocks c62317 LD A,(23462) ; Load A with current INK colour of glowing blocks *62320 INC A ; Advance to next colour in sequence 62321 AND 7 ; Ensure that only INK attributes are used, rolling back over to zero (black) after seven ; (white) 62323 JR Z,62320 ; We don't want "black" light, so advance from zero (black) to one (blue) if black 62325 LD (23462),A ; Place updated attribute back in memory 62328 LD E,A ; Copy new attribute into E 62329 RET ; Return ; Update Game Time, Time Left and Move Characters if Appropriate ; ; Used by the routine at #R62178. c62330 LD A,(23460) ; If number of 1/50 seconds elapsed in current minute is zero (i.e. start of new second)... 62333 OR A ; ... 62334 CALL Z,62622 ; ...then move character whose turn it is to move, if allowed 62337 LD A,(23460) ; [EVERY 1/50 SECOND] Increase number of elapsed 1/50 seconds 62340 INC A ; ... 62341 LD (23460),A ; ... 62344 CP 50 ; If new value isn't 50... 62346 RET NZ ; ...then return 62347 XOR A ; [EVERY 1 SECOND] Else, set the value to zero (start of next full second)... 62348 LD (23460),A ; ... 62351 LD A,(23459) ; Increase number of seconds elapsed... 62354 INC A ; ... 62355 LD (23459),A ; ... 62358 CP 60 ; If new value isn't 60... 62360 RET NZ ; ...then return 62361 XOR A ; [EVERY 1 MINUTE] Else, set the value to zero (start of next minute)... 62362 LD (23459),A ; ... 62365 CALL 62476 ; Update All Characters' Stats (Deteriorate or Regenerate) and Wake Up / Send to Sleep if ; Required 62368 CALL 62431 ; Increase Magic Knight's current Magic Level by 10 (capped at 100) 62371 LD A,6 ; If Magic Knight is wearing the Magic Talisman (6)... 62373 CALL 45505 ; ... 62376 CALL Z,62428 ; ...then increase Magic Knight's current Magic Level by 20 (capped at 100) 62379 LD A,(23713) ; Increase index of current Crystal Ball substring... 62382 INC A ; ... 62383 AND 7 ; ...resetting to zero if above 7... 62385 LD (23713),A ; ... 62388 LD A,(23714) ; Increase index of current Scroll substring... 62391 INC A ; ... 62392 AND 7 ; ...resetting to zero if above 7... 62394 LD (23714),A ; ... 62397 CALL 62443 ; Make Chicken lay an egg if possible 62400 LD A,(23458) ; Increase number of minutes elapsed... 62403 INC A ; ... 62404 LD (23458),A ; ... 62407 CP 5 ; If new value isn't 5... 62409 RET NZ ; ...then return 62410 XOR A ; [EVERY 5 MINUTES] Else, set the value to zero (start of next "hour")... 62411 LD (23458),A ; ... 62414 LD A,(23457) ; Decrease number of hours left... 62417 DEC A ; ... 62418 LD (23457),A ; ... 62421 JP Z,62877 ; If zero then show "Out of time" game over message and return to Control Selection Menu 62424 CALL 47897 ; Play upward scale sound 62427 RET ; Return ; Increase Magic Knight's Current Magic Level by 20 (Up to Maximum of 100) ; ; Used by the routine at #R62330. c62428 CALL 62431 ; Increase Magic Knight's current magic level by 10 (up to maximum of 100) ; This entry point is used by the routine at #R62330. *62431 LD A,(24771) ; Load A with Magic Knight's current Magic Level 62434 LD C,10 ; Add 10 to this value, capping at 100... 62436 CALL 62594 ; ... 62439 LD (24771),A ; Store updated value for Magic Level 62442 RET ; Return ; Make Chicken Lay an Egg If Possible ; ; Used by the routine at #R62330. c62443 LD A,(24852) ; Load A with index of object in Magic Knight's fifth inventory slot (carrying)... 62446 OR A ; ...and if this is not zero (i.e. Magic Knight's hands are full)... 62447 RET NZ ; ...then return 62448 LD A,13 ; If Magic Knight is not carrying the Chicken... 62450 CALL 45510 ; ... 62453 RET NZ ; ...then return 62454 LD A,(23466) ; If index of next object to be laid by Chicken is 42... 62457 CP 42 ; ...i.e. no more eggs... 62459 RET Z ; ...then return 62460 LD A,(23466) ; Load C with index of next object to be laid by Chicken... 62463 LD C,A ; ... 62464 INC A ; Increase index of next object to be laid by Chicken... 62465 LD (23466),A ; ... 62468 LD B,5 ; Load B with 5 (as Magic Knight has five inventory slots) 62470 LD HL,24848 ; Load object in C into Magic Knight's first empty inventory (carrying) slot... 62473 JP 45381 ; ...and return ; Update All Characters' Stats (Deteriorate or Regenerate) and Wake Up / Send to Sleep if Required ; ; Used by the routine at #R62330. c62476 LD DE,8 ; Load DE with 8 (as data is 8 bytes long) 62479 LD HL,62895 ; Point HL at start of characters' Stat Regeneration Data Table 62482 LD IX,24776 ; Point IX at Off-White Knight's current stats (2nd entry in Characters' Current Stats Table, ; as first is Magic Knight's) 62486 LD B,8 ; Load B with 8 (8 characters) *62488 BIT 7,(IX+6) ; If current character is awake... 62492 JR Z,62498 ; ...then skip ahead to #R62498 62494 INC HL ; Advance HL by four bytes to stat deterioration data... 62495 INC HL ; ... 62496 INC HL ; ... 62497 INC HL ; ... *62498 LD C,(HL) ; Load stat change value into C 62499 LD A,(IX+0) ; Load current character's strength into A 62502 CALL 62594 ; Update character's strength as they tire (awake) or regenerate (asleep)... 62505 LD (IX+0),A ; ... 62508 INC HL ; Advance HL to next (happiness) data 62509 LD C,(HL) ; Load stat change value into C 62510 LD A,(IX+1) ; Load current character's happiness into A 62513 CALL 62594 ; Update character's happiness as they tire (awake) or regenerate (asleep)... 62516 LD (IX+1),A ; ... 62519 INC HL ; Advance HL to next (stamina) data 62520 LD C,(HL) ; Load stat change value into C 62521 LD A,(IX+2) ; Load current character's stamina into A 62524 CALL 62594 ; Update character's stamina as they tire (awake) or regenerate (asleep)... 62527 LD (IX+2),A ; ... 62530 INC HL ; Advance HL to next (magic level) data 62531 LD C,(HL) ; Load stat change value into C 62532 LD A,(IX+3) ; Load current character's magic level into A 62535 CALL 62594 ; Update character's magic level as they tire (awake) or regenerate (asleep)... 62538 LD (IX+3),A ; ... 62541 INC HL ; Advance HL to next block of data 62542 BIT 7,(IX+6) ; If current character is asleep... 62546 JR NZ,62552 ; ...then we have already moved into data for next character, so skip ahead to #R62552 62548 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... 62549 INC HL ; ... 62550 INC HL ; ... 62551 INC HL ; ... *62552 ADD IX,DE ; Advance IX by eight bytes to next character's stats 62554 DJNZ 62488 ; Loop back to 62488 62556 LD DE,8 ; Load DE with 8 62559 LD IX,24776 ; Point IX to Off-White Knight's current stats 62563 LD B,8 ; Load B with 8 (8 characters) 62565 LD C,0 ; Load C with zero (to denote first character, Off-White Knight) *62567 LD A,(IX+2) ; Load current character's stamina into A 62570 AND 127 ; If stamina (bits 0-6) is not zero... 62572 JR NZ,62580 ; ...then skip ahead to #R62580 62574 SET 7,(IX+6) ; Else send character to sleep 62578 JR 62588 ; Skip ahead to #R62588 *62580 CP 100 ; If stamina is not 100... 62582 JR NZ,62588 ; ...then skip ahead to #R62588 62584 RES 7,(IX+6) ; Else wake character up *62588 ADD IX,DE ; Advance IX to next character's stats 62590 INC C ; Increase C for next character 62591 DJNZ 62567 ; Loop back to #R62567 for next character 62593 RET ; Return ; Update Characters' Stats as They Tire (Awake) or Regenerate (Asleep) ; ; Used by the routines at #R45434, #R62428 and #R62476. 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 c62594 PUSH AF ; Store AF (A = value of character's stat) 62595 AND 128 ; Capture MSB in stat value and store in instruction at #R62619... 62597 LD (62620),A ; ... 62600 POP AF ; Restore AF (A = value of character's stat) 62601 AND 127 ; Discard MSB of stat value 62603 ADD A,C ; Add change value 62604 OR A ; Check Sign Flag 62605 JP P,62611 ; If sign flag reset (i.e. MSB of result is reset and result is positive) then jump ahead to ; #R62611 62608 XOR A ; else stat must have dropped below zero, so set stat to zero (as it can't be less than 0) 62609 JR 62619 ; Skip ahead to #R62619 *62611 CP 100 ; If new value of stat is less than or equal to 100... 62613 JR Z,62619 ; ...then skip ahead to #R62619... 62615 JR C,62619 ; ... 62617 LD A,100 ; ...else set stat to 100 (as it can't be greater than 100) ; The operand of the instruction at #R62619 represents bit 7 of the input value in A. This is modified by the ; instruction at #R62597. *62619 OR 0 ; Restore previously stored MSB state 62621 RET ; Return ; Move Character Whose Turn it is to Move, if Allowed ; ; Alternate characters move in opposite directions on alternate hours. Characters can only move if they are not in ; the same room as Magic Knight, or if the player is not currently controlling Magic Knight (i.e. navigating menus ; or failing to press FIRE when "PRESS FIRE TO CONTINUE" message is shown). c62622 BIT 2,(IY+65) ; If Characters Can't Move Flag is set... 62626 RET NZ ; ...then return 62627 CALL 62812 ; Update index of character whose turn it is to be updated and load into A 62630 LD E,6 ; Point HL at this character's flags... 62632 CALL 45406 ; ... 62635 LD A,(HL) ; ...and load flags into A 62636 AND 128 ; If character is asleep... 62638 RET NZ ; ...then return 62639 DEC HL ; Move HL back two bytes to character's Attribute... 62640 DEC HL ; ... 62641 LD A,(HL) ; ...and load attribute into A 62642 OR A ; If attribute is zero... 62643 RET Z ; ...then return 62644 LD A,(23455) ; Load BC with three times index of character whose turn it is to be updated... 62647 LD C,A ; ... 62648 ADD A,A ; ... 62649 ADD A,C ; ... 62650 LD C,A ; ... 62651 LD B,0 ; ... 62653 LD HL,24898 ; Point HL at start of Table of Characters' Current Positions at #R24898 62656 ADD HL,BC ; Add BC to HL as offset 62657 LD A,(23702) ; If Magic Knight is not in the same room as this character... 62660 CP (HL) ; ... 62661 JR NZ,62668 ; ...then skip ahead to #R62668 62663 BIT 1,(IY+65) ; If Characters Movement Unrestricted Flag is reset (IY = 23610)... 62667 RET Z ; ...then return *62668 LD A,(HL) ; If character's room is 100... 62669 CP 100 ; ... 62671 RET Z ; ...then return 62672 CP 99 ; If character's room is 99... 62674 JP Z,62853 ; ...then reset character to his / her initial position 62677 LD A,(23455) ; Load B with index of character whose turn it is to be updated... 62680 LD B,A ; ... 62681 LD A,(23457) ; Load A with number of hours left... 62684 ADD A,B ; ...and add index of character to be updated 62685 BIT 0,A ; If result is even... 62687 JP Z,62734 ; ...then skip ahead to #R62734 ; Move character left 62690 LD A,(HL) ; Load A with character's current room 62691 PUSH HL ; Store HL (pointer to character's current room) 62692 LD HL,48913 ; Set movement restriction data base address to #R48915 (one room to the left)... 62695 LD (62785),HL ; ...and load address into instruction at #R62784 62698 LD HL,48811 ; Point HL to left exit value of first entry in Room Connectivity Data Table 62701 CALL 62778 ; Get index of destination room for character and load into A 62704 LD (62723),A ; Load value into instruction at #R62722 62707 POP HL ; Restore HL (pointer to character's current room) 62708 INC HL ; Advance HL to character's x-coordinate 62709 LD A,(HL) ; Load x-coordinate into A... 62710 CP 2 ; ...and if this is 2... 62712 JR Z,62722 ; ...then skip ahead to #R62722 62714 DEC A ; Decrease x-coordinate by two... 62715 DEC A ; ... 62716 CALL 62827 ; Set this as character's new x-coordinate if value is allowed, otherwise return 62719 CP 2 ; If character's x-coordinate is not 2... 62721 RET NZ ; ...then return ; The operand of the instruction at #R62722 represents the character's destination room when moving left. This is ; modified by the instructions at #R62704. *62722 LD A,0 ; Load B with character's destination room... 62724 LD B,A ; ... 62725 CP 255 ; ...and if this is 255 (i.e. no room available)... 62727 RET Z ; ...then return 62728 LD A,28 ; Set character's x-coordinate to 28 (right-hand side of new room)... 62730 LD (HL),A ; ... 62731 DEC HL ; Move HL back to character's room 62732 LD (HL),B ; Set current room to new room index 62733 RET ; Return ; Move character right *62734 LD A,(HL) ; Load A with character's current room 62735 PUSH HL ; Store HL (pointer to character's current room) 62736 LD HL,48917 ; Set movement restriction data base address to #R48915 (one room to the right)... 62739 LD (62785),HL ; ...and load address into instruction at #R62784 62742 LD HL,48812 ; Point HL to right exit value of first entry in Room Connectivity Data Table 62745 CALL 62778 ; Get index of destination room for character and load into A 62748 LD (62767),A ; Load value into instruction at #R62766 62751 POP HL ; Restore HL (pointer to character's current room) 62752 INC HL ; Advance HL to character's x-coordinate 62753 LD A,(HL) ; Load x-coordinate into A... 62754 CP 28 ; ...and if this is 28... 62756 JR Z,62766 ; ...then skip ahead to #R62766 62758 INC A ; Increase x-coordinate by two... 62759 INC A ; ... 62760 CALL 62827 ; Set this as character's new x-coordinate if value is allowed, otherwise return 62763 CP 28 ; If character's x-coordinate is not 28... 62765 RET NZ ; ...then return ; The operand of the instruction at #R62766 represents the character's destination room when moving right. This is ; modified by the instructions at #R62748. *62766 LD A,0 ; Load B with character's destination room... 62768 LD B,A ; ... 62769 CP 255 ; ...and if this is 255 (i.e. no room available)... 62771 RET Z ; ...then return 62772 LD A,2 ; Set character's x-coordinate to 2 (left-hand side of new room)... 62774 LD (HL),A ; ... 62775 DEC HL ; Move HL back to character's room 62776 LD (HL),B ; Set current room to new room index 62777 RET ; Return ; Get Index of Destination Room for a Character and Load into A ; ; Used by the routine at #R62622. Input: A A room index HL Points to one of the two bytes of the first entry of ; the Room Connectivity Data Table at #R48811 Output: A New room index c62778 ADD A,A ; Load double room index into BC... 62779 LD C,A ; ... 62780 LD B,0 ; ... 62782 ADD HL,BC ; Add BC to HL as offset 62783 PUSH HL ; Store HL (pointer to room's left or right exit data) ; The operand of the instruction at #R62784 represents the base address of the movement restriction data (table at ; #R48915), and may be #R48915 (when character tries to move one room to the left) or #R48915 (when character tries ; to move one room to the right). This is modified by the instructions at #R62695 and #R62739. 62784 LD HL,0 ; Load HL with base address of movement restriction data 62787 ADD HL,BC ; Add BC to HL as offset 62788 LD A,(HL) ; If movement restriction data is 98... 62789 CP 98 ; ...then set Zero Flag 62791 POP HL ; Restore HL (pointer to room's left or right exit data) 62792 JR Z,62807 ; If Zero Flag is set (i.e. movement restriction data was 98) then skip ahead to #R62807 62794 LD B,(HL) ; Load B with index of room to the left or right of room of interest 62795 LD A,(23702) ; If Magic Knight's current room is not the same as that in B... 62798 CP B ; ... 62799 JR NZ,62810 ; ...then skip ahead to #R62810 62801 BIT 1,(IY+65) ; If Characters Movement Unrestricted Flag is reset (IY = 23610)... 62805 JR Z,62810 ; ...then skip ahead to #R62810 *62807 LD A,255 ; Load A with 255 62809 RET ; Return *62810 LD A,(HL) ; Load A with room index at HL 62811 RET ; Return ; Update Index of Character Whose Turn it is to be Updated ; ; Used by the routine at #R62622. Output: A Updated index of character whose turn it is to be updated c62812 LD A,(23455) ; Increment index of character whose turn it is to be updated... 62815 INC A ; ... 62816 LD (23455),A ; ... 62819 CP 8 ; If new character index is not 8... 62821 RET NZ ; ...then return 62822 XOR A ; Set new character index to 0, as there are only 8 characters... 62823 LD (23455),A ; ... 62826 RET ; Return ; Update Character's x-Coordinate if New Value is Allowed, Otherwise Return ; ; Used by the routine at #R62622. Input: A Updated x-coordinate for character HL Pointer to x-coordinate data in ; a character's current position data Output: A Updated x-coordinate for character (same as input) c62827 PUSH HL ; Store HL (pointer to x-coordinate in a character's current position data) 62828 PUSH AF ; Store AF (A = updated x-coordinate) 62829 DEC HL ; Move HL back to room index 62830 LD A,(HL) ; Load BC with double character's room index... 62831 ADD A,A ; ... 62832 LD C,A ; ... 62833 LD B,0 ; ... 62835 LD HL,48915 ; Load HL with start address of Character Movement Restriction Data 62838 ADD HL,BC ; ...and add BC as offset 62839 POP AF ; Restore AF (A = updated x-coordinate) 62840 CP (HL) ; If new x-coordinate is same as first disallowed x-coordinate... 62841 JR Z,62850 ; ...then skip ahead to #R62850 62843 INC HL ; If new x-coordinate is same as second disallowed x-coordinate... 62844 CP (HL) ; ... 62845 JR Z,62850 ; ...then skip ahead to #R62850 62847 POP HL ; Store HL (pointer to x-coordinate in a character's current position data) 62848 LD (HL),A ; Store updated x-coordinate 62849 RET ; Return *62850 POP HL ; Store HL (pointer to x-coordinate in a character's current position data) 62851 POP AF ; Remove return address from top of stack... 62852 RET ; ...and return to routine that called the routine that called this one ; Set Position of Character Whose Turn it is to Move to His/Her Initial Position ; ; Used by the routine at #R62622. c62853 LD A,(23455) ; Load BC with three times index of character whose turn it is to be updated... 62856 LD C,A ; ... 62857 ADD A,A ; ... 62858 ADD A,C ; ... 62859 LD C,A ; ... 62860 LD B,0 ; ... 62862 LD HL,24898 ; Load HL with start address of Table of Characters' Current Positions... 62865 ADD HL,BC ; ...and add BC as offset 62866 LD DE,48661 ; Load DE with start address of Table of Characters' Initial Positions 62869 EX DE,HL ; Swap DE (now points to current position data of character of interest) and HL (now points to ; Table of Characters' Initial Positions) 62870 ADD HL,BC ; Add BC to HL as offset (HL now points to character's initial position) 62871 LD BC,3 ; Set character's current position to same as initial position... 62874 LDIR ; ... 62876 RET ; Return ; End Game Due to Running Out of Time ; ; Used by the routine at #R62330. c62877 LD HL,51324 ; Point HL at "YOU RAN OUT OF TIME" text... 62880 LD (62889),HL ; ...and store as operand in instruction at #R62888 62883 POP AF ; Remove return address (call to this routine) from top of stack 62884 CALL 62987 ; Restore all registers from the stack 62887 POP AF ; Remove return address (call to interrupt routine) from top of stack ; The operand of the instruction at #R62888 represents the address of the Game Over text to use. This is modified by ; the instruction at #R62880. 62888 LD HL,0 ; Restore address of "YOU RAN OUT OF TIME" text to HL 62891 EI ; Enable interrupts 62892 JP 64582 ; Jump to "Game over" window routine and return to Control Selection Menu ; Characters' Rates of Stat Regeneration ; ; Stats are in order: b62895 DEFB 1,1,1,1,5,5,5,5 ; Off-White Knight ( 1, 1, 1, 1, 5, 5, 5, 5) 62903 DEFB 255,253,253,255,10,8,15,10 ; Aramis le Peux (-1, -3, -3, -1, 10, 8, 15, 10) 62911 DEFB 253,254,252,250,8,4,4,8 ; Robin of Shylock (-3, -2, -4, -6, 8, 4, 4, 8) 62919 DEFB 253,254,252,252,8,4,4,3 ; Reggie the Rat (-3, -2, -4, -4, 8, 4, 4, 3) 62927 DEFB 253,253,255,255,6,3,4,1 ; Rachel of Amazonia (-3, -3, -1, -1, 6, 3, 4, 1) 62935 DEFB 253,254,252,250,8,4,4,8 ; Barker the Ent (-3, -2, -4, -6, 8, 4, 4, 8) 62943 DEFB 253,254,252,252,8,4,4,3 ; Organon the Guard (-3, -2, -4, -4, 8, 4, 4, 3) 62951 DEFB 253,254,252,252,8,4,4,3 ; Grunter the Bearwoolf (-3, -2, -4, -4, 8, 4, 4, 3) ; Store all Registers on the Stack ; ; Used by the routines at #R45809 and #R62178. c62959 EX (SP),HL ; Place HL onto stack in place of top entry (the address of the CALL to this routine is now in ; HL) 62960 PUSH DE ; Store registers AF, BC & DE... 62961 PUSH BC ; ... 62962 PUSH AF ; ... 62963 EX AF,AF' ; Store shadow registers too... 62964 EXX ; ... 62965 PUSH HL ; ... 62966 PUSH DE ; ... 62967 PUSH BC ; ... 62968 PUSH AF ; ... 62969 EX AF,AF' ; ... 62970 EXX ; ... 62971 PUSH IX ; Store IX 62973 PUSH IY ; Store IY 62975 PUSH HL ; Store HL (address of call to this routine) 62976 PUSH AF ; Store AF 62977 LD HL,23 ; Restore original value of HL (as switched with top of stack at beginning of this routine)... 62980 ADD HL,SP ; ... 62981 LD A,(HL) ; ... 62982 DEC HL ; ... 62983 LD L,(HL) ; ... 62984 LD H,A ; ... 62985 POP AF ; Restore AF 62986 RET ; Return ; Restore All Registers from the Stack ; ; Used by the routines at #R45809, #R62178 and #R62877. c62987 POP HL ; Restore registers HL, IY & IX (HL has address of call to this routine, i.e. 62987)... 62988 POP IY ; ... 62990 POP IX ; ... 62992 EX AF,AF' ; Restore shadow registers too... 62993 EXX ; ... 62994 POP AF ; ... 62995 POP BC ; ... 62996 POP DE ; ... 62997 POP HL ; ... 62998 EX AF,AF' ; ... 62999 EXX ; ... 63000 POP AF ; Restore AF, BC, DE... 63001 POP BC ; ... 63002 POP DE ; ... 63003 EX (SP),HL ; Put HL (address of call to 62987) back on stack in preparation for RET and take off original ; value of HL 63004 RET ; Return ; Print Text/Graphic Character in A and Advance Bitmap Virtual Text Cursor ; ; Used by the routines at #R40729, #R40752, #R47326, #R48389, #R63302, #R63691 and #R63740. Input: A Index of ; character to print c63005 PUSH HL ; Store HL ; The operand of the instruction at #R63006 represents the base address of the character set. This is modified by ; the instructions between #R63478 and #R63482. 63006 LD DE,27480 ; Point to (effective) start Character Set graphics 63009 ADD A,A ; Load index of character into HL and multiply by 8... 63010 LD H,0 ; ... 63012 LD L,A ; ... 63013 ADD HL,HL ; ... 63014 ADD HL,HL ; ... 63015 ADD HL,DE ; ...and add to DE to obtain memory location of required character in the character set 63016 EX DE,HL ; Swap values (DE now holds memory location of character to print and HL holds #R27480) ; The operand of the instruction at #R63017 represents the address of the Bitmap Virtual Text Cursor. This is ; modified by the instructions at #R38804, #R38816, #R38832, #R39425, #R39634, #R40501, #R41358, #R41374, #R41395, ; #R46481, #R47322, #R47409, #R47836, #R48529, #R63259, #R63363, #R63625, #R63642 and #R64797. 63017 LD HL,0 ; Load (video) memory location to start printing character into HL 63020 LD B,8 ; For eight bytes (i.e. full height of character)... *63022 LD A,(DE) ; ...get graphic data from character set... 63023 LD (HL),A ; ...and load into video memory... 63024 INC DE ; ...move to next pixel row in character set... 63025 INC H ; ...and move to next pixel row in video memory 63026 DJNZ 63022 ; Loop back to #R63022 63028 CALL 63286 ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor 63031 LD A,(23695) ; Obtain attribute data stored previously (71 = bright white) 63034 LD (HL),A ; Apply attribute to character just printed 63035 CALL 63247 ; Advance Bitmap Virtual Text Cursor right by one character 63038 POP HL ; Restore HL 63039 RET ; Return ; Draw Axe to Screen ; ; Used by the routines at #R46560 and #R46784. Input: A Frame Number (32, 116, 117, 118 or 119) c63040 PUSH HL ; Store HL 63041 LD DE,28248 ; Point DE at 28248 63044 ADD A,A ; Double A... 63045 LD H,0 ; ...Load into HL... 63047 LD L,A ; ... 63048 ADD HL,HL ; ...Double again... 63049 ADD HL,HL ; ...and again to get 8 times original A value... 63050 ADD HL,DE ; ...and add DE to this to point to one of the five sets of axe frame graphic data (#R28504, ; #R29176, #R29184, #R29192 or #R29200) 63051 PUSH HL ; Copy HL into IX... 63052 POP IX ; ... 63054 LD BC,(23677) ; Load system variable COORDS into BC (holds x- and y-coordinates of axe) 63058 CALL 63134 ; Load HL with Display File address for coordinates in BC 63061 LD C,A ; Load pixel-within-byte "address" into C 63062 LD B,8 ; Load 8 into B (as axe graphic data comprises 8 pixel rows) *63064 LD D,(IX+0) ; Load a byte of axe graphic data into D 63067 LD A,C ; Load pixel-within-byte "address" into A 63068 OR A ; Check if we're dealing with pixel zero... 63069 JR Z,63128 ; ...and if so, skip ahead to #R63128 63071 XOR A ; Set A to zero 63072 LD E,A ; Copy into E 63073 PUSH BC ; Store BC (B=graphic row counter, C=pixel-within-byte "address") 63074 LD B,C ; Copy pixel-within-byte "address" into B *63075 SRL D ; Shift graphic data right one bit (rightmost bit goes into carry flag) 63077 RRA ; Rotate carry flag into leftmost bit of A, shifting other bits right 63078 SCF ; Set carry flag 63079 RR E ; Rotate (set) carry flag into leftmost bit of E, shifting other bits right, and resetting ; carry flag 63081 DJNZ 63075 ; Repeat loop to shift graphic right another pixel if necessary 63083 EX AF,AF' ; Switch AF registers 63084 LD A,E ; Load A with value in E (set bits represent number of pixels by which axe graphic has been ; shifted right) 63085 POP BC ; Restore (B=graphic row counter, C=pixel-within-byte "address") *63086 LD A,D ; Load left part of axe graphic data into A 63087 LD E,(HL) ; Load E with graphic data currently at axe's position on screen 63088 XOR E ; Blend axe graphic data with what is already on screen at its position to make things look ; more natural... 63089 LD (HL),A ; ...and write new graphic data back to screen 63090 INC HL ; Advance right one byte in Display File 63091 EX AF,AF' ; Switch registers to restore right part of axe graphic data to A 63092 LD E,(HL) ; Load E with graphic data currently at axe's position on screen 63093 XOR E ; Blend axe graphic data with what is already on screen at its position to make things look ; more natural... 63094 LD (HL),A ; ...and write new graphic data back to screen 63095 DEC HL ; Move left one byte in Display File 63096 INC IX ; Advance IX to next row of axe graphic data 63098 INC H ; Increase H by 1 (i.e. advance HL by 256) 63099 LD A,H ; If at least one of the three rightmost bits of H are set (i.e. we haven't crossed over from ; one third of the display to the next third)... 63100 AND 7 ; ... 63102 JR NZ,63124 ; ...then skip ahead to #R63124 (as HL now points to next pixel row down)... 63104 LD A,H ; ...else we must have been in the bottom pixel row of a character row, so decrease H by 8 (1 ; to go back up, then 7 pixel rows up to the top of that character row)... 63105 SUB 8 ; ... 63107 LD H,A ; ... 63108 LD A,L ; Advance L by 32 bytes to move down one character row, so now the top of the next character ; row down... 63109 ADD A,32 ; ... 63111 LD L,A ; ... 63112 JR NC,63124 ; 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 the third) then skip ahead to #R63124 63114 LD A,H ; Move down by a third... 63115 ADD A,8 ; ... 63117 LD H,A ; ... 63118 XOR 88 ; If we have not reached the start of the Attribute File... 63120 JR NZ,63124 ; ...then skip ahead to #R63124 63122 LD H,64 ; ...else wrap back round to the start of Display File again *63124 DJNZ 63064 ; Decrease B (remaining number of pixel rows to draw) and loop back to #R63064 63126 POP HL ; Restore HL 63127 RET ; Return *63128 XOR A ; Set A to zero 63129 EX AF,AF' ; Switch registers 63130 XOR A ; Set A to zero 63131 LD E,A ; Set E to zero as axe graphic hasn't been shifted 63132 JR 63086 ; Jump back to #R63086 ; Load HL with Display File Address for Coordinates in BC ; ; Used by the routine at #R63040. Input: B y-coordinate of axe in pixels C x-coordinate of axe in pixels Output: ; A Horizontal pixel offset of axe HL Display File address for axe c63134 LD A,C ; Load A with remainder, when dividing x-coordinate (pixels) by eight... 63135 AND 7 ; ...i.e. "pixel-within-byte" address 63137 EX AF,AF' ; Switch AF and AF' 63138 LD H,0 ; Load HL with double y-coordinate in pixels... 63140 LD L,B ; ... 63141 ADD HL,HL ; ... 63142 LD DE,65140 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row... 63145 ADD HL,DE ; ...and add HL as offset in HL 63146 LD A,(HL) ; Load HL with Display File address of start of pixel row at y-coordinate... 63147 INC HL ; ... 63148 LD H,(HL) ; ... 63149 LD L,A ; ... 63150 LD A,C ; Load A with x-coordinate in pixels... 63151 RRCA ; ...and divide by eight to give x-coordinate in characters... 63152 RRCA ; ... 63153 RRCA ; ... 63154 AND 31 ; ... 63156 LD C,A ; Load BC with x-coordinate in characters... 63157 LD B,0 ; ... 63159 ADD HL,BC ; ...and add to HL as offset in HL 63160 EX AF,AF' ; Switch AF and AF' (A now contains "pixel-within-byte" address) 63161 RET ; Return ; Draw a UDG, with Index A, from 2x2 Blocks' UDG Data at Location of Bitmap Virtual Text Cursor ; ; Used by the routine at #R41271. Input: A Block UDG index (in graphic data starting at #R28504) c63162 PUSH HL ; Store HL 63163 LD DE,28504 ; Load DE with start address of UDG data for 2x2 blocks 63166 ADD A,A ; Load HL with eight times UDG index... 63167 LD H,0 ; ... 63169 LD L,A ; ... 63170 ADD HL,HL ; ... 63171 ADD HL,HL ; ... 63172 ADD HL,DE ; Add start address of UDG data for 2x2 blocks to HL as offset in HL 63173 EX DE,HL ; Swap DE (now address of graphic data for required UDG) and HL (now start address of UDG data ; for 2x2 blocks) 63174 LD HL,(63018) ; Load HL with (Display File address of) Bitmap Virtual Text Cursor 63177 LD B,8 ; Print UDG data at address in DE to Display File address in HL... *63179 LD A,(DE) ; ... 63180 LD (HL),A ; ... 63181 INC DE ; ... 63182 INC H ; ... 63183 DJNZ 63179 ; ... 63185 LD HL,(63018) ; Load HL with (Display File address of) Bitmap Virtual Text Cursor 63188 LD A,H ; Load H into A... 63189 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) 63191 RRCA ; Divide by eight to get character row within the third... 63192 RRCA ; ... 63193 RRCA ; ... 63194 ADD A,88 ; Add 22,528 to HL to move into attribute section of video memory 63196 LD H,A ; L still contains offset of x characters, so points to start of attributes for area where room ; name was just printed 63197 LD A,(23695) ; Load A with value in system variable ATTR T... 63200 LD (HL),A ; ...and apply this to the Attribute File address in HL 63201 POP HL ; Restore HL 63202 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 #R39216, #R39366, #R40832, #R41504, #R41545, #R47193, #R47326, #R61297, #R61336, #R61418, ; #R61521, #R63691 and #R63740. Input: B y-coordinate (characters) C x-coordinate (characters) Output: HL Virtual ; Cursor (Bitmap) Display File address c63203 LD A,B ; Load y-coordinate into A 63204 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) 63206 ADD A,64 ; Load HL with bitmap Display File address of start of appropriate third of display... 63208 LD H,A ; ...(16,384, 18,432 or 20,480) 63209 LD A,B ; Load y-coordinate back into A 63210 AND 7 ; AND 7 to determine which of the 8 character rows within the third we are interested in 63212 RRCA ; Multiply by 8 to get pixel row required... 63213 RRCA ; ... 63214 RRCA ; ... 63215 ADD A,C ; Add x-coordinate 63216 LD L,A ; Add to value currently in HL 63217 JR 63259 ; 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 #R63228 is usually 88 (corresponding to a Attribute File lookup). It is only ; changed to 93 (corresponding to a Terrain Interaction Data lookup) by the routine at #R63233, 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) c63219 LD A,B ; Load y-coordinate into A 63220 ADD A,A ; Multiply this by 8... 63221 ADD A,A ; ... 63222 ADD A,A ; ... 63223 LD L,A ; Copy 8 times y-coordinate into HL... 63224 LD H,0 ; ... 63226 ADD HL,HL ; Multiply by 4... 63227 ADD HL,HL ; ...to give 32 times original y-coordinate in HL ; The operand of the instruction at #R63228 determines whether we are dealing with the Attribute File (88), or the ; current Terrain Interaction Data (93). It is modified by the instructions at #R63235 and #R63243. 63228 LD D,88 ; Point DE at start of data, plus x-coordinate offset in C... 63230 LD E,C ; ... 63231 ADD HL,DE ; Add 32 times y-coordinate as offset in HL 63232 RET ; Return ; Point HL at Terrain Interaction Data for Character Coordinates x=C, y=B ; ; Used by the routines at #R38434, #R38585, #R38724, #R39216, #R39366, #R41173 and #R48191. Input: B y-coordinate ; (chars) C x-coordinate (chars) Output: HL points to entry in Terrain Interaction Data c63233 LD A,93 ; Set most significant byte in Terrain Interaction Data / Attribute File lookup routine to 93 ; (Terrain Interaction Table)... 63235 LD (63229),A ; ... 63238 CALL 63219 ; Point HL at Terrain Interaction Data for Character Coordinates x=C, y=B 63241 LD A,88 ; Set most significant byte in Terrain Interaction Data / Attribute File lookup routine to 88, ; (Attribute File)... 63243 LD (63229),A ; ... 63246 RET ; Return ; Advance Bitmap Virtual Text Cursor right by one character ; ; Used by the routines at #R41271, #R48389 and #R63005. c63247 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor... 63250 INC HL ; ...and increase (for next character) 63251 LD A,L ; Load LSB of HL into A... 63252 OR A ; ...and check whether it is zero 63253 JR NZ,63259 ; 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 #R63259 63255 LD A,H ; Add 7 to MSB of video memory address... 63256 ADD A,7 ; ...as advancing by one at #R63250 took video memory pointer back up to 2nd pixel row of the ; current third of the display... 63258 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 #R63203, #R63263, #R63349 and #R63399. *63259 LD (63018),HL ; Store the updated address of Bitmap Virtual Text Cursor 63262 RET ; Return ; Advance Bitmap Virtual Text Cursor to start of next character row ; ; Used by the routines at #R41271, #R48389 and #R48518. c63263 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 63266 LD A,L ; Get LSB of video memory address in A 63267 ADD A,32 ; Add 32 (i.e. move down one character row) 63269 JP C,63277 ; If we have encountered the bottom of the current third of the display, then skip ahead to ; #R63277 63272 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of a character row) 63274 LD L,A ; Place modified address back into HL 63275 JR 63259 ; Store at 63018 and return *63277 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of a character row) 63279 LD L,A ; Place modified address back into L 63280 LD A,H ; Load MSB of video memory address into A 63281 ADD A,8 ; Increase by 8 (as we're moving one text row, or EIGHT pixel rows down) 63283 LD H,A ; Place modified address back into HL 63284 JR 63259 ; Store at 63018 and return ; Update Attribute Virtual Text Cursor based upon current Bitmap Virtual Text Cursor ; ; Used by the routines at #R46902, #R48389, #R48518 and #R63005. c63286 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 63289 LD A,H ; Load H into A... 63290 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) 63292 RRCA ; Divide by eight to get character row within the third... 63293 RRCA ; ... 63294 RRCA ; ... 63295 ADD A,88 ; Add 22,528 to HL to move into attribute section of video memory 63297 LD H,A ; L still contains offset of x characters, so points to start of attributes for area where room ; name was just printed 63298 LD (23707),HL ; Store memory location for later use 63301 RET ; Return ; Draw a Run of Characters (e.g. Edge of Frame of a Window) ; ; Used by the routines at #R39393, #R47491, #R47833 and #R63598. Input: HL Repeat count for printing character ; (e.g. width of window in characters minus 1) c63302 LD A,H ; Check whether remaining window's width is zero... 63303 OR L ; ...and if it is... 63304 RET Z ; ...then return without doing anything ; The operand of the instruction at #R63305 represents the index of a character set character to draw. This is ; modified by the instructions at #R39413, #R47234, #R47498, #R47844 and #R63630. 63305 LD A,0 ; Else, load A with the character index 63307 CALL 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor 63310 DEC HL ; Decrease remaining width 63311 JR 63302 ; Loop back to #R63302 ; Advance HL to Byte After First Zero From Address in HL Onwards ; ; Used by the routine at #R42616. Input: HL Pointer to search starting point Output: HL Pointer to byte after ; first zero at or after HL input c63313 PUSH BC ; Store BC 63314 LD BC,65535 ; Set range to 65535 63317 XOR A ; Load A (value to search for) to zero 63318 CPIR ; Advance HL to byte after first zero found 63320 POP BC ; Restore BC 63321 RET ; Return ; Point HL at Start of B-th Entry in List of Read-Texts of Readable Objects ; ; Used by the routine at #R43494. c63322 LD HL,52878 ; Point HL at start of List of Read-Texts of Readable Objects 63325 JR 63335 ; 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 52590 ; ; Used by the routine at #R43043. c63327 LD HL,52590 ; Point HL at first of the "COMMAND A CHARACTER" commands (i.e. "GO TO SLEEP") 63330 JR 63335 ; 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 #R42638 and #R45809. Input: B Index of required text string HL (entry via #R63335) ; address of start of a table of zero-terminated strings Output: HL Points to string of index B (input) c63332 LD HL,56565 ; Point HL at start of Table of Object Names ; This entry point is used by the routines at #R39578, #R42638, #R43874, #R45206, #R45227, #R63322 and #R63327. *63335 LD A,B ; Load string index into A 63336 OR A ; Return if index is zero... 63337 RET Z ; ... *63338 PUSH BC ; Store BC 63339 LD BC,65535 ; Load BC (loop counter) with 65535 63342 XOR A ; Set A to zero 63343 CPIR ; Advance HL to start of next zero-terminated string 63345 POP BC ; Store BC 63346 DJNZ 63338 ; Decrease B (remaining number of object names to skip over) and loop back to #R63338 63348 RET ; Return ; Print Text at DE (Command Summary) in Command Summary Window at Top of Screen ; ; Used by the routines at #R41578, #R41924, #R42257, #R42638, #R43043, #R43636, #R43874, #R44100, #R44337, #R45206, ; #R45781 and #R63388. Input: DE Points to command text c63349 PUSH DE ; Store DE (Pointer to command text to print) 63350 LD A,70 ; Set ATTR T system variable to 70 (yellow INK, black PAPER, BRIGHT)... 63352 LD (23695),A ; ... 63355 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 63358 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 63359 LD DE,(23704) ; Load DE with new Display File address to print character... 63363 LD (63018),DE ; ...and update Bitmap Virtual Text Cursor with this location 63367 PUSH HL ; Store HL (pointer to text to be printed) 63368 CALL 63443 ; Swap x- and y-coordinates of current window with those of Command Summary Window in temporary ; storage at #R23418 63371 POP HL ; Restore HL (pointer to text to be printed) 63372 CALL 46902 ; Print text to screen 63375 CALL 63443 ; Restore x- and y-coordinates of current window from temporary storage at #R23418 63378 LD HL,(63018) ; Load HL with new address in Bitmap Virtual Text Cursor (i.e. after text just printed)... 63381 LD (23704),HL ; ...and store back at #R23704 63384 POP HL ; Restore HL (Display File address to start printing character as swapped by instruction at ; #R63358) 63385 JP 63259 ; 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 #R45809 and #R45963. Input: DE Pointer to text to print c63388 LD A,D ; If DE is zero (i.e. no Command Summary Text)... 63389 OR E ; ... 63390 RET Z ; ...then return 63391 PUSH DE ; Store DE (Command Summary Text Pointer) 63392 CALL 63399 ; Print or update Command Summary Window at top of screen 63395 POP DE ; Restore DE (Command Summary Text Pointer)... 63396 JP 63349 ; ...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 #R41578, #R41924, #R42638, #R43874, #R44100, #R44337, #R45206 and #R63388. The operand of ; the instruction at #R63399 represents the index of the window being drawn. This is modified by the instructions at ; #R47204 and #R63437. c63399 LD A,0 ; Load index of window being drawn into A 63401 PUSH AF ; Store AF (A = index of Current Window) 63402 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor... 63405 PUSH HL ; ...and store 63406 CALL 63443 ; Store x- and y-coordinates of current window temporarily at #R23418 63409 HALT ; Wait for interrupt 63410 LD A,1 ; Draw Window 1 (Command Summary Window at top of screen)... 63412 CALL 47193 ; ... 63415 LD HL,50802 ; Point HL to ("COMMAND") text... 63418 CALL 46902 ; ...and print to screen 63421 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 63424 PUSH HL ; Store HL (address of Bitmap Virtual Text Cursor) 63425 CALL 38829 ; Print "STORMBRINGER" text at top of Command Summary Window 63428 POP HL ; Restore HL (address of Bitmap Virtual Text Cursor) 63429 LD (23704),HL ; Store this location as the location to print text to in the Command Summary Window 63432 CALL 63443 ; Restore x- and y-coordinates of current window from #R23418 63435 POP HL ; Restore HL (address of Bitmap Virtual Text Cursor) 63436 POP AF ; Restore AF (A = index of Current Window) 63437 LD (63400),A ; Restore index of Current Window to 63400 (was updated to 1 by call at #R63412) 63440 JP 63259 ; 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 23418) ; ; 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 c63443 LD HL,(23418) ; Swap x- and y-coordinates of top-left of window / graphic currently at #R23408 with values in ; temporary store at #R23418... 63446 LD DE,(23408) ; ... 63450 LD (23418),DE ; ... 63454 LD (23408),HL ; ... 63457 LD HL,(23420) ; Swap x- and y-coordinates of bottom-right of window / graphic currently at #R23410 with ; values in temporary store at #R23420... 63460 LD DE,(23410) ; ... 63464 LD (23420),DE ; ... 63468 LD (23410),HL ; ... 63471 RET ; Return ; Update Character Printing Routine to Use Base Address of Text Character Set Graphics ; ; Used by the routines at #R39393 and #R47326. Input: HL (Entry at #R63476 only) Effective start address of an ; alternative character set c63472 PUSH HL ; Store HL 63473 LD HL,27480 ; Load HL with address of (effective) start Character Set graphics ; This entry point is used by the routine at #R63488. *63476 PUSH AF ; Store AF 63477 LD A,L ; Set operand of instruction at #R63006 (character printing routine) to address in HL... 63478 LD (63007),A ; ... 63481 LD A,H ; ... 63482 LD (63008),A ; ... 63485 POP AF ; Restore AF 63486 POP HL ; Restore HL 63487 RET ; Return ; Update Character Printing Routine to Use Base Address of Floor Character Set Graphics ; ; Used by the routine at #R39393. c63488 PUSH HL ; Store HL (corresponds to POP HL at #R63486) 63489 LD HL,28248 ; Load HL with address of (effective) start Floor Character Set graphics 63492 JR 63476 ; Update character printing routine to this as base address of character set graphics and ; return ; Draw a Graphic with Lookup Index A, Width of 2 and Height of 3 at Character Coordinates (C, B) ; ; Used by the routine at #R39958. Input: A Index of graphic to draw in graphic data lookup table at #R29272 B ; y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c63494 LD DE,770 ; Load D with 3 and E with 2 63497 JR 63507 ; Draw a Graphic with Lookup Index A at Character Coordinates (C, B) with width = 2 characters ; and height = 3 characters and 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 #R46490 and #R48191. Input: A Index of graphic to draw in graphic data lookup table at ; #R29272 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c63499 LD DE,514 ; Load D and E with 2 63502 JR 63507 ; 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 #R39883 and #R42638. Input: A Index of graphic to draw in graphic data lookup table at ; #R29272 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item D (entry at ; #R63507) Graphic height (characters) E (entry at #R63507) Graphic width (characters) c63504 LD DE,1026 ; Set D (height) to 4 and E to 2 (width) ; This entry point is used by the routines at #R47193, #R63494 and #R63499. *63507 PUSH HL ; Store HL 63508 PUSH DE ; Store DE 63509 PUSH AF ; Store AF 63510 LD A,C ; Load x-coordinate to draw item into instruction at #R63570... 63511 LD (63571),A ; ... 63514 LD A,B ; Multiply y-coordinate by 8... 63515 ADD A,A ; ... 63516 ADD A,A ; ... 63517 ADD A,A ; ... 63518 LD L,A ; ...and load into HL... 63519 LD H,0 ; ... 63521 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 #R65140) 63522 LD DE,65140 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 63525 ADD HL,DE ; Advance by 16 times y-coordinate to point HL at entry for start of item's current pixel row 63526 PUSH HL ; Transfer this value into IX... 63527 POP IX ; ... 63529 POP AF ; Restore A (graphic index of item to draw)... 63530 LD L,A ; ...and load into HL... 63531 LD H,0 ; ... 63533 ADD HL,HL ; Multiply by four (as there are two WORD entries for each graphic in the table at #R29272)... 63534 ADD HL,HL ; ... 63535 LD BC,29272 ; Point BC at start of Graphics Data Lookup Table at #R29272... 63538 ADD HL,BC ; ...and add offset to point to entry for item of interest 63539 LD E,(HL) ; Load graphic data address for this graphic into DE... 63540 INC HL ; ... 63541 LD D,(HL) ; ... 63542 INC HL ; ... 63543 CALL 64632 ; Load next value in table (address of graphic data for this object's mask) into HL 63546 POP BC ; Restore BC (B = height, C = width) 63547 LD A,B ; Load height into A... 63548 ADD A,A ; ...and multiply by eight... 63549 ADD A,A ; ... 63550 ADD A,A ; ... 63551 EX AF,AF' ; Swap A and A' 63552 LD B,C ; Copy graphic width into B... 63553 LD A,C ; ...and A'... 63554 LD (63574),A ; ...and modify instruction at #R63573 with this value also 63557 EX AF,AF' ; Swap A and A' 63558 EX DE,HL ; Swap DE (now pointer to object's mask graphic data) and HL (now pointer to object's graphic ; data) 63559 EXX ; Switch registers 63560 LD C,A ; Load C with eight times graphic's height *63561 PUSH BC ; Store BC (C = remaining number of pixel rows to draw, initially eight times graphic's height) 63562 LD L,(IX+0) ; Load HL' with Display File address of start of pixel row at object's y-coordinate... 63565 LD H,(IX+1) ; ... 63568 LD B,0 ; Set B' to zero ; The operand of the instruction at #R63570 represents the x-coordinate at which to draw the item. This is modified ; by the instruction at #R63511. 63570 LD C,0 ; Set C' to x-coordinate of item 63572 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 #R63573 represents the width of the graphic to draw. This is modified by the ; instruction at #R63554. 63573 LD B,0 ; Load B with graphic width *63575 EXX ; Switch registers 63576 LD A,(DE) ; Load graphic data byte from graphic mask data into A 63577 EXX ; Switch registers 63578 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) 63579 EXX ; Switch registers 63580 OR (HL) ; Modify modified mask data by OR-ing with object graphic data byte from graphic data 63581 INC HL ; Advance HL to next byte in object graphic data 63582 INC DE ; Advance DE to next byte in object graphic mask data 63583 EXX ; Switch registers 63584 LD (HL),A ; Load masked graphic data byte into Display File 63585 INC HL ; Advance HL to next byte in Display File 63586 DJNZ 63575 ; Loop back to #R63575 for next column of object graphic data 63588 INC IX ; Advance IX by two bytes to next address in Table of Addresses of Starts of Pixel Rows... 63590 INC IX ; ... 63592 POP BC ; Restore BC (C = remaining number of pixel rows to draw) 63593 DEC C ; Decrease remaining number pixel rows to draw 63594 JR NZ,63561 ; If not zero (i.e. still need to draw at least one more pixel row of graphic data) then loop ; back to #R63561 63596 POP HL ; Restore HL 63597 RET ; Return ; Update Currently Selected Input Device ; ; Used by the routines at #R37689 and #R37909. Input: A Index of currently selected input device D Index of ; previously selected input device (valid for call at #R37747 only) c63598 LD B,A ; Load B with index of currently selected input device... 63599 CP 1 ; ...and if this is 1 (Kempston Joystick)... 63601 CALL Z,63657 ; ...then if Kempston Joystick is not present, revert to previously selected input device 63604 LD A,B ; Load A with currently selected input device 63605 LD HL,62054 ; Point HL at start of Table of Start Addresses of Input Device Reading Routines 63608 CALL 64627 ; Load HL with A-th entry from table (i.e. the routine for the currently selected input ; device)... 63611 LD (64040),HL ; ...and update jump (at #R64039) in input reading routine to this address 63614 LD A,(63653) ; Load index of currently selected input device into A 63617 ADD A,196 ; Add 196 (index in Common Words Table for first "control method" string) 63619 LD (63655),A ; Store as text code at #R63654 63622 LD HL,18444 ; Load HL with Display File address corresponding to (12, 8) (characters)... 63625 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 63628 LD A,32 ; Set character to be repeated to 32 (SPACE)... 63630 LD (63306),A ; ... 63633 LD HL,20 ; Load HL with 20 as we need to draw across 20 character blocks 63636 CALL 63302 ; Draw run of 20 SPACE characters (i.e. clear old "CONTROL : ..." text) 63639 LD HL,18434 ; Load HL with Display File address corresponding to (2, 8) (characters)... 63642 LD (63018),HL ; ...and move Bitmap Virtual Text Cursor here 63645 LD HL,63654 ; Point HL at Current Control Text (Control Selection Screen) 63648 CALL 46873 ; Print text at location HL to screen using full screen width 63651 XOR A ; Set A to zero 63652 RET ; Return ; Index of Currently Selected Input Device b63653 DEFB 0 ; Current Control Text (on Control Selection Screen) b63654 DEFM 195,196,0 ; CONTROL : KEYBOARD ; If Kempston Joystick is Not Present then Revert to Previously Selected Input Device ; ; Used by the routine at #R63598. 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 c63657 IN A,(31) ; Load A with current Kempston Joystick state 63659 AND 224 ; If bits 5, 6 and 7 (i.e. unused bits) are reset, indicating presence of Kempston Joystick... 63661 RET Z ; ...then return 63662 LD A,D ; Load A with index of previously selected input device... 63663 LD (63653),A ; ...set as currently selected input device... 63666 LD B,A ; ...and load into B 63667 RET ; Return ; If Keypress Was Enqueued then Return Index of Last Key Pressed, Else Wait for Keypress and Return Index ; ; Used by the routine at #R63740. Output: A Index of key pressed The operand of the instruction at #R63668 ; represents an enqueued keypress. This is modified by the instructions at #R63686 and #R63749. c63668 LD A,0 ; Load A with enqueued key index... 63670 OR A ; ...and if not zero... 63671 JR NZ,63677 ; ...then skip ahead to #R63677 63673 XOR A ; Clear last pressed key... 63674 LD (23560),A ; ... *63677 HALT ; Wait for interrupt 63678 LD A,(23560) ; Load last pressed key into A... 63681 OR A ; ...and if this is zero (i.e. no key pressed)... 63682 JR Z,63677 ; ...then loop back to #R63677 63684 EX AF,AF' ; Switch AF and AF' 63685 XOR A ; Set enqueued key index to zero... 63686 LD (63669),A ; ... 63689 EX AF,AF' ; Switch AF and AF' 63690 RET ; Return ; Print Current Control Keys to Screen ; ; Used by the routines at #R37951 and #R63740. c63691 LD HL,63986 ; Point HL at list of current keyboard control characters 63694 LD BC,3589 ; Print LEFT key at (5, 14)... 63697 CALL 63724 ; ... 63700 LD BC,3602 ; Print RIGHT key at (18, 14)... 63703 CALL 63724 ; ... 63706 LD BC,4101 ; Print JUMP/UP key at (5, 16)... 63709 CALL 63724 ; ... 63712 LD BC,4114 ; Print DOWN key at (18, 16)... 63715 CALL 63724 ; ... 63718 LD BC,4613 ; Print MENU (FIRE) key at (5, 18)... 63721 JP 63724 ; ... (see trivia) *63724 PUSH HL ; Store HL (current position in list of current keyboard control characters) 63725 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 63728 POP HL ; Restore HL (current position in Current Keyboard Controls) 63729 LD A,(HL) ; Load current keyboard control character into A 63730 INC HL ; Advance HL by one byte to next keyboard control 63731 CP 32 ; If current keyboard control character is not 32 (SPACE)... 63733 JR NZ,63737 ; ...then skip ahead to #R63737 63735 LD A,127 ; Load A with 127 (index of COPYRIGHT graphic in character set) *63737 JP 63005 ; Print text/graphic character in A and advance Bitmap Virtual Text Cursor and return ; Redefine Keyboard Controls ; ; Used by the routine at #R37764. c63740 CALL 63691 ; Print current control keys to Screen 63743 CALL 63668 ; If keypress was enqueued then load A with index of last key pressed, otherwise wait for ; keypress and load A with index 63746 CP 13 ; If key pressed was 13 (ENTER)... 63748 RET Z ; ...then return 63749 LD (63669),A ; Set enqueued key index to index of key pressed 63752 LD B,5 ; Load B with 5 (as there are five controls) 63754 LD HL,63986 ; Point HL at start of list of current keyboard control characters *63757 LD (HL),0 ; Set current keyboard control character to zero 63759 INC HL ; Advance to next keyboard control character 63760 DJNZ 63757 ; Decrease B (remaining number of keyboard control characters to clear) and loop back to ; #R63757 if not zero 63762 LD BC,1280 ; Load B with 5 and C with zero 63765 LD HL,63986 ; Point HL at start of list of current keyboard control characters *63768 PUSH BC ; Store BC (B = remaining number of controls to define, C = number of controls defined) 63769 PUSH HL ; Store HL (current position in List of Keyboard Control Characters) 63770 LD A,C ; Load number of controls defined (0, 1, 2, 3 or 4) into A 63771 AND 6 ; Reset all but bits 1 and 2 (to give 0, 2 or 4) 63773 ADD A,14 ; Add 14 (to give 14, 16 or 18, the y-coordinates in characters of displayed keyboard ; controls)... 63775 LD B,A ; ...and load into B 63776 LD A,C ; Load A with number of controls defined (0, 1, 2, 3 or 4) 63777 AND 1 ; Reset all but bit 0 (to give 0 or 1) 63779 PUSH AF ; Store AF (A = bit 0 of number of controls defined) 63780 ADD A,A ; Double A (to give 0 or 2)... 63781 LD C,A ; ...and load into C 63782 POP AF ; Restore AF (A = bit 0 of number of controls defined) 63783 PUSH AF ; Store AF (A = bit 0 of number of controls defined) 63784 ADD A,C ; Add C to A (to give 0 or 3) 63785 ADD A,A ; Multiply A by four... 63786 ADD A,A ; ...to give 0 or 12... 63787 LD C,A ; ...and load into C 63788 POP AF ; Restore AF (A = bit 0 of number of controls defined) 63789 ADD A,C ; Add value in C to A (to give 0 or 13) 63790 ADD A,5 ; Add 5 (to give 5 or 18, the x-coordinates in characters of displayed keyboard controls)... 63792 LD C,A ; ...and load into C 63793 PUSH BC ; Store BC (coordinates in characters of current control being defined) 63794 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B)... 63797 LD A,(HL) ; ...and set the FLASH Flag for this address... 63798 OR 128 ; ... 63800 LD (HL),A ; ... *63801 POP BC ; Restore BC (coordinates in characters of current control being defined) 63802 PUSH BC ; Store BC (coordinates in characters of current control being defined) 63803 CALL 63203 ; Move Virtual Cursor (Bitmap) to Display File address for Coordinates x=C, y=B and load ; address into HL 63806 CALL 63668 ; If keypress was enqueued then load A with index of last key pressed, otherwise wait for ; keypress and load A with index 63809 CP 32 ; If key pressed was SPACE... 63811 JP Z,63837 ; ...then skip ahead to #R63837 63814 CP 48 ; If index of key pressed is less than 48 (i.e. below "0")... 63816 JP M,63801 ; ...then jump back to #R63801 (i.e. wait for next key press and try again) 63819 CP 91 ; If index of key pressed is 91 or higher (i.e. above "Z")... 63821 JP P,63801 ; ...then jump back to #R63801 (i.e. wait for next key press and try again) 63824 CP 58 ; If index of key pressed is less than 58 (i.e. "9" or below)... 63826 JP M,63837 ; ...then skip ahead to #R63837 63829 CP 65 ; If index of key pressed is 65 or higher (i.e. "A" or above)... 63831 JP P,63837 ; ...then skip ahead to #R63837 63834 JP 63801 ; Jump back to #R63801 (i.e. wait for next key press and try again) *63837 CALL 63969 ; Set Zero Flag if key pressed is already assigned to a control, otherwise reset 63840 JP Z,63801 ; If key pressed is already assigned then jump back to #R63801 (i.e. wait for next key press ; and try again) 63843 LD (23711),A ; Store pressed key index at #R23711 63846 CP 32 ; If key was not SPACE... 63848 JR NZ,63852 ; ...then skip ahead to #R63852 63850 LD A,127 ; Load A with 127 (index in character set of COPYRIGHT UDG at #R28496) *63852 CALL 63005 ; Print text character in A and advance Bitmap Virtual Text Cursor 63855 POP BC ; Restore BC (coordinates in characters of current control being defined) 63856 CALL 63219 ; Load HL with Attribute File address for coordinates (C, B)... 63859 LD A,(HL) ; ...and reset the FLASH Flag for this address... 63860 AND 127 ; ... 63862 LD (HL),A ; ... 63863 POP HL ; Restore HL (current position in List of Keyboard Control Characters) 63864 LD A,(23711) ; Load A with index of previously defined key... 63867 LD (HL),A ; ...and store in List of Keyboard Control Characters 63868 INC HL ; Advance HL to next entry in List of Keyboard Control Characters 63869 POP BC ; Restore BC (B = remaining number of controls to define, C = number of controls defined) 63870 INC C ; Increase C (number of controls defined) 63871 DJNZ 63768 ; Decrease B (remaining number of controls to define) and loop back to #R63768 if not zero 63873 LD B,5 ; Load B with 5 (as each keyboard half-row holds five keys) 63875 LD HL,64045 ; Load HL with address of operand of instruction at #R64044 (MSB of "input address" for ; keyboard half-row reading for LEFT)... 63878 LD (23711),HL ; ...and store at #R23711 63881 LD HL,63986 ; Point HL at start of list of current keyboard control characters *63884 PUSH BC ; Store BC (B = remaining number of control keys to check) 63885 PUSH HL ; Store HL (pointer to current position in list of current keyboard control characters) 63886 LD IX,63994 ; Point IX at Lists of Characters on Each Keyboard Half-Row 63890 LD A,(HL) ; Load A with current keyboard control character index 63891 LD C,0 ; Set C (index in list of half-rows) to zero *63893 CP (IX+0) ; If current keyboard control character index is the same as the current character in keyboard ; half-row groups... 63896 JR Z,63903 ; ...then skip ahead to #R63903 63898 INC C ; Increase C (index in list of half-rows) 63899 INC IX ; Advance to next entry in list of half-rows 63901 JR 63893 ; Loop back to #R63893 *63903 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. 63904 LD B,0 ; Set B (keyboard half-row index) to zero *63906 SUB 5 ; If index of key in current half-row is less than 5 (i.e. key is in the current half-row)... 63908 JP M,63914 ; ...then skip ahead to #R63914 63911 INC B ; Increase B (keyboard half-row index) 63912 JR 63906 ; Loop back to #R63906 ; The MSB in the "input address" for the various keyboard half-rows obeys the progression (254, 253, 251, 247, 239, ; 223, 191, 127). *63914 LD A,B ; Load A with index of keyboard half-row containing current key 63915 PUSH BC ; Store BC (B = index of keyboard half-row, C = index of key in list of half-rows) 63916 INC B ; Increase B 63917 LD HL,128 ; Load HL with 128 *63920 ADD HL,HL ; Double value in HL 63921 DJNZ 63920 ; Decrease B (index of keyboard half-row) and loop back to #R63920 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. 63923 LD A,255 ; Load A with 255 63925 SUB H ; Subtract H (2^m) to give MSB of input address for relevant half-row 63926 LD HL,(23711) ; Load HL with address of operand of instruction to modify (#R64044)... 63929 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# 63930 INC HL ; Advance HL by four bytes to operand of instruction at #R64048... 63931 INC HL ; ... 63932 INC HL ; ... 63933 INC HL ; ... 63934 LD (23711),HL ; ...and store at #R23711 63937 POP BC ; Restore BC (B = index of keyboard half-row, C = index of key in list of half-rows) 63938 LD A,B ; Load B with five times index of keyboard half-row (value currently in B)... 63939 ADD A,A ; ... 63940 ADD A,A ; ... 63941 ADD A,B ; ... 63942 LD B,A ; ... (B is now 0, 5, 10, 15, 20, 25, 30 or 35) 63943 LD A,C ; Load A with index of key in list of half-rows... 63944 SUB B ; ...and subtract B (5 times index of half-row) to give index of key within current half-row 63945 ADD A,A ; Multiply this index by 8 (opcode interval between successive "BIT n,A" and "BIT n+1,A" ; instructions)... 63946 ADD A,A ; ... 63947 ADD A,A ; ... 63948 ADD A,71 ; ...and add 71 (opcode for "BIT 0,A") 63950 LD HL,(23711) ; Load HL with address of operand / opcode for "BIT n,A" instruction... 63953 LD (HL),A ; ...and set "n" accordingly 63954 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)... 63957 ADD HL,BC ; ... 63958 LD (23711),HL ; ...and store at #R23711 63961 POP HL ; Restore HL (pointer to current position in list of current keyboard control characters, ; PUSHed at #R63885) 63962 INC HL ; Advance HL to next keyboard control character 63963 POP BC ; Store BC (B = remaining number of control keys to check, PUSHed at #R63884) 63964 DJNZ 63884 ; Decrease B (remaining number of control keys to check) and loop back to #R63884 for next ; control key if not zero 63966 JP 64230 ; Wait for interrupt then 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 #R63740. Input: A Index of key pressed Output: F Zero Flag set if pressed key is already ; assigned, otherwise reset c63969 PUSH BC ; Store BC 63970 PUSH HL ; Store HL 63971 LD HL,63986 ; Point HL at start of list of current keyboard control characters 63974 LD B,5 ; Load B with 5 (as there are five controls to process) *63976 CP (HL) ; If key pressed is the same as current control key index... 63977 JR Z,63983 ; ...then skip ahead to #R63983 63979 INC HL ; Advance HL to next entry in list of current keyboard control characters 63980 DJNZ 63976 ; Decrease B (remaining number of control characters to process) and loop back to #R63976 if ; not zero 63982 OR A ; Reset Zero Flag *63983 POP HL ; Restore HL 63984 POP BC ; Restore BC 63985 RET ; Return ; Current Keyboard Controls b63986 DEFB 78 ; Left 63987 DEFB 77 ; Right 63988 DEFB 65 ; Jump / Up 63989 DEFB 90 ; Down 63990 DEFB 32 ; Menu (Fire) 63991 DEFB 32,32,32 ; Unused ; Lists of Characters on Each Keyboard Half-Row b63994 DEFM 45,"ZXCV" ; (00) - IN 65278 (B = 254, C = 254) 63999 DEFM "ASDFG" ; (01) - IN 65022 (B = 253, C = 254) 64004 DEFM "QWERT" ; (02) - IN 64510 (B = 251, C = 254) 64009 DEFM "12345" ; (03) - IN 63486 (B = 247, C = 254) 64014 DEFM "09876" ; (04) - IN 61438 (B = 239, C = 254) 64019 DEFM "POIUY" ; (05) - IN 57342 (B = 223, C = 254) 64024 DEFM 45,"LKJH" ; (06) - IN 49150 (B = 191, C = 254) 64029 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 #R38205, #R47502, #R47592, #R64230 and #R64836. Output: A Stored keypress (bits: 0=LEFT, ; 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c64034 LD HL,23487 ; Point HL at input control flags and reset all... 64037 LD (HL),0 ; ... ; The operand of the instruction at #R64039 represents the start address of the input reading routine for the ; currently selected input device. This is modified by the instruction at #R63611. 64039 JP 64042 ; Jump to appropriate keyboard / joystick reading routine ; Capture Keyboard Input ; ; Used by the routine at #R64034. Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c64042 LD C,254 ; Load C with 254 (as all keyboard half-row "input addresses" have C = 254) ; The operand of the instruction at #R64044 represents the MSB of the "input address" to use in reading the keyboard ; for the currently defined LEFT key. It is modified by the routine at #R63740. 64044 LD B,127 ; Load B with MSB of "input address" 64046 IN A,(C) ; Read keyboard ; The operand of the instruction at #R64048 represents the index of the bit to use in reading the keyboard. It is ; modified by the routine at #R63740. 64048 BIT 3,A ; "N" key pressed so... 64050 CALL Z,64192 ; ...store a LEFT input from control device 64053 LD B,127 ; Load B with MSB of "input address" 64055 IN A,(C) ; Read keyboard 64057 BIT 2,A ; "M" key pressed so... 64059 CALL Z,64195 ; ...store a RIGHT input from control device 64062 LD B,253 ; IN 65022 reads the half row A to G... 64064 IN A,(C) ; Read keyboard 64066 BIT 0,A ; "A" key pressed so... 64068 CALL Z,64198 ; ...store an UP input from control device 64071 LD B,254 ; IN 65278 reads the half row CAPS SHIFT to V 64073 IN A,(C) ; Read keyboard 64075 BIT 1,A ; "Z" key pressed so... 64077 CALL Z,64201 ; ...store a DOWN input from control device 64080 LD B,127 ; IN 32766 reads the half row SPACE to B 64082 IN A,(C) ; Read keyboard 64084 BIT 0,A ; SPACE bar pressed so... 64086 CALL Z,64204 ; ...store a FIRE input from control device 64089 LD A,(HL) ; Load stored input into A 64090 RET ; Return ; Capture Kempston Joystick Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c64091 LD C,31 ; Load 31 (Kempston port number) into A 64093 IN A,(C) ; Read byte from port 31 (i.e. read state of joystick) 64095 BIT 0,A ; If joystick moved right... 64097 CALL NZ,64195 ; ...store a RIGHT input from control device 64100 BIT 1,A ; If joystick moved left... 64102 CALL NZ,64192 ; ...store a LEFT input from control device 64105 BIT 2,A ; If joystick moved down... 64107 CALL NZ,64201 ; ...store a DOWN input from control device 64110 BIT 3,A ; If joystick moved up... 64112 CALL NZ,64198 ; ...store an UP input from control device 64115 BIT 4,A ; If fire button pressed... 64117 CALL NZ,64204 ; ...store a FIRE input from control device 64120 LD A,(HL) ; Return stored joystick movement in A 64121 RET ; Return ; Capture Cursor Joystick Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c64122 LD C,254 ; IN 63486 reads the half row 1 to 5 64124 LD B,247 ; ... 64126 IN A,(C) ; Read keyboard/joystick 64128 BIT 4,A ; If joystick moved left ("5" key pressed)... 64130 CALL Z,64192 ; ...store a LEFT input from control device 64133 LD B,239 ; IN 61438 reads the half row O to 6 64135 IN A,(C) ; Read keyboard/joystick 64137 BIT 2,A ; If joystick moved right ("8" key pressed)... 64139 CALL Z,64195 ; ...store a RIGHT input from control device 64142 BIT 4,A ; If joystick moved down ("6" key pressed)... 64144 CALL Z,64201 ; ...store a DOWN input from control device 64147 BIT 3,A ; If joystick moved up ("7" key pressed)... 64149 CALL Z,64198 ; ...store an UP input from control device 64152 BIT 0,A ; If fire button pressed ("0" key pressed)... 64154 CALL Z,64204 ; ...store a FIRE input from control device 64157 LD A,(HL) ; Return stored joystick movement in A 64158 RET ; Return ; Capture Sinclair Joystick 1 Input Output: A Stored keypress (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c64159 LD C,254 ; IN 61438 reads the half row O to 6 64161 LD B,239 ; ... 64163 IN A,(C) ; ... 64165 BIT 4,A ; If joystick moved left ("6" key pressed)... 64167 CALL Z,64192 ; ...store a LEFT input from control device 64170 BIT 3,A ; If joystick moved right ("7" key pressed)... 64172 CALL Z,64195 ; ...store a RIGHT input from control device 64175 BIT 2,A ; If joystick moved down ("8" key pressed)... 64177 CALL Z,64201 ; ...store a DOWN input from control device 64180 BIT 1,A ; If joystick moved down ("9" key pressed)... 64182 CALL Z,64198 ; ...store an UP input from control device 64185 BIT 0,A ; If fire button pressed ("0" key pressed)... 64187 CALL Z,64204 ; ...store a FIRE input from control device 64190 LD A,(HL) ; Return stored joystick movement in A 64191 RET ; Return ; Store a LEFT Input from Control Device ; ; Used by the routines at #R64042, #R64091, #R64122 and #R64159. Input: HL Pointer to Input Control Flags ; (#R23487) c64192 SET 0,(HL) ; Set Left Pressed Flag 64194 RET ; Return ; Store a RIGHT Input from Control Device ; ; Used by the routines at #R64042, #R64091, #R64122 and #R64159. Input: HL Pointer to Input Control Flags ; (#R23487) c64195 SET 1,(HL) ; Set Right Pressed Flag 64197 RET ; Return ; Store an UP Input from Control Device ; ; Used by the routines at #R64042, #R64091, #R64122 and #R64159. Input: HL Pointer to Input Control Flags ; (#R23487) c64198 SET 2,(HL) ; Set Up Pressed Flag 64200 RET ; Return ; Store a DOWN Input from Control Device ; ; Used by the routines at #R64042, #R64091, #R64122 and #R64159. Input: HL Pointer to Input Control Flags ; (#R23487) c64201 SET 3,(HL) ; Set Down Pressed Flag 64203 RET ; Return ; Store a FIRE Input from Control Device ; ; Used by the routines at #R64042, #R64091, #R64122 and #R64159. Input: HL Pointer to Input Control Flags ; (#R23487) c64204 SET 4,(HL) ; Set Fire Pressed Flag 64206 RET ; Return ; Display Execute / Reject Command Window and Return if Execute Chosen, Else Exit to Main Game Loop ; ; Used by the routines at #R41578, #R41748, #R41924, #R42257, #R42638, #R43043, #R43494, #R43636, #R43874, #R44100, ; #R44337, #R44635, #R44861, #R44933, #R44990, #R45095, #R45131 and #R45149. c64207 CALL 47946 ; Play Hiss-Type Sound 64210 LD A,11 ; Draw "EXECUTE / REJECT COMMAND" Window... 64212 CALL 47185 ; ... 64215 LD HL,50731 ; Point to "EXECUTE COMMAND..." text... 64218 CALL 46902 ; ...and print to screen 64221 CALL 47502 ; Process keyboard / joystick input on a menu and load A with selected item index... 64224 OR A ; ...and if this is 0 (i.e. Execute Command)... 64225 RET Z ; ...then return 64226 POP HL ; Remove return address from stack 64227 JP 41742 ; Set Magic Knight's available action flags and jump to start of Main Game Loop ; Wait for Interrupt then Display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be pressed ; ; Used by the routines at #R37764, #R37880, #R37951, #R40258, #R41578, #R44253, #R45641, #R45685, #R45723, #R45963, ; #R63740, #R64317 and #R64582. c64230 HALT ; Wait for interrupt 64231 CALL 47946 ; Play Hiss-Type Sound 64234 LD A,14 ; Draw Window 14 ("PRESS FIRE TO CONTINUE")... 64236 CALL 47193 ; ... 64239 LD HL,50714 ; Point HL at "PRESS FIRE TO CONTINUE" text string... 64242 CALL 46902 ; ...and print to screen *64245 CALL 64034 ; Capture keyboard or joystick input loading result into A 64248 BIT 4,A ; If bit 4 (Fire Button Flag) is not set... 64250 JR Z,64245 ; ...then loop back to #R64245 64252 CALL 47592 ; Wait for Fire Button / Key to be Released 64255 JP 47897 ; 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 #R41578, #R41924 and #R44635. Input: HL (entry at #R64261 only) Address of text to print ; in window c64258 LD HL,51849 ; Point HL at "YOUR HANDS ARE FULL" text ; This entry point is used by the routines at #R41578, #R41748, #R41924, #R42157, #R42257, #R44635, #R64265, #R64270 ; and #R64275. *64261 CALL 64317 ; Display Window 13 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64264 b64264 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 #R41578 and #R41924. c64265 LD HL,51864 ; Point HL at "THE [name of current object] IS TOO HEAVY FOR YOU" text 64268 JR 64261 ; 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 routines at #R41924, #R42091, #R42105 and #R42247. c64270 LD HL,52061 ; Point HL at "[Current Character's short name] WANTS TO KEEP THE [name of Current Object]" ; text 64273 JR 64261 ; 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 routines at #R42257 and #R42429. c64275 LD HL,52144 ; Point HL at "[Current Character's short name] DOES NOT WANT THE [name of Current Object]" ; text 64278 JR 64261 ; Display Window 13 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 routines at #R43318, #R43428 and #R45423. c64280 LD HL,52631 ; Point HL at "[Current Character's short name] DOES NOT WANT TO BE COMMANDED BY YOU " text 64283 JR 64313 ; 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 #R43250, #R45224, #R45227, #R45256, #R45333, #R45342, #R45345 and #R45348. c64285 LD HL,52770 ; Point HL at "[Current Character's short name] CANNOT HELP YOU  " text 64288 JR 64313 ; Display Window 29 with text at HL, wait for Fire to be pressed then jump to Main Game Loop ; Display "YOU CANNOT [Current Command] THAT SPELL NOW..." Window (12), wait for Fire to be pressed then Jump to ; Main Game Loop ; ; Used by the routines at #R43950, #R43998, #R44001, #R44063, #R44100 and #R44198. c64290 LD HL,55549 ; Point HL at "YOU CANNOT [Current Command] THAT SPELL NOW..." text ; This entry point is used by the routines at #R43199, #R43636, #R44100 and #R44337. *64293 CALL 64317 ; Display Window 15 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64296 b64296 DEFB 15 ; ... ; Display Window 12 with Text at HL, wait for Fire to be pressed then Jump to Main Game Loop ; ; Used by the routines at #R41748, #R43494, #R44990, #R45095, #R45131 and #R45149. c64297 CALL 64317 ; Display Window 12 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64300 b64300 DEFB 12 ; ... ; Display Window 24 with Text at HL, wait for Fire to be pressed then Jump to Main Game Loop ; ; Used by the routines at #R45227, #R45256 and #R45336. c64301 CALL 64317 ; Display Window 24 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64304 b64304 DEFB 24 ; ... ; Display Window 27 with Text at HL, wait for Fire to be pressed then Jump to Main Game Loop ; ; Used by the routines at #R44001, #R44063, #R44198 and #R44337. c64305 CALL 64317 ; Display Window 27 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64308 b64308 DEFB 27 ; ... ; Display Window 28 with Text at HL, wait for Fire to be pressed then Jump to Main Game Loop ; ; Used by the routine at #R44337. c64309 CALL 64317 ; Display Window 28 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64312 b64312 DEFB 28 ; ... ; Display Window 29 with Text at HL, wait for Fire to be pressed then Jump to Main Game Loop ; ; Used by the routines at #R40338, #R43117, #R43158, #R43199, #R43250, #R43318, #R43428, #R44933, #R64280 and ; #R64285. c64313 CALL 64317 ; Display Window 29 with text at HL, wait for Fire to be pressed then jump to Main Game Loop... ; Data block at 64316 b64316 DEFB 29 ; ... ; 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 #R43620, #R44896, #R64261, #R64293, #R64297, #R64301, #R64305, ; #R64309 and #R64313. 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 c64317 POP DE ; Remove value on top of stack, as we are not RETurning to this address, but reading data from ; it 64318 LD A,(DE) ; Load A with window index data... 64319 LD (64340),A ; ...and modify instruction at #R64339 with this index 64322 PUSH HL ; Store HL (pointer to text to print) 64323 LD L,A ; Load eight times window index into HL... 64324 LD H,0 ; ... 64326 ADD HL,HL ; ... 64327 ADD HL,HL ; ... 64328 ADD HL,HL ; ... 64329 LD DE,49036 ; Point DE at y-coordinate of top of window in first entry of Window Data table at #R49034 64332 ADD HL,DE ; ...and add HL as offset in HL 64333 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) 64334 POP HL ; Restore HL (pointer to text to print) 64335 CALL 45617 ; Adjust height of window to accommodate text 64338 PUSH HL ; Store HL (pointer to start of text data) ; The operand of the instruction at #R64339 represents a window index. This is modified by the instruction at ; #R64319. 64339 LD A,0 ; Draw window with index specified in data previously... 64341 CALL 47193 ; ... 64344 POP HL ; Restore HL (pointer to start of text data) 64345 CALL 46902 ; Print text to screen 64348 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 64351 JP 41742 ; Set Magic Knight's available action flags and jump to start of Main Game Loop ; Scroll a Region of the Display File Up a Pixel Row Without Wrapping ; ; Used by the routine at #R47603. c64354 LD HL,64360 ; Load HL with address of routine at #R64360 (return) 64357 JP 64367 ; Jump to #R64367 (scroll a region of the Display File up a pixel row then return) ; Do Nothing (Return) ; ; Used by the routines at #R64367 and #R64456. c64360 RET ; Return ; Scroll a Region of the Display File Down a Pixel Row Without Wrapping ; ; Used by the routine at #R47665. c64361 LD HL,64360 ; Load HL with address of routine at #R64360 (return) 64364 JP 64456 ; Jump to #R64456 (scroll a region of the Display File down a pixel row then return) ; Scroll a Region of the Display File Up a Pixel Row ; ; Used by the routine at #R64354. Input: HL Address to jump to at the end of this routine (instruction at #R64453) c64367 LD (64454),HL ; Modify jump (at #R64453) destination to address stored in HL 64370 LD A,(23406) ; Load y-coordinate of top of region to scroll (pixels) into C... 64373 LD C,A ; ... 64374 LD DE,65140 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 64377 LD H,0 ; Load HL with double y-coordinate of top of region to scroll... 64379 LD L,A ; ...(as entries in table at #R26240 are two bytes wide)... 64380 ADD HL,HL ; ... 64381 ADD HL,DE ; ...and add to DE as offset in HL 64382 LD E,(HL) ; Load Display File address of pixel row of interest into DE... 64383 INC HL ; ... 64384 LD D,(HL) ; ... 64385 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 #R65140) 64386 LD A,(23407) ; Load y-coordinate of bottom of region to scroll (pixels) into A... 64389 SUB C ; ...and subtract C to get height of region to scroll (pixels) 64390 EX AF,AF' ; Swap AF and AF' (A' now holds height of region to scroll in pixels) 64391 LD A,(23404) ; Load C with x-coordinate of left edge of region to scroll (characters)... 64394 LD C,A ; ... 64395 LD A,L ; Add this x-coordinate value as offset (via OR) to HL... 64396 OR C ; ... 64397 LD L,A ; ... 64398 LD A,(23405) ; Load A with x-coordinate of right edge of region to scroll (characters) 64401 SUB C ; Subtract C... 64402 INC A ; ...and add one to get width (characters) of region to scroll 64403 LD B,0 ; Load BC with width of region to scroll (characters)... 64405 LD C,A ; ... 64406 PUSH BC ; Store BC (width of region to scroll in characters) 64407 PUSH HL ; Store HL (current position in Display File, at left edge of top pixel row in region to ; scroll) 64408 LD DE,23296 ; Point DE at #R23296 64411 LDIR ; Copy BC bytes of data from HL to DE 64413 POP HL ; Restore HL (current position in Display File, at left edge of top pixel row in region to ; scroll) 64414 POP BC ; Restore BC (width of region to scroll in characters) 64415 EXX ; Swap all registers (B' = width of region to scroll in characters) 64416 EX AF,AF' ; Swap AF and AF' (A now holds height of region to scroll in pixels) 64417 JP Z,64452 ; If height of region to scroll in pixels is zero then skip ahead to #R64452 64420 LD B,A ; Load B with height of region to scroll in pixels *64421 EXX ; Swap all registers (B = width of region to scroll, B' = remaining number of pixel rows to ; scroll) 64422 LD A,H ; Load D and A with H plus 1 and E with L... 64423 INC A ; ... 64424 LD D,A ; ... 64425 LD E,L ; ... 64426 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)... 64428 JP NZ,64442 ; ...then skip ahead to #R64442 ; 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 64431 LD A,E ; Move DE on by 32 bytes to move up one character row (eight rows of pixels)... 64432 ADD A,32 ; ... 64434 LD E,A ; ... 64435 JP C,64442 ; 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 #R64442... 64438 LD A,D ; ...else move up by a third... 64439 SUB 8 ; ... 64441 LD D,A ; ... *64442 EX DE,HL ; Swap DE (now points to start of upper pixel row) and HL (now points to start of lower pixel ; row) 64443 PUSH HL ; Store HL (pointer to lower pixel row) 64444 PUSH BC ; Store BC (B = width of region to scroll, in characters) 64445 LDIR ; Copy row of bitmap data up a row from HL to DE 64447 POP BC ; Restore BC (B = width of region to scroll, in characters) 64448 POP HL ; Store HL (pointer to upper pixel row) 64449 EXX ; Swap all registers (B = remaining number of pixel rows to scroll, B' = width of region to ; scroll) 64450 DJNZ 64421 ; Loop back to #R64421 to copy next row of pixels up *64452 EXX ; Swap all registers ; The operand of the instruction at #R64453 is the address to jump to upon completion of this routine. This is ; modified by the instruction at #R64367, set to the value in HL at the start of this routine. The only value this ; is set to is #R64360 (return). 64453 JP 64360 ; Jump to address that was in HL at start of this routine (return) ; Scroll a Region of the Display File Down a Pixel Row ; ; Used by the routine at #R64361. Input: HL Address to jump to at the end of this routine (instruction at #R64545) c64456 LD (64546),HL ; Modify jump (at #R64545) destination to address stored in HL 64459 LD A,(23407) ; Load y-coordinate of bottom of region to scroll (pixels) into A and C... 64462 LD C,A ; ... 64463 LD DE,65140 ; Point DE at Table of Display File Addresses of Start of Each Pixel Row 64466 LD H,0 ; Load HL with double y-coordinate of bottom of region to scroll... 64468 LD L,A ; ...(as entries in table at #R26240 are two bytes wide)... 64469 ADD HL,HL ; ... 64470 ADD HL,DE ; ...and add to DE as offset in HL 64471 LD E,(HL) ; Load Display File address of pixel row of interest into DE... 64472 INC HL ; ... 64473 LD D,(HL) ; ... 64474 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 #R65140) 64475 LD A,(23406) ; Load y-coordinate of top of region to scroll (pixels) into B... 64478 LD B,A ; ... 64479 LD A,C ; Load y-coordinate of bottom of region to scroll into A... 64480 SUB B ; ...and subtract B to get height of region to scroll (pixels) 64481 EX AF,AF' ; Swap AF and AF' (A' now holds height of region to scroll in pixels) 64482 LD A,(23404) ; Load C with x-coordinate of left edge of region to scroll (characters)... 64485 LD C,A ; ... 64486 LD A,L ; Add this x-coordinate value as offset (via OR) to HL... 64487 OR C ; ... 64488 LD L,A ; ... 64489 LD A,(23405) ; Load A with x-coordinate of right edge of region to scroll (characters) 64492 SUB C ; Subtract C... 64493 INC A ; ...and add one to get width (characters) of region to scroll 64494 LD B,0 ; Load BC with width of region to scroll (characters)... 64496 LD C,A ; ... 64497 PUSH BC ; Store BC (width of region to scroll in characters) 64498 PUSH HL ; Store HL (current position in Display File, at left edge of bottom pixel row in region to ; scroll) 64499 LD DE,23296 ; Point DE at #R23296 64502 LDIR ; Copy BC bytes of data from HL to DE 64504 POP HL ; Restore HL (current position in Display File, at left edge of bottom pixel row in region to ; scroll) 64505 POP BC ; Restore BC (width of region to scroll in characters) 64506 EXX ; Swap all registers (B' = width of region to scroll in characters) 64507 EX AF,AF' ; Swap AF and AF' (A now holds height of region to scroll in pixels) 64508 JP Z,64544 ; If height of region to scroll in pixels is zero then skip ahead to #R64544 64511 LD B,A ; Load B with height of region to scroll in pixels *64512 EXX ; Swap all registers (B = width of region to scroll, B' = remaining number of pixel rows to ; scroll) 64513 LD A,H ; Load D and A with H minus 1 and E with L... 64514 DEC A ; ... 64515 LD E,L ; ... 64516 LD D,A ; ... 64517 CPL ; Invert all bits in A 64518 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)... 64520 JP NZ,64534 ; ...then skip ahead to #R64534 ; 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 64523 LD A,E ; Move DE back by 32 bytes to move up one character row (eight rows of pixels)... 64524 SUB 32 ; ... 64526 LD E,A ; ... 64527 JP C,64534 ; 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 #R64534... 64530 LD A,D ; ...else move down by a third... 64531 ADD A,8 ; ... 64533 LD D,A ; ... *64534 EX DE,HL ; Swap DE (now points to start of lower pixel row) and HL (now points to start of upper pixel ; row) 64535 PUSH HL ; Store HL (pointer to upper pixel row) 64536 PUSH BC ; Store BC (B = width of region to scroll, in characters) 64537 LDIR ; Copy row of bitmap data down a row from HL to DE 64539 POP BC ; Restore BC (B = width of region to scroll, in characters) 64540 POP HL ; Store HL (pointer to upper pixel row) 64541 EXX ; Swap all registers (B = remaining number of pixel rows to scroll, B' = width of region to ; scroll) 64542 DJNZ 64512 ; Loop back to #R64512 to copy next row of pixels down *64544 EXX ; Swap all registers ; The operand of the instruction at #R64545 is the address to jump to upon completion of this routine. This is ; modified by the instruction at #R64456, set to the value in HL at the start of this routine. The only value this ; is set to is #R64360 (return). 64545 JP 64360 ; Jump to address that was in HL at start of this routine (return) ; Flash Border and Screen (as in Cast a Spell) ; ; Used by the routines at #R44216, #R44225 and #R44253. c64548 LD B,96 ; Load B with 96 (number of times to repeat routine) *64550 LD DE,576 ; Load DE with 576 (number of bytes to modify - i.e. bottom 18 rows) 64553 LD HL,22720 ; Point HL at start of 7th row in Attribute File *64556 LD A,(HL) ; Load attribute byte into A 64557 AND 248 ; Clear three lowest bits (i.e. INK colour) preserving only PAPER, BRIGHT and FLASH bits 64559 LD C,A ; Place modified value into C 64560 LD A,(HL) ; Get original attribute from screen again 64561 INC A ; Increase by one 64562 AND 7 ; Clear all bits except the lowest three (i.e. INK colour) 64564 OUT (254),A ; Set border colour to A 64566 OR C ; Combine other bits back in 64567 OUT (254),A ; Update border / speaker state 64569 LD (HL),A ; Load modified value back into Attribute File 64570 INC HL ; Move to next byte in Attribute File 64571 DEC DE ; Reduce DE (reducing number of attribute bytes left to modify) 64572 LD A,D ; If DE is not zero (i.e. there are more attribute bytes to modify)... 64573 OR E ; ... 64574 JR NZ,64556 ; ...then loop back to #R64556 64576 DJNZ 64550 ; Loop back for another pass 64578 XOR A ; Set A to zero 64579 OUT (254),A ; Reset border to black and reset speaker state 64581 RET ; Return ; Display Cyan "Game Over" Window and Return to Control Selection Menu ; ; Used by the routines at #R38205, #R38841, #R40258, #R40598, #R41748, #R43636, #R44216, #R44253, #R45723, #R46560 ; and #R62877. Input: HL Points to location of a string c64582 RES 0,(IY+65) ; Reset Game In Progress Flag (IY = 23610) 64586 LD DE,49228 ; Adjust height of window 24 ("Game Over" Window) to accommodate text... 64589 CALL 45617 ; ... 64592 PUSH HL ; Store HL (points to first character of text to display) 64593 LD A,24 ; Draw Window 24 ("Game Over" Window)... 64595 CALL 47193 ; ... 64598 LD HL,50779 ; Point to string for percentage completion 64601 LD DE,50791 ; Point to string for time left 64604 CALL 45522 ; Insert current time and score into "Time Left" and "Percentage Completion" texts 64607 LD HL,50756 ; Point HL at "GAME OVER / TOTAL COMPLETION XX% / TIME LEFT XX HOURS" text... 64610 CALL 46902 ; ...and print to screen 64613 POP HL ; Restore HL (points to first character of text to display) 64614 CALL 46902 ; Print text to screen 64617 CALL 64230 ; Wait for interrupt then display "PRESS FIRE TO CONTINUE" Window and wait for Fire to be ; pressed 64620 JP 37689 ; Wait for interrupt then 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 #R41924, #R42257, #R42494, #R43043, #R43250 and #R43874. Input: A An index HL First ; entry in list of addresses c64623 CALL 64627 ; Load address with index A in a list of addresses at HL into HL 64626 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 #R38841, #R39014, #R39189, #R39655, #R63598 and #R64623. 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) c64627 ADD A,A ; Double offset value... 64628 LD D,0 ; ...and load into DE... 64630 LD E,A ; ... 64631 ADD HL,DE ; Add doubled offset to address in HL ; This entry point is used by the routines at #R40784, #R41035 and #R63504. *64632 LD A,(HL) ; Load address at HL into HL... 64633 INC HL ; ... 64634 LD H,(HL) ; ... 64635 LD L,A ; ... 64636 RET ; Return ; If Do Not Draw Storm Cloud Flag is Set then Prepare to Draw Storm Cloud ; ; This routine is only called when the Storm Cloud and Magic Knight are both in the same room. c64637 LD A,(64688) ; If Do Not Draw Storm Cloud Flag is reset... 64640 OR A ; ... 64641 RET Z ; ...then return 64642 LD A,(23701) ; Load BC with Storm Cloud's apparent x-coordinate (characters)... 64645 RRCA ; ... 64646 RRCA ; ... 64647 RRCA ; ... 64648 AND 31 ; ... 64650 LD C,A ; ... 64651 LD B,0 ; ... 64653 LD HL,16544 ; Load HL with Display File address for top pixel row of cell at character coordinates (0, 5) 64656 ADD HL,BC ; Add BC to HL as offset... 64657 LD (64704),HL ; ...and store at #R64703 64660 LD A,(23701) ; Load HL with Storm Cloud's apparent x-coordinate (pixel-within-character)... 64663 AND 7 ; ... 64665 ADD A,A ; ...multiplied by 128... 64666 ADD A,A ; ...as each Storm Cloud frame graphic is 128 bytes long... 64667 ADD A,A ; ... 64668 ADD A,A ; ... 64669 LD L,A ; ... 64670 LD H,0 ; ... 64672 ADD HL,HL ; ... 64673 ADD HL,HL ; ... 64674 ADD HL,HL ; ... 64675 LD BC,25176 ; Load BC with start address of Storm Cloud graphic data... 64678 ADD HL,BC ; ...and add HL as offset in HL to give address of required frame's graphic data 64679 LD (64708),HL ; Store graphic's start address at #R64707 64682 XOR A ; Reset Do Not Draw Storm Cloud Flag... 64683 LD (64688),A ; ... 64686 RET ; Return ; If Do Not Draw Storm Cloud Flag is Reset then Draw Storm Cloud ; ; If the Do Not Draw Storm Cloud Flag is reset, then the Storm Cloud will be drawn. After this, the flag is set, ; ensuring that the position of the Storm Cloud can be updated by the routine at #R64637. This also ensures that if ; Magic Knight moves to a different room, the drawing of the Storm Cloud will cease, since the Do Not Draw Storm ; Cloud Flag is only reset by the routine at #R64637, which in turn is only called when both the Storm Cloud and ; Magic Knight are in the same room. The operand of the instruction at #R64687 represents the Do Not Draw Storm ; Cloud Flag. This is modified by the instructions at #R38134, #R64683 and #R64806. c64687 LD A,1 ; If Do Not Draw Storm Cloud Flag is set... 64689 OR A ; ... 64690 RET NZ ; ...then return 64691 LD HL,(23677) ; Store value of system variable COORDS on stack... 64694 PUSH HL ; ... 64695 LD HL,(63018) ; Load HL with address of Bitmap Virtual Text Cursor 64698 PUSH HL ; Store HL (Bitmap Virtual Cursor address) 64699 LD HL,(23707) ; Load HL with address of Attribute Virtual Text Cursor 64702 PUSH HL ; Store HL (Attribute Virtual Cursor address) ; The operand of the instruction at #R64703 represents the Display File address for the top-left of the Storm Cloud. ; This is modified by the instruction at #R64657. 64703 LD HL,0 ; Load HL with current Display File address of Storm Cloud 64706 PUSH HL ; Store HL (current Display File address of Storm Cloud) ; The operand of the instruction at #R64707 represents the start address of the graphic data for the Storm Cloud's ; current frame. This is modified by the instruction at #R64679. 64707 LD DE,0 ; Load DE with start address of graphic data for Storm Cloud's current frame 64710 LD B,8 ; Load B with 8 (as we are drawing the first eight pixel rows of cloud graphic data) *64712 PUSH HL ; Store HL (current Display File address at left side of cloud) 64713 LD A,(DE) ; Copy a run of eight bytes from Storm Cloud's graphic data... 64714 LD (HL),A ; ...to Display File, starting at current Display File address... 64715 INC HL ; ... 64716 INC DE ; ... 64717 LD A,(DE) ; ... 64718 LD (HL),A ; ... 64719 INC HL ; ... 64720 INC DE ; ... 64721 LD A,(DE) ; ... 64722 LD (HL),A ; ... 64723 INC HL ; ... 64724 INC DE ; ... 64725 LD A,(DE) ; ... 64726 LD (HL),A ; ... 64727 INC HL ; ... 64728 INC DE ; ... 64729 LD A,(DE) ; ... 64730 LD (HL),A ; ... 64731 INC HL ; ... 64732 INC DE ; ... 64733 LD A,(DE) ; ... 64734 LD (HL),A ; ... 64735 INC HL ; ... 64736 INC DE ; ... 64737 LD A,(DE) ; ... 64738 LD (HL),A ; ... 64739 INC HL ; ... 64740 INC DE ; ... 64741 LD A,(DE) ; ... 64742 LD (HL),A ; ... 64743 INC DE ; Advance DE to next byte in graphic data (i.e. start of next pixel row) 64744 POP HL ; Restore HL (current Display File address at left side of cloud) 64745 INC H ; Advance down a pixel row 64746 DJNZ 64712 ; Decrease remaining number of pixel rows to draw, and loop back to #R64712 if not zero 64748 POP HL ; Restore HL (current Display File address of Storm Cloud) 64749 LD A,32 ; Add 32 to Display File address to move down eight pixels... 64751 ADD A,L ; ... 64752 LD L,A ; ... 64753 XOR A ; Set A to zero (see trivia) 64754 LD B,5 ; Load B with 5 (as we are drawing a further five pixel rows of cloud graphic data) *64756 PUSH HL ; Store HL (current Display File address at left side of cloud) 64757 LD A,(DE) ; Copy a run of eight bytes from Storm Cloud's graphic data... 64758 LD (HL),A ; ...to Display File, starting at current Display File address... 64759 INC HL ; ... 64760 INC DE ; ... 64761 LD A,(DE) ; ... 64762 LD (HL),A ; ... 64763 INC HL ; ... 64764 INC DE ; ... 64765 LD A,(DE) ; ... 64766 LD (HL),A ; ... 64767 INC HL ; ... 64768 INC DE ; ... 64769 LD A,(DE) ; ... 64770 LD (HL),A ; ... 64771 INC HL ; ... 64772 INC DE ; ... 64773 LD A,(DE) ; ... 64774 LD (HL),A ; ... 64775 INC HL ; ... 64776 INC DE ; ... 64777 LD A,(DE) ; ... 64778 LD (HL),A ; ... 64779 INC HL ; ... 64780 INC DE ; ... 64781 LD A,(DE) ; ... 64782 LD (HL),A ; ... 64783 INC HL ; ... 64784 INC DE ; ... 64785 LD A,(DE) ; ... 64786 LD (HL),A ; ... 64787 INC DE ; ... 64788 POP HL ; Restore HL (current Display File address at left side of cloud) 64789 INC H ; Advance down a pixel row 64790 DJNZ 64756 ; Decrease remaining number of pixel rows to draw, and loop back to #R64756 if not zero 64792 POP HL ; Restore HL (Attribute Virtual Cursor address) 64793 LD (23707),HL ; Restore Attribute Virtual Cursor address 64796 POP HL ; Restore HL (Bitmap Virtual Cursor address) 64797 LD (63018),HL ; Restore Bitmap Virtual Cursor address 64800 POP HL ; Restore value of system variable COORDS from stack... 64801 LD (23677),HL ; ... 64804 LD A,1 ; Set Do Not Draw Storm Cloud Flag... 64806 LD (64688),A ; ... 64809 RET ; Return ; Set New Random Seed and Load A with a Random Number ; ; Used by the routine at #R64829. Output: A LSB of new random seed c64810 PUSH HL ; Store HL 64811 PUSH BC ; Store BC 64812 LD BC,(23671) ; Load system variables Seed (hi) and Frames (1) into BC 64816 LD HL,(23670) ; Load system variable Seed into HL 64819 ADD HL,BC ; Add these together 64820 LD A,H ; Add together H and L in A... 64821 ADD A,L ; ... 64822 LD L,A ; ...and load into L 64823 LD (23670),HL ; Place new HL back into system variable Seed 64826 POP BC ; Restore BC 64827 POP HL ; Restore HL 64828 RET ; Return ; Generate a Random Seed / Random Number Up To B ; ; Used by the routine at #R38024. Input: B Cap value Output: A Random number c64829 CALL 64810 ; Set new random seed and load A with a random number 64832 CP B ; If random seed is greater than or equal to B... 64833 JR NC,64829 ; ...then loop back to #R64829 64835 RET ; Return ; Select Magic Knight's Room (Cheat / Debug Routine) ; ; Used by the routine at #R38205. c64836 EX AF,AF' ; Switch AF and AF' 64837 LD A,(23728) ; If Cheat Mode Enabled Flag is set (see trivia)... 64840 OR A ; ... 64841 JR NZ,64845 ; ...then skip ahead to #R64845 64843 EX AF,AF' ; Switch AF and AF' 64844 RET ; Return *64845 POP HL ; Remove return address from top of Stack 64846 CALL 47989 ; Set parameters (for Cheat Routine Sound) and play ; This entry point is used by the routine at #R64878. *64849 LD A,2 ; Set BORDER to red... 64851 OUT (254),A ; ... 64853 CALL 64034 ; Capture keyboard or joystick input loading result into A 64856 BIT 0,A ; If left pressed... 64858 JR NZ,64883 ; ...then jump to #R64883 (decrease Magic Knight's current room index by 1, wrapping around to ; 51 if below zero) 64860 BIT 1,A ; If right pressed... 64862 JR NZ,64906 ; ...then jump to #R64906 (increase Magic Knight's current room index by 1, wrapping around to ; zero if above 51) 64864 BIT 2,A ; If up pressed... 64866 JR NZ,64912 ; ...then jump to #R64912 (increase Magic Knight's current room index by 8, wrapping around to ; zero if above 51) 64868 BIT 3,A ; If down pressed... 64870 JR NZ,64919 ; ...then jump to #R64919 (decrease Magic Knight's current room index by 8, wrapping around to ; 51 if below zero) 64872 BIT 4,A ; If fire pressed... 64874 JR NZ,64926 ; ...then jump to #R64926 (exit Cheat / Debug Mode) 64876 JR 64849 ; Loop back to #R64849 ; Cheat / Debug Routine Draw Magic Knight's Current Room then Jump Back into Cheat Routine Main Loop ; ; Used by the routine at #R64883. c64878 CALL 38844 ; Draw Magic Knight's current room, draw objects and characters and initialise room-specific ; data 64881 JR 64849 ; Jump back into Cheat Routine main loop ; Cheat / Debug Routine Decrease Magic Knight's Current Room Index By 1, Wrapping Around to 51 if Below Zero ; ; Used by the routine at #R64836. c64883 LD A,(23702) ; Load A with index of Magic Knight's current room... 64886 DEC A ; ...minus 1 ; This entry point is used by the routines at #R64906, #R64912 and #R64919. *64887 OR A ; If new room index is not less than zero... 64888 JP P,64893 ; ...then skip ahead to #R64893 64891 ADD A,52 ; Add 52 to new room index (wrap 0 to 51) *64893 CP 52 ; If new room index is less than 52... 64895 JR C,64901 ; ...then skip ahead to #R64901 64897 SUB 52 ; Subtract 52 from new room index (wrap 51 to 0) 64899 JR 64893 ; Loop back to #R64893 *64901 LD (23702),A ; Store Magic Knight's new room index 64904 JR 64878 ; Draw Magic Knight's current room then jump back into Cheat Routine Main Loop ; Cheat / Debug Routine Increase Magic Knight's Current Room Index By 1, Wrapping Around to Zero if Above 51 ; ; Used by the routine at #R64836. c64906 LD A,(23702) ; Load A with index of Magic Knight's current room... 64909 INC A ; ...plus 1 64910 JR 64887 ; Wrap new index if out of range, store and jump back to Cheat Routine Main Loop ; Cheat / Debug Routine Increase Magic Knight's Current Room Index By 8, Wrapping Around to Zero if Above 51 ; ; Used by the routine at #R64836. c64912 LD A,(23702) ; Load A with index of Magic Knight's current room... 64915 ADD A,8 ; ...plus 8 64917 JR 64887 ; Wrap new index if out of range, store and jump back to Cheat Routine Main Loop ; Cheat / Debug Routine Decrease Magic Knight's Current Room Index By 8, Wrapping Around to Zero if Below Zero ; ; Used by the routine at #R64836. c64919 LD A,(23702) ; Load A with index of Magic Knight's current room... 64922 SUB 8 ; ...minus 8 64924 JR 64887 ; Wrap new index if out of range, store and jump back to Cheat Routine Main Loop ; Cheat / Debug Routine Exit Cheat / Debug Mode ; ; Used by the routine at #R64836. c64926 XOR A ; Set BORDER to black... 64927 OUT (254),A ; ... 64929 CALL 47897 ; Play upward scale sound 64932 JP 38205 ; Jump to start of Main Game Loop ; Set Left and Right x-Coordinates (23408 and 23410) to Edges of Screen and Load A with Magic Knight's Current ; Strength ; ; Used by the routine at #R46463. Output: A Magic Knight's current strength c64935 XOR A ; Set left-edge x-coordinate value at #R23408 to zero... 64936 LD (23408),A ; ... 64939 LD A,31 ; Set right-edge x-coordinate value at #R23410 to 31... 64941 LD (23410),A ; ... 64944 LD A,(24768) ; Load A with Magic Knight's current strength 64947 RET ; Return ; Unused b64948 DEFB 11,24,29,1,28,48,26,34 64956 DEFB 43,1,17,27,18,56,50,39 64964 DEFB 33,18,45,1,61,61,61,61 64972 DEFB 61,61,61,61,61,61,61,24 64980 DEFB 41,33,61,61,25,22,53,48 64988 DEFB 37,38,1,24,24,25,25,25 64996 DEFB 41,41,26,25,38,24,25,24 65004 DEFB 46,18,52,31,1,29,36,24 65012 DEFB 43,26,25,25,24,26,25,30 65020 DEFB 45,26,58,23,25,35,24,53 65028 DEFB 26,22,26,40,40,42,55,49 65036 DEFB 47,25,24,27,56,52,50,50 65044 DEFB 42,44,25,36,25,26,26,49 65052 DEFB 24,49,54,60,22,56,27,22 65060 DEFB 22,23,23,21,21,21,35,22 65068 DEFB 22,22,22,25,24,25,25,26 65076 DEFB 28,25,23,21,23,35,1,43 65084 DEFB 34,1,16,16,16,40,26,25 65092 DEFB 45,40,0,39,59,1,43,43 65100 DEFB 43,47,58,41,51,27,27,36 65108 DEFB 41,38,11,1,20,27,16,21 65116 DEFB 29,28,8,58,42,42,42,42 65124 DEFB 59,60,60,60,60,60,60,60 65132 DEFB 60,59,31,25,0,24,76,255 ; Table of Display File Addresses of Start of Each Pixel Row ; ; Addresses are in sequence, from top to bottom of display b65140 DEFW 16384 65142 DEFW 16640 65144 DEFW 16896 65146 DEFW 17152 65148 DEFW 17408 65150 DEFW 17664 65152 DEFW 17920 65154 DEFW 18176 65156 DEFW 16416 65158 DEFW 16672 65160 DEFW 16928 65162 DEFW 17184 65164 DEFW 17440 65166 DEFW 17696 65168 DEFW 17952 65170 DEFW 18208 65172 DEFW 16448 65174 DEFW 16704 65176 DEFW 16960 65178 DEFW 17216 65180 DEFW 17472 65182 DEFW 17728 65184 DEFW 17984 65186 DEFW 18240 65188 DEFW 16480 65190 DEFW 16736 65192 DEFW 16992 65194 DEFW 17248 65196 DEFW 17504 65198 DEFW 17760 65200 DEFW 18016 65202 DEFW 18272 65204 DEFW 16512 65206 DEFW 16768 65208 DEFW 17024 65210 DEFW 17280 65212 DEFW 17536 65214 DEFW 17792 65216 DEFW 18048 65218 DEFW 18304 65220 DEFW 16544 65222 DEFW 16800 65224 DEFW 17056 65226 DEFW 17312 65228 DEFW 17568 65230 DEFW 17824 65232 DEFW 18080 65234 DEFW 18336 65236 DEFW 16576 65238 DEFW 16832 65240 DEFW 17088 65242 DEFW 17344 65244 DEFW 17600 65246 DEFW 17856 65248 DEFW 18112 65250 DEFW 18368 65252 DEFW 16608 65254 DEFW 16864 65256 DEFW 17120 65258 DEFW 17376 65260 DEFW 17632 65262 DEFW 17888 65264 DEFW 18144 65266 DEFW 18400 65268 DEFW 18432 65270 DEFW 18688 65272 DEFW 18944 65274 DEFW 19200 65276 DEFW 19456 65278 DEFW 19712 65280 DEFW 19968 65282 DEFW 20224 65284 DEFW 18464 65286 DEFW 18720 65288 DEFW 18976 65290 DEFW 19232 65292 DEFW 19488 65294 DEFW 19744 65296 DEFW 20000 65298 DEFW 20256 65300 DEFW 18496 65302 DEFW 18752 65304 DEFW 19008 65306 DEFW 19264 65308 DEFW 19520 65310 DEFW 19776 65312 DEFW 20032 65314 DEFW 20288 65316 DEFW 18528 65318 DEFW 18784 65320 DEFW 19040 65322 DEFW 19296 65324 DEFW 19552 65326 DEFW 19808 65328 DEFW 20064 65330 DEFW 20320 65332 DEFW 18560 65334 DEFW 18816 65336 DEFW 19072 65338 DEFW 19328 65340 DEFW 19584 65342 DEFW 19840 65344 DEFW 20096 65346 DEFW 20352 65348 DEFW 18592 65350 DEFW 18848 65352 DEFW 19104 65354 DEFW 19360 65356 DEFW 19616 65358 DEFW 19872 65360 DEFW 20128 65362 DEFW 20384 65364 DEFW 18624 65366 DEFW 18880 65368 DEFW 19136 65370 DEFW 19392 65372 DEFW 19648 65374 DEFW 19904 65376 DEFW 20160 65378 DEFW 20416 65380 DEFW 18656 65382 DEFW 18912 65384 DEFW 19168 65386 DEFW 19424 65388 DEFW 19680 65390 DEFW 19936 65392 DEFW 20192 65394 DEFW 20448 65396 DEFW 20480 65398 DEFW 20736 65400 DEFW 20992 65402 DEFW 21248 65404 DEFW 21504 65406 DEFW 21760 65408 DEFW 22016 65410 DEFW 22272 65412 DEFW 20512 65414 DEFW 20768 65416 DEFW 21024 65418 DEFW 21280 65420 DEFW 21536 65422 DEFW 21792 65424 DEFW 22048 65426 DEFW 22304 65428 DEFW 20544 65430 DEFW 20800 65432 DEFW 21056 65434 DEFW 21312 65436 DEFW 21568 65438 DEFW 21824 65440 DEFW 22080 65442 DEFW 22336 65444 DEFW 20576 65446 DEFW 20832 65448 DEFW 21088 65450 DEFW 21344 65452 DEFW 21600 65454 DEFW 21856 65456 DEFW 22112 65458 DEFW 22368 65460 DEFW 20608 65462 DEFW 20864 65464 DEFW 21120 65466 DEFW 21376 65468 DEFW 21632 65470 DEFW 21888 65472 DEFW 22144 65474 DEFW 22400 65476 DEFW 20640 65478 DEFW 20896 65480 DEFW 21152 65482 DEFW 21408 65484 DEFW 21664 65486 DEFW 21920 65488 DEFW 22176 65490 DEFW 22432 65492 DEFW 20672 65494 DEFW 20928 65496 DEFW 21184 65498 DEFW 21440 65500 DEFW 21696 65502 DEFW 21952 65504 DEFW 22208 65506 DEFW 22464 65508 DEFW 20704 65510 DEFW 20960 65512 DEFW 21216 65514 DEFW 21472 65516 DEFW 21728 65518 DEFW 21984 65520 DEFW 22240 65522 DEFW 22496 ; Interrupt Routine (Jump 2) ; ; Note - original values here are 16, 16, 16. These are modified to the JP instruction by instructions between 37655 ; and 37663 @ssub=JP 62178 c65524 DEFB 0,0,0 ; Jump to main part of interrupt routine at #R62178 ; Unused b65527 DEFB 0,0,0,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 37652. The operand ; comes from next byte (location 0 in ROM.) @ssub=JR 65524 c65535 NOP ;