; SkoolKit disassembly for Spellbound (48k) ; ; Copyright (c) 2017 Philip M. Anderson (this disassembly) ; Copyright (c) 1985 David Jones / Mastertronic (Spellbound) @start=26627 @org ; Temporary Data Storage Area ; ; Used by the Draw Magic Knight routine at #R39224 b23296 DEFW 0 ; Display File address of bottom of Magic Knight's feet: predicted (Magic Knight moving down / ; horizontally) or current (Magic Knight moving up) 23298 DEFW 0 ; Current position in Magic Knight graphic data (initially: Last byte of Magic Knight graphic ; frame (Magic Knight's current frame to draw [Magic Knight moving down / horizontally] or ; current frame to erase [Magic Knight moving up])) 23300 DEFB 0 ; Temporary store for Magic Knight's predicted (Magic Knight moving down / horizontally) or ; current (Magic Knight moving up) x-coordinate (pixel-within-character) 23301 DEFW 0 ; Temporary store for Magic Knight's predicted (Magic Knight moving down / horizontally) or ; current (Magic Knight moving up) x-coordinate (characters) 23303 DEFW 0 ; Temporary store for current Display File address to draw to (Magic Knight drawing routine) 23305 DEFW 0 ; Last byte of a Magic Knight graphic frame (frame to erase [Magic Knight moving down / ; horizontally] or frame to draw [Magic Knight moving up]) 23307 DEFB 0 ; Temporary store for Magic Knight's current (Magic Knight moving down / horizontally) or ; predicted (Magic Knight moving up) x-coordinate (pixel-within-character) 23308 DEFW 0 ; Temporary store for Magic Knight's current (Magic Knight moving down / horizontally) or ; predicted (Magic Knight moving up) x-coordinate (characters) 23310 DEFW 0 ; Display File address of leftmost part of Magic Knight at current pixel row, mid-drawing 23312 DEFW 0 ; Temporary store for Magic Knight's predicted (Magic Knight moving down / horizontally) or ; current (Magic Knight moving up) x-coordinate (characters) 23314 DEFB 0 ; "Magic Knight changing character position to right" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to left" flag (Magic Knight moving ; up) 23315 DEFB 0 ; "Magic Knight changing character position to left" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to right" flag (Magic Knight ; moving up) 23316 DEFB 0 ; "Magic Knight is leaving his current character position and going left" flag 23317 DEFB 0 ; "Magic Knight is leaving his current character position and going right" flag 23318 DEFB 0 ; "Magic Knight is leaving his current character position" flag 23319 DEFB 0 ; Temporary store for magnitude of Magic Knight's y-velocity 23320 DEFW 0 ; Pointer to Display File address of start of pixel row at Magic Knight's feet: predicted ; (Magic Knight moving down / horizontally) or current (Magic Knight moving up) in table at ; 26064 23322 DEFB 0 ; Temporary store for Magic Knight's predicted (Magic Knight moving down / horizontally) or ; current (Magic Knight moving up) x-coordinate (pixels) 23323 DEFB 0 ; Temporary store for Magic Knight's current (Magic Knight moving down / horizontally) or ; predicted (Magic Knight moving up) x-coordinate (pixels) 23324 DEFB 0 ; Temporary store for Magic Knight's predicted (Magic Knight moving down / horizontally) or ; current (Magic Knight moving up) y-coordinate (pixels) 23325 DEFB 0 ; Temporary store for Magic Knight's current (Magic Knight moving down / horizontally) or ; predicted (Magic Knight moving up) y-coordinate (pixels) 23326 DEFB 0 ; Temporary store for Magic Knight's current frame to draw (Magic Knight moving down / ; horizontally) or current frame to erase (Magic Knight moving up) 23327 DEFB 0 ; Temporary store for Magic Knight's current frame to erase (Magic Knight moving down / ; horizontally) or current frame to draw (Magic Knight moving up) 23328 DEFB 0 ; Temporary store for Magic Knight's current frame to erase 23329 DEFB 0 ; Temporary store for Magic Knight's current x-coordinate (pixels) 23330 DEFB 0 ; Temporary store for Magic Knight's current y-coordinate (pixels) 23331 DEFB 0 ; Temporary store for Magic Knight's predicted x-coordinate (pixels) 23332 DEFB 0 ; Temporary store for Magic Knight's predicted y-coordinate (pixels) 23333 DEFB 0 ; Temporary store for Magic Knight's predicted x-coordinate (characters) 23334 DEFB 0 ; Temporary store for Magic Knight's predicted y-coordinate (characters) 23335 DEFB 0 ; Temporary store for Magic Knight's predicted x-coordinate (pixel-within-character) 23336 DEFB 0 ; Temporary store for Magic Knight's predicted y-coordinate (pixel-within-character) 23337 DEFB 0 ; Temporary store for Magic Knight's attribute 23338 DEFB 0 ; Temporary store for "Update Attributes at Magic Knight's Predicted Position" flag ; Unused b23339 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 23363 DEFB 0,0,0,0,0,0,0,0 23371 DEFB 0,0,0,0,0,0 ; Gimbal-White-Out Safe Flag ; ; Controls whether or not the "GIMBAL IS NOT YET RELEASED..." warning window appears when a command is selected. b23377 DEFB 0 ; Score Progress Flags ; ; Bitwise flags which record Magic Knight's achievements, and are used in calculating percentage completion. Flags ; are initially reset, and each one is set when the corresponding action is performed. b23378 DEFB 0 ; Unused b23379 DEFB 0,0,0 ; Glowing Lift Control Panel Index ; ; Determines which light on the Lift control panel is glowing. b23382 DEFB 0 ; Table of Glowing Attribute File Addresses ; ; Up to ten 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. Lift control panel light, candle flames etc.) b23383 DEFW 0 ; Glow 1 23385 DEFW 0 ; Glow 2 23387 DEFW 0 ; Glow 3 23389 DEFW 0 ; Glow 4 23391 DEFW 0 ; Glow 5 23393 DEFW 0 ; Glow 6 23395 DEFW 0 ; Glow 7 23397 DEFW 0 ; Glow 8 23399 DEFW 0 ; Glow 9 23401 DEFW 0 ; Glow 10 ; Unused b23403 DEFB 0 ; Time Data ; ; Data related to Magic Knight's time left, and also elapsed game time. b23404 DEFB 0 ; Current Time Left - game hours (5 real-time minutes per game hour) 23405 DEFB 0 ; Minute Counter (Time Elapsed since last "hour") 23406 DEFB 0 ; Second Counter (Time Elapsed since last minute) 23407 DEFB 0 ; 1/50 Second Counter (Time Elapsed since last second) ; Compass Glow Update Flag (Locate Compass) ; ; If flag is reset (0), then the attribute of the illuminated Locate A Character Compass sector will be updated on ; next interrupt, if Magic Knight is locating. No update will take place if the flag is set (1). b23408 DEFB 0 ; Current INK Colour of Glowing Blocks b23409 DEFB 0 ; Temporary Store for Magic Knight's Movement Flags ; ; Bitwise flags which determine which direction(s) Magic Knight cannot currently move (i.e. set means can't move). ; Set when Magic Knight either: b23410 DEFB 0 ; Game progress flags (1) ; ; Bitwise flags which record some of Magic Knight's achievements. Flags are initially reset, and each one is set ; when the corresponding action is performed. b23411 DEFB 0 ; Visited Room Flags ; ; Fifty bytes, one for each room in the game. At the start of the game, these are all reset (i.e. zero). Each time ; Magic Knight enters a room for the first time, the flag corresponding to that room is set (to 1). These flags are ; used in calculating percentage completion. b23412 DEFB 0 ; The Lift 23413 DEFB 0,0,0,0,0,0,0,0 ; Roof 23421 DEFB 0,0,0,0,0,0,0,0 ; 4th Floor 23429 DEFB 0,0,0,0,0,0,0,0 ; 3rd Floor 23437 DEFB 0,0,0,0,0,0,0,0 ; 2nd Floor 23445 DEFB 0,0,0,0,0,0,0,0 ; 1st Floor 23453 DEFB 0,0,0,0,0,0,0,0 ; Ground Floor 23461 DEFB 0 ; Basement ; y- and x- coordinates of top-left corner of currently glowing Locate Compass sector b23462 DEFB 0,0 ; Indices of characters in current room ; ; Up to three characters. Data used by routine at #R35931 b23464 DEFB 0,0,0 ; Game progress flags (2) ; ; Bitwise flags which record more of Magic Knight's achievements. Flags are initially reset, and each one is set ; when the corresponding action is performed. b23467 DEFB 0 ; Game progress flags (3) ; ; Bitwise flags which record more of Magic Knight's achievements. Flags are initially reset, and each one is set ; when the corresponding action is performed. b23468 DEFB 0 ; Brickwork Drawing Mode ; ; #TABLE(default,centre,:w) ; { =h Value | =h Meaning } ; { 0 | Draw two rows } ; { 1 | Draw one row only } ; { 2 | Draw one row then a blank row below } ; TABLE# b23469 DEFB 0 ; 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: b23470 DEFB 0 ; Position data for drawing Menu Hand Cursor b23471 DEFB 0 ; Height available to hand cursor to move down (pixels) 23472 DEFB 0 ; x-coordinate of left edge of current window (characters) 23473 DEFB 0 ; y-coordinate of "finger" on hand-cursor (characters) 23474 DEFB 0 ; Unused 23475 DEFB 0 ; Current y-coordinate of hand cursor relative to its starting position (pixels) ; Brickwork Drawing Direction Flag ; ; Only bit 0 is used. If reset (0), then direction is horizontal (i.e. floors and ceilings). If set (1), then ; direction is vertical (i.e. walls). b23476 DEFB 0 ; Attribute of interior of current window, i.e. background / foreground colours of contents b23477 DEFB 0 ; Magic Knight's predicted position, used in routine at 27666 b23478 DEFB 0 ; Predicted x-coordinate 23479 DEFB 0 ; Predicted y-coordinate ; Unused b23480 DEFB 0 ; Store for current position in Terrain Interaction Parameter Table at 24539 b23481 DEFW 0 ; Store for current Terrain Interaction Parameter value b23483 DEFB 0 ; Unused b23484 DEFB 0 ; Store for currently active keyboard press / joystick action b23485 DEFB 0 ; Unused b23486 DEFB 0 ; Attribute File address of Virtual Text Cursor b23487 DEFW 0 ; Position data for drawing windows b23489 DEFB 0 ; Initial y-coordinate of top of hand cursor relative to current window (characters) 23490 DEFB 0 ; x-coordinate of left of interior area of window (characters) (i.e. value at 23493 plus 1) 23491 DEFB 0 ; y-coordinate of top of hand cursor (pixels) 23492 DEFB 0 ; y-coordinate of bottom of window (including frame) (pixels) 23493 DEFB 0 ; x-coordinate of left edge (of frame, or of interior) of current window to draw (characters) 23494 DEFB 0 ; y-coordinate of top edge (of frame, or of interior) of current window to draw (characters) 23495 DEFB 0 ; x-coordinate of right edge (of frame, or of interior) of current window to draw (characters) 23496 DEFB 0 ; y-coordinate of bottom edge (of frame, or of interior) of current window to draw (characters) ; Storage space for ASCII string converted from numeric value b23497 DEFB 0,0,0,0,0 ; Unused b23502 DEFB 0 ; Pointer to index of next character (in summoning sequence table at 33565) who will be sent home upon being ; summoned b23503 DEFW 0 ; "Animate Magic Knight's Puff of Smoke Appearance on Next Room Redraw" Flag ; ; Determines whether or not Magic Knight appears in a puff of smoke the next time a room is (re)drawn. Only bit 0 is ; used. b23505 DEFB 0 ; Characters Sent Home Counter (Score) ; ; For each character sent home, Magic Knight gains a 1% contribution to Percentage Completion. This value counts the ; number of characters sent home for this purpose. b23506 DEFB 0 ; Unused b23507 DEFB 0,0,0,0,0,0,0,0 23515 DEFB 0,0,0,0,0,0,0,0 23523 DEFB 0,0,0,0,0,0,0,0 23531 DEFB 0,0,0,0,0,0,0,0 23539 DEFB 0,0,0,0,0,0,0,0 23547 DEFB 0,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 23849 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,0,0 23700 DEFB 0,0,0,0,0,0,0,0 23708 DEFB 0,0,0,0,0,0,0,0 23716 DEFB 0,0,0,0,0,0,0,0 23724 DEFB 0,0,0,0,0,0,0,0 23732 DEFB 0,0 ; System Data and Stack space 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 10, which loads a block of code of length 6940 bytes to address ; 16384. This code block contains the loading screen and additional loading code at #R23296. This loading code is ; called, before we jump to the start-up routine at 26627. The listing has a disguised address for the start-up ; routine, 26624, which would take us to the "HELLO HACKER" routine. b23755 DEFB 0,0,0 ; 10 CLEAR 26060: POKE 23693,71: BORDER 0: CLS : LOAD ""CODE 16384: RANDOMIZE USR 23296: ; RANDOMIZE USR 26624{26627} 23758 DEFB 0,0,0,0,0 23763 DEFB 0,0,0 23766 DEFB 0,0,0,0,0 23771 DEFB 0,0,0 23774 DEFB 0,0,0,0,0 23779 DEFB 0,0,0 23782 DEFB 0,0,0,0,0 23787 DEFB 0,0,0 23790 DEFB 0,0,0,0,0 23795 DEFB 0,0,0 23798 DEFB 0,0,0,0,0 23803 DEFB 0,0,0 23806 DEFB 0,0,0,0,0 23811 DEFB 0,0,0 23814 DEFB 0,0,0,0,0 23819 DEFB 0,0,0 23822 DEFB 0,0,0,0,0 23827 DEFB 0,0,0 23830 DEFB 0,0,0,0,0 23835 DEFB 0,0,0 23838 DEFB 0,0,0,0,0 23843 DEFB 0,0,0 23846 DEFB 0,0,0 23849 DEFB 0,0,0,0,0 23854 DEFB 0,0,0,0,0,0,0,0 23862 DEFB 0,0,0,0,0,0,0,0 23870 DEFB 0,0,0,0,0,0,0,0 23878 DEFB 0,0,0,0,0,0,0,0 23886 DEFB 0,0,0,0,0,0,0,0 23894 DEFB 0,0,0,0,0,0,0,0 23902 DEFB 0,0,0,0,0,0,0,0 23910 DEFB 0,0,0,0,0,0,0,0 23918 DEFB 0,0,0,0,0,0,0,0 23926 DEFB 0,0,0,0,0,0,0,0 23934 DEFB 0,0,0,0,0,0,0,0 23942 DEFB 0,0,0,0,0,0,0,0 23950 DEFB 0,0,0,0,0,0,0,0 23958 DEFB 0,0,0,0,0,0,0,0 23966 DEFB 0,0,0,0,0,0,0,0 23974 DEFB 0,0,0,0,0,0,0,0 23982 DEFB 0,0,0,0,0,0,0,0 23990 DEFB 0,0,0,0,0,0,0,0 23998 DEFB 0,0,0,0,0,0,0,0 24006 DEFB 0,0,0,0,0,0,0,0 24014 DEFB 0,0,0,0,0,0,0,0 24022 DEFB 0,0,0,0,0,0,0,0 24030 DEFB 0,0,0,0,0,0,0,0 24038 DEFB 0,0,0,0,0,0,0,0 24046 DEFB 0,0,0,0,0,0,0,0 24054 DEFB 0,0,0,0,0,0,0,0 24062 DEFB 0,0,0,0,0,0,0,0 24070 DEFB 0,0,0,0,0,0,0,0 24078 DEFB 0,0,0,0,0,0,0,0 24086 DEFB 0,0,0,0,0,0,0,0 24094 DEFB 0,0,0,0,0,0,0,0 24102 DEFB 0,0,0,0,0,0,0,0 24110 DEFB 0,0,0,0,0,0,0,0 24118 DEFB 0,0,0,0,0,0,0,0 24126 DEFB 0,0,0,0,0,0,0,0 24134 DEFB 0,0,0,0,0,0,0,0 24142 DEFB 0,0,0,0,0,0,0,0 24150 DEFB 0,0,0,0,0,0,0,0 24158 DEFB 0,0,0,0,0,0,0,0 24166 DEFB 0,0,0,0,0,0,0,0 24174 DEFB 0,0,0,0,0,0,0,0 24182 DEFB 0,0,0,0,0,0,0,0 24190 DEFB 0,0,0,0,0,0,0,0 24198 DEFB 0,0,0,0,0,0,0,0 24206 DEFB 0,0,0,0,0,0,0,0 24214 DEFB 0,0,0,0,0,0,0,0 24222 DEFB 0,0,0,0,0,0,0,0 24230 DEFB 0,0,0,0,0,0,0,0 24238 DEFB 0,0,0,0,0,0,0,0 24246 DEFB 0,0,0,0,0,0,0,0 24254 DEFB 0,0,0,0,0,0,0,0 24262 DEFB 0,0,0,0,0,0,0,0 24270 DEFB 0,0,0,0,0,0,0,0 24278 DEFB 0,0,0,0,0,0,0,0 24286 DEFB 0,0,0,0,0,0,0,0 24294 DEFB 0,0,0,0,0,0,0,0 24302 DEFB 0,0,0,0,0,0,0,0 24310 DEFB 0,0,0,0,0,0,0,0 24318 DEFB 0,0,0,0,0,0,0,0 24326 DEFB 0,0,0,0,0,0,0,0 24334 DEFB 0,0,0,0,0,0,0,0 24342 DEFB 0,0,0,0,0,0,0,0 24350 DEFB 0,0,0,0,0,0,0,0 24358 DEFB 0,0,0,0,0,0,0,0 24366 DEFB 0,0,0,0,0,0,0,0 24374 DEFB 0,0,0,0,0,0,0,0 24382 DEFB 0,0,0,0,0,0,0,0 24390 DEFB 0,0,0,0,0,0,0,0 24398 DEFB 0,0,0,0,0,0,0,0 24406 DEFB 0,0,0,0,0,0,0,0 24414 DEFB 0,0,0,0,0,0,0,0 24422 DEFB 0,0,0,0,0,0,0,0 24430 DEFB 0,0,0,0,0,0,0,0 24438 DEFB 0,0,0,0,0,0,0,0 24446 DEFB 0,0,0,0,0,0,0,0 24454 DEFB 0,0,0,0,0,0,0,0 24462 DEFB 0,0,0,0,0,0,0,0 24470 DEFB 0,0,0,0,0,0,0,0 24478 DEFB 0,0,0,0,0,0,0,0 24486 DEFB 0,0,0,0,0,0,0,0 24494 DEFB 0,0,0,0,0,0,0,0 24502 DEFB 0,0,0,0,0,0,0,0 24510 DEFB 0,0,0,0,0,0,0,0 24518 DEFB 0,0,0,0,0,0,0,0 24526 DEFB 0,0,0,0,0,0,0,0 24534 DEFB 0,0,0,0,0 ; Terrain Interaction Data Table ; ; Table comprised of 32 x 20 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: b24539 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24571 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24603 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24635 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24667 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24699 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24731 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24763 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24795 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24827 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24859 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24891 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24923 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24955 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24987 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25019 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25051 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25083 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25115 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25147 DEFB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Unused b25179 DEFB 0,0,0,0,0,0,0,0 25187 DEFB 0,0,0,0,0,0,0,0 25195 DEFB 0,0,0,0,0,0,0,0 25203 DEFB 0,0,0,0,0,0,0,0 25211 DEFB 0,0,0,0,0,0,0,0 25219 DEFB 0,0,0,0,0,0,0,0 25227 DEFB 0,0,0,0,0,0,0,0 25235 DEFB 0,0,0,0,0,0,0,0 25243 DEFB 0,0,0,0,0,0,0,0 25251 DEFB 0,0,0,0,0,0,0,0 25259 DEFB 0,0,0,0,0,0,0,0 25267 DEFB 0,0,0,0,0,0,0,0 25275 DEFB 0,0,0,0,0,0,0,0 25283 DEFB 0,0,0,0,0,0,0,0 25291 DEFB 0,0,0,0,0,0,0,0 25299 DEFB 0,0,0,0,0,0,0,0 ; Slot number (1-3) currently occupied by characters in their current rooms b25307 DEFB 0 ; Gimbal the Wizard 25308 DEFB 0 ; Thor 25309 DEFB 0 ; Florin the Dwarf 25310 DEFB 0 ; Orik the Cleric 25311 DEFB 0 ; Samsun the Strong 25312 DEFB 0 ; Elrand Halfelven 25313 DEFB 0 ; Lady Rosmar 25314 DEFB 0 ; The Banshee ; Characters' Current Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are: b25315 DEFB 0,0,0,0,0,0,0,0 ; Magic Knight 25323 DEFB 0,0,0,0,0,0,0,0 ; Gimbal the Wizard 25331 DEFB 0,0,0,0,0,0,0,0 ; Thor 25339 DEFB 0,0,0,0,0,0,0,0 ; Florin the Dwarf 25347 DEFB 0,0,0,0,0,0,0,0 ; Orik the Cleric 25355 DEFB 0,0,0,0,0,0,0,0 ; Samsun the Strong 25363 DEFB 0,0,0,0,0,0,0,0 ; Elrand Halfelven 25371 DEFB 0,0,0,0,0,0,0,0 ; Lady Rosmar 25379 DEFB 0,0,0,0,0,0,0,0 ; The Banshee ; Magic Knight's Current Data b25387 DEFB 0 ; x-coordinate (pixels) 25388 DEFB 0 ; y-coordinate (pixels) 25389 DEFB 0 ; Frame Number (frame to erase) 25390 DEFB 0 ; Frame Number (frame to draw) 25391 DEFB 0 ; x velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 25392 DEFB 0 ; y velocity (pixels) [jumping] 25393 DEFB 0 ; Attribute 25394 DEFB 0 ; Update Attributes Mask (zeroes BRIGHT and INK component of existing attribute so that Magic ; Knight's INK and BRIGHT bits override) (used by routine at #R39989) ; Characters' Current Inventories ; ; Nine groups of five bytes, one group per character (including Magic Knight). Each of the five bytes per group ; represents an inventory slot for that character. A value of zero indicates that the slot is empty. Non-zero values ; correspond to indices of objects (e.g. 3 = Miolnir) b25395 DEFB 0,0,0,0,0 ; Magic Knight 25400 DEFB 0,0,0,0,0 ; Gimbal the Wizard 25405 DEFB 0,0,0,0,0 ; Thor 25410 DEFB 0,0,0,0,0 ; Florin the Dwarf 25415 DEFB 0,0,0,0,0 ; Orik the Cleric 25420 DEFB 0,0,0,0,0 ; Samsun the Strong 25425 DEFB 0,0,0,0,0 ; Elrand Halfelven 25430 DEFB 0,0,0,0,0 ; Lady Rosmar 25435 DEFB 0,0,0,0,0 ; The Banshee ; Characters' Current Positions ; ; Eight groups of three bytes, one group per character (excluding Magic Knight). The values are: b25440 DEFB 0,0,0 ; Gimbal the Wizard 25443 DEFB 0,0,0 ; Thor 25446 DEFB 0,0,0 ; Florin the Dwarf 25449 DEFB 0,0,0 ; Orik the Cleric 25452 DEFB 0,0,0 ; Samsun the Strong 25455 DEFB 0,0,0 ; Elrand Halfelven 25458 DEFB 0,0,0 ; Lady Rosmar 25461 DEFB 0,0,0 ; The Banshee ; Objects' Current Positions ; ; Fifty groups of three bytes, one group per object. The values are: b25464 DEFB 0,0,0 ; "Nothing at All"! 25467 DEFB 0,0,0 ; Ancient Scroll 25470 DEFB 0,0,0 ; Book of Shadows 25473 DEFB 0,0,0 ; Miolnir 25476 DEFB 0,0,0 ; Axe 25479 DEFB 0,0,0 ; Sticky Bun 25482 DEFB 0,0,0 ; Crystal Ball 25485 DEFB 0,0,0 ; Wand of Command 25488 DEFB 0,0,0 ; Javelin 25491 DEFB 0,0,0 ; Cannon Ball 25494 DEFB 0,0,0 ; Tube of Glue 25497 DEFB 0,0,0 ; Broken Talisman 25500 DEFB 0,0,0 ; Magic Talisman 25503 DEFB 0,0,0 ; Runestone 25506 DEFB 0,0,0 ; Broken Glass 25509 DEFB 0,0,0 ; Book of Runes 25512 DEFB 0,0,0 ; Glowing Bottle 25515 DEFB 0,0,0 ; Gold Goblet 25518 DEFB 0,0,0 ; Fast Blow Fuse 25521 DEFB 0,0,0 ; Red Herring 25524 DEFB 0,0,0 ; Brick 25527 DEFB 0,0,0 ; Green Crystal 25530 DEFB 0,0,0 ; Blue Crystal 25533 DEFB 0,0,0 ; Red Crystal 25536 DEFB 0,0,0 ; Willow Rod 25539 DEFB 0,0,0 ; Lump of Brickwork 25542 DEFB 0,0,0 ; Bottle of Liquid 25545 DEFB 0,0,0 ; Four Leaf Clover 25548 DEFB 0,0,0 ; Loaf of Elf-Bread 25551 DEFB 0,0,0 ; Platform 25554 DEFB 0,0,0 ; Gold Bar 25557 DEFB 0,0,0 ; Pewter Tankard 25560 DEFB 0,0,0 ; White Gold Ring 25563 DEFB 0,0,0 ; Engraved Candle 25566 DEFB 0,0,0 ; Strange Liquid 25569 DEFB 0,0,0 ; Mirror 25572 DEFB 0,0,0 ; Pocket Laser 25575 DEFB 0,0,0 ; Prism 25578 DEFB 0,0,0 ; Elf-Horn 25581 DEFB 0,0,0 ; Saxophone 25584 DEFB 0,0,0 ; Trumpet 25587 DEFB 0,0,0 ; Instruction Book 25590 DEFB 0,0,0 ; Key 25593 DEFB 0,0,0 ; Advert 25596 DEFB 0,0,0 ; Lump of Brickwork 25599 DEFB 0,0,0 ; Empty Bottle 25602 DEFB 0,0,0 ; Power-Pong Plant 25605 DEFB 0,0,0 ; Shield 25608 DEFB 0,0,0 ; Teleport Key 25611 DEFB 0,0,0 ; Teleport Pad ; Movement Data Table for Starfield Routine ; ; Fifty groups of nine bytes, one group per star. The values are: b25614 DEFB 0,0,0,0,0,0,0,0,0 25623 DEFB 0,0,0,0,0,0,0,0,0 25632 DEFB 0,0,0,0,0,0,0,0,0 25641 DEFB 0,0,0,0,0,0,0,0,0 25650 DEFB 0,0,0,0,0,0,0,0,0 25659 DEFB 0,0,0,0,0,0,0,0,0 25668 DEFB 0,0,0,0,0,0,0,0,0 25677 DEFB 0,0,0,0,0,0,0,0,0 25686 DEFB 0,0,0,0,0,0,0,0,0 25695 DEFB 0,0,0,0,0,0,0,0,0 25704 DEFB 0,0,0,0,0,0,0,0,0 25713 DEFB 0,0,0,0,0,0,0,0,0 25722 DEFB 0,0,0,0,0,0,0,0,0 25731 DEFB 0,0,0,0,0,0,0,0,0 25740 DEFB 0,0,0,0,0,0,0,0,0 25749 DEFB 0,0,0,0,0,0,0,0,0 25758 DEFB 0,0,0,0,0,0,0,0,0 25767 DEFB 0,0,0,0,0,0,0,0,0 25776 DEFB 0,0,0,0,0,0,0,0,0 25785 DEFB 0,0,0,0,0,0,0,0,0 25794 DEFB 0,0,0,0,0,0,0,0,0 25803 DEFB 0,0,0,0,0,0,0,0,0 25812 DEFB 0,0,0,0,0,0,0,0,0 25821 DEFB 0,0,0,0,0,0,0,0,0 25830 DEFB 0,0,0,0,0,0,0,0,0 25839 DEFB 0,0,0,0,0,0,0,0,0 25848 DEFB 0,0,0,0,0,0,0,0,0 25857 DEFB 0,0,0,0,0,0,0,0,0 25866 DEFB 0,0,0,0,0,0,0,0,0 25875 DEFB 0,0,0,0,0,0,0,0,0 25884 DEFB 0,0,0,0,0,0,0,0,0 25893 DEFB 0,0,0,0,0,0,0,0,0 25902 DEFB 0,0,0,0,0,0,0,0,0 25911 DEFB 0,0,0,0,0,0,0,0,0 25920 DEFB 0,0,0,0,0,0,0,0,0 25929 DEFB 0,0,0,0,0,0,0,0,0 25938 DEFB 0,0,0,0,0,0,0,0,0 25947 DEFB 0,0,0,0,0,0,0,0,0 25956 DEFB 0,0,0,0,0,0,0,0,0 25965 DEFB 0,0,0,0,0,0,0,0,0 25974 DEFB 0,0,0,0,0,0,0,0,0 25983 DEFB 0,0,0,0,0,0,0,0,0 25992 DEFB 0,0,0,0,0,0,0,0,0 26001 DEFB 0,0,0,0,0,0,0,0,0 26010 DEFB 0,0,0,0,0,0,0,0,0 26019 DEFB 0,0,0,0,0,0,0,0,0 26028 DEFB 0,0,0,0,0,0,0,0,0 26037 DEFB 0,0,0,0,0,0,0,0,0 26046 DEFB 0,0,0,0,0,0,0,0,0 26055 DEFB 0,0,0,0,0,0,0,0,0 ; Display File addresses of start of each pixel row ; ; Addresses are in sequence, from top to bottom of display b26064 DEFW 16384 26066 DEFW 16640 26068 DEFW 16896 26070 DEFW 17152 26072 DEFW 17408 26074 DEFW 17664 26076 DEFW 17920 26078 DEFW 18176 26080 DEFW 16416 26082 DEFW 16672 26084 DEFW 16928 26086 DEFW 17184 26088 DEFW 17440 26090 DEFW 17696 26092 DEFW 17952 26094 DEFW 18208 26096 DEFW 16448 26098 DEFW 16704 26100 DEFW 16960 26102 DEFW 17216 26104 DEFW 17472 26106 DEFW 17728 26108 DEFW 17984 26110 DEFW 18240 26112 DEFW 16480 26114 DEFW 16736 26116 DEFW 16992 26118 DEFW 17248 26120 DEFW 17504 26122 DEFW 17760 26124 DEFW 18016 26126 DEFW 18272 26128 DEFW 16512 26130 DEFW 16768 26132 DEFW 17024 26134 DEFW 17280 26136 DEFW 17536 26138 DEFW 17792 26140 DEFW 18048 26142 DEFW 18304 26144 DEFW 16544 26146 DEFW 16800 26148 DEFW 17056 26150 DEFW 17312 26152 DEFW 17568 26154 DEFW 17824 26156 DEFW 18080 26158 DEFW 18336 26160 DEFW 16576 26162 DEFW 16832 26164 DEFW 17088 26166 DEFW 17344 26168 DEFW 17600 26170 DEFW 17856 26172 DEFW 18112 26174 DEFW 18368 26176 DEFW 16608 26178 DEFW 16864 26180 DEFW 17120 26182 DEFW 17376 26184 DEFW 17632 26186 DEFW 17888 26188 DEFW 18144 26190 DEFW 18400 26192 DEFW 18432 26194 DEFW 18688 26196 DEFW 18944 26198 DEFW 19200 26200 DEFW 19456 26202 DEFW 19712 26204 DEFW 19968 26206 DEFW 20224 26208 DEFW 18464 26210 DEFW 18720 26212 DEFW 18976 26214 DEFW 19232 26216 DEFW 19488 26218 DEFW 19744 26220 DEFW 20000 26222 DEFW 20256 26224 DEFW 18496 26226 DEFW 18752 26228 DEFW 19008 26230 DEFW 19264 26232 DEFW 19520 26234 DEFW 19776 26236 DEFW 20032 26238 DEFW 20288 26240 DEFW 18528 26242 DEFW 18784 26244 DEFW 19040 26246 DEFW 19296 26248 DEFW 19552 26250 DEFW 19808 26252 DEFW 20064 26254 DEFW 20320 26256 DEFW 18560 26258 DEFW 18816 26260 DEFW 19072 26262 DEFW 19328 26264 DEFW 19584 26266 DEFW 19840 26268 DEFW 20096 26270 DEFW 20352 26272 DEFW 18592 26274 DEFW 18848 26276 DEFW 19104 26278 DEFW 19360 26280 DEFW 19616 26282 DEFW 19872 26284 DEFW 20128 26286 DEFW 20384 26288 DEFW 18624 26290 DEFW 18880 26292 DEFW 19136 26294 DEFW 19392 26296 DEFW 19648 26298 DEFW 19904 26300 DEFW 20160 26302 DEFW 20416 26304 DEFW 18656 26306 DEFW 18912 26308 DEFW 19168 26310 DEFW 19424 26312 DEFW 19680 26314 DEFW 19936 26316 DEFW 20192 26318 DEFW 20448 26320 DEFW 20480 26322 DEFW 20736 26324 DEFW 20992 26326 DEFW 21248 26328 DEFW 21504 26330 DEFW 21760 26332 DEFW 22016 26334 DEFW 22272 26336 DEFW 20512 26338 DEFW 20768 26340 DEFW 21024 26342 DEFW 21280 26344 DEFW 21536 26346 DEFW 21792 26348 DEFW 22048 26350 DEFW 22304 26352 DEFW 20544 26354 DEFW 20800 26356 DEFW 21056 26358 DEFW 21312 26360 DEFW 21568 26362 DEFW 21824 26364 DEFW 22080 26366 DEFW 22336 26368 DEFW 20576 26370 DEFW 20832 26372 DEFW 21088 26374 DEFW 21344 26376 DEFW 21600 26378 DEFW 21856 26380 DEFW 22112 26382 DEFW 22368 26384 DEFW 20608 26386 DEFW 20864 26388 DEFW 21120 26390 DEFW 21376 26392 DEFW 21632 26394 DEFW 21888 26396 DEFW 22144 26398 DEFW 22400 26400 DEFW 20640 26402 DEFW 20896 26404 DEFW 21152 26406 DEFW 21408 26408 DEFW 21664 26410 DEFW 21920 26412 DEFW 22176 26414 DEFW 22432 26416 DEFW 20672 26418 DEFW 20928 26420 DEFW 21184 26422 DEFW 21440 26424 DEFW 21696 26426 DEFW 21952 26428 DEFW 22208 26430 DEFW 22464 26432 DEFW 20704 26434 DEFW 20960 26436 DEFW 21216 26438 DEFW 21472 26440 DEFW 21728 26442 DEFW 21984 26444 DEFW 22240 26446 DEFW 22496 ; Unused b26448 DEFB 0,0,0,0,0,0,0,0 26456 DEFB 0,0,0,0,0,0,0,0 26464 DEFB 0,0,0,0,0,0,0,0 26472 DEFB 0,0,0,0,0,0,0,0 26480 DEFB 0,0,0,0,0,0,0,0 26488 DEFB 0,0,0,0,0,0,0,0 26496 DEFB 0,0,0,0,0,0,0,0 26504 DEFB 0,0,0,0,0,0,0,0 26512 DEFB 0,0,0,0,0,0,0,0 26520 DEFB 0,0,0,0,0,0,0,0 26528 DEFB 0,0,0,0,0,0,0,0 26536 DEFB 0,0,0,0,0,0,0,0 26544 DEFB 0,0,0,0,0,0,0,0 26552 DEFB 0,0,0,0,0,0,0,0 26560 DEFB 0,0,0,0,0,0,0,0 26568 DEFB 0,0,0,0,0,0,0,0 26576 DEFB 0,0,0,0,0,0,0,0 26584 DEFB 0,0,0,0,0,0,0,0 26592 DEFB 0,0,0,0,0,0,0,0 26600 DEFB 0,0,0,0,0,0,0,0 26608 DEFB 0,0,0,0,0,0,0,0 26616 DEFB 0,0,0,0,0,0,0,0 ; Fake Start of Game Code c26624 JP 27118 ; Jump to "Hello Hacker" routine ; Initialise Interrupt Code then Jump to Input Device Selection Menu c26627 LD A,(23728) ; Redundant instructions (part of a previous debug routine?)... 26630 OR A ; ... 26631 NOP ; ... 26632 NOP ; ... 26633 XOR A ; Set A to zero (see trivia) 26634 LD (27236),A ; Disable debug / cheat mode... 26637 LD (27237),A ; ... 26640 LD (27238),A ; ... 26643 DI ; Disable interrupts 26644 XOR A ; Reset "Update Game Time and Locate Arrow Glow" flag, "Disable In-Game Glow" flag and ; "Characters Can't Move" flag... 26645 LD (IY+65),A ; ... 26648 LD A,24 ; Put JR instruction at 65535 for jumping to interrupt routine... 26650 LD (65535),A ; ... 26653 LD HL,65524 ; Load first three bytes of interrupt routine with 195, 69 and 214... 26656 LD (HL),195 ; ...this corresponds to the instruction "JP 54853" 26658 INC HL ; ... 26659 LD (HL),69 ; ... 26661 INC HL ; ... 26662 LD (HL),214 ; ... ; Here we load I with 57, indicating an interrupt vector table at 57*256=14592. This is an area of ROM filled with ; FF values. This causes a jump to $FFFF (i.e. 65535) on each interrupt. 26664 LD A,57 ; Load I register with 57 (for interrupt routine)... 26666 LD I,A ; ... 26668 EI ; Enable interrupts 26669 SET 3,(IY+48) ; Set CAPS LOCK flag (i.e. set CAPS LOCK to ON) ; Display input device selection menu ; ; Used by the routine at #R35101. c26673 HALT ; Wait for interrupt 26674 LD SP,24539 ; Set Stack Pointer to 24539 26677 XOR A ; Reset "Update Game Time and Locate Arrow Glow" flag, "Disable In-Game Glow" flag and ; "Characters Can't Move" flag... 26678 LD (IY+65),A ; ... 26681 IM 2 ; Set interrupt mode 2 26683 CALL 26853 ; Clear areas of memory and initialise some variables *26686 CALL 26747 ; Draw Input Selection Menu *26689 LD A,65 ; Default to "A: Keyboard" 26691 CALL 37857 ; Change input device (A=Keyboard, B=Kempston, C=Fuller, etc.) depending on which key was ; pressed (forced to keyboard as A is 65) 26694 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 26697 CP 70 ; If "F" pressed (INSTRUCTIONS)... 26699 JR Z,26737 ; ...then display instructions 26701 CP 71 ; If "G" pressed (PLAY GAME)... 26703 JP Z,26906 ; ...then start a new game 26706 CP 65 ; If key lower than "A" pressed... 26708 JR C,26689 ; ...then loop back to #R26689 26710 CP 70 ; If key higher than "F" pressed... 26712 JR NC,26689 ; ...then loop back to #R26689 26714 EX AF,AF' ; Switch registers 26715 LD A,(40140) ; Load current input device selection into A' 26718 EX AF,AF' ; Switch registers 26719 LD (40140),A ; Store new input device selection 26722 EX AF,AF' ; Switch registers 26723 SUB 65 ; Subtract 65 to get index of previous input device selection 26725 ADD A,12 ; Add 12, to give y-coordinate of previous selection in menu 26727 LD B,A ; Load this y-coordinate into B 26728 LD C,1 ; Load 1 (x-coordinate) into C 26730 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 26733 LD (HL),71 ; Set attribute at this position to 71 (white INK, black PAPER, BRIGHT) to "undo" selection ; glow 26735 JR 26689 ; Loop back to #R26689 *26737 CALL 26788 ; Display instructions 26740 JR 26686 ; Loop back to #R26689 ; Return to Basic ; ; Used by the routine at #R35420. c26742 IM 1 ; Set Interrupt Mode 1 26744 EI ; Enable interrupts 26745 RST 8 ; Return to BASIC... ; Data block at 26746 b26746 DEFB 255 ; ... ; Draw Input Device Selection Menu ; ; Used by the routine at #R26673. c26747 CALL 37816 ; Clear Display File 26750 LD A,70 ; Load system variable ATTR T with 70 (yellow INK, black PAPER, BRIGHT)... 26752 LD (23695),A ; ... 26755 CALL 37841 ; Flood Attribute File with current value in system variable ATTR T 26758 LD A,5 ; Draw window 5 ("SPELLBOUND A TRUE GRAPHIC ADVENTURE BY DAVID JONES COPYRIGHT 1985" window)... 26760 CALL 36987 ; ...at top of screen above input selection menu window... 26763 LD HL,43090 ; ...and print the text within... 26766 CALL 36725 ; ... 26769 LD A,6 ; Display the input selection menu window... 26771 CALL 36979 ; ... 26774 LD HL,46822 ; ...and print the text within... 26777 CALL 36725 ; ... 26780 CALL 38108 ; Set parameters for and play downward scale sound 26783 XOR A ; Clear last pressed key... 26784 LD (23560),A ; ... 26787 RET ; Return ; Display Instructions Windows ; ; Used by the routines at #R26673 and #R32258. c26788 LD A,7 ; Draw window 7... 26790 CALL 36987 ; ... 26793 LD HL,46899 ; Point HL to location of text for 1st instructions window 26796 CALL 36725 ; Print text 26799 CALL 26835 ; Wait for a key-press then beep 26802 LD A,8 ; Draw window 8... 26804 CALL 36987 ; ... 26807 LD HL,47115 ; Point HL to location of text for 2nd instructions window 26810 CALL 36725 ; Print text 26813 CALL 26835 ; Wait for a key-press then beep 26816 LD A,9 ; Draw window 9... 26818 CALL 36987 ; ... 26821 LD HL,47200 ; Point HL to location of text for 3rd instructions window 26824 CALL 36725 ; Print text 26827 CALL 26835 ; Wait for a key-press then beep 26830 XOR A ; Set last key-press to null... 26831 LD (23560),A ; ... 26834 RET ; Return ; Wait for a Key-Press then Beep ; ; Used by the routines at #R26788 and #R35420. Output: A ASCII index of key pressed c26835 XOR A ; Set last key-press to null... 26836 LD (23560),A ; ... 26839 HALT ; Wait for interrupt *26840 LD A,(23560) ; Load last pressed key into A 26843 OR A ; If A is zero (i.e. no key pressed)... 26844 JR Z,26840 ; ...then loop back to #R26840 26846 CALL 38221 ; Make a beep 26849 CALL 37472 ; Wait for keyboard to be released 26852 RET ; Return ; Clear Areas of Memory and Initialise Some Variables ; ; Used by the routine at #R26673. c26853 LD A,7 ; Set system variable BORDERCR to 7... 26855 LD (23624),A ; ...setting border to black and attribute of bottom of screen to white INK, black PAPER 26858 XOR A ; Set "pressed key" to null... 26859 LD (23560),A ; ... 26862 OUT (254),A ; Reset speaker 26864 LD HL,23296 ; Write 255 zeroes to 23296 onwards, overwriting custom loader... 26867 LD DE,23297 ; ... 26870 LD BC,255 ; ... 26873 LD (HL),A ; ... 26874 LDIR ; ... 26876 LD HL,25307 ; Write 8 zeroes from 25307 onwards resetting characters' current slot numbers 26879 LD DE,25308 ; ... 26882 LD BC,7 ; ... 26885 LD (HL),A ; ... 26886 LDIR ; ... 26888 LD HL,23383 ; Write 20 zeroes from 23383 onwards resetting table of attribute memory addresses that are ; glowing 26891 LD DE,23384 ; ... 26894 LD BC,19 ; ... 26897 LD (HL),A ; ... 26898 LDIR ; ... 26900 LD H,A ; Set HL to zero... 26901 LD L,A ; ... 26902 LD (65532),HL ; Reset Magic Knight's action flags 26905 RET ; Return ; Initialise Data and Start a New Game ; ; Used by the routine at #R26673. c26906 LD A,(40140) ; Load input device selection into A 26909 CALL 37857 ; Change input device based on A 26912 CALL 37816 ; Clear Display File 26915 LD A,70 ; Flood Attribute File with value 70 (yellow INK, black PAPER, BRIGHT)... 26917 LD (23695),A ; ... 26920 CALL 37841 ; ... 26923 LD HL,42170 ; Copy initial characters' stats into "current" (modifiable) slots... 26926 LD DE,25315 ; ... 26929 LD BC,72 ; ... 26932 LDIR ; ... 26934 LD HL,40141 ; Copy initial Magic Knight properties (position) into "current" (modifiable) slots... 26937 LD BC,8 ; ... 26940 LDIR ; ... 26942 LD HL,41017 ; Copy initial characters' inventories into "current" (modifiable) slots... 26945 LD BC,45 ; ... 26948 LDIR ; ... 26950 LD HL,41062 ; Copy initial characters' positions into "current" (modifiable) slots... 26953 LD BC,24 ; ... 26956 LDIR ; ... 26958 LD HL,41086 ; Copy initial objects' locations into "current" (modifiable) slots (at #R25464)... 26961 LD BC,150 ; ... 26964 LDIR ; ... 26966 XOR A ; Set A to zero 26967 LD (23675),A ; Set UDG system variable to zero... 26970 LD (23676),A ; ... 26973 LD (23382),A ; Set Lift control panel to display R as current floor 26976 LD (41713),A ; Set left-hand exit of the left-most Roof Garden room to lead to the Lift 26979 INC A ; Set right-hand exit of The Lift to lead to the Roof Garden (i.e. move the Lift to the ; roof)... 26980 LD (41712),A ; ... 26983 LD A,255 ; Set left-hand exits of left-most rooms on all other floors to be inaccessible (i.e. Lift ; isn't there!)... 26985 LD (41729),A ; ...4th Floor... 26988 LD (41745),A ; ...3rd Floor... 26991 LD (41761),A ; ...2nd Floor... 26994 LD (41777),A ; ...1st Floor... 26997 LD (41793),A ; ...Ground Floor... 27000 LD (41809),A ; ...and Basement 27003 CALL 35495 ; Set Magic Knight's available action flags 27006 XOR A ; Set A to zero 27007 LD (23560),A ; Set last key pressed to NULL (system variable) 27010 LD (23484),A ; Set unused memory address to zero 27013 LD (23407),A ; Set number of 1/50 seconds elapsed to zero 27016 LD H,A ; Load HL with zero... 27017 LD L,A ; ... 27018 LD (23405),HL ; Set number of minutes elapsed to zero 27021 LD (23672),A ; Set system variable FRAMES to zero 27024 LD (23673),HL ; ... 27027 INC A ; Set A to 1 27028 LD (25307),A ; Set Gimbal's current slot to 1 27031 LD (65528),A ; Set temporary store for Magic Knight's frame number to zero 27034 LD (23505),A ; Set "Animate Magic Knight's Puff of Smoke Appearance on Next Room Redraw" flag 27037 LD A,48 ; Set number of hours left... 27039 LD (23404),A ; ... 27042 LD A,127 ; Set Gimbal's current attribute to 127 (white INK, white PAPER, BRIGHT)... 27044 LD (29939),A ; ... 27047 LD A,139 ; Set read-text property of the Crystal Ball to 139... 27049 LD (42292),A ; ... 27052 LD HL,25443 ; Point HL at Thor's current position 27055 LD BC,1791 ; Load B with 6 and C with 255 *27058 INC C ; Increase C (current character index) 27059 PUSH BC ; Store B and C 27060 LD B,C ; Copy C into B 27061 LD C,(HL) ; Load character's screen number into C 27062 PUSH HL ; Store HL 27063 CALL 36327 ; Assign a slot in room C to character B and get x- and y-coordinates in BC 27066 POP HL ; Restore HL 27067 INC HL ; Advance HL to character's x-coordinate 27068 LD (HL),C ; Update current x-coordinate based upon position of assigned slot 27069 INC HL ; Advance HL to character's y-coordinate 27070 LD (HL),B ; Update current y-coordinate based upon position of assigned slot 27071 INC HL ; Advance HL to start of next character's data 27072 POP BC ; Restore B and C 27073 DJNZ 27058 ; Repeat loop for next character 27075 LD A,69 ; Assign an attribute of 69 (cyan INK, black PAPER, BRIGHT) to... 27077 LD (42360),A ; ...Broken Glass... 27080 LD (42640),A ; ...and Teleport Pad 27083 LD L,41 ; Set room layout pointer for "The Wall" to 53289... 27085 LD H,208 ; ... 27087 LD (51971),HL ; ... 27090 LD HL,33565 ; Point HL at start of character summoning sequence to return them home 27093 LD (23503),HL ; Store this at 23503 27096 LD A,9 ; Make right-wall in Secret Tunnel Entrance height 9 (i.e. full height of room)... 27098 LD (53598),A ; ... 27101 LD A,8 ; Set character whose turn it is to move to Banshee (8)... 27103 LD (55218),A ; ... 27106 LD A,21 ; Load A with 21 (The Start Room) 27108 CALL 27865 ; Move Magic Knight into room A, initialise room-specific data and draw room 27111 SET 0,(IY+65) ; Set "Update Game Time and Locate Arrow Glow" flag 27115 JP 27189 ; Jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus or ; execute other command) ; Print "HELLO HACKER" Text, Animate Starfield and Reset Spectrum upon Key-Press ; ; Used by the routine at #R26624. c27118 LD SP,24539 ; Set Stack Pointer to 24529 27121 XOR A ; Set A to zero 27122 OUT (254),A ; Reset speaker state and border to black 27124 LD HL,16384 ; Fill Display File with zeroes (i.e. black out the screen) 27127 LD DE,16385 ; ... 27130 LD BC,6144 ; ... 27133 LD (HL),A ; ... 27134 LDIR ; ... 27136 LD A,71 ; Load A with 71 27138 LD (23693),A ; Set system variable ATTR P (permanent colours) to 71 (White INK, black PAPER, BRIGHT) 27141 LD (23695),A ; Set system variable ATTR T to 71 (White INK, black PAPER, BRIGHT) 27144 LD BC,767 ; Flood Attribute File with value 71 (white INK, black PAPER, BRIGHT) 27147 LD (HL),A ; ... 27148 LDIR ; ... 27150 LD HL,20480 ; Set Display File address to print text 27153 LD (36488),HL ; ... 27156 LD HL,43054 ; Point HL at "HELLO HACKER" text 27159 CALL 36725 ; Print text to screen 27162 CALL 38884 ; Animate starfield until a key is pressed 27165 JP 0 ; Reset the Spectrum ; Redraw Magic Knight's Current Room and Return to Main Game Loop ; ; Used by the routines at #R30222 and #R35420. c27168 LD A,(65529) ; Load A with Magic Knight's current room 27171 CALL 27865 ; Move Magic Knight into room A, initialise room-specific data and draw room 27174 JR 27189 ; Jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus or ; execute other command) ; Main Game Loop - Process Keyboard Input and Move Magic Knight, Enter Menus or Execute Other Command ; ; Used by the routine at #R35420. c27176 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate 27179 LD (65528),A ; Store frame number at 65528... 27182 LD (25390),A ; ...and in Magic Knight's current data 27185 XOR A ; Set A to zero (Magic Knight) and... 27186 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) ; This entry point is used by the routines at #R26906, #R27168, #R31636, #R32035, #R32194, #R32258, #R32390, ; #R32655, #R33312, #R33593 and #R33663. *27189 CALL 29763 ; Run checks and updates (Magic Knight's current room and room-specific routines) 27192 CALL 27495 ; Handle Magic Knight's fall 27195 LD A,127 ; Reset bit 7 in A to select the keyboard half-row SPACE - B 27197 IN A,(254) ; Read the keyboard 27199 RRA ; Reset Carry Flag if SPACE pressed, else set it 27200 JR C,27213 ; SPACE was not pressed, so skip ahead to #R27213 27202 LD A,254 ; Reset bit 0 in A to select the keyboard half-row SHIFT - V 27204 IN A,(254) ; Read the keyboard 27206 RRA ; Reset Carry Flag if SHIFT pressed, else set it 27207 LD HL,43450 ; Point HL at "BREAK KEY PRESSED" text 27210 JP NC,35101 ; If SHIFT was pressed (i.e. SHIFT-SPACE, or BREAK) jump to "Game over" window routine and exit *27213 CALL 27666 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27216 CALL 37876 ; Capture keyboard/joystick input into A 27219 BIT 0,A ; If "left" pressed then... 27221 JP NZ,27307 ; Skip ahead to Move Left Subroutine 27224 BIT 1,A ; If "right" pressed then... 27226 JP NZ,27358 ; Skip ahead to Move Right Subroutine 27229 BIT 2,A ; If "up" pressed then... 27231 JP NZ,27374 ; Skip ahead to Jump Subroutine 27234 BIT 3,A ; Check for "down" pressed ; Routine fragment at 27236 ; ; This is the conditional jump to the cheat / debug routine which is overwritten by the instructions between #R26633 ; and #R26640. ; ; . ; ; The following three bytes are set to zero (NOP) by the instructions between 26633 and 26640. This disables the ; conditional jump to the cheat / debug routine at #R35420 (see trivia). c27236 JP NZ,35420 ; Jump to Select Magic Knight's Room (Cheat / Debug Routine - see trivia) 27239 BIT 4,A ; If "fire" pressed then... 27241 JP NZ,27301 ; Skip ahead to #R27301 27244 LD A,(65528) ; Set Magic Knight's current frame to stored value... 27247 LD (25390),A ; ... 27250 XOR A ; Set A to zero (Magic Knight) and... 27251 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) *27254 LD A,(23560) ; Load index of last pressed key into A 27257 OR A ; If last key pressed is null (i.e. key NOT pressed)... 27258 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 27261 LD HL,41811 ; Point HL at string of keyboard shortcuts for commands 27264 LD B,A ; Load index of key pressed into B 27265 LD C,0 ; Set C (index of command shortcut) to zero initially *27267 LD A,(HL) ; Load command shortcut from table at 41811 into A 27268 OR A ; If A is zero (i.e. we have reached the last command shortcut in the table)... 27269 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 27272 CP B ; If key pressed matches current command shortcut... 27273 JP Z,27280 ; ...then skip ahead to #R27280 27276 INC C ; Increase C to advance to next command shortcut to test 27277 INC HL ; Advance pointer to next shortcut 27278 JR 27267 ; Loop back to #R27267 for next shortcut *27280 CALL 37472 ; Wait for keyboard to be released 27283 LD A,C ; Load double the index of command shortcut chosen into BC... 27284 ADD A,A ; ... 27285 LD B,0 ; ... 27287 LD C,A ; ... 27288 LD HL,41827 ; Point HL at table of routine start addresses for Magic Knight's main menu commands 27291 ADD HL,BC ; Add double index of this command's entry as offset, so HL now points at address in table of ; chosen command 27292 LD A,(HL) ; Load address into HL... 27293 INC HL ; ... 27294 LD H,(HL) ; ... 27295 LD L,A ; ... 27296 XOR A ; Set last pressed key to null... 27297 LD (23560),A ; ... 27300 JP (HL) ; Execute the command, then return to game ; Fire pressed *27301 CALL 37486 ; Wait for fire button / key to be released 27304 JP 31153 ; Display and handle main in-game menu, execute selected command and return to game ; Left pressed *27307 LD HL,23470 ; If "Magic Knight Can't Move Left" flag is set... 27310 BIT 0,(HL) ; ... 27312 JP NZ,27254 ; ...then loop back to start of keyboard check routine 27315 LD HL,34824 ; Load HL with 34824 (left-facing version of update Magic Knight's current frame routine) 27318 EX AF,AF' ; Switch AF and AF' 27319 LD A,254 ; Set Magic Knight's x-velocity to minus 2... *27321 LD (25391),A ; ... 27324 LD (27405),A ; Prepare to set Magic Knight's x-velocity to minus 2 27327 LD (34822),HL ; Set instruction at 34821 to jump to 34824 (left-facing version of update Magic Knight's ; current frame routine) 27330 EX AF,AF' ; Switch AF and AF' (A now holds pressed controls bitmap) 27331 BIT 2,A ; If "up" was also pressed... 27333 JR NZ,27378 ; ...then skip ahead to #R27378 (jumping subroutine) 27335 XOR A ; Set Magic Knight's current y-velocity to zero... 27336 LD (25392),A ; ... 27339 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate... 27342 LD (25390),A ; ... 27345 LD (65528),A ; Store frame number at 65528 27348 XOR A ; Set A to zero (Magic Knight) and... 27349 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 27352 CALL 27495 ; Handle Magic Knight's fall 27355 JP 27254 ; Loop back for next key / control press ; Right pressed *27358 LD HL,23470 ; If "Magic Knight Can't Move Right" flag is set... 27361 BIT 1,(HL) ; ... 27363 JP NZ,27254 ; ...then loop back to start of keyboard check routine 27366 LD HL,34838 ; Load HL with 34838 (right-facing version of update Magic Knight's current frame routine) 27369 EX AF,AF' ; Switch AF and AF' 27370 LD A,2 ; Jump to #R27321, setting Magic Knight's x-velocity to 2... 27372 JR 27321 ; ... ; Up pressed *27374 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 27375 LD (27405),A ; ... *27378 LD HL,41859 ; Point HL at start of Magic Knight's y-velocities sequence table *27381 LD (41857),HL ; Store current position in Magic Knight's y-velocities sequence table at 41857 27384 LD A,(25388) ; Load Magic Knight's current y-coordinate into A 27387 CP 8 ; If y-coordinate is less than 8... 27389 JP C,27468 ; ...then jump to #R27468 (exit loop as Magic Knight can't get any higher!) 27392 LD HL,(41857) ; Load HL with current position in Magic Knight's y-velocities sequence table 27395 LD A,(HL) ; Load the current y-velocity in the sequence into A 27396 NEG ; Negate (as Magic Knight is jumping upwards) 27398 OR A ; If A is zero... 27399 JR Z,27468 ; ...jump to #R27468 (exit loop as we have reached the end of the sequence) 27401 LD (25392),A ; Load A into Magic Knight's y-velocity ; The operand of the instruction at #R27404 represents the x-velocity value stored previously. This is modified by ; the instruction at #R27375. 27404 LD A,0 ; Set Magic Knight's x-velocity... 27406 LD (25391),A ; ... 27409 CALL 27666 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27412 LD A,(25391) ; Load Magic Knight's x-velocity into B... 27415 LD B,A ; ... 27416 LD A,(23470) ; Load Magic Knight movement flags into A 27419 XOR B ; Check: 27420 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 27422 JP Z,27480 ; ...then jump ahead to #R27480 27425 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 27427 JP Z,27480 ; ...then jump ahead to #R27480 27430 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 27432 JP Z,27480 ; ...then jump ahead to #R27480 27435 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 27436 JP Z,27480 ; ...then jump ahead to #R27480 *27439 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate... 27442 LD (25390),A ; ... 27445 LD (65528),A ; Store frame number at 65528 27448 CALL 27809 ; Kill Magic Knight's jump if he cannot vertically pass through a block above him 27451 PUSH AF ; Store AF 27452 XOR A ; Set A to zero (Magic Knight) and... 27453 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 27456 POP AF ; Restore AF 27457 JR NZ,27468 ; If Magic Knight's jump was impeded by a block above him then jump to #R27468 27459 CALL 29763 ; Run checks and updates (Magic Knight's current room and room-specific routines) 27462 LD HL,(41857) ; Load HL with current position in Magic Knight's y-velocities sequence table at #R41857 27465 INC HL ; Advance to next y-velocity in the sequence 27466 JR 27381 ; Loop back to #R27381 *27468 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate 27471 LD (65528),A ; Store frame number at #R65528 27474 CALL 27490 ; Handle Magic Knight's fall, preserving x-velocity 27477 JP 27254 ; Loop back to start of keyboard check routine *27480 XOR A ; Set Magic Knight's x-velocity to zero... 27481 LD (25391),A ; ... 27484 LD (27405),A ; Prepare to set Magic Knight's x-velocity to zero 27487 JP 27439 ; Jump back to #R27439 ; Handle Magic Knight's Fall, Preserving x-Velocity ; ; Used by the routine at #R27176. c27490 LD A,(27405) ; Load Magic Knight's stored x-velocity 27493 JR 27496 ; Handle Magic Knight's fall ; Handle Magic Knight's Falls ; ; Used by the routine at #R27176. c27495 XOR A ; Set A to zero ; This entry point is used by the routine at #R27490. *27496 LD (27531),A ; Prepare to set Magic Knight's x-velocity to A 27499 LD HL,41872 ; Point HL at end of table of y-velocities sequence for jumping and falling 27502 LD (41857),HL ; Store current position at 41857 *27505 LD A,(23470) ; If Magic Knight's movement flags are unset... 27508 OR A ; ... 27509 JR Z,27515 ; ...then skip ahead to #R27515 27511 XOR A ; Prepare to set Magic Knight's x-velocity to zero... 27512 LD (27531),A ; ... *27515 LD HL,(41857) ; Load current position in y-velocities table into HL 27518 LD A,(HL) ; Load current y-velocity from table into A 27519 CP 7 ; If velocity is 7... 27521 JR Z,27527 ; ...then skip ahead to #R28527 27523 DEC HL ; Step pointer back one byte in y-velocities table 27524 LD (41857),HL ; Store pointer *27527 LD (25392),A ; Load last y-velocity read from table into Magic Knight's y-velocity ; The operand of the instruction at #R27530 represents the x-velocity value stored previously. This is modified by ; the instructions at #R27496, #R27512 and #R27660. 27530 LD A,0 ; Set Magic Knight's x-velocity... 27532 LD (25391),A ; ... 27535 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 27538 ADD A,4 ; Add 4 to x-coordinate 27540 CALL 30123 ; Divide x-coordinate by eight, rounding down to nearest integer 27543 LD C,A ; Load result (Magic Knight's x-coordinate in characters) into C, setting B to zero... 27544 LD B,0 ; ... 27546 LD A,(25388) ; Load Magic Knight's current y-coordinate into A 27549 AND 7 ; If y-coordinate is a multiple of eight... 27551 JR Z,27555 ; ...then skip ahead to #R27555 27553 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] *27555 LD A,(25388) ; Load Magic Knight's current y-coordinate into A 27558 ADD A,B ; Add B to current y-coordinate (i.e. y-coordinate of highest full character block spanned by ; Magic Knight) 27559 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) 27561 RRCA ; Divide result by 8, removing remainder... 27562 RRCA ; ... 27563 RRCA ; ... 27564 AND 31 ; ... 27566 LD B,A ; Load result (y-coordinate in characters) into B 27567 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B (block that Magic ; Knight is "falling through") 27570 BIT 7,(HL) ; If block cannot be passed vertically (i.e. Magic Knight has landed)... 27572 JP NZ,27627 ; ...then skip ahead to #R27627 27575 INC HL ; Advance to next block right (as Magic Knight is two character blocks wide) in Terrain ; Interaction Table 27576 BIT 7,(HL) ; If block cannot be passed vertically (i.e. Magic Knight has landed)... 27578 JP NZ,27627 ; ...then skip ahead to #R27627 27581 CALL 27666 ; Kill Magic Knight's x-velocity if he cannot horizontally pass through a block beside him 27584 LD A,(25391) ; Load Magic Knight's x-velocity into B... 27587 LD B,A ; ... 27588 LD A,(23470) ; Load Magic Knight's movement flags into A 27591 XOR B ; Check: 27592 CP 255 ; If x-velocity is -2 (left), and Magic Knight can't move left... 27594 JP Z,27656 ; ...then jump ahead to #R27656 27597 CP 253 ; If x-velocity is -2 (left), and Magic Knight can't move left or right... 27599 JP Z,27656 ; ...then jump ahead to #R27656 27602 CP 1 ; If x-velocity is +2 (right), and Magic Knight can't move left or right... 27604 JP Z,27656 ; ...then jump ahead to #R27656 27607 OR A ; If x-velocity is +2 (right), and Magic Knight can't move right... 27608 JP Z,27656 ; ...then jump ahead to #R27656 *27611 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate 27614 LD (65528),A ; Store frame number at 65528 27617 XOR A ; Set A to zero (index for Magic Knight) and... 27618 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 27621 CALL 29763 ; Run checks and updates (Magic Knight's current room and room-specific routines) 27624 JP 27505 ; Loop back to #R27505 *27627 LD A,(25388) ; Load Magic Knight's current y-coordinate into A (e.g. 105) 27630 AND 15 ; Retain only pixel-within-two-characters component (e.g. 9 pixels down the pair of character ; blocks) 27632 NEG ; Negate (i.e. -9 pixels) 27634 AND 15 ; Retain only pixel-within-two-characters component (e.g. 7 pixels up the pair of character ; blocks, or 7 pixels down to the ground) 27636 LD (25392),A ; Set Magic Knight's y-velocity so that it will take his feet to the ground 27639 LD A,(65528) ; Set Magic Knight's frame number to match stored value... 27642 LD (25390),A ; ... 27645 XOR A ; Set A to zero (Magic Knight) and... 27646 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 27649 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 27652 LD (25391),HL ; ... 27655 RET ; Return (Magic Knight has landed) *27656 XOR A ; Set Magic Knight's x-velocity to zero... 27657 LD (25391),A ; ... 27660 LD (27531),A ; Prepare to set Magic Knight's x-velocity to zero 27663 JP 27611 ; Jump back to #R27611 ; Kill Magic Knight's x-Velocity if he Cannot Horizontally Pass Through a Block Beside Him ; ; Used by the routines at #R27176 and #R27495. c27666 LD A,(23410) ; Load B with Magic Knight's "temporary store" movement flags... 27669 LD B,A ; ... 27670 LD A,(25387) ; Load Magic Knight's x-coordinate into A 27673 CP 5 ; If x-coordinate is less than 5... 27675 JP C,27685 ; ...then jump ahead to #R27685 27678 CP 229 ; If x-coordinate is greater than 229... 27680 JP NC,27685 ; ...then jump ahead to #R27685 27683 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) *27685 LD A,B ; Load Magic Knight's Temporary Store Movement Flags into A 27686 LD (23470),A ; Set Magic Knight's movement flags 27689 LD A,(25388) ; Load Magic Knight's y-coordinate into A 27692 LD B,A ; Copy into B 27693 LD A,(25392) ; Add Magic Knight's y-velocity to y-coordinate in A... 27696 ADD A,B ; ... 27697 LD (23479),A ; Store this new (predicted) y-coordinate at 23479 27700 LD C,4 ; Set C to 4 (as Magic Knight is normally four characters tall) 27702 AND 7 ; If predicted y-coordinate is divisible by eight... 27704 JR Z,27707 ; ...then skip ahead to #R27707... 27706 INC C ; ...else Magic Knight must be airborne and at non-integer y-coordinate, and so spans five ; character blocks rather than four *27707 LD A,C ; Load A with number of vertical characters spanned by Magic Knight... 27708 LD (27740),A ; ...and update instructions at 27739... 27711 LD (27781),A ; ...and 27780 with this value 27714 LD A,(25387) ; Load Magic Knight's current x-coordinate into C... 27717 LD C,A ; ... 27718 LD A,(25391) ; Add Magic Knight's x-velocity to x-coordinate in A... 27721 ADD A,C ; ... 27722 LD (23478),A ; Store this new (predicted) x-coordinate at 23478 27725 CALL 30123 ; Divide predicted x-coordinate by eight, rounding down to nearest integer... 27728 LD C,A ; ...and load into C 27729 LD A,(23479) ; Load predicted y-coordinate into A... 27732 CALL 30123 ; ...divide it by eight, rounding down to nearest integer... 27735 LD (23479),A ; ...store back at 23479... 27738 LD B,A ; ...and load into B ; The operand of the instruction at #R27739 represents the number of character blocks to check. This is modified by ; the instruction at #R27708. 27739 LD A,0 ; Load number of characters (vertically) to check for impassibility *27741 PUSH AF ; Store remaining number of character blocks spanned by Magic Knight vertically to check 27742 PUSH BC ; Store predicted x- and y-coordinates (characters) 27743 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B 27746 POP BC ; Restore predicted x- and y-coordinates (characters) 27747 BIT 5,(HL) ; If bit 5 of terrain data is set (i.e. Magic Knight cannot pass block horizontally)... 27749 JR NZ,27758 ; ...then jump ahead to #R27758 27751 INC B ; Advance check to next character down 27752 POP AF ; Restore remaining number of character blocks spanned by Magic Knight vertically to check 27753 DEC A ; Decrease count of remaining character blocks by one 27754 JR NZ,27741 ; Loop back to 27741 to check next block down 27756 JR 27767 ; Skip over setting Magic Knight's Cannot Move Left Flag as there are no obstructions to the ; left *27758 POP AF ; Restore AF 27759 LD A,(23470) ; Set "Magic Knight Cannot Move Left" flag... 27762 OR 1 ; ... 27764 LD (23470),A ; ... *27767 LD A,(23478) ; Load Magic Knight's predicted x-coordinate (pixels) into A... 27770 ADD A,15 ; ...and add 15 27772 CALL 30123 ; Divide A by eight, rounding down to nearest integer... 27775 LD C,A ; ...and load into C 27776 LD A,(23479) ; Load Magic Knight's predicted y-coordinate (characters) into B... 27779 LD B,A ; ... ; The operand of the instruction at #R27780 represents the number of character blocks to check. This is modified by ; the instruction at #R27711. 27780 LD A,0 ; Load number of characters (vertically) to check for impassibility *27782 PUSH AF ; Store AF (remaining number of vertical characters to check for impassibility) 27783 PUSH BC ; Store BC (predicted y- and x-coordinates in characters) 27784 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B 27787 POP BC ; Restore predicted coordinates 27788 BIT 5,(HL) ; If bit 5 is set (i.e. Magic Knight cannot pass block horizontally)... 27790 JR NZ,27799 ; ...jump ahead to #R27799 27792 INC B ; Increase y-coordinate by one character 27793 POP AF ; Restore AF 27794 DEC A ; Decrease number of remaining blocks to check 27795 JR NZ,27782 ; If number of remaining blocks to check is not zero then loop back to #R27782 27797 JR 27808 ; Exit routine *27799 POP AF ; Restore AF 27800 LD A,(23470) ; Set "Magic Knight Cannot Move Right" flag... 27803 OR 2 ; ... 27805 LD (23470),A ; ... *27808 RET ; Return ; Kill Magic Knight's Jump if he Cannot Vertically Pass Through a Block Above Him ; ; Used by the routine at #R27176. Output: A 0 (if Magic Knight's jump was not impeded) or 1 (if the jump was ; impeded) c27809 LD A,(25388) ; Load Magic Knight's current y-coordinate into B... 27812 LD B,A ; ... 27813 LD A,(25392) ; Load A with Magic Knight's y-velocity 27816 ADD A,B ; Add y-velocity to y-coordinate in A 27817 CALL 30123 ; Divide A by eight, rounding down to nearest integer 27820 LD B,A ; Load Magic Knight's y-coordinate (characters) into B 27821 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 27824 ADD A,4 ; Add 4 to x-coordinate (to get point roughly quarter of the way through Magic Knight's total ; width) 27826 CALL 30123 ; Divide A by eight, rounding down to nearest integer 27829 LD C,A ; Load Magic Knight's current x-coordinate (characters) into C 27830 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B 27833 BIT 7,(HL) ; If bit 7 of Magic Knight's current position's terrain data (block is impassable vertically) ; is set then... 27835 JR NZ,27857 ; ...kill Magic Knight's y-velocity and exit routine 27837 INC HL ; Advance to next character block along in Terrain Interaction Data 27838 BIT 7,(HL) ; If bit 7 of this position's terrain data (block is impassable vertically) is set then... 27840 JR NZ,27857 ; ...kill Magic Knight's y-velocity and exit routine 27842 DEC B ; Advance y-coordinate by one character (to get point roughly three quarters of the way through ; Magic Knight's total width) 27843 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B 27846 BIT 7,(HL) ; If bit 7 of this position's terrain data (block is impassable vertically) is set then... 27848 JR NZ,27857 ; ...kill Magic Knight's y-velocity and exit routine 27850 INC HL ; Advance to next character block along in Terrain Interaction Data 27851 BIT 7,(HL) ; If bit 7 of this position's terrain data (block is impassable vertically) is set then... 27853 JR NZ,27857 ; ...kill Magic Knight's y-velocity and exit routine 27855 XOR A ; Set A to zero, as jump was not impeded 27856 RET ; Return *27857 XOR A ; Set Magic Knight's y-velocity to zero... 27858 LD (25392),A ; ... 27861 LD A,1 ; Set A to one 27863 OR A ; Reset zero flag 27864 RET ; Return ; Move Magic Knight into Room A, Initialise Room-Specific Data and Draw Room ; ; Used by the routines at #R26906, #R27168 and #R29514. Input: A Room index c27865 LD (65529),A ; Update Magic Knight's current room to be room index passed to this routine in A 27868 LD A,(25315) ; Decrease Magic Knight's current strength by one... 27871 DEC A ; ... 27872 LD (25315),A ; ... 27875 OR A ; Set zero flag if strength is zero 27876 LD HL,43960 ; Point HL to "YOU DIED OF EXHAUSTION" text... 27879 JP Z,35101 ; ...and if strength is zero, jump to "Game over" window routine and exit 27882 LD A,32 ; Load 32 into "frame number" property of... 27884 LD (36187),A ; ...odd ball 1... 27887 LD (36195),A ; ...odd ball 2... 27890 LD (36203),A ; ...odd ball 3... 27893 LD (36211),A ; ...and odd ball 4 27896 CALL 30101 ; Indent "SPELLBOUND" text in bottom window to indicate Magic Knight's current floor 27899 LD A,(65529) ; Flag Magic Knight's current room as visited for scoring purposes... 27902 LD E,A ; ... 27903 LD D,0 ; ... 27905 LD HL,23412 ; ... 27908 ADD HL,DE ; ... 27909 LD (HL),1 ; ... 27911 LD A,7 ; Set system variable BORDCR to 7... 27913 LD (23624),A ; ... 27916 XOR A ; Set A to zero 27917 OUT (254),A ; Set border to black and reset speaker state 27919 LD A,224 ; Set current Terrain Interaction Parameter to "impassable horizontally", "impassable ; vertically" and "preserve attribute"... 27921 LD (23483),A ; ... 27924 LD A,71 ; Set system variable ATTR T to 71 (white INK, black PAPER, BRIGHT)... 27926 LD (23695),A ; ... 27929 LD A,(23467) ; Load game progress flags into A 27932 RRCA ; Set A to 2 if Armouris Photonicus has been cast, else set A to zero... 27933 AND 2 ; ... 27935 ADD A,69 ; ...add A to 69 (attribute value for cyan INK, black PAPER, BRIGHT, i.e. Magic Knight's ; initial attribute) 27937 LD (25393),A ; Load this value into Magic Knight's current attribute slot 27940 XOR A ; Set brickwork direction flag to zero (horizontal mode for floor and ceiling)... 27941 LD (23476),A ; ... 27944 LD HL,24539 ; Point HL at start of Terrain Interaction Data... 27947 LD DE,24540 ; ...and set 640 bytes from there onwards to 0, clearing data... 27950 LD BC,639 ; ... 27953 LD (HL),A ; ... 27954 LDIR ; ... 27956 LD HL,23383 ; Clear table of glowing Attribute File addresses... 27959 LD DE,23384 ; ... 27962 LD BC,19 ; ... 27965 LD (HL),A ; ... 27966 LDIR ; ... 27968 LD (25389),A ; Set Magic Knight's current frame to erase to zero (frame 0 is blank graphic data) so Magic ; Knight is drawn but not erased 27971 LD (25390),A ; Set Magic Knight's frame number to zero 27974 LD HL,16384 ; Set "Display File address to print character to" to beginning of Display File... 27977 LD (36488),HL ; ... 27980 LD HL,22528 ; Point attribute cursor to beginning of Attribute File... 27983 LD (23487),HL ; ... 27986 LD HL,24539 ; Set Terrain Interaction Table Cursor to point to start of Terrain Interaction Table... 27989 LD (23481),HL ; ... 27992 LD A,(65529) ; Load Magic Knight's current room into A... 27995 ADD A,A ; ...and double the value (as room entries are 2 bytes wide) 27996 LD D,0 ; Load into DE... 27998 LD E,A ; ... 27999 LD HL,51913 ; ...and add to position of start of table of room data addresses... 28002 ADD HL,DE ; ...into HL 28003 LD A,(HL) ; Read address of room data for this room into HL... 28004 INC HL ; ... 28005 LD H,(HL) ; ... 28006 LD L,A ; ... ; Room data is read here *28007 LD A,(HL) ; Load byte from room data into A 28008 OR A ; If data is a zero... 28009 JP Z,28092 ; ...then draw bottom in-game window + room name and animate entry (Puff of Smoke) of a ; character if required and return 28012 CP 160 ; If data is less than 160... 28014 JP C,28038 ; ...then skip ahead to #R28038 28017 PUSH HL ; Store HL (pointer to current position in current room data) 28018 SUB 230 ; Subtract 230 from current data 28020 ADD A,A ; Double the remaining value... 28021 LD E,A ; ...and load into DE... 28022 LD D,0 ; ... 28024 LD HL,30170 ; Point HL at table of addresses of room feature drawing routines 28027 ADD HL,DE ; Add doubled index value as offset to pointer to table of room feature drawing routine ; addresses 28028 LD A,(HL) ; Load room feature drawing address into HL... 28029 INC HL ; ... 28030 LD H,(HL) ; ... 28031 LD L,A ; ... 28032 PUSH HL ; Transfer room feature drawing address into IX... 28033 POP IX ; ... 28035 POP HL ; Restore HL (pointer to current position in current room data) 28036 JP (IX) ; Jump to room feature drawing routine address ; Data is less than 160 *28038 LD B,A ; Copy byte of room data into B (repeat counter for drawing brickwork / architecture) 28039 INC HL ; Advance pointer to current room data by one byte 28040 LD A,(HL) ; Load next byte of room data into A... 28041 LD C,A ; ...and copy into C 28042 OR A ; If this value is zero... 28043 JR Z,28050 ; ...then skip ahead to #R28050 28045 INC HL ; Advance HL by one byte 28046 LD A,(HL) ; Load data into system variable ATTR T... 28047 LD (23695),A ; ... *28050 LD A,C ; Copy C into A 28051 CALL 28344 ; Draw a 2-by-2 block of brickwork, depending upon brickwork drawing mode, with architecture ; style A 28054 DJNZ 28050 ; Loop back to draw next block of brickwork if counter is not zero ; This entry point is used by the routines at #R28064, #R29396 and #R29414. *28056 XOR A ; Set brickwork drawing mode to two rows... 28057 LD (23469),A ; ... ; This entry point is used by the routines at #R28651, #R28659, #R28667, #R28675, #R28683, #R28747, #R28841, ; #R28882, #R28960, #R29032, #R29089, #R29150, #R29184, #R29205, #R29225, #R29291, #R29356 and #R29375. *28060 INC HL ; Advance room data pointer by one byte... 28061 JP 28007 ; ...and repeat routine for this new data ; Set Brickwork Direction Mode to Vertical and Reset Pointers to Beginning of Display c28064 PUSH HL ; Store HL (pointer to current position in current room data) 28065 LD A,1 ; Set brickwork direction flag to 1 (vertical mode for walls)... 28067 LD (23476),A ; ... 28070 LD HL,16384 ; Point HL to start of Display File 28073 LD (36488),HL ; Load HL into "memory location to start printing character" in character printing routine 28076 LD HL,22528 ; Point HL to start of Attribute File 28079 LD (23487),HL ; Update virtual text cursor (attribute) position to 0, 0 28082 LD HL,24539 ; Set Terrain Interaction Table Cursor to point to start of Terrain Interaction Data... 28085 LD (23481),HL ; ... 28088 POP HL ; Restore HL (pointer to current position in current room data) 28089 JP 28056 ; Return to room drawing routine, setting brickwork drawing mode to two rows (so walls don't ; have holes in them!) ; Draw Bottom in-Game Window + Room Name and Animate Entry (Puff of Smoke) of a Character if Required ; ; Used by the routine at #R27865. Output: A Magic Knight's current room c28092 CALL 28272 ; Print Magic Knight's current room name to top of screen 28095 LD A,15 ; Prepare to draw window 15 (window at bottom of screen) 28097 HALT ; Wait for interrupt 28098 CALL 36987 ; Draw window 15 28101 LD HL,43136 ; Point HL to "SPELLBOUND COPYRIGHT..." text (shown in window at bottom of in-game screen when ; Magic Knight is not carrying the Mirror) 28104 PUSH HL ; Store HL 28105 LD A,35 ; Load A with object index of 35 (Mirror) 28107 CALL 34256 ; Set Zero Flag if Magic Knight is carrying the Mirror 28110 POP HL ; Restore HL 28111 JR NZ,28116 ; If Magic Knight is not carrying the Mirror, then skip to #R28116 28113 LD HL,43913 ; Point to " * STRENGTH * 1 2 3 4 5" text *28116 CALL 36725 ; Print text at HL to screen 28119 CALL 36215 ; Draw health bar at bottom of screen 28122 CALL 36275 ; Draw objects in Magic Knight's inventory to bottom of screen if he is carrying mirror 28125 CALL 29446 ; Set Magic Knight's action flags and prepare to execute room-specific routine for his current ; room 28128 CALL 38512 ; Set Terrain Interaction Data for all objects in Magic Knight's current room 28131 CALL 30129 ; Draw lift doors if Magic Knight is at Lift entrance on a different floor to the Lift 28134 XOR A ; Set Magic Knight's current frame to erase to zero (frame 0 is blank graphic data) so Magic ; Knight is drawn but not erased... 28135 LD (25389),A ; ... 28138 CALL 34821 ; Update Magic Knight's current frame based on x-coordinate 28141 LD (65528),A ; Store frame number at 65528 28144 LD (25390),A ; Set Magic Knight's current frame 28147 XOR A ; Set A to zero (Magic Knight) and... 28148 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 28151 CALL 29576 ; Draw all characters in current room and animate arrival of any new character 28154 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 28156 LD (23695),A ; ... 28159 RES 1,(IY+65) ; Reset "Disable In-Game Glow" flag 28163 RES 2,(IY+65) ; Reset "Characters Can't Move" flag 28167 LD A,(23505) ; If "Animate Magic Knight's Puff of Smoke Appearance on Next Room Redraw" flag is reset... 28170 OR A ; ... 28171 JR Z,28264 ; ...then jump ahead to #R28264 28173 LD A,(25390) ; Load Magic Knight's current frame number into A 28176 PUSH AF ; Store AF (A = Magic Knight's current frame number) 28177 XOR A ; Set Magic Knight's current frame number to zero... 28178 LD (25390),A ; ... 28181 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 28184 LD A,(25393) ; Load Magic Knight's current attribute into system variable ATTR T... 28187 LD (23695),A ; ... 28190 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 28193 RRCA ; Divide x-coordinate by eight, rounding down to nearest integer... 28194 RRCA ; ... 28195 RRCA ; ... 28196 AND 31 ; ... 28198 LD C,A ; Copy x-coordinate (characters) into C 28199 LD A,(25388) ; Load Magic Knight's current y-coordinate into A 28202 RRCA ; Divide y-coordinate by eight, rounding down to nearest integer... 28203 RRCA ; ... 28204 RRCA ; ... 28205 AND 31 ; ... 28207 LD B,A ; Copy y-coordinate (characters) into B 28208 LD E,63 ; Load E with 63 (index of Puff of Smoke frame 1) 28210 PUSH DE ; Store DE (E = index of current Puff of Smoke animation frame) 28211 PUSH BC ; Store BC (Magic Knight's x- and y-coordinates in characters) 28212 LD A,E ; Copy index of first Puff of Smoke animation frame into A 28213 CALL 29950 ; Draw Puff of Smoke frame 1 in XOR mode 28216 POP BC ; Restore BC (Magic Knight's x- and y-coordinates in characters) 28217 POP DE ; Restore DE (E = index of current Puff of Smoke animation frame) 28218 LD D,5 ; Load D with 5 (as there are five frames of the Puff of Smoke animation to draw) *28220 HALT ; Wait for interrupts (delay between frames)... 28221 HALT ; ... 28222 HALT ; ... 28223 HALT ; ... 28224 HALT ; ... 28225 HALT ; ... 28226 PUSH DE ; Store DE (D = count of frames to draw, E = graphic lookup index) 28227 PUSH BC ; Store BC (Magic Knight's x- and y-coordinates in characters) 28228 LD A,E ; Copy E into A (index of current frame of Puff of Smoke animation) 28229 CALL 29950 ; Redraw current frame of Puff of Smoke animation in XOR mode, erasing it 28232 POP BC ; Restore BC (Magic Knight's x- and y-coordinates in characters) 28233 POP DE ; Restore DE (D = count of frames to draw, E = graphic lookup index) 28234 INC E ; Advance index E to next Puff of Smoke frame 28235 PUSH DE ; Store DE (D = count of frames to draw, E = graphic lookup index) 28236 PUSH BC ; Store BC (Magic Knight's x- and y-coordinates in characters) 28237 LD A,E ; Copy E into A (index of current frame of Puff of Smoke animation) 28238 CALL 29950 ; Draw current frame of Puff of Smoke animation in XOR mode 28241 POP BC ; Restore BC (Magic Knight's x- and y-coordinates in characters) 28242 POP DE ; Restore DE (D = count of frames to draw, E = graphic lookup index) 28243 DEC D ; Decrease D (count of frames to draw) 28244 JR NZ,28220 ; Loop back to draw next frame if there are any remaining 28246 HALT ; Wait for interrupts... 28247 HALT ; ... 28248 HALT ; ... 28249 HALT ; ... 28250 HALT ; ... 28251 HALT ; ... 28252 LD A,E ; Draw final frame in XOR mode, erasing it... 28253 CALL 29950 ; ... 28256 POP AF ; Restore AF (A = Magic Knight's current frame number) 28257 LD (25390),A ; Restore Magic Knight's current frame number 28260 XOR A ; Set A to zero (Magic Knight) and... 28261 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) *28264 XOR A ; Reset "Animate Magic Knight's Puff of Smoke Appearance on Next Room Redraw" flag... 28265 LD (23505),A ; ... 28268 LD A,(65529) ; Load Magic Knight's current room into A 28271 RET ; Return ; Print Magic Knight's Current Room Name to Top of Screen ; ; Used by the routine at #R28092. c28272 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 28274 LD (23695),A ; ... 28277 LD HL,54238 ; Point HL to start of list of room names 28280 LD A,(65529) ; Load index of Magic Knight's current room into A... 28283 LD B,A ; ...and transfer to B (countdown for search loop) 28284 LD A,B ; Copy value back into A 28285 OR A ; If B is zero then... 28286 JR Z,28293 ; ...skip ahead to #R28293 *28288 CALL 36703 ; Advance HL to start of next zero-terminated string 28291 DJNZ 28288 ; Repeat until HL points to entry with index same as Magic Knight's current room *28293 LD A,(HL) ; Get string length data... 28294 OR A ; ... 28295 RET Z ; ...and exit if string is zero-length 28296 INC HL ; Move to first character 28297 PUSH HL ; Store HL (points to Magic Knight's current room name text data) 28298 ADD A,8 ; Add 8 to length (to get total length including ** and **) 28300 LD B,A ; Store length in B 28301 LD A,32 ; Subtract string length from total screen width (32 characters)... 28303 SUB B ; ... 28304 RRCA ; ...and divide by two to obtain number of blank characters to leave before writing room name 28305 AND 31 ; Ensure value is limited to range 0-31 28307 LD C,A ; Load BC with number of blank characters to leave before printing start of string... 28308 LD B,0 ; ... 28310 LD HL,16384 ; ...and add it to 16384 (start of screen data) 28313 ADD HL,BC ; HL now points to first Display File byte to modify in printing room name 28314 LD (36488),HL ; Store this at 36488 28317 LD HL,28334 ; Load HL with pointer to ** text 28320 CALL 36725 ; Print text at location HL to screen 28323 POP HL ; Restore HL (actual room name) 28324 CALL 36725 ; Print text at location HL to screen 28327 LD HL,28339 ; Load HL with pointer to ** text 28330 CALL 36725 ; Print text at location HL to screen 28333 RET ; Return ; Text Data Used in Room Titles as Printed at Top of Screen b28334 DEFM "** " ; Prefix to room name 28338 DEFM 0 ; End Marker 28339 DEFM " **" ; Suffix to room name 28343 DEFM 0 ; End Marker ; Room Drawing Draw a 2-by-2 Block of Brickwork, then Move Cursor Right or Down, Depending Upon Wall Direction Flag ; ; Used by the routines at #R27865, #R29396 and #R29414. Input: A Architecture style index (e.g. A = C = 19, or 0) c28344 EXX ; Switch BC, DE and HL with BC', DE' and HL' 28345 LD L,A ; Load architecture style index into L 28346 OR A ; If architecture style index is not zero... 28347 JP NZ,28360 ; ...then jump ahead to #R28360 28350 LD A,(23476) ; If brickwork direction flag is zero (horizontal mode for floor and ceiling)... 28353 OR A ; ... 28354 JP Z,28510 ; ...then skip ahead to #R28510 (blank out bitmap and set attribute to current value for 2-by-2 ; character block) 28357 JP 28471 ; Move location to print and Terrain Interaction Cursor down two character rows observing ; y-wrap, then return *28360 LD H,0 ; Load four times Architecture Style Index into HL, as entries are four bytes wide... 28362 LD A,L ; ... 28363 ADD A,A ; ... 28364 LD L,A ; ... 28365 ADD HL,HL ; ... 28366 LD DE,54617 ; Point DE at Architecture Styles Lookup Table 28369 ADD HL,DE ; Add HL (4 times Architecture Style Index) as offset to this, in HL (as each entry is 4 bytes ; wide) 28370 LD DE,(36488) ; Load "memory location to start printing character" in character printing routine into DE... 28374 LD (23296),DE ; ...and store at 23296 28378 LD A,(HL) ; Load first architecture style element (top-left) into A 28379 CALL 36510 ; Draw a single character block part of a wall, ceiling or floor 28382 LD DE,(36488) ; Load "memory location to start printing character" in character printing routine into DE... 28386 INC DE ; Advance DE by one byte... 28387 LD (36488),DE ; ...and load into "memory location to start printing character" 28391 INC HL ; Advance HL to next architecture style element (top-right) 28392 LD A,(HL) ; Load next architecture style element into A 28393 CALL 36510 ; Draw a single character block part of a wall, ceiling or floor 28396 INC HL ; Advance HL to next architecture style index (bottom-left) 28397 EX DE,HL ; Switch HL and DE (HL now Display File address to print to and DE now pointer to architecture ; style) 28398 LD HL,(23296) ; Advance this pointer down a character row (32 bytes from original stored value)... 28401 LD BC,32 ; ... 28404 ADD HL,BC ; ... 28405 LD (36488),HL ; Load new position into "memory location to start printing character" 28408 EX DE,HL ; Switch DE and HL back (HL now pointer to architecture style and DE now Display File address ; to print to) 28409 LD A,(23469) ; Load brickwork drawing mode into A 28412 CP 1 ; If this is 1 [only draw one row of "bricks"]... 28414 JR Z,28441 ; ...then jump ahead to #R28441 28416 CP 2 ; If it is not 2 [draw row of bricks and blank row beneath]... 28418 JR NZ,28423 ; ...then jump ahead to #R28423... 28420 LD HL,54617 ; ...else point HL at first entry (blank, i.e. no brickwork) *28423 LD A,(HL) ; Load brickwork graphic index into A 28424 CALL 36510 ; Draw a single character block part of a wall, ceiling or floor 28427 LD DE,(36488) ; Load "memory location to start printing character" in character printing routine into DE... 28431 INC DE ; Advance DE by one byte... 28432 LD (36488),DE ; ...and load into "memory location to start printing character" 28436 INC HL ; Advance HL to next brickwork graphic index... 28437 LD A,(HL) ; ...and load into A 28438 CALL 36510 ; Draw a single character block part of a wall, ceiling or floor *28441 LD HL,(23296) ; Load previously stored "memory location to start printing character" into HL... 28444 LD (36488),HL ; ...and place back in character drawing routine 28447 LD A,(23483) ; Load stored, "current" Terrain Interaction Parameter into A 28450 LD HL,(23481) ; Load current Terrain Interaction Table Cursor position into HL 28453 LD (HL),A ; Set this and the following character blocks to have the current Terrain Interaction Flags... 28454 INC HL ; ... 28455 LD (HL),A ; ... 28456 LD A,(23469) ; Load brickwork drawing mode into A 28459 OR A ; If brickwork drawing mode is not zero (draw two rows)... 28460 JP NZ,28471 ; ...then skip ahead to #R28471 (move location to print and Terrain Interaction Cursor down two ; character rows observing y-wrap, then return) 28463 LD A,(HL) ; Load last written Terrain Interaction Parameter back into A 28464 LD BC,31 ; Advance Terrain Interaction Table Cursor by 31 bytes (to character below starting ; position)... 28467 ADD HL,BC ; ... 28468 LD (HL),A ; Set this and the following character blocks to have the current Terrain Interaction Flags... 28469 INC HL ; ... 28470 LD (HL),A ; ... ; Mode 1 or 2, Draw one row of bricks This entry point is used by the routine at #R28510. *28471 LD A,(23476) ; If brickwork direction flag is not zero (horizontal mode for floor and ceiling)... 28474 OR A ; ... 28475 JR NZ,28561 ; ...then skip ahead to #R28561 (move location to print and Terrain Interaction Cursor down two ; character rows with y-wrap, as in vertical mode) 28477 CALL 36626 ; Advance Display File pointer by two characters 28480 LD HL,(23481) ; Update current Terrain Interaction Table Cursor position onwards by two characters... 28483 INC HL ; ... 28484 INC HL ; ... 28485 LD (23481),HL ; ... 28488 LD A,(36488) ; Load LSB of "memory location to start printing character" into A 28491 AND 31 ; If this is not a multiple of 32 (i.e. not at start of a pixel row)... 28493 JR NZ,28508 ; ...then skip ahead to #R28508 28495 CALL 37703 ; Move virtual text cursor down to start of next text row (as 2-by-2 blocks are 2 characters ; high so we need to move down another character) 28498 LD BC,32 ; Update current Terrain Interaction Table Cursor position onwards by 32 characters (i.e. down ; one row)... 28501 LD HL,(23481) ; ... 28504 ADD HL,BC ; ... 28505 LD (23481),HL ; ... *28508 EXX ; Switch BC, DE and HL with BC', DE' and HL', restoring values as at input 28509 RET ; Return ; Blank Out Bitmap and Set Attribute to Current Value (ATTR T) for 2-by-2 Character Block ; ; Used by the routine at #R28344. c28510 LD HL,(36488) ; Load HL with Display File address to draw character 28513 LD DE,(36488) ; Load DE with Display File address to draw character 28517 INC DE ; Advance DE by one byte 28518 XOR A ; Set A to zero 28519 LD B,8 ; Load loop counter with 8 *28521 LD (HL),A ; Draw blank space to Display File addresses HL... 28522 LD (DE),A ; ...and DE 28523 INC H ; Advance HL and DE down one pixel row (by adding 256 to Display File address), drawing down ; from top... 28524 INC D ; ... 28525 DJNZ 28521 ; Repeat loop for remaining pixel rows 28527 LD A,L ; Add 32 to HL and DE to move them both down by eight pixel rows... 28528 ADD A,32 ; ... 28530 LD L,A ; ... 28531 INC A ; ... 28532 LD E,A ; ... 28533 XOR A ; Set A to zero 28534 LD B,8 ; Load loop counter with 8 *28536 DEC H ; Advance HL and DE up one pixel row (by subtracting 256 from Display File address), drawing up ; from bottom... 28537 DEC D ; ... 28538 LD (HL),A ; Draw blank space to Display File addresses HL... 28539 LD (DE),A ; ...and DE 28540 DJNZ 28536 ; Repeat loop for remaining pixel rows 28542 CALL 36709 ; Store and point HL at Attribute File address for character just printed 28545 LD A,(23695) ; Load system variable ATTR T into A... 28548 LD (HL),A ; ...and set attribute of four character block just rendered to match this value... 28549 INC HL ; ... 28550 LD (HL),A ; ... 28551 LD BC,31 ; ... 28554 ADD HL,BC ; ... 28555 LD (HL),A ; ... 28556 INC HL ; ... 28557 LD (HL),A ; ... 28558 JP 28471 ; Move location to print and Terrain Interaction Cursor down two character rows observing ; y-wrap, then return ; Move Location to Print and Terrain Interaction Cursor Down Two Character Rows with y-Wrap ; ; Instructions from 28609 onwards can only be executed if, after moving down two character blocks, the next location ; to draw to is beneath the (two-character deep) floor, on the same character row as the "SPELLBOUND" text in the ; bottom window which shows either the copyright message if Magic Knight doesn't hold the mirror, or Magic Knight's ; strength and inventory if he does. Input: HL Points to Terrain Interaction Table data for bottom-right character ; block of 2-by-2 brickwork block just drawn c28561 LD HL,(36488) ; Load HL with Display File address to draw character 28564 LD A,L ; Clear all but least significant five bits (i.e. x-coordinate)... 28565 AND 31 ; ... 28567 LD L,A ; ... 28568 LD H,0 ; ... 28570 PUSH HL ; Store HL (x-coordinate to draw character) 28571 CALL 37719 ; Move virtual text cursor to beginning of character row two rows below current position 28574 LD HL,(36488) ; Load HL with Display File address to draw character (as just updated) 28577 POP DE ; Restore DE (new location to draw character, previously in HL) 28578 ADD HL,DE ; Add x-coordinate as offset to updated location to draw character 28579 LD (36488),HL ; Store the new location (now two characters below position upon entering this routine) 28582 LD HL,(23481) ; Update current Terrain Interaction Table Cursor position onwards by 64 characters (i.e. down ; two rows)... 28585 LD BC,64 ; ... 28588 ADD HL,BC ; ... 28589 LD (23481),HL ; ... 28592 LD HL,(36488) ; Load HL with new Display File address to draw character 28595 LD A,H ; If memory location to draw character is not in the bottom third of the display... 28596 AND 248 ; ... 28598 CP 80 ; ... 28600 JR NZ,28645 ; ...then return 28602 LD A,L ; If memory location to draw character is not in the fifth character row (any of the 8 pixel ; rows)... 28603 AND 224 ; ...(which is the row two rows beneath the floor level, in line with "SPELLBOUND" text in ; bottom window)... 28605 CP 128 ; ... 28607 JR NZ,28645 ; ...then return 28609 LD A,64 ; Load 64 into MSB of Display File address to print character, wrapping from bottom of display ; back up to top... 28611 LD (36489),A ; ... 28614 LD A,(36488) ; Increase LSB by two characters (moving right by two characters upon bottom-to-top wrap)... 28617 INC A ; ... 28618 INC A ; ... 28619 AND 31 ; Cap value to maximum of 31 to ensure that new position is in top character row of display ; (i.e. y-coordinate = 0)... 28621 LD (36488),A ; ...and store 28624 LD BC,24539 ; Point BC at Terrain Interaction Table 28627 XOR A ; Set A to zero (and clear carry flag) 28628 LD HL,(23481) ; Load HL with Terrain Interaction Table Cursor 28631 SBC HL,BC ; Load HL with position of Terrain Interaction Table Cursor relative (i.e. offset) to beginning ; of the table 28633 LD A,L ; Advance cursor x-coordinate offset by two character blocks... 28634 INC A ; ... 28635 INC A ; ... 28636 AND 31 ; ...and cap value to maximum of 31 to ensure that new position is in top character row of ; display (i.e. y-coordinate = 0)... 28638 LD L,A ; Place new x-coordinate in HL along with y-coordinate of zero... 28639 LD H,0 ; ... 28641 ADD HL,BC ; Add this new offset to start of Terrain Interaction Data 28642 LD (23481),HL ; Store the updated Terrain Interaction Table cursor *28645 EXX ; Switch registers 28646 RET ; Return ; Room Drawing Prepare to Draw One Row of Bricks Only c28647 LD A,1 ; Prepare to draw one row of bricks only 28649 JR 28653 ; Set drawing mode and return to room drawing routine to process next data ; Room Drawing Prepare to Draw One Row of Bricks with Blank Row Beneath c28651 LD A,2 ; Prepare to draw one row of bricks, and one blank row beneath it ; This entry point is used by the routine at #R28647. *28653 LD (23469),A ; Set the mode 28656 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Set Terrain Interaction Parameter to Preserve Attribute / impassable Vertically c28659 LD A,192 ; Set current Terrain Interaction Parameter to "preserve attribute" and "impassable ; vertically"... 28661 LD (23483),A ; ... 28664 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Set Terrain Interaction Parameter to Preserve Attribute / impassable Vertically and Horizontally c28667 LD A,224 ; Set current Terrain Interaction Parameter to "impassable horizontally", "preserve attribute" ; and "impassable vertically"... 28669 LD (23483),A ; ... 28672 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Set Terrain Interaction Parameter to Preserve Attribute c28675 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 28677 LD (23483),A ; ... 28680 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Right-Facing Wall-Candle c28683 CALL 29441 ; Read two bytes AFTER HL position into BC (i.e. y- and x-coordinates respectively), advancing ; HL before both reads 28686 PUSH HL ; Store HL 28687 PUSH BC ; Store BC 28688 LD A,68 ; Load system variable ATTR T with 68 (green INK, black PAPER, BRIGHT)... 28690 LD (23695),A ; ... 28693 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 28695 LD (23483),A ; ... 28698 LD A,56 ; Draw right-facing wall-candle wall bracket plate... 28700 CALL 29960 ; ... 28703 POP BC ; Restore BC 28704 PUSH BC ; Store BC 28705 INC B ; Increase y-coordinate by three... 28706 INC B ; ... 28707 INC B ; ... 28708 LD A,55 ; Draw right-facing wall-candle wall bracket... 28710 CALL 29960 ; ... 28713 POP BC ; Restore BC 28714 PUSH BC ; Store BC 28715 DEC B ; Decrease y-coordinate by one 28716 INC C ; Increase x-coordinate by one 28717 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 28719 LD (23695),A ; ... 28722 LD A,54 ; Draw wall-candle... 28724 CALL 29960 ; ... 28727 POP BC ; Restore BC 28728 DEC B ; Decrease y-coordinate 28729 INC C ; Increase x-coordinate 28730 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28733 CALL 28814 ; Add a glowing character block to the current room (left part of the flame) 28736 INC HL ; Advance HL to next character to the right (i.e. rest of flame) 28737 LD (IX+2),L ; Add another glowing character block to the current room (right part of the flame)... 28740 LD (IX+3),H ; ... 28743 POP HL ; Restore HL 28744 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Left-Facing Wall-Candle c28747 CALL 29441 ; Read two bytes AFTER HL position into BC (i.e. y- and x-coordinates respectively), advancing ; HL before both reads 28750 PUSH HL ; Store HL 28751 PUSH BC ; Store BC 28752 LD A,68 ; Load system variable ATTR T with 68 (green INK, black PAPER, BRIGHT)... 28754 LD (23695),A ; ... 28757 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 28759 LD (23483),A ; ... 28762 LD A,58 ; Draw left-facing wall-candle wall bracket plate... 28764 CALL 29960 ; ... 28767 POP BC ; Restore BC 28768 PUSH BC ; Store BC 28769 INC B ; Increase y-coordinate by three... 28770 INC B ; ... 28771 INC B ; ... 28772 DEC C ; Decrease x-coordinate by two 28773 DEC C ; ... 28774 LD A,57 ; Draw left-facing wall-candle wall bracket... 28776 CALL 29960 ; ... 28779 POP BC ; Restore BC 28780 PUSH BC ; Store BC 28781 DEC B ; Decrease y-coordinate by one 28782 DEC C ; Decrease x-coordinate by two 28783 DEC C ; ... 28784 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 28786 LD (23695),A ; ... 28789 LD A,54 ; Draw wall-candle... 28791 CALL 29960 ; ... 28794 POP BC ; Restore BC 28795 DEC B ; Decrease y-coordinate 28796 DEC C ; Decrease x-coordinate 28797 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28800 CALL 28814 ; Add a glowing character block to the current room (should be left part of the flame, but is ; actually right part, i.e. a bug!) 28803 INC HL ; Advance HL to next character to the right (i.e. what should be rest of flame but is in fact ; empty space - bug!) 28804 LD (IX+2),L ; Add another glowing character block to the current room (right part of the flame)... 28807 LD (IX+3),H ; ... 28810 POP HL ; Restore HL 28811 JP 28060 ; Return to room drawing routine and process next data ; Add a Glowing Character Block to the Current Room ; ; Used by the routines at #R28683, #R28747, #R28841, #R29184 and #R29291. Input: HL Points to a memory address in ; Attribute File Output: IX Points to entry in the table created on the last pass of this routine c28814 LD IX,23383 ; Point IX at table of Attribute File addresses of glowing characters in current room 28818 DEC IX ; Move IX back two bytes... 28820 DEC IX ; ... *28822 INC IX ; Advance IX by two bytes... 28824 INC IX ; ... 28826 LD A,(IX+0) ; If two bytes at IX are non-zero... 28829 OR (IX+1) ; ... 28832 JR NZ,28822 ; ...then loop back to check next two bytes 28834 LD (IX+0),L ; Store HL at first empty pair of bytes after 23383... 28837 LD (IX+1),H ; ... 28840 RET ; Return ; Room Drawing Set Attributes, Including Glow, on Lift Control Panel c28841 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 28844 PUSH HL ; Store HL 28845 PUSH BC ; Store BC 28846 LD A,(23382) ; Load A with index of currently illuminated light on Lift control panel (showing current ; floor) 28849 ADD A,B ; To this, add y-coordinate... 28850 LD B,A ; ...and place back into B 28851 INC B ; Increase new y-coordinate by one 28852 INC C ; Increase x-coordinate by one 28853 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28856 CALL 28814 ; Add a glowing character block to the current room for lift indicator panel 28859 POP BC ; Restore BC 28860 INC BC ; Increase x-coordinate by two... 28861 INC BC ; ... 28862 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28865 LD DE,31 ; Set DE to 31 (to advance current attribute cursor down one row and left one character) 28868 LD B,7 ; Set B to 7 to repeat loop 8 times *28870 ADD HL,DE ; Advance HL down one character and left one character (to point to next lift panel indicator, ; e.g. [R])... 28871 LD (HL),68 ; Set attribute of current lift panel light to 68 (green INK, black PAPER, BRIGHT) 28873 INC HL ; Advance to the right one character 28874 LD (HL),70 ; Set attribute of current lift panel light label (i.e. "R", "5", "4", "3", "2", "1", "G", or ; "B") to 70 (yellow INK, black PAPER, BRIGHT) 28876 DJNZ 28870 ; Repeat for next indicator down 28878 POP HL ; Restore HL 28879 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Picture in Frame (59748) c28882 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 28885 PUSH HL ; Store HL 28886 PUSH BC ; Store BC 28887 LD A,7 ; Load system variable ATTR T with 7 (white INK, black PAPER)... 28889 LD (23695),A ; ... 28892 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 28894 LD (23483),A ; ... 28897 LD A,60 ; Draw Picture in Frame (2) [graphic data at #R59748]... 28899 CALL 29960 ; ... 28902 POP BC ; Restore BC 28903 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28906 PUSH HL ; Transfer memory address of attribute cursor... 28907 POP IX ; ...into IX 28909 LD (IX+34),70 ; Set attribute of sun in picture to 70 (yellow INK, black PAPER, BRIGHT) (34 bytes, or 1 ; character down and 2 characters right from top-left corner of picture) 28913 LD A,67 ; Set attribute to 67 (magenta INK, black PAPER, BRIGHT) for... 28915 LD (IX+37),A ; ...magenta castle in picture (six characters, 3 x 2)... 28918 LD (IX+38),A ; ... 28921 LD (IX+39),A ; ... 28924 LD (IX+69),A ; ... 28927 LD (IX+70),A ; ... 28930 LD (IX+71),A ; ... 28933 LD A,70 ; Set attribute to 70 (yellow INK, black PAPER, BRIGHT) for... 28935 LD (IX+97),A ; ...sand / yellow land (7 characters, 7 x 1)... 28938 LD (IX+98),A ; ... 28941 LD (IX+99),A ; ... 28944 LD (IX+100),A ; ... 28947 LD (IX+101),A ; ... 28950 LD (IX+102),A ; ... 28953 LD (IX+103),A ; ... 28956 POP HL ; Restore HL 28957 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Picture in Frame (59748) and Replace Picture with Alternative (60156) c28960 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 28963 PUSH HL ; Store HL 28964 PUSH BC ; Store BC 28965 LD A,6 ; Load system variable ATTR T with 6 (yellow INK, black PAPER)... 28967 LD (23695),A ; ... 28970 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 28972 LD (23483),A ; ... 28975 LD A,60 ; Draw Picture in Frame (2) [graphic data at #R59748]... 28977 CALL 29960 ; ... 28980 POP BC ; Restore BC 28981 PUSH BC ; Store BC 28982 INC B ; Increase y-coordinate by one 28983 INC C ; Increase x-coordinate by one 28984 LD A,4 ; Load system variable ATTR T with 4 (green INK, black PAPER)... 28986 LD (23695),A ; ... 28989 LD A,62 ; Draw Landscape from picture (2) [graphic data at #R60156]... 28991 CALL 29960 ; ... 28994 POP BC ; Restore BC 28995 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 28998 PUSH HL ; Transfer memory address of attribute cursor... 28999 POP IX ; ...into IX 29001 LD (IX+34),70 ; Set attribute of sun in picture to 70 (yellow INK, black PAPER, BRIGHT) (34 bytes, or 1 ; character down and 2 characters right from top-left corner of picture) 29005 LD A,69 ; Set attribute to 69 (cyan INK, black PAPER, BRIGHT) for... 29007 LD (IX+97),A ; ...sea / ocean in picture (7 characters, 7 x 1)... 29010 LD (IX+98),A ; ... 29013 LD (IX+99),A ; ... 29016 LD (IX+100),A ; ... 29019 LD (IX+101),A ; ... 29022 LD (IX+102),A ; ... 29025 LD (IX+103),A ; ... 29028 POP HL ; Restore HL 29029 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Picture in Frame (59548) c29032 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29035 PUSH HL ; Store HL 29036 PUSH BC ; Store BC 29037 LD A,7 ; Load system variable ATTR T with 7 (white INK, black PAPER)... 29039 LD (23695),A ; ... 29042 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29044 LD (23483),A ; ... 29047 LD A,59 ; Draw Picture in Frame (1) [graphic data at #R59548]... 29049 CALL 29960 ; ... 29052 POP BC ; Restore BC 29053 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29056 PUSH HL ; Transfer memory address of attribute cursor... 29057 POP IX ; ...into IX 29059 LD (IX+34),70 ; Set attribute of sun in picture to 70 (yellow INK, black PAPER, BRIGHT) (34 bytes, or 1 ; character down and 2 characters right from top-left corner of picture) 29063 LD A,7 ; Set attribute to 7 (white INK, black PAPER) for... 29065 LD (IX+65),A ; ...mountain peak in picture (3 characters, 3 x 1)... 29068 LD (IX+66),A ; ... 29071 LD (IX+67),A ; ... 29074 LD A,68 ; Set attribute to 68 (green INK, black PAPER, BRIGHT) for... 29076 LD (IX+97),A ; ...grassland in picture (3 characters, 3 x 1)... 29079 LD (IX+98),A ; ... 29082 LD (IX+99),A ; ... 29085 POP HL ; Restore HL 29086 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Picture in Frame (59548) and Replace Picture with Alternative (60108) c29089 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29092 PUSH HL ; Store HL 29093 PUSH BC ; Store BC 29094 LD A,7 ; Load system variable ATTR T with 7 (white INK, black PAPER)... 29096 LD (23695),A ; ... 29099 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29101 LD (23483),A ; ... 29104 LD A,59 ; Draw Picture in Frame (1) [graphic data at #R59548]... 29106 CALL 29960 ; ... 29109 POP BC ; Restore BC 29110 PUSH BC ; Store BC 29111 INC B ; Increase y-coordinate by 2... 29112 INC B ; ... 29113 INC C ; Increase x-coordinate by 1 29114 LD A,4 ; Load system variable ATTR T with 4 (green INK, black PAPER)... 29116 LD (23695),A ; ... 29119 LD A,61 ; Draw Landscape 1 from picture [graphic data at #R60108]... 29121 CALL 29960 ; ... 29124 POP BC ; Restore BC 29125 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29128 PUSH HL ; Transfer memory address of attribute cursor... 29129 POP IX ; ...into IX 29131 LD (IX+34),70 ; Set attribute of sun in picture to 70 (yellow INK, black PAPER, BRIGHT) (34 bytes, or 1 ; character down and 2 characters right from top-left corner of picture) 29135 LD A,69 ; Set attribute to 69 (cyan INK, black PAPER, BRIGHT) for... 29137 LD (IX+97),A ; ...sea / ocean in picture (3 characters, 3 x 1)... 29140 LD (IX+98),A ; ... 29143 LD (IX+99),A ; ... 29146 POP HL ; Restore HL 29147 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Goblet Picture or Character Portrait and Corresponding Picture Frame ; ; Draw Goblet Picture or Character Portrait and Corresponding Picture Frame Input: B y-coordinate of picture C ; x-coordinate of picture c29150 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29153 INC HL ; Read index of graphic to draw into D... 29154 LD D,(HL) ; ... 29155 INC HL ; Read attribute for this graphic into E... 29156 LD E,(HL) ; ... 29157 PUSH HL ; Store HL 29158 PUSH BC ; Store BC (x- and y-coordinates of top left) 29159 PUSH DE ; Store DE (index of graphic in graphic lookup table to draw in window is in D) 29160 CALL 36919 ; Draw window frame for character portraits (2nd floor) and Goblet Picture in Florin's Room 29163 POP DE ; Restore DE 29164 POP BC ; Restore BC 29165 INC B ; Increase y-coordinate 29166 INC C ; Increase x-coordinate 29167 LD A,E ; Load system variable ATTR T with attribute for graphic to be drawn... 29168 LD (23695),A ; ... 29171 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29173 LD (23483),A ; ... 29176 LD A,D ; Draw graphic (e.g. the Goblet in Florin's Room's picture, or a character for their portrait ; on 2nd Floor)... 29177 CALL 29960 ; ... 29180 POP HL ; Restore HL 29181 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Read Data for and Display Glowing Blocks c29184 INC HL ; Read next parameter into A... 29185 LD A,(HL) ; ... 29186 CP 244 ; If parameter is 244... 29188 JP Z,28060 ; ...then return to room drawing routine and process next data 29191 DEC HL ; Move pointer back a byte as this was more data, not an end marker 29192 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29195 PUSH HL ; Store current position of pointer to room data 29196 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29199 CALL 28814 ; Add a glowing character block to the current room 29202 POP HL ; Restore pointer to HL 29203 JR 29184 ; Loop back for next data ; Room Drawing Read Data for and Paint Attributes c29205 INC HL ; Read next parameter into A... 29206 LD A,(HL) ; ... 29207 CP 245 ; If parameter is 245... 29209 JP Z,28060 ; ...then return to room drawing routine and process next data 29212 EX AF,AF' ; Switch AF 29213 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29216 PUSH HL ; Store HL 29217 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29220 EX AF,AF' ; Switch AF 29221 LD (HL),A ; Paint attribute data at coordinates in BC 29222 POP HL ; Restore HL 29223 JR 29205 ; Jump back to start of this routine ; Room Drawing Draw Wall Axes c29225 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29228 PUSH HL ; Store HL 29229 PUSH BC ; Store BC 29230 LD A,70 ; Load system variable ATTR T with 70 (yellow INK, black PAPER, BRIGHT)... 29232 LD (23695),A ; ... 29235 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29237 LD (23483),A ; ... 29240 LD A,86 ; Draw Wall Axes... 29242 CALL 29960 ; ... 29245 POP BC ; Restore BC 29246 INC B ; Increase y-coordinate by two... 29247 INC B ; ... 29248 INC C ; Increase x-coordinate by three... 29249 INC C ; ... 29250 INC C ; ... 29251 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29254 LD A,69 ; Set attribute at this location to 69 (cyan INK, black PAPER, BRIGHT) for top of axe ; handles... 29256 LD (HL),A ; ... 29257 PUSH HL ; Transfer memory address of attribute cursor... 29258 POP IX ; ...into IX 29260 LD (IX+1),A ; Set attribute of rest of handles to 69 (cyan INK, black PAPER, BRIGHT)... 29263 LD (IX+31),A ; ... 29266 LD (IX+32),A ; ... 29269 LD (IX+33),A ; ... 29272 LD (IX+34),A ; ... 29275 LD (IX+63),A ; ... 29278 LD (IX+64),A ; ... 29281 LD (IX+65),A ; ... 29284 LD (IX+66),A ; ... 29287 POP HL ; Restore HL 29288 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw Ceiling Candles c29291 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29294 PUSH HL ; Store HL 29295 PUSH BC ; Store BC 29296 LD A,7 ; Load system variable ATTR T with 7 (white INK, black PAPER)... 29298 LD (23695),A ; ... 29301 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29303 LD (23483),A ; ... 29306 LD A,96 ; Draw ceiling candles... 29308 CALL 29960 ; ... 29311 POP BC ; Restore BC 29312 INC B ; Increase y-coordinate by two... 29313 INC B ; ... 29314 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 29317 PUSH HL ; Store HL (memory address of attribute cursor) 29318 CALL 28814 ; Add a glowing character block to the current room (left-hand candle) 29321 LD BC,34 ; Advance Attribute File pointer down a row and to the right by two characters... 29324 ADD HL,BC ; ... 29325 CALL 28814 ; Add a glowing character block to the current room (right-hand candle) 29328 LD A,70 ; Set attribute at this location to 70 (yellow INK, black PAPER, BRIGHT) (candles)... 29330 POP IX ; Restore memory address of attribute cursor to IX 29332 LD (IX+32),A ; Set attribute of left-hand candle... 29335 LD (IX+64),A ; ... 29338 LD (IX+66),A ; ...and right-hand candle to 70 (yellow INK, black PAPER, BRIGHT) 29341 LD A,71 ; Set attribute at this location to 71 (white INK, black PAPER, BRIGHT) (base - 3 bytes, 3 x ; 1)... 29343 LD (IX+96),A ; ... 29346 LD (IX+97),A ; ... 29349 LD (IX+98),A ; ... 29352 POP HL ; Restore HL 29353 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Point Bitmap Virtual Cursor and Terrain Interaction Cursor to Coordinates x=C, y=B ; ; Point Bitmap Virtual Cursor and Terrain Interaction Cursor to Coordinates x=C, y=B Input: B y-coordinate ; (characters) C x-coordinate (characters) c29356 CALL 29441 ; Read two bytes AFTER HL position into BC, advancing HL before both reads 29359 PUSH HL ; Store HL 29360 PUSH BC ; Store BC 29361 CALL 36551 ; Move Virtual Bitmap Cursor to Display File address for coordinates x=C, y=B 29364 POP BC ; Restore BC 29365 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B 29368 LD (23481),HL ; ...and store this pointed-to location 29371 POP HL ; Restore HL 29372 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Draw a Graphic to Screen Reading Parameters from Room Layout Data c29375 CALL 29441 ; Load x- and y-coordinates of graphic to draw into BC 29378 INC HL ; Advance HL to attribute data 29379 LD A,(HL) ; Load attribute data into system variable ATTR T... 29380 LD (23695),A ; ... 29383 INC HL ; Advance HL to Terrain Interaction Parameter 29384 LD A,(HL) ; Read Terrain Interaction Parameter and store at #R23483... 29385 LD (23483),A ; ... 29388 INC HL ; Advance HL to graphic lookup index data... 29389 LD A,(HL) ; ...and load this data into A 29390 CALL 29955 ; Draw the graphic in OR mode 29393 JP 28060 ; Return to room drawing routine and process next data ; Room Drawing Read Sequence of Architecture Styles and Draw Appropriate 2-by-2 Blocks of Brickwork c29396 INC HL ; Read data into system variable ATTR T... 29397 LD A,(HL) ; ... 29398 LD (23695),A ; ... *29401 INC HL ; Advance HL 29402 LD A,(HL) ; Read next data (architecture style)... 29403 CP 254 ; ...and if this is 254... 29405 JP Z,28056 ; ...then return to room drawing routine, setting brickwork drawing mode to two rows 29408 CALL 28344 ; Draw a 2-by-2 block of brickwork, depending upon brickwork drawing mode, with architecture ; style A 29411 JP 29401 ; Repeat loop for next data byte ; Room Drawing Read Sequence of Architecture Styles and Attributes and Draw Appropriate 2-by-2 Blocks of Brickwork c29414 XOR A ; Set system variable ATTR T to 0 (black INK, black PAPER)... 29415 LD (23695),A ; ... 29418 INC HL ; Advance HL 29419 LD A,(HL) ; Read next data (architecture style)... 29420 CP 255 ; ...and if this is 255... 29422 JP Z,28056 ; ...then return to room drawing routine, setting brickwork drawing mode to two rows 29425 LD C,A ; Copy architecture style into C 29426 OR A ; If this is zero... 29427 JR Z,29434 ; ...then skip ahead to #R29434 (i.e. draw a blank block) 29429 INC HL ; Advance HL 29430 LD A,(HL) ; Read next data... 29431 LD (23695),A ; ...into system variable ATTR T *29434 LD A,C ; Load architecture style back into A 29435 CALL 28344 ; Draw a 2-by-2 block of brickwork, depending upon brickwork drawing mode, with architecture ; style A 29438 JP 29414 ; Repeat loop for next data byte ; Read Two Bytes After HL Position into C and B Respectively, Advancing HL Before Both Reads ; ; Used by the routines at #R28683, #R28747, #R28841, #R28882, #R28960, #R29032, #R29089, #R29150, #R29184, #R29205, ; #R29225, #R29291, #R29356 and #R29375. Input: HL Pointer to current position in data (before reads) Output: B ; Second byte AFTER input HL position C First byte AFTER input HL position HL Two bytes after input HL position c29441 INC HL ; Advance HL 29442 LD C,(HL) ; Load byte into C 29443 INC HL ; Advance HL 29444 LD B,(HL) ; Load byte into B 29445 RET ; Return ; Set Magic Knight's Action Flags and Prepare to Execute Room-Specific Routine for his Current Room ; ; Used by the routine at #R28092. c29446 LD A,(65529) ; Load double Magic Knight's current room index into BC... 29449 ADD A,A ; ... 29450 LD B,0 ; ... 29452 LD C,A ; ... 29453 LD HL,54753 ; Add as offset to address of start of table of room-specific routine addresses and load this ; result into HL... 29456 ADD HL,BC ; ... 29457 LD A,(HL) ; Load WORD value at this address into HL... 29458 INC HL ; ... 29459 LD H,(HL) ; ... 29460 LD L,A ; ... 29461 LD (29773),HL ; Update jump in routine at 29763 to execute room-specific routine 29464 CALL 35495 ; Set Magic Knight's available action flags 29467 RET ; Return ; Check Whether Magic Knight is Moving into a New Room and React if so ; ; Used by the routine at #R29763. c29468 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 29471 CP 3 ; If less than 3... 29473 JP C,29514 ; ...then skip to #R29514 29476 CP 231 ; If 231 or more... 29478 JP NC,29546 ; ...then skip to #R29546 29481 RET ; Return ; Change Magic Knight's Current Room if Possible ; ; Used by the routines at #R29514 and #R29546. 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 c29482 PUSH AF ; Store new x-coordinate for later 29483 XOR A ; Set Magic Knight's Temporary Movement Flags to zero (new room, so Magic Knight can move both ; left and right)... 29484 LD (23410),A ; ... 29487 LD HL,41711 ; Point HL to room connectivity data table 29490 LD A,(65529) ; Load Magic Knight's current room's index into A... 29493 ADD A,A ; ...double it... 29494 LD C,A ; ...and load into BC... 29495 LD B,0 ; ... 29497 ADD HL,BC ; Add BC as offset to HL 29498 ADD HL,DE ; Point to left or right exit from current room, as determined by DE 29499 LD A,(HL) ; Load new room number into A... 29500 CP 255 ; ...and if this is 255 (i.e. Magic Knight can't leave his current room)... 29502 JR Z,29511 ; ...set Zero Flag and exit routine... 29504 LD (65529),A ; ...else update Magic Knight's current room to be this new room index 29507 POP BC ; Restore new x-coordinate to B... 29508 LD A,B ; ...and load back into A 29509 OR A ; Reset Zero Flag 29510 RET ; Return *29511 POP BC ; Restore AF to BC... 29512 LD A,B ; ...and load A with contents of B to restore to what it was on entering this routine 29513 RET ; Return ; Move Magic Knight One Room to the Left if Possible ; ; Used by the routine at #R29468. Input: A (Entry at #R29530 only) Magic Knight's new x-coordinate c29514 LD DE,0 ; Set DE to zero (dealing with current room's left exit) 29517 LD A,230 ; Load A with Magic Knight's new coordinate when he arrives in new room (230 is near right-hand ; side of room) 29519 CALL 29482 ; Change Magic Knight's current room (if possible) based upon left exit of his current room 29522 JR Z,29540 ; If Magic Knight can't leave his current room then jump to #R29540 29524 LD HL,34824 ; Set instruction at #R34821 to jump to #R34824 (left-facing version of update Magic Knight's ; current frame routine)... 29527 LD (34822),HL ; ... ; This entry point is used by the routine at #R29546. *29530 LD (25387),A ; Set Magic Knight's x-coordinate 29533 LD A,(65529) ; Load Magic Knight's current room into A 29536 CALL 27865 ; Move Magic Knight into room A, initialise room-specific data and draw room 29539 RET ; Return *29540 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)... 29542 LD (23410),A ; ... 29545 RET ; Return ; Move Magic Knight One Room to the Right if Possible ; ; Used by the routine at #R29468. c29546 LD HL,34838 ; Set instruction at 34821 to jump to 34838 (right-facing version of update Magic Knight's ; current frame routine)... 29549 LD (34822),HL ; ... 29552 LD DE,1 ; Set DE to one (dealing with current room's right exit) 29555 LD A,4 ; Load A with Magic Knight's new coordinate when he arrives in new room (4 is near left-hand ; side of room) 29557 CALL 29482 ; Change Magic Knight's current room (if possible) based upon right exit of his current room 29560 JR Z,29570 ; If Magic Knight's can't leave his current room then jump to #R29570 29562 LD HL,34838 ; Set instruction at #R34821 to jump to #R34824 (right-facing version of update Magic Knight's ; current frame routine)... 29565 LD (34822),HL ; ... 29568 JR 29530 ; Set Magic Knight's x-coordinate and new room, draw the room and return *29570 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)... 29572 LD (23410),A ; ... 29575 RET ; Return ; Draw All Characters in Current Room and Animate Arrival of Any New Character ; ; Used by the routine at #R28092. c29576 LD A,71 ; Load ATTR T system variable with 71 (white INK, black PAPER, BRIGHT) 29578 LD (23695),A ; ... 29581 LD A,64 ; Set current Terrain Interaction Parameter to "preserve attribute"... 29583 LD (23483),A ; ... 29586 LD IX,25443 ; Point IX at Thor's entry in characters' current positions table 29590 LD BC,1537 ; Load B with 6 and C with 1 29593 LD A,(23467) ; If Banshee is not released... 29596 AND 1 ; ... 29598 JR Z,29601 ; ...then skip ahead to #R29601... 29600 INC B ; ...else increase B by one *29601 LD A,(23468) ; If Gimbal is not released... 29604 AND 1 ; ... 29606 JR Z,29614 ; ...then skip ahead to #R29614... 29608 INC B ; ...else increase B by one... 29609 DEC C ; ...decrease C... 29610 LD IX,25440 ; ...and point IX at Gimbal's entry in characters' current positions table *29614 LD A,(65529) ; Load A with Magic Knight's current room 29617 CP (IX+0) ; Compare current character's room with Magic Knight's... 29620 CALL Z,29680 ; ...and if they're the same, draw the character to the screen 29623 INC C ; Increase C by one 29624 INC IX ; Advance to entry for next character 29626 INC IX ; ... 29628 INC IX ; ... 29630 DJNZ 29614 ; ...and repeat the loop for the next character 29632 LD IX,25443 ; Point IX at Thor's entry in characters' current positions table 29636 LD BC,1537 ; Load B with 6 (as there are initially 6 characters to consider) and C with 1 29639 LD A,(23467) ; If Banshee is not released... 29642 AND 1 ; ... 29644 JR Z,29647 ; ...then skip ahead to #R29647... 29646 INC B ; ...else increase B by one (Banshee) *29647 LD A,(23468) ; If Gimbal is not released... 29650 AND 1 ; ... 29652 JR Z,29660 ; ...then skip ahead to #R29660... 29654 INC B ; ...else increase B by one (Gimbal)... 29655 DEC C ; ...decrease C... 29656 LD IX,25440 ; ...and point IX at Gimbal's entry in characters' current positions table *29660 LD A,(65529) ; Load A with Magic Knight's current room 29663 BIT 7,(IX+0) ; If high bit of character's current room (pointed to by IX) is set... 29667 CALL NZ,29709 ; ...then animate puff of smoke then draw character in position 29670 INC C ; Increase C by one 29671 INC IX ; Advance to room of next character 29673 INC IX ; ... 29675 INC IX ; ... 29677 DJNZ 29660 ; ...and repeat the loop for the next character 29679 RET ; Return ; Load Character's Coordinates into BC and Graphic Lookup Index into A and Draw to Screen ; ; Used by the routines at #R29576 and #R29709. Input: C Index of character to draw IX Pointer to position data ; for this character (3 bytes: Screen number, x-coordinate, y-coordinate) c29680 PUSH BC ; Store BC 29681 PUSH IX ; Store IX 29683 PUSH AF ; Store AF 29684 LD A,C ; Copy index of current character into A... 29685 ADD A,69 ; ...and add 69 to this (as the characters' entries in the graphics data lookup table start at ; entry number 69) 29687 LD C,A ; Copy this index into C 29688 JR 29694 ; Skip to preparation routine below ; Load Object's coordinates into BC and Graphic Lookup Index into A and Draw to Screen ; ; Used by the routine at #R29709. Input: C Index (in graphics lookup data table at #R42642) of object to draw IX ; Pointer to position data for this object (3 bytes: Screen number, x-coordinate, y-coordinate) c29690 PUSH BC ; Store BC 29691 PUSH IX ; Store IX 29693 PUSH AF ; Store AF ; This entry point is used by the routine at #R29680. *29694 LD A,C ; Copy index of object to draw (as it appears in the graphics data lookup table at 42642) into ; A 29695 LD C,(IX+1) ; Load x-coordinate of object into C 29698 LD B,(IX+2) ; Load y-coordinate of object into B 29701 CALL 29950 ; Draw graphic in XOR mode 29704 POP AF ; Restore AF 29705 POP IX ; Restore IX 29707 POP BC ; Restore BC 29708 RET ; Return ; Animate Puff of Smoke then Draw a Character in Position ; ; Only called if high bit of Magic Knight's current room is set Input: A Magic Knight's current room IX Pointer ; to position data for this character (3 bytes: Screen number, x-coordinate, y-coordinate) c29709 LD E,(IX+0) ; Load character's room index into E 29712 RES 7,E ; Reset the most significant bit 29714 CP E ; If new room index is different from Magic Knight's then... 29715 RET NZ ; ...return... 29716 RES 7,(IX+0) ; ...else reset high bit of character's room index 29720 PUSH BC ; Store BC 29721 LD C,63 ; Load C with 63 (index of first frame of puff of smoke animation) 29723 PUSH BC ; Store BC (C = index of puff of smoke) 29724 CALL 29690 ; Load character's coordinates into BC and graphic lookup index into A and draw to screen 29727 POP BC ; Restore BC (C = index of puff of smoke) 29728 LD B,5 ; Set B to 5 (as there are six frames we need to loop 5 times) *29730 PUSH BC ; Store BC (C = index of puff of smoke) 29731 HALT ; Wait for interrupts... 29732 HALT ; ... 29733 HALT ; ... 29734 HALT ; ... 29735 HALT ; ... 29736 HALT ; ... 29737 CALL 29690 ; Load object's coordinates into BC and graphic lookup index into A and draw to screen 29740 POP BC ; Restore BC (C = index of puff of smoke) 29741 INC C ; Advance C by one (to point to next frame of puff of smoke animation) 29742 PUSH BC ; Store BC (C = index of puff of smoke) 29743 CALL 29690 ; Load object's coordinates into BC and graphic lookup index into A and draw to screen 29746 POP BC ; Restore BC (C = index of puff of smoke) 29747 DJNZ 29730 ; Decrease B and loop back for next frame 29749 HALT ; Wait for interrupts... 29750 HALT ; ... 29751 HALT ; ... 29752 HALT ; ... 29753 HALT ; ... 29754 HALT ; ... 29755 CALL 29690 ; Load object's coordinates into BC and graphic lookup index into A and draw to screen 29758 POP BC ; Restore BC 29759 CALL 29680 ; Draw character to screen 29762 RET ; Return ; Run Checks and Updates (Magic Knight's Current Room and Room-Specific Routines) ; ; Used by the routines at #R27176 and #R27495. c29763 LD HL,0 ; Set Magic Knight's current x- and y-velocities to zero... 29766 LD (25391),HL ; ... 29769 CALL 29468 ; Check whether Magic Knight is moving into a new room and react if so ; The operand of the instruction at #R29772 represents the address of the appropriate room-specific routine. This is ; modified by the instruction at #R29461. 29772 JP 29775 ; Execute room-specific routine ; Room-Specific Routine Do Nothing (Return) 1 ; ; Used by the routine at #R29763. c29775 RET ; Return ; Room-Specific Routine Update Positions of 4 Odd-Balls and Display ; ; Used by the routine at #R29911. c29776 XOR A ; Ball 0 29777 CALL 35993 ; Update position of Odd Ball 0, display, and decrease Magic Knight's strength if in contact 29780 LD A,1 ; Ball 1 29782 CALL 35993 ; Update position of Odd Ball 1, display, and decrease Magic Knight's strength if in contact 29785 LD A,2 ; Ball 2 29787 CALL 35993 ; Update position of Odd Ball 2, display, and decrease Magic Knight's strength if in contact 29790 LD A,3 ; Ball 3 29792 CALL 35993 ; Update position of Odd Ball 3, display, and decrease Magic Knight's strength if in contact 29795 RET ; Return ; Room-Specific Routine Do Nothing (Return) 2 c29796 RET ; Return ; Room-Specific Routine Jump to "Kill Magic Knight if he is in a Dark Room Without Illumination" c29797 JR 29800 ; Jump to "Kill Magic Knight if he is in a Dark Room Without Illumination" routine ; Room-Specific Routine Do Nothing (Return) 3 c29799 RET ; Return ; Room-Specific Routine Kill Magic Knight if he is in a Dark Room Without Illumination ; ; Used by the routine at #R29797. c29800 LD A,(23467) ; If "Armouris Photonicus cast" flag is set... 29803 BIT 2,A ; ... 29805 RET NZ ; ...then return 29806 LD A,16 ; Load A with index of Glowing Bottle 29808 CALL 34256 ; Check to see if this object is in Magic Knight's inventory... 29811 RET Z ; ...and if so, return 29812 LD A,(25512) ; Get current "screen" location of Glowing Bottle 29815 CP 18 ; If Glowing Bottle is in "The Little Bottle" room, then... (Bug. See also trivia) 29817 RET Z ; ...return as room is lit (although not sure how bottle can actually get here!) 29818 LD A,33 ; Load A with index of Engraved Candle 29820 CALL 34256 ; Check to see if this object is in Magic Knight's inventory... 29823 JR Z,29832 ; ...and if so, skip ahead to #R29832 (to check if it is lit) 29825 LD A,(25563) ; Get current "screen" location of Engraved Candle 29828 CP 18 ; If Engraved Candle is NOT in "The Little Bottle" room then... 29830 JR NZ,29838 ; ...skip ahead to "You have died" section of routine *29832 LD A,(23467) ; If the Engraved Candle is lit... 29835 BIT 1,A ; ... 29837 RET NZ ; ...then return *29838 RES 0,(IY+65) ; Reset "Update Game Time and Locate Arrow Glow" flag 29842 LD HL,22528 ; Point to start of Attribute File... 29845 LD DE,22529 ; ... 29848 LD BC,607 ; ... 29851 LD (HL),L ; L is zero as HL is 22528 29852 LDIR ; Fill top 19 (i.e. 608 / 32) rows of Attribute File with zeroes (i.e. make the room black ; dark!) 29854 LD A,31 ; Draw window 31 ("Death info" window, i.e. have entered a dark room without illumination)... 29856 CALL 36987 ; ... 29859 LD HL,51457 ; Point to "Somebody switched off the light..." text 29862 CALL 36725 ; Print the text 29865 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 29868 LD HL,43467 ; Point HL at "YOU HURT YOURSELF MOVING AROUND IN THE DARK" text 29871 JP 35101 ; Jump to "Game over" window routine and exit ; Room-Specific Routine Update Position of 1 Odd-Ball and Display c29874 XOR A ; Set A to zero 29875 CALL 35993 ; Update position of Odd Ball 0, display, and decrease Magic Knight's strength if in contact 29878 RET ; Return ; Room-Specific Routine Do Nothing (Return) 4 c29879 RET ; Return ; Room-Specific Routine Kill Magic Knight if he is in the Gas Room Without Protection c29880 LD A,(23468) ; Check Magic Knight spell flags... 29883 AND 2 ; ... 29885 RET NZ ; ...and return if bit 2 is set (i.e. Fumaticus Protectium has been successfully cast) 29886 RES 0,(IY+65) ; Reset "Update Game Time and Locate Arrow Glow" flag 29890 LD A,31 ; Draw window 31 ("Death info" window, i.e. have entered the Gas Room without Fumaticus ; Protectium)... 29892 CALL 36987 ; ... 29895 LD HL,51583 ; Point to "CHOKE... CHOKE..." text 29898 CALL 36725 ; Print the text 29901 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 29904 LD HL,43651 ; Point HL at "THE GAS GOT YOU" text 29907 JP 35101 ; Jump to "Game over" window routine and exit ; Room-Specific Routine Do Nothing (Return) 5 c29910 RET ; Return ; Room-Specific Routine Jump to "Update Positions of 4 Odd-Balls and Display" c29911 JP 29776 ; Update positions of 4 Odd-Balls and display ; Room-Specific Routine Do Nothing (Return) 6 c29914 RET ; Return ; Room-Specific Routine Kill Magic Knight if he has Fallen into the Pit of Destruction c29915 LD A,(25388) ; Load Magic Knight's current y-coordinate into A... 29918 CP 112 ; ...and if this is less than 112... 29920 RET NZ ; ...then return... 29921 LD HL,51723 ; ...else point HL at "YOU FELL INTO THE PIT OF DESTRUCTION..." text... 29924 JP 35101 ; ...display related GAME OVER window and return to main menu ; Room-Specific Routine Do Nothing (Return) 7 c29927 RET ; Return ; Room-Specific Routine Draw Whited-Out Gimbal if he has not Been Freed c29928 LD A,(23468) ; Load A with Game Progress Flags (2) 29931 BIT 0,A ; If Gimbal is free... 29933 RET NZ ; ...then return 29934 LD C,6 ; Set x-coordinate to 6 29936 LD B,2 ; Set y-coordinate to 2 29938 LD A,127 ; Set system variable ATTR T to 127 (white INK, white PAPER, BRIGHT)... 29940 LD (23695),A ; ... 29943 LD A,69 ; Draw Gimbal the Wizard (whited-out)... 29945 CALL 29960 ; ... 29948 RET ; Return ; Room-Specific Routine Do Nothing (Return) 8 c29949 RET ; Return ; Draw a Graphic (in XOR Mode) ; ; Used by the routines at #R28092 and #R29690. Input: A Index of graphic to draw in graphic data lookup table at ; #R42642 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c29950 EX AF,AF' ; Switch register AF 29951 LD A,174 ; Prepare to modify instruction at #R30043 to "XOR (HL)" 29953 JR 29962 ; Jump into graphic drawing routine ; Draw a Graphic (in OR Mode) ; ; Used by the routines at #R29375 and #R38539. Input: A Index of graphic to draw in graphic data lookup table at ; #R42642 B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c29955 EX AF,AF' ; Switch register AF 29956 LD A,182 ; Prepare to modify instruction at #R30043 to "OR (HL)" 29958 JR 29962 ; Jump into graphic drawing routine ; Draw a Graphic (in NOP Mode) ; ; Used by the routines at #R28683, #R28747, #R28882, #R28960, #R29032, #R29089, #R29150, #R29225, #R29291, #R29928, ; #R30129, #R31370, #R32035 and #R36275. Input: A Index of graphic to draw in graphic data lookup table at #R42642 ; B y-coordinate (characters) for printing item C x-coordinate (characters) for printing item c29960 EX AF,AF' ; Switch register AF 29961 XOR A ; Prepare to modify instruction at #R30043 to "NOP" (i.e. A=0) ; This entry point is used by the routines at #R29950 and #R29955. *29962 LD (30043),A ; Modify instruction at #R30043 with new opcode in A 29965 EX AF,AF' ; Switch back 29966 PUSH HL ; Store HL, BC and AF... 29967 PUSH BC ; ... 29968 PUSH AF ; ... 29969 LD A,C ; Load x-coordinate to draw item into instruction at #R30037 29970 LD (30038),A ; ... 29973 LD A,B ; Multiply y-coordinate by 8... 29974 ADD A,A ; ... 29975 ADD A,A ; ... 29976 ADD A,A ; ... 29977 LD L,A ; ...and load into HL... 29978 LD H,0 ; ... 29980 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 26064) 29981 LD DE,26064 ; Point DE at table of Display File addresses of starts of each pixel row 29984 ADD HL,DE ; Advance by 16 times y-coordinate to point HL at entry for start of item's current pixel row 29985 PUSH HL ; Transfer this value into IX... 29986 POP IX ; ... 29988 POP AF ; Restore A (graphic index of item to draw)... 29989 LD L,A ; ...and load into HL... 29990 LD H,0 ; ... 29992 ADD HL,HL ; Multiply by four... 29993 ADD HL,HL ; ... 29994 LD BC,42642 ; Point BC at start of graphics data lookup table... 29997 ADD HL,BC ; ...and add offset to point to entry for item of interest 29998 LD C,(HL) ; Load graphic width into C 29999 INC HL ; Advance to height 30000 LD B,(HL) ; Load graphic height into B 30001 INC HL ; Advance to graphic address 30002 LD A,(HL) ; Load graphic address into HL... 30003 INC HL ; ... 30004 LD H,(HL) ; ... 30005 LD L,A ; ... 30006 LD A,C ; Load graphic width into A 30007 CP 255 ; If width is not set to 255, then... 30009 JR NZ,30014 ; ...skip to #R30014... 30011 LD BC,514 ; ...else set both height and width to 2 *30014 PUSH BC ; Store width and height 30015 EX DE,HL ; Swap graphic address into DE 30016 LD A,B ; Load height into A... 30017 ADD A,A ; ...and multiply by eight... 30018 ADD A,A ; ... 30019 ADD A,A ; ... 30020 LD L,A ; ...and load into L 30021 LD H,C ; Load H with graphic width 30022 LD A,C ; Load A with graphic width 30023 LD (30041),A ; Load graphic width into instruction at #R30040 30026 PUSH HL ; Transfer width (H) and eight times height (L) from HL to... 30027 POP BC ; ...B (width) and C (eight times height) *30028 PUSH BC ; Store B (width) and C (x times height, where x decreases through loop) 30029 LD L,(IX+0) ; Load HL with Display File address to draw item data to screen (stored in IX) from table at ; #R26064... 30032 LD H,(IX+1) ; ... 30035 LD B,0 ; Set B to zero ; The operand of the instruction at #R30037 represents the x-coordinate value stored previously. This is modified by ; the instruction at #R29970. 30037 LD C,0 ; Load C with x-coordinate of item to draw 30039 ADD HL,BC ; Increase Display File offset with x-coordinate (characters) ; The operand of the instruction at #R30040 represents the width value stored previously. This is modified by the ; instruction at #R30023. 30040 LD B,0 ; Load B with width of graphic to draw *30042 LD A,(DE) ; Load a byte of graphic data into A ; The instruction at #R30043 represents the graphic blending mode, and can be NOP, XOR (HL) or OR (HL). This is ; modified by the instruction at #R29962. 30043 NOP ; Blend with graphic data already in Display File 30044 LD (HL),A ; Write resultant graphic data to Display File 30045 INC HL ; Advance Display File pointer to draw second column 30046 INC DE ; Advance to next graphic data byte 30047 DJNZ 30042 ; Repeat loop (for second column of graphic) 30049 INC IX ; Advance IX by two (as it is pointing to a table of two-byte addresses)... 30051 INC IX ; ... 30053 POP BC ; Restore width and eight times height to BC... 30054 DEC C ; ...and decrease C (eight times height) to move to next pixel row 30055 JR NZ,30028 ; Repeat loop for next pixel row 30057 POP DE ; Restore height (D) and width (E) (characters) 30058 LD A,E ; Load width into A 30059 LD (30069),A ; Modify instruction at #R30068 with width 30062 POP BC ; Restore y- and x-coordinates for item being drawn *30063 PUSH BC ; Store this again 30064 PUSH DE ; Store width and height 30065 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address ; The operand of the instruction at #R30068 represents the width value stored previously. This is modified by the ; instruction at #R30059. 30068 LD B,0 ; Load B with width of item being drawn *30070 LD A,(23695) ; Load ATTR T system variable into A (this is set by instructions prior to this routine being ; called) 30073 LD (HL),A ; Write attribute to current virtual cursor location 30074 PUSH HL ; Store current virtual cursor location 30075 XOR A ; Set A to zero 30076 LD DE,22528 ; Point DE to start of Attribute File 30079 SBC HL,DE ; Load HL with address of Virtual Attribute Cursor location, relative to start of Attribute ; File 30081 LD DE,24539 ; Point DE at Terrain Interaction Data 30084 ADD HL,DE ; Add relative address of virtual cursor (attribute) as offset 30085 LD A,(23483) ; Load stored Terrain Interaction Parameter into Terrain Interaction Table for this Attribute ; File address... 30088 LD (HL),A ; ... 30089 POP HL ; Restore current virtual cursor location 30090 INC HL ; Advance cursor to the right one character 30091 DJNZ 30070 ; Repeat loop for rest of width 30093 POP DE ; Restore height (D) and width (E) 30094 POP BC ; Restore y (B) and x (C) coordinates for item being drawn 30095 INC B ; Increase y-coordinate 30096 DEC D ; Decrease "remaining" height 30097 JR NZ,30063 ; If there is some remaining height to colour, then loop back 30099 POP HL ; Restore HL 30100 RET ; Return ; Indent "SPELLBOUND" Text in Bottom Window to Indicate Magic Knight's Current Floor ; ; Used by the routine at #R27865. c30101 LD A,158 ; Load A with 158... 30103 LD (43138),A ; ...and place into formatting data at 43138 30106 LD A,(65529) ; Load A with Magic Knight's current room 30109 OR A ; Return if room number is zero (i.e. Magic Knight is in the Lift)... 30110 RET Z ; ... 30111 DEC A ; ...else... 30112 RRCA ; ...subtract one and divide by eight... 30113 RRCA ; ... 30114 RRCA ; ... 30115 AND 7 ; ...to give floor number 30117 ADD A,158 ; Add floor number to 158 30119 LD (43138),A ; Load into formatting data at 43138 30122 RET ; Return ; Divide A by Eight, Rounding Down to Nearest Integer ; ; Used by the routines at #R27495, #R27666, #R27809, #R34385, #R37333 and #R37571. c30123 RRCA ; Divide by eight... 30124 RRCA ; ... 30125 RRCA ; ... 30126 AND 31 ; ...and remove remainder 30128 RET ; Return ; Draw Lift Doors if Magic Knight is at Lift Entrance on a Different Floor to the Lift ; ; Used by the routine at #R28092. c30129 LD A,(65529) ; Load Magic Knight's current room into A 30132 DEC A ; If room number is not a multiple of 8... 30133 AND 7 ; ...(i.e. not a room from which the lift can be called)... 30135 RET NZ ; ...then return 30136 LD A,(65529) ; Load Magic Knight's current room into A... 30139 ADD A,A ; ...double it... 30140 LD C,A ; ...and copy into BC... 30141 LD B,0 ; ... 30143 LD HL,41711 ; Point HL at room connectivity data table 30146 ADD HL,BC ; Add BC as offset 30147 LD A,(HL) ; Load index of room to left of current room... 30148 CP 255 ; ...and if this is not set to 255 (i.e. the Lift is here)... 30150 RET NZ ; ...return... 30151 LD A,69 ; ...else set system variable ATTR T to 69 (cyan INK, black PAPER, BRIGHT)... 30153 LD (23695),A ; ... 30156 LD A,224 ; Set Terrain Interaction Parameter ("impassable horizontally", "impassable vertically", and ; "preserve attribute")... 30158 LD (23483),A ; ... 30161 LD BC,3584 ; Set coordinates and... 30164 LD A,83 ; ...draw a graphic #83 (lift doors) 30166 CALL 29960 ; ... 30169 RET ; Return ; Addresses of room feature drawing routines b30170 DEFW 28064 ; 230 - Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 30172 DEFW 28647 ; 231 - Set brickwork drawing mode 1 (one row of bricks only) 30174 DEFW 28651 ; 232 - Set brickwork drawing mode 2 (one row of bricks with blank row beneath) 30176 DEFW 28659 ; 233 - Set Terrain Interaction Parameter to "impassable vertically" and "preserve attribute" 30178 DEFW 28667 ; 234 - Set Terrain Interaction Parameter to "impassable horizontally", "impassable vertically" ; and "preserve attribute" 30180 DEFW 28675 ; 235 - Set Terrain Interaction Parameter to "preserve attribute" 30182 DEFW 28683 ; 236 - Draw right-facing wall-candle 30184 DEFW 28747 ; 237 - Draw left-facing wall-candle 30186 DEFW 28841 ; 238 - Set attributes, including glow, on Lift control panel 30188 DEFW 28882 ; 239 - Draw picture in frame (59748) 30190 DEFW 28960 ; 240 - Draw picture in frame (59748) and replace picture with alternative (60156) 30192 DEFW 29032 ; 241 - Draw picture in frame (59548) 30194 DEFW 29089 ; 242 - Draw picture in frame (59548) and replace picture with alternative (60108) 30196 DEFW 29150 ; 243 - Draw Goblet Picture (Florin's Room) or character portrait and corresponding picture ; frame 30198 DEFW 29184 ; 244 - Read data for and display glowing blocks 30200 DEFW 29205 ; 245 - Paint attributes 30202 DEFW 29225 ; 246 - Draw wall axes 30204 DEFW 29291 ; 247 - Draw ceiling candles 30206 DEFW 28038 ; 248 - Unused 30208 DEFW 28038 ; 249 - Unused 30210 DEFW 29356 ; 250 - Room Drawing: Point Terrain Interaction and Bitmap Virtual Cursors to coordinates x=C, ; y=B 30212 DEFW 29375 ; 251 - Draw a graphic (x, y, attribute, Terrain Interaction Parameter, graphic lookup index) 30214 DEFW 28038 ; 252 - Unused 30216 DEFW 28038 ; 253 - Unused 30218 DEFW 29396 ; 254 - Read sequence of architecture styles and draw appropriate 2-by-2 blocks of brickwork 30220 DEFW 29414 ; 255 - Read sequence of architecture styles and attributes and draw appropriate 2-by-2 blocks ; of brickwork ; Process Command to Pick Up an Object c30222 CALL 38075 ; Play upward scale sound 30225 CALL 37654 ; Display / update command summary window at bottom of screen 30228 LD DE,45305 ; Point DE at "PICK UP" text... 30231 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 30234 LD IX,25464 ; Point IX at Objects' Current Positions Table 30238 LD BC,3200 ; Load B with 12 and C with 128 [bug: Should be Load B with 50 and C with 0, or LD BC, 12800] *30241 LD A,(65529) ; Load A with Magic Knight's current room 30244 CP (IX+0) ; If current object's room is not the same as Magic Knight's then... 30247 JR NZ,30250 ; ...skip ahead to #R30250 30249 INC C ; Increase C (count of objects in Magic Knight's current room) *30250 INC IX ; Advance IX to next object's position... 30252 INC IX ; ... 30254 INC IX ; ... 30256 DJNZ 30241 ; Decrease B and loop back for next object 30258 LD A,C ; Copy total number of objects into A... 30259 OR A ; ...and if this value is zero... [can't actually happen because of bug at #R30238] 30260 JP Z,34436 ; ...display "THERE IS NOTHING IN THIS ROOM" message and return to game 30263 LD IX,25464 ; Point IX at Objects' Current Positions Table 30267 LD A,(65529) ; Load A with Magic Knight's current room... 30270 LD C,A ; ...and copy into C 30271 CALL 34385 ; Load Magic Knight's coordinates (in characters) into DE 30274 XOR A ; Set A to zero 30275 EX AF,AF' ; Switch A register 30276 LD B,50 ; Load B with 50 (as there are 50 objects) *30278 LD A,C ; Load Magic Knight's current room into A 30279 CP (IX+0) ; If room of current object is not the same as Magic Knight's current room then... 30282 JR NZ,30327 ; ...skip ahead to #R30327 (advance to next object) 30284 LD A,D ; Copy Magic Knight's y-coordinate into A 30285 CP (IX+2) ; If y-coordinate of object is not the same as Magic Knight's y-coordinate then... 30288 JR NZ,30327 ; ...skip ahead to #R30327 (advance to next object) 30290 LD A,E ; Load Magic Knight's x-coordinate into A 30291 DEC A ; Decrease x-coordinate by two... 30292 DEC A ; ... 30293 CP (IX+1) ; If x-coordinate of object is the same as Magic Knight's x-coordinate minus two... 30296 JP Z,30341 ; ...skip ahead to #R30341 30299 INC A ; Increase x-coordinate by one 30300 CP (IX+1) ; If x-coordinate of object is the same as Magic Knight's x-coordinate minus one then... 30303 JP Z,30341 ; ...skip ahead to #R30341 30306 INC A ; Increase x-coordinate by one 30307 CP (IX+1) ; If x-coordinate of object is the same as Magic Knight's x-coordinate then... 30310 JP Z,30341 ; ...skip ahead to #R30341 30313 INC A ; Increase x-coordinate by one 30314 CP (IX+1) ; If x-coordinate of object is the same as Magic Knight's x-coordinate plus one then... 30317 JP Z,30341 ; ...skip ahead to #R30341 30320 INC A ; Increase x-coordinate by one 30321 CP (IX+1) ; If x-coordinate of object is the same as Magic Knight's x-coordinate plus two then... 30324 JP Z,30341 ; ...skip ahead to #R30341 *30327 INC IX ; Advance IX by three bytes to move to next object... 30329 INC IX ; ... 30331 INC IX ; ... 30333 EX AF,AF' ; Switch A register back (so now contains the index of the object to test next) 30334 INC A ; Increase A (index of current object to test) 30335 EX AF,AF' ; Switch A register 30336 DJNZ 30278 ; Loop back to 30278 for next object 30338 JP 34430 ; Display "THERE IS NOTHING NEAR ENOUGH" message and return to game ; An object has been found within Magic Knight's reach so make this the Current Object *30341 EX AF,AF' ; Switch A register (so now contains index of first object that is within Magic Knight's reach) 30342 LD (30467),A ; Load index of this object into instruction at #R30466 (i.e. set as Current Object) 30345 LD HL,41236 ; Point HL at table of object names 30348 LD B,A ; Load B with index of object that is within Magic Knight's reach 30349 CALL 34842 ; Advance HL to B-th entry in object names table 30352 EX DE,HL ; Swap DE and HL (so DE now contains pointer to name of Current Object) 30353 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 30356 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 30359 LD A,(30467) ; Load A with index of Current Object... 30362 CP 34 ; ...and if it is not object 34 (Strange Liquid) then... 30364 JR NZ,30369 ; ...jump to #R30369 30366 JP 34592 ; Display "THE LIQUID IS STUCK TO THE FLOOR (IT'S A VERY THICK LIQUID)" window and exit *30369 LD HL,25399 ; Load A with object at Magic Knight's fifth inventory slot... 30372 LD A,(HL) ; ... 30373 OR A ; If this is not zero (i.e. Magic Knight's hands are full)... 30374 JP NZ,34418 ; ...then display "YOUR HANDS ARE FULL" window and return to game 30377 CALL 34202 ; Check whether object has a weight greater than Magic Knight's surplus strength... 30380 JP P,34424 ; ...and if it does, display "THAT OBJECT IS TOO HEAVY" message and return to game 30383 LD A,(30467) ; Load A with index of Current Object... 30386 LD C,A ; ...and into C 30387 LD B,5 ; Load B with 5 (as 5 inventory slots) 30389 LD HL,25395 ; Point HL at start of Magic Knight's inventory 30392 CALL 34151 ; Load object in C into Magic Knight's first empty inventory slot 30395 LD A,(30467) ; Load A with index of Current Object... 30398 LD C,A ; ...and into C 30399 ADD A,A ; Multiply index by three in A... 30400 ADD A,C ; ... 30401 LD B,0 ; Load B with zero 30403 LD C,A ; Load three times object index into C (as position data is three bytes wide) 30404 LD HL,25464 ; Point HL at Objects' Current Positions Table 30407 ADD HL,BC ; Add BC as offset to point HL at position data for Current Object 30408 LD (HL),99 ; Set object's room to 99 ; This entry point is used by the routines at #R30439, #R30602 and #R30880. *30410 LD IX,25395 ; Point IX at Magic Knight's current inventory 30414 LD B,5 ; Load B with 5 (as five inventory slots) 30416 LD HL,45285 ; Point HL at "YOU ARE NOW CARRYING" text 30419 CALL 34907 ; Display "Magic Knight's current inventory" window as an information window 30422 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 30425 CALL 35495 ; Set Magic Knight's available action flags ; This entry point is used by the routines at #R31153, #R31370, #R32035, #R32194, #R32258, #R32655, #R33932, ; #R34350, #R34768, #R35141 and #R38725. *30428 LD A,(23377) ; Reset Gimbal-White-Out Safe Flag... 30431 AND 254 ; ... 30433 LD (23377),A ; ... 30436 JP 27168 ; Redraw current room and return to game ; Process Command to Drop an Object c30439 CALL 38075 ; Play upward scale sound 30442 LD IX,25395 ; Point IX at start of Magic Knight's inventory 30446 LD B,5 ; Load B with 5, as there are five inventory slots to check 30448 LD HL,45429 ; Point HL at "DROP WHICH OBJECT?" text 30451 LD DE,45440 ; Point DE at "DROP" text 30454 CALL 34914 ; Show list of objects (window or menu) and handle selection if a menu 30457 LD HL,25395 ; Point HL at start of Magic Knight's current inventory 30460 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 30463 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit ; The operand of the instruction at #R30466 represents the index of the Current Object used in multiple routines. ; This is modified by the instructions at #R30342 and #R34871. 30466 LD A,0 ; Load A with index of Current Object 30468 LD E,1 ; Load E with 1 (Drop status) 30470 CALL 34160 ; Point HL to drop status of object A 30473 BIT 0,(HL) ; If drop status is not zero, i.e. object can't be dropped then... 30475 JP NZ,34442 ; ...jump to #R34442 (display "YOU CAN'T DROP THAT OBJECT" window and return to game) 30478 LD A,(30467) ; Load A with index of Current Object 30481 CP 16 ; If not object 16 (i.e. not Glowing Bottle)... 30483 JR NZ,30490 ; ...skip ahead to #R30490... 30485 CALL 30540 ; ...else smash Glowing Bottle and release Banshee... 30488 JR 30504 ; ...and skip ahead to #R30504 *30490 LD A,(30467) ; Load A with index of Current Object 30493 LD C,A ; Copy into C 30494 PUSH BC ; Store BC 30495 LD B,5 ; Load B with 5 30497 LD HL,25395 ; Point HL at start of Magic Knight's current inventory 30500 CALL 38674 ; Remove object C from Magic Knight's inventory (and tidy up remainder of slots) 30503 POP BC ; Restore BC *30504 LD A,C ; Load Current Object's index into A 30505 ADD A,A ; Multiply object index by 3... 30506 ADD A,C ; ... 30507 LD C,A ; ...and load back into C 30508 LD B,0 ; Load B with zero 30510 LD HL,25464 ; Point HL at start of Objects' Current Positions Table at #R25464 30513 ADD HL,BC ; Add three times Current Object's index as offset to point HL at position data of Current ; Object 30514 LD A,(65529) ; Load A with Magic Knight's current room 30517 LD (HL),A ; Set object's current room to be same as Magic Knight's 30518 INC HL ; Advance HL to x-coordinate of object 30519 LD B,0 ; Set B to zero 30521 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 30524 AND 7 ; Get x-coordinate in terms of pixels within current character block (i.e. lowest 3 bits of ; x-coordinate) 30526 JR Z,30529 ; If this is zero (i.e. Magic Knight at left-most pixel in character block) then skip ahead to ; #R30529... 30528 INC B ; ...else increase B *30529 CALL 34385 ; Load Magic Knight's coordinates (in characters) into DE 30532 LD A,B ; Load B into A 30533 ADD A,E ; Add Magic Knight's x-coordinate to A 30534 LD (HL),A ; Set this as object's x-coordinate 30535 INC HL ; Advance HL to y-coordinate of object 30536 LD (HL),D ; Set this to same as Magic Knight's y-coordinate 30537 JP 30410 ; Display Magic Knight's current inventory and return to game ; Smash Glowing Bottle ; ; Used by the routines at #R30439 and #R32390. Input: C 16 (Item index of Glowing Bottle) Output: C 14 (Item ; index of Broken Glass) c30540 LD C,16 ; Remove Glowing Bottle from Magic Knight's inventory... 30542 LD B,5 ; ... 30544 LD HL,25395 ; ... 30547 CALL 38674 ; ... 30550 LD HL,45496 ; Display "YOU DROPPED THE BOTTLE TO THE GROUND..." window (window 26)... 30553 LD A,26 ; ... 30555 CALL 36987 ; ... 30558 LD HL,45496 ; ... 30561 CALL 36725 ; ... 30564 LD A,(23467) ; Set "Banshee is released" flag... 30567 SET 0,A ; ... 30569 LD (23467),A ; ... 30572 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 30575 LD B,7 ; Set B to 7 (index of Banshee) 30577 LD A,(65529) ; Load A with Magic Knight's current room... 30580 LD C,A ; ...and copy into C 30581 CALL 36327 ; Assign a slot in room C to character B and get x- and y-coordinates in BC 30584 CP 4 ; If assigned slot number is 4 (i.e. already three characters in current room)... 30586 JR Z,30599 ; ...then skip ahead to #R30599 30588 LD HL,25461 ; Point HL at Banshee's current location 30591 LD A,(65529) ; Load Magic Knight's current room index into A 30594 LD (HL),A ; Set Banshee's current room as Magic Knight's current room 30595 INC HL ; Point HL at Banshee's current x-coordinate... 30596 LD (HL),C ; ...and set to match assigned slot 30597 INC HL ; Point HL at Banshee's current y-coordinate 30598 LD (HL),B ; ...and set to match assigned slot *30599 LD C,14 ; Load C with index of Broken Glass (as this will be replacing the Glowing Bottle in the world) 30601 RET ; Return ; Process Command to Take an Object c30602 CALL 38075 ; Play upward scale sound 30605 LD HL,44051 ; Point HL at "TAKE AN OBJECT FROM ?" text 30608 LD DE,45619 ; Point DE at "TAKE SOMETHING FROM" text 30611 CALL 35141 ; Display and process input for character selection menu (current room's characters only), ; setting Current Character ; The operand of the instruction at #R30614 represents the index of the Current Character used in multiple routines. ; This is modified by the instructions at #R31430, #R34893, #R35258, #R35349, #R35383 and #R55462. 30614 LD A,0 ; Load A with index of Current Character 30616 CALL 34186 ; Point IX at current inventory of character in A 30619 LD A,(IX+0) ; Load character's first inventory object into A 30622 OR A ; If first object is zero (i.e. character's hands are empty)... 30623 JP Z,34448 ; ...display "[CHARACTER]'S HANDS ARE EMPTY" window and exit 30626 PUSH IX ; Store IX (pointer to current inventory of Current Character) 30628 LD B,5 ; Load B with 5 (as there are 5 inventory slots) 30630 LD HL,45609 ; Point HL at "TAKE WHICH OBJECT?" text 30633 LD DE,0 ; Set DE to zero so Command Summary Window is not updated upon selecting a character 30636 CALL 34914 ; Show list of objects (window or menu) and handle selection, loading ASCII index code of ; chosen object into A 30639 PUSH AF ; Store AF (A = ASCII code of letter of chosen object, e.g. A = first object, B = second, etc.) 30640 CALL 37654 ; Display / update command summary window at bottom of screen 30643 LD DE,45616 ; Point DE at "TAKE" text... 30646 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 30649 POP AF ; Restore AF (ASCII code of index of selected object) 30650 POP HL ; Restore HL (previously IX, pointer to current inventory of Current Character) 30651 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 30654 LD DE,45623 ; Point DE at "FROM" text... 30657 CALL 38693 ; ...and print in Command Summary Window 30660 LD A,(30615) ; Load A with index of Current Character 30663 CALL 34896 ; Print short name of Current Character in command summary window 30666 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 30669 LD HL,25399 ; Point HL at Magic Knight's fifth inventory slot... 30672 LD A,(HL) ; ...and if this is not empty... 30673 OR A ; ... 30674 JP NZ,34418 ; ...then display "YOUR HANDS ARE FULL" window and return to game 30677 CALL 34202 ; Check whether object has a weight greater than Magic Knight's surplus strength... 30680 JP P,34424 ; ...and if it is, display "THAT OBJECT IS TOO HEAVY" message and return to game 30683 CALL 34137 ; Load happiness of Current Character into A 30686 CP 30 ; If character's happiness is less than 30... 30688 JP C,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30691 LD A,(30467) ; Load B with index of Current Object... 30694 LD B,A ; ... 30695 LD A,(30615) ; Load index of Current Character into A 30698 OR A ; If character index is not zero (i.e. not Gimbal)... 30699 JP NZ,30705 ; ...then skip ahead to #R30705 (Thor's section) 30702 JP 30847 ; Skip ahead to #R30847 (transfer object from Gimbal's inventory to Magic Knight's and return ; to game) *30705 CP 1 ; If character index is not 1 (i.e. not Thor)... 30707 JP NZ,30745 ; ...then skip ahead to #R30745 (Florin's section) 30710 LD A,B ; Load index of selected object into B 30711 CP 3 ; If selected object is not Miolnir... 30713 JR NZ,30742 ; ...then skip ahead to #R30742 30715 LD HL,45668 ; Point HL at "THOR IS ANGRY..." text 30718 LD A,(HL) ; Load text height (rows) into A... 30719 LD (41981),A ; ...and then into stored bottom y-coordinate of window #13 30722 INC HL ; Advance HL to start of actual text data 30723 PUSH HL ; Store HL 30724 LD A,13 ; Draw window 13... 30726 CALL 36987 ; ... 30729 POP HL ; Restore HL (pointer to text) 30730 CALL 36725 ; Print text into window 30733 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 30736 LD HL,45798 ; Point HL at "THOR KILLED YOU" text 30739 JP 35101 ; Jump to "Game over" window routine and exit *30742 JP 30847 ; Skip ahead to #R30847 (transfer object from Current Character's inventory to Magic Knight's ; and return to game) *30745 CP 2 ; If character index is not 2 (i.e. not Florin)... 30747 JP NZ,30784 ; ... then skip ahead to #R30784 (Orik's section) 30750 LD A,B ; Load index of selected object into B 30751 CP 5 ; If selected object is the Sticky Bun... 30753 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30756 CP 11 ; If selected object is the Broken Talisman... 30758 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30761 CP 10 ; If selected object is the Tube of Glue... 30763 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30766 CP 30 ; If selected object is the Gold Bar... 30768 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30771 CP 26 ; If object is not Bottle of Liquid... 30773 JP NZ,30847 ; ...then skip ahead to #R30847 (transfer object from Current Character's inventory to Magic ; Knight's and return to game) 30776 LD A,96 ; Set Magic Knight's strength to 96... 30778 LD (25315),A ; ... 30781 JP 30847 ; Jump to #R30847 (transfer object from Current Character's inventory to Magic Knight's and ; return to game) *30784 CP 3 ; If character index is not 3 (i.e. not Orik)... 30786 JP NZ,30798 ; ...then skip ahead to #R30798 (Samsun's section) 30789 LD A,B ; Load index of selected object into B 30790 CP 2 ; If selected object is the Book of Shadows... 30792 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30795 JP 30847 ; Skip ahead to #R30847 (transfer object from Current Character's inventory to Magic Knight's ; and return to game) *30798 CP 4 ; If character index is not 4 (i.e. not Samsun)... 30800 JP NZ,30817 ; ...then skip ahead to #R30817 (Elrand's section) 30803 LD A,B ; Load index of selected object into B 30804 CP 8 ; If selected object is the Javelin... 30806 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30809 CP 29 ; If selected object is the Platform... 30811 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30814 JP 30847 ; Skip ahead to #R30847 (transfer object from Current Character's inventory to Magic Knight's ; and return to game) *30817 CP 5 ; If character index is not 5 (i.e. not Elrand)... 30819 JP NZ,30831 ; ...then skip ahead to #R30831 (Rosmar's section) 30822 LD A,B ; Load index of selected object into B 30823 CP 40 ; If selected object is the Trumpet... 30825 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30828 JP 30847 ; Skip ahead to #R30847 (transfer object from Current Character's inventory to Magic Knight's ; and return to game) *30831 CP 6 ; If character index is not 6 (i.e. not Rosmar)... 30833 JP NZ,30847 ; ...then skip ahead to #R30847 (transfer object from Current Character's inventory to Magic ; Knight's and return to game) 30836 LD A,B ; Load index of selected object into B 30837 CP 36 ; If selected object is the Pocket Laser... 30839 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game 30842 CP 18 ; If selected object is the Fast Blow Fuse... 30844 JP Z,34454 ; ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game *30847 LD A,(30615) ; Load A with index of Current Character 30850 CALL 34186 ; Point IX at current inventory of character in A 30853 PUSH IX ; Transfer pointer to current inventory of Current Character from IX to HL... 30855 POP HL ; ... 30856 LD A,(30467) ; Load C with index of Current Object... 30859 LD C,A ; ... 30860 LD B,5 ; Load B with 5 (as five inventory slots) 30862 CALL 38674 ; Remove current (selected) object from character's inventory 30865 LD A,(30467) ; Load C with index of Current Object... 30868 LD C,A ; ... 30869 LD B,5 ; Load B with 5 (as five inventory slots) 30871 LD HL,25395 ; Point HL at start of Magic Knight's inventory 30874 CALL 34151 ; Load current (selected) object into Magic Knight's first empty inventory slot 30877 JP 30410 ; Display Magic Knight's current inventory and return to game ; Process Command to Give an Object c30880 CALL 38075 ; Play upward scale sound 30883 LD IX,25395 ; Point IX at Magic Knight's inventory 30887 LD B,5 ; Load B with 5 (as there are five inventory slots) 30889 LD HL,45810 ; Point HL at "GIVE WHICH OBJECT?" text 30892 LD DE,45817 ; Point DE at "GIVE" text 30895 CALL 34914 ; Show list of objects (window or menu) and handle selection if a menu 30898 LD HL,25395 ; Point HL at Magic Knight's inventory 30901 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 30904 LD DE,45820 ; Point DE at "TO" text... 30907 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 30910 LD HL,44058 ; Point HL to "GIVE AN OBJECT TO ?" text 30913 LD DE,0 ; Set DE to zero so Command Summary Window is not updated with additional text 30916 CALL 35141 ; Display and process input for character selection menu (current room's characters only), ; setting Current Character 30919 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 30922 LD A,(30615) ; Load A with index of Current Character 30925 CALL 34186 ; Point IX at current inventory of character in A 30928 LD A,(IX+4) ; Load A with contents of character's last inventory slot 30931 OR A ; If inventory slot is not empty... 30932 JP NZ,34460 ; ...then display "[CHARACTER]'S HANDS ARE FULL" window and return to game 30935 LD BC,1280 ; Load B (number of inventory slots) with 5 and C (running total of character's carried weight) ; with 0 *30938 LD A,(IX+0) ; Load index of object in character's current inventory slot into A 30941 OR A ; If object index is zero (i.e. there is nothing in this slot and we have reached the end of ; the inventory)... 30942 JR Z,30953 ; ...then jump ahead to #R30953 (IX now points to first empty inventory slot) 30944 CALL 34126 ; Load A with weight of object A 30947 ADD A,C ; Add weight of object to C... 30948 LD C,A ; ... 30949 INC IX ; Advance to next inventory slot 30951 DJNZ 30938 ; Decrease B and loop back for next slot *30953 LD A,(30467) ; Load A with index of Current Object 30956 CALL 34126 ; Load A with weight of object A 30959 ADD A,C ; Add weight of Current Object to total weight currently held by the character... 30960 LD C,A ; ...in C 30961 LD A,(30615) ; Load A with index of Current Character 30964 LD E,0 ; Point HL at strength of character whose index is A... 30966 CALL 34174 ; ... 30969 LD A,(HL) ; Load character's strength into A 30970 CP C ; If total weight in C is greater than character's strength in A... 30971 JP C,34466 ; ...then display "[CHARACTER] IS NOT STRONG ENOUGH" window and return to game 30974 CALL 34137 ; Load happiness of Current Character into A 30977 CP 25 ; If character's happiness is less than 25... 30979 JP C,34472 ; ...then display "[CHARACTER] DOES NOT WANT THAT" window and return to game 30982 LD A,(30467) ; Load B with index of Current Object... 30985 LD B,A ; ... 30986 LD A,(30615) ; Load A with index of Current Character 30989 OR A ; If Current Character is not 0 (Gimbal)... 30990 JP NZ,31009 ; ...then skip ahead to #R31009 30993 LD A,B ; Load index of Current Object into A... 30994 CP 24 ; If Current Object is not the Willow Rod... 30996 JR NZ,31006 ; ...then skip ahead to #R31006 30998 LD A,(25328) ; Set Gimbal's "can help" flag... (see trivia) 31001 OR 1 ; ... 31003 LD (25328),A ; ... *31006 JP 31135 ; Skip ahead to #R31135 *31009 CP 1 ; If Current Character is not Thor... 31011 JP NZ,31038 ; ...then skip ahead to #R31038 31014 LD A,B ; Load index of Current Object into A 31015 CP 3 ; If Current Object is not Miolnir... 31017 JR NZ,31035 ; ...then skip ahead to #R31035 31019 LD A,(25336) ; Set Thor's "can help" flag... 31022 OR 1 ; ... 31024 LD (25336),A ; ... 31027 LD A,10 ; Change Thor's "current status" text to 10 (ready to help)... 31029 LD (25338),A ; ... 31032 JP 31135 ; Skip ahead to #R31135 *31035 JP 31135 ; Skip ahead to #R31135 [bug] *31038 CP 2 ; If Current Character is not Florin... 31040 JP NZ,31059 ; ...then skip ahead to #R31059 31043 LD A,B ; Load index of Current Object into A 31044 CP 11 ; If object is not the Broken Talisman... 31046 JR NZ,31056 ; ...then skip ahead to #R31056 31048 LD A,(25344) ; Set Florin's "can help" flag... 31051 OR 1 ; ... 31053 LD (25344),A ; ... *31056 JP 31135 ; Skip ahead to #R31135 *31059 CP 3 ; If Current Character is not Orik... 31061 JP NZ,31068 ; ...then skip ahead to #R31068 31064 LD A,B ; Load index of Current Object into A 31065 JP 31135 ; Skip ahead to #R31135 *31068 CP 4 ; If Current Character is not Samsun... 31070 JP NZ,31092 ; ...then skip ahead to #R31092 31073 LD A,B ; Load index of Current Object into A 31074 CP 8 ; If object is not 8 (Javelin)... 31076 JR NZ,31089 ; ...then skip ahead to #R31089 31078 LD A,(25360) ; Set Samsun's "can help" flag... 31081 OR 1 ; ... 31083 LD (25360),A ; ... 31086 JP 31135 ; Skip ahead to #R31135 *31089 JP 31135 ; Skip ahead to #R31135 [bug] *31092 CP 5 ; If Current Character is not Elrand... 31094 JP NZ,31111 ; ...then skip ahead to #R31111 31097 LD A,B ; Load index of Current Object into A 31098 CP 40 ; [bug - missing JP NZ instruction - should check for presence of object 40, Trumpet, in ; Elrand's inventory but there is no conditional jump following this check] 31100 LD A,(25368) ; Set Elrand's "can help" flag... 31103 OR 1 ; ... 31105 LD (25368),A ; ... 31108 JP 31135 ; Skip ahead to #R31135 *31111 CP 6 ; If Current Character is not Rosmar... 31113 JP NZ,31135 ; ...then skip ahead to #R31135 31116 LD A,B ; Load index of Current Object into A 31117 CP 36 ; If object is not 36 (Pocket Laser)... 31119 JR NZ,31132 ; ...then skip ahead to #R31132 31121 LD A,(25376) ; Set Rosmar's "can help" flag... 31124 OR 1 ; ... 31126 LD (25376),A ; ... 31129 JP 31135 ; Skip ahead to #R31135 *31132 JP 31135 ; Skip ahead to #R31135 [bug] *31135 LD A,(30467) ; Load index of Current Object into first empty inventory slot of character... 31138 LD (IX+0),A ; ... 31141 LD C,A ; ...and into C 31142 LD B,5 ; Load B with 5 (as there are 5 inventory slots to check) 31144 LD HL,25395 ; Point HL at Magic Knight's inventory 31147 CALL 38674 ; Remove object C from Magic Knight's inventory (and tidy up remainder of slots) 31150 JP 30410 ; Display Magic Knight's current inventory and return to game ; Display and Handle Main In-Game Menu (When Fire is Pressed) ; ; Used by the routine at #R27176. c31153 CALL 38108 ; Set parameters for and play downward scale sound 31156 LD BC,2048 ; Set B = 8 (eight action flags) and C = 0 (count of set flags) 31159 LD A,(65532) ; Load Magic Knight's action flags part 1 into A *31162 RLCA ; Pop a flag into carry flag 31163 JR NC,31166 ; If Magic Knight action flag is not set then skip ahead to #R31166 to repeat loop for next ; flag... 31165 INC C ; ...else increase count of set flags *31166 DJNZ 31162 ; Loop back for next flag until all eight are done 31168 LD B,8 ; Set B = 8 (another eight action flags) 31170 LD A,(65533) ; Load Magic Knight's action flags part 2 into A *31173 RLCA ; Pop a flag into carry flag 31174 JR NC,31177 ; If Magic Knight action flag is not set then skip ahead to #R31177 to repeat loop for next ; flag... 31176 INC C ; ...else increase count of set flags *31177 DJNZ 31173 ; Loop back for next flag until all eight are done 31179 LD A,9 ; Load A with 9 (as minimal command window has bottom y-coordinate of 9) 31181 ADD A,C ; Increase A by number of extra commands available 31182 LD C,A ; Load value back into C 31183 LD A,(41876) ; Load A with y-coordinate (characters) of top of menu window 31186 ADD A,C ; Update y-coordinate of bottom of window according to number of extra commands... 31187 LD (41877),A ; ... 31190 XOR A ; Display main in-game menu window (window number zero)... 31191 CALL 36979 ; ... 31194 LD HL,44103 ; Print "COMMANDS AVAILABLE:-" followed by first five commands (Pick up, drop, etc.) that are ; always available... 31197 CALL 36725 ; ... 31200 LD HL,16608 ; Set "memory location to start printing character" in character printing routine to start of ; last character row of permanent (yellow) menu options... 31203 LD (36488),HL ; ...(i.e. "E EXAMINE") in preparation for printing conditional (white) ones, which are ; [CR]-prefixed so will print to next line down 31206 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31209 BIT 0,A ; If Command a Character flag is not set then... 31211 JR Z,31219 ; ...skip ahead to next flag's check 31213 LD HL,44173 ; Else print "C COMMAND A CHARACTER" text... 31216 CALL 36725 ; ... *31219 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31222 BIT 1,A ; If Locate a Character flag is not set then... 31224 JR Z,31232 ; ...skip ahead to next flag's check 31226 LD HL,44181 ; Print "L LOCATE A CHARACTER" text... 31229 CALL 36725 ; ... *31232 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31235 BIT 2,A ; If Teleport flag is not set then... 31237 JR Z,31245 ; ...skip ahead to next flag's check 31239 LD HL,44189 ; Print "X TELEPORT" text... 31242 CALL 36725 ; ... *31245 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31248 BIT 3,A ; If Read flag is not set then... 31250 JR Z,31258 ; ...skip ahead to next flag's check 31252 LD HL,44194 ; Print "R READ SOMETHING" text... 31255 CALL 36725 ; ... *31258 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31261 BIT 4,A ; If Throw flag is not set then... 31263 JR Z,31271 ; ...skip ahead to next flag's check 31265 LD HL,44200 ; Print "Y THROW SOMETHING" text... 31268 CALL 36725 ; ... *31271 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31274 BIT 5,A ; If Cast a spell flag is not set then... 31276 JR Z,31284 ; ...skip ahead to next flag's check 31278 LD HL,44206 ; Print "S CAST A SPELL" text... 31281 CALL 36725 ; ... *31284 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31287 BIT 6,A ; If Blow flag is not set then... 31289 JR Z,31297 ; ...skip ahead to next flag's check 31291 LD HL,44214 ; Print "B BLOW SOMETHING" text... 31294 CALL 36725 ; ... *31297 LD A,(65532) ; Load A with Magic Knight's action flags part 1 31300 BIT 7,A ; If Call Lift flag is not set then... 31302 JR Z,31310 ; ...skip ahead to next flag's check 31304 LD HL,44224 ; Print "W CALL LIFT" text... 31307 CALL 36725 ; ... *31310 LD A,(65533) ; Load A with Magic Knight's action flags part 2 31313 BIT 0,A ; If Move Lift flag is not set then... 31315 JR Z,31323 ; ...skip ahead to next menu object 31317 LD HL,44234 ; Print "V MOVE LIFT" text... 31320 CALL 36725 ; ... *31323 LD HL,44159 ; Print "Z EXIT MENU" text... 31326 CALL 36725 ; ... 31329 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 31332 CP 90 ; If "Z" was pressed... 31334 JP Z,30428 ; ...reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop 31337 LD HL,41811 ; Point HL at start of string of keyboard shortcuts for commands 31340 LD B,A ; Load ASCII code of key pressed into B 31341 LD C,0 ; Set C (selected command number) to zero *31343 LD A,(HL) ; Load keyboard shortcut pointed to by HL into A 31344 CP B ; If key pressed matches currently-pointed-at shortcut... 31345 JP Z,31352 ; ...then jump ahead to #R31352 31348 INC C ; Increase C (advance to next command to check if that was selected instead) 31349 INC HL ; Advance to next entry in list of command shortcuts 31350 JR 31343 ; Loop back to #R31343 to test next command *31352 LD A,C ; Load double index of selected command into BC... 31353 ADD A,A ; ... 31354 LD B,0 ; ... 31356 LD C,A ; ... 31357 LD HL,41827 ; Point HL at table of routine start addresses for Magic Knight's main menu commands 31360 ADD HL,BC ; Add double index of selected command as offset 31361 LD A,(HL) ; Load address of appropriate command processing routine into HL... 31362 INC HL ; ... 31363 LD H,(HL) ; ... 31364 LD L,A ; ... 31365 XOR A ; Set last key pressed to null... 31366 LD (23560),A ; ... 31369 JP (HL) ; Jump to routine to process selected command ; Process Command to Examine an Object, a Character or Magic Knight c31370 CALL 38075 ; Play upward scale sound 31373 LD A,(23377) ; Set Gimbal-White-Out Safe Flag... 31376 OR 1 ; ... 31378 LD (23377),A ; ... 31381 CALL 37654 ; Display / update command summary window at bottom of screen 31384 LD DE,45897 ; Point DE at "EXAMINE" text... 31387 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 31390 LD A,16 ; Display "EXAMINE WHAT?" menu window... 31392 CALL 36979 ; ... 31395 LD HL,45899 ; Print "EXAMINE WHAT? ... O OBJECT ... C CHARACTER ... S YOURSELF" text... 31398 CALL 36725 ; ... 31401 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 31404 CP 79 ; If "O" pressed (i.e. EXAMINE OBJECT)... 31406 JP Z,31548 ; ...then skip ahead to #R31548 31409 CP 67 ; If "C" pressed (i.e. EXAMINE CHARACTER)... 31411 JP Z,31452 ; ...then skip ahead to #R31452 ; Examine Yourself 31414 LD DE,46396 ; Point DE at "YOURSELF" text... 31417 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 31420 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 31423 LD A,18 ; Draw window 18... 31425 CALL 36987 ; ... 31428 LD A,14 ; Store 14 in current character memory slot... 31430 LD (30615),A ; ...as 14 is the position of "MAGIC KNIGHT" text relative to start of characters' short names ; in common words table 31433 LD HL,46126 ; Point HL at percentage completion text 31436 LD DE,46138 ; Point DE at time left text 31439 CALL 34268 ; Insert current time and score into "TIME LEFT" and "PERCENTAGE COMPLETION" texts 31442 LD HL,25315 ; Point HL at Magic Knight's current stats 31445 XOR A ; Load 0 (index of Magic Knight Frame 1 [right] in Graphics Lookup Data table at #R42642) into ; instruction at #R31537... 31446 LD (31538),A ; ... 31449 JP 31484 ; Skip ahead to #R31484 ; Examine Character *31452 LD HL,44065 ; Point HL at "EXAMINE ?" text 31455 LD DE,0 ; Set DE to zero so Command Summary Window is not updated with additional text 31458 CALL 35141 ; Display and process input for character selection menu (current room's characters only), ; setting Current Character 31461 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 31464 LD A,18 ; Draw window 18... 31466 CALL 36987 ; ... 31469 LD A,(30615) ; Load A with index of Current (selected) Character 31472 ADD A,69 ; Add 69 to index of selected character (as 69 is index of first character in Graphics Lookup ; Data table at #R42642)... 31474 LD (31538),A ; ...and load into instruction at #R31537 31477 SUB 69 ; Subtract 69 to revert to index of character 31479 LD E,0 ; Point HL at strength of the character... 31481 CALL 34174 ; ... *31484 CALL 35837 ; Insert numeric stats (at HL) of a character into "EXAMINE CHARACTER" window text 31487 PUSH HL ; Store HL (points to start of character's current stats) 31488 LD HL,45924 ; Print Examine Character window text (i.e. "EXAMINE [CHARACTER] ... STRENGTH XX..." text)... 31491 CALL 36725 ; ... 31494 POP IX ; Restore IX (points to start of character's current stats) 31496 LD A,(IX+6) ; If character's Asleep Flag is set... 31499 BIT 7,A ; ... 31501 JP NZ,31507 ; ...then skip ahead to #R31507 31504 LD A,(IX+7) ; Load A with index of character's Current Status Text *31507 AND 127 ; Reset bit 7 of A (if character is asleep, then A holds the value from IX+6 with bit 7 set. ; Resetting bit 7 leaves 12, index of "[CHARACTER] IS ASLEEP" text) 31509 LD B,A ; ...and load into B 31510 LD HL,46116 ; Point HL at start of characters' "current status" texts 31513 CALL 34845 ; Advance HL to B-th entry in list of zero-terminated strings 31516 CALL 36725 ; Print text at HL 31519 LD A,19 ; Draw window 19... 31521 CALL 36987 ; ... 31524 LD A,(23493) ; Load C with x-coordinate of left edge of current window to draw (characters)... 31527 LD C,A ; ... 31528 LD A,(23494) ; Load B with y-coordinate of top edge of current window to draw (characters)... 31531 LD B,A ; ... 31532 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 31534 LD (23695),A ; ... ; The operand of the instruction at #R31537 represents the graphic index of the selected character. This is modified ; by the instructions at #R31446 and #R31474. 31537 LD A,0 ; Draw the selected character... 31539 CALL 29960 ; ... 31542 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 31545 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Examine Object *31548 LD IX,25395 ; Point IX at Magic Knight's inventory 31552 LD B,5 ; Load B with 5 (as there are 5 inventory slots) 31554 LD HL,45890 ; Point HL at "EXAMINE WHICH OBJECT?" text 31557 LD DE,0 ; Set DE to zero so Command Summary Window is not updated with additional text 31560 CALL 34914 ; Show list of objects (window or menu) and handle selection if a menu 31563 LD HL,25395 ; Point HL at Magic Knight's inventory 31566 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 31569 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 31572 LD A,(30467) ; Load A with index of Current Object 31575 LD E,0 ; Load E with 0 (Weight) 31577 CALL 34160 ; Point HL to weight of object A 31580 CALL 35887 ; Insert numeric / text stats of an object into "EXAMINE OBJECT" window text 31583 LD A,20 ; Draw window 20... 31585 CALL 36987 ; ... 31588 LD HL,46033 ; Print "      EXAMINE" text... 31591 CALL 36725 ; ... 31594 LD A,(30467) ; Load B with index of Current Object... 31597 LD B,A ; ... 31598 CALL 34842 ; Advance HL to B-th entry in object names table 31601 CALL 36725 ; Print the object's name 31604 LD HL,46038 ; Print " EXAMINE" text... 31607 CALL 36725 ; ... 31610 LD A,21 ; Draw window 21... 31612 CALL 36987 ; ... 31615 LD A,(23493) ; Load C with x-coordinate of left edge of current window to draw (characters)... 31618 LD C,A ; ... 31619 LD A,(23494) ; Load B with y-coordinate of top edge of current window to draw (characters)... 31622 LD B,A ; ... 31623 INC B ; Increase y-coordinate so object is drawn within the window rather than overlapping the upper ; frame 31624 LD A,(30467) ; Load A with index of Current Object 31627 CALL 38539 ; Set Terrain Interaction Data for character blocks spanned by the object and draw the object 31630 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 31633 JP 30428 ; reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Process and Execute Command to Command a Character c31636 LD A,(65532) ; Check Magic Knight's action flags... 31639 BIT 0,A ; ...and if he can't command... 31641 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 31644 CALL 38075 ; Play upward scale sound 31647 LD HL,44073 ; Point HL at "COMMAND ?" text 31650 LD DE,46402 ; Point DE at "COMMAND" text 31653 CALL 35141 ; Display and process input for character selection menu (current room's characters only), ; setting Current Character 31656 LD DE,45820 ; Point DE at "TO" text... 31659 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 31662 LD A,23 ; Display "WHICH COMMAND DO YOU WANT TO USE" (Command [CHARACTER] to...) menu window... 31664 CALL 36979 ; ... 31667 LD HL,46405 ; Print "WHICH COMMAND DO YOU WANT TO USE" + "A GO TO SLEEP ... B WAKE UP ..." etc. text... 31670 CALL 36725 ; ... 31673 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 31676 SUB 65 ; Subtract 65 (ASCII code for "A") to leave index of selected command 31678 LD (31696),A ; Set index of "Command a character" routine to jump to later 31681 LD B,A ; Copy into B 31682 CALL 34859 ; Advance HL to the B-th entry in list of option texts from "Command a character" menu 31685 EX DE,HL ; Swap DE (now points to selected command's "Command a character" menu text) and HL (now ; undefined) 31686 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 31689 LD A,(30615) ; Load A with index of Current Character [bug] 31692 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit ; The operand of the instruction at #R31695 represents the index of the "Command a Character" routine to jump to as ; stored previously. This is modified by the instruction at #R31678. 31695 LD A,0 ; Load A with index of "Command a Character" routine to jump to... 31697 ADD A,A ; ...double it (as entries are two bytes wide)... 31698 LD E,A ; ...and load it into DE... 31699 LD D,0 ; ... 31701 LD HL,31710 ; Point HL to start of "Magic Knight command a character to..." routines table 31704 ADD HL,DE ; Add offset to obtain entry of interest 31705 LD A,(HL) ; Load address at this location into HL... 31706 INC HL ; ... 31707 LD H,(HL) ; ... 31708 LD L,A ; ... 31709 JP (HL) ; ...and jump to it ; Table of Routine Addresses for Magic Knight Commanding Characters b31710 DEFW 31722 ; Go to sleep routine 31712 DEFW 31763 ; Wake up routine 31714 DEFW 31804 ; Go away routine 31716 DEFW 31842 ; Help routine 31718 DEFW 31920 ; Eat & Drink 31720 DEFW 31980 ; Be happy routine ; Send Current Character to Sleep if Possible c31722 LD A,(30615) ; Load A with index of Current Character 31725 LD E,0 ; Point HL at strength... 31727 CALL 34174 ; ...of character whose index is A 31730 PUSH HL ; Switch pointer from HL to IX... 31731 POP IX ; ... 31733 BIT 7,(IX+6) ; If "Character is Asleep" flag is set... 31737 JP NZ,34478 ; ...then display "[CHARACTER] IS ALREADY ASLEEP" window and exit 31740 LD A,(IX+2) ; Load A with stamina of Current Character... 31743 CP 70 ; ...and if this is at least 70... 31745 JP NC,34484 ; ...then display "[CHARACTER] IS TOO WAKEFUL TO SLEEP" window and exit 31748 LD A,(IX+1) ; Load A with the happiness of Current Character... 31751 CP 30 ; ...and if this is anything up to 30... 31753 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit 31756 SET 7,(IX+6) ; Set the character's "asleep flag" 31760 JP 34738 ; Display "[CHARACTER] HAS GONE TO SLEEP" window and exit ; Wake Current Character Up if Possible c31763 LD A,(30615) ; Load A with index of Current Character 31766 LD E,0 ; Point HL at strength... 31768 CALL 34174 ; ...of character whose index is A 31771 PUSH HL ; Switch pointer from HL to IX... 31772 POP IX ; ... 31774 BIT 7,(IX+6) ; If "Character is Asleep" flag is not set... 31778 JP Z,34496 ; ...then display "[CHARACTER] IS ALREADY AWAKE" window and exit 31781 LD A,(IX+2) ; Load A with stamina of Current Character... 31784 CP 30 ; ...and if this is anything up to 30... 31786 JP C,34502 ; ...then display "[CHARACTER] IS TOO TIRED TO WAKE UP" window and exit 31789 LD A,(IX+1) ; Load A with the happiness of Current Character... 31792 CP 30 ; ...and if this is anything up to 30... 31794 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit 31797 RES 7,(IX+6) ; Reset the character's "asleep flag" 31801 JP 34744 ; Display "[CHARACTER] HAS WOKEN UP" window and exit ; Make Current Character Go Away if Possible c31804 CALL 34350 ; Check if Current Character is asleep and display "[CHARACTER] IS ASLEEP" window if so 31807 LD A,(30615) ; Load A with index of Current Character 31810 LD E,0 ; Point HL at strength... 31812 CALL 34174 ; ...of character whose index is A 31815 PUSH HL ; Switch pointer from HL to IX... 31816 POP IX ; ... 31818 LD A,(IX+2) ; Load A with stamina of Current Character... 31821 CP 20 ; ...and if this is anything less than 20... 31823 JP C,34508 ; ...then display "[CHARACTER] IS TOO TIRED TO GO AWAY" window and exit 31826 LD A,(IX+1) ; Load A with the happiness of Current Character... 31829 CP 20 ; ...and if this is anything up to 20... 31831 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit 31834 CALL 34402 ; Point HL at current position data for Current Character 31837 LD (HL),99 ; Change current room number for Current Character to 99 31839 JP 34750 ; Display "[CHARACTER] HAS GONE AWAY" window ; Execute Current Character's Help Routine if Possible c31842 CALL 34350 ; Check if Current Character is asleep and display "[CHARACTER] IS ASLEEP" window if so 31845 LD A,32 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to a space (32)... 31847 LD (46710),A ; ... 31850 LD A,(30615) ; Load A with index of Current Character 31853 CP 7 ; If character is 7 (Banshee)... 31855 JR Z,31888 ; ...jump ahead to #R31888 (overriding following section, as Banshee always has zero strength) 31857 LD E,0 ; Point HL at strength... 31859 CALL 34174 ; ...of character whose index is A 31862 PUSH HL ; Switch pointer from HL to IX... 31863 POP IX ; ... 31865 LD A,(IX+5) ; Load A with character's "can help" flag 31868 OR A ; If "can help" flag is reset... 31869 JP Z,34514 ; ...then display "[CHARACTER] CANNOT HELP YOU" window and return to game 31872 LD A,(IX+2) ; Load A with stamina of Current Character... 31875 CP 10 ; ...and if this is anything up to 20... 31877 JP C,34520 ; ...then display "[CHARACTER] IS TOO TIRED TO HELP YOU" window and exit 31880 LD A,(IX+1) ; Load A with the happiness of Current Character... 31883 CP 10 ; ...and if this is anything up to 10... 31885 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit *31888 LD A,(30615) ; Load DE with double the index of the Current Character... 31891 ADD A,A ; ... 31892 LD E,A ; ... 31893 LD D,0 ; ... 31895 LD HL,31904 ; Point HL at table of help routine addresses 31898 ADD HL,DE ; ...and add double the character index to get specific entry for that character 31899 LD A,(HL) ; Load the routine's address into HL... 31900 INC HL ; ... 31901 LD H,(HL) ; ... 31902 LD L,A ; ... 31903 JP (HL) ; ...and jump to it ; Table of Start Addresses of Routines for Characters Being Commanded to Help b31904 DEFW 33808 ; Gimbal help routine 31906 DEFW 33811 ; Thor help routine 31908 DEFW 33883 ; Florin help routine 31910 DEFW 33932 ; Orik help routine 31912 DEFW 33935 ; Samsun help routine 31914 DEFW 33993 ; Elrand help routine 31916 DEFW 34062 ; Rosmar help routine 31918 DEFW 34106 ; Banshee help routine ; Make Current Character Eat & Drink if Possible c31920 CALL 34350 ; Check if Current Character is asleep and display "[CHARACTER] IS ASLEEP" window if so 31923 LD A,(30615) ; Load A with index of Current Character 31926 LD E,0 ; Point HL at strength... 31928 CALL 34174 ; ...of character whose index is A 31931 PUSH HL ; Switch pointer from HL to IX... 31932 POP IX ; ... 31934 LD A,(IX+4) ; Load A with food level of Current Character 31937 OR A ; If food level is zero... 31938 JP Z,34526 ; ...then display "[CHARACTER] HAS NO FOOD LEFT" window and exit 31941 LD A,(IX+2) ; Load A with stamina of Current Character... 31944 CP 20 ; ...and if this is anything up to 20... 31946 JP C,34532 ; ...then display "[CHARACTER] IS TOO TIRED TO EAT OR DRINK" window and exit 31949 LD A,(IX+1) ; Load A with the happiness of Current Character... 31952 CP 30 ; ...and if this is anything up to 30... 31954 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit *31957 LD A,(IX+0) ; Load A with the strength of Current Character... 31960 CP 100 ; ...and if this is equal to 100... 31962 JP Z,34756 ; ...then display "[CHARACTER] HAS TAKEN REFRESHMENT" window and exit 31965 DEC (IX+4) ; Decrease food level by one 31968 INC (IX+0) ; Increase strength by one 31971 LD A,(IX+4) ; If food level is not zero... 31974 OR A ; ... 31975 JR NZ,31957 ; ...then loop back to #R31957 31977 JP 34756 ; ...then display "[CHARACTER] HAS TAKEN REFRESHMENT" window and exit ; Make Current Character Be Happy if Possible c31980 CALL 34350 ; Check if Current Character is asleep and display "[CHARACTER] IS ASLEEP" window if so 31983 LD A,(30615) ; Load A with index of Current Character 31986 LD E,0 ; Point HL at strength... 31988 CALL 34174 ; ...of character whose index is A 31991 PUSH HL ; Switch pointer from HL to IX... 31992 POP IX ; ... 31994 LD A,(IX+2) ; Load A with stamina of Current Character... 31997 CP 30 ; ...and if this is anything up to 30... 31999 JP C,34538 ; ...then display "[CHARACTER] IS TOO TIRED TO BE HAPPY" window and exit 32002 LD A,(IX+1) ; Load A with the happiness of Current Character... 32005 CP 5 ; ...and if this is anything up to 5... 32007 JP C,34490 ; ...then display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" window and exit 32010 LD A,(30615) ; Load A with index of Current Character... 32013 LD E,A ; ...and copy into DE... 32014 LD D,0 ; ... 32016 LD HL,32027 ; Point HL to table of default happiness levels... 32019 ADD HL,DE ; ...and add character index as offset 32020 LD A,(HL) ; Load entry into A... 32021 LD (IX+1),A ; ...and set happiness of Current Character to this value 32024 JP 34762 ; Display "[CHARACTER] WILL TRY TO BE HAPPY" window ; Table of Characters' Default Happiness Levels b32027 DEFB 100 ; Gimbal's default happiness 32028 DEFB 70 ; Thor's default happiness 32029 DEFB 80 ; Florin's default happiness 32030 DEFB 40 ; Orik's default happiness 32031 DEFB 50 ; Samsun's default happiness 32032 DEFB 98 ; Elrand's default happiness 32033 DEFB 90 ; Rosmar's default happiness 32034 DEFB 0 ; Banshee's default happiness ; Process and Execute Command to Locate a Character c32035 LD A,(65532) ; If "Magic Knight Can Locate" flag is not set... 32038 BIT 1,A ; ... 32040 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 32043 CALL 38075 ; Play upward scale sound 32046 CALL 37654 ; Display / update command summary window at bottom of screen 32049 LD DE,46807 ; Point DE at "LOCATE" text... 32052 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 32055 LD HL,44078 ; Point HL at "LOCATE ?" text 32058 PUSH HL ; Store HL 32059 CALL 35293 ; Display and handle full character selection menu 32062 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 32065 LD A,22 ; Draw window 22... 32067 CALL 36987 ; ... 32070 LD A,(23493) ; Load A with x-coordinate of left-hand edge of window... 32073 ADD A,2 ; ...add 2... 32075 LD C,A ; ...and load into C 32076 LD A,(23494) ; Load A with y-coordinate of top edge of window... 32079 ADD A,3 ; ...add 3... 32081 LD B,A ; ...and load into B 32082 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 32084 LD (23695),A ; ... 32087 LD A,1 ; Draw "Locate a Character" compass... 32089 CALL 29960 ; ... 32092 LD HL,46810 ; Print "LOCATED [CHARACTER]" text... 32095 CALL 36725 ; ... 32098 CALL 34402 ; Point HL at current position data for Current Character 32101 LD DE,0 ; Set DE to zero so Command Summary Window is not updated with additional text 32104 LD A,(HL) ; Load room of Current Character 32105 OR A ; If room is zero (i.e. character is in the Lift)... 32106 JP Z,32183 ; ...then skip ahead to #R32183 32109 DEC A ; Discard floor information and set A to represent room number 0-7 (starting at zero for room ; next to Lift), i.e. room's x-coordinate... 32110 AND 7 ; ... 32112 LD B,A ; ...and load into B 32113 LD A,(65529) ; Load Magic Knight's current room into A 32116 DEC A ; Discard floor information and set A to represent room number 0-7 (starting at zero for room ; next to Lift), i.e. room's x-coordinate... 32117 AND 7 ; ... 32119 CP B ; Compare character's room x-coordinate to Magic Knight's 32120 JR Z,32131 ; If character's room and Magic Knight's room are at the same x-coordinate, then skip ahead to ; #R32131 32122 JP M,32129 ; If character's room is to the right of Magic Knight's, then skip ahead to #R32129 ; Character's room is to the left of Magic Knight's 32125 LD E,254 ; Load E with 254 (-2) 32127 JR 32131 ; Skip ahead to #R32131 *32129 LD E,2 ; Load E with 2 *32131 LD A,(HL) ; Load A with character's current room 32132 DEC A ; Decrease by one 32133 AND 248 ; Clear all but floor information (i.e. y-coordinate) 32135 LD B,A ; Load into B 32136 LD A,(65529) ; Load Magic Knight's current room into A 32139 DEC A ; Decrease by one 32140 AND 248 ; Clear all but floor information (i.e. y-coordinate) 32142 CP B ; Compare character's room y-coordinate to Magic Knight's 32143 JR Z,32154 ; If character's room and Magic Knight's room are at the same y-coordinate, then skip ahead to ; #R32154 32145 JP M,32152 ; If character's room is below Magic Knight's, then skip ahead to #R32152 ; Character's room is above Magic Knight's 32148 LD D,254 ; Load D with 254 (-2) 32150 JR 32154 ; Skip ahead to #R32154 *32152 LD D,2 ; Load D with 2 *32154 LD A,(23494) ; Load A with y-coordinate of top edge of current window to draw (characters) (typically 1) 32157 ADD A,5 ; Add 5 to y-coordinate (now pointing at top row of middle "origin" square of "locate compass") 32159 ADD A,D ; Add D (which is either +/-2 to point to top half or bottom half of "locate compass") 32160 LD H,A ; Load this y-coordinate into H 32161 LD A,(23493) ; Load A with x-coordinate of left edge of current window (typically 1) 32164 ADD A,4 ; Add 4 to y-coordinate (now pointing at left column of middle "origin" square of "locate ; compass") 32166 ADD A,E ; Add E (which is either +/-2 to point to left half or right half of "locate compass") 32167 LD L,A ; Load x-coordinate into L *32168 LD (23462),HL ; Store HL at 23462 32171 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 32174 LD HL,0 ; Set word at 23462 to zero... 32177 LD (23462),HL ; ... 32180 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop *32183 LD HL,46815 ; Print "IN THE LIFT" text... 32186 CALL 36725 ; ... 32189 LD HL,1539 ; Set H to 6 and L to 3 (as Lift is always left of Magic Knight's current room when he's not in ; the Lift!) 32192 JR 32168 ; Skip back to display the compass ; Process and Execute Command to Teleport c32194 LD A,(65532) ; If "Magic Knight Can Teleport" flag is not set then... 32197 BIT 2,A ; ... 32199 JP Z,27189 ; ...jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus or ; execute other command) 32202 CALL 38075 ; Play upward scale sound 32205 CALL 37654 ; Display / update command summary window at bottom of screen 32208 LD DE,50346 ; Point DE at "TELEPORT" text... 32211 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 32214 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 32217 LD A,(25611) ; Get current location (room) of Teleport Pad... 32220 CP 99 ; ...and if this is set to 99... 32222 JP Z,34584 ; ...Display "IT IS NOT SAFE TO TELEPORT TRY AGAIN LATER" window and exit 32225 LD HL,25611 ; Point HL to current position data of Teleport Pad 32228 LD A,(HL) ; Load A with current location (room) of Teleport Pad... 32229 LD (65529),A ; ...then update Magic Knight's current room to match 32232 INC HL ; Advance HL to x-coordinate of Teleport Pad... 32233 LD A,(HL) ; ...and load this into A 32234 ADD A,A ; Multiply x-coordinate by eight... 32235 ADD A,A ; ... 32236 ADD A,A ; ... 32237 LD (25387),A ; ...and update Magic Knight's current x-coordinate to match 32240 INC HL ; Advance HL to y-coordinate of Teleport Pad... 32241 LD A,(HL) ; ...and load this into A 32242 SUB 3 ; Subtract three (because Magic Knight is four character blocks tall)... 32244 ADD A,A ; ...then multiply by eight... 32245 ADD A,A ; ... 32246 ADD A,A ; ... 32247 LD (25388),A ; ...then update Magic Knight's current y-coordinate to match 32250 LD A,1 ; Set "Animate Magic Knight's Puff of Smoke Appearance on Next Room Redraw" flag... 32252 LD (23505),A ; ... 32255 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Process and Execute Command to Read an Object c32258 LD A,(65532) ; If "Magic Knight Can Read" flag is not set... 32261 BIT 3,A ; ... 32263 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 32266 CALL 38075 ; Play upward scale sound 32269 LD IX,25395 ; Point IX at start of Magic Knight's inventory 32273 LD B,5 ; Load B with 5 (as there are five inventory slots) 32275 LD HL,47288 ; Point HL at "READ WHICH OBJECT?" text 32278 LD DE,47295 ; Point DE at "READ" text 32281 CALL 34914 ; Show list of objects (window or menu) and handle selection if a menu 32284 LD HL,25395 ; Point HL at Magic Knight's inventory 32287 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 32290 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 32293 LD A,(30467) ; Load A with index of Current Object 32296 CP 41 ; If Current Object is 41 (Instruction Book)... 32298 JP Z,32384 ; ...then display instructions 32301 CP 1 ; If Current Object is not 1 (Ancient Scroll)... 32303 JR NZ,32326 ; ...then skip ahead to #R32326 32305 LD A,(23467) ; If the Engraved Candle is not lit... 32308 BIT 1,A ; ... 32310 JP Z,32361 ; ...then skip ahead to #R32361 (display normal read-text) 32313 LD A,33 ; Load A with index of object 33 (Engraved Candle) 32315 CALL 34256 ; Check whether Magic Knight is carrying the Engraved Candle... 32318 JP NZ,32361 ; ...and if not, skip to #R32361 (display normal read-text) 32321 LD B,8 ; Set text index to 8 (full Ancient Scroll text) 32323 JP 32378 ; Point HL at this text, then return *32326 CP 33 ; If Current Object is not 33 (Engraved Candle)... 32328 JP NZ,32344 ; ... then skip ahead to #R32344 32331 LD A,14 ; Load A with index of object 14 (Broken Glass) 32333 CALL 34256 ; Check whether Magic Knight is carrying the Broken Glass... 32336 JP NZ,32361 ; ...and if not, skip to #R32361 32339 LD B,9 ; Set text index to 9 (Engraved Candle text) 32341 JP 32378 ; Point HL at this text, then return *32344 CP 13 ; If Current Object is not 13 (Runestone)... 32346 JR NZ,32361 ; ...then skip ahead to #R32361 32348 LD A,15 ; Load A with index of object 15 (Book of Runes) 32350 CALL 34256 ; Check whether Magic Knight is carrying the Book of Runes... 32353 JP NZ,32361 ; ...and if not, skip to #R32361 32356 LD B,10 ; Set text index to 10 (full Runestone text) 32358 JP 32378 ; Point HL at this text, then return *32361 LD A,(30467) ; Load A with index of Current Object 32364 LD E,2 ; Load E with 2 (Read text) 32366 CALL 34160 ; Point HL to read text property of object A 32369 BIT 7,(HL) ; If bit 7 is reset (i.e. value at HL is less than 128 so the object can't be read)... 32371 JP Z,34576 ; ...then jump to #R34576 (display "THERE IS NO WRITING FOR ME TO READ" window and return to ; game) 32374 LD A,(HL) ; Load value into B... 32375 AND 127 ; ...resetting bit 7 to leave index of text required... 32377 LD B,A ; ... *32378 CALL 34854 ; Advance HL to B-th entry in list of readable objects' texts at 47322 then return 32381 JP 34799 ; Display window showing read-text window *32384 CALL 26788 ; Display instructions 32387 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Process and Execute Command to Throw an Object c32390 LD A,(65532) ; If "Magic Knight Can Throw" flag is not set... 32393 BIT 4,A ; ... 32395 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 32398 CALL 38075 ; Play upward scale sound 32401 LD A,(23377) ; Set Gimbal-White-Out Safe Flag... 32404 OR 1 ; ... 32406 LD (23377),A ; ... 32409 LD IX,25395 ; Point IX at Magic Knight's inventory 32413 LD B,5 ; Load B with 5 (as 5 inventory slots) 32415 LD HL,50381 ; Point HL at "THROW WHICH OBJECT" text 32418 LD DE,50388 ; Point DE at "THROW" text 32421 CALL 34914 ; Show list of objects (window or menu) and handle selection if a menu 32424 LD HL,25395 ; Point HL at Magic Knight's inventory 32427 CALL 34864 ; Point DE at name of a selected object in object names table and print in command summary ; window 32430 LD DE,50391 ; Point DE at "AT" text... 32433 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 32436 LD HL,44083 ; Point HL at "THROW AN OBJECT AT ?" text 32439 LD DE,0 ; Set DE to zero so Command Summary Window is not updated with additional text 32442 CALL 35141 ; Display and process input for character selection menu (current room's characters only), ; setting Current Character 32445 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 32448 LD A,(30467) ; Load A with index of Current Object 32451 LD E,0 ; Load E with 0 (Weight) 32453 CALL 34160 ; Point HL to weight of object A 32456 PUSH HL ; Copy HL... 32457 POP IX ; ...into IX 32459 LD A,(IX+0) ; Load A with object's weight 32462 CP 12 ; If object has weight greater than 12... 32464 JP NC,32643 ; ...then kill Magic Knight and end game 32467 BIT 4,(IX+4) ; If bit 4 (object is lethal if thrown) of object's use status is set... 32471 JP NZ,32649 ; ...then kill the character who object was thrown at and end game 32474 BIT 5,(IX+4) ; If bit 5 (object is a crystal) of object's use status is not set... 32478 JR Z,32487 ; ...then skip ahead to #R32487 32480 LD A,(30615) ; If target of throw is Gimbal... 32483 OR A ; ... 32484 JP Z,32555 ; ...then skip ahead to #R32555 *32487 LD A,(30467) ; If object thrown is not the Glowing Bottle... 32490 CP 16 ; ... 32492 JP NZ,32499 ; ...then skip ahead to #R32499 32495 CALL 30540 ; Remove Glowing Bottle from Magic Knight's inventory, smash it and release Banshee 32498 LD A,C ; Load index of Broken Glass into A (Current Object) *32499 LD C,A ; Load index of Current Object into C 32500 PUSH BC ; Store BC (C=Current Object) 32501 LD B,5 ; Load B with 5 32503 LD HL,25395 ; Point HL at Magic Knight's inventory 32506 CALL 38674 ; Remove object C from Magic Knight's inventory (and tidy up remainder of slots) 32509 POP BC ; Restore BC (C=Current Object) 32510 LD A,C ; Copy index of Current Object into A... 32511 ADD A,A ; ...and multiply by three... 32512 ADD A,C ; ... 32513 LD C,A ; Transfer into BC... 32514 LD B,0 ; ... 32516 LD HL,25464 ; Point HL to Objects' Current Positions Table 32519 ADD HL,BC ; Add three times Current Object's index as offset 32520 LD A,(65529) ; Set object's room to be Magic Knight's current room... 32523 LD (HL),A ; ... 32524 INC HL ; Advance HL to object's x-coordinate 32525 PUSH HL ; Store HL (pointer to x-coordinate) 32526 LD A,(30615) ; Load BC with three times index of character who was target of throw... 32529 LD C,A ; ... 32530 ADD A,A ; ... 32531 ADD A,C ; ... 32532 LD B,0 ; ... 32534 LD C,A ; ... 32535 LD HL,25441 ; Point HL at x-coordinate of first entry in characters' current positions table 32538 ADD HL,BC ; Add BC (three times character index) as offset 32539 EX DE,HL ; Swap DE (now pointer to Current Character's x-coordinate) and HL (now undefined) 32540 POP HL ; Restore HL (pointer to object's x-coordinate) 32541 LD A,(DE) ; Copy character's x-coordinate... 32542 LD (HL),A ; ...into object's x-coordinate 32543 INC DE ; Advance to character's y-coordinate 32544 INC HL ; Advance to object's y-coordinate 32545 LD A,(DE) ; Copy character's y-coordinate plus three... 32546 ADD A,3 ; ... 32548 LD (HL),A ; ...into object's y-coordinate 32549 CALL 35495 ; Set Magic Knight's available action flags 32552 JP 34724 ; Display "THE [OBJECT] LANDED ON THE FLOOR BY [CHARACTER]" window and return to game *32555 LD A,(23378) ; If "Crystallium Spectralis cast" score flag is not set... 32558 AND 1 ; ... 32560 JP Z,34700 ; ...then display "YOU HEAR A SHORT-RANGE TELEPATHIC WHISPER..." message and return to game 32563 LD A,(30467) ; Load A with index of Current Object 32566 LD B,223 ; Set Blue and Red Crystal Flags, reset Green Crystal Flag in mask 32568 CP 21 ; If object is the Green Crystal... 32570 JR Z,32580 ; ...then skip ahead to #R32580 32572 LD B,239 ; Set Green and Blue Crystal Flags, reset Red Crystal Flag in mask 32574 CP 23 ; If object is the Red Crystal... 32576 JR Z,32580 ; ...then skip ahead to #R32580 32578 LD B,247 ; Set Green and Red Crystal Flags, reset Blue Crystal Flag in mask *32580 LD A,(29939) ; Load Gimbal's current attribute into A... 32583 AND B ; ...apply mask... 32584 LD (29939),A ; ...and store again 32587 PUSH AF ; Store AF (A=Gimbal's current attribute) 32588 LD A,(30467) ; Load C with index of Current Object... 32591 LD C,A ; ... 32592 LD B,5 ; Load B with 5 as there are 5 inventory slots 32594 LD HL,25395 ; Point HL at Magic Knight's inventory 32597 CALL 38674 ; Remove Current Object from Magic Knight's inventory and tidy up slots 32600 POP AF ; Restore AF (A=current R, G and B Crystal Flags) 32601 CP 71 ; If R, G and B PAPER bits of Gimbal's attribute are not all reset... 32603 JR NZ,32624 ; ...skip ahead to #R32624 32605 LD A,(23468) ; Set Gimbal is Free game progress flag... 32608 OR 1 ; ... 32610 LD (23468),A ; ... 32613 LD A,11 ; Set Gimbal's "Examine Character" descriptive text to... 32615 LD (25330),A ; ... 32618 CALL 33278 ; Flash border and screen (as in cast a spell) 32621 JP 34646 ; Display "SUCCESS! GIMBAL IS FREE AT LAST!" window and return to game *32624 CALL 33278 ; Flash border and screen (as in cast a spell) 32627 LD A,(30467) ; Load A with index of Current Object 32630 CP 22 ; If object is the Blue Crystal... 32632 JP Z,34706 ; ...then display "THE BLUE CRYSTAL FLEW AT GIMBAL AND BURST..." window and return to game 32635 CP 23 ; If object is the Red Crystal... 32637 JP Z,34712 ; ...then display "THE RED CRYSTAL FLEW STRAIGHT AT GIMBAL AND TURNED INTO A GAS..." window and ; return to game 32640 JP 34718 ; Display "THE GREEN CRYSTAL FLEW AT GIMBAL AND SUCKED..." window and return to game *32643 LD HL,43504 ; Point HL at "YOU KILLED YOURSELF TRYING TO THROW SOMETHING AT [CHARACTER]" text 32646 JP 35101 ; Jump to "Game over" window routine and exit *32649 LD HL,43539 ; Point HL at "YOU THREW SOMETHING AND KILLED [CHARACTER]" text 32652 JP 35101 ; Jump to "Game over" window routine and exit ; Process and Execute Command to Cast a Spell c32655 LD A,(65532) ; If "Magic Knight Can Cast a Spell" flag is not set... 32658 BIT 5,A ; ... 32660 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 32663 CALL 38075 ; Play upward scale sound 32666 CALL 37654 ; Display / update command summary window at bottom of screen 32669 LD DE,49377 ; Point DE at "CAST A SPELL" text... 32672 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 32675 LD HL,49383 ; Point HL at byte before "WHICH SPELL DO YOU WANT TO CAST?" full menu text 32678 LD A,(HL) ; Load data into position of right edge of window data for "Cast a Spell" window... 32679 LD (42117),A ; ... 32682 INC HL ; Advance HL to start of actual text 32683 PUSH HL ; Store HL (pointer to menu text) 32684 LD A,30 ; Draw the "Cast a Spell" window... 32686 CALL 36979 ; ... 32689 POP HL ; Restore HL (pointer to menu text) 32690 CALL 36725 ; Print the text 32693 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 32696 SUB 65 ; Subtract ASCII value of "A" to get numeric index of option selected 32698 LD (32726),A ; Store index of spell selected in this routine at #R32725 32701 CP 4 ; If spell number 4 (Project Physical Body) is selected... 32703 JR Z,32725 ; ...then skip ahead to #R32725 (as command summary window shows "PROJECT PHYSICAL BODY TO..." ; rather than "CAST..." as with all other spells) 32705 CALL 37654 ; Display / update command summary window at bottom of screen 32708 LD HL,50184 ; Point HL at "CAST CRYSTALLIUM SPECTRALIS" text (i.e. first in list of "CAST [SPELL]" strings) 32711 LD A,(32726) ; Load index of spell selected into B... 32714 LD B,A ; ... 32715 CALL 34845 ; Advance HL to B-th entry in list of zero-terminated strings 32718 EX DE,HL ; Swap DE (now points to "CAST [SPELL]" text) and HL (now points to "CAST A SPELL" text) 32719 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 32722 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit ; The operand of the instruction at #R32725 represents the index of the spell to cast. This is modified by the ; instruction at #R32698. *32725 LD A,0 ; Load A with index of spell to cast 32727 OR A ; If spell is Crystallium Spectralis... 32728 JP Z,32764 ; ...then cast Crystallium Spectralis if possible, else display failure message 32731 CP 1 ; If spell is Candelium Illuminatus... 32733 JP Z,32823 ; ...then jump to #R32823 32736 CP 2 ; If spell is Armouris Photonicus... 32738 JP Z,32903 ; ...then jump to #R32903 32741 CP 3 ; If spell is Fumaticus Protectium... 32743 JP Z,32982 ; ...then jump to #R32982 32746 CP 4 ; If spell is Project Physical Body... 32748 JP Z,33036 ; ...then jump to #R33036 32751 CP 5 ; If spell is Release Spell... 32753 JP Z,33129 ; ...then jump to #R33129 32756 CP 6 ; If spell is Quiticus Gamus... 32758 JP Z,33269 ; ...then jump to #R33269 32761 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Cast Crystallium Spectralis if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c32764 LD A,(23468) ; If "Gimbal is free" flag is set... 32767 BIT 0,A ; ... 32769 JP NZ,34664 ; ...then display "GIMBAL IS ALREADY FREE..." window and exit 32772 LD A,(65529) ; ...else load A with Magic Knight's current room 32775 LD B,A ; Copy into B 32776 LD A,(25440) ; Load A with Gimbal's current room 32779 CP B ; Check if Gimbal and Magic Knight are in the same room... 32780 JP NZ,34634 ; ...and if they aren't then display "THAT SPELL CANNOT YET BE CAST..." window and exit 32783 LD A,(25449) ; Load A with Orik's current room 32786 CP B ; Check if Orik and Magic Knight are in the same room... 32787 JP NZ,34634 ; ...and if they aren't then display "THAT SPELL CANNOT YET BE CAST..." window and exit 32790 LD A,6 ; Load A with 6 (index for Crystal Ball) 32792 LD HL,25415 ; Point HL at Orik's current inventory 32795 CALL 34259 ; If Orik is not carrying the Crystal Ball then... 32798 JP NZ,34634 ; ...display "THAT SPELL CANNOT YET BE CAST..." window and exit 32801 LD A,32 ; Load A with index of object 32 (White Gold Ring) 32803 CALL 34256 ; Check whether Magic Knight is carrying the White Gold Ring... 32806 JP NZ,34634 ; ...and if not, display "THAT SPELL CANNOT YET BE CAST..." window and exit 32809 CALL 33278 ; Flash border and screen (as in cast a spell) 32812 LD A,(23378) ; Set bit 0 of score progress flags... 32815 OR 1 ; ... 32817 LD (23378),A ; ... 32820 JP 34640 ; Display "THE SPELL HAS WORKED! GIMBAL IS NEARLY FREE" window and return to game ; Cast Candelium Illuminatus if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c32823 LD A,(23467) ; If Engraved Candle is lit (i.e. Candelium Illuminatus has been cast)... 32826 BIT 1,A ; ... 32828 JP NZ,34670 ; ...then display "THE CANDLE IS ALREADY ALIGHT" message and exit 32831 LD A,(25545) ; Load A with the current screen containing the Four Leaf Clover 32834 LD C,A ; Copy into C 32835 LD A,(65529) ; Load A with Magic Knight's current room... 32838 CP C ; ...and if Magic Knight is not in the same room as the Four Leaf Clover... 32839 JP NZ,34634 ; ...then display "THAT SPELL CANNOT YET BE CAST..." window and exit 32842 LD A,33 ; Load A with index of object 33 (Engraved Candle) 32844 CALL 34256 ; Check whether Magic Knight is carrying the Engraved Candle... 32847 JP NZ,34634 ; ...and if not, display "THAT SPELL CANNOT YET BE CAST..." window and exit 32850 CALL 33278 ; Flash border and screen (as in cast a spell) 32853 LD A,47 ; Load A with index of object 47 (Shield) 32855 CALL 34256 ; Check whether Magic Knight is carrying the Shield... 32858 JR NZ,32876 ; ...and if not then kill Magic Knight with exploding candle, exiting to Game Over routine... 32860 LD HL,23467 ; ...else... 32863 SET 1,(HL) ; ...set the "Engraved Candle lit" flag 32865 LD A,(23378) ; Set bit 1 of score progress flags... 32868 OR 2 ; ... 32870 LD (23378),A ; ... 32873 JP 34652 ; Display "WELL DONE, THE CANDLE IS NOW GLOWING..." window and return to game ; Kill Magic Knight with Exploding Candle ; ; Used by the routine at #R32823. c32876 LD HL,49505 ; Load number of rows spanned by "BOOM! THE CANDLE BLEW UP..." text into A... 32879 LD A,(HL) ; ... 32880 LD (42157),A ; ...and adjust height of window 35 accordingly 32883 INC HL ; Advance HL to start of actual text 32884 LD A,35 ; Prepare to draw window 35 32886 PUSH HL ; Store HL (pointer to text) 32887 CALL 36987 ; Draw window 35 32890 POP HL ; Restore HL (pointer to text) 32891 CALL 36725 ; Print the text in the window 32894 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 32897 LD HL,50168 ; Point HL at "YOU BLEW YOURSELF UP" text 32900 JP 35101 ; Jump to "Game over" window routine and exit ; Cast Armouris Photonicus if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c32903 LD A,(23467) ; If "Armouris Photonicus cast" flag is set... 32906 BIT 2,A ; ... 32908 JP NZ,34676 ; ...then display "YOUR ARMOUR IS ALREADY GLOWING" message and return to game 32911 LD A,(65529) ; Else load Magic Knight's current room into B... 32914 LD B,A ; ... 32915 LD A,(25566) ; Load current room of Strange Liquid into A 32918 CP B ; If the rooms are different... 32919 JP NZ,34634 ; ...then display "THAT SPELL CANNOT YET BE CAST..." message and return to game 32922 CALL 34385 ; Load Magic Knight's coordinates (in characters) into DE 32925 LD A,(25568) ; Compare y-coordinates of Magic Knight and Strange Liquid... 32928 CP D ; ... 32929 JP NZ,34634 ; ...and if they are different then display "THAT SPELL CANNOT YET BE CAST..." message and ; return to game 32932 LD A,(25567) ; Compare x-coordinates of Magic Knight and Strange Liquid... 32935 DEC A ; ... 32936 CP E ; ... 32937 JR Z,32950 ; ...and if x-coordinate of Strange Liquid is one more than Magic Knight's x-coordinate then ; skip ahead to #R32950 32939 INC A ; If x-coordinate of Strange Liquid is the same as Magic Knight's x-coordinate... 32940 CP E ; ... 32941 JR Z,32950 ; ...then skip ahead to #R32950 32943 INC A ; If x-coordinate of Strange Liquid is one less than Magic Knight's x-coordinate... 32944 CP E ; ... 32945 JR Z,32950 ; ...then skip ahead to #R32950 32947 JP 34634 ; Display "THAT SPELL CANNOT YET BE CAST..." message and return to game *32950 LD HL,23467 ; Set "Armouris Photonicus cast" flag... 32953 SET 2,(HL) ; ... 32955 CALL 33278 ; Flash border and screen (as in cast a spell) 32958 LD A,(23378) ; Set bit 2 of score progress flags... 32961 OR 4 ; ... 32963 LD (23378),A ; ... 32966 LD A,99 ; Set room of Strange Liquid to 99 (i.e. remove it from the game)... 32968 LD (25566),A ; ... 32971 LD A,71 ; Load A with 71 (white INK, black PAPER, BRIGHT)... 32973 LD (42360),A ; ...and apply this attribute to Broken Glass... 32976 LD (42640),A ; ...and Teleport Pad 32979 JP 34658 ; Display "THE LIQUID TURNED INTO A VAPOUR..." window and return to game ; Cast Fumaticus Protectium if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c32982 LD A,(23468) ; If "Fumaticus Protectium cast" flag is set then... 32985 BIT 1,A ; ... 32987 JP NZ,34682 ; Jump to #R34682 32990 LD A,(23404) ; Load current time left (hours) into A 32993 CP 48 ; Compare to 48 32995 JP Z,34634 ; If time left is 48 hours, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 32998 LD A,46 ; Load A with index of object 46 (Power-Pong Plant) 33000 CALL 34256 ; Check whether Magic Knight is holding the Power-Pong Plant... 33003 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33006 LD A,19 ; Load A with index of object 19 (Red Herring) 33008 CALL 34256 ; Check whether Magic Knight is holding the Red Herring... 33011 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33014 CALL 33278 ; Flash border and screen (cast spell effect) 33017 LD A,(23468) ; Set "Fumaticus Protectium has been cast" flag... 33020 SET 1,A ; ... 33022 LD (23468),A ; ... 33025 LD A,(23378) ; Set bit 3 of score progress flags... 33028 OR 8 ; ... 33030 LD (23378),A ; ... 33033 JP 34688 ; Display Fumaticus Protectium successful window ; Cast Project Physical Body if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c33036 CALL 37654 ; Display / update command summary window at bottom of screen 33039 LD DE,50200 ; Point DE at "PROJECT PHYSICAL BODY TO" text... 33042 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 33045 LD HL,44092 ; Point HL at "TRAVEL TO ?" text 33048 PUSH HL ; Store HL 33049 CALL 35293 ; Display and handle full character selection menu 33052 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 33055 LD A,6 ; Load A with index of object 6 (Crystal Ball) 33057 CALL 34256 ; Check whether Magic Knight is holding the Crystal Ball... 33060 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33063 LD A,12 ; Load A with index of object 12 (Magic Talisman) 33065 CALL 34256 ; Check whether Magic Knight is holding the Magic Talisman... 33068 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33071 LD A,(30615) ; Load A with index of Current Character... 33074 LD B,A ; ...and copy into B 33075 ADD A,A ; Multiply index by three... 33076 ADD A,B ; ... 33077 LD B,0 ; ...and load into BC... 33079 LD C,A ; ... 33080 LD HL,25440 ; Point HL at characters' current locations table 33083 ADD HL,BC ; Add three times index of Current Character as offset to this address (as entries are three ; bytes wide) 33084 LD A,(65529) ; If Magic Knight's current room... 33087 CP (HL) ; ...is the same as the Current Character's current room... 33088 JP Z,34634 ; ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game 33091 LD A,(HL) ; If Current Character's room is set to 99... 33092 CP 99 ; ... 33094 JP Z,34634 ; ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game 33097 CP 100 ; If Current Character's room is set to 100... 33099 JP Z,34634 ; ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game 33102 LD (65529),A ; Make Magic Knight's current room same as that for Current Character 33105 INC HL ; Advance to next byte 33106 LD A,(HL) ; Load Current Character's x-coordinate into A 33107 INC A ; Add two... 33108 INC A ; ... 33109 ADD A,A ; ...and multiply by eight... 33110 ADD A,A ; ... 33111 ADD A,A ; ... 33112 LD (25387),A ; ...and set as Magic Knight's x-coordinate 33115 INC HL ; Advance to next byte 33116 LD A,(HL) ; Load Current Character's y-coordinate into A 33117 ADD A,A ; Multiply this by eight... 33118 ADD A,A ; ... 33119 ADD A,A ; ... 33120 LD (25388),A ; ...and set as Magic Knight's y-coordinate 33123 CALL 33278 ; Flash border and screen (as in cast a spell) 33126 JP 34694 ; Display Project Physical Body successful window and return to game ; Cast Release Spell if Possible, else Display Failure Message ; ; Used by the routine at #R32655. c33129 LD A,(23378) ; If any of Crystallium Spectralis, Candelium Illuminatus, Armouris Photonicus or Fumaticus ; Protectium have not been cast... 33132 CP 15 ; ... 33134 JP NZ,34634 ; ...then display "THAT SPELL CANNOT YET BE CAST" message and return to game 33137 LD A,(23468) ; If Gimbal is not free... 33140 AND 1 ; ... 33142 JP Z,34634 ; ...then display "THAT SPELL CANNOT YET BE CAST" message and return to game 33145 LD A,12 ; Load A with index of object 12 (Magic Talisman) 33147 CALL 34256 ; Check whether Magic Knight is holding the Magic Talisman... 33150 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33153 LD A,32 ; Load A with index of object 32 (White Gold Ring) 33155 CALL 34256 ; Check whether Magic Knight is holding the White Gold Ring... 33158 JP NZ,34634 ; ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit 33161 LD A,(23378) ; Set bit 4 of score progress flags... 33164 OR 16 ; ... 33166 LD (23378),A ; ... 33169 CALL 33278 ; Flash border and screen (as in cast a spell) 33172 LD A,30 ; Display "GIMBAL WILL NOW SEND EACH CHARACTER BACK TO THEIR HOMES..." window... 33174 LD HL,50213 ; ... 33177 JP 34768 ; ...and return to game ; Show "WELL DONE MAGIC KNIGHT" Screen with Animated Starfield, Jumping to Game Over on Key-Press ; ; Used by the routine at #R33312. c33180 IM 1 ; Set interrupt mode 1 33182 LD A,(23506) ; Increase "characters sent home" score... 33185 INC A ; ... 33186 LD (23506),A ; ... 33189 CALL 33278 ; Flash border and screen (as in cast a spell) 33192 LD A,36 ; Draw window 36... 33194 CALL 36987 ; ... 33197 LD HL,43663 ; Print "WELL DONE MAGIC KNIGHT..." text... 33200 CALL 36725 ; ... 33203 LD HL,16384 ; Blank out top two thirds of Display File... 33206 LD DE,16385 ; ... 33209 LD BC,4095 ; ... 33212 LD (HL),L ; ... 33213 LDIR ; ... 33215 LD A,71 ; Load system variable ATTR T with 71 (white INK, black PAPER, BRIGHT)... 33217 LD (23695),A ; ... 33220 LD (23693),A ; ...and flood top two thirds of Attribute File with this attribute... 33223 LD HL,22528 ; ... 33226 LD DE,22529 ; ... 33229 LD BC,511 ; ... 33232 LD (HL),A ; ... 33233 LDIR ; ... 33235 LD HL,0 ; Set Magic Knight's x- and y-velocities to zero... 33238 LD (25391),HL ; ... 33241 LD HL,19320 ; Set Magic Knight's x-coordinate to 120 and y-coordinate to 75... 33244 LD (25387),HL ; ... 33247 XOR A ; Set Magic Knight's current frame to erase to zero (frame 0 is blank graphic data) so Magic ; Knight is drawn but not erased... 33248 LD (25389),A ; ... 33251 LD A,1 ; Set Magic Knight's current frame to 1... 33253 LD (25390),A ; ... 33256 XOR A ; Set A to zero (Magic Knight) and... 33257 CALL 39224 ; ...draw Magic Knight (erase old frame and draw new frame) 33260 CALL 38884 ; Animate starfield until a key is pressed 33263 LD HL,43789 ; Point HL at "YOU HAVE SUCCEEDED IN YOUR TASK..." text 33266 JP 35101 ; Jump to "Game over" window routine and exit ; Cast Quiticus Gamus Spell and Jump to Game Over ; ; Used by the routine at #R32655. c33269 CALL 33278 ; Flash border and make sound 33272 LD HL,43559 ; Index of "Quiticus Gamus" game over text 33275 JP 35101 ; Jump to "Game over" window routine and exit ; Flash Border and Screen (as in Cast a Spell) ; ; Used by the routines at #R32390, #R32764, #R32823, #R32903, #R32982, #R33036, #R33129, #R33180, #R33269 and ; #R33312. c33278 LD B,96 ; Load B with 96 (number of times to repeat routine) *33280 LD DE,608 ; Load DE with 608 (number of bytes to modify - i.e. top 19 rows) 33283 LD HL,22528 ; Point HL at start of Attribute File *33286 LD A,(HL) ; Load attribute byte into A 33287 AND 248 ; Clear three lowest bits (i.e. INK colour) preserving only PAPER, BRIGHT and FLASH bits 33289 LD C,A ; Place modified value into C 33290 LD A,(HL) ; Get original attribute from screen again 33291 INC A ; Increase by one 33292 AND 7 ; Clear all bits except the lowest three (i.e. INK colour) 33294 OUT (254),A ; Set border colour to A 33296 OR C ; Combine other bits back in 33297 OUT (254),A ; Update border / speaker state 33299 LD (HL),A ; Load modified value back into Attribute File 33300 INC HL ; Move to next byte in Attribute File 33301 DEC DE ; Reduce DE (reducing number of attribute bytes left to modify) 33302 LD A,D ; If DE is not zero (i.e. there are more attribute bytes to modify)... 33303 OR E ; ... 33304 JR NZ,33286 ; ...then loop back to #R33286 33306 DJNZ 33280 ; Loop back for another pass 33308 XOR A ; Set A to zero 33309 OUT (254),A ; Reset border to black and reset speaker state 33311 RET ; Return ; Process Command to Blow an Object c33312 LD A,(65532) ; Load Magic Knight's current action flags into A 33315 BIT 6,A ; If "Magic Knight Can Blow" flag is unset... 33317 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 33320 CALL 38075 ; Play upward scale sound 33323 LD IX,25395 ; Point IX at Magic Knight's current inventory 33327 LD B,5 ; Set B to 5 (as there are 5 inventory slots) 33329 LD HL,50891 ; Point HL at "BLOW WHICH OBJECT?" text 33332 LD DE,50902 ; Point DE at "BLOW" text 33335 CALL 34914 ; Display list of objects in Magic Knight's inventory and wait for one to be selected. Load its ; index into A 33338 LD HL,25395 ; Point DE at name of a selected object in object names table and print in command summary ; window... 33341 CALL 34864 ; ... 33344 LD A,(30467) ; If selected object is not the Elf Horn... 33347 CP 38 ; ... 33349 JP NZ,33574 ; ...then confirm and process blow command (create dust or racket!) then return to game 33352 SET 2,(IY+65) ; Set "Characters Can't Move" flag 33356 CALL 37654 ; Display / update command summary window at bottom of screen 33359 LD DE,50909 ; Point DE at "SUMMON" text... 33362 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 33365 LD HL,44069 ; Point HL at "SUMMON ?" text... 33368 PUSH HL ; ...and store 33369 CALL 35293 ; Display and handle full character selection menu 33372 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 33375 CALL 34402 ; Point HL at current position data for Current Character 33378 LD A,(65529) ; Load Magic Knight's current room into A 33381 CP (HL) ; If character is in the same room as Magic Knight... 33382 JP Z,34616 ; ...then display "[CHARACTER] IS ALREADY HERE!" message and return to game 33385 LD A,(HL) ; Load character's current room into A 33386 LD HL,51173 ; Point HL at "[CHARACTER] IS NO LONGER AROUND" text 33389 CP 100 ; If character's current room is 100... 33391 JP Z,34808 ; ...then display "[CHARACTER] IS NO LONGER AROUND" window then return to game 33394 LD A,(30615) ; Load A with index of Current Character 33397 CP 7 ; If character is The Banshee... 33399 JR Z,33435 ; ...skip over asleep / tiredness check as Banshee never sleeps or gets tired 33401 LD A,(30615) ; Load A with index of Current Character 33404 LD E,0 ; Point HL at property 0 (strength) of character... 33406 CALL 34174 ; ... 33409 PUSH HL ; Copy location from HL to IX... 33410 POP IX ; ... 33412 BIT 7,(IX+6) ; If character is asleep (bit 7 of the byte 6 bytes forward)... 33416 JP NZ,34598 ; ...then display "[CHARACTER] IS ASLEEP" message and return to game 33419 LD A,(IX+1) ; Load A with happiness of Current Character 33422 CP 40 ; If happiness is less than 40... 33424 JP C,34604 ; ... 33427 LD A,(IX+2) ; ...then display "[CHARACTER] DOES NOT WANT TO BE SUMMONED" message and return to game 33430 CP 30 ; If happiness is less than 30... 33432 JP C,34610 ; ...then display "[CHARACTER] IS TOO TIRED TO BE SUMMONED" message and return to game *33435 CALL 34402 ; Point HL at current position data for Current Character 33438 PUSH HL ; Store HL 33439 PUSH IX ; Store IX 33441 LD A,(65529) ; Load Magic Knight's current room into C... 33444 LD C,A ; ... 33445 LD A,(30615) ; Load B with index of Current Character... 33448 LD B,A ; ... 33449 CALL 36327 ; Assign a slot in room C to character B and get x- and y-coordinates in BC 33452 POP IX ; Restore IX 33454 POP HL ; Restore HL 33455 CP 4 ; If assigned slot number is 4 (i.e. already three characters in this room)... 33457 JP Z,34622 ; ...then display "[CHARACTER] DOES NOT WANT TO COME TO SUCH A CROWDED ROOM" message and return ; to game 33460 PUSH HL ; Store HL (current position data for Current Character) 33461 INC HL ; Load x-coordinate of character into C... 33462 LD (HL),C ; ... 33463 INC HL ; Load y-coordinate of character into B... 33464 LD (HL),B ; ... 33465 POP HL ; Restore HL (start of current position data for Current Character) 33466 LD A,(65529) ; Load Magic Knight's current room into A 33469 OR 128 ; Set bit 7 of room index data if it is not already set to denote that this character's entry ; needs to be animated (puff of smoke) 33471 LD (HL),A ; Load data into current room of Current Character 33472 LD A,(30615) ; Load A with index of Current Character 33475 CP 7 ; If character is The Banshee... 33477 JP Z,33512 ; ...then skip over section dealing with decreasing summoned characters stats as Banshee's ; stats never change (see trivia) 33480 LD A,(IX+0) ; Decrease character's strength by 10... 33483 SUB 10 ; ... 33485 LD (IX+0),A ; ... 33488 LD A,(IX+1) ; Decrease character's happiness by 5... 33491 SUB 5 ; ... 33493 LD (IX+1),A ; ... 33496 LD A,(IX+2) ; Decrease character's stamina by 12... 33499 SUB 12 ; ... 33501 LD (IX+2),A ; ... 33504 LD A,(25318) ; Decrease Magic Knight's spell power by 3... 33507 SUB 3 ; ... 33509 LD (25318),A ; ... *33512 LD A,(23378) ; If Release Spell score flag is not set... 33515 BIT 4,A ; ... 33517 JP Z,34628 ; ...then display "[CHARACTER] APPEARS IN A THICK PUFF OF SMOKE" window and return to game 33520 LD IX,(23503) ; Else load IX with address of index of next character to send home from table at #R33565 33524 LD A,(30615) ; Load A with index of Current Character 33527 CP (IX+0) ; If data at IX does not match Current Character... 33530 JP NZ,34628 ; ...then display "[CHARACTER] APPEARS IN A THICK PUFF OF SMOKE" window and return to game ; (character is not to be sent home yet) 33533 LD (HL),100 ; Set character's current room to 100 33535 INC IX ; Advance IX to next character in sequence... 33537 LD (23503),IX ; ...and store this new pointer 33541 LD A,255 ; If index of next character to go home is 255... 33543 CP (IX+0) ; ... 33546 JP Z,33180 ; ...then jump to "Well Done" (i.e. game complete) routine 33549 CALL 33278 ; Flash border and screen (as in cast a spell) 33552 LD A,(23506) ; Add one to "characters sent home" score... 33555 INC A ; ... 33556 LD (23506),A ; ... 33559 LD HL,51194 ; Display "[CHARACTER] APPEARS IN SPIRIT FORM AS GIMBAL..." window and return to game... 33562 JP 34808 ; ... ; Summoning Sequence to Send Everyone Home After Release Spell is Cast b33565 DEFB 5 ; Elrand Halfelven 33566 DEFB 4 ; Samsun the Strong 33567 DEFB 1 ; Thor 33568 DEFB 6 ; Lady Rosmar 33569 DEFB 7 ; The Banshee 33570 DEFB 2 ; Florin the Dwarf 33571 DEFB 3 ; Orik the Cleric 33572 DEFB 0 ; Gimbal the Wizard 33573 DEFB 255 ; End marker ; Confirm and Process Blow Command (Create Dust or Racket!) then Return to Game ; ; Used by the routine at #R33312. c33574 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 33577 LD A,(30467) ; Load A with index of Current Object 33580 LD E,4 ; Load E with 4 (use properties of object) 33582 CALL 34160 ; Point HL at use properties of object A 33585 BIT 0,(HL) ; If bit zero is set (Blow status) then... 33587 JP NZ,34560 ; ...display "WHAT A RACKET..." window and return to game... 33590 JP 34568 ; ...else display "WHAT A LOT OF DUST..." window and return to game ; Process Command to Call Lift c33593 LD A,(65532) ; If "Magic Knight Can Call Lift" flag is not set... 33596 BIT 7,A ; ... 33598 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 33601 CALL 38075 ; Play upward scale sound 33604 CALL 37654 ; Print command summary window at bottom of screen 33607 LD DE,51271 ; Point DE to "CALL LIFT" text... 33610 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 33613 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 33616 CALL 33770 ; Set the Lift as not being at any floor at all 33619 LD A,(65529) ; Load A with Magic Knight's current room 33622 DEC A ; Decrease index by one... 33623 RRCA ; ...divide by eight... 33624 RRCA ; ... 33625 RRCA ; ... 33626 AND 7 ; ...and leave number 0-7 (0=Roof, 1=4th Floor, ..., 6=Basement) 33628 LD (23382),A ; Update light on Lift control panel to show current floor 33631 LD A,(65529) ; Load A with Magic Knight's current room... 33634 ADD A,A ; ...and double the value 33635 LD HL,41711 ; Point HL at room connectivity data table 33638 LD E,A ; Load double the room number into DE... 33639 LD D,0 ; ... 33641 ADD HL,DE ; Add DE to HL as offset so HL now points to room connectivity entry for current room 33642 LD (HL),D ; Set left-hand exit of current room to lead to The Lift 33643 LD A,(65529) ; Set the right-hand exit of "The Lift" screen to be Magic Knight's current room 33646 LD (41712),A ; ... 33649 CALL 38175 ; Play "LIFT HAS ARRIVED" sound 33652 LD A,(23410) ; Reset "Magic Knight Can't Move Left" Temporary Movement Flag, as the room's left exit has ; opened... 33655 AND 2 ; ... 33657 LD (23410),A ; ... 33660 JP 34544 ; Display "THE LIFT IS HERE" window ; Process Command to Move Lift c33663 LD A,(65533) ; If Magic Knight can't move Lift... 33666 BIT 0,A ; ... 33668 JP Z,27189 ; ...then jump into Main Game Loop (process keyboard input and move Magic Knight, enter menus ; or execute other command) 33671 CALL 38075 ; Play upward scale sound 33674 CALL 37654 ; Display / update command summary window at bottom of screen 33677 LD DE,51290 ; Point DE at "MOVE LIFT" text... 33680 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 33683 LD A,25 ; Draw the "TAKE LIFT TO..." window... 33685 CALL 36979 ; ... 33688 LD HL,51300 ; Print "TAKE LIFT TO" + "A ROOF ... B 4TH FLOOR... etc." text ... 33691 CALL 36725 ; ... 33694 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 33697 SUB 65 ; Subtract 65 (ASCII code for A) to leave index of floor selected 33699 LD (33740),A ; Load selected floor into instruction at #R33739 33702 LD HL,51354 ; Point HL at start of first entry in list of floor names 33705 LD B,A ; Load selected floor number into B 33706 CALL 34845 ; Advance HL to B-th entry in list of zero-terminated strings 33709 EX DE,HL ; Swap DE (now points to name of floor of interest) and HL (now undefined) 33710 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 33713 CALL 38725 ; Display Execute / Reject Command window and return if Execute chosen, else exit 33716 LD A,(23411) ; If "Lift fixed" flag is set... 33719 AND 1 ; ... 33721 JR NZ,33736 ; ...then skip over "Lift is broken" section of routine 33723 LD A,(33740) ; Load selected floor from instruction at #R33739 into A 33726 CP 5 ; If Ground Floor is selected then... 33728 JP Z,34730 ; ...display "THE LIFT IS BROKEN" message and exit 33731 CP 6 ; If Basement is selected then... 33733 JP Z,34730 ; ...display "THE LIFT IS BROKEN" message and exit *33736 CALL 33770 ; Set the lift as not being at any floor at all ; The operand of the instruction at #R33739 represents the selected floor index stored previously. This is modified ; by the instruction at #R33699. 33739 LD A,0 ; Set Lift control panel to show... 33741 LD (23382),A ; ...Lift as being at "current" floor 33744 ADD A,A ; Multiply current floor number by eight... 33745 ADD A,A ; ... 33746 ADD A,A ; ... 33747 INC A ; ...and add one to give index of room that the Lift's exit will lead into 33748 LD (41712),A ; Set this room as the one connected to the Lift's right-exit 33751 ADD A,A ; Double this room index... 33752 LD D,0 ; ...and load into DE to give offset of room's left-exit in room connectivity table at 41711... 33754 LD E,A ; ... 33755 LD HL,41711 ; Point HL at room connectivity table at #R41711 33758 ADD HL,DE ; Add offset in DE to pointer HL 33759 LD (HL),0 ; Set the room referred to by the pointed-to entry to be the Lift (i.e. set the room's ; left-exit to lead into the Lift) 33761 CALL 33788 ; Flash border and make sound (as in Move Lift) 33764 CALL 38175 ; Play "LIFT HAS ARRIVED" sound 33767 JP 34552 ; Display "THE LIFT HAS ARRIVED" window ; Set the Lift as Not Being at Any Floor at all ; ; Used by the routines at #R33593, #R33663 and #R55349. c33770 LD HL,41713 ; Point HL to room connectivity table entry for left-hand exit of left-most room in Roof Garden 33773 LD DE,16 ; Set DE to 16 (as each floor takes up 16 bytes in that table, except the basement of course!) 33776 LD A,255 ; Set A to 255 (value that makes an exit of a room non-traversable) 33778 LD B,7 ; Load B with 7 (as there are 8 floors) *33780 LD (HL),A ; Set left-most exit of current floor to be inaccessible 33781 ADD HL,DE ; Advance by 16 bytes to next floor down 33782 DJNZ 33780 ; Repeat for next floor 33784 LD (41712),A ; Set right-hand exit of the Lift to be inaccessible 33787 RET ; Return ; Flash Border and Make Sound (as in Move Lift) ; ; Used by the routine at #R33663. c33788 LD HL,600 ; Load HL with 600 33791 XOR A ; Set A to zero *33792 OUT (254),A ; Set bits on port 254 33794 LD B,250 ; Load B with 250 (length of pause) *33796 NOP ; Pause by doing nothing... 33797 NOP ; ... 33798 DJNZ 33796 ; Loop back for next part of pause 33800 XOR 7 ; Invert bits 0, 1 and 2 33802 DEC HL ; Decrease HL by one 33803 LD A,H ; Set various bits of A... 33804 OR L ; ... 33805 JR NZ,33792 ; While HL is not zero, repeat loop 33807 RET ; Return ; Display "[CHARACTER] CANNOT HELP YOU" Window and Return to Game (Jump) c33808 JP 34514 ; ; "Command Character to Help" Routine for Thor c33811 LD A,169 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to 169 ("HERE")... 33813 LD (46710),A ; ... 33816 LD A,(65529) ; If Magic Knight is not in the Lift... 33819 OR A ; ... 33820 JR NZ,33846 ; ...then skip ahead to #R33846 33822 LD A,(23411) ; If "Lift fixed" flag is set... 33825 AND 1 ; ... 33827 JP NZ,33875 ; ...then display "THERE IS NOTHING MORE THAT THOR CAN DO TO HELP HERE" window and exit 33830 LD A,(23411) ; Set "Lift fixed" flag 33833 OR 1 ; ... 33835 LD (23411),A ; ... 33838 LD HL,44278 ; Display "THOR SMASHED THE LIFT CONTROL BOX..." window and return to game 33841 LD A,24 ; ... 33843 JP 34768 ; ... *33846 CP 9 ; If Magic Knight is not at The Tower... 33848 JP NZ,34514 ; ...then display "THOR CANNOT HELP YOU" window and exit 33851 LD A,(23411) ; If "Tower zapped by Thor" flag is set... 33854 AND 2 ; ... 33856 JP NZ,33875 ; ...then display "THERE IS NOTHING MORE THAT THOR CAN DO TO HELP HERE" window and exit 33859 LD A,(23411) ; Set "Tower zapped by Thor" flag... 33862 OR 2 ; ... 33864 LD (23411),A ; ... 33867 LD HL,44349 ; Display "THE TOWER SHOOK AS THOR SENT A BOLT OF HIS BEST LIGHTNING AT IT..." window and ; return to game 33870 LD A,24 ; ... 33872 JP 34768 ; ... ; This entry point is used by the routines at #R33935, #R33993 and #R34062. *33875 LD HL,44244 ; Display "THERE IS NOTHING MORE THAT THOR CAN DO TO HELP HERE" window... 33878 LD A,24 ; ... 33880 JP 34768 ; ...and return to game ; "Command Character to Help" Routine for Florin c33883 LD HL,25410 ; Check whether Florin is carrying the Tube of Glue... 33886 LD A,10 ; ... 33888 CALL 34259 ; ... 33891 JP NZ,34514 ; ...and if he isn't, display "[CHARACTER] CANNOT HELP YOU" window and exit 33894 LD HL,25410 ; Check whether Florin is carrying the Broken Talisman... 33897 LD A,11 ; ... 33899 CALL 34259 ; ... 33902 JP NZ,34514 ; ...and if he isn't, display "[CHARACTER] CANNOT HELP YOU" window and exit 33905 LD HL,25410 ; Point HL to start of Florin's current inventory... 33908 PUSH HL ; ...and store 33909 LD C,11 ; Remove Broken Talisman from Florin's inventory 33911 LD B,5 ; ... 33913 CALL 38674 ; ... 33916 POP HL ; Restore HL (points to start of Florin's inventory again) 33917 LD C,12 ; Load the Magic Talisman into Florin's first available inventory slot... 33919 LD B,5 ; ... 33921 CALL 34151 ; ... 33924 LD HL,44488 ; Display the "FLORIN HAS MENDED THE TALISMAN..." window... 33927 LD A,24 ; ... 33929 JP 34768 ; ...and return to game ; "Command Character to Help" Routine for Orik c33932 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; "Command Character to Help" Routine for Samsun c33935 LD A,169 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to 169 ("HERE")... 33937 LD (46710),A ; ... 33940 LD A,(65529) ; If Magic Knight is not at The Pit... 33943 CP 46 ; ... 33945 JP NZ,34514 ; ...then display "SAMSUN CANNOT HELP YOU" window and exit 33948 LD A,(23411) ; If "Platform thrown into Pit" flag is set... 33951 AND 16 ; ... 33953 JP NZ,33875 ; ...then display "THERE IS NOTHING MORE THAT SAMSUN CAN DO TO HELP YOU HERE" window and exit 33956 LD A,(23411) ; Set "Platform thrown into Pit" flag... 33959 OR 16 ; ... 33961 LD (23411),A ; ... 33964 LD HL,25420 ; Point HL to start of Samsun's current inventory... 33967 LD B,5 ; Remove Platform from Samsun's inventory... 33969 LD C,29 ; ... 33971 CALL 38674 ; ... 33974 LD HL,25551 ; Set the Platform's current location... 33977 LD (HL),46 ; ...as being at The Pit... 33979 INC HL ; ... 33980 LD (HL),15 ; ...at x = 15... 33982 INC HL ; ... 33983 LD (HL),11 ; ...y = 11 33985 LD HL,44583 ; Display "GOOD OLD SAMSUN HAS THROWN A PLATFORM..." window... 33988 LD A,24 ; ... 33990 JP 34768 ; ...and return to game ; "Command Character to Help" Routine for Elrand c33993 LD A,169 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to 169 ("HERE")... 33995 LD (46710),A ; ... 33998 LD A,(65529) ; If Magic Knight is not at The Wall... 34001 CP 29 ; ... 34003 JP NZ,34514 ; ...then display "ELRAND CANNOT HELP YOU" window and exit 34006 LD A,170 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to 170 ("YET")... 34008 LD (46710),A ; ... 34011 LD A,(23411) ; If "Wall broken" flag is set... 34014 AND 8 ; ... 34016 JP NZ,33875 ; ...then display "THERE IS NOTHING MORE THAT ELRAND CAN DO TO HELP YOU HERE" window and exit 34019 LD A,(23411) ; If "Tower zapped by Thor" flag is not set... 34022 AND 2 ; ... 34024 JP Z,34514 ; ...then display "ELRAND CANNOT HELP YOU" window and exit 34027 LD A,(23411) ; Set "Wall broken" flag... 34030 OR 8 ; ... 34032 LD (23411),A ; ... 34035 LD HL,53317 ; Change room data pointer for The Wall from 53289 (original version) to 53317 (Wall broken ; version)... 34038 LD A,L ; ... 34039 LD (51971),A ; ... 34042 LD A,H ; ... 34043 LD (51972),A ; ... 34046 LD A,29 ; Set both Lumps of Brickwork to be at The Wall... 34048 LD (25539),A ; ... 34051 LD (25596),A ; ... 34054 LD HL,44643 ; Display "THE TRUMPET BLOWS AND THE WALL COMES A-TUMBLING DOWN !!" window... 34057 LD A,24 ; ... 34059 JP 34768 ; ...and return to game ; "Command Character to Help" Routine for Rosmar c34062 LD A,169 ; Set last character of "[CHARACTER] CANNOT HELP YOU..." text to 169 ("HERE")... 34064 LD (46710),A ; ... 34067 LD A,(65529) ; If Magic Knight is not at The Secret Tunnel Entrance... 34070 CP 42 ; ... 34072 JP NZ,34514 ; ...then display "ROSMAR CANNOT HELP YOU" window and exit 34075 LD A,(53598) ; If height of right-wall in Secret Tunnel Entrance is 7 (i.e. not full height of room)... 34078 CP 7 ; ... 34080 JP Z,33875 ; ...then display "THERE IS NOTHING MORE THAT ROSMAR CAN DO TO HELP HERE" window and exit 34083 LD A,7 ; Make right-wall in Secret Tunnel Entrance height 7 (i.e. Magic Knight-sized gap at bottom)... 34085 LD (53598),A ; ... 34088 LD C,18 ; Remove Fast Blow Fuse (C=18) from Banshee's inventory (HL=#R25435)... [bug! Should be removed ; from Rosmar's inventory, HL=#R25430] 34090 LD B,5 ; ... 34092 LD HL,25435 ; ... 34095 CALL 38674 ; ... 34098 LD HL,44691 ; Display "ROSMAR PLACED THE FUSE IN THE LASER..." window... 34101 LD A,24 ; ... 34103 JP 34768 ; ...and return to game ; "Command Character to Help" Routine for the Banshee c34106 LD A,(23673) ; Load A with middle byte of FRAMES system variable... 34109 RRCA ; ...divide by eight... 34110 RRCA ; ... 34111 RRCA ; ... 34112 AND 7 ; ... 34114 LD B,A ; ...and copy into B 34115 LD HL,44796 ; Point HL at first text entry corresponding to Banshee help quotes 34118 CALL 34845 ; Advance HL by B entries in list of zero-terminated strings (i.e. Banshee quotes) at 44796... 34121 LD A,24 ; ...display the quote in a window... 34123 JP 34768 ; ...and return to game ; Get the Weight of an Object ; ; Used by the routines at #R30880 and #R34224. Input: A Index of an object Output: A Weight of that object c34126 PUSH HL ; Store HL 34127 PUSH DE ; Store DE 34128 LD E,0 ; Point HL to property zero (i.e. weight) of object A... 34130 CALL 34160 ; ... 34133 LD A,(HL) ; ...and load this into A 34134 POP DE ; Restore DE 34135 POP HL ; Restore HL 34136 RET ; Return ; Load Happiness of Current Character into A ; ; Used by the routines at #R30602 and #R30880. Output: A Happiness c34137 LD A,(30615) ; Load A with index of Current Character 34140 PUSH HL ; Store HL 34141 PUSH DE ; Store DE 34142 LD E,1 ; Point HL to... 34144 CALL 34174 ; ...happiness (E=1) of Current Character... 34147 LD A,(HL) ; ...and load into A 34148 POP DE ; Restore DE 34149 POP HL ; Restore HL 34150 RET ; Return ; Load an Object into the First Empty Inventory Slot of a Character ; ; Used by the routines at #R30222, #R30602 and #R33883. Input: HL Points to inventory slots of a character B ; Number of inventory slots to process C Index of object to add to this character's inventory c34151 LD A,(HL) ; Load A with index of object at character's current inventory slot... 34152 OR A ; ...and if this is zero (i.e. empty)... 34153 JR Z,34158 ; ...skip ahead to #R34158 34155 INC HL ; Advance to next inventory slot 34156 DJNZ 34151 ; Repeat for next slot *34158 LD (HL),C ; Load object into this (i.e. first empty) slot 34159 RET ; Return ; Point HL to Property (Given by E) of Object Whose Index is A ; ; Used by the routines at #R30439, #R31370, #R32258, #R32390, #R33574, #R34126, #R35629, #R35669, #R35709, #R35749 ; and #R36275. Input: A Index of an object E Required property from properties table at #R42242 (e.g. E = 0 for ; weight) Output: HL Property E of object A c34160 ADD A,A ; Multiply index by eight... 34161 ADD A,A ; ... 34162 LD L,A ; ... 34163 LD H,0 ; ... 34165 ADD HL,HL ; ...and load into HL 34166 LD D,0 ; Add value of E (e.g. 6 for attribute)... 34168 ADD HL,DE ; ... 34169 LD DE,42242 ; Point DE at start of object properties table... 34172 ADD HL,DE ; ...and add into HL to point to property "E" 34173 RET ; Return ; Point HL at Property (Given by E) of Character Whose Index is A ; ; Used by the routines at #R30880, #R31370, #R31722, #R31763, #R31804, #R31842, #R31920, #R31980, #R33312, #R34137, ; #R34211, #R34350 and #R55233. Input: A Character index E Property of interest (e.g. 0 = Strength, 1 = ; Happiness, etc.) Output: HL Points to property E of character A c34174 ADD A,A ; Multiply A by 8... 34175 ADD A,A ; ... 34176 ADD A,A ; ... 34177 ADD A,E ; ...and add E... 34178 LD D,0 ; Load this offset into DE... 34180 LD E,A ; ... 34181 LD HL,25323 ; Point HL at start of characters' stats table... 34184 ADD HL,DE ; ...and add DE to point HL to property E of character A 34185 RET ; Return ; Point IX at Current Inventory of Character A ; ; Used by the routines at #R30602, #R30880 and #R34211. Input: A Index of a character Output: IX Points to ; current inventory of character A c34186 PUSH DE ; Store DE 34187 LD E,A ; Multiply character index by five (as each character has five inventory slots)... 34188 ADD A,A ; ... 34189 ADD A,A ; ... 34190 ADD A,E ; ... 34191 LD E,A ; ...and load into DE... 34192 LD D,0 ; ... 34194 LD IX,25400 ; Point IX at start of characters' current inventories table (i.e. Gimbal's entry) 34198 ADD IX,DE ; Add five times character index to this as offset 34200 POP DE ; Restore DE 34201 RET ; Return ; Prepare to Check Whether Magic Knight Can Pick Up an Object ; ; Used by the routines at #R30222 and #R30602. c34202 LD IX,25395 ; Point IX to start of Magic Knight's current inventory 34206 LD A,(25315) ; Load Magic Knight's current strength into A 34209 JR 34224 ; Jump ahead to #R34224 (test whether object to pick up is too heavy for Magic Knight) ; Unused routine c34211 LD A,(30615) ; Load A with index of Current Character 34214 CALL 34186 ; Point IX at current inventory of character in A 34217 LD A,(30615) ; Load A with index of Current Character 34220 CALL 34174 ; Point HL at property (given by E) of character whose index is A 34223 LD A,(HL) ; Load property into A ; Test Whether Current Object is too Heavy for A Character to Pick Up ; ; Used by the routine at #R34202. Input: A Character's current strength IX Points to Character's current ; inventory Output: F S Flag set if object is light enough to be picked up, reset otherwise c34224 PUSH AF ; Store AF (A = Character's current strength) 34225 LD BC,1280 ; Load B with 5 (as five inventory slots to check) and C (total weight carried) with zero *34228 LD A,(IX+0) ; Load object in current inventory slot 34231 OR A ; If no object present... 34232 JR Z,34243 ; ...skip ahead to #R34243... 34234 CALL 34126 ; Load A with weight of object A 34237 ADD A,C ; Add C to this... 34238 LD C,A ; ...and load result into C (total weight so far) 34239 INC IX ; Advance to next inventory slot 34241 DJNZ 34228 ; Loop back for next inventory slot *34243 POP AF ; Restore AF (A = Character's current strength) 34244 AND 127 ; Ensure that strength is capped at 127 and that Sign Flag is reset (in reality, Magic Knight's ; strength can only go as high as 96) 34246 SUB C ; Subtract total weight of character's carried objects from his/her strength to get "surplus" ; strength... 34247 LD C,A ; ...and load into C 34248 LD A,(30467) ; Load A with index of Current Object (e.g. object character is trying to receive) 34251 CALL 34126 ; Load A with weight of object A 34254 CP C ; Set Sign Flag if surplus strength exceeds weight of object, otherwise reset 34255 RET ; Return ; Check Whether Magic Knight is Carrying an Object ; ; Used by the routines at #R28092, #R29800, #R32258, #R32764, #R32823, #R32982, #R33036, #R33129, #R36215 and ; #R36275. Input: A Index of an object HL (Entry at #R34259) Pointer to start of a character's inventory Output: ; F Zero Flag set if object is present in inventory, reset otherwise c34256 LD HL,25395 ; Point HL at start of Magic Knight's current Inventory ; This entry point is used by the routines at #R32764 and #R33883. *34259 LD B,5 ; Load B with 5 (as characters have five inventory slots) *34261 CP (HL) ; If object at current inventory slot is the object of interest... 34262 RET Z ; ...then return with zero flag set 34263 INC HL ; Advance HL to next inventory slot 34264 DJNZ 34261 ; Decrease B (remaining number of inventory slots to check) and loop back to #R34261 34266 OR A ; Reset zero flag, as object is not present 34267 RET ; Return ; Insert Current Time and Score into "TIME LEFT" and "PERCENTAGE COMPLETION" Texts ; ; Used by the routines at #R31370 and #R35101. Input: HL Points to percentage completion text (#R43230 or #R46117) ; DE Points to time left text (#R43253 or #R46132) c34268 PUSH DE ; Store DE 34269 PUSH HL ; Store HL 34270 LD HL,23412 ; Point HL at Visited Rooms table 34273 LD BC,12800 ; Set B=50, C=0 *34276 LD A,(HL) ; Load A with value at HL 34277 ADD A,C ; Add this to C... 34278 LD C,A ; ... 34279 INC HL ; Advance to next byte 34280 DJNZ 34276 ; Loop back to 34276 (adding together 50 values from 23412 onwards to get score for exploring ; rooms) 34282 DEC C ; Decrease exploration score by one (due to no score for The Start Room) 34283 LD A,(23378) ; Add four percent if "Engraved Candle lit" score flag is set... 34286 AND 2 ; ... 34288 ADD A,A ; ... 34289 ADD A,C ; ... 34290 LD C,A ; ... 34291 LD A,(23378) ; Add four percent if "Armouris Photonicus spell cast" score flag is set... 34294 AND 4 ; ... 34296 ADD A,C ; ... 34297 LD C,A ; ... 34298 LD A,(23378) ; Add four percent if "Fumaticus Protectium spell cast" score flag is set... 34301 AND 8 ; ... 34303 RRCA ; ... 34304 ADD A,C ; ... 34305 LD C,A ; ... 34306 LD A,(23378) ; Add eight percent if "Crystallium Spectralis spell cast" score flag is set... 34309 AND 1 ; ... 34311 ADD A,A ; ... 34312 ADD A,A ; ... 34313 ADD A,A ; ... 34314 ADD A,C ; ... 34315 LD C,A ; ... 34316 LD A,(23378) ; Add sixteen percent if "Release Spell cast" score flag is set... 34319 AND 16 ; ... 34321 ADD A,C ; ... 34322 LD C,A ; ... 34323 LD A,(23468) ; If "Crystallium Spectralis spell cast" score flag is not set... 34326 AND 1 ; ... 34328 JR Z,34334 ; ...then skip ahead to #R34334 34330 LD A,7 ; Add seven percent to current score... 34332 ADD A,C ; ... 34333 LD C,A ; ... *34334 LD A,(23506) ; Add "characters sent home" score... 34337 ADD A,C ; ... 34338 POP HL ; Restore HL (percentage completion text) 34339 CALL 36647 ; Splice numeric data A as a string into "PERCENTAGE COMPLETION" text 34342 LD A,(23404) ; Load A with current number of hours left 34345 POP HL ; Restore HL (originally DE, time left text) 34346 CALL 36647 ; Splice numeric data A as a string into "TIME LEFT" text 34349 RET ; Return ; Check if Current Character is Asleep and Display "[CHARACTER] IS ASLEEP" Window if So ; ; Used by the routines at #R31804, #R31842, #R31920 and #R31980. c34350 PUSH HL ; Store HL 34351 LD A,(30615) ; Load A with index of Current Character 34354 LD E,6 ; Point HL at... 34356 CALL 34174 ; ...Current Character's asleep flag 34359 BIT 7,(HL) ; If character is awake... 34361 JR Z,34382 ; ...then exit routine 34363 LD A,34 ; Draw window 34... 34365 CALL 36987 ; ... 34368 LD HL,43641 ; Point HL at "[CHARACTER] IS ASLEEP" text... 34371 CALL 36725 ; ...and print the text 34374 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" Window and wait for SPACE / Fire 34377 POP HL ; Restore HL 34378 POP HL ; Restore HL again, removing return address of calling "command a character to" routine, so a ; RET will return to the routine that called THAT routine 34379 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop *34382 POP HL ; Restore HL 34383 XOR A ; Set A to zero 34384 RET ; Return ; Load Magic Knight's Coordinates (in Characters) into DE ; ; Used by the routines at #R30222, #R30439 and #R32903. Output: D y-coordinate (characters) E x-coordinate ; (characters) c34385 LD A,(25388) ; Load Magic Knight's current y-coordinate into A 34388 CALL 30123 ; Divide by eight, rounding down to nearest integer 34391 ADD A,3 ; Add 3 (as Magic Knight is four characters tall) 34393 LD D,A ; And load result into D 34394 LD A,(25387) ; Load Magic Knight's current x-coordinate into A 34397 CALL 30123 ; Divide by eight, rounding down to nearest integer 34400 LD E,A ; Load result into E 34401 RET ; Return ; Point HL to Current Position Data for Current Character ; ; Used by the routines at #R31804, #R32035 and #R33312. Output: HL Points to entry for Current Character in current ; character positions table at #R25440 c34402 PUSH BC ; Store BC 34403 LD A,(30615) ; Load A with index of Current Character... 34406 LD C,A ; ...copy into C... 34407 ADD A,A ; ...and multiply by 3 (as there are three bytes per entry in character positions table; ; screen, x- and y-coordinates)... 34408 ADD A,C ; ... 34409 LD C,A ; Load new value back into BC... 34410 LD B,0 ; ... 34412 LD HL,25440 ; Point HL at table of characters' current positions 34415 ADD HL,BC ; Add offset so that HL points to position entry for Current Character 34416 POP BC ; Restore BC 34417 RET ; Return ; Display "YOUR HANDS ARE FULL" Window and Return to Game ; ; Used by the routines at #R30222 and #R30602. c34418 LD HL,45343 ; Point HL at "YOUR HANDS ARE FULL" text 34421 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "THAT OBJECT IS TOO HEAVY" Window and Return to Game ; ; Used by the routines at #R30222 and #R30602. c34424 LD HL,45361 ; Point HL at "THAT OBJECT IS TOO HEAVY" text 34427 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "THERE IS NOTHING NEAR ENOUGH" Window and Return to Game ; ; Used by the routine at #R30222. c34430 LD HL,45326 ; Point HL at "THERE IS NOTHING NEAR ENOUGH" text 34433 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "THERE IS NOTHING IN THIS ROOM" Window and Return to Game ; ; Used by the routine at #R30222. c34436 LD HL,45315 ; Point HL at "THERE IS NOTHING IN THIS ROOM" text 34439 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "YOU CANNOT DROP THAT OBJECT" Window and Return to Game ; ; Used by the routine at #R30439. c34442 LD HL,45475 ; Point HL at "YOU CANNOT DROP THAT OBJECT" text 34445 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER]'S HANDS ARE EMPTY" Window and Return to Game ; ; Used by the routine at #R30602. c34448 LD HL,45627 ; Point HL at "[CHARACTER]'S HANDS ARE EMPTY" text 34451 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER] WANTS TO KEEP THAT" Window and Return to Game ; ; Used by the routine at #R30602. c34454 LD HL,45648 ; Point HL at "[CHARACTER] WANTS TO KEEP THAT" text 34457 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER]'S HANDS ARE FULL" Window and Return to Game ; ; Used by the routine at #R30880. c34460 LD HL,45824 ; Point HL at "[CHARACTER]'S HANDS ARE FULL" text 34463 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER] IS NOT STRONG ENOUGH" Window and Return to Game ; ; Used by the routine at #R30880. c34466 LD HL,45844 ; Point HL at "[CHARACTER] IS NOT STRONG ENOUGH" text 34469 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER] DOES NOT WANT THAT" Window and Return to Game ; ; Used by the routine at #R30880. c34472 LD HL,45866 ; Point HL at "[CHARACTER] DOES NOT WANT THAT" text 34475 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER] IS ALREADY ASLEEP" Window and Return to Game ; ; Used by the routine at #R31722. c34478 LD HL,46567 ; Point HL at "[CHARACTER] IS ALREADY ASLEEP" text 34481 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO WAKEFUL TO SLEEP" Window and Return to Game ; ; Used by the routine at #R31722. c34484 LD HL,46582 ; Point HL at "[CHARACTER] IS TOO WAKEFUL TO SLEEP" text 34487 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" Window and Return to Game ; ; Used by the routines at #R31722, #R31763, #R31804, #R31842, #R31920 and #R31980. c34490 LD HL,46535 ; Point HL at "[CHARACTER] DOES NOT WANT TO BE COMMANDED BY YOU" text 34493 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS ALREADY AWAKE" Window and Return to Game ; ; Used by the routine at #R31763. c34496 LD HL,46627 ; Point HL at "[CHARACTER] IS ALREADY AWAKE" text 34499 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO WAKE UP" Window and Return to Game ; ; Used by the routine at #R31763. c34502 LD HL,46641 ; Point HL at "[CHARACTER] IS TOO TIRED TO WAKE UP" text 34505 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO GO AWAY" Window and Return to Game ; ; Used by the routine at #R31804. c34508 LD HL,46669 ; Point HL at "[CHARACTER] IS TOO TIRED TO GO AWAY" text 34511 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] CANNOT HELP YOU" Window and Return to Game ; ; Used by the routines at #R31842, #R33808, #R33811, #R33883, #R33935, #R33993 and #R34062. c34514 LD HL,46698 ; Point HL at "[CHARACTER] CANNOT HELP YOU" text 34517 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO HELP YOU" Window and Return to Game ; ; Used by the routine at #R31842. c34520 LD HL,46712 ; Point HL at "[CHARACTER] IS TOO TIRED TO HELP YOU" text 34523 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] HAS NO FOOD LEFT" Window and Return to Game ; ; Used by the routine at #R31920. c34526 LD HL,46718 ; Point HL at "[CHARACTER] HAS NO FOOD LEFT" text 34529 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO EAT OR DRINK" Window and Return to Game ; ; Used by the routine at #R31920. c34532 LD HL,46738 ; Point HL at "[CHARACTER] IS TOO TIRED TO EAT OR DRINK" text 34535 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO BE HAPPY" Window and Return to Game ; ; Used by the routine at #R31980. c34538 LD HL,46780 ; Point HL at "[CHARACTER] IS TOO TIRED TO BE HAPPY" text 34541 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "THE LIFT IS HERE" Window and Return to Game ; ; Used by the routine at #R33593. c34544 LD HL,51278 ; Point HL at "THE LIFT IS HERE" text 34547 LD A,24 ; Draw window (index 24) with text pointed to by HL... 34549 JP 34768 ; ...and return to game ; Display "THE LIFT HAS ARRIVED" Window and Return to Game ; ; Used by the routine at #R33663. c34552 LD HL,51338 ; Point HL at "THE LIFT HAS ARRIVED" text 34555 LD A,24 ; Draw window (index 24) with text pointed to by HL... 34557 JP 34768 ; ...and return to game ; Display "WHAT A RACKET..." Window and Return to Game ; ; Used by the routine at #R33574. c34560 LD HL,50911 ; Point HL at "WHAT A RACKET! APART FROM THE NOISE, NOTHING HAPPENED" text 34563 LD A,27 ; Draw window (index 27) with text pointed to by HL... 34565 JP 34768 ; ...and return to game ; Display "WHAT A LOT OF DUST..." Window and Return to Game ; ; Used by the routine at #R33574. c34568 LD HL,51086 ; Point HL at "WHAT A LOT OF DUST. DOESN'T ANYBODY CLEAN THIS PLACE?" text 34571 LD A,27 ; Draw window (index 27) with text pointed to by HL... 34573 JP 34768 ; ...and return to game ; Display "THERE IS NO WRITING FOR ME TO READ" Window and Return to Game ; ; Used by the routine at #R32258. c34576 LD A,12 ; Draw window (index 12) with text pointed to by HL 34578 LD HL,47298 ; Point HL at "THERE IS NO WRITING FOR ME TO READ" text... 34581 JP 34768 ; ...and return to game ; Display "IT IS NOT SAFE TO TELEPORT..." Window and Return to Game ; ; Used by the routine at #R32194. c34584 LD HL,50348 ; Point HL at "IT IS NOT SAFE TO TELEPORT TRY AGAIN LATER" text 34587 LD A,17 ; Draw window (index 17) with text pointed to by HL... 34589 JP 34768 ; ...and return to game ; Display "THE LIQUID IS STUCK TO THE FLOOR..." Window and Return to Game ; ; Used by the routine at #R30222. c34592 LD HL,45380 ; Point HL at "THE LIQUID IS STUCK TO THE FLOOR (IT'S A VERY THICK LIQUID)" text 34595 JP 34803 ; Draw window (index 13) with text pointed to by HL ; Display "[CHARACTER] IS ASLEEP" window and return to game ; ; Used by the routine at #R33312. c34598 LD HL,50965 ; Point HL at "[CHARACTER] IS ASLEEP" text 34601 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "[CHARACTER] DOES NOT WANT TO BE SUMMONED" window and return to game ; ; Used by the routine at #R33312. c34604 LD HL,50976 ; Point HL at "[CHARACTER] DOES NOT WANT TO BE SUMMONED" text 34607 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "[CHARACTER] IS TOO TIRED TO BE SUMMONED" window and return to game ; ; Used by the routine at #R33312. c34610 LD HL,51006 ; Point HL at "[CHARACTER] IS TOO TIRED TO BE SUMMONED" text 34613 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "[CHARACTER] IS ALREADY HERE!" window and return to game ; ; Used by the routine at #R33312. c34616 LD HL,51033 ; Point HL at "[CHARACTER] IS ALREADY HERE!" text 34619 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "[CHARACTER] DOES NOT WANT TO COME TO SUCH A CROWDED ROOM!" window and return to game ; ; Used by the routine at #R33312. c34622 LD HL,51045 ; Point HL at "[CHARACTER] DOES NOT WANT TO COME TO SUCH A CROWDED ROOM!" text 34625 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "[CHARACTER] APPEARS IN A THICK PUFF OF SMOKE" window and return to game ; ; Used by the routine at #R33312. c34628 LD HL,51138 ; Point HL at "[CHARACTER] APPEARS IN A THICK PUFF OF SMOKE" text 34631 JP 34808 ; Draw window (index 28) with text pointed to by HL ; Display "THAT SPELL CANNOT YET BE CAST..." window and return to game ; ; Used by the routines at #R32764, #R32823, #R32903, #R32982, #R33036 and #R33129. c34634 LD HL,49435 ; Point HL at "THAT SPELL CANNOT YET BE CAST. SOMETHING HAS NOT BEEN DONE OR MAYBE THE TIME IS ; NOT YET SUITABLE" text 34637 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "THE SPELL HAS WORKED! GIMBAL IS NEARLY FREE" window and return to game ; ; Used by the routine at #R32764. c34640 LD HL,49581 ; Point HL at "THE SPELL HAS WORKED! GIMBAL IS NEARLY FREE" text 34643 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "SUCCESS ! GIMBAL IS FREE AT LAST" window and return to game ; ; Used by the routine at #R32390. c34646 LD HL,49613 ; Point HL at "SUCCESS ! GIMBAL IS FREE AT LAST" text 34649 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Candelium Illuminatus successful window and return to game ; ; Used by the routine at #R32823. c34652 LD HL,49640 ; Point HL at "WELL DONE, THE CANDLE IS NOW GLOWING WITH A COOL YELLOW LIGHT THAT HAS MAGIC ; POWER" text 34655 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Armouris Photonicus successful window and return to game ; ; Used by the routine at #R32903. c34658 LD HL,49709 ; Point HL at Armouris Photonicus successful text 34661 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "GIMBAL IS ALREADY FREE" window and return to game ; ; Used by the routine at #R32764. c34664 LD HL,50076 ; Point HL at "GIMBAL IS ALREADY FREE" text 34667 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "THE CANDLE IS ALREADY ALIGHT" window and return to game ; ; Used by the routine at #R32823. c34670 LD HL,50087 ; Point HL at "THE CANDLE IS ALREADY ALIGHT" text 34673 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "YOUR ARMOUR IS GLOWING ALREADY" window and return to game ; ; Used by the routine at #R32903. c34676 LD HL,50102 ; Point HL at "YOUR ARMOUR IS GLOWING ALREADY" text 34679 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "YOU HAVE ALL THE PROTECTION YOU NEED AGAINST GAS ALREADY" window and return to game ; ; Used by the routine at #R32982. c34682 LD HL,50124 ; Point HL at "YOU HAVE ALL THE PROTECTION YOU NEED AGAINST GAS ALREADY" text 34685 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Fumaticus Protectium successful window and return to game ; ; Used by the routine at #R32982. c34688 LD HL,49880 ; Point HL at Fumaticus Protectium successful text 34691 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Project Physical Body successful window and return to game ; ; Used by the routine at #R33036. c34694 LD HL,50006 ; Point HL at "YOUR SPIRIT FLOWS THROUGH THE GATES OF MAGICAL-SPACE-TIME AND THE SPELL CARRIES ; YOUR BODY ALONG" text 34697 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Gimbal's telepathic whisper window and return to game ; ; Used by the routine at #R32390. c34700 LD HL,50396 ; Point HL at "YOU HEAR A SHORT RANGE TELEPATHIC WHISPER FROM GIMBAL. 'KEEP THE CRYSTAL FOR ; LATER - IT IS OF NO USE HERE YET'" text 34703 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Blue Crystal used successfully window and return to game ; ; Used by the routine at #R32390. c34706 LD HL,50486 ; Point HL at "THE BLUE CRYSTAL FLEW AT GIMBAL AND BURST INTO A SPARKLING POWDER ON CONTACT. ; THE BLUE PORTION THE WHITE-OUT AURA SURROUNDING GIMBAL IS DESTROYED" text 34709 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Red Crystal used successfully window and return to game ; ; Used by the routine at #R32390. c34712 LD HL,50605 ; Point HL at "THE RED CRYSTAL FLEW STRAIGHT AT GIMBAL AND TURNED INTO A GAS SURROUNDING HIM. ; THE STENCH WAS ALMOST UNBEARABLE BUT NOW THE RED ELEMENT OF THE WHITE-OUT SPELL TRAPPING ; GIMBAL IS REMOVED" text 34715 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display Green Crystal used successfully window and return to game ; ; Used by the routine at #R32390. c34718 LD HL,50763 ; Point HL at "THE GREEN CRYSTAL FLEW AT GIMBAL AND SUCKED UP ALL OF THE GREEN PARTS OF THE ; WHITE-OUT SPELL BEFORE IT BURNED UP IN A BRIGHT FLARE." text 34721 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "THE [OBJECT] LANDED ON THE FLOOR BY [CHARACTER]" window and return to game ; ; Used by the routine at #R32390. c34724 LD HL,50869 ; Point HL at "THE [OBJECT] LANDED ON THE FLOOR BY [CHARACTER]" text 34727 JP 34816 ; Draw window (index 35) with text pointed to by HL ; Display "THE LIFT IS BROKEN..." window and return to game ; ; Used by the routine at #R33663. c34730 LD HL,51368 ; Point HL at "THE LIFT IS BROKEN AND CANNOT BE MOVED TO THAT FLOOR YET. A GOOD BASH IN THE ; CONTROL BOX WILL PROBABLY FIX IT" text 34733 LD A,24 ; Draw window (index 24) with text pointed to by HL... 34735 JP 34768 ; ...and return to game ; Display "[CHARACTER] HAS GONE TO SLEEP" window and return to game ; ; Used by the routine at #R31722. c34738 LD HL,46608 ; Point HL at "[CHARACTER] HAS GONE TO SLEEP" text 34741 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] HAS WOKEN UP" window and return to game ; ; Used by the routine at #R31763. c34744 LD HL,46653 ; Point HL at "[CHARACTER] HAS WOKEN UP" text 34747 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] HAS GONE AWAY" window and return to game ; ; Used by the routine at #R31804. c34750 LD HL,46681 ; Point HL at "[CHARACTER] HAS GONE AWAY" text 34753 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] HAS TAKEN REFRESHMENT" window and return to game ; ; Used by the routine at #R31920. c34756 LD HL,46755 ; Point HL at "[CHARACTER] HAS TAKEN REFRESHMENT" text 34759 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Display "[CHARACTER] WILL TRY TO BE HAPPY" window and return to game ; ; Used by the routine at #R31980. c34762 LD HL,46789 ; Point HL at "[CHARACTER] WILL TRY TO BE HAPPY" text 34765 JP 34812 ; Draw window (index 29) with text pointed to by HL ; Adjust the Height and Display a Message Window, then Return to Game ; ; Used by the routines at #R33129, #R33811, #R33883, #R33935, #R33993, #R34062, #R34106, #R34544, #R34552, #R34560, ; #R34568, #R34576, #R34584, #R34730, #R34799, #R34803, #R34808, #R34812, #R34816, #R34914 and #R35393. Input: A ; Window index HL Points to text to show in window c34768 PUSH HL ; Store HL 34769 LD L,A ; Load index A into HL... 34770 LD H,0 ; ... 34772 EX AF,AF' ; Exchange AF 34773 ADD HL,HL ; Multiply HL by 8... 34774 ADD HL,HL ; ... 34775 ADD HL,HL ; ... 34776 LD DE,41877 ; Point DE at bottom position of first window in window data table... 34779 ADD HL,DE ; ...then add this to HL to obtain bottom position of window A location 34780 POP DE ; Restore pointer to text to show in window 34781 LD A,(DE) ; Load the first character of the text (a height value) into A... 34782 LD (HL),A ; ...and from there into window table, thereby adjusting the height of the window! 34783 INC DE ; Move to next character (which should be the true start of the text) 34784 PUSH DE ; Store this pointer 34785 EX AF,AF' ; Switch back to restore window index to A 34786 CALL 36987 ; Draw the window with index A 34789 POP HL ; Restore pointer to text to HL 34790 CALL 36725 ; Print the text into the window 34793 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 34796 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Draw Window (Index 2) with Text at HL ; ; Used by the routine at #R32258. Input: HL Points to text to write in window c34799 LD A,2 ; Draw window (index 2) with text pointed to by HL... 34801 JR 34768 ; ...and return to game ; Draw Window (Index 13) with Text at HL ; ; Used by the routines at #R34418, #R34424, #R34430, #R34436, #R34442, #R34448, #R34454, #R34460, #R34466, #R34472 ; and #R34592. Input: HL Points to text to write in window c34803 LD A,13 ; Draw window (index 13) with text pointed to by HL... 34805 JP 34768 ; ...and return to game ; Draw Window (Index 28, Summoning Messages) with Text at HL ; ; Used by the routines at #R33312, #R34598, #R34604, #R34610, #R34616, #R34622 and #R34628. Input: HL Points to ; text to write in window c34808 LD A,28 ; Draw window (index 28) with text pointed to by HL... 34810 JR 34768 ; ...and return to game ; Draw Window (Index 29) with Text at HL ; ; Used by the routines at #R34478, #R34484, #R34490, #R34496, #R34502, #R34508, #R34514, #R34520, #R34526, #R34532, ; #R34538, #R34738, #R34744, #R34750, #R34756 and #R34762. Input: HL Points to text to write in window c34812 LD A,29 ; Draw window (index 29) with text pointed to by HL... 34814 JR 34768 ; ...and return to game ; Draw Window (Index 35) with Text at HL ; ; Used by the routines at #R34634, #R34640, #R34646, #R34652, #R34658, #R34664, #R34670, #R34676, #R34682, #R34688, ; #R34694, #R34700, #R34706, #R34712, #R34718 and #R34724. Input: HL Points to text to write in window c34816 LD A,35 ; Draw window (index 35) with text pointed to by HL... 34818 JP 34768 ; ...and return to game ; Update Magic Knight's Current Frame Based on x-Coordinate (Walking Left) ; ; Used by the routines at #R27176, #R27495 and #R28092. Output: A Frame number The operand of the instruction at ; #R34821 represents the address of the appropriate "walking" routine to jump to (either #R34824 for walking left or ; #R34838 for walking right). This is modified by the instructions at #R27327, #R29527, #R29549 and #R29565. c34821 JP 34824 ; Jump to walking left or walking right version of routine *34824 LD B,5 ; Load B with 5 (as first graphic frame of Magic Knight walking left is frame number 5) ; This entry point is used by the routine at #R34838. *34826 LD HL,25387 ; Point HL at Magic Knight's current data (x- and y-coordinates, etc.) 34829 LD A,(HL) ; Load A with Magic Knight's x-coordinate 34830 RRCA ; Divide Magic Knight's x-coordinate by 2... 34831 AND 3 ; ...and take lowest two bits (0 - 3) 34833 ADD A,B ; Add result to B (1 for walking right frames or 5 for walking left frames) to get current ; required frame 34834 LD (25390),A ; Load frame number into Magic Knight's properties 34837 RET ; Return ; Update Magic Knight's Current Frame Based on x-Coordinate (Walking Right) c34838 LD B,1 ; Load B with 1 (as first graphic frame of Magic Knight walking right is frame number 1) 34840 JR 34826 ; Return to routine at #R34821 ; Advance HL to B-th Entry in List of Zero-Terminated Strings (e.g. Object Names Table) ; ; Used by the routines at #R30222, #R31370, #R34864 and #R34914. Input: B Index of required text string Output: HL ; Points to string of index B (input) c34842 LD HL,41236 ; Point HL at start of object names table ; This entry point is used by the routines at #R31370, #R32655, #R33663, #R34106, #R34854 and #R34859. *34845 LD A,B ; Load string index into A 34846 OR A ; Return if index is zero... 34847 RET Z ; ... *34848 CALL 36703 ; Advance HL to start of next zero-terminated string 34851 DJNZ 34848 ; Decrease B and repeat loop 34853 RET ; Return ; Advance HL to the B-th Entry in List of Readable Objects' Texts at 47322 then Return ; ; Used by the routine at #R32258. Input: B Index of required text string c34854 LD HL,47322 ; Point HL at start of list of readable objects' texts 34857 JR 34845 ; Jump to routine that iterates through list of zero-terminated strings to get B-th entry then ; return ; Advance HL to the B-th Entry in List of Option Texts from "Command a Character" Menu then Return ; ; Used by the routine at #R31636. Input: B Index of required text string c34859 LD HL,46490 ; Point HL at list of option texts from "COMMAND A CHARACTER" menu 34862 JR 34845 ; Jump to routine that iterates through list of zero-terminated strings to get B-th entry then ; return ; Point DE at Name of a Selected Object in Object Names Table and Print in Command Summary Window ; ; Used by the routines at #R30439, #R30602, #R30880, #R31370, #R32258, #R32390 and #R33312. Input: A ASCII code of ; letter corresponding to an inventory slot (e.g. "B" is second inventory slot) HL Points to start of a character's ; inventory c34864 SUB 65 ; Convert A from ASCII code to inventory slot number 34866 LD E,A ; Load inventory slot number into DE... 34867 LD D,0 ; ... 34869 ADD HL,DE ; Add to HL as offset 34870 LD A,(HL) ; Load index of object in that slot into A 34871 LD (30467),A ; Set this object as the Current Object 34874 LD B,A ; Also load index into B 34875 CALL 34842 ; Point HL at name of object in object names table 34878 EX DE,HL ; Switch registers so DE points to object name and HL contains inventory slot number 34879 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 34882 RET ; Return ; Update Current Character Based Upon Selection Made in Menu ; ; Used by the routine at #R35141. Input: A ASCII code of letter corresponding to a character listed in a ; character-selection menu (e.g. "B" is second character) c34883 LD HL,23464 ; Point HL at table of indices of characters in current room 34886 SUB 65 ; Subtract 65 (ASCII code for "A") 34888 LD E,A ; Load remainder (i.e. index of selected item in menu) into DE... 34889 LD D,0 ; ... 34891 ADD HL,DE ; Add this as offset to table of characters in current room to identify one of those as the ; character of interest 34892 LD A,(HL) ; Load index of this character into A 34893 LD (30615),A ; Modify instruction at #R30614 to set the Current Character ; This entry point is used by the routines at #R30602 and #R35293. *34896 LD DE,34903 ; Point DE to code to print short name of Current Character... 34899 CALL 38693 ; ...and print in Command Summary Window at bottom of screen 34902 RET ; Return ; Code for Printing Routine to Display Short Name of Current Character b34903 DEFM 31,0 ; short name of Current Character ; Code for Printing Routine to Display Full Name of Current Character b34905 DEFM 30,0 ; full name of Current Character ; Display a Character's Inventory Window as an Information Window ; ; Used by the routine at #R30222. Input: IX Points to a character's inventory (usually Magic Knight) c34907 LD A,111 ; Modify instruction at 34989 to display as information window, rather than menu window... 34909 LD (34990),A ; ... 34912 JR 34959 ; Jump into inventory window drawing routine ; Show List of Objects (Window or Menu) and Handle Selection if a Menu ; ; Used by the routines at #R30439, #R30602, #R30880, #R31370, #R32258, #R32390 and #R33312. Input: B Number of ; inventory slots to check DE Points to summary command text (e.g. "BLOW"), or 0 for no summary text HL Points to ; full command text (e.g. "BLOW WHICH OBJECT?", or "YOU ARE NOW CARRYING") IX Points to a character's inventory ; Output: A ASCII code for letter of selected menu item c34914 PUSH BC ; Store BC (B = number of inventory slots) 34915 PUSH DE ; Store DE 34916 PUSH HL ; Store HL 34917 PUSH IX ; Store IX 34919 CALL 38108 ; Set parameters for and play downward scale sound 34922 POP IX ; Restore IX 34924 POP HL ; Restore HL 34925 POP DE ; Restore DE 34926 POP BC ; Restore BC (B = number of inventory slots) 34927 LD A,(IX+0) ; Load first object in character's inventory into A 34930 OR A ; If nothing in first slot... 34931 JP Z,35069 ; ...jump ahead to #R35069 (display "YOU ARE NOT CARRYING ANYTHING" message and return to game) 34934 LD A,105 ; Modify instruction at #R34989 with 105, denoting window as a menu rather than information ; window... 34936 LD (34990),A ; ... 34939 PUSH BC ; Store BC (B = number of inventory slots) 34940 PUSH HL ; Store HL 34941 PUSH IX ; Store IX 34943 LD A,D ; If DE is zero (i.e. summary command text unset)... 34944 OR E ; ... 34945 JR Z,34955 ; ...jump ahead to #R34955 34947 PUSH DE ; Store DE 34948 CALL 37654 ; Display / update command summary window at bottom of screen 34951 POP DE ; Restore DE 34952 CALL 38693 ; ...and print in Command Summary Window at bottom of screen *34955 POP IX ; Restore IX 34957 POP HL ; Restore HL 34958 POP BC ; Restore BC (B = number of inventory slots) ; This entry point is used by the routine at #R34907. *34959 LD C,0 ; Load C (object counter) with zero 34961 PUSH BC ; Store BC (B = number of inventory slots) 34962 PUSH IX ; Store IX *34964 LD A,(IX+0) ; Load object from character's inventory (slot number C) into A 34967 OR A ; If nothing in this slot... 34968 JR Z,34975 ; ...then jump ahead to #R34975 34970 INC C ; Increase count of objects in inventory 34971 INC IX ; Advance IX to next slot 34973 DJNZ 34964 ; Repeat for next slot *34975 POP IX ; Restore IX (points to start of inventory) 34977 LD A,C ; Copy number of objects into A 34978 OR A ; If number of objects is zero... (see trivia) 34979 JP Z,35078 ; ...then jump ahead to #R35078 34982 LD A,C ; Copy number of objects into A 34983 ADD A,3 ; Add 3 to this (menu window padding) 34985 LD (41909),A ; Modify height of window 4 to accommodate list of C objects 34988 PUSH HL ; Store HL (pointer to full command text) ; The operand of the instruction at #R34989 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instruction at #R34936. 34989 LD A,0 ; Load A with "Draw Hand Menu Cursor" Flag 34991 CP 105 ; If this is not 105 (i.e. window is not a menu, but a simple information window)... 34993 JR NZ,35002 ; ...then jump ahead to #R35002 34995 LD A,4 ; Draw a menu window... 34997 CALL 36979 ; ... 35000 JR 35007 ; ...and skip over "draw an information window" section *35002 LD A,4 ; Draw window 4... 35004 CALL 36987 ; ... *35007 LD A,64 ; Set character at 43221 (letter preceding menu items) to "@" (i.e. the character immediately ; before "A")... 35009 LD (43221),A ; ... 35012 POP HL ; Restore HL (pointer to full command text)... 35013 CALL 36725 ; ...and print the text 35016 POP BC ; Restore BC (B = number of remaining inventory slots) *35017 PUSH BC ; Store BC (B = number of remaining inventory slots) 35018 LD A,(IX+0) ; Load index of first object in inventory into A 35021 OR A ; If index is zero (i.e. if nothing in inventory)... 35022 JP Z,35064 ; ...then skip ahead to #R35064 35025 LD B,A ; Copy index into B 35026 PUSH IX ; Store IX (pointer to start of inventory) 35028 LD HL,43221 ; Point HL to letter shortcut (currently set to "@" as at instruction #R35007)... 35031 LD A,(HL) ; ... 35032 INC A ; ... 35033 LD (HL),A ; ...and increase index by one to change to "A" 35034 LD HL,43220 ; Point HL to 43220 35037 PUSH BC ; Store BC (B = index of an object) 35038 CALL 36725 ; Print text (i.e. "A] ") to screen 35041 POP BC ; Restore BC (B = index of an object) 35042 CALL 34842 ; Point HL to B-th entry in list of object names 35045 CALL 36725 ; Print object name to screen 35048 POP IX ; Restore IX (pointer to start of inventory) 35050 INC IX ; Advance IX to next inventory slot 35052 POP BC ; Restore BC (B = number of remaining inventory slots) 35053 DJNZ 35017 ; Repeat loop for next object in inventory, decreasing B (number of remaining inventory slots) 35055 LD A,(34990) ; If window is a menu, rather than information window... 35058 CP 105 ; ... 35060 CALL Z,37333 ; ...then process keyboard / joystick input for menu, and load ASCII code of shortcut for ; selected (i.e. SPACE or fire pressed) item into A... 35063 RET ; ...and return *35064 POP BC ; Restore BC 35065 CALL Z,37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 35068 RET ; Return *35069 LD A,13 ; Display "YOU ARE NOT CARRYING ANYTHING" window... 35071 POP HL ; ...restoring HL... 35072 LD HL,45447 ; ... 35075 JP 34768 ; ...and return to game *35078 PUSH HL ; Store HL (points to full command text, e.g. "BLOW WHICH OBJECT?", or "YOU ARE NOW CARRYING") 35079 LD A,4 ; Modify height of window 4... 35081 LD (41909),A ; ... 35084 LD A,4 ; Draw window 4... 35086 CALL 36987 ; ... 35089 POP HL ; Restore HL (points to window title line, e.g. "BLOW WHICH OBJECT?", or "YOU ARE NOW ; CARRYING") 35090 CALL 36725 ; Print the text 35093 LD HL,41236 ; Point HL at NOTHING AT ALL text... 35096 CALL 36725 ; ...and print 35099 POP BC ; Restore BC 35100 RET ; Return ; Display Cyan "Game Over" Window and Return to Pre-Game Menu ; ; Used by the routines at #R27176, #R27865, #R29800, #R29880, #R29915, #R30602, #R32390, #R32876, #R33180, #R33269, ; #R35993, #R55461 and #R55478. Input: HL Points to location of a string (e.g. "YOU DIED OF EXHAUSTION...") c35101 RES 0,(IY+65) ; Reset "Update Game Time and Locate Arrow Glow" flag 35105 LD A,(HL) ; Set height of window to accommodate text... 35106 LD (42141),A ; ... 35109 INC HL ; Advance to first character of message... 35110 PUSH HL ; ...and store for later use 35111 LD A,33 ; Draw window 33 ("Game Over" window with modified height, as above)... 35113 CALL 36987 ; ... 35116 LD HL,43247 ; Point to string for percentage completion 35119 LD DE,43259 ; Point to string for time left 35122 CALL 34268 ; Insert current time and score into "TIME LEFT" and "PERCENTAGE COMPLETION" texts 35125 LD HL,43224 ; Point HL at "GAME OVER / TOTAL COMPLETION XX% / TIME LEFT XX HOURS" text... 35128 CALL 36725 ; ...and print it to screen 35131 POP HL ; Restore HL (pointer to first character of message pointed to on entry to routine)... 35132 CALL 36725 ; ...and print it to screen 35135 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 35138 JP 26673 ; Jump back to pre-game menu (select input device, view instructions, play game, etc.) ; Display and Process Input for Character Selection Menu (Current Room's Characters Only) ; ; Used by the routines at #R30602, #R30880, #R31370, #R31636 and #R32390. Input: HL Pointer to primary text DE ; Pointer to secondary text c35141 PUSH HL ; Store HL 35142 PUSH BC ; Store BC 35143 PUSH IX ; Store IX 35145 PUSH DE ; Store DE 35146 CALL 38116 ; Play short downward scale sound 35149 POP DE ; Restore DE 35150 LD A,D ; If DE is zero... 35151 OR E ; ... 35152 JR Z,35162 ; ...then skip ahead to #R35162 35154 PUSH DE ; Store DE 35155 CALL 37654 ; Display / update command summary window at bottom of screen 35158 POP DE ; Restore DE 35159 CALL 38693 ; ...and print in Command Summary Window at bottom of screen *35162 LD A,(65529) ; Load A with Magic Knight's current room 35165 CALL 35931 ; Load number of characters in this room into C and load their indices into table at 23464 35168 JR NZ,35199 ; If there are characters present then jump to #R35199 35170 LD HL,44035 ; Point HL at "THERE IS NOBODY IN THIS ROOM" text 35173 LD A,(HL) ; Load text height (rows) into A... 35174 LD (41981),A ; ...and then into stored bottom y-coordinate of window #13 35177 INC HL ; Advance HL to next byte (start of actual text) 35178 PUSH HL ; Store HL 35179 LD A,13 ; Draw window 13... 35181 CALL 36987 ; ... 35184 POP HL ; Restore HL 35185 CALL 36725 ; Print "THERE IS NOBODY IN THIS ROOM" text to screen 35188 CALL 38749 ; Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire 35191 POP IX ; Restore IX 35193 POP BC ; Restore BC 35194 POP HL ; Restore HL 35195 POP HL ; Restore HL again (as this routine was CALLed, but we are not RETurning from it, so need to ; keep stack tidy!) 35196 JP 30428 ; Reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop *35199 ADD A,4 ; Add four to number of characters in current room (for menu size padding) 35201 LD (41901),A ; Load value into "bottom position (characters)" field of fourth window in windows data table ; at #R41874 (i.e. adjust window's height to accommodate all the characters present) 35204 POP IX ; Restore IX 35206 POP BC ; Restore BC 35207 LD A,3 ; Draw "WHO DO YOU WANT TO COMMAND?" menu window... 35209 CALL 36979 ; ... 35212 LD HL,44017 ; Point HL at "WHO DO YOU WANT TO COMMAND?" text 35215 CALL 36725 ; Print text in window 35218 POP HL ; Restore HL (primary text, as at beginning of this routine) 35219 CALL 36725 ; Print text in window 35222 LD HL,43221 ; Point HL at "0]" text (i.e. letters corresponding to menu items) 35225 LD A,64 ; Set this character to ASCII code 64 (character immediately before "A")... 35227 LD (HL),A ; ... 35228 LD IX,23464 ; Point IX at table of indices of characters in current room 35232 LD B,3 ; Load 3 into B (as we can have up to three characters in this room) *35234 PUSH BC ; Store BC 35235 LD A,(IX+0) ; Load index of next character in room... 35238 CP 255 ; ...compare with 255 (i.e. empty slot)... 35240 JP Z,35282 ; ...and if this is an empty slot (i.e. no more characters) then jump to #R35282 35243 LD HL,43221 ; Point HL at "0]" text (i.e. letters corresponding to menu items) 35246 LD A,(HL) ; Load the first text character into A... 35247 INC A ; ...increment... 35248 LD (HL),A ; ...and write back to location HL (i.e. advance to next letter, as menu choices are labelled ; A, B, C, etc.) 35249 LD HL,43220 ; Point to beginning of this modified string... 35252 CALL 36725 ; ...and print it to screen 35255 LD A,(IX+0) ; Load index of character into A again... 35258 LD (30615),A ; ...and set this as the Current Character 35261 LD HL,34905 ; Point HL to code to print full name of Current Character... 35264 CALL 36725 ; ...and print it to screen 35267 INC IX ; Advance IX to next character 35269 POP BC ; Restore BC 35270 DJNZ 35234 ; Repeat loop if we have not yet reached the third character 35272 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 35275 CALL 34883 ; Update Current Character based upon selection made in menu 35278 CALL 35393 ; Display warning and abort if command is not safe while Gimbal whited-out 35281 RET ; Return *35282 POP BC ; Restore BC 35283 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 35286 CALL 34883 ; Update Current Character based upon selection made in menu 35289 CALL 35393 ; Display warning and abort if command is not safe while Gimbal whited-out 35292 RET ; Return ; Display and Process Input for Character Selection Menu for "Travel To", "Summon" or "Locate" ; ; Used by the routines at #R32035, #R33036 and #R33312. Input: HL (On stack) Pointer to text ("TRAVEL TO", ; "SUMMON" or "LOCATE") pushed onto stack before call to this routine c35293 CALL 38116 ; Set parameters for and play short downward scale sound... 35296 CALL 38116 ; ...twice 35299 LD A,(23467) ; Load A with 1 if Banshee is released, else load with 0... 35302 AND 1 ; ... 35304 ADD A,11 ; Set height of character selection menu window according to whether or not Banshee is free... 35306 LD (41901),A ; ... 35309 LD A,3 ; Display character selection menu... 35311 CALL 36979 ; ... 35314 LD HL,44017 ; Print "WHO DO YOU WANT TO..." text... 35317 CALL 36725 ; ... 35320 POP HL ; Restore HL (address to return to upon RET instruction)... 35321 EX (SP),HL ; ...and swap with next value on stack (pointer to text that was PUSHed before this routine was ; called) 35322 CALL 36725 ; Print the text 35325 LD HL,43221 ; Set character at 43221 (letter preceding menu items) to "@" (i.e. the character immediately ; before "A")... 35328 LD A,64 ; ... 35330 LD (HL),A ; ... 35331 LD B,7 ; Load B with 7 as there are initially 7 characters 35333 LD A,(23467) ; If Banshee is not released... 35336 BIT 0,A ; ... 35338 JR Z,35341 ; ...then skip ahead to #R35341 35340 INC B ; Add one as with Banshee free there are 8 characters *35341 LD A,B ; Load number of characters into A... 35342 LD (35375),A ; ...and use to modify instruction at #R35374 35345 XOR A ; Set B to zero... 35346 LD B,A ; ... *35347 PUSH AF ; Store AF 35348 PUSH BC ; Store BC 35349 LD (30615),A ; Change Current Character to value in A 35352 LD A,B ; Copy B into A 35353 ADD A,65 ; Set character at 43221 (letter preceding menu items) to ASCII code of "A", plus index of ; character... 35355 LD (43221),A ; ... 35358 LD HL,43220 ; Point HL at this prefix text... 35361 CALL 36725 ; ...and print it 35364 LD HL,34905 ; Point HL to code to print full name of Current Character... 35367 CALL 36725 ; ...and print it 35370 POP BC ; Restore BC (B=current character number) 35371 INC B ; Increase B for next character 35372 POP AF ; Restore AF 35373 INC A ; Increase A to count number characters printed in menu ; The operand of the instruction at #R35374 represents the number of currently active characters in the game ; (excluding Magic Knight). This is modified by the instruction at #R35342. 35374 CP 7 ; If number of characters printed is not equal to number of characters to print... 35376 JR NZ,35347 ; ...then loop back to #R35347 for next character 35378 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A 35381 SUB 65 ; Subtract ASCII code of "A" from letter of character chosen to get index of selected character ; in A 35383 LD (30615),A ; Set this to be the Current Character 35386 CALL 34896 ; Print short name of Current Character in command summary window at bottom of screen 35389 CALL 35393 ; Display warning and abort if command is not safe while Gimbal whited-out 35392 RET ; Return ; Display Warning and Abort if Command is not Safe While Gimbal is Whited-Out ; ; Used by the routines at #R35141 and #R35293. c35393 LD A,(30615) ; Load index of Current Character into A 35396 OR A ; If not zero (Gimbal)... 35397 RET NZ ; ...then return 35398 LD A,(23377) ; If Gimbal-White-Out Safe Flag is set... 35401 AND 1 ; ... 35403 RET NZ ; ...then return 35404 LD A,(23468) ; If Gimbal is released... 35407 AND 1 ; ... 35409 RET NZ ; ...then return 35410 POP HL ; Restore HL 35411 POP HL ; Restore HL 35412 LD A,32 ; Display "GIMBAL IS NOT YET RELEASED..." window and return to game... 35414 LD HL,43274 ; ... 35417 JP 34768 ; ... ; Select Magic Knight's Room (Cheat / Debug Routine) ; ; Used by the routine at #R27236. c35420 CALL 38183 ; Play Cheat Routine Sound 35423 CALL 26835 ; Wait for a key-press then beep, loading index of pressed key into A 35426 CP 88 ; If "X" is pressed... 35428 JP Z,26742 ; ...then return to BASIC 35431 CP 48 ; If a key with an index lower than "0" is pressed then exit this routine... 35433 JP M,35489 ; ... 35436 CP 53 ; If a key with an index equal to or higher than "5" is pressed then exit this routine... 35438 JP NC,35489 ; ... 35441 SUB 48 ; Subtract 48 (ASCII code for "0") from index of key pressed to convert to a number 35443 LD B,A ; Multiply number by 10 in A... 35444 ADD A,A ; ... 35445 ADD A,A ; ... 35446 ADD A,B ; ... 35447 ADD A,A ; ... 35448 LD (65529),A ; Set Magic Knight's current room to this value 35451 CALL 26835 ; Wait for a key-press then beep, loading index of pressed key into A 35454 CP 88 ; If "X" is pressed... 35456 JP Z,26742 ; ...then return to BASIC 35459 CP 48 ; If a key with an index lower than "0" is pressed then exit this routine... 35461 JP M,35489 ; ... 35464 CP 58 ; If a key with an index equal to or higher than ":" (one immediately after "9") is pressed ; then exit this routine... 35466 JP NC,35489 ; ... 35469 SUB 48 ; Subtract 48 (ASCII code for "0") from index of key pressed to convert to a number 35471 LD B,A ; Add value of this second digit to value in Magic Knight's current room... 35472 LD A,(65529) ; ... 35475 ADD A,B ; ... 35476 LD (65529),A ; ... 35479 XOR A ; Set Magic Knight's current frame to erase to zero (frame 0 is blank graphic data) so Magic ; Knight is drawn but not erased... 35480 LD (25389),A ; ... 35483 CALL 38108 ; Set parameters for and play downward scale sound 35486 JP 27168 ; Redraw current room and return to game *35489 CALL 38183 ; Play Cheat Routine Sound 35492 JP 27176 ; Jump to start of Main Game Loop ; Set Magic Knight's Available Action Flags ; ; Used by the routines at #R26906, #R29446, #R30222 and #R32390. c35495 CALL 35536 ; Set the "Magic Knight Can Command" flag if he is carrying the wand of command 35498 CALL 35567 ; Set the "Magic Knight Can Locate" flag if he is carrying the crystal ball 35501 CALL 35598 ; Set the "Magic Knight Can Teleport" flag if he is carrying the teleport key 35504 CALL 35629 ; Set the "Magic Knight Can Read" flag if he is carrying a readable object 35507 CALL 35669 ; Set the "Magic Knight Can Throw" flag if he is carrying a throwable object 35510 CALL 35709 ; Set the "Magic Knight Can Cast a spell" flag if he is carrying a magic object 35513 CALL 35749 ; Set the "Magic Knight Can Blow" flag if he is carrying a blowable object 35516 CALL 35789 ; Set the "Magic Knight Can Call Lift" flag if he is in the first room of a floor 35519 CALL 35815 ; Set the "Magic Knight Can Move Lift" flag if he is in the Lift 35522 LD A,(65529) ; Load A with Magic Knight's current room... 35525 OR A ; ...and if he is not in the Lift... 35526 RET NZ ; ...then return 35527 LD A,(65532) ; If he IS in the lift... 35530 RES 1,A ; ...reset the "Magic Knight Can Locate" flag (i.e. false)... 35532 LD (65532),A ; ... 35535 RET ; Return ; Set the "Magic Knight Can Command" Flag if he is Carrying the Wand of Command ; ; Used by the routine at #R35495. c35536 LD A,(65532) ; Reset "Magic Knight Can Command" flag (i.e. false)... 35539 RES 0,A ; ... 35541 LD (65532),A ; ... 35544 LD HL,25395 ; Point HL to start of Magic Knight's current inventory 35547 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) *35549 LD A,(HL) ; Load index of object carried by Magic Knight into A 35550 CP 7 ; And if this is the Wand of Command (object 7)... 35552 JR Z,35558 ; ...then skip to #R35558... 35554 INC HL ; ...else advance to next inventory slot... 35555 DJNZ 35549 ; ...and repeat 35557 RET ; If this was last slot, then return with "Magic Knight Can Command" flag unset *35558 LD A,(65532) ; Set "Magic Knight Can Command" flag (i.e. true)... 35561 SET 0,A ; ... 35563 LD (65532),A ; ... 35566 RET ; Return ; set the "Magic Knight Can Locate" Flag if he is Carrying the Crystal Ball ; ; Used by the routine at #R35495. c35567 LD A,(65532) ; Reset "Magic Knight Can Locate" flag (i.e. false)... 35570 RES 1,A ; ... 35572 LD (65532),A ; ... 35575 LD HL,25395 ; Point HL to start of Magic Knight's current inventory 35578 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) *35580 LD A,(HL) ; Load index of object carried by Magic Knight into A 35581 CP 6 ; And if this is the Crystal Ball (object 6)... 35583 JR Z,35589 ; ...then skip to #R35589... 35585 INC HL ; ...else advance to next inventory slot... 35586 DJNZ 35580 ; ...and repeat 35588 RET ; If this was last slot, then return with "Magic Knight Can Locate" flag unset *35589 LD A,(65532) ; Set "Magic Knight Can Locate" flag (i.e. true)... 35592 SET 1,A ; ... 35594 LD (65532),A ; ... 35597 RET ; Return ; Set the "Magic Knight Can Teleport" Flag if he is Carrying the Teleport Key ; ; Used by the routine at #R35495. c35598 LD A,(65532) ; Reset "Magic Knight Can Teleport" flag (i.e. false)... 35601 RES 2,A ; ... 35603 LD (65532),A ; ... 35606 LD HL,25395 ; Point HL to start of Magic Knight's current inventory 35609 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) *35611 LD A,(HL) ; Load index of object carried by Magic Knight into A 35612 CP 48 ; And if this is the Teleport Key (object 48)... 35614 JR Z,35620 ; ...then skip to #R35620... 35616 INC HL ; ...else advance to next inventory slot... 35617 DJNZ 35611 ; ...and repeat 35619 RET ; If this was last slot, then return with "Magic Knight Can Teleport" flag unset *35620 LD A,(65532) ; Set "Magic Knight Can Teleport" flag (i.e. true)... 35623 SET 2,A ; ... 35625 LD (65532),A ; ... 35628 RET ; Return ; Set the "Magic Knight Can Read" Flag if he is Carrying a Readable Object ; ; Used by the routine at #R35495. c35629 LD A,(65532) ; Reset "Magic Knight Can Read" flag (i.e. false)... 35632 RES 3,A ; ... 35634 LD (65532),A ; ... 35637 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) 35639 LD IX,25395 ; Point IX to start of Magic Knight's current inventory *35643 LD A,(IX+0) ; Load index of object carried by Magic Knight into A 35646 LD E,2 ; Point HL to property 2 ("Read Text") of this object (in table at #R42242)... 35648 CALL 34160 ; ... 35651 LD A,(HL) ; ...and load into A 35652 OR A ; If "Read Text" property is not zero (i.e. if object can be read)... 35653 JR NZ,35660 ; ...then skip to #R35660... 35655 INC IX ; ...else advance to next inventory slot... 35657 DJNZ 35643 ; ...and repeat 35659 RET ; If this was last slot, then return with "Magic Knight Can Read" flag unset *35660 LD A,(65532) ; Set "Magic Knight Can Read" flag (i.e. true)... 35663 SET 3,A ; ... 35665 LD (65532),A ; ... 35668 RET ; Return ; Set the "Magic Knight Can Throw" Flag if he is Carrying a Throwable Object ; ; Used by the routine at #R35495. c35669 LD A,(65532) ; Reset "Magic Knight Can Throw" flag (i.e. false)... 35672 RES 4,A ; ... 35674 LD (65532),A ; ... 35677 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) 35679 LD IX,25395 ; Point IX to start of Magic Knight's current inventory *35683 LD A,(IX+0) ; Load index of object carried by Magic Knight into A 35686 LD E,4 ; Point HL to property 4 ("use status") of this object (in table at #R42242)... 35688 CALL 34160 ; ... 35691 BIT 1,(HL) ; ...and if bit 1 (Throw status) of this is set... 35693 JR NZ,35700 ; ...then skip to #R35700... 35695 INC IX ; ...else advance to next inventory slot... 35697 DJNZ 35683 ; ...and repeat 35699 RET ; If this was last slot, then return with "Magic Knight Can Throw" flag unset *35700 LD A,(65532) ; Set "Magic Knight Can Throw" flag (i.e. true)... 35703 SET 4,A ; ... 35705 LD (65532),A ; ... 35708 RET ; Return ; Set the "Magic Knight Can Cast a Spell" Flag if he is Carrying a Magic Object ; ; Used by the routine at #R35495. c35709 LD A,(65532) ; Reset "Magic Knight Can Cast a Spell" flag (i.e. false)... 35712 RES 5,A ; ... 35714 LD (65532),A ; ... 35717 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) 35719 LD IX,25395 ; Point IX to start of Magic Knight's current inventory *35723 LD A,(IX+0) ; Load index of object carried by Magic Knight into A 35726 LD E,3 ; Point HL to property 3 ("Magic Power") of this object (in table at #R42242)... 35728 CALL 34160 ; ... 35731 LD A,(HL) ; ...and load into A 35732 OR A ; If "Magic Power" property is not zero (i.e. if object is magic)... 35733 JR NZ,35740 ; ...then skip to #R35740... 35735 INC IX ; ...else advance to next inventory slot... 35737 DJNZ 35723 ; ...and repeat 35739 RET ; If this was last slot, then return with "Magic Knight Can Cast a Spell" flag unset *35740 LD A,(65532) ; Set "Magic Knight Can Cast a Spell" flag (i.e. true)... 35743 SET 5,A ; ... 35745 LD (65532),A ; ... 35748 RET ; Return ; Set the "Magic Knight Can Blow" Flag if he is Carrying a Blowable Object ; ; Used by the routine at #R35495. c35749 LD A,(65532) ; Reset "Magic Knight Can Blow" flag (i.e. false)... 35752 RES 6,A ; ... 35754 LD (65532),A ; ... 35757 LD B,5 ; Set counter to 5 (as Magic Knight can carry 5 objects) 35759 LD IX,25395 ; Point IX to start of Magic Knight's current inventory *35763 LD A,(IX+0) ; Load index of object carried by Magic Knight into A 35766 LD E,4 ; Point HL to property 4 ("Use Status") of this object (in table at #R42242)... 35768 CALL 34160 ; ... 35771 BIT 0,(HL) ; ...and if bit 0 (Blow status) of this is set... 35773 JR NZ,35780 ; ...then skip to #R35780... 35775 INC IX ; ...else advance to next inventory slot... 35777 DJNZ 35763 ; ...and repeat 35779 RET ; If this was last slot, then return with "Magic Knight Can Blow" flag unset *35780 LD A,(65532) ; Set "Magic Knight Can Blow" flag (i.e. true)... 35783 SET 6,A ; ... 35785 LD (65532),A ; ... 35788 RET ; Return ; Set the "Magic Knight Can Call Lift" Flag if he is in the First Room of a Floor ; ; Room numbers from which lift can be called: c35789 LD A,(65532) ; Reset "Magic Knight Can Call Lift" flag (i.e. false)... 35792 RES 7,A ; ... 35794 LD (65532),A ; ... 35797 LD A,(65529) ; Load A with Magic Knight's current room 35800 OR A ; If room number is zero (i.e. "The Lift")... 35801 RET Z ; ...then return with flag unset 35802 DEC A ; Decrease room number by one 35803 AND 7 ; If this value is not a multiple of eight (i.e. a room from which the lift can be called)... 35805 RET NZ ; ...then return with flag unset 35806 LD A,(65532) ; Set "Magic Knight Can Call Lift" flag (i.e. true)... 35809 SET 7,A ; ... 35811 LD (65532),A ; ... 35814 RET ; Return ; Set the "Magic Knight Can Move Lift" Flag if he is in the Lift ; ; Used by the routine at #R35495. c35815 LD A,(65533) ; Reset "Magic Knight Can Move Lift" flag (i.e. false)... 35818 RES 0,A ; ... 35820 LD (65533),A ; ... 35823 LD A,(65529) ; Load A with Magic Knight's current room 35826 OR A ; If room number is not zero (i.e. not "The Lift")... 35827 RET NZ ; ...then return with flag unset 35828 LD A,(65533) ; Set "Magic Knight Can Move Lift" flag (i.e. true)... 35831 SET 0,A ; ... 35833 LD (65533),A ; ... 35836 RET ; Return ; Insert Numeric Stats (at HL) of a Character into "Examine Character" Window Text ; ; Used by the routine at #R31370. Input: HL Points to strength of a character c35837 PUSH HL ; Store HL (pointer to strength) 35838 LD A,(HL) ; Load strength into A 35839 PUSH HL ; Store HL (pointer to strength) 35840 LD HL,45941 ; Point HL at "strength" 99 in "EXAMINE [CHARACTER]" window text 35843 CALL 36647 ; Splice numeric data A as a string into a string at HL 35846 POP HL ; Restore HL (pointer to strength) 35847 INC HL ; Advance HL to happiness 35848 LD A,(HL) ; Load happiness into A 35849 PUSH HL ; Store HL (pointer to happiness) 35850 LD HL,45963 ; Point HL at "happiness" 99 in "EXAMINE [CHARACTER]" window text 35853 CALL 36647 ; Splice numeric data A as a string into a string at HL 35856 POP HL ; Restore HL (pointer to happiness) 35857 INC HL ; Advance HL to stamina 35858 LD A,(HL) ; Load stamina into A 35859 PUSH HL ; Store HL (pointer to stamina) 35860 LD HL,45984 ; Point HL at "stamina" 99 in "EXAMINE [CHARACTER]" window text 35863 CALL 36647 ; Splice numeric data A as a string into a string at HL 35866 POP HL ; Restore HL (pointer to stamina) 35867 INC HL ; Advance HL to spell power 35868 LD A,(HL) ; Load spell power into A 35869 PUSH HL ; Store HL (pointer to spell power) 35870 LD HL,46002 ; Point HL at "spell power" 99 in "EXAMINE [CHARACTER]" window text 35873 CALL 36647 ; Splice numeric data A as a string into a string at HL 35876 POP HL ; Restore HL (pointer to spell power) 35877 INC HL ; Advance HL to food level 35878 LD A,(HL) ; Load food level into A 35879 LD HL,46024 ; Point HL at "food level" 99 in "EXAMINE [CHARACTER]" window text 35882 CALL 36647 ; Splice numeric data A as a string into a string at HL 35885 POP HL ; Restore HL (original pointer to strength) 35886 RET ; Return ; Insert Numeric / Text Stats of an Object into "Examine Object" Window Text ; ; Used by the routine at #R31370. Input: HL Points to weight of an object c35887 LD A,(HL) ; Load A with weight of the object 35888 PUSH HL ; Store HL (pointer to weight of object) 35889 LD HL,46053 ; Point HL at numeric part of "WEIGHT XXX#" string 35892 CALL 36647 ; Splice numeric data A as a string into a string at HL 35895 POP HL ; Restore HL (pointer to weight of object) 35896 INC HL ; Advance HL to Drop Status 35897 LD B,147 ; Load B with (index for text "YES") 35899 LD A,(HL) ; Load A with Drop Status 35900 OR A ; If drop status is zero (i.e. object can be dropped)... 35901 JR Z,35904 ; ...then skip ahead to #R35904 35903 INC B ; Increase B to 148 (index for text "NO") *35904 LD A,B ; Load B into A... 35905 LD (46076),A ; ...and insert this text into the string "DROP STATUS X" 35908 INC HL ; Advance HL to "Read Text" index 35909 LD B,147 ; Load B with (index for text "YES") 35911 LD A,(HL) ; Load A with "Read Text" index 35912 OR A ; If "Read Text" index is not zero (i.e. object can be read)... 35913 JR NZ,35916 ; ...then skip ahead to #R35904 35915 INC B ; Increase B to 148 (index for text "NO") *35916 LD A,B ; Load B into A... 35917 LD (46092),A ; ...and insert this text into the string "READ STATUS X" 35920 INC HL ; Advance HL to "Magic Power" value 35921 LD A,(HL) ; Load A with "Magic Power" value 35922 PUSH HL ; Store HL (pointer to Magic Power value) 35923 LD HL,46107 ; Point HL at numeric part of "MAGIC POWER XXX#" string 35926 CALL 36647 ; Splice numeric data A as a string into a string at HL 35929 POP HL ; Restore HL (pointer to object's Magic Power value) 35930 RET ; Return ; Get Number of Characters in a Room, and Load Their Indices into Table at 23464 ; ; Used by the routine at #R35141. Input: A Room number Output: A number of characters in room A (input) C number ; of characters in room A (input) F Zero Flag reset if characters are present in room, set otherwise c35931 LD (35967),A ; Store room index in instruction at #R35966 35934 PUSH HL ; Store HL 35935 PUSH BC ; Store BC 35936 PUSH DE ; Store DE 35937 PUSH IX ; Store IX 35939 LD A,255 ; Load A with 255 35941 LD HL,23466 ; Clear "characters in current room" data table at #R23464... 35944 LD (HL),A ; ... 35945 DEC HL ; ... 35946 LD (HL),A ; ... 35947 DEC HL ; ... 35948 LD (HL),A ; ... 35949 LD IX,25440 ; Point IX at characters' current positions table 35953 LD D,0 ; Set D to zero 35955 LD BC,1792 ; Set B to 7 (as we have seven characters, excluding Banshee so loop back seven times) and C to ; 0 35958 LD A,(23467) ; If Banshee has not been released, then... 35961 BIT 0,A ; ... 35963 JR Z,35966 ; ...skip ahead to #R35966... 35965 INC B ; ...else increase B by one to take into account presence of Banshee ; The operand of the instruction at #R35966 represents the appropriate room index. This is modified by the ; instruction at #R35931. *35966 LD A,0 ; Load A with room number 35968 CP (IX+0) ; Compare to room number of current character... 35971 JR NZ,35976 ; ...and if not the same, then jump to #R35976 (i.e. move onto next character) 35973 INC C ; Increase C (number of characters in current room) by one 35974 LD (HL),D ; Store character index in table at #R23464 35975 INC HL ; *35976 INC IX ; Advance IX by three bytes, to next character's entry... 35978 INC IX ; ... 35980 INC IX ; ... 35982 INC D ; Increase D (index of current character) 35983 DJNZ 35966 ; Loop back for next character 35985 LD A,C ; Load A with number of characters in current room 35986 OR A ; Set zero flag if no characters present 35987 POP IX ; Restore IX 35989 POP DE ; Restore DE 35990 POP BC ; Restore BC 35991 POP HL ; Restore HL 35992 RET ; Return ; Update Position of Odd Ball, Display, and Decrease Magic Knight's Strength if in Contact ; ; Used by the routines at #R29776 and #R29874. Input: A Ball number (0, 1, 2 or 3) c35993 ADD A,A ; Multiply value of A by eight... 35994 ADD A,A ; ... 35995 ADD A,A ; ... 35996 LD C,A ; Store in C 35997 LD B,0 ; Set B to zero 35999 LD IX,36183 ; Set IX to point to data for balls 36003 ADD IX,BC ; Add eight times ball number as offset to IX pointer 36005 LD C,(IX+0) ; Load ball's x-coordinate into C 36008 LD B,(IX+1) ; Load ball's y-coordinate into B 36011 PUSH BC ; Store BC 36012 LD (23677),BC ; Load BC into system variable "COORDS" 36016 LD A,(IX+4) ; Load A with ball's current frame number 36019 PUSH IX ; Store IX 36021 CALL 39125 ; Draw Odd Ball to screen 36024 POP IX ; Restore IX 36026 POP BC ; Restore BC 36027 LD A,(IX+2) ; Load x-velocity into A 36030 ADD A,C ; Add x-coordinate to A 36031 LD C,A ; Load new x-coordinate back into C 36032 LD A,(IX+3) ; Load y-velocity into A 36035 ADD A,B ; Add y-coordinate to A 36036 LD B,A ; Load new y-coordinate back into B 36037 LD (IX+0),C ; Update data with new x-... 36040 LD (IX+1),B ; ...and y-coordinates 36043 LD (23677),BC ; Update "COORDS" system variable 36047 LD A,(IX+4) ; Load A with Odd Ball frame data 36050 SUB 116 ; Subtract 116 (i.e. frame number of first Odd Ball frame) to get "absolute frame number" (see ; trivia) 36052 INC A ; Advance absolute frame number by one 36053 AND 3 ; Cap absolute frame number to 3, and wrap round from 3 to 0 as there are only four frames 36055 ADD A,116 ; Add 116 to absolute frame number to give relative frame number again 36057 LD (IX+4),A ; Store new frame number 36060 PUSH IX ; Store IX 36062 CALL 39125 ; Draw Odd Ball to screen 36065 POP IX ; Restore IX 36067 LD A,(IX+0) ; Load x-coordinate of ball 36070 OR A ; If x-coordinate is zero... 36071 CALL Z,36173 ; ...multiply x "velocity" by minus one 36074 CP 244 ; If x-coordinate is 244... 36076 CALL Z,36173 ; ...multiply x "velocity" by minus one 36079 INC IX ; Temporarily advance IX pointer to work with y "velocities" 36081 LD A,(IX+0) ; Load y-coordinate of ball 36084 CP 172 ; If y-coordinate is 172... 36086 CALL Z,36173 ; ...multiply y "velocity" by minus one 36089 CP 40 ; If y-coordinate is 40... 36091 CALL Z,36173 ; ...multiply y "velocity" by minus one 36094 DEC IX ; Move IX back one again (reversing instruction at #R36079) 36096 LD A,(25387) ; Load A with Magic Knight's current x-coordinate 36099 LD B,A ; Copy into B 36100 LD A,(IX+0) ; Load A with x-coordinate of ball 36103 ADD A,6 ; Add 6 to x-coordinate of ball 36105 SUB B ; Subtract B to get x-distance between Magic Knight and the ball, plus 6 36106 CP 21 ; If this value is not less than 21 then... 36108 JP NC,36172 ; ...return 36111 LD A,(25388) ; Else, load B with Magic Knight's y-coordinate... 36114 LD B,A ; ... 36115 LD A,(IX+1) ; Load A with y-coordinate of ball (uses same coordinate system as PLOT command, i.e. y=0 is at ; bottom of screen) 36118 SUB 175 ; Subtract y-coordinate from 175 to change y-origin to top of screen... 36120 NEG ; ...and have y-coordinate increase downwards rather than upwards 36122 ADD A,6 ; Add 6 to y-coordinate of ball 36124 SUB B ; Subtract B to get y-distance between Magic Knight and the ball, plus 6 36125 CP 39 ; If this value is not less than 39 then... 36127 JP NC,36172 ; ...return 36130 LD A,(25315) ; Else, decrease Magic Knight's current strength by one... 36133 DEC A ; ... 36134 LD (25315),A ; ... 36137 CALL 36215 ; Draw health bar at bottom of screen 36140 LD A,(25315) ; Load Magic Knight's current strength into A... 36143 OR A ; If Magic Knight's strength is zero... 36144 LD HL,43960 ; ...point HL to "YOU DIED OF EXHAUSTION" text... 36147 JP Z,35101 ; ...and jump to "Game over" window routine and exit 36150 LD C,32 ; Set C to 32 (number of times to repeat loop below) *36152 LD A,16 ; Set speaker bit... 36154 OUT (254),A ; ... 36156 LD A,R ; Load A with random number between 0 - 15 (as R register increases with each instruction ; executed)... 36158 AND 15 ; ... 36160 LD B,A ; Load value into B *36161 DJNZ 36161 ; Pause by repeating this line B times 36163 XOR A ; Set A to zero 36164 OUT (254),A ; Reset speaker bit 36166 DEC C ; Decrease C... 36167 JR NZ,36152 ; ...and repeat loop if C is not zero 36169 XOR A ; Reset speaker bit... 36170 OUT (254),A ; ... *36172 RET ; Return ; Multiply x or y Velocity of Odd-Ball by Minus One ; ; Used by the routine at #R35993. Input: IX Address of x or y "velocity" of Odd-Ball minus two c36173 LD A,(IX+2) ; Load A with x "velocity" of ball 36176 NEG ; Multiply velocity by minus one 36178 LD (IX+2),A ; Load back into data block 36181 XOR A ; Set A to zero 36182 RET ; Return ; Properties of the Odd-Balls ; ; Up to four balls may exist in a room, therefore there are four entries in this table. Each ball's properties are ; encoded in eight bytes with the following meanings: b36183 DEFB 12,112,4,2,32,0,0,0 ; Ball 1 36191 DEFB 12,112,2,252,32,0,0,0 ; Ball 2 36199 DEFB 200,120,252,2,32,0,0,0 ; Ball 3 36207 DEFB 200,120,254,252,32,0,0,0 ; Ball 4 ; Draw Strength Bar at Bottom of Screen ; ; Used by the routines at #R28092 and #R35993. c36215 LD A,35 ; Load A with index of object 35 (Mirror) 36217 CALL 34256 ; Check whether Magic Knight is carrying the Mirror... 36220 RET NZ ; ...and if not, return 36221 LD HL,20642 ; Point HL to position of start of health bar in Display File 36224 LD A,(25315) ; Load A with Magic Knight's strength 36227 RRCA ; Divide strength by eight, rounding down to nearest integer... 36228 RRCA ; ... 36229 RRCA ; ... 36230 AND 15 ; ...and if lowest four bits are reset (i.e. don't need to draw part of a character block)... 36232 JR Z,36251 ; ...then skip ahead to #R36251 36234 LD B,A ; Load number of full character blocks to draw into B 36235 LD A,255 ; Place 255 into A *36237 PUSH HL ; Store HL (Display File position of start of health bar block) 36238 PUSH BC ; Store BC (B = number of full character blocks to draw) 36239 LD B,4 ; Load B with 4 (health bar has 4 stripes) *36241 LD (HL),A ; Draw a byte (i.e. a "block" of 8 health units) to health bar 36242 INC H ; Advance HL two rows down (as bar is made of alternating horizontal stripes)... 36243 INC H ; ... 36244 DJNZ 36241 ; And if there's another stripe of the 4 to draw, then loop back and draw it 36246 POP BC ; Restore BC (B = number of full character blocks to draw) 36247 POP HL ; Restore HL (Display File position of start of health bar) 36248 INC HL ; Advance HL (horizontally) one character to draw next full block, if applicable 36249 DJNZ 36237 ; If there's another block to draw, then loop back to draw it *36251 LD A,(25315) ; Load A with Magic Knight's strength 36254 AND 7 ; Get fractional part (i.e. amount by which strength is more than a multiple of eight) 36256 JR NZ,36261 ; If it is not zero, then skip ahead to #R36261 36258 XOR A ; Set A to zero 36259 JR 36267 ; Skip ahead to draw the blank rows (see trivia) *36261 LD B,A ; Load fractional part of strength into B 36262 XOR A ; Set A to zero *36263 SCF ; Set the Carry Flag 36264 RRA ; Move carry Flag bit into MSB of A 36265 DJNZ 36263 ; Decrease B and loop back if not zero (i.e. place a bit at the LHS of A for each unit of ; strength that is left!) *36267 LD B,4 ; Load B with 4 (health bar has 4 stripes) *36269 LD (HL),A ; Draw a byte (i.e. a "block" of 8 health units) to health bar 36270 INC H ; Advance HL two rows down (as bar is made of alternating horizontal stripes)... 36271 INC H ; ... 36272 DJNZ 36269 ; Loop back to draw next row 36274 RET ; Return ; Draw Objects in Magic Knight's Inventory to Bottom of Screen if he is Carrying the Mirror ; ; Used by the routine at #R28092. c36275 LD A,35 ; Load A with index of object 35 (Mirror) 36277 CALL 34256 ; Check whether Magic Knight is carrying the Mirror... 36280 RET NZ ; ...and if not, return 36281 LD HL,25395 ; Point HL to Magic Knight's inventory 36284 LD B,5 ; Set counter to 5 (as inventory has 5 slots) 36286 LD DE,5392 ; Load DE with x- and y-coordinates respectively to start drawing object graphics (D, or x = ; 21, E, or y = 16) *36289 PUSH BC ; Store BC, HL and DE... 36290 PUSH HL ; ... 36291 PUSH DE ; ... 36292 LD A,(HL) ; Load index of object at current slot in Magic Knight's inventory into A 36293 OR A ; If this is zero... 36294 JR Z,36323 ; ...then return 36296 LD E,6 ; Load 6 into E 36298 CALL 34160 ; Point HL to property 6 (attribute) of this object in properties table... 36301 LD A,(HL) ; ...and load value of property into A... 36302 LD (23695),A ; ...then into system variable ATTR T 36305 INC HL ; Advance HL to point to graphic index property... 36306 LD A,(HL) ; ...and load into A 36307 POP BC ; Restore BC... 36308 PUSH BC ; ...and store again 36309 CALL 29960 ; Draw the object at the current inventory slot 36312 POP DE ; Restore coordinates 36313 LD A,E ; Add 1 character of horizontal space between this and the next object (objects are 2 ; characters wide, plus one of space makes three)... 36314 ADD A,3 ; ... 36316 LD E,A ; ... 36317 POP HL ; Advance to next inventory slot... 36318 INC HL ; ... 36319 POP BC ; ... 36320 DJNZ 36289 ; Repeat loop for next inventory slot 36322 RET ; Return *36323 POP DE ; Restore BC, HL and DE... 36324 POP HL ; ... 36325 POP BC ; ... 36326 RET ; Return ; Assign a Slot in Room C to Character B ; ; Used by the routines at #R26906, #R30540, #R33312 and #R55233. Input: B Index of a character C Room number ; Output: A Number of slot assigned (4 if room is full) B y-coordinate (characters) of slot C x-coordinate ; (characters) of slot c36327 LD A,C ; Load room number into A 36328 LD HL,25440 ; Point HL at start of table of current characters' locations (i.e. Gimbal, Thor etc.) 36331 LD DE,25307 ; Point DE at table of characters' slots in their current rooms 36334 LD IX,36472 ; Point IX at 36472 list of occupied slots... 36338 LD (IX+0),0 ; ...and set three bytes there to zeroes... 36342 LD (IX+1),0 ; ... 36346 LD (IX+2),0 ; ... 36350 PUSH BC ; Store BC 36351 LD B,8 ; Load B with 8 *36353 CP (HL) ; Compare a character's current screen number with room number passed to this routine (in A)... 36354 JR NZ,36364 ; ...and if they're not the same then skip ahead to #R36364 (move onto next character, if ; applicable) 36356 EX AF,AF' ; Swap registers 36357 LD A,(DE) ; Load character's slot (i.e. order of arrival in the room) into A 36358 LD (IX+0),A ; Copy slot into table at 36472 36361 INC IX ; Advance IX to next entry in this table 36363 EX AF,AF' ; Exchange registers *36364 INC HL ; Advance HL by three bytes (i.e. skip over x- and y-coordinates to get to screen number of ; next character)... 36365 INC HL ; ... 36366 INC HL ; ... 36367 INC DE ; Advance DE by one byte to get slot of next character 36368 DJNZ 36353 ; Loop back if previous character was not the last 36370 POP BC ; Restore BC 36371 LD IX,36472 ; Point IX at list of occupied slots 36375 LD A,1 ; If one of the characters in room C has a slot of 1... 36377 CP (IX+0) ; ...then jump ahead to #R36394... 36380 JR Z,36394 ; ... 36382 CP (IX+1) ; ... 36385 JR Z,36394 ; ... 36387 CP (IX+2) ; ... 36390 JR Z,36394 ; ... 36392 JR 36435 ; ...else jump to #R36435 *36394 LD A,2 ; If one of the characters in room C has a slot of 2... 36396 CP (IX+0) ; ...then jump ahead to #R36413... 36399 JR Z,36413 ; ... 36401 CP (IX+1) ; ... 36404 JR Z,36413 ; ... 36406 CP (IX+2) ; ... 36409 JR Z,36413 ; ... 36411 JR 36435 ; ...else jump to #R36435 *36413 LD A,3 ; If one of the characters in room C has a slot of 3... 36415 CP (IX+0) ; ...then jump ahead to #R36432... 36418 JR Z,36432 ; ... 36420 CP (IX+1) ; ... 36423 JR Z,36432 ; ... 36425 CP (IX+2) ; ... 36428 JR Z,36432 ; ... 36430 JR 36435 ; ...else jump to #R36435 *36432 LD A,4 ; Return with A=4... 36434 RET ; ... *36435 LD E,A ; Load highest slot among characters plus one in room into E 36436 PUSH DE ; Store DE (E=lowest empty slot) 36437 PUSH BC ; Store BC (B=Character index, C=Room number) 36438 DEC A ; Decrease A to get index of lowest empty slot... 36439 ADD A,A ; ...double it... 36440 LD E,A ; ...and load into DE... 36441 LD D,0 ; ... 36443 LD B,0 ; Set B to zero 36445 PUSH BC ; Copy BC into HL... 36446 POP HL ; ...so that HL contains room number passed to this routine initially 36447 ADD HL,HL ; Double room number... 36448 ADD HL,BC ; ...add room number again (now three times)... 36449 ADD HL,HL ; ...and double again to get six times original room number in HL 36450 LD BC,53938 ; Point BC at table of coordinates of character positions in rooms 36453 ADD HL,BC ; Add to six times room number into HL 36454 ADD HL,DE ; Add to this double (slot - 1) from DE 36455 LD C,(HL) ; Load x- and y-coordinates into BC 36456 INC HL ; ... 36457 LD B,(HL) ; ... 36458 EXX ; Exchange all registers 36459 POP BC ; Restore BC (B=Character index, C=Room number) 36460 LD HL,25307 ; Point HL at table of characters' slots in their current rooms 36463 LD D,0 ; Load input character index into DE... 36465 LD E,B ; ... 36466 ADD HL,DE ; Add as offset to HL 36467 POP DE ; Restore (E=lowest empty slot) 36468 LD (HL),E ; Set this character's slot to be lowest empty slot in this room 36469 LD A,E ; Set A to slot number just filled 36470 EXX ; Exchange all registers 36471 RET ; Return ; List of Occupied Slots in a Room ; ; Used by routine at #R36327 b36472 DEFB 0,0,0 ; Print a Character (e.g. Letter in the Current Room Name, or a Block of a Window Border) ; ; Used by the routines at #R36725, #R36908 and #R37147. Input: A Index of character to print c36475 PUSH HL ; Store HL 36476 LD DE,63732 ; Point to graphic (Magic Knight, frame 1, facing left) 36479 ADD A,A ; Load index of character into HL and multiply by 8... 36480 LD H,0 ; ... 36482 LD L,A ; ... 36483 ADD HL,HL ; ... 36484 ADD HL,HL ; ... 36485 ADD HL,DE ; ...and add to DE to obtain memory location of required character in the character set 36486 EX DE,HL ; Swap values (DE now holds memory location of character to print and HL holds 63732) ; The operand of the instruction at #R36487 represents the Display File address to print to. This is modified by the ; instructions at #R28272 and #R36551. 36487 LD HL,0 ; Load HL with the Display File address to print character to 36490 LD B,8 ; For eight bytes (i.e. full height of character)... *36492 LD A,(DE) ; ...get graphic data from character set... 36493 LD (HL),A ; ...and load into Display File... 36494 INC DE ; ...move to next pixel row in character set... 36495 INC H ; ...and move to next pixel row in Display File 36496 DJNZ 36492 ; (End loop) 36498 CALL 36709 ; Load memory location 23487 (and HL) with memory location of attribute data (Attribute File) ; for character just printed 36501 LD A,(23695) ; Obtain attribute data stored previously in system variable ATTR T (71 = white INK, black ; PAPER, BRIGHT) 36504 LD (HL),A ; Apply attribute to character just printed 36505 CALL 36606 ; Advance Display File pointer to next location (for printing room name) 36508 POP HL ; Restore HL 36509 RET ; Return ; Draw a Single Character Block Part of a Wall, Ceiling or Floor ; ; Used by the routine at #R28344. Input: A Index of brickwork graphic to draw (from lookup table #R54617) c36510 PUSH HL ; Store HL 36511 LD DE,64756 ; Point DE at start of brickwork (architecture) graphic data 36514 ADD A,A ; Double architecture style index 36515 LD H,0 ; Load brickwork graphic index into HL... 36517 LD L,A ; ... 36518 ADD HL,HL ; Multiply by 4 (to give 8 times original value)... 36519 ADD HL,HL ; ... 36520 ADD HL,DE ; Add to DE as offset 36521 EX DE,HL ; Switch DE and HL (so HL points to start of brickwork graphic data and DE points graphic data ; for required brickwork block) 36522 LD HL,(36488) ; Load "memory location to start printing character" in character printing routine into HL... 36525 LD B,8 ; Set loop repeat counter to 8 *36527 LD A,(DE) ; Load a byte of graphic data into A... 36528 LD (HL),A ; ...and draw to display 36529 INC DE ; Advance to next data to read 36530 INC H ; Move HL down one pixel row 36531 DJNZ 36527 ; Repeat loop for next pixel row 36533 LD HL,(36488) ; Load "bitmap memory location to start printing character" in character printing routine into ; HL... 36536 LD A,H ; Advance HL to attribute memory location corresponding to this Display File address... 36537 AND 31 ; ... 36539 RRCA ; ... 36540 RRCA ; ... 36541 RRCA ; ... 36542 ADD A,88 ; ... 36544 LD H,A ; ... 36545 LD A,(23695) ; Load value in system variable ATTR T into this memory location (i.e. apply attribute)... 36548 LD (HL),A ; ... 36549 POP HL ; Restore HL 36550 RET ; Return ; Move Bitmap Virtual Cursor to Display File address for Coordinates x=C, y=B ; ; Used by the routines at #R29356, #R36987, #R37147, #R37333, #R37552 and #R38417. Input: B y-coordinate ; (characters) C x-coordinate (characters) Output: HL Virtual Bitmap Cursor Display File address c36551 LD A,B ; Load y-coordinate into A 36552 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) 36554 ADD A,64 ; Load HL with Display File address of start of appropriate third of display... 36556 LD H,A ; ...(16,384, 18,432 or 20,480) 36557 LD A,B ; Load y-coordinate back into A 36558 AND 7 ; AND 7 to determine which of the 8 character rows within the third we are interested in 36560 RRCA ; Multiply by 8 to get pixel row required... 36561 RRCA ; ... 36562 RRCA ; ... 36563 ADD A,C ; Add x-coordinate 36564 LD L,A ; Add to value currently in HL 36565 LD (36488),HL ; Set (video) memory location to start printing character 36568 RET ; Return ; Update Virtual Attribute Cursor to Attribute File for Coordinates x=C, y=B ; ; Used by the routines at #R26673, #R28683, #R28747, #R28841, #R28882, #R28960, #R29032, #R29089, #R29184, #R29205, ; #R29225, #R29291, #R29960, #R37571, #R38242, #R54853 and #R54955. Input: B y-coordinate (characters) C ; y-coordinate (characters) Output: HL Virtual Attribute Cursor Attribute File address c36569 LD A,B ; Copy y-coordinate into A 36570 ADD A,A ; Multiply by 8... 36571 ADD A,A ; ... 36572 ADD A,A ; ... 36573 LD L,A ; Load HL with value... 36574 LD H,0 ; ... 36576 ADD HL,HL ; Multiply by four... 36577 ADD HL,HL ; ...now HL holds 32 times original y-coordinate 36578 LD D,88 ; Load DE with position of start of attribute data, plus x-coordinate... 36580 LD E,C ; ... 36581 ADD HL,DE ; Add 32 times y-coordinate 36582 LD (23487),HL ; Store this in memory (virtual attribute cursor storage) 36585 RET ; Return ; Point HL at Terrain Interaction Data for Character Coordinates x=C, y=B ; ; Used by the routines at #R27495, #R27666, #R27809, #R29356 and #R38539. Input: B y-coordinate (characters) C ; y-coordinate (characters) Output: HL Points to entry in "Terrain Interaction Data" at #R24539 c36586 PUSH AF ; Store AF 36587 LD A,B ; Load y-coordinate into A 36588 ADD A,A ; Multiply this by 8... 36589 ADD A,A ; ... 36590 ADD A,A ; ... 36591 LD L,A ; Copy 8 times y-coordinate into HL... 36592 LD H,0 ; ... 36594 ADD HL,HL ; Multiply by 4... 36595 ADD HL,HL ; ...to give 32 times original y-coordinate in HL 36596 LD DE,24539 ; Point DE at start of "Terrain Interaction Data" 36599 ADD HL,DE ; Add 32 times y-coordinate as offset to HL 36600 LD D,0 ; Load x-coordinate into DE... 36602 LD E,C ; ... 36603 ADD HL,DE ; Add x-coordinate as offset to HL 36604 POP AF ; Restore AF 36605 RET ; Return ; Advance Display File Pointer to Next Location (for Printing Room Name) ; ; Used by the routines at #R36475 and #R36875. c36606 LD HL,(36488) ; Get Display File byte to modify... 36609 INC HL ; ...and increase (for next character) 36610 LD A,L ; Load LSB of HL into A... 36611 OR A ; ...and check whether it is zero 36612 JR Z,36618 ; If it is zero (i.e. advancing down a character row will take us into a different third of ; Display File) then skip to second part of routine... 36614 LD (36488),HL ; ...else store the updated (increased) Display File address for next character... 36617 RET ; ...and return *36618 LD A,H ; Add 7 to MSB of Display File address... 36619 ADD A,7 ; ...as advancing by one at 36609 took Display File pointer back up to 2nd pixel row of the ; current third of the display... 36621 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!)... 36622 LD (36488),HL ; ... 36625 RET ; Return ; Advance Display File Pointer by Two Characters ; ; Used by the routine at #R28344. c36626 LD HL,(36488) ; Get Display File byte to modify... 36629 INC HL ; ...and increase by two bytes... 36630 INC HL ; ... 36631 LD A,L ; Load LSB of HL into A... 36632 OR A ; ...and check whether it is zero 36633 JR Z,36639 ; If it is zero (i.e. advancing down a character row will take us into a different third of ; Display File) then skip to second part of routine... 36635 LD (36488),HL ; ...else store the updated (increased) Display File address for next character... 36638 RET ; ...and return *36639 LD A,H ; Add 7 to MSB of Display File address... 36640 ADD A,7 ; ...as advancing by one at #R36609 took Display File pointer back up to 2nd pixel row of the ; current third of the display... 36642 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!)... 36643 LD (36488),HL ; ... 36646 RET ; Return ; Splice Numeric Data A as a String into a String at HL ; ; Used by the routines at #R34268, #R35837 and #R35887. Input: A Numeric data (e.g. percentage completion / ; character's strength) to be loaded into text at HL HL Points to a "numeric" text (e.g. percentage completion / ; character's strength) c36647 PUSH HL ; Store HL (pointer to "numeric text") 36648 LD HL,23497 ; Point HL at destination location for ASCII string 36651 LD B,0 ; Load numeric value into BC... 36653 LD C,A ; ... 36654 CALL 37746 ; Convert numeric value in BC to ASCII string at location 23497 36657 LD HL,23499 ; Convert up to two (C=2) leading zeroes to spaces in last three digits (starting at #R23497) ; of the ASCII string number... 36660 LD C,2 ; ... 36662 CALL 36692 ; ... 36665 POP DE ; Restore pointer to "numeric text" (originally in HL at start of this routine) into DE 36666 LD HL,23499 ; Point HL at string number just created 36669 LD BC,3 ; Splice ASCII string number just generated into "numeric data" text (e.g. put the number XX ; into the "TIME LEFT XX HOURS" text)... 36672 LDIR ; ... 36674 RET ; Return ; Unused routine c36675 PUSH HL ; Transfer HL into BC... 36676 POP BC ; ... 36677 PUSH IX ; Store IX 36679 PUSH IX ; Transfer IX into HL... 36681 POP HL ; ... 36682 CALL 37746 ; Convert numeric value in BC to ASCII string at location HL 36685 POP HL ; Restore HL (was originally in IX) 36686 LD C,4 ; Convert leading zeroes to spaces in a string number as 4 digit value... 36688 CALL 36692 ; ... 36691 RET ; Return ; Convert Leading Zeroes to Spaces in a String Number ; ; Used by the routines at #R36647 and #R36675. Input: C Number of required digits in string (e.g. 2) HL Pointer ; to location within ASCII string c36692 LD A,(HL) ; Load ASCII character at HL into A 36693 CP 48 ; If character is not a zero ("0")... 36695 RET NZ ; ...then return 36696 LD (HL),32 ; Replace the zero character with a space (i.e. remove leading zeroes from number) 36698 INC HL ; Advance to next character in string 36699 DEC C ; Decrease C (number of remaining digits to process) 36700 RET Z ; Return if last digit has been processed 36701 JR 36692 ; Loop back for next digit ; Get Start of Next Zero-Terminated String ; ; Used by the routines at #R28272, #R34842 and #R36830. Input: HL Current position in a list of zero-terminated ; strings Output: HL Byte immediately after the first zero byte following HL (input) address c36703 LD A,(HL) ; Get byte at HL 36704 INC HL ; Advance HL 36705 OR A ; Is byte value from old HL position zero? 36706 RET Z ; If so then exit 36707 JR 36703 ; If not, then restart this loop with new HL ; Store and Point HL at Attribute File Address for Character Just Printed ; ; Used by the routines at #R28510, #R36475, #R36725, #R36800 and #R36810. c36709 LD HL,(36488) ; Load HL with Display File address for drawing character 36712 LD A,H ; Load H into A... 36713 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) 36715 RRCA ; Divide by eight to get character row within the third... 36716 RRCA ; ... 36717 RRCA ; ... 36718 ADD A,88 ; Add 22,528 to HL to move into Attribute File 36720 LD H,A ; L still contains offset of x characters, so points to start of attributes for area where room ; name was just printed 36721 LD (23487),HL ; Store memory location for later use 36724 RET ; Return ; Print Text at Location HL to Screen ; ; Used by the routines at #R26747, #R26788, 27118, #R28092, #R28272, #R29800, #R29880, #R30540, #R30602, #R31153, ; #R31370, #R31636, #R32035, #R32655, #R32876, #R33180, #R33663, #R34350, #R34768, #R34914, #R35101, #R35141, ; #R35293, #R36830, #R37654, #R38693, #R38725 and #R38749. Input: HL Points to text data to print c36725 PUSH AF ; Store AF 36726 PUSH HL ; Store HL 36727 CALL 36709 ; Update stored location of start of attribute data 36730 POP HL ; Retrieve HL 36731 DEC HL ; Prepare for loop ; This entry point is used by the routines at #R36800 and #R36830. *36732 INC HL ; Start of loop - advance to next character to be printed 36733 LD A,(HL) ; Get character from string at location HL (e.g. "**  " text) 36734 OR A ; Check against various values... 36735 JP Z,36798 ; If character is a null character, exit routine (via RET at #R36798) 36738 CP 9 ; If character is a "9" (move right)... 36740 JP Z,36875 ; ...then move virtual text cursor right by one character 36743 CP 13 ; If the character is a "13" ("ENTER" - carriage return + line feed)... 36745 JP Z,36800 ; ...then move Virtual Text Cursor down to start of next row 36748 CP 14 ; If the character is a "14"... 36750 JP Z,36810 ; ...then move Virtual Text Cursor down to start of next row within current window 36753 CP 16 ; If the character is a "16" (change of INK colour)... 36755 JP Z,36861 ; ...then go to change INK colour routine 36758 CP 17 ; If the character is a "17" (change of PAPER colour)... 36760 JP Z,36849 ; ...then go to change PAPER colour routine 36763 CP 18 ; If the character is a "18" (change of FLASH status)... 36765 JP Z,36857 ; ...go to change FLASH status routine 36768 CP 19 ; If the character is a "19" (change of BRIGHT status)... 36770 JP Z,36853 ; ...then go to change BRIGHT status routine 36773 CP 29 ; If the character is a "29" (print name of Current Object)... 36775 JP Z,36882 ; ...then go to the print Current Object name routine 36778 CP 30 ; If the character is a "30" (print full name of Current Character)... 36780 JP Z,36892 ; ...then print the Current Character's full name 36783 CP 31 ; If the character is a "31" (print short name of Current Character)... 36785 JP Z,36900 ; ...then print the Current Character's short name 36788 CP 91 ; If value is 91 or greater (i.e. special character)... 36790 JP NC,36830 ; ...then print special character or change text attribute 36793 CALL 36475 ; Print character to screen 36796 JR 36732 ; Loop back to #R36732 to print next character *36798 POP AF ; Restore AF and return 36799 RET ; Return ; Move Virtual Text Cursor Down to Start of Next Row ; ; Used by the routine at #R36725. c36800 PUSH HL ; Store HL 36801 CALL 37703 ; Move virtual text cursor down to start of next text row 36804 CALL 36709 ; Update stored location of start of attribute data ; This entry point is used by the routines at #R36810, #R36830 and #R36875. *36807 POP HL ; Restore HL 36808 JR 36732 ; Move onto next character ; Move Virtual Text Cursor Down to Start of Next Row Within Current Window ; ; Used by the routine at #R36725. c36810 PUSH HL ; Store HL 36811 CALL 37703 ; Move virtual text cursor down to start of next text row 36814 LD HL,(36488) ; Get position of virtual text cursor 36817 LD A,(23493) ; Load A with x-coordinate of left edge of current window (in characters) 36820 ADD A,L ; Offset the text cursor based upon left-edge of current window to prepare to print text ; starting at left edge of this window... 36821 LD L,A ; ... 36822 LD (36488),HL ; Update virtual text cursor location 36825 CALL 36709 ; Update stored location of start of attribute data 36828 JR 36807 ; Go to #R36807 for next character ; Print Special Character or Change Text Attribute ; ; Used by the routines at #R36725, #R36892 and #R36900. c36830 PUSH HL ; Store HL 36831 LD HL,40149 ; Point HL at start of common words table 36834 SUB 91 ; Subtract 91 from A to get index of special character ; This entry point is used by the routine at #R36882. *36836 JR Z,36844 ; If first string is required (i.e. index is zero), then jump straight to print commands 36838 LD B,A ; Load index into B *36839 CALL 36703 ; Get start of next zero-terminated string... 36842 DJNZ 36839 ; ...and repeat until the B-th string is found (e.g. 20th)... *36844 CALL 36725 ; ...then print this string to screen 36847 JR 36807 ; Jump to #R36807 (i.e. we have printed the common word, so go back to printing rest of ; original string) ; This entry point is used by the routine at #R36725. *36849 LD B,199 ; PAPER bits 36851 JR 36863 ; Update attribute ; This entry point is used by the routine at #R36725. *36853 LD B,191 ; BRIGHT bit 36855 JR 36863 ; Update attribute ; This entry point is used by the routine at #R36725. *36857 LD B,127 ; FLASH bit 36859 JR 36863 ; Update attribute ; This entry point is used by the routine at #R36725. *36861 LD B,248 ; INK bits *36863 INC HL ; Advance to next character 36864 LD A,(23695) ; Get system variable ATTR T 36867 AND B ; Clear bits 36868 OR (HL) ; Update bits with value from HL 36869 LD (23695),A ; Set system variable ATTR T (i.e. change INK / PAPER colour of text) 36872 JP 36732 ; Move onto next character ; Move Virtual Text Cursor Right by One Character ; ; Used by the routine at #R36725. c36875 PUSH HL ; Store HL 36876 CALL 36606 ; Advance to next character location (Display File) 36879 JP 36807 ; Loop back ; Print the Current Object's Name ; ; Used by the routine at #R36725. c36882 PUSH HL ; Store HL 36883 LD HL,41236 ; Set HL to start of object names table 36886 LD A,(30467) ; Load A with index of Current Object 36889 OR A ; (Re)Set zero flag 36890 JR 36836 ; Jump back to print this object's name ; Print the Current Character's Full Name ; ; Used by the routine at #R36725. c36892 LD A,(30615) ; Load index of Current Character into A 36895 ADD A,117 ; Add as offset to 117 (index of first of characters' names) 36897 JP 36830 ; Jump into the text printing routine to display the text ; Print the Current Character's Short Name ; ; Used by the routine at #R36725. c36900 LD A,(30615) ; Load index of Current Character into A 36903 ADD A,130 ; Add as offset to 130 (index of first of characters' names) 36905 JP 36830 ; Jump into the text printing routine to display the text ; Draw an Edge of Frame of a Window ; ; Used by the routines at #R37147 and #R37782. Input: HL Width of window (characters) minus 1 - used as a loop ; counter to print segments of window border c36908 LD A,H ; Check whether remaining window's width is zero... 36909 OR L ; ...and if it is... 36910 RET Z ; ...then return ; The operand of the instruction at #R36911 represents the border style (character index) to print. This is modified ; by the instructions at #R37028, #R37176 and #R37246. 36911 LD A,0 ; Load A with the border style (character index)... 36913 CALL 36475 ; ...print the character... 36916 DEC HL ; ...decrease the remaining width... 36917 JR 36908 ; ...and loop back to #R36908 ; Draw Window Frame for Character Portraits (2nd Floor) and Goblet Picture in Florin's Room ; ; Used by the routine at #R29150. Input: B y-coordinate (characters) of picture C x-coordinate (characters) of ; picture D index of graphic to draw inside frame c36919 LD A,10 ; Load A with 10 (window index) 36921 EX AF,AF' ; Switch AF 36922 PUSH BC ; Store BC (x- and y-coordinates of top-left corner) 36923 LD H,0 ; Load HL with index of graphic to draw inside frame 36925 LD L,D ; ... 36926 LD E,3 ; In preparation for drawing an object (object height + 1) 36928 ADD HL,HL ; Multiply HL by four... 36929 ADD HL,HL ; ... 36930 LD BC,42642 ; Point to start of graphic lookup data 36933 ADD HL,BC ; Add offset (now, for example, pointing to entry for Goblet from picture in Florin's room) 36934 LD A,(HL) ; Load width data into A 36935 CP 255 ; If width data is 255 (i.e. we are drawing an object)... 36937 JR Z,36942 ; ...then jump ahead to #R36942 36939 INC HL ; Load height data into E... 36940 LD E,(HL) ; ... 36941 INC E ; Increase height by one *36942 POP BC ; Restore BC (x- and y-coordinates of top-left corner) 36943 LD A,112 ; Set window / menu parameter to 112 (window, not menu) in window drawing routine... 36945 LD (37084),A ; ... 36948 LD A,C ; Load x-coordinate... 36949 LD (41954),A ; ...into this window's "left position" entry in the window data table at #R41874 36952 ADD A,3 ; Set window's "right position"... 36954 LD (41955),A ; ...as three characters to the right (i.e. width of window is 4 characters) 36957 LD A,B ; Load y-coordinate... 36958 LD (41956),A ; ...into this window's "top position" entry in the window data table at #R41874 36961 ADD A,E ; Set window's "right position"... 36962 LD (41957),A ; ...as top position plus height data 36965 LD A,(25393) ; Load Magic Knight's current attribute into A... 36968 LD (41959),A ; ...and set window's border attribute to match 36971 CALL 36993 ; Draw the window 36974 RES 1,(IY+65) ; Reset "Disable In-Game Glow" flag 36978 RET ; Return ; Draw a Menu Window ; ; Used by the routines at #R26747, #R31153, #R31370, #R31636, #R32655, #R33663, #R34914, #R35141, #R35293 and ; #R38725. Input: A Index of window to draw c36979 EX AF,AF' ; Swap AF register (A holds index of window to draw) 36980 LD A,105 ; Load the value 105 into #R37083 (i.e. set "Draw Menu (Hand) Cursor" 'flag' to true)... 36982 LD (37084),A ; ... 36985 JR 36993 ; Draw the window ; Draw a Window ; ; Used by the routines at #R26747, #R26788, #R28092, #R29800, #R29880, #R30540, #R30602, #R31370, #R32035, #R32876, ; #R33180, #R34350, #R34768, #R34914, #R35101, #R35141, #R37654 and #R38749. Input: A Index of window to draw ; (e.g. 14 for "PRESS SPACE OR FIRE TO CONTINUE" window) c36987 EX AF,AF' ; Switch AF and AF' 36988 LD A,111 ; Reset "Draw Hand Menu Cursor" Flag (later in this routine)... 36990 LD (37084),A ; ... ; This entry point is used by the routines at #R36919 and #R36979. *36993 SET 1,(IY+65) ; Set "Disable In-Game Glow" flag 36997 EX AF,AF' ; Restore original AF (with A being index of window) 36998 LD (37655),A ; Set this index as the Current Window index 37001 LD L,A ; Load HL with A value (index of required window, e.g. 14 for "PRESS SPACE OR FIRE TO CONTINUE" ; window)... 37002 LD H,0 ; ... 37004 ADD HL,HL ; Multiply index by eight (as each window's data takes up eight bytes in table at 41874)... 37005 ADD HL,HL ; ... 37006 ADD HL,HL ; ... 37007 LD BC,41874 ; Set BC to start of window data table 37010 ADD HL,BC ; Calculate location of start of required window's data 37011 LD E,(HL) ; Load E with x-coordinate of left edge (characters) 37012 INC HL ; Load C with x-coordinate of right edge (characters)... 37013 LD C,(HL) ; ... 37014 INC HL ; Load D with y-coordinate of top edge (characters)... 37015 LD D,(HL) ; ... 37016 INC HL ; Load B with y-coordinate of bottom edge (characters)... 37017 LD B,(HL) ; ... 37018 LD (23493),DE ; Store values for later use... 37022 LD (23495),BC ; ... 37026 INC HL ; Load A with window's upper edge border style... 37027 LD A,(HL) ; ... 37028 LD (36912),A ; Store for later use 37031 INC HL ; Load A with window's border attribute... 37032 LD A,(HL) ; ... 37033 EX AF,AF' ; Exchange AF and AF' 37034 INC HL ; Load A with starting y-coordinate of hand cursor... 37035 LD A,(HL) ; ... 37036 LD (23489),A ; Store for later use 37039 INC HL ; Load A with window's content attribute... 37040 LD A,(HL) ; ... 37041 LD (23477),A ; Store for later use 37044 EX AF,AF' ; Exchange AF and AF' (restoring border attribute to A and putting background colour in A') 37045 CALL 37147 ; Draw window frame 37048 LD HL,23493 ; Point HL at previously stored values 37051 INC (HL) ; Increase top-left x-coordinate 37052 INC HL ; Increase top-left y-coordinate... 37053 INC (HL) ; ... 37054 INC HL ; Decrease bottom-right x-coordinate... 37055 DEC (HL) ; ... 37056 INC HL ; Decrease bottom-right y-coordinate... 37057 DEC (HL) ; ... 37058 LD A,(23477) ; Load window background attribute into A 37061 LD (38250),A ; Load this attribute into instruction in routine at #R38242 that sets attribute of window ; contents 37064 LD (23695),A ; Update system variable ATTR T with window background attribute 37067 CALL 38242 ; Fill the interior of the window with its specified attribute (i.e. background colour and ; colour of text within) 37070 CALL 38417 ; Blank the interior of the window (bitmap area) 37073 LD HL,23493 ; Load x-coordinate of left of interior of window into C... 37076 LD C,(HL) ; ... 37077 INC HL ; Load y-coordinate of top of interior of window into B... 37078 LD B,(HL) ; ... 37079 CALL 36551 ; Move virtual cursor (bitmap) to top-left of interior or window 37082 PUSH HL ; Store HL ; The operand of the instruction at #R37083 represents the "Draw Hand Menu Cursor" Flag. This is modified by the ; instructions at #R36945, #R36982 and #R36990. 37083 LD A,0 ; Load A with "Draw Hand Menu Cursor" Flag 37085 CP 105 ; If value is not 105... 37087 JP NZ,37138 ; ...then jump to #R37138 (i.e. don't draw the hand cursor) ; Window is a menu (105) 37090 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 37094 INC C ; Increase x-coordinate by one 37095 LD A,(23489) ; Load A with starting y-coordinate of hand cursor 37098 ADD A,B ; Add y-coordinate of top of area to this... 37099 LD B,A ; ...and place back into B 37100 PUSH BC ; Store Coordinates for later 37101 CALL 36551 ; Move virtual cursor (bitmap) to coordinates in BC 37104 LD DE,54701 ; Load DE with pointer to "menu hand" graphic 37107 LD B,8 ; Loop over 8 pixel rows (drawing upper half of hand): *37109 LD A,(DE) ; Load a bitmap byte from hand graphic 37110 LD (HL),A ; Place bitmap byte at virtual cursor (bitmap) location (i.e. draw it to screen) 37111 INC DE ; Advance DE 37112 INC L ; Advance L (i.e. move right one character as hand graphic is 2-by-2 characters) 37113 LD A,(DE) ; Load a bitmap byte from hand graphic 37114 LD (HL),A ; Place bitmap byte at virtual cursor (bitmap) location (i.e. draw it to screen) 37115 DEC L ; Move virtual cursor (bitmap) left one character again 37116 INC DE ; Advance DE 37117 INC H ; Advance H (i.e. move down one pixel row, or 256 bytes) 37118 DJNZ 37109 ; Repeat loop to draw next row 37120 POP BC ; Recover coordinates 37121 INC B ; Increase y-coordinate as we are now drawing lower half of hand 37122 CALL 36551 ; Move virtual cursor (bitmap) to coordinates in BC 37125 LD B,8 ; Loop over 8 pixel rows (drawing lower half of hand): *37127 LD A,(DE) ; Load a bitmap byte from hand graphic 37128 LD (HL),A ; Place bitmap byte at virtual cursor (bitmap) location (i.e. draw it to screen) 37129 INC DE ; Advance DE 37130 INC L ; Advance L (i.e. move right one character as hand graphic is 2-by-2 characters) 37131 LD A,(DE) ; Load a bitmap byte from hand graphic 37132 LD (HL),A ; Place bitmap byte at virtual cursor (bitmap) location (i.e. draw it to screen) 37133 DEC L ; Move virtual cursor (bitmap) left one character again 37134 INC DE ; Advance DE 37135 INC H ; Advance H (i.e. move down one pixel row, or 256 bytes) 37136 DJNZ 37127 ; Repeat loop to draw next row *37138 XOR A ; Set A to zero 37139 LD (23475),A ; Set hand cursor's current y-coordinate to zero (i.e. defaults to top of its movement range ; within current window) 37142 POP HL ; Restore HL 37143 LD (36488),HL ; Set memory location to start printing character in character printing routine 37146 RET ; Return ; Draw a Window Frame ; ; Used by the routine at #R36987. Input: A Window border attribute A' Window background colour c37147 LD (23695),A ; Store border attribute in system variable ATTR T 37150 LD A,(23493) ; Load A with x-coordinate of left of window 37153 LD C,A ; Copy into C 37154 LD A,(23495) ; Load A with x-coordinate of right of window 37157 SUB C ; Get distance between left and right coordinates 37158 DEC A ; Subtract 1 to get width of window top-edge (not including corner pieces) 37159 LD C,A ; Transfer this to BC... 37160 LD B,0 ; ... 37162 PUSH BC ; Store BC on stack 37163 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 37167 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) 37168 CALL 36551 ; Set position of virtual cursor for drawing 37171 POP HL ; Put width of top edge piece into HL... 37172 PUSH HL ; ...but retain it on stack also 37173 CALL 36908 ; Draw the top edge of the window 37176 LD A,(36912) ; Get previously drawn window component character (i.e. top edge)... 37179 INC A ; ...and increase to obtain next one (i.e. bottom edge) 37180 LD (36912),A ; Place this new character into the drawing routine 37183 LD A,(23493) ; Load A with x-coordinate of left of window 37186 LD C,A ; Copy into C 37187 LD A,(23496) ; Load A with y-coordinate of bottom of window 37190 LD B,A ; Copy into B 37191 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) 37192 CALL 36551 ; Set position of virtual cursor for drawing 37195 POP HL ; Put width of bottom edge into HL... 37196 CALL 36908 ; Draw the bottom edge of the window 37199 LD A,(36912) ; Get previously drawn window component character (i.e. bottom edge)... 37202 INC A ; ...and increase to obtain next one (i.e. left edge) 37203 LD (36912),A ; Place this new character into the drawing routine 37206 LD A,(23494) ; Load y-coordinate of top of window into A 37209 LD B,A ; Copy into B 37210 LD A,(23496) ; Load y-coordinate of bottom of window into A 37213 SUB B ; Subtract B... 37214 DEC A ; ...and decrease by one to get length of left-edge (not including corner pieces) *37215 PUSH AF ; Store AF (A contains length of left / right edges) 37216 LD E,A ; Store length in E 37217 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 37221 ADD A,B ; Add to get starting point of left edge 37222 LD B,A ; Load into B 37223 PUSH DE ; Store DE 37224 CALL 36551 ; Set position of virtual cursor for drawing 37227 LD A,(36912) ; Get character to draw 37230 CALL 36475 ; Draw character 37233 POP DE ; Restore DE (length of edge in E) 37234 LD A,(23495) ; Load x-coordinate of right edge of window into A 37237 LD C,A ; Copy to C 37238 LD A,(23494) ; Load y-coordinate of top edge of window into A 37241 ADD A,E ; Add to E to give y-coordinate of bottom of edge 37242 LD B,A ; Copy to B 37243 CALL 36551 ; Set position of virtual cursor for drawing 37246 LD A,(36912) ; Get character previously drawn (left edge)... 37249 INC A ; ...and increase to give right edge 37250 CALL 36475 ; Draw character 37253 POP AF ; Restore AF (A contains length of left / right edges) 37254 DEC A ; Decrease A by one as we have drawn one character of both left and right edges 37255 JP NZ,37215 ; If there is still some left and right edge to be drawn, loop back ; edges of window have been drawn 37258 LD A,(23495) ; Load x-coordinate of right edge into A 37261 LD C,A ; Copy to C 37262 LD A,(23494) ; Load y-coordinate of top edge into A 37265 LD B,A ; Copy to B 37266 CALL 36551 ; Set position of virtual cursor for drawing 37269 LD A,(36912) ; Get character previously STORED (left edge)... 37272 INC A ; ...and increase twice to get top-right corner piece... 37273 INC A ; ... 37274 LD (36912),A ; Update drawing routine with this character 37277 CALL 36475 ; Draw character 37280 LD BC,(23495) ; Load B with y-coordinate of bottom edge and C with x-coordinate of right edge 37284 CALL 36551 ; Set position of virtual cursor for drawing 37287 LD A,(36912) ; Get character previously stored (top-right corner)... 37290 INC A ; ...and increase to get bottom-right corner piece 37291 LD (36912),A ; Place this character back into drawing routine 37294 CALL 36475 ; Draw character 37297 LD A,(23493) ; Load x-coordinate of left edge into A 37300 LD C,A ; Copy into C 37301 LD A,(23496) ; Load y-coordinate of bottom edge into A 37304 LD B,A ; Copy into B 37305 CALL 36551 ; Set position of virtual cursor for drawing 37308 LD A,(36912) ; Get character previously stored (bottom-right corner)... 37311 INC A ; ...and increase to get bottom-left corner piece 37312 LD (36912),A ; Place this character back into drawing routine 37315 CALL 36475 ; Draw character 37318 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 37322 CALL 36551 ; Set position of virtual cursor for drawing 37325 LD A,(36912) ; Get character previously stored (bottom-left corner)... 37328 INC A ; ...and increase to get top-left corner piece 37329 CALL 36475 ; Draw character 37332 RET ; Return ; Process Keyboard / Joystick Input on a Menu ; ; Used by the routines at #R26673, #R31153, #R31370, #R31636, #R32655, #R33663, #R34914, #R35141, #R35293 and ; #R38725. Output: A ASCII code of letter shortcut that has been selected on menu c37333 LD A,(37084) ; Check whether to draw hand cursor on menu... 37336 CP 105 ; ...and if not... 37338 RET NZ ; ...return 37339 LD A,(23493) ; Load x-coordinate of current window's top-left corner into A 37342 INC A ; Increase by one character... 37343 LD (23490),A ; ...and store for later use 37346 LD A,(23489) ; Load starting y-coordinate of hand cursor into A... 37349 LD B,A ; and copy into B 37350 LD A,(23494) ; Load y-coordinate of current window's top-left corner into A... 37353 ADD A,B ; ...add to B... 37354 ADD A,A ; ...and multiply by 8 to get y-coordinate of top of hand cursor in pixels... 37355 ADD A,A ; ... 37356 ADD A,A ; ... 37357 LD (23491),A ; Then store for later use 37360 LD A,(23496) ; Load y-coordinate of current window's bottom edge into A... 37363 ADD A,A ; ...multiply by eight... 37364 ADD A,A ; ... 37365 ADD A,A ; ... 37366 ADD A,7 ; ...then add 7 to get y-coordinate of absolute bottom of window in pixels 37368 LD (23492),A ; ...and store for later 37371 LD A,(23494) ; Load y-coordinate of current window's top-left corner into A... 37374 LD B,A ; ...and copy into B 37375 LD A,(23496) ; Load y-coordinate of current window's bottom-right corner into A... 37378 SUB B ; ...subtract B... 37379 DEC A ; ...then subtract one to get height of window, not including frame 37380 LD B,A ; Copy this into B 37381 LD A,(23489) ; Load A with initial y-coordinate of hand cursor relative to current window... 37384 SUB B ; ...subtract B... 37385 NEG ; ...and negate to give vertical distance available to hand cursor to move 37387 ADD A,A ; Multiply this by eight to convert from chars to pixels... 37388 ADD A,A ; ... 37389 ADD A,A ; ... 37390 LD (23471),A ; ...and store at 23471 37393 CALL 37571 ; Apply FLASH attribute to menu letter shortcut next to hand menu cursor ; This entry point is used by the routines at #R37497 and #R37523. *37396 XOR A ; Set A to zero 37397 LD (23560),A ; Clear last pressed key 37400 HALT ; Wait for interrupt / reset 37401 CALL 37876 ; Capture keyboard input, or jump to joystick reading routine 37404 BIT 2,A ; If "up" pressed then... 37406 JP NZ,37497 ; ...jump to routine to move Hand Cursor up and update flashing menu shortcut 37409 BIT 3,A ; If "down" pressed then... 37411 JP NZ,37523 ; ...jump to routine to move Hand Cursor down and update flashing menu shortcut 37414 BIT 4,A ; If "fire" pressed then... 37416 JP NZ,37552 ; ...jump to routine to load A with ASCII code of shortcut for selected item in menu 37419 LD A,(23560) ; Load last pressed key (system variable) into A... 37422 OR A ; ...and if this is zero (i.e. no key pressed)... 37423 JR Z,37396 ; ...loop back to #R37396 37425 LD (37457),A ; Store pressed key further on in this routine 37428 LD A,(23491) ; Load A with y-coordinate of top of hand cursor (pixels)... 37431 CALL 30123 ; ...and divide by eight to get top of cursor in characters 37434 INC A ; Add one to this 37435 LD B,A ; Copy into B 37436 LD A,(23493) ; Load A with x-coordinate of left edge of current window (characters) 37439 LD C,A ; Copy into C 37440 LD A,(23492) ; Load A with y-coordinate of bottom of window (including frame) (pixels) 37443 CALL 30123 ; Divide by eight to get coordinate in characters... 37446 INC A ; ...and add one *37447 EX AF,AF' ; Switch A register 37448 PUSH BC ; Store B and C 37449 CALL 36551 ; Move Virtual Bitmap Cursor to Display File address for coordinates (C,B) 37452 CALL 37613 ; Load ASCII code of character in Display File address stored at 36488 into A (i.e. letter ; shortcut for command at current y-coordinate) 37455 POP BC ; Restore coordinates to BC ; The operand of the instruction at #R37456 represents the index of the key that was pressed. This is modified by ; the instruction at #R37425. 37456 CP 0 ; If last-pressed key matches this letter shortcut... 37458 JR Z,37468 ; ...then jump to end of routine 37460 INC B ; ...else increase y-coordinate by one (i.e. move onto next row of menu) 37461 EX AF,AF' ; Switch A register... 37462 CP B ; ...and if current y-coordinate is less than this (i.e. we haven't yet reached the last ; command in this window)... 37463 JR NZ,37447 ; ...then loop back to #R37447 for next row of text in window 37465 JP 37396 ; Repeat process for next key-press *37468 CALL 37472 ; Wait for keyboard to be released 37471 RET ; Return ; Wait for Keyboard to be Released ; ; Used by the routines at #R26835, #R27176, #R37333 and #R38749. c37472 PUSH AF ; Store AF *37473 LD A,(23556) ; Read first byte of second keyboard map (system variable)... 37476 CP 255 ; ...and if this is not 255 (i.e. not marked as "free")... 37478 JR NZ,37473 ; ...loop back 37480 XOR A ; Set last key pressed to NULL... 37481 LD (23560),A ; ... 37484 POP AF ; Restore AF 37485 RET ; Return ; Wait for Fire Button / Key to be Released ; ; Used by the routines at #R27176, #R37552 and #R38749. c37486 PUSH AF ; Store AF *37487 HALT ; Wait for interrupt 37488 CALL 37876 ; Capture keyboard / joystick input into A 37491 BIT 4,A ; If fire button / key pressed... 37493 JR NZ,37487 ; ...loop back 37495 POP AF ; Restore AF 37496 RET ; Return ; Move Hand Cursor Up and Update Flashing Menu Shortcut ; ; Used by the routine at #R37333. c37497 CALL 37566 ; Remove FLASH attribute from menu letter shortcut next to hand menu cursor 37500 LD A,(23475) ; Load menu hand cursor's current y-coordinate into A 37503 OR A ; If coordinate is zero... 37504 JR Z,37517 ; ...then skip ahead to end of this routine 37506 DEC A ; Decrease cursor's y-coordinate by two... 37507 DEC A ; ... 37508 LD (23475),A ; Place new coordinate back into memory 37511 CALL 38296 ; Scroll Hand Cursor up a unit 37514 CALL 38296 ; Scroll Hand Cursor up a unit *37517 CALL 37571 ; Apply FLASH attribute to menu letter shortcut next to hand menu cursor 37520 JP 37396 ; Jump back to input processing routine ; Move Hand Cursor Down and Update Flashing Menu Shortcut ; ; Used by the routine at #R37333. c37523 CALL 37566 ; Remove FLASH attribute from menu letter shortcut next to hand menu cursor 37526 LD A,(23475) ; Load menu hand cursor's current y-coordinate into A 37529 LD HL,23471 ; Point HL at height available to hand cursor to move down... 37532 CP (HL) ; ...and if these are equal (i.e. hand cursor is as far down as it can go)... 37533 JR Z,37546 ; ...then skip ahead to end of this routine 37535 INC A ; Increase cursor's y-coordinate by two... 37536 INC A ; ... 37537 LD (23475),A ; Place new coordinate back into memory 37540 CALL 38356 ; Scroll Hand Cursor down a unit 37543 CALL 38356 ; Scroll Hand Cursor down a unit *37546 CALL 37571 ; Apply FLASH attribute to menu letter shortcut next to hand menu cursor 37549 JP 37396 ; Jump back to input processing routine ; Load A with ASCII Code of Shortcut for Selected Item in Menu ; ; Used by the routine at #R37333. Output: A ASCII code of letter shortcut that has been selected on menu c37552 CALL 37486 ; Wait for fire button / key to be released 37555 LD BC,(23472) ; Load y-coordinate of Hand Cursor's finger and x-coordinate of left edge of interior of window ; into B and C respectively 37559 CALL 36551 ; Move Virtual Bitmap Cursor to Display File address for coordinates x=C, y=B 37562 CALL 37613 ; Load ASCII code of character in Display File address stored at 36488 into A 37565 RET ; Return ; Remove FLASH Attribute from Menu Letter Shortcut Next to Hand Menu Cursor ; ; Used by the routines at #R37497 and #R37523. c37566 LD HL,32742 ; Load HL with opcode for "AND 127" (remove FLASH attribute) 37569 JR 37574 ; Remove FLASH attribute on menu letter shortcut next to hand menu cursor ; Apply FLASH Attribute to Menu Letter Shortcut Next to Hand Menu Cursor ; ; Used by the routines at #R37333, #R37497 and #R37523. c37571 LD HL,33014 ; Load HL with opcode for "OR 128" (apply FLASH attribute) ; This entry point is used by the routine at #R37566. *37574 LD (37609),HL ; Modify attribute modification code below with opcode stored in HL 37577 LD A,(23493) ; Load A with x-coordinate of left edge of current window... 37580 LD C,A ; ...and copy into C 37581 LD A,(23475) ; Load hand cursor's current y-coordinate into A 37584 ADD A,5 ; Add five (as the "finger" of the cursor naturally points five pixels below the cursor's ; actual position) 37586 CALL 30123 ; Divide this new y-coordinate by eight to get y-coordinate in characters 37589 LD B,A ; Load this y-coordinate into B 37590 LD A,(23489) ; Load initial y-coordinate of top of hand cursor relative to current window, into A 37593 ADD A,B ; Add this to y-coordinate of "finger" 37594 LD B,A ; Load this into B, so that B now contains y-coordinate of "finger" relative to top of window ; (characters) 37595 LD A,(23494) ; Load y-coordinate of top edge of current window into A 37598 ADD A,B ; Add... 37599 INC A ; ...then add one (for window frame at top) so we now have y-coordinate of "finger" relative to ; screen 37600 LD B,A ; Load into B 37601 LD (23472),BC ; Store coordinates at 23472 37605 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 37608 LD A,(HL) ; Load current attribute at this location into A ; The instruction at #R37609 represents the modification to make to the attribute value (either AND 127 which ; removes FLASH, or OR 128 which applies FLASH). This is modified by the instruction at #R37574. 37609 NOP ; Update FLASH Flag as required... 37610 NOP ; ... 37611 LD (HL),A ; Load modified attribute back into Attribute File at coordinates X=C, Y=B 37612 RET ; Return ; Load ASCII Code of Character in Display File Address Stored at 36488 into A ; ; Used by the routines at #R37333 and #R37552. Output: A ASCII code of character c37613 LD HL,64252 ; Point HL at start of letter A graphic in character set 37616 EX DE,HL ; Swap into DE 37617 LD B,26 ; Load B with 26 *37619 PUSH BC ; Store BC 37620 LD HL,(36488) ; Load (video) memory location to start printing character into HL 37623 LD BC,2048 ; Load B with 8 and C with zero *37626 LD A,(DE) ; Read a byte of the character's graphic data... 37627 CP (HL) ; ...compare to what is already displayed in Display File at to-print location... 37628 JR Z,37631 ; ...and if they're the same, jump to #R37631 37630 INC C ; Else increase C *37631 INC H ; Move down one pixel row (advance by 256 bytes) in Display File 37632 INC DE ; Advance to next pixel row of character of interest 37633 DJNZ 37626 ; Loop back for next row 37635 LD A,C ; Copy C into A... 37636 OR A ; ...and if it is zero (i.e. current character in character set is same as character at ; to-print location in Display File)... 37637 JR Z,37645 ; ...jump ahead to #R37645 37639 POP BC ; Restore BC 37640 DJNZ 37619 ; Loop back for next character 37642 LD A,48 ; Load A with 48 37644 RET ; Return *37645 POP BC ; Character in Display File at to-print location is same as character with index (26 - B)... 37646 LD A,B ; ...so load B into A... 37647 SUB 26 ; ...subtract 26... 37649 NEG ; ...and negate to get index of character in A (e.g. A=0, B=1, C=2 ...) 37651 ADD A,65 ; Add 65 to get ASCII index 37653 RET ; Return ; Print or Update Command Summary Window at Bottom of Screen ; ; Used by the routines at #R30222, #R30602, #R31370, #R32035, #R32194, #R32655, #R33036, #R33312, #R33593, #R33663, ; #R34914 and #R35141. The operand of the instruction at #R37654 represents the index of the window being drawn. ; This is modified by the instructions at #R36998 and #R37699. c37654 LD A,0 ; Load A with the index of the window being drawn 37656 PUSH AF ; Store AF 37657 LD HL,(36488) ; Store current (video) memory location to start printing character... 37660 PUSH HL ; ... 37661 LD HL,(23493) ; Store x- & y-coordinates of top-left of currently drawn window... 37664 PUSH HL ; ... 37665 LD HL,(23494) ; Store y- & x-coordinates of top-right of currently drawn window... 37668 PUSH HL ; ... 37669 LD A,1 ; Draw window 1 (Command Summary Window at bottom of screen)... 37671 CALL 36987 ; ... 37674 LD HL,43271 ; Point HL to ("COMMAND") text... 37677 CALL 36725 ; ...and print text 37680 LD HL,(36488) ; Copy current (video) memory location to start printing character into memory at 65530... 37683 LD (65530),HL ; ... 37686 POP HL ; Restore y- & x-coordinates of top-right of currently drawn window... 37687 LD (23494),HL ; ... 37690 POP HL ; Restore x- & y-coordinates of top-left of currently drawn window... 37691 LD (23493),HL ; ... 37694 POP HL ; Restore current (video) memory location to start printing character... 37695 LD (36488),HL ; ... 37698 POP AF ; Restore AF (A = index of window being drawn)... 37699 LD (37655),A ; ...and store at 37654 37702 RET ; Return ; Move Virtual Text Cursor to Beginning of Character Row Below its Current Position ; ; Used by the routines at #R28344, #R36800 and #R36810. c37703 LD HL,(36488) ; Load "memory location to start printing character" in character printing routine into HL 37706 LD A,L ; Add 32 to LSB (i.e. move down a character row)... 37707 ADD A,32 ; ... 37709 JP C,37735 ; If overflows from A register (crossing between successive thirds of the bitmap display) then ; jump to #R37735 37712 AND 224 ; Clear bits for 1, 2, 4, 8 and 16 (i.e. set to zero) to set cursor to beginning of new ; character row 37714 LD L,A ; Place modified value back into HL... 37715 LD (36488),HL ; ...and update stored value accordingly 37718 RET ; Return ; Move Virtual Text Cursor to Beginning of Character Row Two Rows Below its Current Position ; ; Used by the routine at #R28561. c37719 LD HL,(36488) ; Load "memory location to start printing character" in character printing routine into HL 37722 LD A,L ; Add 64 to LSB (i.e. move down two rows)... 37723 ADD A,64 ; ... 37725 JP C,37735 ; If overflows from A register (crossing between successive thirds of the bitmap display) then ; jump to #R37735 37728 AND 224 ; Clear bits for 1, 2, 4, 8 and 16 (i.e. set to zero) to set cursor to beginning of new ; character row 37730 LD L,A ; Place modified value back into HL... 37731 LD (36488),HL ; ...and update stored value accordingly 37734 RET ; Return ; Move Virtual Text Cursor from One Third to Another in Display File ; ; Used by the routines at #R37703 and #R37719. c37735 AND 224 ; Clear bits for 1, 2, 4, 8 and 16 (i.e. set to zero) to set cursor to beginning of new ; character row 37737 LD L,A ; Put value back into L 37738 LD A,H ; Get value of H 37739 ADD A,8 ; Increase by 8 (as we're moving one text row, or EIGHT pixel rows down) 37741 LD H,A ; Place modified value back into HL... 37742 LD (36488),HL ; ...and update stored value accordingly 37745 RET ; Return ; Convert Numeric Value BC to ASCII String at Location HL ; ; Used by the routines at #R36647 and #R36675. Input: BC A numeric value HL Points to location to hold a ; five-character string, e.g. #R23497) c37746 PUSH DE ; Store DE 37747 LD DE,54743 ; Point DE at table of powers of ten 37750 PUSH BC ; Store BC (value) 37751 PUSH HL ; Store HL (location to hold string) 37752 PUSH HL ; Store HL (location to hold string) 37753 LD H,B ; Load BC (value) into HL... 37754 LD L,C ; ... *37755 EX DE,HL ; Swap DE (now value) and HL (now pointer to table of powers of ten) 37756 LD C,(HL) ; Read WORD at HL (power of ten) into BC... 37757 INC HL ; ...and advance HL by two bytes... 37758 LD B,(HL) ; ... 37759 INC HL ; ... 37760 EX DE,HL ; Swap DE (now pointer to next power of ten) and HL (now value) 37761 LD A,47 ; Load A with 47 (ASCII code immediately prior to that for zero, "0") *37763 INC A ; Increase A to next ASCII character 37764 OR A ; (Re)Set carry flag 37765 SBC HL,BC ; Subtract (BC [power of ten] + carry flag) from HL (value) 37767 JR NC,37763 ; If carry flag was not set then loop back to #R37763 37769 ADD HL,BC ; Add power of ten back to HL 37770 EX (SP),HL ; Swap value on top of stack (now remaining value) with HL (now location to hold string) 37771 LD (HL),A ; Store ASCII code in table at #R23497 and advance HL to next slot... 37772 INC HL ; ... 37773 EX (SP),HL ; Swap value on top of stack (pointer to entry in table of ASCII characters at 23497) with HL ; (now remaining value) 37774 DEC C ; Decrease C to check if last power of ten (i.e. 1) has been reached... 37775 JR NZ,37755 ; ...and if not, then loop back to #R37755 for next power of ten 37777 POP HL ; Restore HL 37778 POP HL ; Restore HL 37779 POP BC ; Restore BC 37780 POP DE ; Restore DE 37781 RET ; Return ; Clear Top Two Thirds of Display File and Draw Two Rows of [SPACE] Characters Below (UNUSED) c37782 LD HL,20480 ; Point HL two thirds of the way down Display File 37785 LD (36488),HL ; Store this address at 36488 37788 LD HL,64 ; Set width to 64 37791 LD A,32 ; Set window border style character to 32 (a SPACE character)... 37793 LD (36912),A ; ... 37796 CALL 36908 ; Draw upper edge of frame of a window 37799 LD HL,0 ; Load zero (all bits reset) into HL 37802 LD BC,8 ; Load 0 into B and 8 into C to repeat outer loop 8 times 37805 DI ; Disable interrupts 37806 LD (37837),SP ; Store stack pointer at 37837 37810 LD SP,20480 ; Point stack pointer two thirds of the way down Display File 37813 JP 37830 ; Jump into clearing routine ; Clear Display File ; ; Used by the routines at #R26747 and #R26906. c37816 LD HL,0 ; Load zero (all bits reset) into HL 37819 LD BC,12 ; Load 0 into B and 12 into C to repeat outer loop 12 times 37822 DI ; Disable interrupts 37823 LD (37837),SP ; Store stack pointer at 37837 37827 LD SP,22528 ; Point stack pointer at start of Attribute File ; This entry point is used by the routine at #R37782. *37830 PUSH HL ; Decrease current stack pointer position by two and load two zeroes into it 37831 DJNZ 37830 ; As B is already zero, this will "decrease" B to 255 and thus run through loop 256 times 37833 DEC C ; Decrease C... 37834 JR NZ,37830 ; ...and repeat if C is still greater than zero ; The operand of the instruction at #R37836 represents the original value in SP stored previously. This is modified ; by the instructions at #R37806 and #R37823. 37836 LD SP,0 ; Restore stack pointer to original value 37839 EI ; Enable interrupts 37840 RET ; Return ; Set Entire Attribute File to Colour Housed in ATTR T System Variable ; ; Used by the routines at #R26747 and #R26906. c37841 LD HL,22528 ; Load HL with start of Attribute File 37844 LD DE,22529 ; Load DE with next byte up 37847 LD BC,767 ; Load BC with length of data to copy (767 bytes = length of Attribute File minus one) 37850 LD A,(23695) ; Load system variable ATTR T into A 37853 LD (HL),A ; Load memory at HL with this attribute... 37854 LDIR ; ...and repeat 767 times 37856 RET ; Return ; Change Input Device (Keyboard / Joysticks) ; ; Used by the routines at #R26673 and #R26906. Input: A ASCII code of selected menu option from "A" to "E" (65 - ; 69) c37857 SUB 65 ; Subtract 65 (ASCII code for "A") to get index of menu item selected 37859 ADD A,A ; Double the value 37860 LD H,0 ; Load into HL... 37862 LD L,A ; ... 37863 LD BC,54733 ; Point BC at start table of start addresses of input device reading routines 37866 ADD HL,BC ; Add double selected item index to BC in HL (HL now points to entry for selected input device) 37867 LD A,(HL) ; Load address into HL... 37868 INC HL ; ... 37869 LD H,(HL) ; ... 37870 LD L,A ; ... 37871 LD (37882),HL ; Place in routine at 37882 37874 XOR A ; Reset A to zero 37875 RET ; Return ; Capture Keyboard Input, or Jump to Joystick Reading Routine ; ; Used by the routines at #R27176, #R37333, #R37486 and #R38749. Output: A Stored key-press (bits: 0=LEFT, 1=RIGHT, ; 2=UP, 3=DOWN, 4=FIRE) c37876 LD HL,23485 ; Set stored keyboard / joystick action to zero... 37879 LD (HL),0 ; ... ; The operand of the instruction at #R37881 represents the address of the appropriate keyboard / joystick reading ; routine. This is modified by the instruction at #R37857. 37881 JP 37884 ; Jump to keyboard / joystick reading routine *37884 LD C,254 ; IN 65022 reads the half row A to G... 37886 LD B,253 ; ... 37888 IN A,(C) ; Read keyboard 37890 BIT 0,A ; "A" key pressed so... 37892 CALL Z,38066 ; ...store an UP input from control device 37895 INC B ; IN 65278 reads the half row CAPS SHIFT to V 37896 IN A,(C) ; Read keyboard 37898 BIT 1,A ; "Z" key pressed so... 37900 CALL Z,38069 ; ...store a DOWN input from control device 37903 LD B,127 ; IN 32766 reads the half row SPACE to B 37905 IN A,(C) ; Read keyboard 37907 BIT 3,A ; "N" key pressed so... 37909 CALL Z,38060 ; ...store a LEFT input from control device 37912 IN A,(C) ; Read keyboard 37914 BIT 2,A ; "M" key pressed so... 37916 CALL Z,38063 ; ...store a RIGHT input from control device 37919 IN A,(C) ; Read keyboard 37921 BIT 0,A ; SPACE bar pressed so... 37923 CALL Z,38072 ; ...store a FIRE input from control device 37926 LD A,(HL) ; Return stored key-press in A 37927 RET ; Return ; Capture Kempston Joystick Input Input: HL #R23485 (store for currently active keyboard press / joystick action) ; Output: A Stored key-press (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c37928 LD C,31 ; Load 31 (Kempston port number) into A 37930 IN A,(C) ; Read byte from port 31 (i.e. read state of joystick) 37932 BIT 0,A ; If joystick moved right... 37934 CALL NZ,38063 ; ...store a RIGHT input from control device 37937 BIT 1,A ; If joystick moved left... 37939 CALL NZ,38060 ; ...store a LEFT input from control device 37942 BIT 2,A ; If joystick moved down... 37944 CALL NZ,38069 ; ...store a DOWN input from control device 37947 BIT 3,A ; If joystick moved up... 37949 CALL NZ,38066 ; ...store an UP input from control device 37952 BIT 4,A ; If fire button pressed... 37954 CALL NZ,38072 ; ...store a FIRE input from control device 37957 LD A,(HL) ; Return stored joystick movement in A 37958 RET ; Return ; Capture Fuller Joystick Input Input: HL #R23485 (store for currently active keyboard press / joystick action) ; Output: A Stored key-press (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c37959 LD C,127 ; Load 127 (Fuller port number) into A 37961 IN A,(C) ; Read byte from port 127 (i.e. read state of joystick) 37963 BIT 2,A ; If joystick moved left... 37965 CALL Z,38060 ; ...store a LEFT input from control device 37968 BIT 3,A ; If joystick moved right... 37970 CALL Z,38063 ; ...store a RIGHT input from control device 37973 BIT 1,A ; If joystick moved down... 37975 CALL Z,38069 ; ...store a DOWN input from control device 37978 BIT 0,A ; If joystick moved up... 37980 CALL Z,38066 ; ...store an UP input from control device 37983 BIT 7,A ; If fire button pressed... 37985 CALL Z,38072 ; ...store a FIRE input from control device 37988 LD A,(HL) ; Return stored joystick movement in A 37989 RET ; Return ; Capture Cursor Joystick Input Input: HL #R23485 (store for currently active keyboard press / joystick action) ; Output: A Stored key-press (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c37990 LD C,254 ; IN 63486 reads the half row 1 to 5... 37992 LD B,247 ; ... 37994 IN A,(C) ; Read keyboard/joystick 37996 BIT 4,A ; If joystick moved left ("5" key pressed)... 37998 CALL Z,38060 ; ...store a LEFT input from control device 38001 LD B,239 ; IN 61438 reads the half row O to 6 38003 IN A,(C) ; Read keyboard/joystick 38005 BIT 2,A ; If joystick moved right ("8" key pressed)... 38007 CALL Z,38063 ; ...store a RIGHT input from control device 38010 BIT 4,A ; If joystick moved down ("6" key pressed)... 38012 CALL Z,38069 ; ...store a DOWN input from control device 38015 BIT 3,A ; If joystick moved up ("7" key pressed)... 38017 CALL Z,38066 ; ...store an UP input from control device 38020 BIT 0,A ; If fire button pressed ("0" key pressed)... 38022 CALL Z,38072 ; ...store a FIRE input from control device 38025 LD A,(HL) ; Return stored joystick movement in A 38026 RET ; Return ; Capture ZX Interface 2 Joystick 1 Input Input: HL #R23485 (store for currently active keyboard press / joystick ; action) Output: A Stored key-press (bits: 0=LEFT, 1=RIGHT, 2=UP, 3=DOWN, 4=FIRE) c38027 LD C,254 ; IN 61438 reads the half row O to 6... 38029 LD B,239 ; ... 38031 IN A,(C) ; ... 38033 BIT 4,A ; If joystick moved left ("6" key pressed)... 38035 CALL Z,38060 ; ...store a LEFT input from control device 38038 BIT 3,A ; If joystick moved right ("7" key pressed)... 38040 CALL Z,38063 ; ...store a RIGHT input from control device 38043 BIT 2,A ; If joystick moved down ("8" key pressed)... 38045 CALL Z,38069 ; ...store a DOWN input from control device 38048 BIT 1,A ; If joystick moved down ("9" key pressed)... 38050 CALL Z,38066 ; ...store an UP input from control device 38053 BIT 0,A ; If fire button pressed ("0" key pressed)... 38055 CALL Z,38072 ; ...store a FIRE input from control device 38058 LD A,(HL) ; Return stored joystick movement in A 38059 RET ; Return ; Store a LEFT Input from Control Device ; ; Used by the routines at #R37876, #R37928, #R37959, #R37990 and #R38027. Input: HL #R23485 (store for currently ; active keyboard press / joystick action) c38060 SET 0,(HL) ; Set Left Pressed Flag 38062 RET ; Return ; Store a RIGHT Input from Control Device ; ; Used by the routines at #R37876, #R37928, #R37959, #R37990 and #R38027. Input: HL #R23485 (store for currently ; active keyboard press / joystick action) c38063 SET 1,(HL) ; Set Right Pressed Flag 38065 RET ; Return ; Store an UP Input from Control Device ; ; Used by the routines at #R37876, #R37928, #R37959, #R37990 and #R38027. Input: HL #R23485 (store for currently ; active keyboard press / joystick action) c38066 SET 2,(HL) ; Set Up Pressed Flag 38068 RET ; Return ; Store a DOWN Input from Control Device ; ; Used by the routines at #R37876, #R37928, #R37959, #R37990 and #R38027. Input: HL #R23485 (store for currently ; active keyboard press / joystick action) c38069 SET 3,(HL) ; Set Down Pressed Flag 38071 RET ; Return ; Store a FIRE Input from Control Device ; ; Used by the routines at #R37876, #R37928, #R37959, #R37990 and #R38027. Input: HL #R23485 (store for currently ; active keyboard press / joystick action) c38072 SET 4,(HL) ; Set Fire Pressed Flag 38074 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 ; #R38080) is a delay constant that determines the speed at which the sound is played. Input: A (Entry at #R38080 ; only) Delay constant c38075 XOR A ; Set A to 0 38076 LD B,13 ; Set B to 13 (DEC C) 38078 LD H,A ; Set HL to 0... 38079 LD L,A ; ... ; This entry point is used by the routines at #R38108 and #R38116. *38080 LD (38094),A ; Modify instruction at #R38093 with value of delay constant 38083 LD A,B ; Load B into A 38084 LD (38102),A ; Set instruction at #R38102 38087 LD (38103),HL ; Set instructions at #R38103 and #R38104 38090 CALL 38212 ; Load A with current border colour ; The operand of the instruction at #R38093 represents the value of the delay constant. This is modified by the ; instruction at #R38080. 38093 LD C,0 ; Load C with delay constant *38095 OUT (254),A ; Set border colour, and reset ear/speaker 38097 XOR 16 ; Invert ear/speaker bit of A 38099 LD B,C ; Load C (delay constant) into B... *38100 DJNZ 38100 ; ...and delay ; The instructions at #R38102 - #R38104 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 #R38084 and #R38087. 38102 DEC C ; Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone ; respectively 38103 NOP ; Do nothing, or increase delay constant 38104 NOP ; Do nothing, or increase delay constant 38105 JR NZ,38095 ; If delay constant is not zero, then loop back to continue playing tone 38107 RET ; Return ; Set Parameters for and Play Downward Scale Sound ; ; Used by the routines at #R26747, #R31153, #R34914 and #R35420. c38108 XOR A ; Set parameters... 38109 LD B,12 ; ...(INC C)... 38111 LD H,A ; ... 38112 LD L,A ; ... 38113 INC A ; ... 38114 JR 38080 ; ...and play sound ; Set Parameters for and Play Short Downward Scale Sound ; ; Used by the routines at #R35141 and #R35293. c38116 LD A,1 ; Set parameters... 38118 LD B,12 ; ...(INC C)... 38120 LD H,B ; ... 38121 LD L,B ; ... 38122 JR 38080 ; ...and play sound ; Play Hiss-Type Sound ; ; Used by the routines at #R38725 and #R38749. c38124 CALL 38212 ; 38127 EX AF,AF' ; 38128 LD H,0 ; 38130 LD BC,128 ; *38133 EX AF,AF' ; 38134 OUT (254),A ; 38136 XOR 16 ; 38138 EX AF,AF' ; 38139 LD L,0 ; 38141 LD D,L ; 38142 LD E,H ; 38143 AND A ; 38144 SBC HL,DE ; 38146 SBC HL,DE ; 38148 LD DE,254 ; 38151 ADD HL,DE ; 38152 LD A,L ; 38153 SUB H ; 38154 JR C,38157 ; 38156 DEC A ; *38157 LD H,A ; *38158 DEC A ; 38159 JR NZ,38158 ; 38161 DEC BC ; 38162 LD A,B ; 38163 OR C ; 38164 JR NZ,38133 ; 38166 RET ; ; Set Parameters (for Unknown Sound) and Jump to Playing Routine (Unused) c38167 LD HL,33006 ; Load HL with bytecodes for instruction "XOR 128" 38170 LD DE,255 ; Load D with 0 and E with 255 38173 JR 38189 ; Jump into sound playing routine ; Set Parameters (for "Lift has Arrived" Sound) and Jump to Playing Routine ; ; Used by the routines at #R33593 and #R33663. c38175 LD HL,8390 ; Load HL with bytecodes for instruction "ADD A,32" 38178 LD DE,255 ; Load D with 0 and E with 255 38181 JR 38189 ; Jump into sound playing routine ; Set Parameters (for Cheat Routine Sound) and Play ; ; Used by the routine at #R35420. c38183 LD HL,1222 ; Load HL with bytecodes for instruction "ADD A,4" 38186 LD DE,0 ; Load D with 0 and E with 0 ; This entry point is used by the routines at #R38167 and #R38175. *38189 CALL 38212 ; Load A with current border colour 38192 LD (38204),HL ; Set instruction at 38204 to "XOR 128", "ADD A,4" or "ADD A,32" depending upon value in HL *38195 OUT (254),A ; Set current border colour and reset speaker state 38197 XOR 16 ; Flip "speaker" bit 38199 LD B,E ; Copy E into B *38200 DJNZ 38200 ; Delay for period determined by B 38202 EX AF,AF' ; Switch AF and AF' 38203 LD A,E ; Copy E into A ; The instruction at #R38204 is modified by the instruction at #R38192, resulting in different sounds. 38204 XOR 128 ; Change E (delay constant)... 38206 LD E,A ; ... 38207 EX AF,AF' ; Switch AF and AF' again 38208 DEC D ; Decrease D (initially zero)... 38209 JR NZ,38195 ; ...and repeat loop (256 times) 38211 RET ; Return ; Get Current Border Colour ; ; Used by the routines at #R38075, #R38124 and #R38183. Output: A Current border colour (0 - 7) c38212 LD A,(23624) ; Get border & BASIC cursor area attribute 38215 RRCA ; Clear bits for 1, 2 and 4 to leave (border colour * 8) only... 38216 RRCA ; ... 38217 RRCA ; ... 38218 AND 7 ; Ensure all other bits are cleared 38220 RET ; Return ; Play "Beep" Sound (as in Moving Through Instructions Windows) ; ; Used by the routine at #R26835. c38221 PUSH AF ; Store AF 38222 PUSH BC ; Store BC 38223 LD B,0 ; Set B to zero *38225 XOR A ; Set A to zero 38226 OUT (254),A ; Reset speaker and border colour to zero 38228 LD C,100 ; Do nothing for 100 "cycles"... *38230 DEC C ; ... 38231 JR NZ,38230 ; ... 38233 XOR 16 ; Invert bit 4 (Ear / speaker bit)... 38235 OUT (254),A ; ...and write to port 254 (inverting state of speaker, making a sound) 38237 DJNZ 38225 ; Decrease B and loop back 38239 POP BC ; Restore BC 38240 POP AF ; Restore AF 38241 RET ; Return ; Fill the Interior of a Drawn Window With its Specified Attribute (i.e. Background Colour and Colour of Text ; Within) ; ; Used by the routine at #R36987. c38242 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge - these will become ; the current x- and y-coordinates of fill area 38246 CALL 36569 ; Update virtual attribute cursor (memory location 23487 and in HL) ; The operand of the instruction at #R38249 represents the attribute value with which to paint the window. This is ; modified by the instruction at #R37061. *38249 LD A,0 ; Load A with attribute to paint with 38251 LD (HL),A ; Paint attribute data to Attribute File at current virtual cursor (attribute) position 38252 LD A,(23495) ; Load A with x-coordinate of right side of area to fill 38255 CP C ; Check if left and right edges are at same x-coordinate (i.e. zero width)... 38256 JP Z,38272 ; ... and if so, skip to #R38272 38259 INC C ; Increase C 38260 LD A,C ; Copy C into A 38261 AND 31 ; Ensure current x-coordinate doesn't exceed 31 (i.e. width of screen) 38263 LD C,A ; Place back into C 38264 LD A,L ; Get LSB of Attribute File address (Virtual Attribute Cursor location) 38265 AND 224 ; Decrease to nearest multiple of 32 (i.e. start of character row in Attribute File) 38267 ADD A,C ; Add x-offset (i.e. current x-coordinate, C) 38268 LD L,A ; Update virtual attribute cursor position 38269 JP 38249 ; Loop back to print next attribute block *38272 LD A,(23493) ; Get x-coordinate of left of area to fill 38275 LD C,A ; Store in C 38276 LD A,(23496) ; Get y-coordinate of bottom of area to fill 38279 CP B ; Compare with y-coordinate of top of area to fill 38280 RET Z ; If no difference between current y-coordinate and y-coordinate of bottom of area to fill then ; exit function and return 38281 INC B ; Move current y-coord down one unit 38282 LD A,B ; Copy current y-coord into A... 38283 CP 24 ; ...and ensure it doesn't exceed 24 (i.e. height of screen)... 38285 JP NZ,38290 ; ...if it doesn't then skip ahead... 38288 LD B,0 ; ...else set current y-coord to zero (top of screen) *38290 CALL 36569 ; Update virtual attribute cursor (memory location 23487 and in HL) 38293 JP 38249 ; Loop back to print next attribute block row ; Scroll Hand Cursor Up a Unit ; ; Used by the routine at #R37497. c38296 LD A,(23491) ; Load y-coordinate of top of hand cursor into A 38299 LD C,A ; Copy into C 38300 LD DE,26064 ; Point DE at table of Display File addresses of starts of each pixel row 38303 LD H,0 ; Load y-coordinate into HL... 38305 LD L,A ; ... 38306 ADD HL,HL ; Double it 38307 ADD HL,DE ; And add as offset to table of Display File addresses of starts of each pixel row 38308 PUSH HL ; Transfer value into IX... 38309 POP IX ; ... 38311 LD A,(23492) ; Load y-coordinate of bottom of window into A 38314 SUB C ; Subtract y-coordinate of top of hand cursor 38315 DEC A ; Decrease by one, so now holds distance between top of hand cursor and bottom of window 38316 EX AF,AF' ; Exchange A register 38317 LD A,(23490) ; Load x-coordinate of left of interior of window (characters) into A 38320 LD C,A ; Copy into BC... 38321 LD B,0 ; ... 38323 EX AF,AF' ; Switch A register *38324 EX AF,AF' ; Switch A register (now holds y-coordinate of top of interior of window on first pass) 38325 INC IX ; Advance IX by two bytes... 38327 INC IX ; ... 38329 LD L,(IX+0) ; Load HL with Display File address of start of pixel row 1... 38332 LD H,(IX+1) ; ... 38335 LD E,(IX+2) ; Load DE with Display File address of start of pixel row 2... 38338 LD D,(IX+3) ; ... 38341 ADD HL,BC ; Add x-coordinate of left of interior of window to Display File address 38342 EX DE,HL ; Swap addresses 38343 ADD HL,BC ; Add x-coordinate of left of interior of window to Display File address 38344 EX DE,HL ; Swap addresses back (HL points to upper row and DE points to lower row) 38345 LD A,(DE) ; Read Display File data from lower row... 38346 LD (HL),A ; ...and copy into upper row 38347 INC DE ; Increase DE and HL (as hand cursor is two characters wide)... 38348 INC HL ; ... 38349 LD A,(DE) ; Read Display File data from lower row... 38350 LD (HL),A ; ...and copy into upper row 38351 EX AF,AF' ; Swap A register (holds remaining distance between top of hand cursor and bottom of window) 38352 DEC A ; Decrease A, as one less pixel row to scroll up 38353 JR NZ,38324 ; Loop back to #R38324 for next pixel row 38355 RET ; Return ; Scroll Hand Cursor Down a Unit ; ; Used by the routine at #R37523. c38356 LD A,(23492) ; Load y-coordinate of bottom of window (pixels) into A 38359 LD C,A ; Copy into C 38360 LD DE,26064 ; Point DE at table of Display File addresses of starts of each pixel row 38363 LD H,0 ; Load y-coordinate into HL... 38365 LD L,A ; ... 38366 ADD HL,HL ; Double it 38367 ADD HL,DE ; And add as offset to table of Display File addresses of starts of each pixel row 38368 PUSH HL ; Transfer value into IX... 38369 POP IX ; ... 38371 LD A,(23491) ; Load y-coordinate of top of hand cursor (pixels) into A 38374 SUB C ; Subtract y-coordinate of bottom of window 38375 NEG ; Negate, so A now holds distance between top of hand cursor and bottom of window 38377 EX AF,AF' ; Exchange A register 38378 LD A,(23490) ; Load x-coordinate of left of interior of window (characters) into A 38381 LD C,A ; Copy into BC... 38382 LD B,0 ; ... 38384 EX AF,AF' ; Switch A register (A now holds distance between top of hand cursor and bottom of window) *38385 EX AF,AF' ; Switch A register (now holds x-coordinate of left of interior of window in characters on ; first pass) 38386 DEC IX ; Move IX back by two bytes... 38388 DEC IX ; ... 38390 LD L,(IX+0) ; Load HL with Display File address of start of pixel row 1... 38393 LD H,(IX+1) ; ... 38396 LD E,(IX+2) ; Load DE with Display File address of start of pixel row 2... 38399 LD D,(IX+3) ; ... 38402 ADD HL,BC ; Add x-coordinate of left of interior of window to Display File address 38403 EX DE,HL ; Swap addresses 38404 ADD HL,BC ; Add x-coordinate of left of interior of window to Display File address 38405 EX DE,HL ; Swap addresses back (HL points to upper row and DE points to lower row) 38406 LD A,(HL) ; Read Display File data from upper row... 38407 LD (DE),A ; ...and copy into lower row 38408 INC DE ; Increase DE and HL (as hand cursor is two characters wide)... 38409 INC HL ; ... 38410 LD A,(HL) ; Read Display File data from upper row... 38411 LD (DE),A ; ...and copy into lower row 38412 EX AF,AF' ; Swap A register (A now holds remaining distance between top of hand cursor and bottom of ; window) 38413 DEC A ; Decrease remaining distance in A 38414 JR NZ,38385 ; Loop back to #R38385 for next pixel row 38416 RET ; Return ; Blank an Area of the Display File ; ; We write zeroes to the Display File in order to blank out a region, for example the interior of a window. The ; top-left and bottom-right coordinates of the area to be blanked by this routine are stored at #R23493). c38417 LD BC,(23493) ; Load B with y-coordinate of top edge and C with x-coordinate of left edge 38421 LD HL,(36488) ; Load HL with current virtual text cursor location... 38424 PUSH HL ; ...and store on the stack 38425 CALL 36551 ; Set virtual cursor location (bitmap area) 38428 LD A,(23495) ; Load A with x-coordinate of right-edge 38431 SUB C ; Subtract x-coordinate of left-edge... 38432 INC A ; ...and add one to obtain width 38433 LD D,A ; Store width in D 38434 LD A,(23496) ; Load A with y-coordinate of bottom 38437 SUB B ; Subtract y-coordinate of top-edge... 38438 INC A ; ...and add one to obtain height 38439 LD E,A ; Store height in E 38440 PUSH DE ; Copy width and height... 38441 POP BC ; ...into BC 38442 PUSH HL ; Store (initial) HL on stack 38443 LD A,B ; Copy width into A 38444 EX AF,AF' ; Exchange AF register (preserve width) *38445 PUSH BC ; Store width and height on stack 38446 PUSH HL ; Store (current) HL on stack 38447 XOR A ; Set A to zero 38448 LD B,8 ; Set B to 8 *38450 LD (HL),A ; Write zero to current Display File address 38451 INC H ; Move down one pixel row (by adding 256 bytes to current Display File address) 38452 DJNZ 38450 ; Repeat for other 7 pixel rows 38454 POP HL ; Recover previous (current) value of HL (start of previous character block)... 38455 INC HL ; ...and increase to obtain next block 38456 POP BC ; Restore width and height... 38457 DJNZ 38445 ; ...reduce width by one and loop back to clear next block (until remaining width = 0) 38459 POP HL ; Recover (initial) value of HL 38460 DEC C ; Reduce remaining height by one... 38461 JR Z,38481 ; ...and if it is now zero, then exit loop... 38463 LD A,32 ; ...else... 38465 ADD A,L ; ...add 32 (screen width) to current Display File pointer to move down to next character ; row... 38466 LD L,A ; ... 38467 JP NC,38474 ; If moving down a character row is valid (i.e. if we're not moving down one row from the ; bottom row of one of the three thirds of the bitmap area, which would actually wrap back up ; to the second pixel row of the top character row of the current third!) then skip ahead 38470 LD A,8 ; We need to move down from the bottom character row of one third of the screen to the top ; character row of the third below so... 38472 ADD A,H ; ...increase HL accordingly... 38473 LD H,A ; ... *38474 EX AF,AF' ; Swap AF register 38475 LD B,A ; Recover width (stored earlier, at instr. 38444) into B 38476 EX AF,AF' ; Preserve width again 38477 PUSH HL ; Store current Display File address on stack... 38478 JP 38445 ; ...and loop back to #R38445 to write another row of zeroes *38481 POP HL ; Restore virtual bitmap cursor location... 38482 LD (36488),HL ; ...and store 38485 RET ; Return ; Set New Random Seed ; ; Used by the routines at #R38505 and #R38795. Output: A LSB of new random seed c38486 PUSH HL ; Store HL 38487 PUSH BC ; Store BC 38488 LD BC,(23671) ; Load system variables Seed (hi) and Frames (1) into BC 38492 LD HL,(23670) ; Load system variable Seed into HL 38495 ADD HL,BC ; Add these together 38496 LD A,H ; Add together H and L in A... 38497 ADD A,L ; ... 38498 LD L,A ; ...and load into L 38499 LD (23670),HL ; Place new HL back into system variable Seed 38502 POP BC ; Restore BC 38503 POP HL ; Restore HL 38504 RET ; Return ; Load A With a Random Number Less than or Equal to B ; ; Used by the routine at #R55349. Input: B Cap for random value Output: A Random number less than or equal to B ; (input) c38505 CALL 38486 ; Set new random seed and load LSB of this (random value) into A 38508 CP B ; If random value is greater than B... 38509 JR NC,38505 ; ...then generate another 38511 RET ; Return ; Set Terrain Interaction Data for all Objects in Magic Knight's Current Room ; ; Used by the routine at #R28092. c38512 LD IX,25464 ; Point IX at start of Objects' Current Positions Table at #R25464 38516 LD C,0 ; Set current object to zero 38518 LD B,50 ; Set counter to 50 (as there are 50 objects, including "Nothing at All") *38520 LD A,(65529) ; Load A with Magic Knight's current room 38523 CP (IX+0) ; If object and Magic Knight are in the same room... 38526 CALL Z,38550 ; ...then set Terrain Interaction Data for character blocks spanned by that object 38529 INC C ; Increase C 38530 INC IX ; Advance to next object... 38532 INC IX ; ... 38534 INC IX ; ... 38536 DJNZ 38520 ; ...and repeat 38538 RET ; Return ; Set Terrain Interaction Data for Character Blocks Spanned by an Object and Draw the Object ; ; Used by the routine at #R31370. Input: A Index of current object (call to #R38539 only) B y-coordinate (call to ; #R38539 only) C x-coordinate (call to #R38539 only) IX Points at object's position data (call to #R38550 only) c38539 LD IX,23296 ; Store object's position data temporarily at 23296 - 23298... 38543 LD (IX+1),C ; ...x-coordinate... 38546 LD (IX+2),B ; ...y-coordinate... 38549 LD C,A ; Load index of object of interest into C ; This entry point is used by the routine at #R38512. *38550 PUSH BC ; Store BC 38551 PUSH IX ; Store IX 38553 LD A,C ; Load HL with eight times current object number... 38554 ADD A,A ; ... 38555 ADD A,A ; ... 38556 LD L,A ; ... 38557 LD H,0 ; ... 38559 ADD HL,HL ; ... 38560 LD DE,42249 ; Point DE at last byte (graphic index) of "Nothing at All" properties 38563 ADD HL,DE ; Add eight times current object index as offset 38564 LD A,(HL) ; Load graphic index into A... 38565 PUSH AF ; ...and store 38566 DEC HL ; Move pointer back one byte to point at attribute of object... 38567 LD A,(HL) ; ... 38568 LD (23695),A ; ...and copy into system variable ATTR T 38571 LD C,(IX+1) ; Load C with x-coordinate of current object 38574 LD B,(IX+2) ; Load B with y-coordinate of current object 38577 DEC B ; Decrease y-coordinate by one 38578 XOR A ; Set A to zero 38579 LD (23483),A ; Reset all Terrain Interaction Parameter flags 38582 POP AF ; Restore graphic index to A 38583 PUSH AF ; And store again 38584 PUSH IX ; Store IX (pointer to position data for current object) 38586 CALL 29955 ; Draw the object in OR mode 38589 POP IX ; Restore IX 38591 POP AF ; Restore graphic index to A 38592 ADD A,A ; Load into HL... 38593 LD L,A ; ... 38594 LD H,0 ; ... 38596 ADD HL,HL ; ...and multiply by four 38597 LD DE,42643 ; Point DE at height property of first object in graphics data lookup table... 38600 ADD HL,DE ; ...and add four times graphic index (as entries are 4 bytes wide) as offset to get entry for ; current object 38601 LD A,(HL) ; Load height property of current object into A... 38602 LD (38616),A ; ...and modify later instruction with this data 38605 LD C,(IX+1) ; Load C with x-coordinate of current object 38608 LD B,(IX+2) ; Load B with y-coordinate of current object 38611 DEC B ; Decrease y-coordinate by one 38612 CALL 36586 ; Point HL at Terrain Interaction Data for character coordinates x=C, y=B ; The operand of the instruction at #R38615 represents the height of the object. This is modified by the instruction ; at #R38602. 38615 LD A,0 ; Load A with "height" property of graphic of current object (x=height property of current ; object's graphic) 38617 AND 192 ; Discard all but the two most significant bits 38619 OR (HL) ; Combine with Terrain Interaction Data already present for that block... 38620 LD (HL),A ; ... 38621 INC HL ; Advance HL to next byte in Terrain Interaction Data 38622 LD A,(38616) ; Load A with height property of graphic of current object 38625 RLCA ; Next two bits correspond to next character block's Terrain Interaction Data... 38626 RLCA ; ... 38627 AND 192 ; Discard all but the two most significant bits 38629 OR (HL) ; Combine with Terrain Interaction Data already present for that block... 38630 LD (HL),A ; ... 38631 LD BC,31 ; Advance HL by 31 bytes in Terrain Interaction Data (i.e. down a character row and to the left ; one character)... 38634 ADD HL,BC ; ... 38635 LD A,(38616) ; Load A with height property of graphic of current object 38638 RLCA ; Next two bits correspond to next character block's Terrain Interaction Data... 38639 RLCA ; ... 38640 RLCA ; ... 38641 RLCA ; ... 38642 AND 192 ; Discard all but the two most significant bits 38644 OR (HL) ; Combine with Terrain Interaction Data already present for that block... 38645 LD (HL),A ; ... 38646 INC HL ; Advance HL to next byte in Terrain Interaction Data 38647 LD A,(38616) ; Load A with height property of graphic of current object 38650 RRCA ; Next two bits correspond to next character block's Terrain Interaction Data... 38651 RRCA ; ... 38652 AND 192 ; Discard all but the two most significant bits 38654 OR (HL) ; Combine with Terrain Interaction Data already present for that block... 38655 LD (HL),A ; ... 38656 POP IX ; Restore IX 38658 POP BC ; Restore BC 38659 RET ; Return ; Get x- and y- Coordinates of Object A (Unused) Input: A Index of required object Output: B y-coordinate C ; x-coordinate c38660 LD C,A ; Multiply A by three... 38661 ADD A,A ; ...as entries in table at #R25464 are three bytes long... 38662 ADD A,C ; ... 38663 LD L,A ; Load value into HL... 38664 LD H,0 ; ... 38666 LD BC,25465 ; Point BC at x-coordinate property of "Nothing at All" in table at #R25464 38669 ADD HL,BC ; Add HL as offset to BC (into HL) 38670 LD C,(HL) ; Load x-coordinate into C 38671 INC HL ; Advance by one byte 38672 LD B,(HL) ; Load y-coordinate into B 38673 RET ; Return ; Remove Object C from a Character's Inventory and Tidy Up Remaining Entries ; ; Used by the routines at #R30439, #R30540, #R30602, #R30880, #R32390, #R33883, #R33935 and #R34062. Input: B ; Number of inventory slots to check C Index of object to be removed HL Pointer to a character's current inventory c38674 LD A,(HL) ; Load A with inventory object 38675 CP C ; If this matches index in C... 38676 JR Z,38682 ; ...then skip ahead to #R38682 38678 INC HL ; Advance to next inventory slot... 38679 DJNZ 38674 ; ...and repeat loop for next slot 38681 RET ; Return if object not found *38682 INC HL ; Advance to next inventory slot 38683 LD A,(HL) ; Load object at this slot into A 38684 DEC HL ; Move back to previous slot again 38685 LD (HL),A ; Place object from next slot into current one 38686 INC HL ; Advance to next slot again 38687 DJNZ 38682 ; Repeat for all remaining slots 38689 DEC HL ; Move back to previous slot (i.e. final slot for this character)... 38690 XOR A ; ...and set to empty... 38691 LD (HL),A ; ... 38692 RET ; Return ; Print Command Summary in Command Summary Window at Bottom of Screen ; ; Used by the routines at #R30222, #R30602, #R30880, #R31370, #R31636, #R32035, #R32194, #R32390, #R32655, #R33036, ; #R33312, #R33593, #R33663, #R34864, #R34883, #R34914 and #R35141. Input: DE Points to command text c38693 PUSH DE ; Store DE 38694 LD A,78 ; Set system variable ATTR T to 78 (yellow INK, blue PAPER, BRIGHT) 38696 LD (23695),A ; ... 38699 LD HL,(36488) ; Load HL with (video) memory location to start printing character 38702 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 38703 LD DE,(65530) ; Load DE with new Display File address to print character... 38707 LD (36488),DE ; ...and update printing routine with this location 38711 CALL 36725 ; Print text at location HL to screen 38714 LD HL,(36488) ; Load Display File address just printed to into HL 38717 LD (65530),HL ; Store at 65530 (where it was just read from!) 38720 POP HL ; Restore original memory location that was replaced in printing routine... 38721 LD (36488),HL ; ...and put it back into the printing routine 38724 RET ; Return ; Display Execute / Reject Command Window and Return if Execute Chosen, Else Exit ; ; Used by the routines at #R30222, #R30439, #R30602, #R30880, #R31370, #R31636, #R32035, #R32194, #R32258, #R32390, ; #R32655, #R33036, #R33312, #R33574, #R33593 and #R33663. c38725 CALL 38124 ; Play hiss-type sound 38728 LD A,11 ; Set window index to draw as 11... 38730 CALL 36979 ; ...and draw 38733 LD HL,43196 ; Point to "E] EXECUTE COMMAND..." text 38736 CALL 36725 ; Print the text 38739 CALL 37333 ; Process keyboard / joystick input for menu, and load ASCII code of shortcut for selected ; (i.e. SPACE or fire pressed) item into A... 38742 CP 69 ; ...and if this is "E" (i.e. Execute Command)... 38744 RET Z ; ...return... 38745 POP HL ; ...else restore HL and... 38746 JP 30428 ; ...reset Gimbal-White-Out Safe Flag, redraw current room and return to main game loop ; Display "PRESS SPACE OR FIRE TO CONTINUE" Window and Wait for Space / Fire ; ; Used by the routines at #R29800, #R29880, #R30222, #R30540, #R30602, #R31370, #R32035, #R32876, #R34350, #R34768, ; #R35101 and #R35141. c38749 CALL 38124 ; Play hiss-type sound 38752 LD A,14 ; Draw window 14... 38754 CALL 36987 ; ... 38757 LD HL,43166 ; Point HL at "PRESS SPACE OR FIRE" text string 38760 CALL 36725 ; Print the text *38763 XOR A ; Clear key-press buffer... 38764 LD (23560),A ; ... 38767 CALL 37876 ; Capture keyboard / joystick input into A 38770 BIT 4,A ; If "FIRE" button / key pressed... 38772 JR NZ,38788 ; ...jump to #R38788 38774 LD A,(23560) ; Capture last key pressed 38777 CP 32 ; If not a space then... 38779 JR NZ,38763 ; Go back to start of loop 38781 CALL 37472 ; Wait for keyboard to be released 38784 CALL 38075 ; Play upward scale sound 38787 RET ; Return *38788 CALL 37486 ; Wait for fire button / key to be released 38791 CALL 38075 ; Play upward scale sound 38794 RET ; Return ; Reset Star to Point of Origin and Generate a New Direction and Movement Data ; ; Used by the routines at #R38884 and #R38961. Input: IX Points to an entry in table of stars' movement data at ; #R25614 c38795 CALL 38486 ; Set new random seed and load LSB of this into A 38798 AND 31 ; Discard bits five to seven 38800 SUB 15 ; Subtract 15 38802 LD B,A ; Load result into B (random number -15 to 16) (y-component of star's direction) 38803 CALL 38486 ; Set new random seed and load LSB of this into A 38806 AND 31 ; Discard bits five to seven 38808 SUB 15 ; Subtract 15 38810 LD C,A ; Load result into C (random number -15 to 16) (x-component of star's direction) 38811 LD A,128 ; Add to 128 (set bit 7) in C... 38813 ADD A,C ; ... 38814 LD C,A ; ...(random number 113 to 144) 38815 LD A,B ; Add 87 to B... 38816 ADD A,87 ; ... 38818 LD B,A ; ...(random number 72 to 103) 38819 CP 87 ; If A is not 87 (i.e. y-direction component is not zero)... 38821 JR NZ,38828 ; ...skip ahead to #R38828 38823 LD C,A ; If A (loaded into C) is 128... [bug: this instruction only executed if A is 87, so how could ; it ever be 128 here? This should actually be LD A,C, preventing stars having zero for both ; direction components] 38824 CP 128 ; ... 38826 JR Z,38795 ; ...then restart this routine to generate two new random numbers/seeds *38828 LD D,87 ; Load D (initial y-coordinate) with 87 38830 LD E,128 ; Load E (initial x-coordinate) with 128 38832 PUSH DE ; Store DE 38833 CALL 39016 ; Set up star's movement data based upon starting position and direction 38836 POP DE ; Restore DE 38837 LD (IX+0),E ; Set star's initial coordinates as (128, 87)... 38840 LD (IX+1),D ; ... 38843 RET ; Return ; Unused routine ; ; This routine plots the path of a star with point of origin (100,100) and direction (10,10). c38844 LD BC,2570 ; Load B with 10 (y-component of star's direction) and C with 10 (x-component of direction) 38847 LD DE,25700 ; Load D with 100 and E with 100 (initial coordinates of star) 38850 LD IX,25614 ; Point IX at start of table of stars' movement data 38854 PUSH DE ; Store DE 38855 CALL 39016 ; Set up star's movement data based upon starting position and direction 38858 POP DE ; Restore DE 38859 LD (IX+0),E ; Set initial x-coordinate of star 38862 LD (IX+1),D ; Set initial y-coordinate of star 38865 LD B,50 ; Load B with 50 (as loop runs 50 times) *38867 PUSH BC ; Store BC 38868 CALL 39081 ; Load BC with new (y,x) coordinates of a star depending upon the signs and magnitudes of its ; direction 38871 LD (IX+0),C ; Load C (x-coordinate to PLOT) into star's x-coordinate 38874 LD (IX+1),B ; Load B (y-coordinate to PLOT) into star's y-coordinate 38877 CALL 8933 ; PLOT the pixel (x=C, y=B) 38880 POP BC ; Restore BC (B = remaining number of iterations) 38881 DJNZ 38867 ; Decrease B by one and loop back to 38867 38883 RET ; Return ; Animate Starfield Until a Key is Pressed ; ; Used by the routines at 27118 and #R33180. c38884 XOR A ; Clear last pressed key... 38885 LD (23560),A ; ... 38888 SET 0,(IY+87) ; Set P-FLAG bit 0 (OVER 1) 38892 SET 1,(IY+87) ; Set P-FLAG bit 1 (OVER 1) 38896 CALL 38961 ; Reset all stars to point of origin and generate new velocities and movement data *38899 LD A,(23560) ; If last pressed key (system variable LAST-K) is not set to zero (i.e. a key has been ; pressed)... 38902 OR A ; ... 38903 RET NZ ; ...then return... 38904 LD IX,25614 ; ...else point IX at start of table of stars' movement data 38908 LD B,50 ; Load B with 50, as we are dealing with 50 "stars" *38910 PUSH BC ; Store BC (B = remaining number of stars to process) 38911 LD B,(IX+1) ; Load old y-coordinate from star's movement data into B 38914 LD C,(IX+0) ; Load old x-coordinate from star's movement data into C 38917 CALL 8933 ; Un-PLOT the pixel (x=C, y=B - star's old position) (as "OVER" flag is set, so PLOTting an ; already PLOTted point removes it) 38920 CALL 39081 ; Load BC with new (y,x) coordinates of a star depending upon the signs and magnitudes of its ; direction 38923 LD A,B ; Load new y-coordinate into A 38924 CP 48 ; If new y-coordinate is less than 48... (How far down the star goes) 38926 JR C,38932 ; ...then skip ahead to #R38932 38928 CP 175 ; If new y-coordinate is less than 175... (How far up the star goes) 38930 JR C,38937 ; ...then skip ahead to #R38937 *38932 CALL 38795 ; Reset star to point of origin and generate a new direction and movement data 38935 JR 38950 ; Skip ahead to #R38950 *38937 LD A,C ; Load x-coordinate into A 38938 AND A ; If x-coordinate is zero... 38939 JR Z,38932 ; ...then jump to #R38932 38941 LD (IX+0),C ; Store new x- and y-coordinates in star's movement data table entry... 38944 LD (IX+1),B ; ... 38947 CALL 8933 ; PLOT the star's new position (x=C, y=B) *38950 POP BC ; Restore BC (B = remaining number of stars to process) 38951 LD DE,9 ; Advance IX by nine bytes to next entry in table of star movement data... 38954 ADD IX,DE ; ... 38956 DJNZ 38910 ; Loop back to #R38910 for next star 38958 JP 38899 ; Jump back to #R38899 to repeat routine again ; Reset All Stars to Point of Origin and Generate New Velocities and Movement Data ; ; Used by the routine at #R38884. c38961 LD IX,25614 ; Point IX at start of table of stars' movement data 38965 LD B,50 ; Load B with 50 (as there are 50 stars to process) *38967 PUSH BC ; Store BC (B = remaining number of stars to process) 38968 CALL 38795 ; Reset star to point of origin and generate a new direction and movement data 38971 LD DE,9 ; Load DE with 9 38974 ADD IX,DE ; Advance IX by 9 bytes 38976 POP BC ; Restore BC 38977 DJNZ 38967 ; Decrease B and repeat loop 38979 RET ; Return ; Unused routine ; ; This routine draws a line from (C, B) to (E, D). c38980 LD (23677),DE ; Load contents of DE into system variable COORDS (start point of line) 38984 LD A,B ; Subtract y-coordinate of start of line from y-coordinate of end of line... 38985 SUB D ; ...to get delta-y 38986 LD D,1 ; Set direction of vertical change to +1 (upward) 38988 JR NC,38994 ; If delta-y is positive (i.e. upward) then skip ahead to #R38994 38990 CPL ; Multiply delta-y by -1 (downward) to get absolute magnitude... 38991 INC A ; ... 38992 LD D,255 ; Set direction of vertical change to -1 (downward) *38994 LD B,A ; Load B with magnitude of difference in y-coordinate between start and end of line 38995 LD A,C ; Subtract x-coordinate of start of line from y-coordinate of end of line... 38996 SUB E ; ...to get delta-x 38997 LD E,1 ; Set direction of horizontal change to +1 (rightward) 38999 JR NC,39005 ; If delta-x is positive (i.e. rightward) then skip ahead to #R39005 39001 CPL ; Multiply delta-x by -1 (leftward) to get absolute magnitude... 39002 INC A ; ... 39003 LD E,255 ; Set direction of vertical change to -1 (leftward) *39005 LD C,A ; Load C with magnitude of difference in x-coordinate between start and end of line 39006 EXX ; Switch registers 39007 PUSH HL ; Store HL 39008 EXX ; Switch registers 39009 CALL 9402 ; Draw a line (ROM routine) 39012 EXX ; Switch registers 39013 POP HL ; Restore HL 39014 EXX ; Switch registers 39015 RET ; Return ; Set Up Star Movement Data Based Upon Starting Position and Direction ; ; Used by the routines at #R38795 and #R38844. Input: B y component of star direction added to initial ; y-coordinate (random number 72 to 103) C x component of star direction added to initial x-coordinate (random ; number 113 to 144) D Initial y-coordinate of star (87) (pixels) E Initial x-coordinate of star (128) (pixels) IX ; Points to an entry in table of stars' movement data at #R25614 c39016 LD A,B ; Load (DIR-Y + INIT-Y) into A 39017 SUB D ; Subtract initial y-coordinate to leave y-component of direction in A 39018 LD D,1 ; Set D to 1 (because star is moving up) 39020 JR NC,39026 ; If y-component is positive (i.e. star is moving up) then skip ahead to #R39026 39022 CPL ; Negate negative y-direction component... 39023 INC A ; ... 39024 LD D,255 ; Set D to -1 (because star is moving down) *39026 LD B,A ; Load magnitude of y-component into B 39027 LD A,C ; Load (DIR-X + INIT-X) into A 39028 SUB E ; Subtract initial x-coordinate to leave x-component of direction in A 39029 LD E,1 ; Set D to 1 (because star is moving 1 pixel right) 39031 JR NC,39037 ; If x-component is positive (i.e. star is moving right) then skip ahead to #R39037 39033 CPL ; Negate negative x-direction component... 39034 INC A ; ... 39035 LD E,255 ; Set E to -1 (because star is moving 1 pixel left) *39037 LD C,A ; Load magnitude of x-component into C 39038 LD (IX+3),D ; Store y-direction at byte 4 39041 LD (IX+2),E ; Store x-direction at byte 3 39044 LD (IX+5),D ; Store y-direction at byte 6 39047 LD (IX+4),E ; Store x-direction at byte 5 39050 LD A,C ; Load magnitude of x-component into A 39051 CP B ; If magnitude of y-component is less than or equal to magnitude of x-component... 39052 JR NC,39063 ; ...then skip ahead to #R39063 39054 LD (IX+8),C ; Store magnitude of x-component at byte 9 39057 LD (IX+2),0 ; Set byte 3 to zero 39061 JR 39073 ; Skip ahead to #R39073 *39063 OR C ; If magnitude of x-component is zero... 39064 RET Z ; ...then return 39065 LD (IX+8),B ; Store magnitude of y-component at byte 9 39068 LD B,C ; Load magnitude of x-component into B 39069 LD (IX+3),0 ; Store zero at byte 4 *39073 LD (IX+7),B ; Store magnitude of x-/y-component at byte 8 39076 LD A,B ; Load magnitude of x-/y-component into A... 39077 LD (IX+6),A ; ...and store at byte 7 39080 RET ; Return ; Move a Star Depending Upon the Signs and Magnitudes of its "Direction" ; ; Each time this routine runs, we add the smaller of the x- and y-magnitudes to the running "ratio" value in (IX+6). ; Input: IX Points to entry in Star Data table at #R25614 Output: B New y-coordinate to plot C New x-coordinate ; to plot c39081 LD A,(IX+6) ; Load current "ratio" value into A 39084 ADD A,(IX+8) ; Add smaller of x- and y-component magnitudes 39087 JR C,39094 ; If result is crosses the 255-0 boundary then skip ahead to #R39094 39089 CP (IX+7) ; If result is less than larger of x- and y-component magnitudes... 39092 JR C,39105 ; ...then skip ahead to #R39105 (move star only on axis with larger magnitude) *39094 SUB (IX+7) ; Subtract larger of x- and y-magnitudes 39097 LD H,(IX+5) ; Load y-step into H... 39100 LD L,(IX+4) ; ...and x-step into H (moving star on BOTH axes) 39103 JR 39111 ; Skip ahead to #R39111 *39105 LD H,(IX+3) ; Load 0 / y-step into H 39108 LD L,(IX+2) ; Load 0 / x-step into H *39111 LD (IX+6),A ; Update "ratio" value 39114 LD A,(IX+1) ; Add previous y-coordinate... 39117 ADD A,H ; ...to y-step... 39118 LD B,A ; ...in B 39119 LD A,(IX+0) ; Add previous x-coordinate... 39122 ADD A,L ; ...to x-step... 39123 LD C,A ; ...in C 39124 RET ; Return ; Draw Odd Ball to Screen ; ; Used by the routine at #R35993. Input: A Frame Number (32, 116, 117, 118 or 119) c39125 PUSH HL ; Store HL 39126 LD DE,64500 ; Point DE at 64500 39129 ADD A,A ; Double A... 39130 LD H,0 ; ...Load into HL... 39132 LD L,A ; ... 39133 ADD HL,HL ; ...Double again... 39134 ADD HL,HL ; ...and again to get 8 times original A value... 39135 ADD HL,DE ; ...and add DE to this to point to one of the five sets of Odd Ball frame graphic data ; (#R64756, #R65428, #R65436, #R65444 or #R65452) 39136 EX DE,HL ; Swap so DE now points to an Odd Ball graphic and HL holds 64500 39137 PUSH DE ; Copy DE into IX... 39138 POP IX ; ... 39140 LD BC,(23677) ; Load system variable COORDS into BC (holds x- and y-coordinates of Odd Ball) 39144 CALL 8874 ; Call ROM routine (Get Pixel Address) - Loads HL with Display File address corresponding to ; pixel at coordinates BC, and A with the location of that pixel within the byte 39147 LD C,A ; Load pixel-within-byte "address" into C 39148 LD B,8 ; Load 8 into B (as Odd Ball graphic data comprises 8 pixel rows) *39150 LD D,(IX+0) ; Load a byte of Odd Ball graphic data into D 39153 CALL 39175 ; Shift Odd Ball graphic data right by C pixels and load into D (LHS) and A' (RHS) 39156 LD A,D ; Load left part of Odd Ball graphic data into A 39157 LD E,(HL) ; Load E with graphic data currently at Odd Ball's position on screen 39158 XOR E ; Blend Odd Ball graphic data with what is already on screen at its position to make things ; look more natural... 39159 LD (HL),A ; ...and write new graphic data back to screen 39160 INC HL ; Advance right one byte in Display File 39161 EX AF,AF' ; Switch registers to restore right part of Odd Ball graphic data to A 39162 LD E,(HL) ; Load E with graphic data currently at Odd Ball's position on screen 39163 XOR E ; Blend Odd Ball graphic data with what is already on screen at its position to make things ; look more natural... 39164 LD (HL),A ; ...and write new graphic data back to screen 39165 DEC HL ; Move left one byte in Display File 39166 INC IX ; Advance IX to next row of Odd Ball graphic data 39168 CALL 39200 ; Advance HL down one pixel row in Display File 39171 DJNZ 39150 ; Loop back to draw next row of Odd Ball data 39173 POP HL ; Restore HL 39174 RET ; Return ; Shift Odd Ball Graphic Data Right by C Pixels and Load into D (L.H.S.) and A' (R.H.S.) ; ; Used by the routine at #R39125. Input: C Pixel-within-byte "address" D A byte of graphic data for an Odd Ball ; Output: D (Right-shifted) partial byte of graphic data for an Odd Ball A' Remainder of the graphic data for an ; Odd Ball (i.e. displaying D and A' side-by-side would show a complete row of Odd Ball graphic data, shifted right ; by C (input) pixels) E Set bits represent number of pixels to the right that the Odd Ball graphic has been ; shifted c39175 LD A,C ; Load pixel-within-byte "address" into A 39176 OR A ; Check if we're dealing with pixel zero... 39177 JR Z,39195 ; ...and if so, skip ahead to #R39195 39179 XOR A ; Set A to zero 39180 LD E,A ; Copy into E 39181 PUSH BC ; Store BC (B=graphic row counter, C=pixel-within-byte "address") 39182 LD B,C ; Copy pixel-within-byte "address" into B *39183 SRL D ; Shift graphic data right one bit (rightmost bit goes into carry flag) 39185 RRA ; Rotate carry flag into leftmost bit of A, shifting other bits right 39186 SCF ; Set carry flag 39187 RR E ; Rotate (set) carry flag into leftmost bit of E, shifting other bits right, and resetting ; carry flag 39189 DJNZ 39183 ; Repeat loop to shift graphic right another pixel if necessary 39191 EX AF,AF' ; Switch AF registers 39192 LD A,E ; Load A with value in E (set bits represent number of pixels by which Odd Ball graphic has ; been shifted right) 39193 POP BC ; Restore (B=graphic row counter, C=pixel-within-byte "address") 39194 RET ; Return *39195 XOR A ; Set A to zero 39196 EX AF,AF' ; Switch registers 39197 XOR A ; Set A to zero 39198 LD E,A ; Set E to zero as Odd Ball graphic hasn't been shifted 39199 RET ; Return ; Advance HL Down One Pixel Row in Display File ; ; Used by the routine at #R39125. Input: HL Points to a byte in Display File Output: HL Points to the byte in ; Display File below HL (input) c39200 INC H ; Increase H by 1 (i.e. advance HL by 256) 39201 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)... 39202 AND 7 ; ... 39204 RET NZ ; ...then return (as HL now points to next pixel row down)... 39205 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)... 39206 SUB 8 ; ... 39208 LD H,A ; ... 39209 LD A,L ; Advance L by 32 bytes to move down one character row, so now the top of the next character ; row down... 39210 ADD A,32 ; ... 39212 LD L,A ; ... 39213 RET NC ; 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 return... 39214 LD A,H ; ...else move down by a third... 39215 ADD A,8 ; ... 39217 LD H,A ; ... 39218 XOR 88 ; If we have not reached the start of the Attribute File, then return... 39220 RET NZ ; ... 39221 LD H,64 ; ...else wrap back round to the start of Display File again 39223 RET ; Return ; Draw Magic Knight (Erase Old Frame and Draw New Frame) ; ; Magic Knight is erased from his old position and redrawn at his new position. If Magic Knight has y-velocity (i.e. ; he is moving up or down with or without horizontal motion) then this is done in three stages, each depending on ; the magnitude of his y-velocity. If he is not moving up or down, then the three stages are still followed, but ; with zero y-velocity, stages 1 and 3 do nothing. The three stages are (with Y = magnitude of Magic Knight's ; y-velocity): Input: A Always zero c39224 PUSH IX ; Store IX 39226 ADD A,A ; Multiply A by eight... 39227 ADD A,A ; ... 39228 ADD A,A ; ... 39229 LD B,0 ; ...and load into BC... 39231 LD C,A ; ... 39232 LD HL,25387 ; Point HL at Magic Knight's current data (x- and y-coordinates, etc.) 39235 ADD HL,BC ; Add eight times original A value as offset to this 39236 PUSH HL ; Store HL 39237 LD A,(HL) ; Load Magic Knight's x-coordinate into A... 39238 LD (23329),A ; ...and copy to 23329... 39241 LD C,A ; ...and C 39242 INC HL ; Advance HL to Magic Knight's y-coordinate 39243 LD A,(HL) ; Load Magic Knight's y-coordinate into A... 39244 LD (23330),A ; ...and copy to 23330... 39247 LD B,A ; ...and B 39248 INC HL ; Advance HL to Magic Knight's current frame to erase... 39249 LD A,(HL) ; ... 39250 LD (23328),A ; ...and copy to 23328 39253 INC HL ; Advance HL by two bytes to Magic Knight's current x-velocity... 39254 INC HL ; ... 39255 LD E,(HL) ; Load Magic Knight's current x-velocity into E 39256 INC HL ; Advance HL to Magic Knight's current y-velocity... 39257 LD D,(HL) ; ...and load into D 39258 INC HL ; Advance HL to Magic Knight's attribute... 39259 LD A,(HL) ; ...and load into A 39260 LD (23337),A ; Copy Magic Knight's attribute into 23337 39263 INC HL ; Advance HL to Magic Knight's "Update Attributes at Magic Knight's Predicted Position" flag ; (Reset is 255, any other value is set)... 39264 LD A,(HL) ; ...load into A... 39265 LD (23338),A ; ...and copy into 23338 39268 LD A,C ; Load Magic Knight's x-coordinate into A 39269 ADD A,E ; Add Magic Knight's x-velocity to give predicted x-coordinate 39270 LD (23331),A ; Store at 23331 39273 LD A,B ; Load Magic Knight's y-coordinate into A 39274 ADD A,D ; Add Magic Knight's y-velocity to give predicted y-coordinate 39275 LD (23332),A ; Store at 23332 39278 LD A,(23338) ; Load Magic Knight's Update Attributes Mask flag (stored earlier) into A 39281 CP 255 ; If this is not 255 (i.e. no components to override)... 39283 CALL NZ,39989 ; ...then update attributes at Magic Knight's predicted position 39286 XOR A ; Set bytes 23316 - 23318 to zero... 39287 LD (23317),A ; ... 39290 LD (23316),A ; ... 39293 LD (23318),A ; ... 39296 LD A,C ; Set three least significant bits of Magic Knight's x-coordinate to zero (i.e. set ; pixel-within-character to zero)... 39297 AND 248 ; ... 39299 LD C,A ; ... 39300 LD A,(23331) ; Load predicted x-coordinate (pixels) into A 39303 AND 248 ; Set three least significant bits of Magic Knight's predicted x-coordinate to zero (i.e. set ; pixel-within-character to zero) 39305 SUB C ; Test: 39306 JP Z,39331 ; If x-coordinate and predicted x-coordinate are now the same (i.e. Magic Knight is not ; changing his position in characters) then skip ahead to #R39331 39309 JP P,39323 ; If x-coordinate is smaller than predicted x-coordinate (i.e. Magic Knight is moving right) ; then skip ahead to #R39323 ; [Magic Knight is moving left] 39312 LD A,1 ; Set... 39314 LD (23316),A ; ..."Magic Knight is leaving his current character position and going left" flag and... 39317 LD (23318),A ; ..."Magic Knight is leaving his current character position" flag 39320 JP 39331 ; Skip ahead to #R39331 (over Magic Knight is moving right section) ; [Magic Knight is moving right] *39323 LD A,1 ; Set... 39325 LD (23317),A ; ..."Magic Knight is leaving his current character position and going right" flag and... 39328 LD (23318),A ; ..."Magic Knight is leaving his current character position" flag *39331 LD A,(23332) ; Load predicted y-coordinate (pixels) into 23324... 39334 LD (23324),A ; ... 39337 LD A,(23330) ; Load current y-coordinate (pixels) into 23325... 39340 LD (23325),A ; ... 39343 LD A,(23331) ; Load predicted x-coordinate (pixels) into 23322... 39346 LD (23322),A ; ... 39349 LD A,(23329) ; Load current x-coordinate (pixels) into 23323... 39352 LD (23323),A ; ... 39355 LD A,(25390) ; Load Magic Knight's current frame into 23326... 39358 LD (23326),A ; ... 39361 LD A,(23328) ; Load Magic Knight's current frame to erase into 23327... 39364 LD (23327),A ; ... 39367 LD A,(23317) ; Load "Magic Knight is leaving his current character position and going right" flag into ; 23314... 39370 LD (23314),A ; ... 39373 LD A,(23316) ; Load "Magic Knight is leaving his current character position and going left" flag into ; 23315... 39376 LD (23315),A ; ... 39379 LD A,D ; Load Magic Knight's current y-velocity into A 39380 OR A ; If y-velocity is positive (Magic Knight moving downwards)... 39381 JP P,39432 ; ...then jump ahead to #R39432 39384 LD A,(23330) ; Load current y-coordinate (pixels) into #R23324... 39387 LD (23324),A ; ... 39390 LD A,(23332) ; Load predicted y-coordinate (pixels) into #R23325... 39393 LD (23325),A ; ... 39396 LD A,(23329) ; Load current x-coordinate (pixels) into #R23322... 39399 LD (23322),A ; ... 39402 LD A,(23331) ; Load predicted x-coordinate (pixels) into #R23323... 39405 LD (23323),A ; ... 39408 LD A,(23328) ; Load Magic Knight's current frame to erase into #R23326... 39411 LD (23326),A ; ... 39414 LD A,(25390) ; Load Magic Knight's current frame number into #R23327... 39417 LD (23327),A ; ... 39420 LD A,(23316) ; Load "Magic Knight is leaving his current character position and going left" flag into ; #R23314... 39423 LD (23314),A ; ... 39426 LD A,(23317) ; Load "Magic Knight is leaving his current character position and going right" flag into ; #R23315... 39429 LD (23315),A ; ... *39432 LD A,D ; Load Magic Knight's current y-velocity into A 39433 BIT 7,A ; If y-velocity is positive (moving downwards)... 39435 JP Z,39440 ; ...then skip ahead to #R39440 39438 NEG ; Negate negative velocity *39440 LD (23319),A ; Load magnitude of y-velocity into 23319 39443 LD A,(23325) ; Load current / predicted y-coordinate into A 39446 ADD A,31 ; Add 31 (as Magic Knight is 32 pixels high) to get current / predicted y-coordinate of bottom ; of Magic Knight's feet... 39448 LD (23325),A ; ...and store back at 23325 39451 LD A,(23324) ; Load current / predicted y-coordinate into A 39454 ADD A,31 ; Add 31 (as Magic Knight is 32 pixels high) to get current / predicted y-coordinate of bottom ; of Magic Knight's feet... 39456 LD (23324),A ; ...and store back at 23324 39459 LD H,0 ; Also load into HL... 39461 LD L,A ; ... 39462 ADD HL,HL ; Double value (to use as offset in WORD lookup table) 39463 LD DE,26064 ; Point DE at table of Display File addresses of starts of each pixel row 39466 ADD HL,DE ; Add double y-coordinate as offset to start of table of Display File addresses in HL 39467 LD (23320),HL ; Store at 23320 39470 LD E,(HL) ; Load memory address of start of this pixel row into DE... 39471 INC HL ; ... 39472 LD D,(HL) ; ... 39473 LD C,0 ; Load C with zero 39475 LD A,(23322) ; Load Magic Knight's predicted (Magic Knight moving down / horizontally) or current (Magic ; Knight moving up) x-coordinate (pixels) into A 39478 SRL A ; Rotate three least significant bits (pixel-within-character) of x-coordinate out of A... 39480 RR C ; ...and into three most significant bits of C... 39482 SRL A ; ... 39484 RR C ; ... 39486 SRL A ; ... 39488 RR C ; ... 39490 LD H,0 ; Load HL with remaining value in A (x-coordinate in characters)... 39492 LD L,A ; ... 39493 LD (23301),HL ; Store at 23301 39496 LD A,(23318) ; If "Magic Knight is leaving his current character position" flag is reset... 39499 OR A ; ... 39500 JP Z,39513 ; ...then skip ahead to #R39513 39503 LD A,(23314) ; If "Magic Knight changing character position to right" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to left" flag (Magic Knight moving ; up) is set... 39506 OR A ; ... 39507 JP NZ,39513 ; ...then skip ahead to #R39513 39510 LD (23312),HL ; Load predicted (Magic Knight moving down / horizontally) or current (Magic Knight moving up) ; x-coordinate (pixels) into 23312 *39513 ADD HL,DE ; Add x-coordinate (HL) as offset to Display File address of start of row (DE) in HL 39514 LD (23296),HL ; Store Display File address at 23296 39517 LD A,C ; Load A with pixel-within-character coordinate (in 3 MS bits of C) 39518 RLCA ; Rotate left to get into least significant 3 bits of A... 39519 RLCA ; ... 39520 RLCA ; ... 39521 LD (23300),A ; Store at 23300 39524 LD H,0 ; Load Magic Knight's current frame to draw (Magic Knight moving down / horizontally) or ; current frame to erase (Magic Knight moving up) into HL... 39526 LD A,(23326) ; ... 39529 LD L,A ; ... 39530 ADD A,A ; Multiply A by four... 39531 ADD A,A ; ... 39532 LD L,A ; Load into HL again (so now HL contains 4x original value) 39533 ADD HL,HL ; Multiply by 16... 39534 ADD HL,HL ; ... 39535 ADD HL,HL ; ... 39536 ADD HL,HL ; ...so now HL contains 4 x 16 (i.e. 64) times original value (as Magic Knight frame graphics ; are 64 bytes long) 39537 LD DE,63475 ; Point DE at last byte of "Magic Knight Frame 0" graphic data (this is blank as index of first ; frame is actually 1, with Magic Knight facing right) 39540 ADD HL,DE ; Add HL as offset (to point to last byte of required frame) 39541 LD (23298),HL ; Store at 23298 39544 LD C,0 ; Load C with zero 39546 LD A,(23323) ; Load Magic Knight's current (Magic Knight moving down / horizontally) or predicted (Magic ; Knight moving up) x-coordinate (pixels) into A 39549 SRL A ; Rotate three least significant bits of predicted x-coordinate (pixel-within-character) out of ; A... 39551 RR C ; ...and into most significant three bits of C... 39553 SRL A ; ... 39555 RR C ; ... 39557 SRL A ; ... 39559 RR C ; ... 39561 LD H,0 ; Load HL with remaining value in A (x-coordinate in characters)... 39563 LD L,A ; ... 39564 LD (23308),HL ; Store this at 23308 39567 LD A,(23318) ; If "Magic Knight is leaving his current character position" flag is reset... 39570 OR A ; ... 39571 JP Z,39584 ; ...then skip ahead to #R39584 39574 LD A,(23315) ; If "Magic Knight changing character position to left" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to right" flag (Magic Knight ; moving up) is set... 39577 OR A ; ... 39578 JP NZ,39584 ; ...then skip ahead to #R39584 39581 LD (23312),HL ; Load predicted (Magic Knight moving down / horizontally) or current (Magic Knight moving up) ; x-coordinate (characters) into 23312 *39584 LD A,C ; Load A with pixel-within-character coordinate (in three most significant bits) 39585 RLCA ; Rotate data from most significant to least significant three bits... 39586 RLCA ; ... 39587 RLCA ; ... 39588 LD (23307),A ; Store at 23307 39591 LD H,0 ; Load Magic Knight's current frame to erase (Magic Knight moving down / horizontally) or ; current frame to draw (Magic Knight moving up) into HL... 39593 LD A,(23327) ; ... 39596 LD L,A ; ... 39597 ADD A,A ; Multiply A by four... 39598 ADD A,A ; ... 39599 LD L,A ; Load into HL again (so now HL contains 4x original value) 39600 ADD HL,HL ; Multiply by 16... 39601 ADD HL,HL ; ... 39602 ADD HL,HL ; ... 39603 ADD HL,HL ; ...so now HL contains 4 x 16 (i.e. 64) times original value (as Magic Knight frame graphics ; are 64 bytes long) 39604 LD DE,63475 ; Point DE at last byte of "Magic Knight Frame 0" graphic data (this is blank as index of first ; frame is actually 1, with Magic Knight facing right) 39607 ADD HL,DE ; Add HL as offset (to point to last byte of required frame) 39608 LD (23305),HL ; Store at 23305 39611 LD A,(23318) ; If "Magic Knight is leaving his current character position" flag is set... 39614 OR A ; ... 39615 JP NZ,39624 ; ...then skip ahead to #R39624 39618 LD HL,(23301) ; Load Magic Knight's predicted (Magic Knight moving down / horizontally) or current (Magic ; Knight moving up) x-coordinate (characters) into HL... 39621 LD (23312),HL ; ...and store at 23312 *39624 LD A,(23319) ; If magnitude of y-velocity is zero... 39627 OR A ; ... 39628 JR Z,39696 ; ...then skip ahead to #R39696 39630 LD HL,(23298) ; Load HL with pointer to last byte of Magic Knight graphic frame (Magic Knight's current frame ; to draw [Magic Knight moving down / horizontally] or current frame to erase [Magic Knight ; moving up]) 39633 LD B,A ; Load magnitude of y-velocity into B ; [This section draws / erases only bottom Y pixel rows, where Y is magnitude of Magic Knight's y-velocity. e.g. ; draw / erase 7 pixel rows if Magic Knight's y-velocity magnitude = 7] *39634 PUSH BC ; Store BC (B = magnitude of y-velocity) 39635 LD D,(HL) ; Load byte of graphic data (right-hand column) into D 39636 DEC HL ; Move back to previous byte of graphic data 39637 LD B,(HL) ; Load byte of graphic data (left-hand column) into B 39638 DEC HL ; Move back to previous byte of graphic data (right-hand column, row above) 39639 PUSH HL ; Store HL (pointer to current position in graphic data) 39640 LD C,0 ; Load C with zero (i.e. clear bits for loading of graphic data) 39642 LD A,(23300) ; Load A with Magic Knight's predicted (Magic Knight moving down / horizontally) or current ; (Magic Knight moving up) x-coordinate (pixel-within-character) as stored previously 39645 OR A ; If value is zero... 39646 JP Z,39658 ; ...then skip ahead to #R39658 (i.e. printing graphic data as-is with no need to shift bits ; for pixel-within-character offset) *39649 RR B ; Move graphic data one pixel right through D and into C... 39651 RR D ; ... 39653 RR C ; ... 39655 DEC A ; Decrease A (as one less pixel space left to deal with) 39656 JR NZ,39649 ; If A is not zero (i.e. not all pixels yet dealt with) then loop back to #R39649 for next one *39658 LD HL,(23296) ; Load HL with Display File address of bottom of Magic Knight's feet: predicted (Magic Knight ; moving down / horizontally) or current (Magic Knight moving up) 39661 LD A,B ; Print the three consecutive 8-pixel strips to Display File, XORring with what is already ; there... 39662 XOR (HL) ; ... 39663 LD (HL),A ; ... 39664 INC HL ; ... 39665 LD A,D ; ... 39666 XOR (HL) ; ... 39667 LD (HL),A ; ... 39668 INC HL ; ... 39669 LD A,C ; ... 39670 XOR (HL) ; ... 39671 LD (HL),A ; ... 39672 LD HL,(23320) ; Point HL at entry for Display File address of start of pixel row at Magic Knight's feet: ; predicted (Magic Knight moving down / horizontally) or current (Magic Knight moving up) in ; table at 26064 39675 DEC HL ; Load Display File address of start of pixel row above this into DE... 39676 LD D,(HL) ; ... 39677 DEC HL ; ... 39678 LD E,(HL) ; ... 39679 LD (23320),HL ; ...and place decreased pointer (y-coordinate offset, pixels) back at 23320 39682 LD HL,(23301) ; Load Magic Knight's predicted (Magic Knight moving down / horizontally) or current (Magic ; Knight moving up) x-coordinate (characters) into HL 39685 ADD HL,DE ; Add as offset to Display File address of start of relevant pixel row in HL 39686 LD (23296),HL ; Store as memory address to print next graphic data 39689 POP HL ; Restore HL (pointer to current position in graphic data) 39690 POP BC ; Restore BC (B = magnitude of y-velocity) 39691 DJNZ 39634 ; Loop back to 39634 ; [This section calculates remaining number of pixel rows to be drawn] 39693 LD (23298),HL ; Store current position in graphic data at 23298 *39696 LD HL,(23320) ; Point HL at entry for Display File address of start of pixel row current position (part-way ; through drawing Magic Knight) in table at 26064 39699 LD E,(HL) ; Load Display File address of start of this pixel row into DE... 39700 INC HL ; ... 39701 LD D,(HL) ; ... 39702 LD HL,(23312) ; Load HL with Magic Knight's predicted (Magic Knight moving down / horizontally) or current ; (Magic Knight moving up) x-coordinate (characters) 39705 ADD HL,DE ; Add to HL as offset 39706 LD (23310),HL ; Store at 23310 (Display File address of leftmost part of Magic Knight at current pixel row, ; mid-drawing) 39709 LD A,(23319) ; Load magnitude of y-velocity into A 39712 SUB 32 ; Subtract 32 (as Magic Knight is 32 pixels high)... 39714 NEG ; ...and negate to get number of pixel rows still to draw (i.e. 32-n here, but drew other n in ; loop between 39634 - 39691) ; [This section loads the graphic data to draw / erase] *39716 EX AF,AF' ; Swap registers 39717 LD HL,(23298) ; Load HL with current position in Magic Knight graphic data 39720 LD D,(HL) ; Load two bytes of graphic data into D and C, reading backwards... 39721 DEC HL ; ... 39722 LD C,(HL) ; ... 39723 DEC HL ; ... 39724 LD (23298),HL ; Store updated position in graphic data at 23298 39727 LD B,0 ; Blank out bitmap data in B 39729 LD L,0 ; Blank out bitmap data in L 39731 LD A,(23300) ; Load A Magic Knight's predicted (Magic Knight moving down / horizontally) or current (Magic ; Knight moving up) x-coordinate (pixel-within-character) 39734 OR A ; If this is zero... 39735 JP Z,39747 ; ...then skip ahead to #R39747 *39738 RR C ; Move graphic data one pixel right through D and into B... 39740 RR D ; ... 39742 RR B ; ... 39744 DEC A ; Decrease number of remaining pixels to shift 39745 JR NZ,39738 ; If there are still pixels to shift, loop back to #R39738 *39747 LD A,(23314) ; If "Magic Knight changing character position to right" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to left" flag (Magic Knight moving ; up) is reset... 39750 OR A ; ... 39751 JP Z,39759 ; ...then skip ahead to #R39759 39754 LD L,B ; Move data from C, through D, then B to L... 39755 LD B,D ; ... 39756 LD D,C ; ... 39757 LD C,0 ; ... ; [This section loads the graphic data to erase / draw] *39759 EXX ; Swap registers 39760 LD HL,(23305) ; Point HL' at current position (initially last byte) of Magic Knight graphic frame (Magic ; Knight's current frame to erase [Magic Knight moving down / horizontally] or current frame to ; draw [Magic Knight moving up]) 39763 LD D,(HL) ; Load two bytes of graphic data into D' and C', reading backwards... 39764 DEC HL ; ... 39765 LD C,(HL) ; ... 39766 DEC HL ; ... 39767 LD (23305),HL ; Store updated position in graphic data at 23305 39770 LD B,0 ; Blank out bitmap data in B' 39772 LD L,0 ; Blank out bitmap data in L' 39774 LD A,(23307) ; Load A Magic Knight's current (Magic Knight moving down / horizontally) or predicted (Magic ; Knight moving up) x-coordinate (pixel-within-character) 39777 OR A ; If this is zero... 39778 JP Z,39790 ; ...then skip ahead to #R39790 *39781 RR C ; Move graphic data one pixel right through D and into B... 39783 RR D ; ... 39785 RR B ; ... 39787 DEC A ; Decrease remaining number of pixels to shift 39788 JR NZ,39781 ; If there are still pixels left to shift, then loop back to #R39781 *39790 LD A,(23315) ; "Magic Knight changing character position to left" flag (Magic Knight moving down / ; horizontally) or "Magic Knight changing character position to right" flag (Magic Knight ; moving up) is reset... 39793 OR A ; ... 39794 JP Z,39802 ; ...then skip ahead to #R39802 39797 LD L,B ; Move data from C', through D', then B' to L'... 39798 LD B,D ; ... 39799 LD D,C ; ... 39800 LD C,0 ; ... ; At this point: [L, B, D, C contain graphic data to print, from current position in Magic Knight's current ; frame to draw [Magic Knight moving down / horizontally] or current frame to erase [Magic Knight moving up] [L', ; B', D', C' contain graphic data to print, from current position in Magic Knight's current frame to erase [Magic ; Knight moving down / horizontally] or current frame to draw [Magic Knight moving up] *39802 LD IX,(23310) ; Load IX with Display File address of leftmost part of Magic Knight at current pixel row, ; mid-drawing 39806 LD A,C ; XOR together values from C, C' and current location in Display File... 39807 EXX ; ...erasing old and drawing new graphic data... 39808 XOR C ; ... 39809 EXX ; ... 39810 XOR (IX+0) ; ... 39813 LD (IX+0),A ; ...and print at current location in Display File 39816 INC IX ; Advance right one character 39818 LD A,D ; XOR together values from D, D' and current location in Display File... 39819 EXX ; ...erasing old and drawing new graphic data... 39820 XOR D ; ... 39821 EXX ; ... 39822 XOR (IX+0) ; ... 39825 LD (IX+0),A ; ...and print at current location in Display File 39828 INC IX ; Advance right one character 39830 LD A,B ; XOR together values from B, B' and current location in Display File... 39831 EXX ; ...erasing old and drawing new graphic data... 39832 XOR B ; ... 39833 EXX ; ... 39834 XOR (IX+0) ; ... 39837 LD (IX+0),A ; ...and print at current location in Display File 39840 INC IX ; Advance right one character 39842 LD A,L ; XOR together values from L, L' and current location in Display File... 39843 EXX ; ...erasing old and drawing new graphic data... 39844 XOR L ; ... 39845 EXX ; ... 39846 XOR (IX+0) ; ... 39849 LD (IX+0),A ; ...and print at current location in Display File 39852 LD HL,(23320) ; Point HL' at entry for Display File address of start of pixel row current position (part-way ; through drawing Magic Knight) in table at 26064 39855 DEC HL ; Load Display File address of start of pixel row above this into DE'... 39856 LD D,(HL) ; ... 39857 DEC HL ; ... 39858 LD E,(HL) ; ... 39859 LD (23320),HL ; ...and place decreased pointer (y-coordinate offset, pixels) back at 23320 39862 LD HL,(23312) ; Load HL' with Magic Knight's predicted (Magic Knight moving down / horizontally) or current ; (Magic Knight moving up) x-coordinate (characters) 39865 ADD HL,DE ; Add x-coordinate (HL') as offset to Display File address of start of row (DE') in HL' 39866 LD (23310),HL ; Store at 23310 (Display File address of leftmost part of Magic Knight at current pixel row, ; mid-drawing) 39869 EX AF,AF' ; Swap registers (A = number of pixel rows still to draw) 39870 DEC A ; Decrease A by one, as there is now one less pixel row to draw 39871 JP NZ,39716 ; If there are still more pixel rows to draw, then loop back to #R39716 39874 LD A,(23319) ; If magnitude of y-velocity is zero... 39877 OR A ; ... 39878 JR Z,39973 ; ...then skip ahead to #R39973 (nothing more to draw / erase) 39880 LD HL,(23320) ; Point HL at entry for Display File address of start of pixel row current position (part-way ; through drawing Magic Knight) in table at 26064 39883 LD E,(HL) ; Load memory address of start of this pixel row into DE... 39884 INC HL ; ... 39885 LD D,(HL) ; ... 39886 LD HL,(23308) ; Load HL with Magic Knight's current (Magic Knight moving down / horizontally) or predicted ; (Magic Knight moving up) x-coordinate (characters) 39889 ADD HL,DE ; Add as offset to Display File address of start of relevant pixel row in HL 39890 LD (23303),HL ; Store at 23303 (current position to print to) 39893 LD HL,(23305) ; Load HL with current position in frame of Magic Knight graphic data, for Magic Knight's ; current frame to erase [Magic Knight moving down / horizontally] or current frame to draw ; [Magic Knight moving up] 39896 LD B,A ; Load magnitude of y-velocity into B ; [This section draws / erases only top Y pixel rows, where Y is magnitude of Magic Knight's y-velocity. e.g. draw / ; erase 7 pixel rows if Magic Knight's y-velocity magnitude = 7) *39897 PUSH BC ; Store BC (B = magnitude of y-velocity) 39898 LD D,(HL) ; Load byte of graphic data (right-hand column) into D 39899 DEC HL ; Move back to previous byte of graphic data 39900 LD B,(HL) ; Load byte of graphic data (right-hand column) into B 39901 DEC HL ; Move back to previous byte of graphic data 39902 PUSH HL ; Store HL (pointer to current position in graphic data) 39903 LD C,0 ; Load C with zero (i.e. clear bits for loading of graphic data) 39905 LD L,0 ; Load L with zero (i.e. clear bits for loading of graphic data) 39907 LD A,(23307) ; Load A with Magic Knight's current (Magic Knight moving down / horizontally) or predicted ; (Magic Knight moving up) x-coordinate (pixel-within-character) as stored previously 39910 OR A ; If value is zero... 39911 JP Z,39923 ; ...then skip ahead to #R39923 (i.e. printing graphic data as-is with no need to shift bits ; for pixel-within-character offset) *39914 RR B ; Move graphic data one pixel right through D and into C... 39916 RR D ; ... 39918 RR C ; ... 39920 DEC A ; Decrease A (as one less pixel space left to deal with) 39921 JR NZ,39914 ; If A is not zero (i.e. not all pixels yet dealt with) then loop back to #R39649 for next one *39923 LD IX,(23303) ; Load current position in bitmap Display File to print to into IX 39927 LD A,B ; Print the three consecutive 8-pixel strips to Display File, XORring with what is already ; there... 39928 XOR (IX+0) ; ... 39931 LD (IX+0),A ; ... 39934 INC IX ; ... 39936 LD A,D ; ... 39937 XOR (IX+0) ; ... 39940 LD (IX+0),A ; ... 39943 INC IX ; ... 39945 LD A,C ; ... 39946 XOR (IX+0) ; ... 39949 LD (IX+0),A ; ... 39952 LD HL,(23320) ; Point HL at entry for Display File address of start of pixel row for current mid-drawing ; position: predicted (Magic Knight moving down / horizontally) or current (Magic Knight moving ; up) in table at 26064 39955 DEC HL ; Load Display File address of start of pixel row above this into DE... 39956 LD D,(HL) ; ... 39957 DEC HL ; ... 39958 LD E,(HL) ; ... 39959 LD (23320),HL ; ...and place decreased pointer (y-coordinate offset, pixels) back at 23320 39962 LD HL,(23308) ; Load HL with Magic Knight's current (Magic Knight moving down / horizontally) or predicted ; (Magic Knight moving up) x-coordinate (characters) 39965 ADD HL,DE ; Add as offset to Display File address of start of relevant pixel row in HL 39966 LD (23303),HL ; Store at 23303 (current position to print to) 39969 POP HL ; Restore HL (pointer to current position in graphic data) 39970 POP BC ; Restore BC (B = magnitude of y-velocity) 39971 DJNZ 39897 ; Loop back to 39897 for next pixel row up *39973 POP HL ; Restore HL (pointer to Magic Knight's current data, stored at 39639) 39974 LD BC,(23331) ; Load BC with Magic Knight's predicted x-coordinate (pixels) 39978 LD (HL),C ; Set Magic Knight's current x-coordinate to be value in predicted x-coordinate 39979 INC HL ; Advance HL to Magic Knight's y-coordinate 39980 LD (HL),B ; Set Magic Knight's current y-coordinate to be value in predicted y-coordinate 39981 INC HL ; Advance HL to Magic Knight's current frame to erase 39982 LD A,(25390) ; Set this to same as Magic Knight's current frame number (as it is now drawn, so on the next ; call to this routine it will be the one to be erased)... 39985 LD (HL),A ; ... 39986 POP IX ; Restore IX 39988 RET ; Return ; Update Attributes at Magic Knight's Predicted Position ; ; Used by the routine at #R39224. c39989 PUSH IX ; Store IX 39991 PUSH BC ; Store BC 39992 PUSH DE ; Store DE 39993 LD A,(23331) ; Load Magic Knight's predicted x-coordinate into A 39996 RRCA ; Divide by eight, rounding down to nearest integer... 39997 RRCA ; ... 39998 RRCA ; ... 39999 AND 31 ; ... 40001 LD (23333),A ; ...and store at 23333 40004 LD A,(23331) ; Load three least significant bits of predicted x-coordinate into 23335... 40007 AND 7 ; ... 40009 LD (23335),A ; ... 40012 LD A,(23332) ; Load Magic Knight's predicted x-coordinate into A 40015 RRCA ; Divide by eight, rounding down to nearest integer... 40016 RRCA ; ... 40017 RRCA ; ... 40018 AND 31 ; ... 40020 LD (23334),A ; ...and store at 23333 40023 LD A,(23332) ; Load three least significant bits of predicted x-coordinate into 23336... 40026 AND 7 ; ... 40028 LD (23336),A ; ... 40031 LD A,(23334) ; Load predicted y-coordinate in characters into A 40034 ADD A,A ; Multiply by 8... 40035 ADD A,A ; ... 40036 ADD A,A ; ... 40037 LD H,0 ; Load into HL... 40039 LD L,A ; ... 40040 ADD HL,HL ; Multiply by 4 (i.e. 32 times original value)... 40041 ADD HL,HL ; ... 40042 LD A,(23333) ; Load predicted x-coordinate in characters into A 40045 LD D,0 ; Load into DE... 40047 LD E,A ; ... 40048 ADD HL,DE ; Add x-coordinate to 32 times y-coordinate (to get offset from, for example, start of ; Attribute File) 40049 PUSH HL ; Store HL (x + 32*y offset value) 40050 LD DE,22528 ; Point DE at start of Attribute File 40053 ADD HL,DE ; Add HL to address of start of Attribute File as offset 40054 PUSH HL ; Transfer updated Display File address (predicted attribute Display File address of Magic ; Knight) from HL to IX... 40055 POP IX ; ... 40057 POP HL ; Restore HL (x + 32*y offset value) 40058 LD DE,24539 ; Point DE at start of Terrain Interaction Data 40061 ADD HL,DE ; Add HL to DE as offset (in HL) 40062 LD B,0 ; Load BC with 30, as 30 characters have to be skipped when moving from right side of Magic ; Knight on one character row to left side on next row... 40064 LD C,30 ; ... 40066 LD A,(23335) ; Load pixel-within-character predicted x-coordinate of Magic Knight into A 40069 OR A ; If this is zero... 40070 JR Z,40074 ; ...then skip ahead to #R40074... 40072 LD C,29 ; ...else load BC with 29, as Magic Knight is spans three characters rather than two *40074 LD DE,(23337) ; Load Magic Knight's attribute and "Update Attributes at Magic Knight's Predicted Position" ; flag into DE 40078 EXX ; Switch registers 40079 LD C,4 ; Load C with 4 (as Magic Knight is 4 characters tall) 40081 LD A,(23336) ; Load predicted pixel-within-character y-coordinate 40084 OR A ; If this is zero... 40085 JR Z,40089 ; ...then skip ahead to #R40089... 40087 LD C,5 ; ...else add one, as Magic Knight is "between" characters, and therefore spans 5 characters ; tall *40089 LD B,2 ; Load B with 2 (as Magic Knight is 2 characters wide) 40091 LD A,(23335) ; Load predicted pixel-within-character x-coordinate 40094 OR A ; If this is zero... 40095 JR Z,40099 ; ...then skip ahead to #R40099... 40097 LD B,3 ; ...else add one, as Magic Knight is "between" characters, and therefore spans 3 characters ; wide *40099 LD A,B ; Load number of characters spanned by Magic Knight into A... 40100 LD (40104),A ; ...and into instruction at 40103 ; The operand of the instruction at #R40103 represents the number of characters spanned by Magic Knight ; horizontally. This is modified by the instruction at #R40100. *40103 LD B,0 ; Load B with number of characters spanned by Magic Knight horizontally *40105 EXX ; Switch registers 40106 BIT 6,(HL) ; If bit 6 (i.e. preserve attribute) is set in Terrain Interaction Data for Magic Knight's ; predicted x- and y-coordinates... 40108 JP NZ,40120 ; ...then skip ahead to #R40120 40111 LD A,(IX+0) ; Load attribute at Magic Knight's predicted x- and y-coordinates into A 40114 XOR E ; XOR with Magic Knight's current attribute 40115 AND D ; Reset INK and BRIGHT bits, preserving only PAPER and FLASH 40116 XOR E ; XOR with Magic Knight's current attribute (Magic Knight's INK and BRIGHT bits override ; whatever was there before) 40117 LD (IX+0),A ; Load processed attribute value at Magic Knight's predicted x- and y-coordinates back into ; Display File *40120 INC HL ; Advance by one byte in Terrain Interaction Data 40121 INC IX ; Advance by one byte in Display File 40123 EXX ; Switch registers 40124 DJNZ 40105 ; Loop back to 40105 for next character in Magic Knight's spanned characters 40126 EXX ; Switch registers 40127 ADD HL,BC ; Advance pointer in Terrain Interaction Data by 29/30 bytes (down to next row, depending on ; how many characters Magic Knight spans) 40128 ADD IX,BC ; Advance pointer in Attribute File by 29/30 bytes (down to next row, depending on how many ; characters Magic Knight spans) 40130 EXX ; Switch registers 40131 DEC C ; Decrease number of characters spanned by Magic Knight vertically... 40132 JR NZ,40103 ; ...and if not zero (i.e. more to go) then loop back to #R40103 40134 EXX ; Switch registers 40135 POP DE ; Restore DE 40136 POP BC ; Restore BC 40137 POP IX ; Restore IX 40139 RET ; Return ; Data - currently selected control device b40140 DEFB 65 ; Magic Knight's initial data b40141 DEFB 128 ; x-coordinate (pixels) 40142 DEFB 110 ; y-coordinate (pixels) 40143 DEFB 0 ; Frame Number (frame to erase) 40144 DEFB 0 ; Frame Number (frame to draw) 40145 DEFB 0 ; x velocity (pixels) [walking / jumping sideways, usually 2 for right and 254 / -2 for left] 40146 DEFB 0 ; y velocity (pixels) [jumping] 40147 DEFB 69 ; Attribute 40148 DEFB 184 ; Update Attributes Mask (zeroes BRIGHT and INK component of existing attribute so that Magic ; Knight's INK and BRIGHT bits override) (used by routine at 39989) ; Common Words Table ; ; 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. b40149 DEFM 14,14,0 ; carriage return / line feed}{carriage return / line feed 40152 DEFM 16,5,0 ; change INK colour to cyan 40155 DEFM 9,9,0 ; move text cursor right by two characters 40158 DEFM 14,16,7,0 ; carriage return / line feed}{change INK colour to white 40162 DEFM "INSTRUCTION",0 ; INSTRUCTION 40174 DEFM " = ",0 ; = 40178 DEFM "A ",0 ; A 40181 DEFM "AN ",0 ; AN 40185 DEFM "TO ",0 ; TO 40189 DEFM "COMMAND",0 ; COMMAND 40197 DEFM "CHARACTER",0 ; CHARACTER 40207 DEFM "FROM ",0 ; FROM 40213 DEFM "OBJECT ",0 ; OBJECT 40221 DEFM "AND ",0 ; AND 40226 DEFM "YOU ",0 ; YOU 40231 DEFM "GAME ",0 ; GAME 40237 DEFM "EXAMINE ",0 ; EXAMINE 40246 DEFM "ANY ",0 ; ANY 40251 DEFM "KEY",0 ; KEY 40255 DEFM " ",0 40259 DEFM "THE ",0 ; THE 40264 DEFM "WHICH ",0 ; WHICH 40271 DEFM "TAKE ",0 ; TAKE 40277 DEFM "GIVE ",0 ; GIVE 40283 DEFM "SUMMON ",0 ; SUMMON 40291 DEFM "LOCATE",0 ; LOCATE 40298 DEFM 130," ",111,"WIZARD ",0 ; GIMBAL THE WIZARD 40309 DEFM 131,0 ; THOR 40311 DEFM 132," ",111,"DWARF ",0 ; FLORIN THE DWARF 40321 DEFM 133," ",111,"CLERIC ",0 ; ORIK THE CLERIC 40332 DEFM 134," ",111,"STRONG ",0 ; SAMSUN THE STRONG 40343 DEFM 135," HALFELVEN ",0 ; ELRAND HALFELVEN 40356 DEFM "LADY ",136,0 ; LADY ROSMAR 40363 DEFM 111,137,0 ; THE BANSHEE 40366 DEFM "SOMETHING ",0 ; SOMETHING 40377 DEFM "TELEPORT ",0 ; TELEPORT 40387 DEFM " JOYSTICK ",0 ; JOYSTICK 40398 DEFM "HELP ",0 ; HELP 40404 DEFM "DAVID JONES",0 ; DAVID JONES 40416 DEFM "GIMBAL",0 ; GIMBAL 40423 DEFM "THOR",0 ; THOR 40428 DEFM "FLORIN",0 ; FLORIN 40435 DEFM "ORIK",0 ; ORIK 40440 DEFM "SAMSUN",0 ; SAMSUN 40447 DEFM "ELRAND",0 ; ELRAND 40454 DEFM "ROSMAR",0 ; ROSMAR 40461 DEFM "BANSHEE",0 ; BANSHEE 40469 DEFM "CRYSTAL",0 ; CRYSTAL 40477 DEFM "THIS ",0 ; THIS 40483 DEFM "NOTHING",0 ; NOTHING 40491 DEFM "THROW ",0 ; THROW 40498 DEFM "THERE ",0 ; THERE 40505 DEFM "THEIR",0 ; THEIR 40511 DEFM "MAGIC KNIGHT",0 ; MAGIC KNIGHT 40524 DEFM "BOOK",0 ; BOOK 40529 DEFM "READ ",0 ; READ 40535 DEFM "YES",0 ; YES 40539 DEFM "NO",0 ; NO 40542 DEFM "BOTTLE",0 ; BOTTLE 40549 DEFM " OF ",0 ; OF 40554 DEFM "ROOF",0 ; ROOF 40559 DEFM "4TH ",177,0 ; 4TH FLOOR 40565 DEFM "3RD ",177,0 ; 3RD FLOOR 40571 DEFM "2ND ",177,0 ; 2ND FLOOR 40577 DEFM "1ST ",177,0 ; 1ST FLOOR 40583 DEFM "GROUND ",177,0 ; GROUND FLOOR 40592 DEFM "BASEMENT",0 ; BASEMENT 40601 DEFM " ",0 40603 DEFM " ",0 40607 DEFM 159," ",0 40611 DEFM 160," ",0 40615 DEFM 161," ",0 40619 DEFM 162," ",0 40623 DEFM 163," ",0 40627 DEFM "SPELLBOUND",0 ; SPELLBOUND 40638 DEFM "COPYRIGHT ",0 ; COPYRIGHT 40649 DEFM " IS",14 ; IS TOO TIRED TO 40653 DEFM "TOO TIRED TO",0 40666 DEFM 92,29,14 ; name of Current Object} YE UNBINDE SPELL HOLD IN THY HAND A MOST MAGIC ; OBJECT YOU CAST THEE ONCE THY SPELL OF 40669 DEFM 14 40670 DEFM "YE UNBINDE ",175,14 40683 DEFM 14 40684 DEFM "HOLD IN THY HAND aMOST",14 40707 DEFM "MAGIC OBJECT i",174,14 40723 DEFM "THEE ONCE THY ",175," OF",14,0 40743 DEFM "HERE",0 ; HERE 40748 DEFM "YET",0 ; YET 40752 DEFM 111,"ROOF GARDEN",0 ; THE ROOF GARDEN 40765 DEFM "SECRET TUNNEL",0 ; SECRET TUNNEL 40779 DEFM "QUITICUS GAMUS",0 ; QUITICUS GAMUS 40794 DEFM "CAST",0 ; CAST 40799 DEFM "SPELL",0 ; SPELL 40805 DEFM "FUMATICUS PROTECTIUM",0 ; FUMATICUS PROTECTIUM 40826 DEFM "FLOOR",0 ; FLOOR 40832 DEFM "ROOM",0 ; ROOM 40837 DEFM "CRYSTALLIUM SPECTRALIS",0 ; CRYSTALLIUM SPECTRALIS 40860 DEFM "CANDELIUM ILLUMINATUS",0 ; CANDELIUM ILLUMINATUS 40882 DEFM "ARMOURIS PHOTONICUS",0 ; ARMOURIS PHOTONICUS 40902 DEFM "PROJECT PHYSICAL BODY",0 ; PROJECT PHYSICAL BODY 40924 DEFM "RELEASE ",175,0 ; RELEASE SPELL 40934 DEFM "HAPPY",0 ; HAPPY 40940 DEFM "SAYS",0 ; SAYS 40945 DEFM "YOUR",0 ; YOUR 40950 DEFM "CANDLE",0 ; CANDLE 40957 DEFM "ALREADY",0 ; ALREADY 40965 DEFM "LUMP OF BRICKWORK",0 ; LUMP OF BRICKWORK 40983 DEFM "MASTERTRONIC ",0 ; MASTERTRONIC 40997 DEFM "LIFT",0 ; LIFT 41002 DEFM "IS ",0 ; IS 41006 DEFM "TIME",0 ; TIME 41011 DEFM "MAGIC",0 ; MAGIC ; Characters' Initial Inventories ; ; Nine groups of five bytes, one group per character (including Magic Knight). Each of the five bytes per group ; represents an inventory slot for that character. A value of zero indicates that the slot is empty. Non-zero values ; correspond to indices of objects (e.g. 3 = Miolnir) b41017 DEFB 43,0,0,0,0 ; Magic Knight 41022 DEFB 0,0,0,0,0 ; Gimbal the Wizard 41027 DEFB 0,0,0,0,0 ; Thor 41032 DEFB 4,0,0,0,0 ; Florin the Dwarf 41037 DEFB 0,0,0,0,0 ; Orik the Cleric 41042 DEFB 29,38,0,0,0 ; Samsun the Strong 41047 DEFB 3,28,0,0,0 ; Elrand Halfelven 41052 DEFB 24,18,0,0,0 ; Lady Rosmar 41057 DEFB 0,0,0,0,0 ; The Banshee ; Characters' Initial Positions ; ; Eight groups of three bytes, one group per character (excluding Magic Knight). The values are: b41062 DEFB 48,6,2 ; Gimbal the Wizard 41065 DEFB 23,0,0 ; Thor 41068 DEFB 20,0,0 ; Florin the Dwarf 41071 DEFB 32,0,0 ; Orik the Cleric 41074 DEFB 28,0,0 ; Samsun the Strong 41077 DEFB 25,0,0 ; Elrand Halfelven 41080 DEFB 4,0,0 ; Lady Rosmar 41083 DEFB 99,0,0 ; The Banshee ; Objects' Initial Positions ; ; Fifty groups of three bytes, one group per object. The values are: b41086 DEFB 99,0,0 ; "Nothing at All" 41089 DEFB 9,28,17 ; Ancient Scroll 41092 DEFB 26,4,17 ; Book of Shadows 41095 DEFB 99,0,0 ; Miolnir 41098 DEFB 99,0,0 ; Axe 41101 DEFB 33,8,17 ; Sticky Bun 41104 DEFB 0,2,17 ; Crystal Ball 41107 DEFB 8,10,17 ; Wand of Command 41110 DEFB 16,12,17 ; Javelin 41113 DEFB 29,28,17 ; Cannon Ball 41116 DEFB 37,15,9 ; Tube of Glue 41119 DEFB 46,26,9 ; Broken Talisman 41122 DEFB 99,0,0 ; Magic Talisman 41125 DEFB 2,15,17 ; Runestone 41128 DEFB 99,0,0 ; Broken Glass 41131 DEFB 34,20,17 ; Book of Runes 41134 DEFB 22,20,7 ; Glowing Bottle 41137 DEFB 34,28,17 ; Gold Goblet 41140 DEFB 99,0,0 ; Fast Blow Fuse 41143 DEFB 22,2,17 ; Red Herring 41146 DEFB 27,26,17 ; Brick 41149 DEFB 12,15,9 ; Green Crystal 41152 DEFB 31,12,17 ; Blue Crystal 41155 DEFB 9,14,7 ; Red Crystal 41158 DEFB 99,0,0 ; Willow Rod 41161 DEFB 99,12,17 ; Lump of Brickwork 41164 DEFB 1,20,17 ; Bottle of Liquid 41167 DEFB 1,8,17 ; Four Leaf Clover 41170 DEFB 99,0,0 ; Loaf of Elf-Bread 41173 DEFB 99,0,0 ; Platform 41176 DEFB 29,6,17 ; Gold Bar 41179 DEFB 18,8,17 ; Pewter Tankard 41182 DEFB 31,16,17 ; White Gold Ring 41185 DEFB 17,5,17 ; Engraved Candle 41188 DEFB 42,10,17 ; Strange Liquid 41191 DEFB 19,15,9 ; Mirror 41194 DEFB 42,14,17 ; Pocket Laser 41197 DEFB 6,16,17 ; Prism 41200 DEFB 99,0,0 ; Elf-Horn 41203 DEFB 20,18,17 ; Saxophone 41206 DEFB 40,16,17 ; Trumpet 41209 DEFB 24,3,17 ; Instruction Book 41212 DEFB 17,9,17 ; Key 41215 DEFB 99,0,0 ; Advert 41218 DEFB 99,16,17 ; Lump of Brickwork 41221 DEFB 28,24,17 ; Empty Bottle 41224 DEFB 49,6,17 ; Power-Pong Plant 41227 DEFB 41,28,17 ; Shield 41230 DEFB 21,2,17 ; Teleport Key 41233 DEFB 23,20,17 ; Teleport Pad ; Object Names b41236 DEFM 140," AT ALL ",0 ; NOTHING AT ALL 41246 DEFM "ANCIENT SCROLL",0 ; ANCIENT SCROLL 41261 DEFM 145,150,"SHADOWS",0 ; BOOK OF SHADOWS 41271 DEFM "MIOLNIR",0 ; MIOLNIR 41279 DEFM "AXE",0 ; AXE 41283 DEFM "STICKY BUN",0 ; STICKY BUN 41294 DEFM 138," BALL",0 ; CRYSTAL BALL 41301 DEFM "W",104,"OF ",100,0 ; WAND OF COMMAND 41308 DEFM "JAVELIN",0 ; JAVELIN 41316 DEFM "CANNON BALL",0 ; CANNON BALL 41328 DEFM "TUBE",150,"GLUE",0 ; TUBE OF GLUE 41338 DEFM "BROKEN TALISMAN",0 ; BROKEN TALISMAN 41354 DEFM 194," TALISMAN",0 ; MAGIC TALISMAN 41365 DEFM "RUNESTONE",0 ; RUNESTONE 41375 DEFM "BROKEN GLASS",0 ; BROKEN GLASS 41388 DEFM 145,150,"RUNES",0 ; BOOK OF RUNES 41396 DEFM "GLOWING ",149,0 ; GLOWING BOTTLE 41406 DEFM "GOLD GOBLET",0 ; GOLD GOBLET 41418 DEFM "FAST BLOW FUSE",0 ; FAST BLOW FUSE 41433 DEFM "RED HERRING",0 ; RED HERRING 41445 DEFM "BRICK",0 ; BRICK 41451 DEFM "GREEN ",138,0 ; GREEN CRYSTAL 41459 DEFM "BLUE ",138,0 ; BLUE CRYSTAL 41466 DEFM "RED ",138,0 ; RED CRYSTAL 41472 DEFM "WILLOW ROD",0 ; WILLOW ROD 41483 DEFM 189,0 ; LUMP OF BRICKWORK 41485 DEFM 149,150,"LIQUID",0 ; BOTTLE OF LIQUID 41494 DEFM "FOUR LEAF CLOVER",0 ; FOUR LEAF CLOVER 41511 DEFM "LOAF",150,"ELF-B",146,0 ; LOAF OF ELF-BREAD 41523 DEFM "PLATFORM",0 ; PLATFORM 41532 DEFM "GOLD BAR",0 ; GOLD BAR 41541 DEFM "PEWTER TANKARD",0 ; PEWTER TANKARD 41556 DEFM "WHITE GOLD RING",0 ; WHITE GOLD RING 41572 DEFM "ENGRAVED ",187,0 ; ENGRAVED CANDLE 41583 DEFM "STRANGE LIQUID",0 ; STRANGE LIQUID 41598 DEFM "MIRROR",0 ; MIRROR 41605 DEFM "POCKET LASER",0 ; POCKET LASER 41618 DEFM "PRISM",0 ; PRISM 41624 DEFM "ELF-HORN",0 ; ELF-HORN 41633 DEFM "SAXAPHONE",0 ; SAXAPHONE [bug] 41643 DEFM "TRUMPET",0 ; TRUMPET 41651 DEFM 95," ",145,0 ; INSTRUCTION BOOK 41655 DEFM 109,0 ; KEY 41657 DEFM "ADVERT",0 ; ADVERT 41664 DEFM 189,0 ; LUMP OF BRICKWORK 41666 DEFM "EMPTY BOTTLE",0 ; EMPTY BOTTLE 41679 DEFM "POWER-PONG PLANT",0 ; POWER-PONG PLANT 41696 DEFM "SHIELD",0 ; SHIELD 41703 DEFM 126,109,0 ; TELEPORT KEY 41706 DEFM 126,"PAD",0 ; TELEPORT PAD ; Room Connectivity Data ; ; Two values per room: b41711 DEFB 255,1 ; The Lift 41713 DEFB 0,2,1,3,2,4,3,5,4,6,5,7,6,8,7,255 ; Roof 41729 DEFB 255,10,9,11,10,12,11,13,12,14,13,15,14,16,15,255 ; 4th Floor 41745 DEFB 255,18,17,19,18,20,19,21,20,22,21,23,22,24,23,255 ; 3rd Floor 41761 DEFB 255,26,25,27,26,28,27,29,28,30,29,31,30,32,31,255 ; 2nd Floor 41777 DEFB 255,34,33,35,34,36,35,37,36,38,37,39,38,40,39,255 ; 1st Floor 41793 DEFB 255,42,41,43,42,44,43,45,44,46,45,47,46,48,47,255 ; Ground Floor 41809 DEFB 255,255 ; Basement ; Keyboard Shortcuts for Commands b41811 DEFM "PDTGHECLXRYSBWV" 41826 DEFB 0 ; Routine Start Addresses for Magic Knight's Commands (Main Menu) b41827 DEFW 30222 ; Process command to pick up an object 41829 DEFW 30439 ; Process command to drop an object 41831 DEFW 30602 ; Process command to take an object 41833 DEFW 30880 ; Process command to give an object 41835 DEFW 31153 ; Display and Handle Main In-Game Menu 41837 DEFW 31370 ; Process command to examine an object, a character or Magic Knight 41839 DEFW 31636 ; Process and Execute Command to Command a Character 41841 DEFW 32035 ; Process command to locate a character 41843 DEFW 32194 ; Process command to teleport 41845 DEFW 32258 ; Process and Execute Command to Read an Object 41847 DEFW 32390 ; Process command to throw an object 41849 DEFW 32655 ; Process command to cast a spell 41851 DEFW 33312 ; Process command to blow an object 41853 DEFW 33593 ; Process command to call Lift 41855 DEFW 33663 ; Process command to move Lift ; Store for address of current position in Magic Knight's y-velocities sequence table at 41857 b41857 DEFW 0 ; Magic Knight's y-Velocities Sequence for Jumping and Falling ; ; This is the sequence of y-velocity increments / decrements applied to Magic Knight's y-coordinate when he is ; jumping or falling. The data is zero-terminated. b41859 DEFB 7,7,6,6,5,5,4,4 41867 DEFB 3,3,2,2,1,1,0 ; Window Data ; ; Eight bytes per window. The meaning of the data is: b41874 DEFB 0,23,0,14,117,79,1,79 ; (00) Main (Game) Window 41882 DEFB 0,31,19,23,101,67,0,79 ; (01) Command Summary Window 41890 DEFB 0,25,0,9,117,68,0,79 ; (02) Window showing an object's read text (i.e. "READ OBJECT successful" ; window) 41898 DEFB 0,22,0,12,117,68,2,79 ; (03) Character Selection Window 41906 DEFB 0,23,0,8,117,70,1,79 ; (04) List of objects window (menu or info) 41914 DEFB 5,26,1,6,101,70,0,0 ; (05) "SPELLBOUND A TRUE GRAPHIC ADVENTURE BY DAVID JONES COPYRIGHT 1985" ; window above Control Selection Window 41922 DEFB 0,31,10,19,101,70,0,69 ; (06) Control Selection Window 41930 DEFB 0,31,10,21,117,70,0,79 ; (07) Instructions Window (1/3) 41938 DEFB 3,28,9,19,117,84,0,14 ; (08) Instructions Window (2/3) 41946 DEFB 5,26,8,22,117,115,0,69 ; (09) Instructions Window (3/3) 41954 DEFB 0,0,0,0,117,7,0,7 ; (10) 2nd Floor portraits and Florin's Room Picture frame 41962 DEFB 0,19,0,4,117,76,0,70 ; (11) "EXECUTE / REJECT COMMAND" Window 41970 DEFB 0,15,0,4,117,98,0,104 ; (12) "THERE IS NO WRITING FOR ME TO READ" window 41978 DEFB 0,18,0,3,117,67,0,78 ; (13) Pick Up / Drop / Give / Take failed (including "THOR IS ANGRY...") ; messages window 41986 DEFB 0,18,15,18,117,70,0,205 ; (14) "PRESS SPACE OR FIRE TO CONTINUE" window 41994 DEFB 0,31,19,23,101,78,0,69 ; (15) In-game window at bottom of screen ("SPELLBOUND COPYRIGHT ; MASTERTRONIC..." / Magic Knight's strength and inventory if carrying mirror) 42002 DEFB 0,15,0,6,117,98,1,112 ; (16) "EXAMINE WHAT?" Window 42010 DEFB 0,16,0,4,117,67,0,78 ; (17) "IT IS NOT SAFE TO TELEPORT..." window 42018 DEFB 0,22,0,12,117,67,0,120 ; (18) "EXAMINE YOURSELF" / "EXAMINE CHARACTER" Window 42026 DEFB 2,5,3,8,117,68,0,71 ; (19) Frame around portrait of character on "EXAMINE CHARACTER" and "EXAMINE ; YOURSELF" windows 42034 DEFB 0,22,0,9,117,67,0,120 ; (20) "EXAMINE OBJECT" Window 42042 DEFB 2,5,4,7,117,69,0,69 ; (21) Frame around object in "EXAMINE OBJECT" Window 42050 DEFB 0,11,0,11,117,78,0,71 ; (22) "LOCATE A CHARACTER" Window 42058 DEFB 0,22,0,10,117,77,2,78 ; (23) "WHICH COMMAND DO YOU WANT TO USE?" ("COMMAND [CHARACTER] TO...") Window 42066 DEFB 0,21,0,2,117,98,0,120 ; (24) "Command a character to help successful" window / Lift Messages Window 42074 DEFB 0,16,0,10,117,77,1,71 ; (25) "TAKE LIFT TO:" Window 42082 DEFB 0,23,0,10,117,67,0,71 ; (26) "YOU DROPPED THE BOTTLE TO THE GROUND..." Window 42090 DEFB 0,15,0,5,117,115,0,112 ; (27) "WHAT A RACKET" / "WHAT A LOT OF DUST" Window 42098 DEFB 0,22,0,3,117,68,2,71 ; (28) Summoning messages 42106 DEFB 0,19,0,3,117,68,2,71 ; (29) "Result of commanding a character" Window 42114 DEFB 0,26,0,1,117,87,2,87 ; (30) Spell Selection Window 42122 DEFB 4,27,1,12,117,87,0,87 ; (31) Red death information window 42130 DEFB 0,31,0,10,117,96,0,96 ; (32) Green "GIMBAL IS NOT YET RELEASED..." Window 42138 DEFB 4,27,1,12,117,104,0,104 ; (33) Game Over Window 42146 DEFB 0,10,0,3,117,104,0,104 ; (34) "[CHARACTER] IS ASLEEP" window 42154 DEFB 0,23,0,3,117,68,0,71 ; (35) "Result of casting a spell (or failing)" Window 42162 DEFB 0,31,16,23,101,67,0,79 ; (36) "WELL DONE MAGIC KNIGHT..." window ; Characters' Initial Stats ; ; Nine groups of eight bytes, one group per character (including Magic Knight). The values are: b42170 DEFB 70,17,82,14,62,0,0,1 ; Magic Knight 42178 DEFB 90,70,30,250,100,0,12,2 ; Gimbal the Wizard 42186 DEFB 100,65,41,10,210,0,12,3 ; Thor 42194 DEFB 40,60,52,15,250,0,140,4 ; Florin the Dwarf 42202 DEFB 50,55,63,55,180,0,140,5 ; Orik the Cleric 42210 DEFB 100,50,74,5,200,0,12,6 ; Samsun the Strong 42218 DEFB 60,45,75,60,250,0,12,7 ; Elrand Halfelven 42226 DEFB 80,40,76,5,165,0,12,8 ; Lady Rosmar 42234 DEFB 0,0,0,100,0,1,0,9 ; The Banshee ; Object Properties ; ; Fifty groups of eight bytes, one group per object (including "Nothing at All"). The values are: b42242 DEFB 0,0,0,0,0,0,0,0 ; "Nothing at All" 42250 DEFB 1,0,128,0,0,0,71,7 ; Ancient Scroll 42258 DEFB 1,0,129,10,0,0,70,18 ; Book of Shadows 42266 DEFB 25,0,0,12,18,0,70,16 ; Miolnir 42274 DEFB 10,0,0,0,18,0,70,15 ; Axe 42282 DEFB 1,1,0,0,0,0,71,26 ; Sticky Bun 42290 DEFB 2,0,139,35,0,0,71,5 ; Crystal Ball 42298 DEFB 1,0,0,37,0,0,70,27 ; Wand of Command 42306 DEFB 5,0,0,0,18,0,70,28 ; Javelin 42314 DEFB 20,0,0,0,18,0,69,5 ; Cannon Ball 42322 DEFB 1,1,0,0,0,0,70,29 ; Tube of Glue 42330 DEFB 1,0,0,0,0,0,70,30 ; Broken Talisman 42338 DEFB 1,0,0,85,0,0,70,31 ; Magic Talisman 42346 DEFB 10,0,130,90,16,0,70,17 ; Runestone 42354 DEFB 1,0,0,0,0,0,71,24 ; Broken Glass 42362 DEFB 1,0,131,57,0,0,68,18 ; Book of Runes 42370 DEFB 1,2,148,0,0,0,71,6 ; Glowing Bottle 42378 DEFB 5,0,0,17,18,0,70,32 ; Gold Goblet 42386 DEFB 1,0,0,0,0,0,0,0 ; Fast Blow Fuse 42394 DEFB 1,0,145,25,0,0,66,8 ; Red Herring 42402 DEFB 25,0,0,0,18,0,6,13 ; Brick 42410 DEFB 2,0,0,33,34,0,68,3 ; Green Crystal 42418 DEFB 2,0,0,33,34,0,65,3 ; Blue Crystal 42426 DEFB 2,0,0,33,34,0,66,3 ; Red Crystal 42434 DEFB 1,0,0,31,0,0,70,33 ; Willow Rod 42442 DEFB 1,0,0,0,0,0,7,25 ; Lump of Brickwork 42450 DEFB 2,0,135,0,0,0,68,6 ; Bottle of Liquid 42458 DEFB 1,0,0,16,0,0,68,37 ; Four Leaf Clover 42466 DEFB 1,0,0,0,0,0,71,11 ; Loaf of Elf-Bread 42474 DEFB 80,0,0,0,16,0,67,25 ; Platform 42482 DEFB 30,0,0,0,18,0,70,13 ; Gold Bar 42490 DEFB 1,0,132,0,0,0,71,21 ; Pewter Tankard 42498 DEFB 1,0,0,100,0,0,71,20 ; White Gold Ring 42506 DEFB 1,0,133,77,0,0,70,22 ; Engraved Candle 42514 DEFB 1,0,0,0,0,0,69,10 ; Strange Liquid 42522 DEFB 1,0,0,0,0,0,71,14 ; Mirror 42530 DEFB 1,0,144,0,0,0,69,19 ; Pocket Laser 42538 DEFB 1,0,0,0,0,0,69,39 ; Prism 42546 DEFB 1,0,0,81,1,0,68,23 ; Elf-Horn 42554 DEFB 1,0,146,46,1,0,70,35 ; Saxophone 42562 DEFB 1,0,0,0,1,0,70,36 ; Trumpet 42570 DEFB 2,0,128,0,0,0,67,18 ; Instruction Book 42578 DEFB 1,0,151,0,0,0,70,12 ; Key 42586 DEFB 1,0,134,0,0,0,70,38 ; Advert 42594 DEFB 1,0,0,0,0,0,7,25 ; Lump of Brickwork 42602 DEFB 1,0,135,0,0,0,69,6 ; Empty Bottle 42610 DEFB 1,0,150,0,0,0,70,34 ; Power-Pong Plant 42618 DEFB 1,0,0,0,0,0,71,4 ; Shield 42626 DEFB 1,0,149,0,0,0,67,12 ; Teleport Key 42634 DEFB 20,0,147,0,0,0,69,9 ; Teleport Pad ; Graphic Lookup Table ; ; Three values per graphic. First two are BYTEs and third is a WORD. The values are: b42642 DEFB 2,4,244,247 ; (000) - Graphics (#R63476) - Magic Knight Frame 1 (Right) 42646 DEFB 6,6,148,246 ; (001) - Graphics (#R63124) - "Locate a Character" Compass 42650 DEFB 2,2,173,213 ; (002) - Graphics (#R54701) - Menu Cursor (Hand) 42654 DEFB 255,85,52,245 ; (003) - Graphics (#R62772) - Crystal (Object) 42658 DEFB 255,85,84,245 ; (004) - Graphics (#R62804) - Shield (Object) 42662 DEFB 255,85,116,245 ; (005) - Graphics (#R62836) - Cannon / Crystal Ball (Object) 42666 DEFB 255,17,148,245 ; (006) - Graphics (#R62868) - Bottle (Object) 42670 DEFB 255,85,180,245 ; (007) - Graphics (#R62900) - Ancient Scroll (Object) 42674 DEFB 255,5,212,245 ; (008) - Graphics (#R62932) - Red Herring (Object) 42678 DEFB 255,0,244,245 ; (009) - Graphics (#R62964) - Teleport Pad (Object) 42682 DEFB 255,0,20,246 ; (010) - Graphics (#R62996) - Pool of Liquid (Object) 42686 DEFB 255,85,52,246 ; (011) - Graphics (#R63028) - Loaf of Bread (Object) 42690 DEFB 255,5,84,246 ; (012) - Graphics (#R63060) - (Teleport) Key (Object) 42694 DEFB 255,5,116,246 ; (013) - Graphics (#R63092) - Brick / Gold Bar (Object) 42698 DEFB 255,85,212,243 ; (014) - Graphics (#R62420) - Mirror (Object) 42702 DEFB 255,85,244,243 ; (015) - Graphics (#R62452) - Axe (Object) 42706 DEFB 255,85,20,244 ; (016) - Graphics (#R62484) - Miolnir (Object) 42710 DEFB 255,85,52,244 ; (017) - Graphics (#R62516) - Runestone (Object) 42714 DEFB 255,85,84,244 ; (018) - Graphics (#R62548) - Book (Object) 42718 DEFB 255,5,116,244 ; (019) - Graphics (#R62580) - Pocket Laser (Object) 42722 DEFB 255,85,148,244 ; (020) - Graphics (#R62612) - White Gold Ring (Object) 42726 DEFB 255,85,180,244 ; (021) - Graphics (#R62644) - Pewter Tankard (Object) 42730 DEFB 255,17,212,244 ; (022) - Graphics (#R62676) - Engraved Candle (Object) 42734 DEFB 255,85,244,244 ; (023) - Graphics (#R62708) - Elf Horn (Object) 42738 DEFB 255,0,20,245 ; (024) - Graphics (#R62740) - Broken Glass (Object) 42742 DEFB 255,255,116,242 ; (025) - Graphics (#R62068) - Lump of Brickwork (Object) 42746 DEFB 255,5,148,242 ; (026) - Graphics (#R62100) - Sticky Bun (Object) 42750 DEFB 255,17,180,242 ; (027) - Graphics (#R62132) - Wand of Command (Object) [bug] 42754 DEFB 255,85,212,242 ; (028) - Graphics (#R62164) - Javelin (Object) 42758 DEFB 255,5,244,242 ; (029) - Graphics (#R62196) - Tube of Glue (Object) 42762 DEFB 255,5,20,243 ; (030) - Graphics (#R62228) - Broken Talisman (Object) 42766 DEFB 255,17,52,243 ; (031) - Graphics (#R62260) - Magic Talisman (Object) [bug] 42770 DEFB 255,85,84,243 ; (032) - Graphics (#R62292) - Goblet (Object) [bug] 42774 DEFB 255,85,116,243 ; (033) - Graphics (#R62324) - Willow Rod (Object) 42778 DEFB 255,85,148,243 ; (034) - Graphics (#R62356) - Power Pong Plant (Object) 42782 DEFB 255,85,180,243 ; (035) - Graphics (#R62388) - Saxophone (Object) 42786 DEFB 255,85,20,241 ; (036) - Graphics (#R61716) - Trumpet 42790 DEFB 255,85,52,241 ; (037) - Graphics (#R61748) - Four Leaf Clover 42794 DEFB 255,85,84,241 ; (038) - Graphics (#R61780) - Advert 42798 DEFB 255,85,116,241 ; (039) - Graphics (#R61812) - Prism 42802 DEFB 2,2,148,241 ; (040) - Graphics (#R61844) - Plant Pot (1) 42806 DEFB 2,1,180,241 ; (041) - Graphics (#R61876) - Plant Pot (2) 42810 DEFB 2,2,196,241 ; (042) - Graphics (#R61892) - Plant Pot (3) 42814 DEFB 2,3,228,241 ; (043) - Graphics (#R61924) - Goblet (from Picture in Florin's Room) 42818 DEFB 2,3,20,242 ; (044) - Graphics (#R61972) - Plant Pot (4) 42822 DEFB 2,3,68,242 ; (045) - Graphics (#R62020) - Plant (7) 42826 DEFB 0,0,0,0 ; (046) - Unused 42830 DEFB 8,5,212,239 ; (047) - Graphics (#R61396) - Tree Trunk (2) 42834 DEFB 8,5,84,237 ; (048) - Graphics (#R60756) - Tree Top (2) 42838 DEFB 8,5,148,238 ; (049) - Graphics (#R61076) - Tree Top (3) 42842 DEFB 2,5,116,236 ; (050) - Graphics (#R60532) - Plant (3) 42846 DEFB 2,3,196,236 ; (051) - Graphics (#R60612) - Plant (4) 42850 DEFB 2,3,244,236 ; (052) - Graphics (#R60660) - Plant (5) 42854 DEFB 2,3,36,237 ; (053) - Graphics (#R60708) - Plant (6) 42858 DEFB 2,4,164,235 ; (054) - Graphics (#R60324) - Wall Bracketed Candle 42862 DEFB 3,2,228,235 ; (055) - Graphics (#R60388) - Right-Facing Candle Wall Bracket 42866 DEFB 1,3,20,236 ; (056) - Graphics (#R60436) - Right-Facing Candle Wall Bracket Plate 42870 DEFB 3,2,44,236 ; (057) - Graphics (#R60460) - Left-Facing Candle Wall Bracket 42874 DEFB 1,3,92,236 ; (058) - Graphics (#R60508) - Left-Facing Candle Wall Bracket Plate 42878 DEFB 5,5,156,232 ; (059) - Graphics (#R59548) - Picture in Frame (1) 42882 DEFB 9,5,100,233 ; (060) - Graphics (#R59748) - Picture in Frame (2) 42886 DEFB 3,2,204,234 ; (061) - Graphics (#R60108) - Landscape 1 (from framed picture) 42890 DEFB 7,3,252,234 ; (062) - Graphics (#R60156) - Landscape 2 (from framed picture) 42894 DEFB 2,3,124,231 ; (063) - Graphics (#R59260) - Puff of Smoke Frame 1 42898 DEFB 2,3,172,231 ; (064) - Graphics (#R59308) - Puff of Smoke Frame 2 42902 DEFB 2,3,220,231 ; (065) - Graphics (#R59356) - Puff of Smoke Frame 3 42906 DEFB 2,3,12,232 ; (066) - Graphics (#R59404) - Puff of Smoke Frame 4 42910 DEFB 2,3,60,232 ; (067) - Graphics (#R59452) - Puff of Smoke Frame 5 42914 DEFB 2,3,108,232 ; (068) - Graphics (#R59500) - Puff of Smoke Frame 6 42918 DEFB 2,4,124,229 ; (069) - Graphics (#R58748) - Gimbal the Wizard 42922 DEFB 2,4,188,229 ; (070) - Graphics (#R58812) - Thor 42926 DEFB 2,4,252,229 ; (071) - Graphics (#R58876) - Florin the Dwarf 42930 DEFB 2,4,60,230 ; (072) - Graphics (#R58940) - Orik the Cleric 42934 DEFB 2,4,124,230 ; (073) - Graphics (#R59004) - Samsun the Strong 42938 DEFB 2,4,188,230 ; (074) - Graphics (#R59068) - Elrand Halfelven 42942 DEFB 2,4,252,230 ; (075) - Graphics (#R59132) - Lady Rosmar 42946 DEFB 2,4,60,231 ; (076) - Graphics (#R59196) - The Banshee 42950 DEFB 4,9,92,228 ; (077) - Graphics (#R58460) - Lift Control Panel 42954 DEFB 2,2,148,227 ; (078) - Graphics (#R58260) - Mushroom (1) 42958 DEFB 2,2,180,227 ; (079) - Graphics (#R58292) - Mushroom (2) 42962 DEFB 2,2,212,227 ; (080) - Graphics (#R58324) - Mushroom (3) 42966 DEFB 2,2,244,227 ; (081) - Graphics (#R58356) - Mushroom (4) 42970 DEFB 3,3,20,228 ; (082) - Graphics (#R58388) - Large Mushroom 42974 DEFB 2,4,84,227 ; (083) - Graphics (#R58196) - Lift Door 42978 DEFB 6,4,244,225 ; (084) - Graphics (#R57844) - Tree Top (1) 42982 DEFB 4,5,180,226 ; (085) - Graphics (#R58036) - Tree Trunk (1) 42986 DEFB 8,5,180,224 ; (086) - Graphics (#R57524) - Wall axes 42990 DEFB 2,5,164,223 ; (087) - Graphics (#R57252) - Unknown 42994 DEFB 2,2,244,223 ; (088) - Graphics (#R57332) - Unknown 42998 DEFB 2,5,20,224 ; (089) - Graphics (#R57364) - Plant (1) 43002 DEFB 2,5,100,224 ; (090) - Graphics (#R57444) - Plant (2) 43006 DEFB 3,10,180,222 ; (091) - Graphics (#R57012) - Wall clock 43010 DEFB 6,7,100,221 ; (092) - Graphics (#R56676) - Stag's Head 43014 DEFB 4,4,36,220 ; (093) - Graphics (#R56356) - Big Bottle Top 43018 DEFB 4,4,164,220 ; (094) - Graphics (#R56484) - Big / Little Bottle Body 43022 DEFB 4,2,36,221 ; (095) - Graphics (#R56612) - Little Bottle Top 43026 DEFB 3,6,148,219 ; (096) - Graphics (#R56212) - Ceiling Candles 43030 DEFB 5,2,4,218 ; (097) - Graphics (#R55812) - Books (1) 43034 DEFB 5,3,84,218 ; (098) - Graphics (#R55892) - Books (2) 43038 DEFB 5,3,204,218 ; (099) - Graphics (#R56012) - Books (3) 43042 DEFB 5,2,68,219 ; (100) - Graphics (#R56132) - Books (4) 43046 DEFB 3,2,164,217 ; (101) - Graphics (#R55716) - Right bookend 43050 DEFB 3,2,212,217 ; (102) - Graphics (#R55764) - Left bookend ; "HELLO HACKER" text b43054 DEFM "HELLO HACKER",13 ; HELLO HACKER FANCY MEETING YOU HERE ! 43067 DEFM 13 43068 DEFM "FANCY MEETING ",105,"HERE !" 43089 DEFM 0 ; Miscellaneous Text (1) b43090 DEFM 92," ",165,16,6," ",97,"TRUE",14 ; SPELLBOUND A TRUE GRAPHIC ADVENTURE BY DAVID JONES COPYRIGHT ; 1985 43102 DEFM " GRAPHIC ADVENTURE",14 43121 DEFM 16,7,110,"BY ",129,14 43129 DEFM 110,166,"1985" 43135 DEFM 0 43136 DEFM 16,6,158,165,14 ; SPELLBOUND COPYRIGHT MASTERTRONIC 1985 BY DAVID JONES 1985 43141 DEFM 16,7,19,0," ",166,190,"1985",14 43153 DEFM 19,64," BY ",129," 1985" 43165 DEFM 0 43166 DEFM "PRESS SPACE OR",14 ; PRESS SPACE OR FIRE TO CONTINUE 43181 DEFM "FIRE ",99,"CONTINUE" 43195 DEFM 0 43196 DEFM 14 ; E EXECUTE COMMAND R REJECT COMMAND 43197 DEFM "E",93,"EXECUTE ",100,14 43209 DEFM "R",93,"REJECT ",100 43219 DEFM 0 43220 DEFM 14 ; 0 43221 DEFM "0",93 43223 DEFM 0 43224 DEFM 106,"OVER",14 ; GAME OVER TOTAL COMPLETION 000 % TIME LEFT 48 HOURS 43230 DEFM "TOTAL COMPLETION 000 %",14 43253 DEFM 193," LEFT 48 HOURS",14 43269 DEFM 14 43270 DEFM 0 43271 DEFM 100,14 ; COMMAND 43273 DEFM 0 43274 DEFM 10 ; Height = 10 43275 DEFM 130," ",192,"NOT ",170," RELEASED",14 ; GIMBAL IS NOT YET RELEASED FROM THE WHITE-OUT SPELL THAT HE ; ACCIDENTALLY CAST UPON HIMSELF. A SPELL IS REQUIRED TO RELEASE ; HIM. IF HE IS NOT RELEASED SOON HIS SPIRIT WILL BE TOTALLY ; BLEACHED OUT (NASTY !!) 43293 DEFM "FROM ",111,"WHITE-OUT ",175," THAT",14 43316 DEFM "HE ACCIDENTALLY ",174," UPON",14 43339 DEFM "HIMSELF.",14 43348 DEFM 97,175," ",192,"REQUIRED ",99,14 43363 DEFM "RELEASE HIM.",14 43376 DEFM "IF HE ",192,"NOT RELEASED SOON",14 43401 DEFM "H",192,"SPIRIT WILL BE TOTALLY",14 43426 DEFM "BLEACHED OUT (NASTY !!)" 43449 DEFM 0 ; Cyan "Game Over" Window Additional Texts b43450 DEFM 7 ; Height = 7 43451 DEFM "BREAK ",109," PRESSED" ; BREAK KEY PRESSED 43466 DEFM 0 43467 DEFM 9,105,"HURT ",186,"SELF",14 ; YOU HURT YOURSELF MOVING AROUND IN THE DARK 43480 DEFM "MOVING AROUND IN ",111,14 43499 DEFM "DARK" 43503 DEFM 0 43504 DEFM 10 ; Height = 10 43505 DEFM 105,"KILLED ",186,"SELF",14 ; YOU KILLED YOURSELF TRYING TO THROW SOMETHING AT {short name of Current ; Character} 43519 DEFM "TRYING ",99,"THROW",14 43533 DEFM 125,"AT",14 43537 DEFM 31 43538 DEFM 0 43539 DEFM 8 ; Height = 8 43540 DEFM 105,"THREW ",125,14 ; YOU THREW SOMETHING AND KILLED {short name of Current Character} 43549 DEFM 104,"KILLED ",31 43558 DEFM 0 43559 DEFM 12 ; Height = 12 43560 DEFM "I SUPPOSE ",105,"REALISED",14 ; I SUPPOSE YOU REALISED THAT QUITICUS GAMUS IS A SPELL TO QUIT THE GAME ; BUT PRESSING THE BREAK KEY IS MUCH QUICKER ! 43580 DEFM "THAT ",173," IS",14 43590 DEFM 97,175," ",99,"QUIT ",111,14 43601 DEFM 106,"BUT PRESSING ",111,14 43617 DEFM "BREAK ",109," ",192,"MUCH",14 43631 DEFM "QUICKER !" 43640 DEFM 0 ; Miscellaneous Text (2) b43641 DEFM 31,14 ; short name of Current Character} IS ASLEEP 43643 DEFM 192,"ASLEEP" 43650 DEFM 0 43651 DEFM 7 ; Height = 7 43652 DEFM 111,"GAS GOT ",105 ; THE GAS GOT YOU 43662 DEFM 0 43663 DEFM "WELL DONE ",144," ",105,14 ; WELL DONE MAGIC KNIGHT YOU HAVE COMPLETED YOUR TASK BUT THE ; LAST SPELL HAS THROWN YOU INTO A TIMESTREAM AND YOU WILL ; EMERGE SHORTLY IN KNIGHT-TYME ALSO FROM MASTERTRONIC 43677 DEFM "HAVE COMPLETED ",186," TASK BUT",14 43703 DEFM 111,"LAST ",175," HAS THROWN YOU",14 43726 DEFM "INTO ",97,193,"STREAM ",104,105,"WILL",14 43747 DEFM "EMERGE SHORTLY IN KNIGHT-TYME",14 43777 DEFM "ALSO FROM ",190 43788 DEFM 0 43789 DEFM 15 ; Height = 15 43790 DEFM 105,"HAVE SUCCEEDED IN",14 ; YOU HAVE SUCCEEDED IN YOUR TASK BUT A MUCH GREATER ; CHALLENGE AWAITS YOU IN THE FAR FUTURE. CAN YOU ESCAPE BACK ; TO YOUR OWN TIME ? TO BE CONTINUED.... 43809 DEFM 186," TASK BUT ",97,"MUCH",14 43826 DEFM "GREATER CHALLENGE",14 43844 DEFM "AWAITS ",105,"IN ",111,"FAR",14 43860 DEFM "FUTURE.",14 43868 DEFM "C",98,105,"ESCAPE BACK",14 43883 DEFM 99,186," OWN ",193," ?",14 43894 DEFM 14 43895 DEFM 99,"BE CONTINUED...." 43912 DEFM 0 43913 DEFM " * STRENGTH * 1 2 3 4 5",14 ; * STRENGTH * 1 2 3 4 5 43942 DEFM " ",16,2,17,32," " 43959 DEFM 0 43960 DEFM 10 ; Height = 10 43961 DEFM 105,"DIED OF EXHAUSTION",14 ; YOU DIED OF EXHAUSTION (YOU REALLY SHOULD BE MORE CAREFUL ; !) 43981 DEFM 14 43982 DEFM "(",105,"REALLY SHOULD BE",14 44001 DEFM "MORE CAREFUL !)" 44016 DEFM 0 44017 DEFM 16,6,"WHO DO ",105,"WANT ",99,14 ; WHO DO YOU WANT TO 44034 DEFM 0 44035 DEFM 3 ; Height = 3 44036 DEFM 142,192,"NOBODY",14 ; THERE IS NOBODY IN THIS ROOM 44045 DEFM "IN ",139,178 44050 DEFM 0 44051 DEFM 113,98,103,102,"?",14 ; TAKE AN OBJECT FROM ? 44057 DEFM 0 44058 DEFM 114,98,103,99,"?",14 ; GIVE AN OBJECT TO ? 44064 DEFM 0 44065 DEFM 107,"?",14 ; EXAMINE ? 44068 DEFM 0 44069 DEFM 115,"?",14 ; SUMMON ? 44072 DEFM 0 44073 DEFM 100," ?",14 ; COMMAND ? 44077 DEFM 0 44078 DEFM 116," ?",14 ; LOCATE ? 44082 DEFM 0 44083 DEFM 141,98,103,"AT ?",14 ; THROW AN OBJECT AT ? 44091 DEFM 0 44092 DEFM "TRAVEL ",99,"?",14 ; TRAVEL TO ? 44102 DEFM 0 ; Main In-Game Menu Strings b44103 DEFM 16,4,100,"S AVAILABLE :-",14 ; COMMANDS AVAILABLE :- P PICK UP OBJECT D DROP OBJECT T TAKE OBJECT G ; GIVE OBJECT E EXAMINE 44121 DEFM 14 44122 DEFM 16,6,"P",93,"PICK UP ",103,14 44136 DEFM "D",93,"DROP ",103,14 44145 DEFM "T",93,113,103,14 44150 DEFM "G",93,114,103,14 44155 DEFM "E",93,107 44158 DEFM 0 44159 DEFM 14 ; Z EXIT MENU 44160 DEFM 92,"Z",93,"EXIT MENU" 44172 DEFM 0 44173 DEFM 94,"C",93,100," ",97,101 ; C COMMAND A CHARACTER 44180 DEFM 0 44181 DEFM 94,"L",93,116," ",97,101 ; L LOCATE A CHARACTER 44188 DEFM 0 44189 DEFM 94,"X",93,126 ; X TELEPORT 44193 DEFM 0 44194 DEFM 94,"R",93,146,125 ; R READ SOMETHING 44199 DEFM 0 44200 DEFM 94,"Y",93,141,125 ; Y THROW SOMETHING 44205 DEFM 0 44206 DEFM 94,"S",93,174," ",97,175 ; S CAST A SPELL 44213 DEFM 0 44214 DEFM 94,"B",93,"BLOW ",125 ; B BLOW SOMETHING 44223 DEFM 0 44224 DEFM 94,"W",93,"CALL ",191 ; W CALL LIFT 44233 DEFM 0 44234 DEFM 94,"V",93,"MOVE ",191 ; V MOVE LIFT 44243 DEFM 0 ; "Command a Character to Help" Text Messages b44244 DEFM 4 ; Height = 4 44245 DEFM 142,192,"NOTHING",14 ; THERE IS NOTHING MORE THAT {short name of Current Character} CAN DO TO ; HELP HERE 44255 DEFM "MORE THAT ",31," CAN",14 44271 DEFM "DO ",99,128,169 44277 DEFM 0 44278 DEFM 6 ; Height = 6 44279 DEFM 131," SMASHED ",111,14 ; THOR SMASHED THE LIFT CONTROL BOX WITH MIOLNIR. "THAT SHOULD DO THE ; TRICK" HE SAYS 44291 DEFM 191," CONTROL BOX",14 44305 DEFM "WITH MIOLNIR.",14 44319 DEFM 34,"THAT SHOULD DO ",111,14 44337 DEFM "TRICK",34," HE ",185 44348 DEFM 0 44349 DEFM 11 ; Height = 11 44350 DEFM 111,"TOWER SHOOK AS",14 ; THE TOWER SHOOK AS THOR SENT A BOLT OF HIS BEST LIGHTNING AT IT. THE ; TOWER STILL STANDS BUT HE HAS WEAKENED A WALL SOMEWHERE DUE TO ALL THE ; SHAKING AND NOISE 44366 DEFM 131," SENT ",97,"BOLT OF",14 44382 DEFM "H",192,"BEST LIGHTNING",14 44399 DEFM "AT IT.",14 44406 DEFM 111,"TOWER STILL",14 44419 DEFM "STANDS BUT HE HAS",14 44437 DEFM "WEAKENED ",97,"WALL",14 44452 DEFM "SOMEWHERE DUE ",99,"ALL",14 44471 DEFM 111,"SHAKING ",104,14 44482 DEFM "NOISE" 44487 DEFM 0 44488 DEFM 8 ; Height = 8 44489 DEFM 132," HAS MENDED",14 ; FLORIN HAS MENDED THE TALISMAN USING THE GLUE. THEN HE CAST AN OLD ; SPELL IN DWARVISH TO RESTORE IT TO FULL MAGIC POTENCY 44502 DEFM 111,"TALISMAN USING",14 44518 DEFM 111,"GLUE.",14 44525 DEFM "THEN HE ",174," ",98,"OLD",14 44540 DEFM 175," IN DWARVISH",14 44554 DEFM 99,"RESTORE IT ",99,14 44568 DEFM "FULL ",194," POTENCY" 44582 DEFM 0 44583 DEFM 5 ; Height = 5 44584 DEFM "GOOD OLD ",134," HAS",14 ; GOOD OLD SAMSUN HAS THROWN A PLATFORM INTO THE MIDDLE OF THE PIT FOR ; YOU 44599 DEFM "THROWN ",97,"PLATFORM",14 44616 DEFM "INTO ",111,"MIDDLE OF",14 44632 DEFM 111,"PIT FOR ",105 44642 DEFM 0 44643 DEFM 4 ; Height = 4 44644 DEFM 111,"TRUMPET BLOWS",14 ; THE TRUMPET BLOWS AND THE WALL COMES A-TUMBLING DOWN !! 44659 DEFM 104,111,"WALL COMES",14 44672 DEFM "A-TUMBLING DOWN !!" 44690 DEFM 0 44691 DEFM 8 ; Height = 8 44692 DEFM 136," PLACED ",111,14 ; ROSMAR PLACED THE FUSE IN THE LASER AND MELTED A HOLE IN THE WALL. NOT ; THE MOST SUBTLE METHOD OF ENTRY BUT VERY EFFECTIVE ! 44703 DEFM "FUSE IN ",111,"LASER",14 44718 DEFM 104,"MELTED ",97,"HOLE",14 44732 DEFM "IN ",111,"WALL.",14 44742 DEFM "NOT ",111,"MOST SUBTLE",14 44759 DEFM "METHOD OF ENTRY BUT",14 44779 DEFM "VERY EFFECTIVE !" 44795 DEFM 0 ; The Banshee's Help Texts b44796 DEFM 6 ; Height = 6 44797 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "THEY THAT WOULD BE FIRST SHALL BE LAST AND THE ; LAST SHALL BE FIRST" 44802 DEFM 34,"THEY THAT WOULD BE",14 44822 DEFM "FIRST SHALL BE LAST",14 44842 DEFM 104,111,"LAST SHALL",14 44855 DEFM "BE FIRST",34 44864 DEFM 0 44865 DEFM 5 ; Height = 5 44866 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "FLORIN THE DWARF IS GOOD AT MENDING THINGS" 44871 DEFM 34,119,"IS",14,"GOOD AT MENDING",14 44892 DEFM "THINGS",34 44899 DEFM 0 44900 DEFM 4 ; Height = 4 44901 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "BRING BACK LOST IN SPACE !" 44906 DEFM 34,"BRING BACK LOST",14 44923 DEFM "IN SPACE !",34 44934 DEFM 0 44935 DEFM 8 ; Height = 8 44936 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "A DISTANT COUSIN OF MINE IS PRETENDING TO BE A ; POOL OF LIQUID. A SPELL COULD BE OF USE TO BOTH OF YOU (bug) 44941 DEFM 34,97,"DISTANT COUSIN OF",14 44961 DEFM "MINE ",192,"PRETENDING",14 44978 DEFM 99,"BE ",97,"POOL OF",14 44991 DEFM "LIQUID.",14 44999 DEFM 97,175," COULD BE OF",14 45014 DEFM "USE ",99,"BOTH OF ",105 45028 DEFM 0 45029 DEFM 4 ; Height = 4 45030 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "RED HERRINGS ARE NOT ALWAYS FISH" 45035 DEFM 34,"RED HERRINGS ARE",14 45053 DEFM "NOT ALWAYS FISH",34 45069 DEFM 0 45070 DEFM 8 ; Height = 8 45071 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "THE PROOF IS IN THE BOTTLE. LEND IT TO FLORIN ; AND GAIN STRENGTH BY YOUR ACTIONS WHEN YOU CLAIM IT BACK" 45076 DEFM 34,111,"PROOF ",192,"IN",14 45088 DEFM 111,149,".",14 45092 DEFM "LEND IT ",99,132,14 45103 DEFM 104,"GAIN STRENGTH BY",14 45121 DEFM 186," ACTIONS WHEN",14 45136 DEFM 105,"CLAIM IT BACK",34 45151 DEFM 0 45152 DEFM 9 ; Height = 9 45153 DEFM 111,137," CHANTS",14 ; THE BANSHEE CHANTS "CANDLE LIGHT CANDLE BRIGHT FOUR LEAF CLOVER ; FROM THE NIGHT WITHOUT THE LOT YOUR CHANCE IS SLIGHT" 45163 DEFM 34,187," LIGHT",14 45172 DEFM 187," BRIGHT",14 45181 DEFM "FOUR LEAF CLOVER",14 45198 DEFM "FROM ",111,"NIGHT",14 45210 DEFM "WITHOUT ",111,"LOT",14 45223 DEFM 186," CHANCE ",192,14 45234 DEFM "SLIGHT",34 45241 DEFM 0 45242 DEFM 5 ; Height = 5 45243 DEFM 111,137," ",185,14 ; THE BANSHEE SAYS "I THINK YOU HAVE HAD ENOUGH HELP FROM ME." 45248 DEFM 34,"I THINK ",105,"HAVE",14 45263 DEFM "HAD ENOUGH ",128,"FROM",14 45280 DEFM "ME.",34 45284 DEFM 0 ; Text Relating to "Pick Up" Command b45285 DEFM 92,105,"ARE NOW CARRYING",94 ; YOU ARE NOW CARRYING 45304 DEFM 0 45305 DEFM 92,"PICK UP " ; PICK UP 45314 DEFM 0 45315 DEFM 3 ; Height = 3 45316 DEFM 142,192,140,14 ; THERE IS NOTHING IN THIS ROOM 45320 DEFM "IN ",139,178 45325 DEFM 0 45326 DEFM 3 ; Height = 3 45327 DEFM 142,192,140,14 ; THERE IS NOTHING NEAR ENOUGH 45331 DEFM "NEAR ENOUGH" 45342 DEFM 0 45343 DEFM 3 ; Height = 3 45344 DEFM 186," HANDS ARE",14 ; YOUR HANDS ARE FULL 45356 DEFM "FULL" 45360 DEFM 0 45361 DEFM 3 ; Height = 3 45362 DEFM "THAT ",103,192,14 ; THAT OBJECT IS TOO HEAVY 45370 DEFM "TOO HEAVY" 45379 DEFM 0 45380 DEFM 6 ; Height = 6 45381 DEFM 111,"LIQUID ",192,14 ; THE LIQUID IS STUCK TO THE FLOOR. (IT'S A VERY THICK LIQUID) 45391 DEFM "STUCK ",99,111,14 45400 DEFM 177,".",14 45403 DEFM "(IT'S ",97,"VERY",14 45415 DEFM "THICK LIQUID)" 45428 DEFM 0 ; Text Relating to "Drop" Command b45429 DEFM 92,"DROP ",112,103,"?",94 ; DROP WHICH OBJECT ? 45439 DEFM 0 45440 DEFM 92,"DROP " ; DROP 45446 DEFM 0 45447 DEFM 3 ; Height = 3 45448 DEFM 105,"ARE NOT",14 ; YOU ARE NOT CARRYING ANYTHING 45457 DEFM "CARRYING ANYTHING" 45474 DEFM 0 45475 DEFM 3 ; Height = 3 45476 DEFM 105,"CANNOT",14 ; YOU CANNOT DROP THAT OBJECT 45484 DEFM "DROP THAT ",103 45495 DEFM 0 45496 DEFM 16,6,105,"DROPPED ",111,149,14 ; YOU DROPPED THE BOTTLE TO THE GROUND AND NOW THERE IS A ; WAILING SOUND AN ANCIENT SPIRIT YOU WILL SEE FOR YOU HAVE ; RELEASED ...... BANSHEE 45510 DEFM 99,111,"GROUND",14 45519 DEFM 104,"NOW THERE ",192,"A",14 45533 DEFM "WAILING SOUND",14 45547 DEFM 14 45548 DEFM 98,"ANCIENT SPIRIT",14 45564 DEFM 105,"WILL SEE",14 45574 DEFM "FOR ",105,"HAVE RELEASED",14 45593 DEFM 46,46,46,46,46,46,16,4,18,128,32,137,32,18,0 45608 DEFM 0 ; Text Relating to "Take" Command b45609 DEFM 92,113,112,103,"?",94 ; TAKE WHICH OBJECT ? 45615 DEFM 0 45616 DEFM 92,113 ; TAKE 45618 DEFM 0 45619 DEFM 113,125,102 ; TAKE SOMETHING FROM 45622 DEFM 0 45623 DEFM " ",102,14 ; FROM 45626 DEFM 0 45627 DEFM 3 ; Height = 3 45628 DEFM 31,"'S",14 ; short name of Current Character}'S HANDS ARE EMPTY 45632 DEFM "HANDS ARE EMPTY" 45647 DEFM 0 45648 DEFM 3 ; Height = 3 45649 DEFM 31," WANTS",14 ; short name of Current Character} WANTS TO KEEP THAT 45657 DEFM 99,"KEEP THAT" 45667 DEFM 0 45668 DEFM 10 ; Height = 10 45669 DEFM 131," ",192,"ANGRY.",14 ; THOR IS ANGRY. A THUNDER STORM ERRUPTS FROM THE END OF HIS MIGHTY HAMMER ; MIOLNIR. "DIE MORTAL" CRIES THOR AND A BOLT OF LIGHTNING STRIKES YOU DEAD. ; [bug] 45679 DEFM 97,"THUNDER STORM",14 45694 DEFM "ERRUPTS FROM ",111,14 45709 DEFM "END OF H",192,"MIGHTY",14 45725 DEFM "HAMMER MIOLNIR.",14 45741 DEFM 34,"DIE MORTAL",34,14 45754 DEFM "CRIES ",131," ",104,"A",14 45765 DEFM "BOLT OF LIGHTNING",14 45783 DEFM "STRIKES ",105,"DEAD." 45797 DEFM 0 45798 DEFM 7 ; Height = 7 45799 DEFM 131," KILLED ",105 ; THOR KILLED YOU 45809 DEFM 0 ; Text Relating to "Give" Command b45810 DEFM 92,114,112,103,"?",94 ; GIVE WHICH OBJECT ? 45816 DEFM 0 45817 DEFM 92,114 ; GIVE 45819 DEFM 0 45820 DEFM 32,99,14 ; TO 45823 DEFM 0 45824 DEFM 3 ; Height = 3 45825 DEFM 31,"'S HANDS",14 ; short name of Current Character}'S HANDS ARE FULL 45835 DEFM "ARE FULL" 45843 DEFM 0 45844 DEFM 3 ; Height = 3 45845 DEFM 31," ",192,"NOT",14 ; short name of Current Character} IS NOT STRONG ENOUGH 45852 DEFM "STRONG ENOUGH" 45865 DEFM 0 45866 DEFM 3 ; Height = 3 45867 DEFM 31," DOES NOT",14 ; short name of Current Character} DOES NOT WANT THAT YET 45878 DEFM "WANT THAT ",170 45889 DEFM 0 ; Text Relating to "Examine" Command b45890 DEFM 92,107,112,103,"?",94 ; EXAMINE WHICH OBJECT ? 45896 DEFM 0 45897 DEFM 107 ; EXAMINE 45898 DEFM 0 45899 DEFM 107,"WHAT ?",14 ; EXAMINE WHAT ? O OBJECT C CHARACTER S YOURSELF 45907 DEFM 14 45908 DEFM "O",93,103,14 45912 DEFM "C",93,101,14 45916 DEFM "S",93,186,"SELF" 45923 DEFM 0 45924 DEFM 107,31,14 ; EXAMINE {short name of Current Character} STRENGTH 99 ; HAPPINESS 99 STAMINA 99 SPELL POWER 99 FOOD LEVEL ; 99 45927 DEFM 14 45928 DEFM 110,110,"STRENGTH",110,16,4," 99 ",16,0,14 45948 DEFM 110,110,"HAPPINESS ",16,4," 99 ",16,0,14 45970 DEFM 110,110,"STAMIN",97," ",16,4," 99 ",16,0,14 45991 DEFM 110,110,175," POWER",16,4," 99 ",16,0,14 46009 DEFM 110,110,"FOOD LEVEL ",16,4," 99 ",16,0,14 46031 DEFM 14 46032 DEFM 0 46033 DEFM 110,110,107,14 ; EXAMINE 46037 DEFM 0 46038 DEFM 14 ; WEIGHT 99# DROP STATUS . READ STATUS . MAGIC POWER ; 99 46039 DEFM 14 46040 DEFM 110,110,"WEIGHT",110," ",16,4," 99#",16,0,14 46060 DEFM 110,110,"DROP STATUS ",16,4,".",16,0,14 46080 DEFM 110,110,146,"STATUS ",16,4,".",16,0,14 46096 DEFM 110,110,194," POWER",16,4," 99 ",16,0,14 46114 DEFM 14 46115 DEFM 0 ; Characters' "Current Status" Texts b46116 DEFM 0 ; Unused 46117 DEFM "PROGRESS 000 %",14 ; PROGRESS 000 % TIME LEFT 48 HOURS 46132 DEFM 193," LEFT 48 HOURS" 46147 DEFM 0 46148 DEFM 130," ",192,"TRAPPED IN",14 ; GIMBAL IS TRAPPED IN A WHITE-OUT SOMEWHERE 46162 DEFM 97,"WHITE-OUT SOMEWHERE" 46182 DEFM 0 46183 DEFM 131," WANT'S HIS",14 ; THOR WANT'S HIS HAMMER BACK (bug) 46196 DEFM "HAMMER BACK" 46207 DEFM 0 46208 DEFM 132," LIKES SINGING",14 ; FLORIN LIKES SINGING (ABOUT GOLD MOSTLY) 46224 DEFM "(ABOUT GOLD MOSTLY)" 46243 DEFM 0 46244 DEFM 133," ",192,"LEARNING",14 ; ORIK IS LEARNING MAGIC BY POST 46256 DEFM 194," BY POST" 46265 DEFM 0 46266 DEFM 134," ",192,97,"LITTLE",14 ; SAMSUN IS A LITTLE BIT STUPID 46277 DEFM "BIT STUPID" 46287 DEFM 0 46288 DEFM 135," ",192,"VERY",14 ; ELRAND IS VERY MUSICAL 46296 DEFM "MUSICAL" 46303 DEFM 0 46304 DEFM 123," ",192,"VERY",14 ; LADY ROSMAR IS VERY CLEVER 46312 DEFM "CLEVER" 46318 DEFM 0 46319 DEFM 124," ",192,"QUIET",14 ; THE BANSHEE IS QUIET AT THE MOMENT 46328 DEFM "AT ",111,"MOMENT" 46338 DEFM 0 46339 DEFM 131," ",192,"READY ",99,14 ; THOR IS READY TO HELP YOU WHEN YOU ASK 46350 DEFM 128,105,"WHEN ",105,"ASK" 46361 DEFM 0 46362 DEFM 130," ",192,"READY ",99,14 ; GIMBAL IS READY TO CAST A RELEASE SPELL 46373 DEFM 174," ",97,"RELEASE ",175 46385 DEFM 0 46386 DEFM 31," ",192,"ASLEEP" ; short name of Current Character} IS ASLEEP 46395 DEFM 0 ; Miscellaneous Text (3) b46396 DEFM 186,"SELF" ; YOURSELF 46401 DEFM 0 ; Text Relating to "Command" Command b46402 DEFM 100," " ; COMMAND 46404 DEFM 0 46405 DEFM "WHICH ",100," DO YOU",14 ; WHICH COMMAND DO YOU WANT TO USE ? A GO TO SLEEP B WAKE UP C GO AWAY D ; HELP E EAT & DRINK F BE HAPPY 46420 DEFM "WANT ",99,"USE ?",14 46432 DEFM 14 46433 DEFM "A",93,"GO ",99,"SLEEP",14 46445 DEFM "B",93,"WAKE UP",14 46455 DEFM "C",93,"GO AWAY",14 46465 DEFM "D",93,128,14 46469 DEFM "E",93,"EAT & DRINK",14 46483 DEFM "F",93,"BE ",184 46489 DEFM 0 46490 DEFM "GO ",99,"SLEEP" ; GO TO SLEEP 46499 DEFM 0 46500 DEFM "WAKE UP" ; WAKE UP 46507 DEFM 0 46508 DEFM "GO AWAY" ; GO AWAY 46515 DEFM 0 46516 DEFM 128 ; HELP 46517 DEFM 0 46518 DEFM "EAT & DRINK" ; EAT & DRINK 46529 DEFM 0 46530 DEFM "BE ",184 ; BE HAPPY 46534 DEFM 0 46535 DEFM 4 ; Height = 4 46536 DEFM 31," DOES NOT",14 ; short name of Current Character} DOES NOT WANT TO BE COMMANDED BY YOU 46547 DEFM "WANT ",99,"BE",14 46556 DEFM 100,"ED BY YOU" 46566 DEFM 0 46567 DEFM 3 ; Height = 3 46568 DEFM 31," IS",14 ; short name of Current Character} IS ALREADY ASLEEP 46573 DEFM 188," ASLEEP" 46581 DEFM 0 46582 DEFM 4 ; Height = 4 46583 DEFM 31," IS",14 ; short name of Current Character} IS TOO WAKEFUL TO SLEEP 46588 DEFM "TOO WAKEFUL ",99,14 46602 DEFM "SLEEP" 46607 DEFM 0 46608 DEFM 3 ; Height = 3 46609 DEFM 31," HAS",14 ; short name of Current Character} HAS GONE TO SLEEP 46615 DEFM "GONE ",99,"SLEEP" 46626 DEFM 0 46627 DEFM 3 ; Height = 3 46628 DEFM 31," IS",14 ; short name of Current Character} IS ALREADY AWAKE 46633 DEFM 188," AWAKE" 46640 DEFM 0 46641 DEFM 4 ; Height = 4 46642 DEFM 31,167,14 ; short name of Current Character} IS TOO TIRED TO WAKE UP 46645 DEFM "WAKE UP" 46652 DEFM 0 46653 DEFM 3 ; Height = 3 46654 DEFM 31," HAS",14 ; short name of Current Character} HAS WOKEN UP 46660 DEFM "WOKEN UP" 46668 DEFM 0 46669 DEFM 4 ; Height = 4 46670 DEFM 31,167,14 ; short name of Current Character} IS TOO TIRED TO GO AWAY 46673 DEFM "GO AWAY" 46680 DEFM 0 46681 DEFM 3 ; Height = 3 46682 DEFM 31," HAS",14 ; short name of Current Character} HAS GONE AWAY 46688 DEFM "GONE AWAY" 46697 DEFM 0 46698 DEFM 3 ; Height = 3 46699 DEFM 31," CANNOT",14 ; short name of Current Character} CANNOT HELP YOU 46708 DEFM 128,105," " 46711 DEFM 0 46712 DEFM 4 ; Height = 4 46713 DEFM 31,167,14 ; short name of Current Character} IS TOO TIRED TO HELP YOU (bug - no end ; marker) 46716 DEFM 128,105 46718 DEFM 3 ; Height = 3 46719 DEFM 31," HAS",14 ; short name of Current Character} HAS NO FOOD LEFT 46725 DEFM "NO FOOD LEFT" 46737 DEFM 0 46738 DEFM 4 ; Height = 4 46739 DEFM 31,167,14 ; short name of Current Character} IS TOO TIRED TO EAT OR DRINK 46742 DEFM "EAT OR DRINK" 46754 DEFM 0 46755 DEFM 3 ; Height = 3 46756 DEFM 31," HAS",14 ; short name of Current Character} HAS TAKEN REFRESHMENT 46762 DEFM "TAKEN REFRESHMENT" 46779 DEFM 0 46780 DEFM 4 ; Height = 4 46781 DEFM 31,167,14 ; short name of Current Character} IS TOO TIRED TO BE HAPPY 46784 DEFM "BE ",184 46788 DEFM 0 46789 DEFM 3 ; Height = 3 46790 DEFM 31," WILL",14 ; short name of Current Character} WILL TRY TO BE HAPPY 46797 DEFM "TRY ",99,"BE ",184 46806 DEFM 0 ; Text Relating to "Locate" Command b46807 DEFM 116," " ; LOCATE 46809 DEFM 0 46810 DEFM 116,"D",14 ; LOCATED {short name of Current Character} 46813 DEFM 31 46814 DEFM 0 46815 DEFM " IN",14 ; IN THE LIFT 46819 DEFM 111,191 46821 DEFM 0 ; Initial Control Selection Menu Text b46822 DEFM 16,7,14 ; A KEYBOARD B KEMPSTON JOYSTICK C FULLER JOYSTICK D CURSOR ; JOYSTICK E ZX INTERFACE 2 JOYSTICK 1 F INSTRUCTIONS G PLAY GAME 46825 DEFM "A",93,109,"BOARD",14 46834 DEFM "B",93,"KEMPSTON",127,14 46846 DEFM "C",93,"FULLER",127,14 46856 DEFM "D",93,"CURSOR",127,14 46866 DEFM "E",93,"ZX INTERFACE 2",127,"1",14 46885 DEFM "F",93,95,"S",14 46890 DEFM "G",93,"PLAY ",106 46898 DEFM 0 ; Instructions Text b46899 DEFM 117,"HAS BEEN",14 ; GIMBAL THE WIZARD HAS BEEN MAKING A MESS OF HIS SPELLS ; AGAIN ! HE HAS MANAGED TO BIND YOU AND A NUMBER OF OTHER ; PEOPLE IN A SUMMON SPELL. YOU MUST RETURN EVERYBODY TO ; THEIR CORRECT TIME/SPACE ZONES BUT FIRST YOU HAVE TO ; RELEASE GIMBAL WHO HAS GOT HIMSELF TRAPPED IN A WHITE-OUT ; SPELL. 46909 DEFM "MAKING ",97,"MESS",150,"H",192,175,"S",14 46927 DEFM "AGAIN ! HE HAS MANAGED ",99,14 46952 DEFM "BIND ",105,104,97,"NUMBER",150,"OTHER",14 46973 DEFM "PEOPLE IN ",97,"SUMMON ",175,". ",105,14 46996 DEFM "MUST RETURN EVERYBODY ",99,143,14 47021 DEFM "CORRECT ",193,"/SPACE ZONES BUT",14 47047 DEFM "FIRST ",105,"HAVE ",99,"RELEASE",14 47068 DEFM 130," WHO HAS GOT HIMSELF",14 47090 DEFM "TRAPPED IN ",97,"WHITE-OUT ",175,"." 47114 DEFM 0 47115 DEFM " ",111,109,"S ARE :-",91 ; THE KEYS ARE :- N = LEFT M = RIGHT A = JUMP/UP Z = ; DOWN PRESS SPACE OR FIRE FOR MENU 47128 DEFM " N",96,"LEFT ",110,"M",96,"RIGHT",91 47146 DEFM " A",96,"JUMP/UP Z",96,"DOWN",91 47165 DEFM " ",110,"PRESS SPACE OR",91 47183 DEFM " ",110,"FIRE FOR MENU" 47199 DEFM 0 47200 DEFM " ",139,106,"FEATURES",14 ; THIS GAME FEATURES WINDIMATION STARRING YOU AS MAGIC KNIGHT ; WITH GIMBAL THE WIZARD THOR FLORIN THE DWARF ORIK THE ; CLERIC SAMSUN THE STRONG ELRAND HALFELVEN LADY ROSMAR THE ; BANSHEE 47212 DEFM 159," WINDIMATION",14 47226 DEFM 160,16,4,18,128,"STARRING",18,0,92,14 47243 DEFM 16,7,"YOU AS ",144,14 47254 DEFM 16,5,"WITH",14 47261 DEFM " ",117,14 47264 DEFM " ",118,14 47267 DEFM " ",119,14 47270 DEFM " ",120,14 47273 DEFM " ",121,14 47276 DEFM " ",122,14 47279 DEFM " ",123,14 47282 DEFM " ",124 47284 DEFM 0 47285 DEFM 95,"S" ; INSTRUCTIONS 47287 DEFM 0 ; Text Relating to "Read" Command b47288 DEFM 92,146,112,103,"?",94 ; READ WHICH OBJECT ? 47294 DEFM 0 47295 DEFM 92,146 ; READ 47297 DEFM 0 47298 DEFM 4 ; Height = 4 47299 DEFM 142,192,"NO",14 ; THERE IS NO WRITING FOR ME TO READ 47304 DEFM "WRITING FOR ME",14 47319 DEFM 99,146 47321 DEFM 0 ; List of Read-Texts of Readable Objects b47322 DEFM 11 ; Height = 11 47323 DEFM 168,"CRY......",14 ; name of Current Object} YE UNBINDE SPELL HOLD IN THY HAND A ; MOST MAGIC OBJECT YOU CAST THEE ONCE THY SPELL OF CRY...... THE ; REST OF THE SCROLL IS UNREADABLE ! 47334 DEFM 16,6,111,"REST OF ",111,"SCROLL",14 47353 DEFM 192,"UNREADABLE !" 47366 DEFM 0 47367 DEFM 9 ; Height = 9 47368 DEFM 92,29,14 ; name of Current Object} CASTING SPELLS TO CAST THE SPELL OF ; FUMATICUS PROTECTIUM YOU WILL REQUIRE TWO VERY SMELLY OBJECTS. 47371 DEFM 14 47372 DEFM 174,"ING ",175,"S",14 47380 DEFM 14 47381 DEFM 99,174," ",111,175," OF",14 47390 DEFM 176," YOU",14 47396 DEFM "WILL REQUIRE TWO VERY",14 47418 DEFM "SMELLY OBJECTS." 47433 DEFM 0 47434 DEFM 6 ; Height = 6 47435 DEFM 92,29,14 ; name of Current Object} THE RUNES CANNOT BE UNDERSTOOD WITHOUT ; THE BOOK TO EXPLAIN THEM 47438 DEFM 14 47439 DEFM 111,"RUNES CANNOT BE",14 47456 DEFM "UNDERSTOOD WITHOUT ",111,14 47477 DEFM 145," ",99,"EXPLAIN THEM" 47492 DEFM 0 47493 DEFM 10 ; Height = 10 47494 DEFM 92,29,14 ; name of Current Object} ALL THE RUNES THAT YOU WILL FIND WERE ; WRITTEN BY THE ANCIENT GIANTS OF GORFLAND. THEY ARE OF NO USE ; TO YOU SINCE MOST ARE SIMPLY COOKING RECIPIES [bug] 47497 DEFM 14 47498 DEFM "ALL ",111,"RUNES THAT YOU",14 47518 DEFM "WILL FIND WERE WRITTEN",14 47541 DEFM "BY ",111,"ANCIENT GIANTS",14 47560 DEFM "OF GORFLAND. THEY ARE",14 47582 DEFM "OF ",148," USE ",99,105,"SINCE",14 47599 DEFM "MOST ARE SIMPLY COOKING",14 47623 DEFM "RECIPIES" 47631 DEFM 0 47632 DEFM 5 ; Height = 5 47633 DEFM 92,29,14 ; name of Current Object} IT IS ENGRAVED. IT SAYS GOOD LUCK ON ; YOUR QUEST 47636 DEFM 14 47637 DEFM "IT ",192,"ENGRAVED. IT ",185,14 47656 DEFM "GOOD LUCK ON ",186," QUEST" 47676 DEFM 0 47677 DEFM 5 ; Height = 5 47678 DEFM 92,29,14 ; name of Current Object} THE WRITING IS FAR TOO SMALL TO READ 47681 DEFM 14 47682 DEFM 111,"WRITING ",192,"FAR TOO",14 47700 DEFM "SMALL ",99,146 47708 DEFM 0 47709 DEFM 8 ; Height = 8 47710 DEFM 92,29,14 ; name of Current Object} GAME CONCEPT AND PROGRAM BY DAVID ; JONES. WHY NOT GO OUT AND BUY MY LAST GAME CALLED FINDERS ; KEEPERS 47713 DEFM 14 47714 DEFM 16,7,106,"CONCEPT ",104,"PROGRAM",14 47734 DEFM "BY ",16,6,18,128,129,".",18,1,16,7,14 47748 DEFM "WHY NOT GO OUT ",104,"BUY",14 47768 DEFM "MY LAST ",106,"CALLED",14 47784 DEFM 16,6,18,128,"FINDERS KEEPERS",18,1 47805 DEFM 0 47806 DEFM 6 ; Height = 6 47807 DEFM 92,29,14 ; name of Current Object} THE LABEL READS "RESTORATIVE FLUID 100% ; PROOF" 47810 DEFM 14 47811 DEFM 111,"LABEL READS",14 47824 DEFM 34,"RESTORATIVE FLUID",14 47843 DEFM "100% PROOF",34 47854 DEFM 0 47855 DEFM 14 ; Height = 14 47856 DEFM 168,179,".",14 ; name of Current Object} YE UNBINDE SPELL HOLD IN THY HAND A ; MOST MAGIC OBJECT YOU CAST THEE ONCE THY SPELL OF CRYSTALLIUM ; SPECTRALIS. THROW EACH OF THE CRYSTALS AT GIMBAL. SOMEBODY MUST ; HOLD YE CRYSTAL BALL FOR THY SPELL TO SUCCEED. 47860 DEFM "THROW EACH OF ",111,14 47876 DEFM 138,"S AT ",130,".",14 47885 DEFM "SOMEBODY MUST HOLD",14 47904 DEFM "YE ",138," BALL FOR",14 47918 DEFM "THY ",175," ",99,"SUCCEED." 47933 DEFM 0 47934 DEFM 13 ; Height = 13 47935 DEFM 92,29,14 ; name of Current Object} LIGHT CANDLE WITH CARE USING AN ; APPROPRIATE MAGIC SPELL. DISCLAIMER THE MANUFACTURER WILL NOT ; BE HELD RESPONSIBLE FOR ANY LOSS HOWSOEVER CAUSED RESULTING ; FROM THE USE OR MISUSE OF THIS CANDLE 47938 DEFM 14 47939 DEFM "LIGHT ",187," WITH CARE",14 47957 DEFM "USING ",98,"APPROPRIATE",14 47976 DEFM 194," ",175,".",14 47981 DEFM 16,6,"DISCLAIMER",14 47994 DEFM 16,4,111,"MANUFACTURER WILL",14 48015 DEFM "NOT BE HELD RESPONSIBLE",14 48039 DEFM "FOR ",108,"LOSS HOWSOEVER",14 48059 DEFM "CAUSED RESULTING FROM",14 48081 DEFM 111,"USE OR MISUSE OF",14 48099 DEFM 139,187 48101 DEFM 0 48102 DEFM 14 ; Height = 14 48103 DEFM 92,29,14 ; name of Current Object} TANGY WALDATE TART 300 LEMONS 30 KG ; CASTOR SUGAR 15 KG SEMOLINA 68 KG SHORTCRUST PASTRY MIX 15 KG ; WALNUTS 30 KG DATES 30 KG MARGARINE 300 EGGS ICING SUGAR 48106 DEFM 14 48107 DEFM "TANGY WALDATE TART",14 48126 DEFM 16,6,"300 LEMONS",14 48139 DEFM "30 KG ",174,"OR SUGAR",14 48155 DEFM "15 KG SEMOLINA",14 48170 DEFM "68 KG SHORTCRUST PASTRY",14 48194 DEFM " MIX",14 48201 DEFM "15 KG WALNUTS",14 48215 DEFM "30 KG DATES",14 48227 DEFM "30 KG MARGARINE",14 48243 DEFM "300 EGGS",14 48252 DEFM "ICING SUGAR" 48263 DEFM 0 48264 DEFM 7 ; Height = 7 48265 DEFM 92,29,14 ; name of Current Object} THE CRYSTAL BALL IS TOO CLOUDY AND ; THERE ARE NO IMAGES THAT CAN BE READ AT THIS TIME 48268 DEFM 14 48269 DEFM 111,138," BALL ",192,"TOO",14 48282 DEFM "CLOUDY ",104,"THERE ARE NO",14 48303 DEFM "IMAGES THAT CAN BE ",146,14 48324 DEFM "AT ",139,193 48329 DEFM 0 48330 DEFM 6 ; Height = 6 48331 DEFM 92,29,14 ; name of Current Object} THE MIST CLEARS TO SHOW THOR HELPING ; YOU IN THE LIFT 48334 DEFM 14 48335 DEFM 111,"MIST CLEARS ",99,"SHOW",14 48354 DEFM 131," HELPING ",105,"IN ",111,14 48370 DEFM 191 48371 DEFM 0 48372 DEFM 9 ; Height = 9 48373 DEFM 92,29,14 ; name of Current Object} IN THE MIDST OF THE MIST YOU CAN SEE A ; TAROT CARD WHICH MEANS DEATH AND DESTRUCTION OR THE DEMOLISHING ; OF HOPES AND PRIDE 48376 DEFM 14 48377 DEFM "IN ",111,"MIDST OF ",111,"MIST",14 48396 DEFM 105,"CAN SEE ",97,"TAROT CARD",14 48417 DEFM "WHICH MEANS DEATH ",104,14 48437 DEFM "DESTRUCTION OR ",111,14 48454 DEFM "DEMOLISHING OF HOPES",14 48475 DEFM 104,"PRIDE" 48481 DEFM 0 48482 DEFM 9 ; Height = 9 48483 DEFM 92,29,14 ; name of Current Object} YOU CAN SEE A WALL COME CRASHING TO THE ; GROUND. THERE IS A NOISE AND AN IMAGE OF AN OLD RELIGIOUS BOOK ; WRITTEN IN HEBREW 48486 DEFM 14 48487 DEFM 105,"CAN SEE ",97,"WALL COME",14 48507 DEFM "CRASHING ",99,111,"GROUND.",14 48526 DEFM 142," ",192,97,"NOISE ",104,14 48538 DEFM 98,"IMAGE OF ",98,"OLD",14 48553 DEFM "RELIGIOUS ",145," WRITTEN",14 48573 DEFM "IN HEBREW" 48582 DEFM 0 48583 DEFM 7 ; Height = 7 48584 DEFM 92,29,14 ; name of Current Object} A SPIRIT APPEARS AND TELLS YOU THAT ; SAMSUN WILL BE OF USE IF YOU GIVE HIM THE JAVELIN 48587 DEFM 14 48588 DEFM 97,"SPIRIT APPEARS AND",14 48608 DEFM "TELLS ",105,"THAT ",134,14 48622 DEFM "WILL BE OF USE IF YOU",14 48644 DEFM "GIVE HIM ",111,"JAVELIN" 48661 DEFM 0 48662 DEFM 7 ; Height = 7 48663 DEFM 92,29,14 ; name of Current Object} THE LABEL SAYS :- 240 V AC 50 HZ ; MAXIMUM RATING 1 WATT. USE CORRECT FUSE 48666 DEFM 14 48667 DEFM 111,"LABEL ",185," :-",14 48679 DEFM "240 V AC 50 HZ MAXIMUM",14 48702 DEFM "RATING 1 WATT.",14 48717 DEFM "USE CORRECT FUSE" 48733 DEFM 0 48734 DEFM 15 ; Height = 15 48735 DEFM 92,29,14 ; name of Current Object} HERE ARE SOME CLUES TWO OF THE MOST ; USEFUL OBJECTS WILL START IN THE ROOF GARDEN A CERTAIN BOTTLE ; WILL BE USEFUL IF GIVEN TO FLORIN AND THEN TAKEN BACK (DUE TO ; FLORIN'S MAGICAL POWERS) NOW READ THE KEY 48738 DEFM 16,6,"HERE ARE SOME CLUES",16,5,14 48762 DEFM 14 48763 DEFM "TWO OF ",111,"MOST USEFUL",14 48783 DEFM "OBJECTS WILL START IN",14 48805 DEFM 171,14 48807 DEFM 14 48808 DEFM 97,"CERTAIN ",149," WILL BE",14 48827 DEFM "USEFUL IF GIVEN ",99,14 48845 DEFM 132," ",104,"THEN TAKEN",14 48859 DEFM "BACK (DUE ",99,132,"'S",14 48874 DEFM 194,"AL POWERS)",14 48886 DEFM 14 48887 DEFM 16,7,"NOW READ ",111,"KEY" 48902 DEFM 0 48903 DEFM 9 ; Height = 9 48904 DEFM 92,29,14 ; name of Current Object} THERE IS A LABEL FIXED TO THIS ; SAXAPHONE. IT READS "SID THE FISH WAS HERE". IT CERTAINLY ; DOESN'T SOUND LIKE A CLUE TO ME (bug) 48907 DEFM 14 48908 DEFM "THERE ",192,97,"LABEL FIXED",14 48928 DEFM 99,139,"SAXAPHONE.",14 48941 DEFM "IT READS ",34,"SID ",111,"FISH",14 48961 DEFM "WAS HERE",34,".",14 48972 DEFM "IT CERTAINLY DOESN'T",14 48993 DEFM "SOUND LIKE ",97,"CLUE ",99,"ME" 49013 DEFM 0 49014 DEFM 7 ; Height = 7 49015 DEFM 92,29,14 ; name of Current Object} THE TELEPORT PAD IS THE PROPERTY OF LAO ; TSE INC. ESTABLISHED 6000 BC. MADE IN CHINA. 49018 DEFM 14 49019 DEFM 111,"TELEPORT PAD ",192,111,14 49036 DEFM "PROPERTY OF LAO TSE INC.",14 49061 DEFM "ESTABLISHED 6000 BC.",14 49082 DEFM "MADE IN CHINA." 49096 DEFM 0 49097 DEFM 8 ; Height = 8 49098 DEFM 92,29,14 ; name of Current Object} THE LABEL READS "FIZZY POP LEMONADE ; WITH EXTRA ADDED RADIUM WILL MAKE YOU THE TALK OF ANY PARTY." 49101 DEFM 14 49102 DEFM 111,"LABEL READS ",34,"FIZZY",14 49122 DEFM "POP LEMONADE WITH EXTRA",14 49146 DEFM "ADDED RADIUM WILL MAKE",14 49169 DEFM 105,111,"TALK OF ANY",14 49183 DEFM "PARTY.",34 49190 DEFM 0 49191 DEFM 5 ; Height = 5 49192 DEFM 92,29,14 ; name of Current Object} THERE IS A YIN-YANG SYMBOL ON THIS KEY. 49195 DEFM 14 49196 DEFM "THERE ",192,97,"YIN-YANG",14 49213 DEFM "SYMBOL ON ",139,"KEY." 49228 DEFM 0 49229 DEFM 6 ; Height = 6 49230 DEFM 92,29,14 ; name of Current Object} THE PLANT SAYS "FEED ME SYMORE !" HOW ; STRANGE ! 49233 DEFM 14 49234 DEFM 111,"PLANT ",185,14 49243 DEFM 34,"FEED ME SYMORE !",34,14 49262 DEFM "HOW STRANGE !" 49275 DEFM 0 49276 DEFM 9 ; Height = 9 49277 DEFM 92,29,14 ; name of Current Object} MORE CLUES THE MAGIC TALISMAN CAN BE OF ; MUCH USE IF YOU CAN MEND IT. (OR GET SOMEBODY ELSE TO MEND IT) 49280 DEFM 16,6,"MORE CLUES",16,5,14 49295 DEFM 14 49296 DEFM 111,194," TALISMAN CAN",14 49312 DEFM "BE OF MUCH USE IF ",105,14 49332 DEFM "CAN MEND IT.",14 49345 DEFM "(OR GET SOMEBODY ELSE",14 49367 DEFM 99,"MEND IT)" 49376 DEFM 0 ; Text Relating to "Cast a Spell" Command b49377 DEFM 92,174," ",97,175 ; CAST A SPELL 49382 DEFM 0 49383 DEFM 11 ; Height = 11 49384 DEFM "WHICH ",175," DO ",105,"WANT",14 ; WHICH SPELL DO YOU WANT TO CAST ? A CRYSTALLIUM SPECTRALIS B ; CANDELIUM ILLUMINATUS C ARMOURIS PHOTONICUS D FUMATICUS PROTECTIUM ; E PROJECT PHYSICAL BODY F RELEASE SPELL G QUITICUS GAMUS 49401 DEFM 99,174," ?",14 49406 DEFM 14 49407 DEFM "A",93,179,14 49411 DEFM "B",93,180,14 49415 DEFM "C",93,181,14 49419 DEFM "D",93,176,14 49423 DEFM "E",93,182,14 49427 DEFM "F",93,183,14 49431 DEFM "G",93,173 49434 DEFM 0 49435 DEFM 6 ; Height = 6 49436 DEFM "THAT ",175," CANNOT ",170,14 ; THAT SPELL CANNOT YET BE CAST. SOMETHING HAS NOT BEEN DONE OR MAYBE ; THE TIME IS NOT YET SUITABLE 49452 DEFM "BE ",174,". ",125,"HAS",14 49463 DEFM "NOT BEEN DONE OR MAYBE",14 49486 DEFM 111,193," ",192,"NOT ",170,14 49496 DEFM "SUITABLE" 49504 DEFM 0 49505 DEFM 6 ; Height = 6 49506 DEFM "BOOOOOMMM !!",14 ; BOOOOOMMM !! THE CANDLE BLEW UP IN YOUR FACE. SOME PROTECTION WOULD ; HAVE BEEN USEFUL. 49519 DEFM 111,187," BLEW UP IN",14 49533 DEFM 186," FACE.",14 49541 DEFM "SOME PROTECTION WOULD",14 49563 DEFM "HAVE BEEN USEFUL." 49580 DEFM 0 49581 DEFM 3 ; Height = 3 49582 DEFM 111,175," HAS WORKED !",14 ; THE SPELL HAS WORKED ! GIMBAL IS NEARLY FREE 49598 DEFM 130," ",192,"NEARLY FREE" 49612 DEFM 0 49613 DEFM 3 ; Height = 3 49614 DEFM "SUCCESS !",14 ; SUCCESS ! GIMBAL IS FREE AT LAST 49624 DEFM 130," ",192,"FREE AT LAST" 49639 DEFM 0 49640 DEFM 5 ; Height = 5 49641 DEFM "WELL DONE, ",111,187,14 ; WELL DONE, THE CANDLE IS NOW GLOWING WITH A COOL YELLOW LIGHT THAT ; HAS MAGIC POWER 49655 DEFM 192,"NOW GLOWING WITH",14 49673 DEFM 97,"COOL YELLOW LIGHT",14 49692 DEFM "THAT HAS ",194," POWER" 49708 DEFM 0 49709 DEFM 10 ; Height = 10 49710 DEFM 111,"LIQUID TURNED ",99,14 ; THE LIQUID TURNED TO A VAPOUR AND FORMED A CLOUD AROUND YOU, THEN IT ; STARTED TO GLOW. ALL OF A SUDDEN THE CLOUD DISAPPEARED AND YOU FOUND ; YOUR ARMOUR GLOWING BRILLIANTLY. (COULD BE USEFUL !) 49727 DEFM 97,"VAPOUR ",104,"FORMED ",97,14 49745 DEFM "CLOUD AROUND YOU, THEN",14 49768 DEFM "IT STARTED ",99,"GLOW.",14 49786 DEFM "ALL OF ",97,"SUDDEN ",111,14 49803 DEFM "CLOUD DISAPPEARED ",104,14 49823 DEFM 105,"FOUND ",186," ARMOUR",14 49839 DEFM "GLOWING BRILLIANTLY.",14 49860 DEFM "(COULD BE USEFUL !)" 49879 DEFM 0 49880 DEFM 9 ; Height = 9 49881 DEFM 111,"FUMES FROM ",111,14 ; THE FUMES FROM THE PLANT & FISH MINGLE UNDER THE INFLUENCE OF THE ; SPELL TO GIVE YOU A NASTY HEADACHE. IF THE SPELL WORKED YOU SHOULD ; BE IMMUNE FROM GAS NOW 49895 DEFM "PLANT & FISH MINGLE",14 49915 DEFM "UNDER ",111,"INFLUENCE",14 49932 DEFM "OF ",111,175," ",99,"GIVE",14 49944 DEFM 105,97,"NASTY HEADACHE.",14 49962 DEFM "IF ",111,175," WORKED",14 49975 DEFM 105,"SHOULD BE",14 49986 DEFM "IMMUNE FROM GAS NOW" 50005 DEFM 0 50006 DEFM 6 ; Height = 6 50007 DEFM 186," SPIRT FLOWS",14 ; YOUR SPIRT FLOWS THROUGH THE GATES OF MAGICAL-SPACE-TIME AND THE ; SPELL CARRIES YOUR BODY ALONG (bug) 50021 DEFM "THROUGH ",111,"GATES OF",14 50039 DEFM 194,"AL-SPACE-",193,14 50051 DEFM 104,111,175," CARRIES",14 50063 DEFM 186," BODY ALONG" 50075 DEFM 0 50076 DEFM 3 ; Height = 3 50077 DEFM 130," ",192,188,14 ; GIMBAL IS ALREADY FREE 50082 DEFM "FREE" 50086 DEFM 0 50087 DEFM 3 ; Height = 3 50088 DEFM 111,187," ",192,14 ; THE CANDLE IS ALREADY ALIGHT 50093 DEFM 188," ALIGHT" 50101 DEFM 0 50102 DEFM 3 ; Height = 3 50103 DEFM 186," ARMOUR ",192,14 ; YOUR ARMOUR IS GLOWING ALREADY 50114 DEFM "GLOWING ",188 50123 DEFM 0 50124 DEFM 4 ; Height = 4 50125 DEFM 105,"HAVE ALL ",111,14 ; YOU HAVE ALL THE PROTECTION YOU NEED AGAINST GAS ALREADY 50137 DEFM "PROTECTION ",105,"NEED",14 50154 DEFM "AGAINST GAS ",188 50167 DEFM 0 50168 DEFM 7 ; Height = 7 50169 DEFM 105,"BLEW ",186,"SELF UP" ; YOU BLEW YOURSELF UP 50183 DEFM 0 ; Miscellaneous Text (4) b50184 DEFM 174," ",179,0 ; CAST CRYSTALLIUM SPECTRALIS 50188 DEFM 174," ",180,0 ; CAST CANDELIUM ILLUMINATUS 50192 DEFM 174," ",181,0 ; CAST ARMOURIS PHOTONICUS 50196 DEFM 174," ",176,0 ; CAST FUMATICUS PROTECTIUM 50200 DEFM 182," ",99,14,0 ; PROJECT PHYSICAL BODY TO 50205 DEFM 174," ",183,0 ; CAST RELEASE SPELL 50209 DEFB 174," ",173,0 ; CAST QUITICUS GAMUS 50213 DEFM 8 ; Height = 8 50214 DEFM 130," WILL NOW SEND EACH",14 ; GIMBAL WILL NOW SEND EACH CHARACTER BACK TO THEIR HOMES AS YOU ; SUMMON THEM. THE ORDER IS VERY IMPORTANT BUT GIMBAL THINKS YOU ; SHOULD HAVE THE PICTURE BY NOW. 50235 DEFM "CHARACTER BACK ",99,"THEIR",14 50257 DEFM "HOMES AS ",105,"SUMMON THEM.",14 50280 DEFM 111,"ORDER ",192,"VERY",14 50293 DEFM "IMPORTANT BUT ",130,14 50309 DEFM "THINKS ",105,"SHOULD HAVE",14 50329 DEFM 111,"PICTURE BY NOW." 50345 DEFM 0 ; Text Relating to "Teleport" Command b50346 DEFM 126 ; TELEPORT 50347 DEFM 0 50348 DEFM 4 ; Height = 4 50349 DEFM "IT ",192,"NOT SAFE",14 ; IT IS NOT SAFE TO TELEPORT TRY AGAIN LATER 50362 DEFM 99,126,14 50365 DEFM "TRY AGAIN LATER" 50380 DEFM 0 ; Text Relating to "Throw" Command b50381 DEFM 92,141,112,103,"?",94 ; THROW WHICH OBJECT ? 50387 DEFM 0 50388 DEFM 92,141 ; THROW 50390 DEFM 0 50391 DEFM " AT",14 ; AT 50395 DEFM 0 50396 DEFM 7 ; Height = 7 50397 DEFM 105,"HEAR ",97,"SHORT RANGE",14 ; YOU HEAR A SHORT RANGE TELEPATHIC WHISPER FROM GIMBAL. "KEEP THE ; CRYSTAL FOR LATER - IT IS OF NO USE HERE YET" 50416 DEFM "TELEPATHIC WHISPER",14 50435 DEFM "FROM ",130,".",14 50443 DEFM 34,"KEEP ",111,138," FOR",14 50456 DEFM "LATER - IT ",192,"OF NO",14 50474 DEFM "USE HERE ",170,34 50485 DEFM 0 50486 DEFM 9 ; Height = 9 50487 DEFM 111,"BLUE ",138," FLEW",14 ; THE BLUE CRYSTAL FLEW AT GIMBAL AND BURST INTO A SPARKLING POWDER ON ; CONTACT. THE BLUE PORTION OF THE WHITE-OUT AURA SURROUNDING GIMBAL IS ; DESTROYED 50500 DEFM "AT ",130," ",104,"BURST",14 50512 DEFM "INTO ",97,"SPARKLING",14 50528 DEFM "POWDER ON CONTACT.",14 50547 DEFM 111,"BLUE PORTION OF",14 50564 DEFM 111,"WHITE-OUT AURA",14 50580 DEFM "SURROUNDING ",130,14 50594 DEFM 192,"DESTROYED" 50604 DEFM 0 50605 DEFM 11 ; Height = 11 50606 DEFM 111,"RED ",138," FLEW",14 ; THE RED CRYSTAL FLEW STRAIGHT AT GIMBAL AND TURNED INTO A GAS ; SURROUNDING HIM. THE STENCH WAS ALMOST UNBEARABLE BUT NOW THE RED ; ELEMENT OF THE WHITE-OUT SPELL TRAPPING GIMBAL IS REMOVED 50618 DEFM "STRAIGHT AT ",130," AND",14 50636 DEFM "TURNED INTO ",97,"GAS",14 50653 DEFM "SURROUNDING HIM.",14 50670 DEFM 111,"STENCH WAS ALMOST",14 50689 DEFM "UNBEARABLE BUT NOW THE",14 50712 DEFM "RED ELEMENT OF ",111,14 50729 DEFM "WHITE-OUT ",175,14 50741 DEFM "TRAPPING ",130," IS",14 50755 DEFM "REMOVED" 50762 DEFM 0 50763 DEFM 8 ; Height = 8 50764 DEFM 111,"GREEN ",138," FLEW",14 ; THE GREEN CRYSTAL FLEW AT GIMBAL AND SUCKED UP ALL OF THE GREEN PARTS ; OF THE WHITE- OUT SPELL BEFORE IT BURNED UP IN A BRIGHT FLARE. 50778 DEFM "AT ",130," ",104,"SUCKED",14 50791 DEFM "UP ALL OF ",111,"GREEN",14 50808 DEFM "PARTS OF ",111,"WHITE-",14 50825 DEFM "OUT ",175," BEFORE IT",14 50841 DEFM "BURNED UP IN ",97,"BRIGHT",14 50862 DEFM "FLARE." 50868 DEFM 0 50869 DEFM 4 ; Height = 4 50870 DEFM 111,29,14 ; THE {name of Current Object} LANDED ON THE FLOOR BY {short name of ; Current Character} 50873 DEFM "LANDED ON ",111,177,14 50886 DEFM "BY ",31 50890 DEFM 0 ; Text Relating to "Blow" Command b50891 DEFM 92,"BLOW ",112,103,"?",94 ; BLOW WHICH OBJECT ? 50901 DEFM 0 50902 DEFM 92,"BLOW " ; BLOW 50908 DEFM 0 50909 DEFM 115 ; SUMMON 50910 DEFM 0 50911 DEFM 5 ; Height = 5 50912 DEFM "WHAT ",97,"RACKET!",14 ; WHAT A RACKET! APART FROM THE NOISE, NOTHING HAPPENED 50926 DEFM "APART FROM THE",14 50941 DEFM "NOISE, NOTHING",14 50956 DEFM "HAPPENED" 50964 DEFM 0 50965 DEFM 3 ; Height = 3 50966 DEFM 30,14 ; full name of Current Character} IS ASLEEP 50968 DEFM 192,"ASLEEP" 50975 DEFM 0 50976 DEFM 4 ; Height = 4 50977 DEFM 30,14 ; full name of Current Character} DOES NOT WANT TO BE SUMMONED 50979 DEFM "DOES NOT WANT ",99,"BE",14 50997 DEFM "SUMMONED" 51005 DEFM 0 51006 DEFM 4 ; Height = 4 51007 DEFM 30,14 ; full name of Current Character} IS TOO TIRED TO BE SUMMONED 51009 DEFM 192,"TOO TIRED ",99,"BE",14 51024 DEFM "SUMMONED" 51032 DEFM 0 51033 DEFM 3 ; Height = 3 51034 DEFM 30,14 ; full name of Current Character} IS ALREADY HERE! 51036 DEFM 192,188," HERE!" 51044 DEFM 0 51045 DEFM 5 ; Height = 5 51046 DEFM 30,14 ; full name of Current Character} DOES NOT WANT TO COME TO SUCH A CROWDED ; ROOM! 51048 DEFM "DOES NOT WANT ",99,"COME",14 51068 DEFM 99,"SUCH ",97,"CROWDED",14 51083 DEFM 178,"!" 51085 DEFM 0 51086 DEFM 5 ; Height = 5 51087 DEFM "WHAT ",97,"LOT OF",14 ; WHAT A LOT OF DUST. DOESN'T ANYBODY CLEAN THIS PLACE ? 51100 DEFM "DUST. DOESN'T",14 51114 DEFM "ANYBODY CLEAN",14 51128 DEFM 139," PLACE ?" 51137 DEFM 0 51138 DEFM 4 ; Height = 4 51139 DEFM 30,14 ; full name of Current Character} APPEARS IN A THICK PUFF OF SMOKE 51141 DEFM "APPEARS IN ",97,"THICK",14 51159 DEFM "PUFF OF SMOKE" 51172 DEFM 0 51173 DEFM 3 ; Height = 3 51174 DEFM 30,14 ; full name of Current Character} IS NO LONGER AROUND 51176 DEFM 192,"NO LONGER AROUND" 51193 DEFM 0 51194 DEFM 8 ; Height = 8 51195 DEFM 30,14 ; full name of Current Character} APPEARS IN SPIRIT FORM AS GIMBAL UTTERS ; THE SPELL OF FINAL RETURN. {full name of Current Character} HAS ARRIVED ; HOME 51197 DEFM "APPEARS IN SPIRIT",14 51215 DEFM "FORM AS ",130,14 51225 DEFM "UTTERS ",111,175," OF",14 51238 DEFM "FINAL RETURN.",14 51252 DEFM 30,14 51254 DEFM "HAS ARRIVED HOME" 51270 DEFM 0 ; Text Relating to "Call Lift" Command b51271 DEFM "CALL ",191 ; CALL LIFT 51277 DEFM 0 51278 DEFM 2 ; Height = 2 51279 DEFM " ",111,191," ",192,"HERE" ; THE LIFT IS HERE 51289 DEFM 0 ; Text Relating to "Move Lift" Command b51290 DEFM "MOVE ",191," ",99,111 ; MOVE LIFT TO THE 51299 DEFM 0 51300 DEFM "TAKE ",191," ",99,14 ; TAKE LIFT TO A ROOF B 4TH FLOOR C 3RD FLOOR D 2ND FLOOR E 1ST FLOOR ; F GROUND FLOOR G BASEMENT 51309 DEFM 14 51310 DEFM "A",93,151,14 51314 DEFM "B",93,152,14 51318 DEFM "C",93,153,14 51322 DEFM "D",93,154,14 51326 DEFM "E",93,155,14 51330 DEFM "F",93,156,14 51334 DEFM "G",93,157 51337 DEFM 0 51338 DEFM 2 ; Height = 2 51339 DEFM 111,191," HAS ARRIVED" ; THE LIFT HAS ARRIVED 51353 DEFM 0 51354 DEFM 151,0 ; ROOF 51356 DEFM 152,0 ; 4TH FLOOR 51358 DEFM 153,0 ; 3RD FLOOR 51360 DEFM 154,0 ; 2ND FLOOR 51362 DEFM 155,0 ; 1ST FLOOR 51364 DEFM 156,0 ; GROUND FLOOR 51366 DEFM 157,0 ; BASEMENT 51368 DEFM 7 ; Height = 7 51369 DEFM 111,191," ",192,"BROKEN",14 ; THE LIFT IS BROKEN AND CANNOT BE MOVED TO THAT FLOOR YET. A GOOD BASH IN ; THE CONTROL BOX WILL PROBABLY FIX IT 51380 DEFM 104,"CANNOT BE MOVED",14 51397 DEFM 99,"THAT ",177," ",170,".",14 51408 DEFM 97,"GOOD BASH IN ",111,14 51424 DEFM "CONTROL BOX WILL",14 51441 DEFM "PROBABLY FIX IT" 51456 DEFM 0 ; More "Game Over" Texts b51457 DEFM "SOMEBODY SWITCHED OUT",14 ; 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 51479 DEFM 111,"LIGHT. ",105,"FALL",14 51493 DEFM 104,"INJURE ",186,"SELF",14 51507 DEFM "FATALLY ON ",186," ARMOUR",14 51527 DEFM 14 51528 DEFM "WHY NOT CARRY ",97,"TORCH",14 51549 DEFM "OR ",125,"SIMILAR",14 51561 DEFM "NEXT ",193," ?",14 51570 DEFM 14 51571 DEFM "HARD LUCK ",144 51582 DEFM 0 51583 DEFM "CHOKE... CHOKE.......",14 ; CHOKE... CHOKE....... THIS ROOM IS FULL OF DEADLY KNIGHTSHADE GAS ; WHICH IS FATAL TO ALL WHO ATTEMPT TO LEARN AND MASTER THE SECRETS OF ; DEEP MAGIC. (THAT MEANS YOU !) 51605 DEFM 14 51606 DEFM 139,178," ",192,"FULL OF",14 51618 DEFM "DEADLY KNIGHTSHADE GAS",14 51641 DEFM "WHICH ",192,"FATAL ",99,"ALL",14 51659 DEFM "WHO ATTEMPT ",99,"LEARN",14 51678 DEFM 104,"MASTER ",111,"SECRETS",14 51695 DEFM "OF DEEP ",194,".",14 51706 DEFM 14 51707 DEFM "(THAT MEANS ",105,"!)" 51722 DEFM 0 51723 DEFM 10 ; Height = 10 51724 DEFM 105,"FELL INTO ",111,14 ; YOU FELL INTO THE PIT OF DESTRUCTION. MAYBE YOU NEED SOME HELP TO ; CROSS IT ? 51737 DEFM "PIT OF DESTRUCTION.",14 51757 DEFM "MAYBE ",105,"NEED SOME",14 51774 DEFM 128,99,"CROSS IT ?" 51786 DEFM 0 51787 DEFM 14 ; Height = 14 51788 DEFM 31," HAS STARVED",14 ; short name of Current Character} HAS STARVED TO DEATH. IT WAS YOUR ; JOB TO KEEP EVERYBODY ALIVE AND SEND THEM HOME SAFELY. NOT UP TO ; YOUR USUAL STANDARD MAGIC KNIGHT. 51802 DEFM 99,"DEATH.",14 51810 DEFM "IT WAS ",186," JOB ",99,14 51825 DEFM "KEEP EVERYBODY ALIVE",14 51846 DEFM 104,"SEND THEM HOME",14 51862 DEFM "SAFELY.",14 51870 DEFM "NOT UP ",99,186," USUAL",14 51886 DEFM "STANDARD ",144,"." 51897 DEFM 0 51898 DEFM 7 ; Height = 7 51899 DEFM 105,"RAN OUT OF ",193 ; YOU RAN OUT OF TIME 51912 DEFM 0 ; Room Layout Data Pointers b51913 DEFW 52013 ; (00) - The Lift 51915 DEFW 52052 ; (01) - Roof 1 (The Roof Garden) 51917 DEFW 52134 ; (02) - Roof 2 (The Roof Garden) 51919 DEFW 52166 ; (03) - Roof 3 (The Roof Garden) 51921 DEFW 52212 ; (04) - Roof 4 (The Roof Garden) 51923 DEFW 52273 ; (05) - Roof 5 (The Roof Garden) 51925 DEFW 52307 ; (06) - Roof 6 (The Roof Garden) 51927 DEFW 52339 ; (07) - Roof 7 (The Roof Garden) 51929 DEFW 52365 ; (08) - Roof 8 (The Roof Garden) 51931 DEFW 52423 ; (09) - 4th Floor 1 (The Tower) 51933 DEFW 52456 ; (10) - 4th Floor 2 (Beyond the Tower) 51935 DEFW 52535 ; (11) - 4th Floor 3 (Further Beyond the Tower) 51937 DEFW 52559 ; (12) - 4th Floor 4 (The Ballroom) 51939 DEFW 52597 ; (13) - 4th Floor 5 (The Tree of Karn) 51941 DEFW 52631 ; (14) - 4th Floor 6 (The Stalagmites) 51943 DEFW 52709 ; (15) - 4th Floor 7 (The Big Bottle) 51945 DEFW 52744 ; (16) - 4th Floor 8 51947 DEFW 52795 ; (17) - 3rd Floor 1 (The Library) 51949 DEFW 52869 ; (18) - 3rd Floor 2 (The Little Bottle) 51951 DEFW 52559 ; (19) - 3rd Floor 3 (The Odd-Ball) 51953 DEFW 52904 ; (20) - 3rd Floor 4 (Florin's room) 51955 DEFW 52927 ; (21) - 3rd Floor 5 (The Start Room) 51957 DEFW 52981 ; (22) - 3rd Floor 6 (The L-Shaped Room) 51959 DEFW 53027 ; (23) - 3rd Floor 7 (The Plant Room [Thor's room]) 51961 DEFW 53100 ; (24) - 3rd Floor 8 (More Plant Room) 51963 DEFW 53188 ; (25) - 2nd Floor 1 51965 DEFW 53215 ; (26) - 2nd Floor 2 51967 DEFW 53233 ; (27) - 2nd Floor 3 51969 DEFW 53261 ; (28) - 2nd Floor 4 51971 DEFW 53289 ; (29) - 2nd Floor 5 (The Wall) (Originally #R53289, changed to #R53317 when Elrand blows the ; Trumpet at the Wall) 51973 DEFW 53356 ; (30) - 2nd Floor 6 (The Gallery) 51975 DEFW 53377 ; (31) - 2nd Floor 7 (The Gallery) 51977 DEFW 53398 ; (32) - 2nd Floor 8 (The Gallery) 51979 DEFW 53439 ; (33) - 1st Floor 1 (The Mush Room) 51981 DEFW 53537 ; (34) - 1st Floor 2 (The Gas Room) 51983 DEFW 53555 ; (35) - 1st Floor 3 51985 DEFW 52535 ; (36) - 1st Floor 4 51987 DEFW 52559 ; (37) - 1st Floor 5 (The Spare Ballroom) 51989 DEFW 52709 ; (38) - 1st Floor 6 51991 DEFW 52927 ; (39) - 1st Floor 7 (The Trophy Room) 51993 DEFW 52744 ; (40) - 1st Floor 8 51995 DEFW 53188 ; (41) - Ground Floor 1 51997 DEFW 53579 ; (42) - Ground Floor 2 (Secret Tunnel Entrance) 51999 DEFW 52795 ; (43) - Ground Floor 3 (Gimbal's Secret Study) 52001 DEFW 53649 ; (44) - Ground Floor 4 (The Secret Tunnel) 52003 DEFW 53688 ; (45) - Ground Floor 5 (More Secret Tunnel) 52005 DEFW 53703 ; (46) - Ground Floor 6 (The Pit) 52007 DEFW 53769 ; (47) - Ground Floor 7 52009 DEFW 53811 ; (48) - Ground Floor 8 (The Most Magic Room) 52011 DEFW 53883 ; (49) - The Basement ; Room Layout Data The Lift b52013 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52014 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52017 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52019 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52020 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52023 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52024 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to 0, 0 (top-left of screen) 52027 DEFB 9,19,7 ; Draw left wall (9 blocks, architecture style 19, attribute 7) 52030 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to 30, 0 (top-right of screen) 52033 DEFB 7,19,7 ; Draw right wall (7 blocks, architecture style 19, attribute 7) 52036 DEFB 236,2,5 ; Draw right-facing wall-candle at coordinates (2, 5) 52039 DEFB 237,29,5 ; Draw left-facing wall-candle at coordinates (29, 5) 52042 DEFB 251,10,4,69,64,77 ; Draw Lift Control Panel (77) at (10, 4) with attribute of 69, preserve attribute 52048 DEFB 238,10,4 ; Set attributes, including glow, on Lift control panel 52051 DEFB 0 ; End of room data ; Room Layout Data Roof 1 (The Roof Garden) b52052 DEFB 144,0 ; Draw 144 2x blocks of nothing 52054 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52055 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52058 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52059 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to 0, 0 (top-left of screen) 52062 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 52065 DEFB 251,10,8,68,64,48 ; Draw Tree Top (2) at (10, 8) with attribute of 68, preserve attribute 52071 DEFB 251,10,13,69,64,47 ; Draw Tree Trunk (2) at (10, 13) with attribute of 69, preserve attribute 52077 DEFB 251,6,15,68,64,52 ; Draw Plant (5) at ( 6, 15) with attribute of 68, preserve attribute 52083 DEFB 251,25,15,68,64,52 ; Draw Plant (5) at (25, 15) with attribute of 68, preserve attribute 52089 DEFB 251,26,13,68,64,50 ; Draw Plant (3) at (26, 13) with attribute of 68, preserve attribute 52095 DEFB 251,27,15,68,64,52 ; Draw Plant (5) at (27, 15) with attribute of 68, preserve attribute 52101 DEFB 251,10,16,69,64,78 ; Draw Mushroom (1) at (10, 16) with attribute of 69, preserve attribute 52107 DEFB 251,16,16,69,64,79 ; Draw Mushroom (2) at (16, 16) with attribute of 69, preserve attribute 52113 DEFB 245 ; Begin attribute painting block 52114 DEFB 66,13,9 ; Paint attribute 66 at (13,9) 52117 DEFB 66,10,13 ; Paint attribute 66 at (10,13) 52120 DEFB 66,16,12 ; Paint attribute 66 at (16,12) 52123 DEFB 66,14,11 ; Paint attribute 66 at (14,11) 52126 DEFB 67,26,13 ; Paint attribute 67 at (26,13) 52129 DEFB 2,27,13 ; Paint attribute 2 at (27,13) 52132 DEFB 245 ; End attribute painting block 52133 DEFB 0 ; End of room data ; Room Layout Data Roof 2 (The Roof Garden) b52134 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52136 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52137 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52140 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52141 DEFB 251,4,8,4,64,49 ; Draw Tree Top (3) at ( 4, 8) with attribute of 4, preserve attribute 52147 DEFB 251,4,13,69,64,47 ; Draw Tree Trunk (2) at ( 4,13) with attribute of 69, preserve attribute 52153 DEFB 251,19,8,4,64,49 ; Draw Tree Top (3) at (19, 8) with attribute of 4, preserve attribute 52159 DEFB 251,21,13,69,64,85 ; Draw Tree Trunk (1) at (21,13) with attribute of 69, preserve attribute 52165 DEFB 0 ; End of room data ; Room Layout Data Roof 3 (The Roof Garden) b52166 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52168 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52169 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52172 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52173 DEFB 251,16,13,68,64,50 ; Draw Plant (3) at (16,13) with attribute of 68, preserve attribute 52179 DEFB 251,10,15,68,64,51 ; Draw Plant (4) at (10,15) with attribute of 68, preserve attribute 52185 DEFB 251,11,15,68,64,52 ; Draw Plant (5) at (11,15) with attribute of 68, preserve attribute 52191 DEFB 251,26,15,68,64,52 ; Draw Plant (5) at (26,15) with attribute of 68, preserve attribute 52197 DEFB 251,20,15,68,64,53 ; Draw Plant (6) at (20,15) with attribute of 68, preserve attribute 52203 DEFB 245 ; Begin attribute painting block 52204 DEFB 70,16,13 ; Paint attribute 70 at (16,13) 52207 DEFB 70,17,13 ; Paint attribute 70 at (17,13) 52210 DEFB 245 ; End attribute painting block 52211 DEFB 0 ; End of room data ; Room Layout Data Roof 4 (The Roof Garden) b52212 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52214 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52215 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52218 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52219 DEFB 251,10,15,68,64,53 ; Draw Plant (6) at (10,15) with attribute of 68, preserve attribute 52225 DEFB 251,18,13,68,64,50 ; Draw Plant (3) at (18,13) with attribute of 68, preserve attribute 52231 DEFB 251,20,13,68,64,50 ; Draw Plant (3) at (20,13) with attribute of 68, preserve attribute 52237 DEFB 251,22,13,68,64,50 ; Draw Plant (3) at (22,13) with attribute of 68, preserve attribute 52243 DEFB 251,23,13,68,64,50 ; Draw Plant (3) at (23,13) with attribute of 68, preserve attribute 52249 DEFB 245 ; Begin attribute painting block 52250 DEFB 66,18,13 ; Paint attribute 66 at (18,13) 52253 DEFB 67,19,13 ; Paint attribute 67 at (19,13) 52256 DEFB 67,20,13 ; Paint attribute 67 at (20,13) 52259 DEFB 66,21,13 ; Paint attribute 66 at (21,13) 52262 DEFB 69,22,13 ; Paint attribute 69 at (22,13) 52265 DEFB 67,23,13 ; Paint attribute 67 at (23,13) 52268 DEFB 66,24,13 ; Paint attribute 66 at (24,13) 52271 DEFB 245 ; End attribute painting block 52272 DEFB 0 ; End of room data ; Room Layout Data Roof 5 (The Roof Garden) b52273 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52275 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52276 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52279 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52280 DEFB 251,10,13,68,64,50 ; Draw Plant (3) at (10,13) with attribute of 68, preserve attribute 52286 DEFB 251,15,15,68,64,51 ; Draw Plant (4) at (15,15) with attribute of 68, preserve attribute 52292 DEFB 251,20,15,68,64,52 ; Draw Plant (5) at (20,15) with attribute of 68, preserve attribute 52298 DEFB 245 ; Begin attribute painting block 52299 DEFB 71,10,13 ; Paint attribute 71 at (10,13) 52302 DEFB 71,11,13 ; Paint attribute 71 at (11,13) 52305 DEFB 245 ; End attribute painting block 52306 DEFB 0 ; End of room data ; Room Layout Data Roof 6 (The Roof Garden) b52307 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52309 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52310 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52313 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52314 DEFB 251,14,15,68,64,52 ; Draw Plant (5) at (14,15) with attribute of 68, preserve attribute 52320 DEFB 251,18,15,68,64,52 ; Draw Plant (5) at (18,15) with attribute of 68, preserve attribute 52326 DEFB 251,2,16,70,64,78 ; Draw Mushroom (1) at ( 2,16) with attribute of 70, preserve attribute 52332 DEFB 251,5,16,71,64,79 ; Draw Mushroom (2) at ( 5,16) with attribute of 71, preserve attribute 52338 DEFB 0 ; End of room data ; Room Layout Data Roof 7 (The Roof Garden) b52339 DEFB 144,0 ; Draw 144 2-by-2 blocks of nothing 52341 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52342 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52345 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52346 DEFB 251,8,16,70,64,80 ; Draw Mushroom (3) at ( 8,16) with attribute of 70, preserve attribute 52352 DEFB 251,11,16,71,64,81 ; Draw Mushroom (4) at (11,16) with attribute of 71, preserve attribute 52358 DEFB 251,14,15,70,64,82 ; Draw Large Mushroom at (14,15) with attribute of 70, preserve attribute 52364 DEFB 0 ; End of room data ; Room Layout Data Roof 8 (The Roof Garden) b52365 DEFB 144,0 ; Draw 128 2-by-2 blocks of nothing 52367 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52368 DEFB 16,3,68 ; Draw floor (16 blocks, architecture style 3, attribute 68) 52371 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52372 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to 30, 0 52375 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) 52378 DEFB 251,20,8,68,64,48 ; Draw Tree Top (2) at (20, 8) with attribute of 68, preserve attribute 52384 DEFB 251,20,13,69,64,47 ; Draw Tree Trunk (2) at (20,13) with attribute of 69, preserve attribute 52390 DEFB 251,3,9,69,64,84 ; Draw Tree Top (1) at ( 3, 9) with attribute of 69, preserve attribute 52396 DEFB 251,4,13,69,64,85 ; Draw Tree Trunk (1) at ( 4,13) with attribute of 69, preserve attribute 52402 DEFB 251,18,15,68,64,52 ; Draw Plant (5) at (18,15) with attribute of 68, preserve attribute 52408 DEFB 245 ; Begin attribute painting block 52409 DEFB 66,23,9 ; Paint attribute 66 at (23, 9) 52412 DEFB 66,20,13 ; Paint attribute 66 at (20,13) 52415 DEFB 66,26,12 ; Paint attribute 66 at (26,12) 52418 DEFB 66,24,11 ; Paint attribute 66 at (24,11) 52421 DEFB 245 ; End attribute painting block 52422 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 1 (The Tower) b52423 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52424 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52427 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52429 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52430 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52433 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52434 DEFB 250,14,8 ; Point bitmap and terrain interaction pointers to 14, 8 52437 DEFB 5,19,7 ; Draw The Tower (5 blocks, architecture style 19, attribute 7) 52440 DEFB 250,18,12 ; Point bitmap and terrain interaction pointers to 18, 12 52443 DEFB 1,19,7 ; Draw platform to right of Tower (1 block, architecture style 19, attribute 7) 52446 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to 0, 0 (top-left of screen) 52449 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 52452 DEFB 236,2,5 ; Draw right-facing wall-candle at coordinates (2, 5) 52455 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 2 (Beyond the Tower) b52456 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52457 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52460 DEFB 51,0 ; Draw 51 2-by-2 blocks of nothing 52462 DEFB 10,19,7 ; Draw plant shelf (10 blocks, architecture style 19, attribute 7) 52465 DEFB 67,0 ; Draw 67 2-by-2 blocks of nothing 52467 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52468 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52471 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 52474 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 52477 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52478 DEFB 251,7,3,68,64,51 ; Draw Plant (4) at ( 7, 3) with attribute of 68, preserve attribute 52484 DEFB 251,10,3,68,64,53 ; Draw Plant (6) at (10, 3) with attribute of 68, preserve attribute 52490 DEFB 251,19,1,68,64,50 ; Draw Plant (3) at (19, 1) with attribute of 68, preserve attribute 52496 DEFB 251,7,6,66,64,42 ; Draw Plant Pot (3) at ( 7, 6) with attribute of 66, preserve attribute 52502 DEFB 251,10,6,66,64,42 ; Draw Plant Pot (3) at (10, 6) with attribute of 66, preserve attribute 52508 DEFB 251,19,6,66,64,42 ; Draw Plant Pot (3) at (19, 6) with attribute of 66, preserve attribute 52514 DEFB 251,15,3,68,64,45 ; Draw Plant (7) at (15, 3) with attribute of 68, preserve attribute 52520 DEFB 251,15,6,69,64,42 ; Draw Plant Pot (3) at (15, 6) with attribute of 69, preserve attribute 52526 DEFB 245 ; Begin attribute painting block 52527 DEFB 69,19,1 ; Paint attribute 69 at (19, 1) 52530 DEFB 71,20,1 ; Paint attribute 71 at (20, 1) 52533 DEFB 245 ; End attribute painting block 52534 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 3 (Further Beyond the Tower) and 1st Floor 4 b52535 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52536 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52539 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52541 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52542 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52545 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 52548 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 52551 DEFB 239,5,6 ; Draw picture in frame (59748) at (5, 6) 52554 DEFB 240,18,6 ; Draw picture in frame (59748) and replace picture with alternative (60156) at 18, 6 52557 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52558 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 4 (The Ballroom) and 3rd Floor 3 (The Odd-Ball) b52559 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52560 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52563 DEFB 71,0 ; Draw 71 2-by-2 blocks of nothing 52565 DEFB 2,19,7 ; Draw top row of "pyramid" (2 blocks, architecture style 19, attribute 7) 52568 DEFB 13,0 ; Draw 13 2-by-2 blocks of nothing 52570 DEFB 4,19,7 ; Draw second row of "pyramid" (4 blocks, architecture style 19, attribute 7) 52573 DEFB 10,0 ; Draw 10 2-by-2 blocks of nothing 52575 DEFB 8,19,7 ; Draw third row of "pyramid" (8 blocks, architecture style 19, attribute 7) 52578 DEFB 6,0 ; Draw 6 2-by-2 blocks of nothing 52580 DEFB 12,19,7 ; Draw fourth row of "pyramid" (12 blocks, architecture style 19, attribute 7) 52583 DEFB 2,0 ; Draw 2 2-by-2 blocks of nothing 52585 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52586 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52589 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52590 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 52593 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 52596 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 5 (The Tree of Karn) b52597 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52598 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52601 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52603 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52604 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52607 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52608 DEFB 251,12,8,68,64,48 ; Draw Tree Top (2) at (12, 8) with attribute of 68, preserve attribute 52614 DEFB 251,12,13,69,64,47 ; Draw Tree Trunk (2) at (12,13) with attribute of 69, preserve attribute 52620 DEFB 244 ; Start painting glowing blocks 52621 DEFB 15,9 ; (15, 9) 52623 DEFB 12,13 ; (12,13) 52625 DEFB 18,12 ; (18,12) 52627 DEFB 16,11 ; (16,11) 52629 DEFB 244 ; Stop painting glowing blocks 52630 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 6 (The Stalagmites) b52631 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52632 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52635 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52637 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52638 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52641 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52642 DEFB 250,4,16 ; Point bitmap and terrain interaction pointers to 4, 16 52645 DEFB 1,19,7 ; Draw left column of left stalagmite (1 block, architecture style 19, attribute 7) 52648 DEFB 250,6,12 ; Point bitmap and terrain interaction pointers to 6, 12 52651 DEFB 3,19,7 ; Draw second column of left stalagmite (3 blocks, architecture style 19, attribute 7) 52654 DEFB 250,8,10 ; Point bitmap and terrain interaction pointers to 8, 10 52657 DEFB 4,19,7 ; Draw third column of left stalagmite (4 blocks, architecture style 19, attribute 7) 52660 DEFB 250,10,12 ; Point bitmap and terrain interaction pointers to 10, 12 52663 DEFB 3,19,7 ; Draw fourth column of left stalagmite (3 blocks, architecture style 19, attribute 7) 52666 DEFB 250,12,16 ; Point bitmap and terrain interaction pointers to 12, 16 52669 DEFB 1,19,7 ; Draw fifth column of left stalagmite (1 blocks, architecture style 19, attribute 7) 52672 DEFB 250,18,16 ; Point bitmap and terrain interaction pointers to 18, 16 52675 DEFB 1,19,7 ; Draw left column of right stalagmite (1 block, architecture style 19, attribute 7) 52678 DEFB 250,20,12 ; Point bitmap and terrain interaction pointers to 20, 12 52681 DEFB 3,19,7 ; Draw second column of right stalagmite (3 blocks, architecture style 19, attribute 7) 52684 DEFB 250,22,10 ; Point bitmap and terrain interaction pointers to 22, 10 52687 DEFB 4,19,7 ; Draw third column of right stalagmite (4 blocks, architecture style 19, attribute 7) 52690 DEFB 250,24,12 ; Point bitmap and terrain interaction pointers to 24, 12 52693 DEFB 3,19,7 ; Draw fourth column of right stalagmite (3 blocks, architecture style 19, attribute 7) 52696 DEFB 250,26,16 ; Point bitmap and terrain interaction pointers to 26, 16 52699 DEFB 1,19,7 ; Draw fifth column of right stalagmite (1 block, architecture style 19, attribute 7) 52702 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 52705 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 52708 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 7 (The Big Bottle) and 1st Floor 6 b52709 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52710 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52713 DEFB 118,0 ; Draw 118 2-by-2 blocks of nothing 52715 DEFB 4,19,7 ; Draw bottle's plinth (4 blocks, architecture style 19, attribute 7) 52718 DEFB 6,0 ; Draw 6 2-by-2 blocks of nothing 52720 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52721 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52724 DEFB 251,14,8,70,64,93 ; Draw Big Bottle Top at (14, 8) with attribute of 70, preserve attribute 52730 DEFB 251,14,12,70,64,94 ; Draw Big Bottle Body at (14,12) with attribute of 70, preserve attribute 52736 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) [bug] 52739 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) [bug] 52742 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52743 DEFB 0 ; End of room data ; Room Layout Data 4th Floor 8 and 1st Floor 8 b52744 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52745 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52748 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52750 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52751 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52754 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52755 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to (30, 0) 52758 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) 52761 DEFB 251,3,8,70,64,4 ; Draw Shield at ( 3, 8) with attribute of 70, preserve attribute 52767 DEFB 251,8,8,69,64,4 ; Draw Shield at ( 8, 8) with attribute of 69, preserve attribute 52773 DEFB 246,12,4 ; Draw wall axes at 12, 4 52776 DEFB 251,22,8,70,64,4 ; Draw Shield at (22, 8) with attribute of 70, preserve attribute 52782 DEFB 251,27,8,68,64,4 ; Draw Shield at (27, 8) with attribute of 68, preserve attribute 52788 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 52791 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 52794 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 1 (The Library) and Ground Floor 3 (Gimbal's Secret Study) b52795 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52796 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52799 DEFB 52,0 ; Draw 52 2-by-2 blocks of nothing 52801 DEFB 10,19,7 ; Draw book-shelf (10 blocks, architecture style 19, attribute 7) 52804 DEFB 66,0 ; Draw 66 2-by-2 blocks of nothing 52806 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52807 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52810 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of ; display 52811 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to (0, 0) (top-left of screen) 52814 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 52817 DEFB 236,2,5 ; Draw right-facing wall-candle at coordinates (2, 5) 52820 DEFB 251,12,6,68,64,97 ; Draw Books (1) at (12, 6) with attribute of 68, preserve attribute 52826 DEFB 251,17,5,69,64,98 ; Draw Books (2) at (17, 5) with attribute of 69, preserve attribute 52832 DEFB 251,22,6,67,64,101 ; Draw Right Bookend at (22, 6) with attribute of 67, preserve attribute 52838 DEFB 251,9,6,67,64,102 ; Draw Left Bookend at ( 9, 6) with attribute of 67, preserve attribute 52844 DEFB 251,16,15,66,64,99 ; Draw Books (3) at (16,15) with attribute of 66, preserve attribute 52850 DEFB 251,21,16,69,70,100 ; Draw Books (4) at (21,16) with attribute of 69, preserve attribute [bug - 70 is ; not a valid value] 52856 DEFB 251,26,16,67,64,101 ; Draw Right Bookend at (26,16) with attribute of 67, preserve attribute 52862 DEFB 251,13,16,67,64,102 ; Draw Left Bookend at (13,16) with attribute of 67, preserve attribute 52868 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 2 (The Little Bottle) b52869 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52870 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52873 DEFB 118,0 ; Draw 118 2-by-2 blocks of nothing 52875 DEFB 4,19,7 ; Draw bottle's plinth (4 blocks, architecture style 19, attribute 7) 52878 DEFB 6,0 ; Draw 6 2-by-2 blocks of nothing 52880 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52881 DEFB 16,19,86 ; Draw floor (16 blocks, architecture style 19, attribute 86) 52884 DEFB 251,14,10,70,64,95 ; Draw Little Bottle Top at (14,10) with attribute of 70, preserve attribute 52890 DEFB 251,14,12,70,64,94 ; Draw Little Bottle Body at (14,12) with attribute of 70, preserve attribute 52896 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) [bug] 52899 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) [bug] 52902 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52903 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 4 (Florin's room) b52904 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52905 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52908 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52910 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52911 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52914 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52915 DEFB 243,2,6,43,70 ; Draw framed picture at ( 2, 6) with contents of graphic lookup index 43 (Goblet) and ; attribute 70 52920 DEFB 247,14,1 ; Draw ceiling candles at coordinates (14, 1) 52923 DEFB 242,25,6 ; Draw picture in frame (59548) and replace picture with alternative (60108) at 25, 6 52926 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 5 (The Start Room) and 1st Floor 7 (The Trophy Room) b52927 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52928 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52931 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 52933 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52934 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52937 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52938 DEFB 251,2,8,70,64,4 ; Draw shield at ( 2, 8) with attribute of 70, preserve attribute, and graphic ; lookup index 4 (shield) 52944 DEFB 251,6,8,69,64,4 ; Draw shield at ( 6, 8) with attribute of 69, preserve attribute, and graphic ; lookup index 4 (shield) 52950 DEFB 251,10,8,71,64,4 ; Draw shield at (10, 8) with attribute of 71, preserve attribute, and graphic ; lookup index 4 (shield) 52956 DEFB 251,13,6,69,64,92 ; Draw stag head at (13, 6) with attribute of 69, preserve attribute, and graphic ; lookup index 92 (stag head) 52962 DEFB 251,20,8,69,64,4 ; Draw shield at (20, 8) with attribute of 69, preserve attribute, and graphic ; lookup index 4 (shield) 52968 DEFB 251,24,8,70,64,4 ; Draw shield at (24, 8) with attribute of 70, preserve attribute, and graphic ; lookup index 4 (shield) 52974 DEFB 251,28,8,68,64,4 ; Draw shield at (28, 8) with attribute of 68, preserve attribute, and graphic ; lookup index 4 (shield) 52980 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 6 (The L-Shaped Room) b52981 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 52982 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 52985 DEFB 56,0 ; Draw 56 2-by-2 blocks of nothing 52987 DEFB 8,19,7 ; Draw horizontal platform holding plant (8 blocks, architecture style 19, attribute ; 7) 52990 DEFB 64,0 ; Draw 64 2-by-2 blocks of nothing 52992 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 52993 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 52996 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 52997 DEFB 250,16,0 ; Point bitmap and terrain interaction pointers to (16, 0) (top-left of screen) 53000 DEFB 4,19,7 ; Draw wall at end of platform (4 blocks, architecture style 19, attribute 7) 53003 DEFB 246,4,4 ; Draw wall axes at 4, 4 53006 DEFB 251,26,1,68,64,50 ; Draw Plant (3) at (26, 1) with attribute of 68, preserve attribute 53012 DEFB 251,26,6,70,64,42 ; Draw Plant Pot (3) at (26, 6) with attribute of 70, preserve attribute 53018 DEFB 245 ; Begin attribute painting block 53019 DEFB 69,26,1 ; Paint attribute 69 at (26,1) 53022 DEFB 70,27,1 ; Paint attribute 70 at (27,1) 53025 DEFB 245 ; End attribute painting block 53026 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 7 (The Plant Room [Thor's room]) b53027 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53028 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53031 DEFB 48,0 ; Draw 48 2-by-2 blocks of nothing 53033 DEFB 16,19,7 ; Draw horizontal platform holding plants (16 blocks, architecture style 19, attribute ; 7) 53036 DEFB 64,0 ; Draw 64 2-by-2 blocks of nothing 53038 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53039 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53042 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53043 DEFB 251,5,3,68,64,51 ; Draw Plant (4) at ( 5, 3) with attribute of 68, preserve attribute 53049 DEFB 251,10,4,68,64,53 ; Draw Plant (6) at (10, 4) with attribute of 68, preserve attribute 53055 DEFB 251,19,1,68,64,50 ; Draw Plant (3) at (19, 1) with attribute of 68, preserve attribute 53061 DEFB 251,5,6,66,64,42 ; Draw Plant Pot (3) at ( 5, 6) with attribute of 66, preserve attribute 53067 DEFB 251,10,7,70,64,41 ; Draw Plant Pot (2) at (10, 7) with attribute of 70, preserve attribute 53073 DEFB 251,19,6,66,64,40 ; Draw Plant Pot (1) at (19, 6) with attribute of 66, preserve attribute 53079 DEFB 251,27,2,68,64,45 ; Draw Plant (7) at (27, 2) with attribute of 68, preserve attribute 53085 DEFB 251,27,5,69,64,44 ; Draw Plant Pot (4) at (27, 5) with attribute of 68, preserve attribute 53091 DEFB 245 ; Begin attribute painting block 53092 DEFB 69,19,1 ; Paint attribute 66 at (19, 1) 53095 DEFB 71,20,1 ; Paint attribute 66 at (20, 1) 53098 DEFB 245 ; End attribute painting block 53099 DEFB 0 ; End of room data ; Room Layout Data 3rd Floor 8 (More Plant Room) b53100 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53101 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53104 DEFB 48,0 ; Draw 48 2-by-2 blocks of nothing 53106 DEFB 12,19,7 ; Draw horizontal platform holding plants (12 blocks, architecture style 19, attribute ; 7) 53109 DEFB 68,0 ; Draw 68 2-by-2 blocks of nothing 53111 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53112 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53115 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53116 DEFB 250,28,14 ; Point bitmap and terrain interaction pointers to (28, 14) (near bottom-right of ; screen) 53119 DEFB 9,19,7 ; Draw wall protrusion / platform (9 blocks, architecture style 19, attribute 7) [bug! ; Should only be 2 blocks!] 53122 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to (30, 0) 53125 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) 53128 DEFB 237,29,3 ; Draw left-facing wall-candle at coordinates (29, 3) 53131 DEFB 251,6,3,68,64,52 ; Draw Plant (5) at ( 6, 3) with attribute of 68, preserve attribute 53137 DEFB 251,10,4,68,64,52 ; Draw Plant (5) at (10, 4) with attribute of 68, preserve attribute 53143 DEFB 251,14,1,68,64,50 ; Draw Plant (3) at (14, 1) with attribute of 68, preserve attribute 53149 DEFB 251,6,6,70,64,40 ; Draw Plant Pot (1) at ( 6, 6) with attribute of 70, preserve attribute 53155 DEFB 251,10,7,66,64,41 ; Draw Plant Pot (2) at (10, 7) with attribute of 66, preserve attribute 53161 DEFB 251,14,6,69,64,42 ; Draw Plant Pot (3) at (14, 6) with attribute of 69, preserve attribute 53167 DEFB 251,18,2,68,64,52 ; Draw Plant (5) at (18, 2) with attribute of 68, preserve attribute 53173 DEFB 251,18,5,66,64,44 ; Draw Plant Pot (4) at (18, 5) with attribute of 68, preserve attribute 53179 DEFB 245 ; Begin attribute painting block 53180 DEFB 67,14,1 ; Paint attribute 67 at (14, 1) 53183 DEFB 67,15,1 ; Paint attribute 67 at (15, 1) 53186 DEFB 245 ; End attribute painting block 53187 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 1 and Ground Floor 1 b53188 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53189 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53192 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53194 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53195 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53198 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53199 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to 0, 0 (top-left of screen) 53202 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 53205 DEFB 236,2,5 ; Draw right-facing wall-candle at 2, 5 53208 DEFB 246,8,4 ; Draw wall axes at 8, 4 53211 DEFB 246,18,4 ; Draw wall axes at 18, 4 53214 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 2 b53215 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53216 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53219 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53221 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53222 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53225 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53226 DEFB 246,8,4 ; Draw wall axes at 8, 4 53229 DEFB 246,18,4 ; Draw wall axes at 18, 4 53232 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 3 b53233 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53234 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53237 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53239 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53240 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53243 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53244 DEFB 243,8,6,69,70 ; Draw framed picture at ( 8, 6) with contents of graphic lookup index 69 (Gimbal) and ; attribute 70 53249 DEFB 243,20,6,72,71 ; Draw framed picture at (20, 6) with contents of graphic lookup index 72 (Orik) and ; attribute 71 53254 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 53257 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 53260 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 4 b53261 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53262 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53265 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53267 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53268 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53271 DEFB 243,8,6,71,70 ; Draw framed picture at ( 8, 6) with contents of graphic lookup index 71 (Florin) and ; attribute 70 53276 DEFB 243,20,6,76,71 ; Draw framed picture at (20, 6) with contents of graphic lookup index 76 (Banshee) and ; attribute 71 53281 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 53284 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 53287 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53288 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 5 (The Wall, original) b53289 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53290 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53293 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53295 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53296 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53299 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53300 DEFB 250,14,0 ; Point bitmap and terrain interaction pointers to 14, 0 53303 DEFB 9,19,7 ; Draw The Wall (9 blocks, architecture style 19, attribute 7) 53306 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53307 DEFB 1,19,7 ; Draw bottom block of The Wall (1 blocks, architecture style 19, attribute 7) (Unnecessary, as ; this is already part of the previously drawn floor - (see trivia)) 53310 DEFB 236,16,3 ; Draw right-facing wall-candle at coordinates (16, 3) 53313 DEFB 239,20,6 ; Draw picture in frame (59748) at (20, 6) 53316 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 5 (The Wall, after Elrand has helped) b53317 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53318 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53321 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53323 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53324 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53327 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53328 DEFB 250,14,0 ; Point bitmap and terrain interaction pointers to 14, 0 53331 DEFB 4,19,7 ; Draw top section of The Wall (4 blocks, architecture style 19, attribute 7) 53334 DEFB 3,0 ; Draw 3 2-by-2 blocks of nothing 53336 DEFB 2,19,7 ; Draw bottom section of The Wall (2 blocks, architecture style 19, attribute 7) 53339 DEFB 236,16,3 ; Draw right-facing wall-candle at coordinates (16, 3) 53342 DEFB 239,20,6 ; Draw picture in frame (59748) at (20, 6) 53345 DEFB 243,2,6,71,70 ; Draw framed picture at ( 2, 6) with contents of graphic lookup index 71 (Florin) and ; attribute 70 [bug] 53350 DEFB 243,8,6,76,71 ; Draw framed picture at ( 8, 6) with contents of graphic lookup index 76 (Banshee) and ; attribute 71 [bug] 53355 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 6 (The Gallery) b53356 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53357 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53360 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53362 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53363 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53366 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53367 DEFB 239,2,6 ; Draw picture in frame (59748) at (2, 6) 53370 DEFB 240,12,6 ; Draw picture in frame (59748) and replace picture with alternative (60156) at 12, 6 53373 DEFB 241,24,6 ; Draw picture in frame (59548) at 24, 6 53376 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 7 (The Gallery) b53377 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53378 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53381 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53383 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53384 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53387 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53388 DEFB 242,4,6 ; Draw picture in frame (59548) and replace picture with alternative (60108) at 4, 6 53391 DEFB 241,14,6 ; Draw picture in frame (59548) at 14, 6 53394 DEFB 240,20,6 ; Draw picture in frame (59748) and replace picture with alternative (60156) at 20, 6 53397 DEFB 0 ; End of room data ; Room Layout Data 2nd Floor 8 (The Gallery) b53398 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53399 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53402 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53404 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53405 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53408 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53409 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to 30, 0 53412 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) 53415 DEFB 237,29,5 ; Draw left-facing wall-candle at coordinates (29, 5) 53418 DEFB 243,2,6,75,70 ; Draw framed picture at ( 2, 6) with contents of graphic lookup index 75 (Rosmar) and ; attribute 70 53423 DEFB 243,8,6,70,71 ; Draw framed picture at ( 8, 6) with contents of graphic lookup index 70 (Thor) and ; attribute 71 53428 DEFB 243,14,6,73,69 ; Draw framed picture at (14, 6) with contents of graphic lookup index 73 (Samsun) and ; attribute 69 53433 DEFB 243,20,6,74,68 ; Draw framed picture at (20, 6) with contents of graphic lookup index 74 (Elrand) and ; attribute 68 53438 DEFB 0 ; End of room data ; Room Layout Data 1st Floor 1 (The Mush Room) b53439 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53440 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53443 DEFB 52,0 ; Draw 52 2-by-2 blocks of nothing 53445 DEFB 10,19,7 ; Draw mushroom shelf (10 blocks, architecture style 19, attribute 7) 53448 DEFB 66,0 ; Draw 66 2-by-2 blocks of nothing 53450 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53451 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53454 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53455 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to 0, 0 (top-left of screen) 53458 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 53461 DEFB 236,2,5 ; Draw right-facing wall-candle at coordinates (2, 5) 53464 DEFB 251,8,6,70,64,78 ; Draw Mushroom (1) at ( 8, 6) with attribute of 70, preserve attribute 53470 DEFB 251,11,6,71,64,79 ; Draw Mushroom (2) at (11, 6) with attribute of 71, preserve attribute 53476 DEFB 251,14,5,70,64,82 ; Draw Large Mushroom at (14, 5) with attribute of 70, preserve attribute 53482 DEFB 251,17,6,70,64,80 ; Draw Mushroom (3) at (17, 6) with attribute of 70, preserve attribute 53488 DEFB 251,20,6,71,64,81 ; Draw Mushroom (4) at (20, 6) with attribute of 71, preserve attribute 53494 DEFB 251,24,5,70,64,82 ; Draw Large Mushroom at (24, 5) with attribute of 70, preserve attribute 53500 DEFB 251,5,16,70,64,80 ; Draw Mushroom (3) at ( 5,16) with attribute of 70, preserve attribute 53506 DEFB 251,10,16,71,64,81 ; Draw Mushroom (4) at (10,16) with attribute of 71, preserve attribute 53512 DEFB 251,14,15,70,64,82 ; Draw Large Mushroom at (14,15) with attribute of 70, preserve attribute 53518 DEFB 251,19,16,70,64,80 ; Draw Mushroom (3) at (19,16) with attribute of 70, preserve attribute 53524 DEFB 251,22,16,71,64,81 ; Draw Mushroom (4) at (22,16) with attribute of 71, preserve attribute 53530 DEFB 251,25,15,70,64,82 ; Draw Large Mushroom at (25,15) with attribute of 70, preserve attribute 53536 DEFB 0 ; End of room data ; Room Layout Data 1st Floor 2 (The Gas Room) b53537 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53538 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53541 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53543 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53544 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53547 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 53550 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 53553 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53554 DEFB 0 ; End of room data ; Room Layout Data 1st Floor 3 b53555 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53556 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53559 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53561 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53562 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53565 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53566 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 53569 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 53572 DEFB 251,15,5,69,64,91 ; Draw Wall Clock at (15, 5) with attribute of 69, preserve attribute 53578 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 2 (Secret Tunnel Entrance) b53579 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53580 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53583 DEFB 51,0 ; Draw 51 2-by-2 blocks of nothing 53585 DEFB 10,19,7 ; Draw plant shelf (10 blocks, architecture style 19, attribute 7) 53588 DEFB 67,0 ; Draw 67 2-by-2 blocks of nothing 53590 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53591 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53594 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53595 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to 30, 0 53598 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) [9 originally, ; becomes 7 after Rosmar helps] 53601 DEFB 237,29,5 ; Draw left-facing wall-candle at coordinates (29, 5) 53604 DEFB 251,10,4,68,64,53 ; Draw Plant (6) at (10, 4) with attribute of 68, preserve attribute 53610 DEFB 251,19,1,68,64,50 ; Draw Plant (3) at (19, 1) with attribute of 68, preserve attribute 53616 DEFB 251,10,7,70,64,41 ; Draw Plant Pot (2) at (10, 7) with attribute of 70, preserve attribute 53622 DEFB 251,19,6,66,64,40 ; Draw Plant Pot (1) at (19, 6) with attribute of 66, preserve attribute 53628 DEFB 251,22,2,68,64,45 ; Draw Plant (7) at (22, 2) with attribute of 68, preserve attribute 53634 DEFB 251,22,5,69,64,44 ; Draw Plant Pot (4) at (22, 5) with attribute of 69, preserve attribute 53640 DEFB 245 ; Begin attribute painting block 53641 DEFB 69,19,1 ; Paint attribute 69 at (19, 1) 53644 DEFB 71,20,1 ; Paint attribute 71 at (20, 1) 53647 DEFB 245 ; End attribute painting block 53648 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 4 (The Secret Tunnel) b53649 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53650 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53653 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53655 DEFB 250,18,10 ; Point bitmap and terrain interaction pointers to 18, 10 53658 DEFB 7,19,87 ; Draw top row of "floor" (7 blocks, architecture style 19, attribute 87) 53661 DEFB 250,14,12 ; Point bitmap and terrain interaction pointers to (14,12) 53664 DEFB 9,19,87 ; Draw second row of "floor" (9 blocks, architecture style 19, attribute 87) 53667 DEFB 250,10,14 ; Point bitmap and terrain interaction pointers to (10,14) 53670 DEFB 11,19,87 ; Draw third row of "floor" (11 blocks, architecture style 19, attribute 87) 53673 DEFB 250,6,16 ; Point bitmap and terrain interaction pointers to ( 6,16) 53676 DEFB 13,19,87 ; Draw fourth row of "floor" (13 blocks, architecture style 19, attribute 87) 53679 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53680 DEFB 16,19,87 ; Draw floor (16 blocks, architecture style 19, attribute 87) 53683 DEFB 247,2,1 ; Draw ceiling candles at coordinates (2, 1) 53686 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53687 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 5 (More Secret Tunnel) b53688 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53689 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53692 DEFB 64,0 ; Draw 64 2-by-2 blocks of nothing 53694 DEFB 64,19,87 ; Draw four rows of "floor" (64 blocks, architecture style 19, attribute 87) 53697 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53698 DEFB 16,19,87 ; Draw floor (16 blocks, architecture style 19, attribute 87) 53701 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53702 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 6 (The Pit) b53703 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53704 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53707 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53709 DEFB 250,0,10 ; Point bitmap and terrain interaction pointers to 0, 10 53712 DEFB 6,19,87 ; Draw top row of left "floor" (6 blocks, architecture style 19, attribute 87) 53715 DEFB 250,20,10 ; Point bitmap and terrain interaction pointers to (20,10) 53718 DEFB 12,19,87 ; Draw top row of right, and second row of left "floor" (12 blocks, architecture style 19, ; attribute 87) 53721 DEFB 250,20,12 ; Point bitmap and terrain interaction pointers to (20,12) 53724 DEFB 12,19,87 ; Draw second row of right, and third row of left "floor" (12 blocks, architecture style 19, ; attribute 87) 53727 DEFB 250,20,14 ; Point bitmap and terrain interaction pointers to (20,14) 53730 DEFB 12,19,87 ; Draw third row of right, and fourth row of left "floor" (12 blocks, architecture style 19, ; attribute 87) 53733 DEFB 250,20,16 ; Point bitmap and terrain interaction pointers to (20,16) 53736 DEFB 6,19,87 ; Draw fourth row of right "floor" (6 blocks, architecture style 19, attribute 87) 53739 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53740 DEFB 6,19,87 ; Draw left section of floor (6 blocks, architecture style 19, attribute 87) 53743 DEFB 4,15,70 ; Draw pit flames (4 blocks, architecture style 15, attribute 70) [bug] 53746 DEFB 6,19,87 ; Draw right section of floor (6 blocks, architecture style 19, attribute 87) [bug] 53749 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53750 DEFB 244 ; Start painting glowing blocks 53751 DEFB 12,18 ; (12,18) 53753 DEFB 13,18 ; (13,18) 53755 DEFB 14,18 ; (14,18) 53757 DEFB 15,18 ; (15,18) 53759 DEFB 16,18 ; (16,18) 53761 DEFB 17,18 ; (17,18) 53763 DEFB 18,18 ; (18,18) 53765 DEFB 19,18 ; (19,18) 53767 DEFB 244 ; Stop painting glowing blocks 53768 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 7 b53769 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53770 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53773 DEFB 128,0 ; Draw 128 2-by-2 blocks of nothing 53775 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53776 DEFB 16,19,87 ; Draw floor (16 blocks, architecture style 19, attribute 87) 53779 DEFB 250,0,10 ; Point bitmap and terrain interaction pointers to 0, 10 53782 DEFB 2,19,87 ; Draw top row of "floor" (2 blocks, architecture style 19, attribute 87) 53785 DEFB 250,0,12 ; Point bitmap and terrain interaction pointers to ( 0,12) 53788 DEFB 4,19,87 ; Draw second row of "floor" (4 blocks, architecture style 19, attribute 87) 53791 DEFB 250,0,14 ; Point bitmap and terrain interaction pointers to ( 0,14) 53794 DEFB 6,19,87 ; Draw third row of "floor" (6 blocks, architecture style 19, attribute 87) 53797 DEFB 250,0,16 ; Point bitmap and terrain interaction pointers to ( 0,16) 53800 DEFB 8,19,87 ; Draw fourth row of "floor" (8 blocks, architecture style 19, attribute 87) 53803 DEFB 247,2,1 ; Draw ceiling candles at coordinates ( 2, 1) 53806 DEFB 247,27,1 ; Draw ceiling candles at coordinates (27, 1) 53809 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53810 DEFB 0 ; End of room data ; Room Layout Data Ground Floor 8 (The Most Magic Room) b53811 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53812 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53815 DEFB 35,0 ; Draw 35 2-by-2 blocks of nothing 53817 DEFB 2,19,7 ; Draw left platform (2 blocks, architecture style 19, attribute 7) 53820 DEFB 16,0 ; Draw 16 2-by-2 blocks of nothing 53822 DEFB 3,19,7 ; Draw right platform (3 blocks, architecture style 19, attribute 7) 53825 DEFB 72,0 ; Draw 72 2-by-2 blocks of nothing 53827 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53828 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53831 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53832 DEFB 250,10,0 ; Point bitmap and terrain interaction pointers to (10, 0) 53835 DEFB 254 ; Start drawing 2-by-2 blocks of brickwork 53836 DEFB 68 ; Set attribute to 68 (green INK, black PAPER, BRIGHT) 53837 DEFB 2 ; Arch. style 2 (top green block) 53838 DEFB 3 ; Arch. style 3 (2nd green block) 53839 DEFB 4 ; Arch. style 4 (3rd green block) 53840 DEFB 5 ; Arch. style 5 (4th green block) 53841 DEFB 254 ; Stop drawing 2-by-2 blocks of brickwork 53842 DEFB 235 ; Set Terrain Interaction Parameter to "preserve attribute" 53843 DEFB 250,6,2 ; Point bitmap and terrain interaction pointers to ( 6, 2) 53846 DEFB 254 ; Start drawing 2-by-2 blocks of brickwork 53847 DEFB 127 ; Set attribute to 127 (white INK, white PAPER, BRIGHT) 53848 DEFB 16 ; Arch. style 16 (top of white-out zone) 53849 DEFB 16 ; Arch. style 16 (bottom of white-out zone) 53850 DEFB 254 ; Stop drawing 2-by-2 blocks of brickwork 53851 DEFB 250,6,8 ; Point bitmap and terrain interaction pointers to ( 6, 8) 53854 DEFB 254 ; Start drawing 2-by-2 blocks of brickwork (left-hand column) 53855 DEFB 71 ; Set attribute to 71 (white INK, black PAPER, BRIGHT) 53856 DEFB 11 ; Arch. style 11 (top of column) 53857 DEFB 13 ; Arch. style 13 (body of column, 2nd block) 53858 DEFB 13 ; Arch. style 13 (body of column, 3rd block) 53859 DEFB 13 ; Arch. style 13 (body of column, 4th block) 53860 DEFB 12 ; Arch. style 12 (base of column) 53861 DEFB 254 ; Stop drawing 2-by-2 blocks of brickwork 53862 DEFB 250,14,10 ; Point bitmap and terrain interaction pointers to (14,10) 53865 DEFB 254 ; Start drawing 2-by-2 blocks of brickwork (right-hand column) 53866 DEFB 71 ; Set attribute to 71 (white INK, black PAPER, BRIGHT) 53867 DEFB 11 ; Arch. style 11 (top of column) 53868 DEFB 13 ; Arch. style 13 (body of column, 2nd block) 53869 DEFB 13 ; Arch. style 13 (body of column, 3rd block) 53870 DEFB 12 ; Arch. style 12 (base of column) 53871 DEFB 254 ; Stop drawing 2-by-2 blocks of brickwork 53872 DEFB 234 ; Set Terrain Interaction Parameter to "impassable horizontally", "impassable vertically" and ; "preserve attribute" 53873 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to (30, 0) 53876 DEFB 9,19,7 ; Draw right wall (9 blocks, architecture style 19, attribute 7) 53879 DEFB 237,29,5 ; Draw left-facing wall-candle at coordinates (29, 5) 53882 DEFB 0 ; End of room data ; Room Layout Data The Basement b53883 DEFB 232 ; Set brickwork drawing mode 2 (draw one row and blank row beneath) 53884 DEFB 16,19,7 ; Draw ceiling (16 blocks, architecture style 19, attribute 7) 53887 DEFB 61,0 ; Draw 61 2-by-2 blocks of nothing 53889 DEFB 3,19,7 ; Draw upper floor (3 blocks, architecture style 19, attribute 7) 53892 DEFB 12,0 ; Draw 12 2-by-2 blocks of nothing 53894 DEFB 2,19,7 ; Draw 4th step's row (2 blocks, architecture style 19, attribute 7) 53897 DEFB 13,0 ; Draw 13 2-by-2 blocks of nothing 53899 DEFB 3,19,7 ; Draw 3rd step's row (3 blocks, architecture style 19, attribute 7) 53902 DEFB 12,0 ; Draw 12 2-by-2 blocks of nothing 53904 DEFB 4,19,7 ; Draw 2nd step's row (4 blocks, architecture style 19, attribute 7) 53907 DEFB 11,0 ; Draw 11 2-by-2 blocks of nothing 53909 DEFB 5,19,7 ; Draw 1st step's row (5 blocks, architecture style 19, attribute 7) 53912 DEFB 2,0 ; Draw 2 2-by-2 blocks of nothing 53914 DEFB 231 ; Set brickwork drawing mode 1 (draw one row only) 53915 DEFB 16,19,7 ; Draw floor (16 blocks, architecture style 19, attribute 7) 53918 DEFB 230 ; Set Brickwork Direction Mode to vertical and reset pointers to beginning of display 53919 DEFB 250,0,0 ; Point bitmap and terrain interaction pointers to ( 0, 0) 53922 DEFB 7,19,7 ; Draw left wall (7 blocks, architecture style 19, attribute 7) 53925 DEFB 250,30,0 ; Point bitmap and terrain interaction pointers to (30, 0) 53928 DEFB 4,1,5 ; Draw cyan basement wall (4 blocks, architecture style 1, attribute 5) 53931 DEFB 236,2,5 ; Draw right-facing wall-candle at coordinates ( 2, 5) 53934 DEFB 236,28,11 ; Draw right-facing wall-candle at coordinates (28, 11) 53937 DEFB 0 ; End of room data ; x- and y-Coordinates of Three Positions in Room that Characters Can Occupy b53938 DEFB 4,14,8,14,12,14 ; The Lift 53944 DEFB 3,14,8,14,23,14 ; Roof 1 (The Roof Garden) 53950 DEFB 2,14,14,14,28,14 ; Roof 2 (The Roof Garden) 53956 DEFB 3,14,10,14,22,14 ; Roof 3 (The Roof Garden) 53962 DEFB 26,14,14,14,6,14 ; Roof 4 (The Roof Garden) 53968 DEFB 17,14,4,14,9,14 ; Roof 5 (The Roof Garden) 53974 DEFB 4,14,10,14,16,14 ; Roof 6 (The Roof Garden) 53980 DEFB 4,14,10,14,16,14 ; Roof 7 (The Roof Garden) 53986 DEFB 26,14,2,14,7,14 ; Roof 8 (The Roof Garden) 53992 DEFB 20,14,24,14,16,14 ; 4th Floor 1 (The Tower) 53998 DEFB 10,14,14,14,18,14 ; 4th Floor 2 (Beyond the Tower) 54004 DEFB 10,14,14,14,18,14 ; 4th Floor 3 (Further Beyond the Tower) 54010 DEFB 8,10,14,6,20,10 ; 4th Floor 4 (The Ballroom) 54016 DEFB 4,14,6,14,20,14 ; 4th Floor 5 (The Tree of Karn) 54022 DEFB 0,14,14,14,26,12 ; 4th Floor 6 (The Stalagmites) 54028 DEFB 2,14,8,14,22,14 ; 4th Floor 7 (The Big Bottle) 54034 DEFB 10,14,14,14,18,14 ; 4th Floor 8 54040 DEFB 10,14,14,14,18,14 ; 3rd Floor 1 (The Library) 54046 DEFB 2,14,8,14,22,14 ; 3rd Floor 2 (The Little Bottle) 54052 DEFB 8,10,14,6,20,10 ; 3rd Floor 3 (The Odd-Ball) 54058 DEFB 10,14,14,14,20,14 ; 3rd Floor 4 (Florin's room) 54064 DEFB 10,14,14,14,19,14 ; 3rd Floor 5 (The Start Room) 54070 DEFB 10,14,14,14,20,14 ; 3rd Floor 6 (The L-Shaped Room) 54076 DEFB 8,14,12,14,16,14 ; 3rd Floor 7 (The Plant Room [Thor's room]) 54082 DEFB 8,14,12,14,16,14 ; 3rd Floor 8 (More Plant Room) 54088 DEFB 8,14,12,14,16,14 ; 2nd Floor 1 54094 DEFB 8,14,12,14,16,14 ; 2nd Floor 2 54100 DEFB 8,14,12,14,16,14 ; 2nd Floor 3 54106 DEFB 8,14,12,14,16,14 ; 2nd Floor 4 54112 DEFB 2,14,8,14,14,14 ; 2nd Floor 5 (The Wall) [bug] 54118 DEFB 14,14,18,14,26,14 ; 2nd Floor 6 (The Gallery) 54124 DEFB 14,14,18,14,24,14 ; 2nd Floor 7 (The Gallery) 54130 DEFB 14,14,18,14,22,14 ; 2nd Floor 8 (The Gallery) 54136 DEFB 14,14,18,14,26,14 ; 1st Floor 1 (The Mush Room) 54142 DEFB 14,14,18,14,24,14 ; 1st Floor 2 (The Gas Room) 54148 DEFB 2,14,8,14,12,14 ; 1st Floor 3 54154 DEFB 2,14,8,14,12,14 ; 1st Floor 4 54160 DEFB 8,10,14,6,20,10 ; 1st Floor 5 (The Spare Ballroom) 54166 DEFB 2,14,8,14,22,14 ; 1st Floor 6 54172 DEFB 2,14,8,14,12,14 ; 1st Floor 7 (The Trophy Room) 54178 DEFB 2,14,8,14,16,14 ; 1st Floor 8 54184 DEFB 22,14,14,14,6,14 ; Ground Floor 1 54190 DEFB 22,14,14,14,6,14 ; Ground Floor 2 (Secret Tunnel Entrance) 54196 DEFB 2,14,15,14,8,14 ; Ground Floor 3 (Gimbal's Secret Study) 54202 DEFB 18,6,22,6,26,6 ; Ground Floor 4 (The Secret Tunnel) 54208 DEFB 4,6,8,6,12,6 ; Ground Floor 5 (More Secret Tunnel) 54214 DEFB 0,6,4,6,8,6 ; Ground Floor 6 (The Pit) 54220 DEFB 18,14,22,14,26,14 ; Ground Floor 7 54226 DEFB 6,2,9,14,22,14 ; Ground Floor 8 (The Most Magic Room) 54232 DEFB 4,14,8,14,12,14 ; The Basement ; 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: b54238 DEFM 8,111,"LIFT",0 ; THE LIFT 54245 DEFM 15,171,0 ; THE ROOF GARDEN 54248 DEFM 15,171,0 ; THE ROOF GARDEN 54251 DEFM 15,171,0 ; THE ROOF GARDEN 54254 DEFM 15,171,0 ; THE ROOF GARDEN 54257 DEFM 15,171,0 ; THE ROOF GARDEN 54260 DEFM 15,171,0 ; THE ROOF GARDEN 54263 DEFM 15,171,0 ; THE ROOF GARDEN 54266 DEFM 15,171,0 ; THE ROOF GARDEN 54269 DEFM 9,111,"TOWER",0 ; THE TOWER 54277 DEFM 16,"BEYOND ",111,"TOWER",0 ; BEYOND THE TOWER 54292 DEFM 24,"FURTHUR BEYOND ",111,"TOWER",0 ; FURTHUR BEYOND THE TOWER [bug] 54315 DEFM 12,111,"BALL",178,0 ; THE BALLROOM 54323 DEFM 16,111,"TREE OF KARN",0 ; THE TREE OF KARN 54338 DEFM 15,"THE STALAGMITES",0 ; THE STALAGMITES 54355 DEFM 14,111,"BIG BOTTLE",0 ; THE BIG BOTTLE 54368 DEFM 0 54369 DEFM 11,111,"LIBRARY",0 ; THE LIBRARY 54379 DEFM 17,111,"LITTLE BOTTLE",0 ; THE LITTLE BOTTLE 54395 DEFM 12,111,"ODD-BALL",0 ; THE ODD-BALL 54406 DEFM 0 54407 DEFM 14,111,"START ",178,0 ; THE START ROOM 54417 DEFM 17,111,"L-SHAPED ",178,0 ; THE L-SHAPED ROOM 54430 DEFM 14,111,"PLANT ",178,0 ; THE PLANT ROOM 54440 DEFM 15,"MORE PLANT ",178,0 ; MORE PLANT ROOM 54454 DEFM 0 54455 DEFM 0 54456 DEFM 0 54457 DEFM 0 54458 DEFM 8,111,"WALL",0 ; THE WALL 54465 DEFM 11,111,"GALLERY",0 ; THE GALLERY 54475 DEFM 11,111,"GALLERY",0 ; THE GALLERY 54485 DEFM 11,111,"GALLERY",0 ; THE GALLERY 54495 DEFM 13,111,"MUSH ",178,0 ; THE MUSH ROOM 54504 DEFM 12,111,"GAS ",178,0 ; THE GAS ROOM 54512 DEFM 0 54513 DEFM 0 54514 DEFM 18,111,"SPARE BALL",178,0 ; THE SPARE BALLROOM 54528 DEFM 0 54529 DEFM 15,111,"TROPHY ",178,0 ; THE TROPHY ROOM 54540 DEFM 0 54541 DEFM 0 54542 DEFM 22,172," ENTRANCE",0 ; SECRET TUNNEL ENTRANCE 54554 DEFM 21,130,"'S SECRET STUDY",0 ; GIMBAL'S SECRET STUDY 54572 DEFM 17,111,172,0 ; THE SECRET TUNNEL 54576 DEFM 18,"MORE ",172,0 ; MORE SECRET TUNNEL 54584 DEFM 7,111,"PIT",0 ; THE PIT 54590 DEFM 0 54591 DEFM 19,111,"MOST MAGIC ",178,0 ; THE MOST MAGIC ROOM 54606 DEFM 12,111,"BASEMENT",0 ; THE BASEMENT ; Architecture Styles Lookup Table ; ; #TABLE(default,centre,:w) ; { =h Offset | =h Meaning } ; { 0 | Index of top-left UDG } ; { 1 | Index of top-right UDG } ; { 2 | Index of bottom-left UDG } ; { 3 | Index of bottom-right UDG } ; TABLE# b54617 DEFB 0,0,0,0 54621 DEFB 24,24,24,24 54625 DEFB 2,3,26,27 54629 DEFB 4,5,28,29 54633 DEFB 6,7,30,31 54637 DEFB 8,9,32,33 54641 DEFB 10,11,34,35 ; (unused) 54645 DEFB 12,13,36,37 ; (unused) 54649 DEFB 14,15,38,39 ; (unused) 54653 DEFB 48,49,72,73 ; (unused) 54657 DEFB 10,11,38,39 ; (unused) 54661 DEFB 54,55,78,79 54665 DEFB 56,57,80,81 54669 DEFB 58,59,58,59 54673 DEFB 16,17,40,41 ; (unused) 54677 DEFB 82,83,0,0 54681 DEFB 0,0,0,0 54685 DEFB 16,17,0,41 ; (unused) 54689 DEFB 18,19,42,0 ; (unused) 54693 DEFB 66,67,90,91 54697 DEFB 42,43,66,67 ; (unused) ; Graphics (Hand Menu Cursor) b54701 DEFB 0,0,0,48,0,120,0,252 54709 DEFB 1,254,24,255,23,127,16,54 54717 DEFB 8,28,18,40,37,32,74,160 54725 DEFB 149,64,162,128,193,0,0,0 ; Table of Start Addresses of Input Device Reading Routines b54733 DEFW 37884 ; Address of keyboard reading routine 54735 DEFW 37928 ; Address of Kempston Joystick reading routine 54737 DEFW 37959 ; Address of Fuller Joystick reading routine 54739 DEFW 37990 ; Address of Cursor Joystick reading routine 54741 DEFW 38027 ; Address of ZX Interface 2 Joystick 1 reading routine ; Powers of Ten ; ; Used by the routine at #R37746 for Converting Numbers to ASCII Strings b54743 DEFW 10000 54745 DEFW 1000 54747 DEFW 100 54749 DEFW 10 54751 DEFW 1 ; Addresses of Room-Specific Routines b54753 DEFW 29775 ; The Lift 54755 DEFW 29775 ; Roof 1 (The Roof Garden) 54757 DEFW 29775 ; Roof 2 (The Roof Garden) 54759 DEFW 29775 ; Roof 3 (The Roof Garden) 54761 DEFW 29775 ; Roof 4 (The Roof Garden) 54763 DEFW 29775 ; Roof 5 (The Roof Garden) 54765 DEFW 29775 ; Roof 6 (The Roof Garden) 54767 DEFW 29775 ; Roof 7 (The Roof Garden) 54769 DEFW 29775 ; Roof 8 (The Roof Garden) 54771 DEFW 29775 ; 4th Floor 1 (The Tower) 54773 DEFW 29775 ; 4th Floor 2 (Beyond the Tower) 54775 DEFW 29775 ; 4th Floor 3 (Further Beyond the Tower) 54777 DEFW 29776 ; Update positions of 4 Odd-Balls and display [4th Floor 4 (The Ballroom)] 54779 DEFW 29796 ; 4th Floor 5 (The Tree of Karn) 54781 DEFW 29796 ; 4th Floor 6 (The Stalagmites) 54783 DEFW 29797 ; 4th Floor 7 (The Big Bottle) 54785 DEFW 29799 ; 4th Floor 8 54787 DEFW 29799 ; 3rd Floor 1 (The Library) 54789 DEFW 29800 ; 3rd Floor 2 (The Little Bottle) 54791 DEFW 29874 ; Update position of 1 Odd-Ball and display [3rd Floor 3 (The Odd-Ball)] 54793 DEFW 29879 ; 3rd Floor 4 (Florin's room) 54795 DEFW 29879 ; 3rd Floor 5 (The Start Room) 54797 DEFW 29879 ; 3rd Floor 6 (The L-Shaped Room) 54799 DEFW 29879 ; 3rd Floor 7 (The Plant Room [Thor's room]) 54801 DEFW 29879 ; 3rd Floor 8 (More Plant Room) 54803 DEFW 29879 ; 2nd Floor 1 54805 DEFW 29879 ; 2nd Floor 2 54807 DEFW 29879 ; 2nd Floor 3 54809 DEFW 29879 ; 2nd Floor 4 54811 DEFW 29879 ; 2nd Floor 5 (The Wall) 54813 DEFW 29879 ; 2nd Floor 6 (The Gallery) 54815 DEFW 29879 ; 2nd Floor 7 (The Gallery) 54817 DEFW 29879 ; 2nd Floor 8 (The Gallery) 54819 DEFW 29879 ; 1st Floor 1 (The Mush Room) 54821 DEFW 29880 ; 1st Floor 2 (The Gas Room) 54823 DEFW 29910 ; 1st Floor 3 54825 DEFW 29910 ; 1st Floor 4 54827 DEFW 29911 ; Update positions of 4 Odd-Balls and display [1st Floor 5 (The Spare Ballroom)] 54829 DEFW 29914 ; 1st Floor 6 54831 DEFW 29914 ; 1st Floor 7 (The Trophy Room) 54833 DEFW 29914 ; 1st Floor 8 54835 DEFW 29914 ; Ground Floor 1 54837 DEFW 29914 ; Ground Floor 2 (Secret Tunnel Entrance) 54839 DEFW 29914 ; Ground Floor 3 (Gimbal's Secret Study) 54841 DEFW 29914 ; Ground Floor 4 (The Secret Tunnel) 54843 DEFW 29914 ; Ground Floor 5 (More Secret Tunnel) 54845 DEFW 29915 ; Ground Floor 6 (The Pit) 54847 DEFW 29927 ; Ground Floor 7 54849 DEFW 29928 ; Ground Floor 8 (The Most Magic Room) 54851 DEFW 29949 ; The Basement ; Call Time-Dependent Routines [Main Interrupt Routine] ; ; Used by the routine at #R65524. c54853 CALL 55546 ; Store all registers on the stack 54856 LD A,(37655) ; Load A with index of Current Window... 54859 CP 6 ; ...and if this is 6 (Control Selection Window)... 54861 JP Z,54955 ; ...then skip ahead to #R54955 54864 BIT 0,(IY+65) ; If "Update Game Time and Locate Arrow Glow" flag is reset... 54868 JP Z,54949 ; ...then skip to end of interrupt routine 54871 CALL 54996 ; Update game time, time left and (every minute) read-text of Crystal Ball 54874 LD BC,(23462) ; Load x- & y- coordinate of top-left character of currently glowing "Locate Compass" component ; into BC 54878 LD A,B ; If this is zero (i.e. compass not glowing because Magic Knight isn't "locating")... 54879 OR C ; ... 54880 JP Z,54916 ; ...jump to #R54916... 54883 LD A,(23408) ; Else, load "Compass Glow Update Flag" into A 54886 INC A ; Invert Compass Glow Update Flag 54887 AND 1 ; Store back at 23408 and if Compass Glow Update Flag is set... 54889 LD (23408),A ; ... 54892 JR NZ,54916 ; ...then skip over glow attribute update section to #R54916 (don't update glowing attributes ; this time) 54894 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 54897 CALL 54983 ; Update glowing blocks' attribute to next colour in sequence and load into E 54900 CALL 54976 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 54903 CALL 54976 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 54906 LD BC,30 ; Advance Attribute File address (HL) down to next row, to the block immediately below the ; first one updated at instruction #R54900... 54909 ADD HL,BC ; ... 54910 CALL 54976 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 54913 CALL 54976 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL *54916 BIT 1,(IY+65) ; If "Disable In-Game Glow" flag is set... 54920 JP NZ,54949 ; ...then skip to end of interrupt routine 54923 LD IX,23383 ; Point IX at table of Attribute File addresses that are glowing 54927 CALL 54983 ; Update glowing blocks' attribute to next colour in sequence and load into E *54930 LD L,(IX+0) ; Load a glowing Attribute File address into HL... 54933 LD H,(IX+1) ; ... 54936 LD A,L ; If HL is zero... 54937 OR H ; ... 54938 JR Z,54949 ; ...then jump to #R54949 (to exit loop) 54940 CALL 54976 ; Write current attribute for a glowing block to Attribute File (HL) and advance HL 54943 INC IX ; Advance to next Attribute File address in list of glowing blocks... 54945 INC IX ; ... 54947 JR 54930 ; Jump back to #R54930 to update next block ; This entry point is used by the routine at #R54955. *54949 CALL 55574 ; Restore all registers from the stack 54952 JP 56 ; Jump to ROM maskable interrupt routine (update frame counter, read keyboard and then return ; to main game code where the interrupt was triggered) ; Interrupt Routine Update Glowing Character on Input Selection Menu ; ; Used by the routine at #R54853. c54955 LD A,(40140) ; Load input device selection into A 54958 SUB 65 ; Subtract 65 (minimum value it can be) 54960 ADD A,12 ; Add 12 54962 LD B,A ; Load coordinates of glowing square (control selection menu) into BC... 54963 LD C,1 ; ... 54965 CALL 36569 ; Update Virtual Attribute Cursor storage location to coordinates x=C y=B and point HL to ; corresponding Attribute File address 54968 CALL 54983 ; Update glowing blocks' attribute to next colour in sequence and load into E 54971 CALL 54976 ; Write current attribute for a glowing block to Attribute File 54974 JR 54949 ; Exit interrupt routine ; Interrupt Routine Write Current Attribute for a Glowing Block to Attribute File ; ; Used by the routines at #R54853 and #R54955. 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 c54976 LD A,(HL) ; Load current attribute of this memory location into A 54977 AND 248 ; Reset all INK bits 54979 OR E ; Set required INK bits for current colour 54980 LD (HL),A ; Write data to Attribute File to display the colour 54981 INC HL ; Advance to next Attribute File address 54982 RET ; Return ; Interrupt Routine Update Glowing Blocks' Attribute to Next Colour in Sequence ; ; Used by the routines at #R54853 and #R54955. Output: E New attribute of glowing blocks c54983 LD A,(23409) ; Load A with current INK colour of glowing blocks *54986 INC A ; Advance to next colour in sequence 54987 AND 7 ; Ensure that only INK attributes are used, rolling back over to zero (black) after seven ; (white) 54989 JR Z,54986 ; We don't want "black" light, so advance from zero (black) to one (blue) if black 54991 LD (23409),A ; Place updated attribute back in memory 54994 LD E,A ; Copy new attribute into E 54995 RET ; Return ; Update Game Time, Time Left and (Every Minute) Read-Text of Crystal Ball ; ; Used by the routine at #R54853. c54996 LD A,(23407) ; [EVERY 1/50 SECOND] Increase number of elapsed 1/50 seconds 54999 INC A ; ... 55000 LD (23407),A ; ... 55003 CP 50 ; If new value isn't 50 then return... 55005 RET NZ ; ... 55006 XOR A ; [EVERY 1 SECOND] Else, set the value to zero (start of next full second)... 55007 LD (23407),A ; ... 55010 CALL 55233 ; If character whose turn it is to move is free and awake, then update their current room if ; possible 55013 LD A,(23406) ; Increase number of seconds elapsed... 55016 INC A ; ... 55017 LD (23406),A ; ... 55020 CP 60 ; If new value isn't 60 then return... 55022 RET NZ ; ... 55023 XOR A ; [EVERY 1 MINUTE] Else, set the value to zero (start of next minute)... 55024 LD (23406),A ; ... 55027 CALL 55077 ; Update all characters' stats (deteriorate or regenerate) and wake up / send to sleep if ; required 55030 CALL 55349 ; Move the Lift to a random floor if Magic Knight is not nearby 55033 LD A,(42292) ; Update read-text property of Crystal Ball... 55036 INC A ; ... 55037 LD (42292),A ; ... 55040 CP 144 ; If read-text property is less than 144... 55042 JR NZ,55049 ; ...skip ahead to #R55049... 55044 LD A,139 ; ...else set read-text property of Crystal Ball to 139... 55046 LD (42292),A ; ... *55049 LD A,(23405) ; Increase number of minutes elapsed... 55052 INC A ; ... 55053 LD (23405),A ; ... 55056 CP 5 ; If new value isn't 5 then return... 55058 RET NZ ; ... 55059 XOR A ; [EVERY 5 MINUTES] Else, set the value to zero (start of next "hour")... 55060 LD (23405),A ; ... 55063 LD A,(23404) ; Decrease number of hours left... 55066 DEC A ; ... 55067 LD (23404),A ; ... 55070 JP Z,55478 ; If zero then jump to "Out of time" game over message 55073 CALL 38075 ; Set parameters for and play upward scale sound 55076 RET ; Return ; Update All Characters' Stats (Deteriorate or Regenerate) and Wake Up / Send to Sleep if Required ; ; Used by the routine at #R54996. c55077 LD DE,8 ; Load DE with 8 (as data is 8 bytes long) 55080 LD HL,55490 ; Point HL at Gimbal's stat regeneration data 55083 LD IX,25323 ; Point IX to Gimbal's current stats 55087 LD B,7 ; Load B with 7 (as there are 7 characters to which this routine applies - Banshee is excluded) 55089 LD A,(23468) ; If "Gimbal is free" flag is set... 55092 AND 1 ; ... 55094 JR NZ,55104 ; ...then jump ahead to #R55104 55096 LD HL,55498 ; Else point HL at Thor's stat regeneration data 55099 LD IX,25331 ; Point IX to Thor's current stats 55103 DEC B ; Decrease B to 6 as, since Gimbal is not free, he is not included in this routine's function *55104 BIT 7,(IX+6) ; If current character is awake... 55108 JR Z,55114 ; ...then skip ahead to #R55114 55110 INC HL ; Advance HL by four bytes to stat deterioration data... 55111 INC HL ; ... 55112 INC HL ; ... 55113 INC HL ; ... *55114 LD C,(HL) ; Load stat change value into C 55115 LD A,(IX+0) ; Load current character's strength into A 55118 CALL 55219 ; Update character's strength as they tire (awake) or regenerate (asleep)... 55121 LD (IX+0),A ; ... 55124 INC HL ; Advance HL to next (happiness) data 55125 LD C,(HL) ; Load stat change value into C 55126 LD A,(IX+1) ; Load current character's happiness into A 55129 CALL 55219 ; Update character's happiness as they tire (awake) or regenerate (asleep)... 55132 LD (IX+1),A ; ... 55135 INC HL ; Advance HL to next (stamina) data 55136 LD C,(HL) ; Load stat change value into C 55137 LD A,(IX+2) ; Load current character's stamina into A 55140 CALL 55219 ; Update character's stamina as they tire (awake) or regenerate (asleep)... 55143 LD (IX+2),A ; ... 55146 INC HL ; Advance HL to next (spell power) data 55147 LD C,(HL) ; Load stat change value into C 55148 LD A,(IX+3) ; Load current character's spell power into A 55151 CALL 55219 ; Update character's spell power as they tire (awake) or regenerate (asleep)... 55154 LD (IX+3),A ; ... 55157 INC HL ; Advance HL to next block of data 55158 BIT 7,(IX+6) ; If current character is asleep... 55162 JR NZ,55168 ; ...then we have already moved into data for next character, so skip ahead to #R55168 55164 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... 55165 INC HL ; ... 55166 INC HL ; ... 55167 INC HL ; ... *55168 ADD IX,DE ; Advance IX by eight bytes to next character's stats 55170 DJNZ 55104 ; Loop back to 55104 55172 LD DE,8 ; Load DE with 8 55175 LD IX,25323 ; Point IX to Gimbal's current stats 55179 LD B,7 ; Load B with 7 (as there are 7 characters to which this routine applies - Banshee is excluded) 55181 LD C,0 ; Load C with zero (to denote first character, Gimbal) *55183 LD A,(IX+2) ; Load current character's stamina into A 55186 OR A ; If stamina is not zero... 55187 JP NZ,55196 ; ...then skip ahead to #R55196 55190 SET 7,(IX+6) ; Else send character to sleep 55194 JR 55205 ; Skip ahead to #R55205 *55196 CP 100 ; If stamina is not 100... 55198 JP NZ,55205 ; ...then skip ahead to #R55205 55201 RES 7,(IX+6) ; Else wake character up *55205 LD A,(IX+0) ; Load character's strength into A 55208 OR A ; If strength is zero... 55209 JP Z,55461 ; ...then the character has starved to death, so jump to #R55461 55212 ADD IX,DE ; Advance IX to next character's stats 55214 INC C ; Increase C for next character 55215 DJNZ 55183 ; Loop back to 55183 for next character 55217 RET ; Return ; Index of Character Whose Turn it is to Move b55218 DEFB 8 ; Update Characters' Stats as They Tire (Awake) or Regenerate (Asleep) ; ; Used by the routine at #R55077. 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 c55219 ADD A,C ; Add stat and data together 55220 OR A ; (Re)set sign flag 55221 JP P,55226 ; If sign flag reset (i.e. MSB is reset and result is positive) then jump ahead to #R55226 55224 XOR A ; else stat must have dropped below zero, so set stat to zero (as it can't be less than 0) 55225 RET ; Return *55226 CP 100 ; If new value of stat is less than or equal to 100... 55228 RET Z ; ...then return... 55229 RET C ; ... 55230 LD A,100 ; ...else set stat to 100 (as it can't be greater than 100) 55232 RET ; Return ; Interrupt Routine If Character is Free and Awake, then Update Their Current Room if Possible ; ; Used by the routine at #R54996. c55233 BIT 2,(IY+65) ; If "Characters Can't Move" flag is set... 55237 RET NZ ; ...then return without moving characters 55238 LD A,(55218) ; Load "character to move" index into A 55241 INC A ; Increase by one, but cap at 31 and reset to zero if now above this... 55242 AND 31 ; ... 55244 LD (55218),A ; ... 55247 AND 24 ; Return if value is over 7... 55249 RET NZ ; ... 55250 LD A,(55218) ; Load "character to move" index into A 55253 OR A ; If value is not zero... 55254 JR NZ,55264 ; ...then skip ahead to #R55264 55256 LD A,(23468) ; If Gimbal is not free... 55259 AND 1 ; ... 55261 RET Z ; ...then return 55262 JR 55274 ; Skip ahead to #R55274 *55264 CP 7 ; If value is not 7... 55266 JR NZ,55274 ; ...then skip ahead to #R55274 55268 LD A,(23467) ; If Banshee not released... 55271 AND 1 ; ... 55273 RET Z ; ...then return *55274 LD A,(55218) ; Load A with "character to move" index 55277 LD E,6 ; Point HL at character's "asleep flag"... 55279 CALL 34174 ; ... 55282 BIT 7,(HL) ; ...and if character is asleep... 55284 RET NZ ; ...then return 55285 LD A,(55218) ; Load "character to move" index into A 55288 LD C,A ; Multiply by three (as data entries are three bytes wide)... 55289 ADD A,A ; ... 55290 ADD A,C ; ... 55291 LD C,A ; Load into BC... 55292 LD B,0 ; ... 55294 LD HL,25440 ; Point HL at start of current character positions table 55297 ADD HL,BC ; Add BC as offset 55298 LD A,(65529) ; Load Magic Knight's current room into A 55301 CP (HL) ; If Magic Knight and the character are both in the same room... 55302 RET Z ; ...then return 55303 LD B,A ; Copy Magic Knight's current room into B 55304 LD A,(HL) ; If character's current room is not 99... 55305 CP 99 ; ... 55307 JR NZ,55319 ; ...then jump to #R55319 55309 CP 100 ; If character's current room is 100 (i.e. character has been sent home)... [bug: can't happen ; as won't reach this instruction if room is 100] 55311 RET Z ; ...then return 55312 LD A,(55218) ; Current room is 99 (character has been commanded to go away), so calculate the index of that ; character's "Go Away Base Room"... 55315 ADD A,A ; ...((4 x Character Index) + 5)... 55316 ADD A,A ; ... 55317 ADD A,5 ; ... *55319 CALL 55404 ; Load A with new room index for character to move into based upon current room 55322 CP 255 ; If new room index is 255... 55324 RET Z ; ...then return 55325 CP B ; If new room index is same as Magic Knight's current room... 55326 RET Z ; ...then return 55327 PUSH AF ; Store AF (A = new room index) 55328 LD C,A ; Load new room index into C 55329 LD A,(55218) ; Load "character to move" index into B... 55332 LD B,A ; ... 55333 PUSH HL ; Store HL (pointer to character's current room) 55334 CALL 36327 ; Assign a slot in room C to character B and get x- and y-coordinates in BC 55337 POP HL ; Restore HL (pointer to character's current room) 55338 POP DE ; Restore DE (was AF, now D = new room index) 55339 CP 4 ; If new room is full... 55341 RET Z ; ...then return 55342 LD A,D ; Copy new room index into A 55343 LD (HL),A ; Set character to be at coordinates (C, B) in room A... 55344 INC HL ; ... 55345 LD (HL),C ; ... 55346 INC HL ; ... 55347 LD (HL),B ; ... 55348 RET ; Return ; Move the Lift to a Random Floor if Magic Knight is not Nearby ; ; Used by the routine at #R54996. c55349 LD A,(65529) ; Load Magic Knight's current room into A 55352 OR A ; Return is Magic Knight is in the Lift (room 0)... 55353 RET Z ; ... 55354 DEC A ; Return if Magic Knight is in a room that connects with the lift... 55355 AND 7 ; ... 55357 RET Z ; ... 55358 LD B,6 ; Load A with a random number less than or equal to 6... 55360 CALL 38505 ; ... 55363 LD B,A ; Copy random number into B 55364 LD A,(23411) ; Load A with game progress flags 55367 AND 1 ; If the Lift is fixed... 55369 JR NZ,55378 ; ...then jump to #R55378 55371 LD A,B ; Else copy random number back to A 55372 CP 5 ; If random number is 5 or 6 then return... 55374 RET Z ; ... 55375 CP 6 ; ... 55377 RET Z ; ... *55378 PUSH BC ; Store BC... 55379 CALL 33770 ; ...set the Lift as not being at any floor at all... 55382 POP AF ; ...and restore BC value to AF 55383 LD (23382),A ; Set Lift control panel light corresponding with previous randomly generated number to glow 55386 ADD A,A ; Multiply A by eight... 55387 ADD A,A ; ... 55388 ADD A,A ; ... 55389 INC A ; ...and add one to get first room on "random" floor 55390 LD (41712),A ; Set right-exit of Lift to first room on floor 55393 ADD A,A ; Double room number 55394 LD D,0 ; Load into DE... 55396 LD E,A ; ... 55397 LD HL,41711 ; Point HL at start of room connectivity data 55400 ADD HL,DE ; Add offset for left-exit of first room on random floor... 55401 LD (HL),0 ; ...and set this exit to lead to the Lift 55403 RET ; Return ; Load A with New Room Index for a Character to Move into ; ; This routine causes a character to leave his / her current room and move to an adjacent room if that character has ; a current room index not equal to 99. In this case, the value of A upon entering this routine is the index of that ; character's current room. Input: A Character's current room index, or ((4 x character index) + 5) Output: A New ; room index for character to move into c55404 PUSH HL ; Store HL 55405 PUSH DE ; Store DE 55406 ADD A,A ; Load double A (now either "character to move" index x 8 + 10, or double a room index) into ; E... 55407 LD E,A ; ... 55408 LD A,(55218) ; Load "character to move" index into A 55411 AND 1 ; Discard all but bit 0 (odd / even) 55413 LD D,A ; Load 0 for even-numbered character (EC), or 1 for odd-numbered character (OC) into D 55414 LD A,(23404) ; Load A with number of hours left 55417 AND 1 ; Set A to 0 for even number of hours left (EH), or 1 for odd number of hours left (OH) 55419 XOR D ; Set A to 0 for EH / EC or OH/OH, and 1 for EH / OC or OH / EC 55420 ADD A,E ; Add A (0 or 1, i.e. left or right) to double room index in DE... 55421 LD E,A ; ... 55422 LD D,0 ; ... 55424 LD HL,41711 ; Point HL at table of room connectivity data 55427 ADD HL,DE ; Add DE as offset 55428 LD A,(HL) ; Load room index off current room's exit of interest 55429 CP 255 ; If 255 (i.e. no exit from room)... 55431 JR Z,55456 ; ...return with A = 255 55433 CP 34 ; If 34 (i.e. "The Gas Room")... 55435 JR Z,55456 ; ...return with A = 255 55437 CP 18 ; If 18 (i.e. "The Little Bottle")... 55439 JR Z,55456 ; ...return with A = 255 55441 CP 46 ; If 46 (i.e. "The Pit")... 55443 JR Z,55456 ; ...return with A = 255 55445 CP 9 ; If 9 (i.e. "The Tower")... 55447 JR Z,55456 ; ...return with A = 255 55449 CP 29 ; If 29 (i.e. "The Wall")... 55451 JR Z,55456 ; ...return with A = 255 55453 POP DE ; Restore DE 55454 POP HL ; Restore HL 55455 RET ; Return *55456 LD A,255 ; Set A to 255 (to denote that chosen room exit is impassable) 55458 POP DE ; Restore DE 55459 POP HL ; Restore HL 55460 RET ; Return ; Interrupt Routine End Game Due to a Character Starving to Death ; ; Used by the routine at #R55077. Input: C Index of character who has starved to death c55461 LD A,C ; Set starved character to be Current Character... 55462 LD (30615),A ; ... 55465 POP HL ; Restore HL (return address from call to "Update All Characters' Stats (Deteriorate or ; Regenerate) and Wake Up / Send to Sleep if Required" routine at 55077) 55466 POP HL ; Restore HL (return address from call to "Update Game Time, Time Left and (Every Minute) ; Read-Text of Crystal Ball" routine at #R54996) 55467 CALL 55574 ; Restore all registers from stack 55470 POP HL ; Restore HL (return address from call to interrupt routine) 55471 LD HL,51787 ; Point HL at "[CHARACTER] HAS STARVED TO DEATH..." text 55474 EI ; Enable interrupts 55475 JP 35101 ; Jump to Game Over routine and return to pre-game menu ; Interrupt Routine End Game Due to Running Out of Time ; ; Used by the routine at #R54996. c55478 POP HL ; Restore HL (return address from call to "Update Game Time, Time Left and (Every Minute) ; Read-Text of Crystal Ball" routine at #R54996) 55479 CALL 55574 ; Restore all registers from stack 55482 POP HL ; Restore HL (return address from call to interrupt routine) 55483 LD HL,51898 ; Point HL at "YOU RAN OUT OF TIME" text 55486 EI ; Enable interrupts 55487 JP 35101 ; Jump to Game Over routine and return to pre-game menu ; Characters' Rates of Stat Regeneration ; ; Stats are in order: b55490 DEFB 255,255,253,252,10,8,15,10 ; Gimbal (-1, -1, -3, -4, 10, 8, 15, 10) 55498 DEFB 250,253,255,255,5,3,4,1 ; Thor (-6, -3, -1, -1, 5, 3, 4, 1) 55506 DEFB 253,255,252,251,3,7,4,8 ; Florin (-3, -1, -4, -5, 3, 7, 4, 8) 55514 DEFB 253,254,252,252,7,8,3,9 ; Orik (-3, -2, -4, -4, 7, 8, 3, 9) 55522 DEFB 255,253,253,255,10,2,10,1 ; Samsun (-1, -3, -3, -1, 10, 2, 10, 1) 55530 DEFB 253,254,252,250,8,4,4,8 ; Elrand (-3, -2, -4, -6, 8, 4, 4, 8) 55538 DEFB 253,254,252,252,8,4,4,3 ; Rosmar (-3, -2, -4, -4, 8, 4, 4, 3) ; Store All Registers on the Stack ; ; Used by the routine at #R54853. c55546 EX (SP),HL ; Place HL onto stack in place of top entry (the address of the CALL to this routine is now in ; HL) 55547 PUSH DE ; Store registers AF, BC & DE... 55548 PUSH BC ; ... 55549 PUSH AF ; ... 55550 EX AF,AF' ; Store shadow registers too... 55551 EXX ; ... 55552 PUSH HL ; ... 55553 PUSH DE ; ... 55554 PUSH BC ; ... 55555 PUSH AF ; ... 55556 EX AF,AF' ; ... 55557 EXX ; ... 55558 PUSH IX ; Store IX 55560 PUSH IY ; Store IY 55562 PUSH HL ; Store HL (address of call to this routine) 55563 PUSH AF ; Store AF 55564 LD HL,23 ; Restore original value of HL (as switched with top of stack at beginning of this routine)... 55567 ADD HL,SP ; ... 55568 LD A,(HL) ; ... 55569 DEC HL ; ... 55570 LD L,(HL) ; ... 55571 LD H,A ; ... 55572 POP AF ; Restore AF 55573 RET ; Return ; Interrupt Routine Restore All Registers from the Stack ; ; Used by the routines at #R54853, #R55461 and #R55478. c55574 POP HL ; Restore registers HL, IY & IX (HL has address of call to this routine, i.e. 55574)... 55575 POP IY ; ... 55577 POP IX ; ... 55579 EX AF,AF' ; Restore shadow registers too... 55580 EXX ; ... 55581 POP AF ; ... 55582 POP BC ; ... 55583 POP DE ; ... 55584 POP HL ; ... 55585 EX AF,AF' ; ... 55586 EXX ; ... 55587 POP AF ; Restore AF, BC, DE... 55588 POP BC ; ... 55589 POP DE ; ... 55590 EX (SP),HL ; Put HL (address of call to 55574) back on stack in preparation for RET and take off original ; value of HL 55591 RET ; Return ; Source Code Fragment ; ; This source code fragment appears to be part of the routine at #R55077, dealing with characters' stat regeneration ; / deterioration b55592 DEFM "M",141 55594 DEFM "LD HL,DETAILSCUPD1+8",141 55615 DEFM "LD IX,DETAILSC+8",141 55632 DEFM "DEC B",141 55638 DEFM "ICUPD1:BIT 7,(IX+6)",141 55658 DEFM "JR Z,ICUPDAS1 ",59,"AWAKE",141 55679 DEFM 59,"ASLEEP",141 55687 DEFM "INC HL",141 55694 DEFM "INC HL",141 55701 DEFM "INC HL",141 55708 DEFM "INC HL",141 55715 DEFM "I" ; Graphics (Scenery Part 1) Right bookend (3 x 2) b55716 DEFB 192,0,0,224,0,0,254,0 55724 DEFB 0,255,128,0,225,192,0,193 55732 DEFB 192,0,206,224,0,222,224,0 55740 DEFB 217,199,128,223,143,192,206,31 55748 DEFB 224,192,60,112,224,121,176,216 55756 DEFB 241,48,207,192,112,255,255,224 ; Left bookend (3 x 2) 55764 DEFB 0,0,3,0,0,7,0,0 55772 DEFB 127,0,1,255,0,3,135,0 55780 DEFB 3,131,0,7,115,0,7,123 55788 DEFB 1,227,155,3,241,251,7,248 55796 DEFB 115,14,60,3,13,158,7,12 55804 DEFB 143,27,14,3,243,7,255,255 ; Books (1) (5 x 2) 55812 DEFB 254,3,248,15,240,130,2,8 55820 DEFB 15,240,254,114,232,12,48,198 55828 DEFB 114,168,9,144,254,114,233,203 55836 DEFB 208,254,114,233,74,80,198,114 55844 DEFB 233,202,80,146,114,233,202,80 55852 DEFB 186,114,233,203,208,186,114,233 55860 DEFB 203,208,186,114,233,203,208,186 55868 DEFB 114,233,203,208,186,114,233,202 55876 DEFB 80,146,114,233,201,144,198,114 55884 DEFB 9,76,48,254,115,249,207,240 ; Books (2) (5 x 3) 55892 DEFB 0,0,0,0,0,0,0,0 55900 DEFB 0,0,0,0,0,0,0,254 55908 DEFB 0,0,0,0,254,0,0,3 55916 DEFB 252,198,0,0,3,252,130,0 55924 DEFB 0,3,156,186,0,0,3,12 55932 DEFB 130,15,240,3,12,130,15,243 55940 DEFB 243,108,186,12,51,51,12,130 55948 DEFB 9,146,19,12,131,203,210,211 55956 DEFB 12,147,74,82,211,12,131,202 55964 DEFB 82,19,12,131,202,82,147,12 55972 DEFB 131,203,210,19,12,131,203,210 55980 DEFB 19,12,131,203,210,19,108,187 55988 DEFB 203,210,19,108,187,202,82,211 55996 DEFB 12,131,201,146,19,156,199,76 56004 DEFB 51,51,252,255,207,243,243,252 ; Books (3) (5 x 3) 56012 DEFB 0,0,0,0,0,0,0,0 56020 DEFB 0,0,0,0,0,0,0,254 56028 DEFB 0,0,0,0,254,0,0,3 56036 DEFB 252,198,0,0,3,252,130,0 56044 DEFB 0,3,156,186,0,0,3,12 56052 DEFB 130,248,0,3,12,130,248,7 56060 DEFB 243,108,186,136,6,51,12,130 56068 DEFB 139,228,19,12,130,251,229,211 56076 DEFB 12,146,218,37,211,12,130,250 56084 DEFB 36,19,12,130,251,228,147,12 56092 DEFB 130,251,228,19,12,130,250,36 56100 DEFB 19,12,130,250,36,19,108,186 56108 DEFB 250,36,19,108,186,218,37,211 56116 DEFB 12,130,250,36,19,156,198,138 56124 DEFB 38,51,252,254,251,231,243,252 ; Books (4) (5 x 2) 56132 DEFB 240,15,240,3,248,240,15,240 56140 DEFB 2,8,144,12,48,114,232,144 56148 DEFB 9,144,114,168,147,203,208,114 56156 DEFB 232,146,74,80,114,232,147,202 56164 DEFB 80,114,232,243,202,80,114,232 56172 DEFB 243,203,208,114,232,243,203,208 56180 DEFB 114,232,243,203,208,114,232,243 56188 DEFB 203,208,114,232,147,202,80,114 56196 DEFB 232,243,201,144,114,232,146,76 56204 DEFB 48,114,8,243,207,240,115,248 ; Ceiling Candles (3 x 6) 56212 DEFB 0,0,0,31,255,248,15,255 56220 DEFB 240,0,0,0,0,255,0,0 56228 DEFB 255,0,0,60,0,0,24,0 56236 DEFB 0,24,0,0,24,0,0,24 56244 DEFB 0,0,24,0,0,24,0,0 56252 DEFB 24,0,0,24,0,0,24,0 56260 DEFB 0,24,0,0,24,0,8,24 56268 DEFB 0,28,24,0,28,24,0,28 56276 DEFB 24,0,8,24,0,0,24,0 56284 DEFB 30,24,0,62,24,0,58,24 56292 DEFB 0,122,24,8,94,24,12,94 56300 DEFB 24,28,124,24,28,124,24,24 56308 DEFB 124,24,8,60,24,32,60,24 56316 DEFB 56,60,24,44,60,24,60,60 56324 DEFB 24,60,255,24,255,255,24,255 56332 DEFB 0,8,0,255,255,255,127,255 56340 DEFB 254,0,0,0,63,255,252,0 56348 DEFB 60,0,0,0,0,0,0,0 ; Big Bottle Top (4 x 4) 56356 DEFB 0,15,240,0,0,25,248,0 56364 DEFB 0,25,248,0,0,31,248,0 56372 DEFB 0,0,0,0,0,15,240,0 56380 DEFB 0,15,240,0,0,0,0,0 56388 DEFB 0,31,240,0,0,239,246,0 56396 DEFB 2,79,251,128,6,15,253,192 56404 DEFB 14,15,252,96,31,31,251,176 56412 DEFB 27,31,250,144,57,191,196,216 56420 DEFB 49,191,132,220,1,127,132,140 56428 DEFB 0,95,143,36,2,191,188,98 56436 DEFB 6,127,240,98,180,255,240,226 56444 DEFB 181,255,224,194,173,255,225,218 56452 DEFB 171,255,243,250,219,111,247,254 56460 DEFB 219,39,255,242,211,3,255,248 56468 DEFB 193,3,255,192,229,3,255,128 56476 DEFB 229,131,255,194,246,231,131,254 ; Big / Little Bottle Body (4 x 4) 56484 DEFB 247,119,0,126,119,119,0,252 56492 DEFB 111,119,48,60,111,118,255,252 56500 DEFB 111,173,255,252,111,172,7,252 56508 DEFB 55,160,3,248,55,156,3,248 56516 DEFB 59,126,15,248,42,255,199,248 56524 DEFB 52,255,247,248,54,127,255,248 56532 DEFB 23,127,255,240,27,127,255,240 56540 DEFB 27,56,127,240,27,176,31,240 56548 DEFB 29,176,7,240,14,32,127,224 56556 DEFB 15,32,15,224,3,135,255,224 56564 DEFB 13,223,255,224,13,223,129,192 56572 DEFB 6,95,3,192,7,158,1,192 56580 DEFB 7,209,143,192,7,207,255,192 56588 DEFB 7,223,255,192,7,159,255,128 56596 DEFB 2,63,254,0,3,15,225,128 56604 DEFB 1,240,31,0,0,31,248,0 ; Little Bottle Top (4 x 2) 56612 DEFB 0,15,192,0,0,127,252,0 56620 DEFB 0,239,254,0,0,207,254,0 56628 DEFB 0,239,254,0,0,255,254,0 56636 DEFB 0,127,252,0,0,0,0,0 56644 DEFB 0,255,254,0,1,143,255,0 56652 DEFB 0,255,254,0,0,0,0,0 56660 DEFB 3,249,255,128,27,197,255,240 56668 DEFB 115,185,240,60,247,187,128,126 ; Stag's Head (6 x 7) 56676 DEFB 0,0,0,0,0,0,0,0 56684 DEFB 0,0,6,0,0,0,0,0 56692 DEFB 6,0,0,24,0,0,7,0 56700 DEFB 0,24,0,0,7,0,0,24 56708 DEFB 0,0,7,3,0,24,0,0 56716 DEFB 7,3,12,28,0,0,7,3 56724 DEFB 12,28,0,12,7,199,14,60 56732 DEFB 7,156,15,255,15,60,15,223 56740 DEFB 207,254,7,254,30,199,255,224 56748 DEFB 0,254,56,0,126,0,0,15 56756 DEFB 56,0,124,0,0,7,240,0 56764 DEFB 28,0,0,1,240,0,120,0 56772 DEFB 0,0,56,1,240,0,0,0 56780 DEFB 28,15,224,0,0,0,30,31 56788 DEFB 128,0,0,0,14,28,0,0 56796 DEFB 0,0,7,24,127,0,0,7 56804 DEFB 231,24,195,0,0,3,187,41 56812 DEFB 142,0,0,3,9,203,24,0 56820 DEFB 0,1,137,203,24,0,0,1 56828 DEFB 206,251,240,0,0,0,127,255 56836 DEFB 224,0,0,0,7,252,0,0 56844 DEFB 0,0,13,236,0,0,0,0 56852 DEFB 14,222,0,0,0,0,30,222 56860 DEFB 0,0,0,0,31,254,0,0 56868 DEFB 0,0,31,254,0,0,0,0 56876 DEFB 31,250,0,0,0,0,23,248 56884 DEFB 0,0,0,0,7,248,0,0 56892 DEFB 0,0,36,12,0,0,0,0 56900 DEFB 104,101,0,0,0,0,236,37 56908 DEFB 128,0,0,1,204,5,192,0 56916 DEFB 0,1,151,28,224,0,0,3 56924 DEFB 215,59,96,0,0,3,216,5 56932 DEFB 48,0,0,3,156,77,176,0 56940 DEFB 0,3,15,253,176,0,0,2 56948 DEFB 110,245,192,0,0,1,238,97 56956 DEFB 240,0,0,1,236,105,224,0 56964 DEFB 0,0,225,125,128,0,0,0 56972 DEFB 103,63,0,0,0,0,15,188 56980 DEFB 0,0,0,0,0,0,0,0 56988 DEFB 0,0,0,0,0,0,0,0 56996 DEFB 0,0,0,0,0,0,7,248 57004 DEFB 0,0,0,0,7,248,0,0 ; Wall Clock (3 x 10) 57012 DEFB 0,8,0,0,8,0,0,28 57020 DEFB 0,0,28,0,0,62,0,0 57028 DEFB 227,128,1,193,192,1,193,192 57036 DEFB 1,193,128,28,227,56,62,126 57044 DEFB 124,48,0,12,48,255,12,51 57052 DEFB 1,204,22,124,104,29,239,48 57060 DEFB 59,199,184,51,199,152,119,239 57068 DEFB 220,119,239,220,116,206,92,119 57076 DEFB 31,220,119,31,220,67,255,132 57084 DEFB 59,239,152,125,239,60,108,124 57092 DEFB 100,127,3,252,63,255,248,0 57100 DEFB 0,0,252,0,126,127,255,252 57108 DEFB 0,0,0,112,255,28,227,129 57116 DEFB 134,206,124,230,253,198,126,123 57124 DEFB 3,60,0,0,0,63,255,248 57132 DEFB 31,255,240,0,0,0,3,131 57140 DEFB 128,1,255,0,0,130,0,0 57148 DEFB 68,0,0,130,0,0,68,0 57156 DEFB 0,130,0,0,68,0,0,130 57164 DEFB 0,0,68,0,0,130,0,0 57172 DEFB 68,0,0,130,0,0,68,0 57180 DEFB 0,130,0,0,68,0,0,130 57188 DEFB 0,0,68,0,0,130,0,1 57196 DEFB 196,0,1,194,0,3,228,0 57204 DEFB 3,226,0,3,164,0,3,34 57212 DEFB 0,3,36,0,1,194,0,0 57220 DEFB 4,0,0,2,0,0,4,0 57228 DEFB 0,6,0,0,15,0,0,15 57236 DEFB 0,0,31,128,0,30,128,0 57244 DEFB 28,128,0,24,128,0,15,0 ; Unknown (2 x 5) 57252 DEFB 3,160,7,224,0,0,31,224 57260 DEFB 63,48,63,144,63,16,31,224 57268 DEFB 0,0,15,224,30,240,22,240 57276 DEFB 63,176,43,240,43,80,43,80 57284 DEFB 47,88,111,200,95,216,93,248 57292 DEFB 95,236,87,228,95,164,122,164 57300 DEFB 58,180,43,148,105,180,109,164 57308 DEFB 100,236,68,232,69,232,205,232 57316 DEFB 253,108,237,100,237,228,167,166 57324 DEFB 4,130,4,0,0,0,0,0 ; Unknown (2 x 2) 57332 DEFB 3,160,7,32,15,64,15,192 57340 DEFB 31,128,31,64,30,224,13,160 57348 DEFB 3,160,7,32,15,64,15,192 57356 DEFB 31,128,31,64,30,224,13,160 ; Plant (1) (2 x 5) 57364 DEFB 0,0,0,0,7,128,12,192 57372 DEFB 8,64,8,96,15,32,13,160 57380 DEFB 12,160,8,167,0,173,0,168 57388 DEFB 12,239,124,157,70,128,66,120 57396 DEFB 66,252,194,156,130,156,134,158 57404 DEFB 181,158,245,182,213,22,221,22 57412 DEFB 141,22,141,18,141,18,13,32 57420 DEFB 13,96,9,96,11,64,11,64 57428 DEFB 11,70,10,79,10,201,10,143 57436 DEFB 10,157,10,48,10,0,0,0 ; Plant (2) (2 x 5) 57444 DEFB 4,64,12,32,12,32,12,96 57452 DEFB 14,224,7,192,7,192,3,128 57460 DEFB 3,0,1,0,1,0,1,60 57468 DEFB 1,126,1,126,13,126,30,248 57476 DEFB 30,128,28,128,12,136,4,156 57484 DEFB 4,156,4,156,4,136,3,136 57492 DEFB 1,56,1,64,17,64,57,64 57500 DEFB 57,128,57,28,13,124,5,252 57508 DEFB 7,24,1,0,3,0,2,0 57516 DEFB 2,0,2,0,2,0,0,0 ; Wall Axes (8 x 5) 57524 DEFB 0,0,64,0,0,2,0,0 57532 DEFB 0,6,224,0,0,7,96,0 57540 DEFB 0,13,176,0,0,13,176,0 57548 DEFB 0,11,152,0,0,25,208,0 57556 DEFB 0,7,204,0,0,51,224,0 57564 DEFB 0,15,228,0,0,39,240,0 57572 DEFB 0,63,246,0,0,111,252,0 57580 DEFB 1,255,243,0,0,207,255,128 57588 DEFB 15,255,249,128,1,159,255,240 57596 DEFB 63,255,252,192,3,63,255,28 57604 DEFB 113,255,254,192,3,127,255,140 57612 DEFB 35,255,254,96,6,127,255,236 57620 DEFB 51,255,255,48,12,255,255,232 57628 DEFB 51,255,255,152,25,255,255,248 57636 DEFB 27,255,255,252,63,255,255,248 57644 DEFB 31,255,255,224,7,255,255,240 57652 DEFB 15,255,255,216,27,255,255,240 57660 DEFB 7,255,255,188,61,255,255,224 57668 DEFB 7,255,255,158,121,255,255,192 57676 DEFB 3,255,255,30,248,255,255,192 57684 DEFB 1,255,254,13,240,127,255,128 57692 DEFB 0,255,254,3,224,127,255,0 57700 DEFB 0,127,236,3,224,51,254,0 57708 DEFB 0,63,216,7,208,25,252,0 57716 DEFB 0,30,16,15,184,12,120,0 57724 DEFB 0,6,48,31,188,12,224,0 57732 DEFB 0,3,224,63,126,7,192,0 57740 DEFB 0,0,224,62,63,7,0,0 57748 DEFB 0,0,0,126,31,128,0,0 57756 DEFB 0,0,0,252,31,128,0,0 57764 DEFB 0,0,1,248,15,192,0,0 57772 DEFB 0,0,3,240,6,96,0,0 57780 DEFB 0,0,7,240,3,48,0,0 57788 DEFB 0,0,7,96,1,184,0,0 57796 DEFB 0,0,14,64,0,140,0,0 57804 DEFB 0,0,28,192,0,196,0,0 57812 DEFB 0,0,49,128,0,98,0,0 57820 DEFB 0,0,57,0,0,44,0,0 57828 DEFB 0,0,31,0,0,56,0,0 57836 DEFB 0,0,14,0,0,0,0,0 ; Tree Top (1) (6 x 4) 57844 DEFB 0,0,0,20,0,0,0,0 57852 DEFB 0,28,0,0,0,0,64,14 57860 DEFB 0,0,0,0,66,14,0,0 57868 DEFB 0,0,38,6,0,0,0,0 57876 DEFB 24,6,0,0,4,0,16,7 57884 DEFB 3,0,4,0,16,5,195,0 57892 DEFB 6,0,32,7,227,16,6,15 57900 DEFB 192,0,179,16,6,0,252,0 57908 DEFB 151,48,3,0,7,0,215,32 57916 DEFB 3,128,7,0,71,240,3,130 57924 DEFB 7,0,30,8,1,142,7,199 57932 DEFB 246,6,1,145,199,255,252,0 57940 DEFB 1,160,3,255,240,0,1,192 57948 DEFB 1,255,132,0,1,224,1,248 57956 DEFB 60,0,0,190,3,240,120,0 57964 DEFB 0,195,195,224,120,0,0,127 57972 DEFB 247,224,240,0,0,3,255,224 57980 DEFB 240,0,0,1,255,225,208,0 57988 DEFB 0,7,127,251,176,0,252,12 57996 DEFB 60,255,160,0,15,251,190,95 58004 DEFB 96,0,0,255,255,127,192,0 58012 DEFB 0,15,127,127,128,0,0,2 58020 DEFB 15,255,0,0,0,0,7,255 58028 DEFB 0,0,0,0,7,255,0,0 ; Tree Trunk (1) (4 x 5) 58036 DEFB 0,7,254,0,0,7,246,0 58044 DEFB 0,7,183,0,0,7,183,0 58052 DEFB 0,7,55,128,0,15,63,128 58060 DEFB 0,14,63,128,0,12,159,128 58068 DEFB 0,9,223,128,0,10,62,128 58076 DEFB 0,10,22,128,0,10,214,128 58084 DEFB 0,10,23,128,0,11,55,128 58092 DEFB 0,9,63,128,0,13,127,0 58100 DEFB 0,13,95,0,0,13,190,0 58108 DEFB 0,28,126,0,0,30,126,0 58116 DEFB 0,30,126,0,0,30,126,0 58124 DEFB 0,30,251,0,0,30,251,0 58132 DEFB 0,63,123,0,0,59,123,0 58140 DEFB 0,59,127,0,0,123,247,0 58148 DEFB 0,123,247,0,0,127,247,0 58156 DEFB 0,127,254,0,0,254,254,0 58164 DEFB 0,254,238,0,0,254,238,0 58172 DEFB 0,255,247,0,0,62,247,0 58180 DEFB 7,158,247,0,31,255,119,0 58188 DEFB 255,255,159,224,248,31,131,248 ; Lift Door (2 x 4) 58196 DEFB 251,223,243,207,235,215,219,219 58204 DEFB 187,221,123,222,251,223,251,223 58212 DEFB 251,223,251,223,123,222,187,221 58220 DEFB 219,219,235,215,243,207,251,223 58228 DEFB 251,223,243,207,235,215,219,219 58236 DEFB 187,221,123,222,251,223,251,223 58244 DEFB 251,223,251,223,123,222,187,221 58252 DEFB 219,219,235,215,243,207,251,223 ; Mushroom (1) (2 x 2) 58260 DEFB 0,0,0,0,7,192,31,120 58268 DEFB 47,220,125,100,127,254,127,254 58276 DEFB 56,62,3,156,3,192,7,192 58284 DEFB 7,224,7,224,7,224,3,192 ; Mushroom (2) (2 x 2) 58292 DEFB 0,0,0,0,31,128,121,192 58300 DEFB 208,224,223,160,250,48,127,48 58308 DEFB 15,208,27,144,61,240,125,228 58316 DEFB 120,30,248,30,248,132,113,204 ; Mushroom (3) (2 x 2) 58324 DEFB 0,0,0,0,0,0,7,240 58332 DEFB 29,188,55,110,63,255,127,255 58340 DEFB 60,31,25,204,3,224,1,225 58348 DEFB 1,225,3,227,3,230,1,198 ; Mushroom (4) (2 x 2) 58356 DEFB 0,0,0,0,7,128,31,112 58364 DEFB 53,248,127,248,239,248,254,56 58372 DEFB 189,192,251,224,247,224,119,240 58380 DEFB 3,248,3,248,3,248,1,240 ; Large Mushroom (3 x 3) 58388 DEFB 0,0,0,0,0,0,7,254 58396 DEFB 0,31,7,128,62,123,224,49 58404 DEFB 18,48,118,198,144,118,254,88 58412 DEFB 113,243,24,125,241,252,127,255 58420 DEFB 132,126,31,182,60,15,150,60 58428 DEFB 1,198,24,1,254,4,145,242 58436 DEFB 15,240,242,13,241,226,13,241 58444 DEFB 252,27,227,248,27,231,224,31 58452 DEFB 224,0,31,224,0,15,192,0 ; Lift Control Panel (4 x 9) (see bug) 58460 DEFB 3,255,255,192,15,255,255,240 58468 DEFB 12,0,0,48,24,211,187,152 58476 DEFB 24,146,170,152,24,210,171,24 58484 DEFB 24,155,186,152,24,0,0,24 58492 DEFB 24,0,0,24,24,0,124,24 58500 DEFB 24,124,126,24,24,124,102,24 58508 DEFB 24,124,124,24,24,124,126,24 58516 DEFB 24,0,102,24,24,0,102,24 58524 DEFB 24,0,0,24,24,0,28,24 58532 DEFB 24,124,60,24,24,124,108,24 58540 DEFB 24,124,126,24,24,124,126,24 58548 DEFB 24,0,12,24,24,0,12,24 58556 DEFB 24,0,0,24,24,0,60,24 58564 DEFB 24,124,126,24,24,124,102,24 58572 DEFB 24,124,28,24,24,124,102,24 58580 DEFB 24,0,126,24,24,0,60,24 58588 DEFB 24,0,0,24,24,0,60,24 58596 DEFB 24,124,126,24,24,124,14,24 58604 DEFB 24,124,60,24,24,124,112,24 58612 DEFB 24,0,126,24,24,0,126,24 58620 DEFB 24,0,0,24,24,0,28,24 58628 DEFB 24,124,60,24,24,124,44,24 58636 DEFB 24,124,12,24,24,124,12,24 58644 DEFB 24,0,63,24,24,0,63,24 58652 DEFB 24,0,0,24,24,0,62,24 58660 DEFB 24,124,126,24,24,124,96,24 58668 DEFB 24,124,110,24,24,124,102,24 58676 DEFB 24,0,126,24,24,0,60,24 58684 DEFB 24,0,0,24,24,0,124,24 58692 DEFB 24,124,126,24,24,124,102,24 58700 DEFB 24,124,124,24,24,124,102,24 58708 DEFB 24,0,126,24,24,0,124,24 58716 DEFB 24,0,0,24,8,0,0,48 58724 DEFB 15,255,255,240,3,255,255,192 58732 DEFB 0,0,0,0,0,0,0,0 58740 DEFB 0,0,0,0,0,0,0,0 ; Graphics (Characters) ; ; All character graphics are (2 x 4). Gimbal the Wizard b58748 DEFB 2,0,2,0,3,0,3,128 58756 DEFB 7,64,7,96,6,48,7,112 58764 DEFB 15,96,15,152,0,48,31,206 58772 DEFB 0,31,25,191,18,54,51,0 58780 DEFB 51,246,49,206,50,28,3,252 58788 DEFB 112,248,120,250,236,122,28,59 58796 DEFB 220,179,222,199,62,127,254,127 58804 DEFB 254,110,223,126,223,110,78,124 ; Thor 58812 DEFB 0,0,0,0,0,240,3,252 58820 DEFB 7,134,14,0,12,102,28,111 58828 DEFB 30,31,18,22,22,0,19,28 58836 DEFB 27,178,31,254,25,252,16,252 58844 DEFB 22,120,15,0,15,136,14,136 58852 DEFB 14,136,14,216,6,216,9,216 58860 DEFB 13,216,5,248,3,240,0,0 58868 DEFB 3,48,2,32,7,188,7,222 ; Florin the Dwarf 58876 DEFB 0,0,0,0,0,0,0,0 58884 DEFB 0,0,0,0,0,0,0,0 58892 DEFB 8,2,8,2,28,246,29,134 58900 DEFB 60,0,52,156,38,190,38,60 58908 DEFB 63,130,27,254,9,198,0,236 58916 DEFB 0,56,6,64,15,112,9,248 58924 DEFB 25,204,17,12,51,228,55,96 58932 DEFB 6,48,6,48,5,40,3,156 ; Orik the Cleric 58940 DEFB 0,0,0,120,3,254,3,254 58948 DEFB 15,134,30,240,28,134,28,47 58956 DEFB 30,31,6,64,59,119,43,54 58964 DEFB 43,128,49,226,24,254,0,252 58972 DEFB 6,120,15,0,15,136,14,216 58980 DEFB 14,216,14,216,6,240,8,0 58988 DEFB 13,176,5,176,3,176,3,48 58996 DEFB 3,48,2,32,7,188,7,222 ; Samsun the Strong 59004 DEFB 3,240,14,56,12,12,13,36 59012 DEFB 0,140,12,216,15,56,6,80 59020 DEFB 115,230,253,223,231,51,251,239 59028 DEFB 248,30,127,238,31,156,4,120 59036 DEFB 1,224,12,0,15,240,15,208 59044 DEFB 31,176,31,56,31,120,31,120 59052 DEFB 30,120,30,56,28,120,60,120 59060 DEFB 120,112,120,120,126,126,63,62 ; Elrand Halfelven 59068 DEFB 0,0,0,128,5,144,7,226 59076 DEFB 79,114,94,5,201,21,227,7 59084 DEFB 176,114,144,250,208,244,87,12 59092 DEFB 115,216,44,0,63,136,15,240 59100 DEFB 19,224,60,24,60,56,102,56 59108 DEFB 102,108,78,236,79,192,15,196 59116 DEFB 206,204,142,192,204,192,12,192 59124 DEFB 12,192,0,0,4,32,14,112 ; Lady Rosmar 59132 DEFB 0,224,3,252,15,152,30,32 59140 DEFB 30,240,62,156,61,188,94,240 59148 DEFB 110,248,125,216,61,192,78,240 59156 DEFB 124,192,56,128,55,0,109,0 59164 DEFB 108,192,116,224,52,224,20,192 59172 DEFB 20,128,5,128,12,128,31,128 59180 DEFB 31,0,31,0,15,0,0,0 59188 DEFB 12,0,12,0,15,0,13,128 ; The Banshee 59196 DEFB 3,192,15,240,31,240,28,248 59204 DEFB 56,56,56,24,58,92,114,94 59212 DEFB 114,94,112,31,112,31,112,31 59220 DEFB 120,63,124,57,76,113,70,113 59228 DEFB 38,115,46,114,46,250,60,250 59236 DEFB 61,254,57,254,57,252,56,252 59244 DEFB 56,248,16,248,0,248,0,248 59252 DEFB 0,240,0,112,0,96,0,0 ; Graphics (Puff of Smoke) ; ; All Puff of Smoke frame graphics are (2 x 3). Frame 1 b59260 DEFB 0,0,0,0,0,0,0,0 59268 DEFB 0,0,0,0,0,0,0,0 59276 DEFB 0,0,1,128,2,64,2,64 59284 DEFB 1,128,0,0,0,0,0,0 59292 DEFB 0,0,0,0,0,0,0,0 59300 DEFB 0,0,0,0,0,0,0,0 ; Frame 2 59308 DEFB 0,0,0,0,0,0,0,0 59316 DEFB 0,0,0,0,0,0,2,128 59324 DEFB 4,96,8,16,8,16,4,0 59332 DEFB 4,32,2,64,0,0,0,0 59340 DEFB 0,0,0,0,0,0,0,0 59348 DEFB 0,0,0,0,0,0,0,0 ; Frame 3 59356 DEFB 0,0,0,0,0,0,0,0 59364 DEFB 0,0,0,0,1,128,7,224 59372 DEFB 12,240,14,112,2,0,7,96 59380 DEFB 14,112,28,240,29,240,30,224 59388 DEFB 14,0,0,0,0,0,0,0 59396 DEFB 0,0,0,0,0,0,0,0 ; Frame 4 59404 DEFB 0,0,0,0,0,0,0,0 59412 DEFB 0,0,14,112,28,56,24,56 59420 DEFB 12,16,4,16,0,0,0,0 59428 DEFB 8,32,16,24,54,24,60,112 59436 DEFB 24,32,0,0,0,0,0,0 59444 DEFB 0,0,0,0,0,0,0,0 ; Frame 5 59452 DEFB 0,0,0,0,15,0,31,128 59460 DEFB 63,204,63,222,63,190,62,126 59468 DEFB 62,30,31,60,7,0,3,112 59476 DEFB 60,124,62,60,126,254,125,254 59484 DEFB 126,254,126,126,127,124,62,56 59492 DEFB 0,0,0,0,0,0,0,0 ; Frame 6 59500 DEFB 0,0,0,0,15,0,31,128 59508 DEFB 63,204,57,222,56,150,48,6 59516 DEFB 48,14,16,12,0,0,8,0 59524 DEFB 56,12,48,12,112,14,113,134 59532 DEFB 112,198,122,126,127,124,62,56 59540 DEFB 0,0,0,0,0,0,0,0 ; Graphics (Scenery Part 2) Picture in Frame (1) (5 x 5) b59548 DEFB 127,255,255,255,254,128,0,0 59556 DEFB 0,1,223,255,255,255,251,239 59564 DEFB 255,255,255,247,183,255,255,255 59572 DEFB 237,187,255,255,255,221,188,0 59580 DEFB 0,0,61,188,0,0,0,61 59588 DEFB 188,0,0,0,61,188,0,0 59596 DEFB 0,61,188,7,128,0,61,188 59604 DEFB 15,224,0,61,188,15,224,0 59612 DEFB 61,188,15,224,0,61,188,15 59620 DEFB 224,0,61,188,7,192,0,61 59628 DEFB 188,0,0,0,61,188,0,0 59636 DEFB 0,61,188,0,0,0,61,188 59644 DEFB 0,0,240,61,188,0,7,240 59652 DEFB 61,188,0,31,252,61,188,0 59660 DEFB 127,255,61,188,3,255,255,61 59668 DEFB 188,15,255,255,61,188,255,255 59676 DEFB 255,61,188,255,255,255,61,188 59684 DEFB 255,255,255,61,188,255,255,255 59692 DEFB 61,188,255,255,255,61,188,255 59700 DEFB 255,255,61,188,255,255,255,61 59708 DEFB 188,0,0,0,61,188,0,0 59716 DEFB 0,61,187,255,255,255,221,183 59724 DEFB 240,0,63,237,175,240,0,63 59732 DEFB 245,159,255,255,255,249,176,0 59740 DEFB 0,0,13,127,255,255,255,254 ; Picture in Frame (2) (9 x 5) 59748 DEFB 0,0,0,0,0,0,0,0 59756 DEFB 0,0,0,0,0,0,0,0 59764 DEFB 0,0,63,255,255,255,255,255 59772 DEFB 255,255,252,48,0,0,0,0 59780 DEFB 0,0,0,12,47,255,255,255 59788 DEFB 255,255,255,255,244,44,0,0 59796 DEFB 0,0,0,0,0,52,43,255 59804 DEFB 255,255,255,255,255,255,212,43 59812 DEFB 255,255,255,255,255,255,255,212 59820 DEFB 43,0,0,0,0,0,0,0 59828 DEFB 212,43,0,0,0,0,0,0 59836 DEFB 0,212,43,0,0,0,0,0 59844 DEFB 0,0,212,43,0,0,0,0 59852 DEFB 0,0,0,212,43,0,28,0 59860 DEFB 0,0,0,0,212,43,0,62 59868 DEFB 0,0,0,1,80,212,43,0 59876 DEFB 62,0,0,170,1,240,212,43 59884 DEFB 0,62,0,0,254,1,240,212 59892 DEFB 43,0,28,0,0,254,85,176 59900 DEFB 212,43,0,0,0,0,223,255 59908 DEFB 240,212,43,0,0,0,0,222 59916 DEFB 124,208,212,43,0,0,0,0 59924 DEFB 222,255,240,212,43,0,0,0 59932 DEFB 0,223,227,240,212,43,0,0 59940 DEFB 0,0,223,193,240,212,43,0 59948 DEFB 0,0,0,255,193,240,212,43 59956 DEFB 0,0,0,0,127,193,240,212 59964 DEFB 43,0,0,7,255,30,0,0 59972 DEFB 212,43,62,0,127,255,192,231 59980 DEFB 252,212,43,63,131,255,195,255 59988 DEFB 255,252,212,43,63,255,255,255 59996 DEFB 255,255,252,212,43,63,231,240 60004 DEFB 127,231,252,252,212,43,59,255 60012 DEFB 199,255,255,255,252,212,43,63 60020 DEFB 255,255,255,255,255,252,212,43 60028 DEFB 0,0,0,0,0,0,0,212 60036 DEFB 43,255,255,255,255,255,255,255 60044 DEFB 212,43,255,255,255,255,255,255 60052 DEFB 255,212,42,0,0,24,0,24 60060 DEFB 0,0,52,47,255,255,248,0 60068 DEFB 31,255,255,244,40,0,0,24 60076 DEFB 0,24,0,0,12,63,255,255 60084 DEFB 255,255,255,255,255,252,0,0 60092 DEFB 0,0,0,0,0,0,0,0 60100 DEFB 0,0,0,0,0,0,0,0 ; Alternative Picture Landscape (1) (3 x 2) 60108 DEFB 0,0,0,0,0,0,0,0 60116 DEFB 0,0,0,0,112,3,192,95 60124 DEFB 135,224,112,206,52,127,255,255 60132 DEFB 127,255,251,198,31,231,255,255 60140 DEFB 255,224,254,31,252,7,255,199 60148 DEFB 255,131,223,241,255,255,143,255 ; Alternative Picture Landscape (2) (7 x 3) 60156 DEFB 0,0,0,0,0,0,0,0 60164 DEFB 0,0,0,0,0,0,0,0 60172 DEFB 0,0,0,0,0,0,12,0 60180 DEFB 0,0,0,0,0,30,0,0 60188 DEFB 0,0,0,0,31,0,0,0 60196 DEFB 0,0,0,63,0,0,0,0 60204 DEFB 0,0,30,0,0,0,0,0 60212 DEFB 0,0,0,0,0,0,0,0 60220 DEFB 0,0,0,0,0,0,0,0 60228 DEFB 0,0,0,0,0,0,0,0 60236 DEFB 62,0,0,0,0,0,0,127 60244 DEFB 128,120,0,0,11,191,247,195 60252 DEFB 206,0,0,124,255,128,115,131 60260 DEFB 192,7,255,255,248,127,191,240 60268 DEFB 63,255,255,255,7,255,252,63 60276 DEFB 227,255,255,255,255,252,63,255 60284 DEFB 227,255,255,248,252,56,255,255 60292 DEFB 254,63,15,252,63,241,255,255 60300 DEFB 255,255,140,63,255,255,31,227 60308 DEFB 255,252,63,255,255,255,255,255 60316 DEFB 252,0,0,0,0,0,0,0 ; Wall Bracketed Candle (2 x 4) 60324 DEFB 0,0,0,0,0,128,0,192 60332 DEFB 1,224,1,96,1,224,0,192 60340 DEFB 0,0,3,224,3,224,7,160 60348 DEFB 5,160,7,160,3,160,3,224 60356 DEFB 3,192,3,192,3,192,3,192 60364 DEFB 3,192,3,192,3,192,0,0 60372 DEFB 255,255,195,225,227,241,227,243 60380 DEFB 115,230,57,204,29,216,15,240 ; Right-Facing Candle Wall Bracket (3 x 2) 60388 DEFB 192,255,255,192,96,6,192,63 60396 DEFB 252,192,124,60,216,241,142,241 60404 DEFB 231,238,227,207,238,239,142,46 60412 DEFB 255,15,28,254,15,252,252,3 60420 DEFB 240,240,0,0,192,0,0,192 60428 DEFB 0,0,192,0,0,192,0,0 ; Right-Facing Candle Wall Bracket Plate (1 x 3) 60436 DEFB 0,56,112,96,96,96,224,224 60444 DEFB 192,192,192,192,192,192,192,192 60452 DEFB 192,192,192,192,192,192,192,192 ; Left-Facing Candle Wall Bracket (3 x 2) 60460 DEFB 255,255,3,96,6,3,63,252 60468 DEFB 3,60,62,3,113,143,27,119 60476 DEFB 231,143,119,243,199,116,113,247 60484 DEFB 56,240,255,63,240,127,15,192 60492 DEFB 63,0,0,15,0,0,3,0 60500 DEFB 0,3,0,0,3,0,0,3 ; Left-Facing Candle Wall Bracket Plate (1 x 3) 60508 DEFB 0,28,14,6,6,6,7,7 60516 DEFB 3,3,3,3,3,3,3,3 60524 DEFB 3,3,3,3,3,3,3,3 ; Plant (3) (2 x 5) 60532 DEFB 0,0,14,0,30,0,31,28 60540 DEFB 23,158,1,186,1,176,0,176 60548 DEFB 0,160,0,160,0,160,0,160 60556 DEFB 14,32,27,32,51,160,61,160 60564 DEFB 53,160,37,160,39,128,3,60 60572 DEFB 3,126,0,99,30,73,55,125 60580 DEFB 99,119,219,115,239,113,199,96 60588 DEFB 135,96,135,111,135,105,7,110 60596 DEFB 7,111,51,109,235,104,139,88 60604 DEFB 235,88,251,80,155,80,11,80 ; Plant (4) (2 x 3) 60612 DEFB 0,0,0,0,7,224,62,48 60620 DEFB 3,184,64,204,64,116,114,52 60628 DEFB 91,54,199,50,239,178,205,162 60636 DEFB 89,174,27,184,59,0,59,158 60644 DEFB 57,187,61,177,29,188,25,183 60652 DEFB 13,96,6,9,2,56,2,32 ; Plant (5) (2 x 3) 60660 DEFB 15,224,24,176,49,144,55,0 60668 DEFB 52,0,92,0,120,248,17,176 60676 DEFB 27,32,11,98,15,194,54,14 60684 DEFB 114,11,83,25,113,19,65,94 60692 DEFB 0,240,32,142,60,185,53,231 60700 DEFB 29,127,5,3,1,4,0,0 ; Plant (6) (2 x 3) 60708 DEFB 15,224,24,176,49,144,55,0 60716 DEFB 52,0,92,0,120,248,17,176 60724 DEFB 27,32,11,98,15,194,54,14 60732 DEFB 114,11,83,25,113,19,65,94 60740 DEFB 0,240,32,142,60,185,53,231 60748 DEFB 29,127,5,3,1,4,0,0 ; Tree Top (2) (8 x 5) 60756 DEFB 0,0,0,0,0,0,0,0 60764 DEFB 0,0,0,0,0,0,0,0 60772 DEFB 0,0,0,0,0,2,0,0 60780 DEFB 0,0,0,0,0,7,15,0 60788 DEFB 0,0,0,0,0,5,153,128 60796 DEFB 0,0,3,240,0,12,191,128 60804 DEFB 0,0,6,120,0,12,184,0 60812 DEFB 0,0,12,216,0,15,143,128 60820 DEFB 0,0,11,128,64,7,88,192 60828 DEFB 0,1,206,56,96,0,220,96 60836 DEFB 0,7,240,124,120,60,7,224 60844 DEFB 0,15,216,226,76,249,243,96 60852 DEFB 0,14,104,242,69,179,248,34 60860 DEFB 0,8,124,246,101,51,137,134 60868 DEFB 0,8,0,124,61,51,189,254 60876 DEFB 0,0,248,56,1,97,228,100 60884 DEFB 0,1,141,129,225,225,5,56 60892 DEFB 0,1,229,231,48,195,123,0 60900 DEFB 0,1,61,54,144,220,254,0 60908 DEFB 8,60,5,119,240,112,184,0 60916 DEFB 12,102,65,187,145,199,135,224 60924 DEFB 12,94,120,185,1,31,204,56 60932 DEFB 30,82,148,153,243,24,203,136 60940 DEFB 27,97,230,220,254,110,239,232 60948 DEFB 27,32,38,116,54,195,241,248 60956 DEFB 25,7,175,47,56,128,12,24 60964 DEFB 29,12,201,13,100,249,239,136 60972 DEFB 13,11,201,9,230,156,182,128 60980 DEFB 6,94,77,45,246,204,211,192 60988 DEFB 230,225,69,45,254,124,113,226 60996 DEFB 178,240,247,109,124,24,48,14 61004 DEFB 120,120,0,109,56,8,32,254 61012 DEFB 71,120,252,103,15,160,28,204 61020 DEFB 221,185,158,102,120,62,58,120 61028 DEFB 14,129,238,96,79,155,113,0 61036 DEFB 6,60,114,243,196,205,97,0 61044 DEFB 112,255,0,250,6,103,125,0 61052 DEFB 205,199,217,58,243,35,127,0 61060 DEFB 187,241,241,155,153,225,126,0 61068 DEFB 224,255,129,131,204,36,60,0 ; Tree Top (3) (8 x 5) 61076 DEFB 0,0,0,0,0,0,0,0 61084 DEFB 0,0,0,0,16,1,192,0 61092 DEFB 0,0,62,0,112,3,224,0 61100 DEFB 60,0,127,0,120,46,240,0 61108 DEFB 102,192,71,0,104,56,216,0 61116 DEFB 95,224,115,192,120,48,104,0 61124 DEFB 126,112,94,96,56,28,56,0 61132 DEFB 78,120,0,96,240,4,24,0 61140 DEFB 64,60,0,99,128,4,0,0 61148 DEFB 0,255,28,114,0,4,1,0 61156 DEFB 7,147,48,112,0,4,3,0 61164 DEFB 4,19,240,124,1,244,3,128 61172 DEFB 192,51,16,30,15,12,6,192 61180 DEFB 96,113,136,30,127,8,4,192 61188 DEFB 39,253,192,206,252,8,5,128 61196 DEFB 31,252,240,143,224,56,7,128 61204 DEFB 0,62,240,143,192,32,2,0 61212 DEFB 2,6,113,143,131,252,2,0 61220 DEFB 3,231,121,31,3,224,129,0 61228 DEFB 0,32,121,63,199,128,129,240 61236 DEFB 0,56,125,127,254,0,135,254 61244 DEFB 0,12,63,254,14,35,135,192 61252 DEFB 0,4,63,224,14,34,15,0 61260 DEFB 63,119,191,204,14,38,15,0 61268 DEFB 12,255,223,188,28,60,31,0 61276 DEFB 60,7,223,188,124,8,30,0 61284 DEFB 54,0,223,156,120,12,30,62 61292 DEFB 54,0,95,222,248,4,126,236 61300 DEFB 126,0,79,223,112,3,255,184 61308 DEFB 252,0,15,223,240,7,248,224 61316 DEFB 64,0,15,199,240,15,240,0 61324 DEFB 0,0,12,231,224,255,16,0 61332 DEFB 0,0,14,99,199,254,56,0 61340 DEFB 0,0,7,113,247,254,108,0 61348 DEFB 0,0,7,113,255,252,108,0 61356 DEFB 0,60,3,113,252,240,108,0 61364 DEFB 0,255,3,121,249,240,120,0 61372 DEFB 1,199,223,59,235,248,120,0 61380 DEFB 3,241,243,191,235,204,48,0 61388 DEFB 1,255,131,239,207,196,16,0 ; Tree Trunk (2) (8 x 5) 61396 DEFB 0,126,8,199,197,7,0,0 61404 DEFB 14,0,60,100,117,135,0,0 61412 DEFB 31,28,62,37,28,197,144,0 61420 DEFB 57,182,31,20,12,132,240,0 61428 DEFB 57,183,191,156,137,134,240,0 61436 DEFB 61,180,231,224,199,3,224,0 61444 DEFB 63,28,199,185,231,128,0,0 61452 DEFB 30,24,131,173,61,128,0,0 61460 DEFB 0,8,3,205,125,128,0,0 61468 DEFB 0,0,3,223,125,128,0,0 61476 DEFB 0,0,3,219,119,192,0,0 61484 DEFB 0,2,1,155,119,192,0,0 61492 DEFB 0,3,1,187,119,192,0,0 61500 DEFB 0,1,193,187,247,192,0,0 61508 DEFB 0,0,125,179,231,192,0,0 61516 DEFB 0,1,199,183,235,192,0,0 61524 DEFB 0,1,3,183,235,128,0,0 61532 DEFB 0,63,3,247,201,128,0,0 61540 DEFB 0,32,3,54,220,128,0,0 61548 DEFB 0,0,3,118,214,132,0,0 61556 DEFB 0,0,3,118,247,196,48,0 61564 DEFB 0,0,6,118,227,196,96,0 61572 DEFB 0,0,6,221,195,195,128,0 61580 DEFB 0,0,6,221,193,194,0,0 61588 DEFB 0,0,7,221,193,225,0,0 61596 DEFB 0,0,7,221,193,227,0,0 61604 DEFB 0,0,7,205,227,226,0,0 61612 DEFB 0,0,7,239,227,238,0,0 61620 DEFB 0,0,7,239,245,232,0,0 61628 DEFB 0,0,7,239,245,232,0,0 61636 DEFB 0,0,3,175,249,248,0,0 61644 DEFB 0,0,3,189,251,236,0,0 61652 DEFB 0,0,7,63,251,228,0,0 61660 DEFB 0,0,13,127,123,244,0,0 61668 DEFB 0,0,11,111,127,246,0,0 61676 DEFB 0,0,30,111,127,243,128,0 61684 DEFB 0,0,252,255,63,254,128,0 61692 DEFB 0,3,255,159,6,63,224,224 61700 DEFB 0,15,143,193,3,227,249,176 61708 DEFB 0,63,3,252,0,127,31,248 ; Graphics (Objects Part 1) ; ; All object graphics are (2 x 2). Trumpet b61716 DEFB 0,0,0,0,0,0,0,3 61724 DEFB 0,3,0,7,15,247,130,175 61732 DEFB 255,255,255,249,152,237,191,247 61740 DEFB 112,59,112,59,127,248,63,240 ; Four Leaf Clover 61748 DEFB 0,0,0,0,0,0,28,28 61756 DEFB 62,62,62,62,63,126,31,124 61764 DEFB 3,112,57,76,124,62,126,126 61772 DEFB 62,124,1,128,1,128,1,128 ; Advert 61780 DEFB 255,255,255,255,192,197,200,255 61788 DEFB 220,193,206,255,192,193,255,197 61796 DEFB 196,217,255,217,200,193,255,255 61804 DEFB 192,201,255,255,196,193,255,255 ; Prism 61812 DEFB 1,128,1,128,3,192,3,192 61820 DEFB 7,224,7,224,15,240,15,240 61828 DEFB 31,248,31,248,63,252,63,252 61836 DEFB 127,254,127,254,255,255,255,255 ; Graphics (Scenery Part 3) Plant Pot (1) (2 x 2) b61844 DEFB 103,254,231,255,231,255,103,254 61852 DEFB 0,0,255,255,202,147,138,145 61860 DEFB 138,145,138,145,202,147,255,255 61868 DEFB 127,254,127,254,31,248,7,224 ; Plant Pot (2) (2 x 1) 61876 DEFB 127,255,99,255,99,255,113,254 61884 DEFB 121,254,60,124,31,248,7,224 ; Plant Pot (3) (2 x 2) 61892 DEFB 255,255,255,255,192,7,127,254 61900 DEFB 103,254,103,254,103,254,103,254 61908 DEFB 99,254,115,254,51,252,51,252 61916 DEFB 51,252,63,252,63,252,31,248 ; Goblet (from Picture) (2 x 3) 61924 DEFB 255,255,194,67,218,91,90,90 61932 DEFB 90,90,74,82,106,86,34,84 61940 DEFB 50,76,30,88,7,224,0,0 61948 DEFB 1,128,1,128,1,128,1,128 61956 DEFB 1,128,1,128,0,0,3,192 61964 DEFB 3,192,0,0,15,240,63,252 ; Plant Pot (4) (2 x 3) 61972 DEFB 255,255,255,255,0,0,255,255 61980 DEFB 99,250,99,250,99,250,115,242 61988 DEFB 115,246,51,244,51,244,51,244 61996 DEFB 51,244,51,244,51,244,51,228 62004 DEFB 59,236,27,232,27,232,27,232 62012 DEFB 27,232,27,200,31,248,31,248 ; Plant (7) (2 x 3) 62020 DEFB 0,0,0,0,1,0,3,128 62028 DEFB 3,128,48,24,123,188,36,216 62036 DEFB 15,192,7,128,24,112,60,112 62044 DEFB 26,0,1,128,16,135,60,142 62052 DEFB 46,217,50,83,29,215,7,238 62060 DEFB 0,252,0,96,0,96,0,96 ; Graphics (Objects Part 2) ; ; All object graphics are (2 x 2). Lump of Brickwork b62068 DEFB 63,126,127,255,255,255,255,255 62076 DEFB 223,253,255,231,255,254,123,252 62084 DEFB 0,0,190,63,254,127,255,127 62092 DEFB 255,111,247,103,255,115,252,63 ; Sticky Bun 62100 DEFB 0,0,0,0,0,0,0,0 62108 DEFB 0,0,0,0,0,0,0,0 62116 DEFB 0,0,0,0,3,240,12,124 62124 DEFB 49,254,115,254,127,254,63,252 ; Wand of Command 62132 DEFB 0,0,1,0,32,0,8,0 62140 DEFB 17,0,72,0,16,32,2,0 62148 DEFB 3,128,8,192,64,96,0,48 62156 DEFB 0,24,0,12,0,6,0,3 ; Javelin 62164 DEFB 0,1,0,2,0,12,0,28 62172 DEFB 0,56,0,112,0,224,1,192 62180 DEFB 3,128,7,0,14,0,28,0 62188 DEFB 56,0,112,0,96,0,128,0 ; Tube of Glue 62196 DEFB 0,0,0,0,0,0,0,0 62204 DEFB 0,0,0,0,0,0,0,0 62212 DEFB 0,0,0,0,0,0,0,0 62220 DEFB 63,255,255,255,255,255,63,255 ; Broken Talisman 62228 DEFB 0,0,0,0,0,0,0,0 62236 DEFB 0,0,0,0,0,0,0,0 62244 DEFB 1,1,1,1,3,3,3,3 62252 DEFB 7,199,7,247,15,255,15,255 ; Talisman 62260 DEFB 1,128,1,128,3,192,3,192 62268 DEFB 7,224,7,224,14,112,13,176 62276 DEFB 13,176,14,112,7,224,7,224 62284 DEFB 3,192,3,192,1,128,1,128 ; Goblet 62292 DEFB 0,255,0,94,0,94,0,94 62300 DEFB 0,94,0,110,0,60,0,0 62308 DEFB 0,24,0,0,0,24,0,60 62316 DEFB 0,24,0,0,0,24,0,60 ; Willow Rod 62324 DEFB 1,128,1,128,1,128,1,128 62332 DEFB 1,128,1,128,3,192,6,96 62340 DEFB 12,48,24,24,48,12,96,6 62348 DEFB 96,6,96,6,96,6,96,6 ; Power Pong Plant 62356 DEFB 3,192,7,224,6,96,14,112 62364 DEFB 11,208,14,112,6,96,3,192 62372 DEFB 1,128,1,128,15,240,15,240 62380 DEFB 15,240,15,240,7,224,7,224 ; Saxophone 62388 DEFB 0,0,0,6,0,14,0,24 62396 DEFB 0,48,0,48,0,48,0,48 62404 DEFB 8,48,24,48,60,48,124,112 62412 DEFB 30,240,15,224,7,224,3,128 ; Mirror 62420 DEFB 164,37,152,25,127,254,97,6 62428 DEFB 162,5,36,132,161,5,98,6 62436 DEFB 100,134,161,5,34,4,164,5 62444 DEFB 96,6,127,254,152,25,164,37 ; Axe 62452 DEFB 0,0,0,0,0,0,59,0 62460 DEFB 55,128,15,192,63,224,127,224 62468 DEFB 223,192,239,176,119,104,63,100 62476 DEFB 30,114,12,57,0,29,0,14 ; Miolnir 62484 DEFB 3,224,3,240,3,232,3,212 62492 DEFB 3,210,3,209,3,209,3,206 62500 DEFB 3,192,3,192,31,248,127,254 62508 DEFB 127,254,127,254,127,254,31,248 ; Runestone 62516 DEFB 60,60,127,254,255,255,239,131 62524 DEFB 231,255,107,142,109,254,111,254 62532 DEFB 127,246,91,246,91,182,219,223 62540 DEFB 219,239,219,247,127,254,60,60 ; Book 62548 DEFB 0,0,0,0,63,252,192,8 62556 DEFB 255,252,255,248,255,248,255,248 62564 DEFB 255,248,255,248,255,248,255,248 62572 DEFB 255,248,255,252,255,248,63,252 ; Pocket Laser 62580 DEFB 0,0,0,0,0,0,0,0 62588 DEFB 0,0,0,0,0,0,0,0 62596 DEFB 85,0,85,0,255,192,255,254 62604 DEFB 255,254,255,192,85,0,85,0 ; White Gold Ring 62612 DEFB 0,0,0,0,7,224,28,120 62620 DEFB 49,252,103,254,76,62,216,31 62628 DEFB 208,15,240,15,240,15,112,14 62636 DEFB 112,14,120,28,60,56,15,224 ; Pewter Tankard 62644 DEFB 0,0,0,0,255,192,127,128 62652 DEFB 63,28,127,190,255,230,255,198 62660 DEFB 255,198,255,204,255,216,255,240 62668 DEFB 127,160,63,48,127,144,255,192 ; Candle 62676 DEFB 0,8,0,16,0,8,0,126 62684 DEFB 0,126,0,86,0,126,0,74 62692 DEFB 0,126,0,82,0,126,0,110 62700 DEFB 0,126,0,74,0,126,0,126 ; Elf Horn 62708 DEFB 0,0,0,0,0,0,0,56 62716 DEFB 0,126,0,102,128,195,128,195 62724 DEFB 193,195,227,102,254,126,113,252 62732 DEFB 127,248,63,224,31,128,0,0 ; Broken Glass 62740 DEFB 0,0,0,0,0,0,0,0 62748 DEFB 0,0,0,0,0,0,0,0 62756 DEFB 0,0,0,0,0,0,0,0 62764 DEFB 0,0,32,132,170,221,255,255 ; Crystal 62772 DEFB 1,127,3,127,7,127,15,127 62780 DEFB 31,127,63,127,127,127,255,0 62788 DEFB 254,255,253,254,251,252,247,248 62796 DEFB 239,240,223,224,191,192,127,128 ; Shield 62804 DEFB 128,1,192,3,252,63,255,255 62812 DEFB 255,243,255,231,255,207,127,158 62820 DEFB 127,62,126,126,60,252,57,252 62828 DEFB 27,248,15,240,7,224,3,192 ; Cannon / Crystal Ball 62836 DEFB 0,0,7,192,31,240,60,248 62844 DEFB 120,252,115,252,247,254,231,254 62852 DEFB 255,254,255,254,255,254,127,252 62860 DEFB 127,252,63,248,31,240,7,192 ; Bottle 62868 DEFB 0,60,0,24,0,24,0,0 62876 DEFB 0,60,0,44,0,44,0,110 62884 DEFB 0,255,0,221,0,193,0,213 62892 DEFB 0,201,0,213,0,193,0,126 ; Ancient Scroll 62900 DEFB 127,254,255,255,127,254,32,4 62908 DEFB 45,228,44,4,45,100,32,4 62916 DEFB 44,196,32,36,47,84,32,36 62924 DEFB 32,84,127,254,255,255,127,254 ; Red Herring 62932 DEFB 0,0,0,0,0,0,0,0 62940 DEFB 0,0,0,0,0,0,0,0 62948 DEFB 15,1,63,198,79,236,223,252 62956 DEFB 255,252,95,236,63,198,15,1 ; Teleport Pad 62964 DEFB 0,0,0,0,0,0,0,0 62972 DEFB 0,0,0,0,0,0,0,0 62980 DEFB 0,0,0,0,0,0,0,0 62988 DEFB 0,0,127,254,255,255,127,254 ; Pool of Liquid 62996 DEFB 0,0,0,0,0,0,0,0 63004 DEFB 0,0,0,0,0,0,0,0 63012 DEFB 0,0,0,0,0,0,0,0 63020 DEFB 0,0,0,0,255,255,255,255 ; Loaf of Bread 63028 DEFB 0,0,0,0,0,0,0,0 63036 DEFB 0,0,15,240,127,126,237,239 63044 DEFB 247,187,255,255,255,255,127,254 63052 DEFB 127,254,127,254,127,254,63,252 ; (Teleport) Key 63060 DEFB 0,0,0,0,0,0,0,0 63068 DEFB 0,0,0,0,0,0,0,0 63076 DEFB 0,62,0,127,255,231,128,103 63084 DEFB 255,231,0,127,248,62,216,0 ; Brick / Gold Bar 63092 DEFB 0,0,0,0,0,0,0,0 63100 DEFB 0,0,0,0,0,0,0,0 63108 DEFB 255,255,192,3,191,253,191,253 63116 DEFB 191,253,191,253,192,3,255,255 ; Graphics - "Locate a Character" Compass (6 x 6) b63124 DEFB 0,0,0,0,0,0,0,0 63132 DEFB 1,128,0,0,0,0,3,192 63140 DEFB 0,0,31,240,7,224,15,248 63148 DEFB 31,224,15,240,7,248,31,0 63156 DEFB 31,248,0,248,31,128,51,204 63164 DEFB 1,248,31,192,3,192,3,248 63172 DEFB 27,224,3,192,7,216,25,240 63180 DEFB 3,192,15,152,24,248,3,192 63188 DEFB 31,24,16,124,3,192,62,8 63196 DEFB 0,62,3,192,124,0,0,28 63204 DEFB 3,192,56,0,0,8,0,0 63212 DEFB 16,0,0,0,0,0,0,0 63220 DEFB 0,0,227,199,0,0,0,0 63228 DEFB 243,207,0,0,2,0,251,223 63236 DEFB 0,64,6,0,123,222,0,96 63244 DEFB 12,0,59,220,0,48,28,0 63252 DEFB 3,192,0,56,63,252,255,255 63260 DEFB 63,252,127,252,255,255,63,254 63268 DEFB 127,252,255,255,63,254,63,252 63276 DEFB 255,255,63,252,28,0,3,192 63284 DEFB 0,56,12,0,59,220,0,48 63292 DEFB 6,0,123,222,0,96,2,0 63300 DEFB 251,223,0,64,0,0,243,207 63308 DEFB 0,0,0,0,227,199,0,0 63316 DEFB 0,0,0,0,0,0,0,8 63324 DEFB 0,0,16,0,0,28,3,192 63332 DEFB 56,0,0,62,3,192,124,0 63340 DEFB 16,124,3,192,62,8,24,248 63348 DEFB 3,192,31,24,25,240,3,192 63356 DEFB 15,152,27,224,3,192,7,216 63364 DEFB 31,192,3,192,3,248,31,128 63372 DEFB 51,204,1,248,31,0,31,248 63380 DEFB 0,248,31,224,15,240,7,248 63388 DEFB 31,240,7,224,15,248,0,0 63396 DEFB 3,192,0,0,0,0,1,128 63404 DEFB 0,0,0,0,0,0,0,0 ; Graphics (Magic Knight) ; ; All Magic Knight frame graphics are (2 x 4). Frame 0 (Blank) This "frame" is used when Magic Knight is to be drawn ; without a previously drawn frame waiting to be erased. The Draw / Erase Magic Knight routine at #R39224 first ; erases the previously drawn frame before drawing the new one. When Magic Knight enters a new room, however, there ; is no previously drawn frame to erase, so frame zero (blank) is used causing the erase phase of the routine to ; leave the display unchanged. b63412 DEFB 0,0,0,0,0,0,0,0 63420 DEFB 0,0,0,0,0,0,0,0 63428 DEFB 0,0,0,0,0,0,0,0 63436 DEFB 0,0,0,0,0,0,0,0 63444 DEFB 0,0,0,0,0,0,0,0 63452 DEFB 0,0,0,0,0,0,0,0 63460 DEFB 0,0,0,0,0,0,0,0 63468 DEFB 0,0,0,0,0,0,0,0 ; Frame 1 (Right) 63476 DEFB 0,0,0,0,15,192,63,224 63484 DEFB 124,30,227,255,28,147,228,147 63492 DEFB 196,147,252,147,15,147,96,254 63500 DEFB 63,0,31,252,7,252,1,224 63508 DEFB 3,192,6,96,6,112,6,48 63516 DEFB 7,56,7,184,7,184,7,184 63524 DEFB 7,240,3,224,1,192,1,192 63532 DEFB 1,224,3,248,3,252,1,252 ; Frame 2 (Right) 63540 DEFB 0,0,0,0,15,192,63,224 63548 DEFB 124,30,227,255,28,147,228,147 63556 DEFB 196,147,252,147,15,147,96,254 63564 DEFB 63,0,31,252,7,252,1,224 63572 DEFB 3,192,6,96,6,96,6,112 63580 DEFB 6,120,6,120,6,248,7,248 63588 DEFB 1,240,3,224,3,220,7,220 63596 DEFB 28,124,28,124,30,120,30,120 ; Frame 3 (Right) 63604 DEFB 0,0,0,0,15,192,63,224 63612 DEFB 124,30,227,255,28,147,228,147 63620 DEFB 196,147,252,147,15,147,96,254 63628 DEFB 63,0,31,252,7,252,1,224 63636 DEFB 3,192,6,96,6,96,6,112 63644 DEFB 6,120,7,184,7,184,7,184 63652 DEFB 59,243,59,231,61,239,29,255 63660 DEFB 30,60,14,60,6,56,6,56 ; Frame 4 (Right) 63668 DEFB 0,0,0,0,15,192,63,224 63676 DEFB 124,30,227,255,28,147,228,147 63684 DEFB 196,147,252,147,15,147,96,254 63692 DEFB 63,0,31,252,7,252,1,224 63700 DEFB 3,192,6,96,6,32,7,48 63708 DEFB 7,56,7,184,7,248,7,248 63716 DEFB 7,240,55,224,61,220,61,156 63724 DEFB 62,124,30,124,6,120,6,120 ; Frame 5 (Left) 63732 DEFB 0,0,0,0,3,240,7,252 63740 DEFB 120,62,255,199,201,56,201,39 63748 DEFB 201,35,201,63,201,240,127,6 63756 DEFB 0,252,63,248,63,224,7,128 63764 DEFB 3,192,6,96,14,96,12,96 63772 DEFB 28,224,29,224,29,224,29,224 63780 DEFB 15,224,7,192,3,128,3,128 63788 DEFB 7,128,31,192,63,192,63,128 ; Frame 6 (Left) 63796 DEFB 0,0,0,0,3,240,7,252 63804 DEFB 120,62,255,199,201,56,201,39 63812 DEFB 201,35,201,63,201,240,127,6 63820 DEFB 0,252,63,248,63,224,7,128 63828 DEFB 3,192,6,96,6,96,14,96 63836 DEFB 30,96,30,96,31,96,31,224 63844 DEFB 15,128,7,192,59,192,59,224 63852 DEFB 62,56,62,56,30,120,30,120 ; Frame 7 (Left) 63860 DEFB 0,0,0,0,3,240,7,252 63868 DEFB 120,62,255,199,201,56,201,39 63876 DEFB 201,35,201,63,201,240,127,6 63884 DEFB 0,252,63,248,63,224,7,128 63892 DEFB 3,192,6,96,6,96,14,96 63900 DEFB 30,96,29,224,29,224,29,224 63908 DEFB 207,220,231,220,247,188,255,184 63916 DEFB 60,120,60,112,28,96,28,96 ; Frame 8 (Left) 63924 DEFB 0,0,0,0,3,240,7,252 63932 DEFB 120,62,255,199,201,56,201,39 63940 DEFB 201,35,201,63,201,240,127,6 63948 DEFB 0,252,63,248,63,224,7,128 63956 DEFB 3,192,6,96,4,96,12,224 63964 DEFB 28,224,29,224,31,224,31,224 63972 DEFB 15,224,7,236,59,188,57,188 63980 DEFB 62,124,62,120,30,96,30,96 ; Graphics (Interface) ; ; The character set (font) used by the game. The index of the first entry is 32 (ASCII code for SPACE character), ; and runs through to Z (90). Characters 91 and 92 are unknown. b63988 DEFB 0,0,0,0,0,0,0,0 63996 DEFB 0,48,48,48,48,0,48,48 64004 DEFB 0,36,36,0,0,0,0,0 64012 DEFB 0,36,126,36,36,126,36,0 64020 DEFB 0,8,62,40,62,10,62,8 64028 DEFB 0,98,100,8,16,38,70,0 64036 DEFB 0,56,108,59,126,108,127,59 64044 DEFB 0,12,24,16,0,0,0,0 64052 DEFB 0,12,24,24,24,24,12,4 64060 DEFB 0,48,24,24,24,24,48,32 64068 DEFB 0,0,20,8,62,8,20,0 64076 DEFB 0,0,8,8,62,8,8,0 64084 DEFB 0,0,0,0,0,12,12,24 64092 DEFB 0,0,0,62,62,0,0,0 64100 DEFB 0,0,0,0,0,0,24,24 64108 DEFB 0,6,14,28,56,112,96,0 64116 DEFB 0,60,126,110,126,118,126,60 64124 DEFB 0,28,60,44,12,12,63,63 64132 DEFB 0,60,126,14,60,112,126,126 64140 DEFB 0,60,126,102,28,102,126,60 64148 DEFB 0,28,60,108,126,126,12,12 64156 DEFB 0,126,126,96,124,6,126,124 64164 DEFB 0,60,124,96,124,102,126,60 64172 DEFB 0,126,126,14,28,24,24,24 64180 DEFB 0,60,126,102,60,102,126,60 64188 DEFB 0,60,126,102,62,6,62,60 64196 DEFB 0,0,24,24,0,0,24,24 64204 DEFB 0,0,24,24,0,24,24,48 64212 DEFB 0,0,6,12,24,24,12,6 64220 DEFB 0,0,0,62,0,62,0,0 64228 DEFB 0,0,96,48,24,24,48,96 64236 DEFB 0,60,110,30,28,0,24,24 64244 DEFB 0,60,74,86,94,64,60,0 64252 DEFB 0,60,126,102,126,126,102,102 64260 DEFB 0,124,126,102,124,102,126,124 64268 DEFB 0,60,126,102,96,102,126,60 64276 DEFB 0,120,124,110,102,110,124,120 64284 DEFB 0,126,126,96,124,96,126,126 64292 DEFB 0,126,126,96,124,124,96,96 64300 DEFB 0,62,126,96,110,102,126,60 64308 DEFB 0,102,102,126,126,102,102,102 64316 DEFB 0,126,126,24,24,24,126,126 64324 DEFB 0,6,6,6,102,102,126,60 64332 DEFB 0,110,124,120,124,110,102,102 64340 DEFB 0,96,96,96,96,96,126,126 64348 DEFB 0,198,254,254,214,198,198,198 64356 DEFB 0,102,118,126,110,102,102,102 64364 DEFB 0,60,126,102,102,102,126,60 64372 DEFB 0,124,126,102,126,124,96,96 64380 DEFB 0,60,126,102,118,110,126,60 64388 DEFB 0,124,126,102,124,126,102,102 64396 DEFB 0,60,124,96,60,6,126,124 64404 DEFB 0,254,254,48,48,48,48,48 64412 DEFB 0,102,102,102,102,102,126,60 64420 DEFB 0,102,102,102,102,102,60,24 64428 DEFB 0,102,102,102,102,126,126,36 64436 DEFB 0,231,255,60,60,126,231,195 64444 DEFB 0,195,231,126,60,24,24,24 64452 DEFB 0,126,126,28,56,112,126,126 ; Unknown Character 1 64460 DEFB 0,3,15,31,63,127,255,255 ; Unknown Character 2 64468 DEFB 0,192,240,248,252,254,255,255 ; Window Border 1 64476 DEFB 255,255,0,255,0,255,0,255 64484 DEFB 255,0,255,0,255,0,255,255 64492 DEFB 213,213,213,213,213,213,213,213 64500 DEFB 171,171,171,171,171,171,171,171 64508 DEFB 255,255,3,251,11,235,43,171 64516 DEFB 171,43,235,11,251,3,255,255 64524 DEFB 213,212,215,208,223,192,255,255 64532 DEFB 255,255,192,223,208,215,212,213 ; Window Border 2 64540 DEFB 255,255,0,36,219,0,255,255 64548 DEFB 255,255,0,219,36,0,255,255 64556 DEFB 203,203,211,203,203,211,203,203 64564 DEFB 211,211,203,211,211,203,211,211 64572 DEFB 194,227,124,28,204,38,151,211 64580 DEFB 211,151,38,204,28,124,227,194 64588 DEFB 203,233,100,51,56,62,199,67 64596 DEFB 67,199,62,56,51,100,233,203 ; Window Border 3 64604 DEFB 153,153,195,66,102,189,129,255 64612 DEFB 255,129,189,102,66,195,153,153 64620 DEFB 231,156,176,163,163,176,156,231 64628 DEFB 231,57,13,197,197,13,57,231 64636 DEFB 155,155,196,75,115,176,156,231 64644 DEFB 231,156,176,115,75,196,155,155 64652 DEFB 231,57,13,206,210,35,217,217 64660 DEFB 217,217,35,210,206,13,57,231 ; Window Border 4 64668 DEFB 255,255,0,255,0,0,0,0 64676 DEFB 0,0,0,0,255,0,255,255 64684 DEFB 208,208,208,208,208,208,208,208 64692 DEFB 11,11,11,11,11,11,11,11 64700 DEFB 255,255,7,251,11,11,11,11 64708 DEFB 11,11,11,11,251,7,255,255 64716 DEFB 208,208,208,208,223,224,255,255 64724 DEFB 255,255,224,223,208,208,208,208 ; Character Set (Additional) 64732 DEFB 0,16,56,84,16,16,16,0 64740 DEFB 0,28,62,112,124,48,126,126 64748 DEFB 0,60,126,227,223,227,126,60 ; Graphics - Brickwork Blocks (Part 1) ; ; Referenced by Architecture Styles Table at #R54617 b64756 DEFB 0,0,0,0,0,0,0,0 ; 00 Initial frame of odd ball and second, blank row in brickwork ; drawing 64764 DEFB 254,130,254,198,254,254,198,146 ; 01 Unused 64772 DEFB 63,127,239,223,255,255,255,255 ; 02 Top green block in Most Magic Room 64780 DEFB 56,248,252,222,238,254,255,255 ; 03 Top green block in Most Magic Room 64788 DEFB 111,255,247,239,127,127,31,207 ; 04 2nd green block in Most Magic Room 64796 DEFB 0,240,254,255,247,251,255,255 ; 05 2nd green block in Most Magic Room 64804 DEFB 7,63,127,255,255,255,127,127 ; 06 3rd green block in Most Magic Room 64812 DEFB 192,248,222,231,255,255,254,254 ; 07 3rd green block in Most Magic Room 64820 DEFB 3,31,63,127,255,255,255,255 ; 08 4th green block in Most Magic Room 64828 DEFB 240,254,255,255,255,255,255,255 ; 09 4th green block in Most Magic Room 64836 DEFB 56,124,238,246,246,254,255,255 ; 10 Unused 64844 DEFB 24,60,110,246,251,251,255,255 ; 11 Unused 64852 DEFB 14,63,127,239,223,255,255,255 ; 12 Unused 64860 DEFB 7,255,255,255,255,255,255,255 ; 13 Unused 64868 DEFB 131,255,255,255,255,255,255,252 ; 14 Unused 64876 DEFB 252,238,247,255,255,130,60,254 ; 15 Unused 64884 DEFB 63,127,255,255,223,255,255,123 ; 16 Unused 64892 DEFB 126,255,255,255,253,231,254,252 ; 17 Unused 64900 DEFB 63,63,103,111,127,127,127,62 ; 18 Unused 64908 DEFB 62,255,255,255,251,243,254,112 ; 19 Unused 64916 DEFB 0,0,0,0,0,0,0,0 ; 20 Unused 64924 DEFB 0,0,0,0,0,0,0,0 ; 21 Unused 64932 DEFB 0,0,0,0,0,0,0,0 ; 22 Unused 64940 DEFB 0,0,0,0,0,0,0,0 ; 23 Unused 64948 DEFB 126,126,126,0,239,239,239,0 ; 24 (Basement Wall) 64956 DEFB 186,186,186,186,186,146,198,254 ; 25 Unused 64964 DEFB 127,127,127,127,255,255,127,63 ; 26 Top green block in Most Magic Room 64972 DEFB 255,255,255,238,158,254,252,24 ; 27 Top green block in Most Magic Room 64980 DEFB 247,251,249,252,126,119,123,63 ; 28 2nd green block in Most Magic Room 64988 DEFB 255,254,254,250,246,126,60,24 ; 29 2nd green block in Most Magic Room 64996 DEFB 127,121,126,255,247,238,124,56 ; 30 3rd green block in Most Magic Room 65004 DEFB 240,238,223,123,255,255,254,112 ; 31 3rd green block in Most Magic Room 65012 DEFB 127,119,121,63,71,243,125,28 ; 32 4th green block in Most Magic Room 65020 DEFB 255,255,255,255,254,255,240,224 ; 33 4th green block in Most Magic Room 65028 DEFB 255,254,254,126,252,252,124,56 ; 34 Unused 65036 DEFB 255,127,126,126,254,252,252,120 ; 35 Unused 65044 DEFB 127,127,127,111,119,127,63,28 ; 36 Unused 65052 DEFB 255,255,238,221,243,207,30,14 ; 37 Unused 65060 DEFB 49,199,255,255,255,255,63,0 ; 38 Unused 65068 DEFB 255,255,255,255,246,206,254,252 ; 39 Unused 65076 DEFB 0,190,254,255,255,247,255,252 ; 40 Unused 65084 DEFB 0,63,127,127,111,103,115,63 ; 41 Unused 65092 DEFB 0,124,255,255,255,254,238,124 ; 42 Unused 65100 DEFB 0,63,127,127,127,119,115,63 ; 43 Unused 65108 DEFB 0,0,0,0,0,0,0,0 ; 44 Unused 65116 DEFB 0,0,0,0,0,0,0,0 ; 45 Unused 65124 DEFB 0,0,0,0,0,0,0,0 ; 46 Unused 65132 DEFB 0,0,0,0,0,0,0,0 ; 47 Unused 65140 DEFB 7,15,63,119,239,255,255,255 ; 48 Unused 65148 DEFB 240,248,254,255,255,255,255,255 ; 49 Unused 65156 DEFB 255,146,146,147,150,154,106,73 ; 50 Unused 65164 DEFB 255,91,101,203,83,37,95,137 ; 51 Unused 65172 DEFB 255,228,255,0,63,3,0,0 ; 52 Unused 65180 DEFB 255,39,255,0,252,192,0,0 ; 53 Unused 65188 DEFB 255,255,255,156,63,115,109,54 ; 54 Top of columns in Most Magic Room 65196 DEFB 255,255,255,57,252,206,182,108 ; 55 Top of columns in Most Magic Room 65204 DEFB 54,54,54,54,54,54,63,63 ; 56 Base of columns in Most Magic Room 65212 DEFB 108,108,108,108,108,108,252,252 ; 57 Base of columns in Most Magic Room 65220 DEFB 54,54,54,54,54,54,54,54 ; 58 Body of columns in Most Magic Room 65228 DEFB 108,108,108,108,108,108,108,108 ; 59 Body of columns in Most Magic Room 65236 DEFB 0,0,0,0,0,0,0,0 ; 60 Unused 65244 DEFB 0,0,0,0,0,0,0,0 ; 61 Unused 65252 DEFB 0,0,0,0,0,0,0,0 ; 62 Unused 65260 DEFB 0,0,0,0,0,0,0,0 ; 63 Unused 65268 DEFB 0,127,255,255,223,255,255,123 ; 64 Unused 65276 DEFB 0,222,255,255,253,231,254,252 ; 65 Unused 65284 DEFB 0,63,127,127,111,103,127,62 ; 66 Standard (used by most rooms in the game) 65292 DEFB 0,206,255,249,253,255,254,112 ; 67 Standard (used by most rooms in the game) 65300 DEFB 0,0,0,0,0,0,0,0 ; 68 Unused 65308 DEFB 0,0,0,0,0,0,0,0 ; 69 Unused 65316 DEFB 0,0,0,0,0,0,0,0 ; 70 Unused 65324 DEFB 0,0,0,0,0,0,0,0 ; 71 Unused 65332 DEFB 255,127,127,231,231,115,63,15 ; 72 Unused 65340 DEFB 255,246,238,252,250,247,239,134 ; 73 Unused 65348 DEFB 73,38,38,25,24,6,1,0 ; 74 Unused 65356 DEFB 137,127,17,161,127,65,193,63 ; 75 Unused 65364 DEFB 120,6,254,254,254,8,120,120 ; 76 Unused 65372 DEFB 255,0,255,0,255,255,0,0 ; 77 Unused 65380 DEFB 62,29,195,255,127,54,54,54 ; 78 Top of columns in Most Magic Room 65388 DEFB 124,184,195,255,254,108,108,108 ; 79 Top of columns in Most Magic Room 65396 DEFB 63,0,127,127,0,255,255,255 ; 80 Base of columns in Most Magic Room 65404 DEFB 252,0,254,254,0,255,255,255 ; 81 Base of columns in Most Magic Room 65412 DEFB 24,12,10,7,10,20,58,217 ; 82 Pit of Destruction flames 65420 DEFB 16,24,44,52,40,20,46,77 ; 83 Pit of Destruction flames ; Graphics (Odd Ball) b65428 DEFB 60,126,255,255,251,243,126,60 ; Frame 1 65436 DEFB 60,126,255,255,223,207,126,60 ; Frame 2 65444 DEFB 60,126,207,223,255,255,126,60 ; Frame 3 65452 DEFB 60,126,243,251,255,255,126,60 ; Frame 4 ; Graphics - Brickwork Blocks (Part 2) ; ; Referenced by Architecture Styles Table at #R54617 b65460 DEFB 0,190,254,255,255,247,255,252 ; 88 Unused 65468 DEFB 0,63,127,127,111,103,115,63 ; 89 Unused 65476 DEFB 0,124,255,255,255,254,238,124 ; 90 Standard (used by most rooms in the game) 65484 DEFB 0,63,126,126,127,127,127,63 ; 91 Standard (used by most rooms in the game) ; Unused b65492 DEFB 0,0,0,0,0,0,0,0 65500 DEFB 0,0,0,0,0,0,0,0 65508 DEFB 0,0,0,0,0,0,0,0 65516 DEFB 0,0,0,0,0,0,0,0 ; Interrupt Routine (Jump 2) ; ; Note - original values here are 16, 16, 16. These are modified to the JP instruction by instructions between 26653 ; and 26662 @ssub=JP 54853 c65524 DEFB 16,16,16 ; Jump to main part of interrupt routine at #R54853 ; Unused b65527 DEFB 0 ; Temporary store for Magic Knight's frame number (to draw) b65528 DEFB 0 ; Magic Knight's current room b65529 DEFB 66 ; Store for Display File Address to Print Text to in Command Summary Window b65530 DEFW 16962 ; Magic Knight's Current Action Flags ; ; Bitwise flags which determine which commands appear in the main in-game menu. The bits are: b65532 DEFB 66 ; Magic Knight's current action flags (1) 65533 DEFB 66 ; Magic Knight's current action flags (2) ; Unused b65534 DEFB 0 ; Interrupt Routine (Jump 1) ; ; Note - original value at 65535 is 0. This is modified to the JR instruction by instruction at 26650. The operand ; comes from next byte (location 0 in ROM.) @ssub=JR 65524 c65535 NOP ; Jump to next part of interrupt routine