Stormbringer has a cheat / debug mode built in. Address 23728 is the cheat-mode-enabled flag, and if this is set (i.e. contains any non-zero value)
then cheat mode becomes available:
When cheat mode is enabled, pressing DOWN while controlling Magic Knight will result in a prompt sound being played, and the border turning red. After
this, it is possible to change Magic Knight's current room. Pressing LEFT or RIGHT decreases or increases, respectively, Magic Knight's current room
index by one. Pressing UP or DOWN increases or decreases, respectively, Magic Knight's current room index by eight. After Magic Knight's current room
index is changed, the new room is drawn. Pressing FIRE causes a return to the game.
Although the 128k version of Stormbringer includes the LOCATE command, the 48k version does not. Despite this, there remain some data and instructions
in the 48k version that appear to be related to the LOCATE command. Much of the code is similar to that related to the LOCATE command in Spellbound:
The routine at 37689 displays and handles the input device selection menu, and the instructions from 37722 onward are executed when the currently
selected input device is changed. The instructions between 37723 and 37742 seem to be set up to highlight the control device that was previously
selected whenever a new one is chosen. The previously selected menu item is highlighted via a change in attribute for a character cell to the left of
that item in the menu. The attribute used is 71 (white INK, black PAPER, BRIGHT), so the change will normally not be visible since there is nothing
drawn in the cell in question and its PAPER is already black. Changing the value at 37741 to a different value can make the highlighting
Leftover debug code, part 2
The flag at 23461 determines whether or not only the top two character cells in 2 × 2 blocks are drawn. This flag is never modified
anywhere in the game code, and so presumably exists only for debugging or development purposes. In order for the 2 × 1 drawing mode to
function correctly (i.e. to move to the top-left cell of the next block to the right), an otherwise redundant instruction at 41322 advances the bitmap
virtual text cursor right by one character. When the draw-2-×-1-blocks flag is reset, this advancing to the top-left cell of the next block
to the left occurs at 41423 and 41426.
Whenever a new game is started, the routine at 38024 is jumped to. This routine initialises data for the new game, including the password number which
is required to activate the teleport from the castle to the spaceship. One of Magic Knight's tasks is to encode this number to a series of bits and pull
those main levers that correspond to the number's set bits. Two of the levers, representing bits 5 (59798) and 6 (59772) of the number, lie beyond
the security door (59841). The code that generates the number (38024 - 38034 inclusive) is set up to ensure that at least one of bits 5 and 6 is
set, thereby forcing Magic Knight to have to deal with the security door.
Redundant instructions / code
There are many instances of redundant code, or redundant instructions in several texts. Some examples are:
the routine at 38841 changes Magic Knight's current room index to the value in A, however Magic Knight's room is also updated to the same value immediately prior to that routine being called at 40431, 40483 and 40592
the instruction at 41274 loads L with a value, but that value is overwritten at 41276 without having been used
the instruction at 44403 loads A with the index of the Current Object, but that value is overwritten immediately afterwards in the call to 45601 and again at 44409 without having been used
the instruction at 44778 checks whether the Current Object that has been selected as the target of the UNWEAR command is the Teddy Bear in order to display the "THE BEAR SAYS..." message, however this can never happen because the Teddy Bear can't be worn
the routine at 45670 checks whether the Current Character is carrying the object with index in E, however this routine is unused. An ideal place to have used it would have been in Aramis's "command a character to help" routine at 45227.
the instructions at 38121 - 38123 do nothing. In the equivalent routine in Knight Tyme, the instructions in these positions set the least significant byte of the frame counter (FRAMES system variable) to zero. In Knight Tyme, however, FRAMES was not used as heavily as it is in Stormbringer.
the instructions at 40437 - 40438, part of the room-specific routine for transporting Magic Knight between the teleports, set the BORDER to black and reset the speaker state. There is no apparent need to do this, however.
the instructions between 42587 and 42595 are unnecessary, and replacing them with LD C,A; JR 42601 results in the same functionality. The table at 48535 is likewise unnecessary
the instruction at 42795 resets the most significant bit of the current character's status text index, however this bit can never be set so this instruction is unnecessary.
the instruction at 43255 writes a 32 (SPACE character) at the end of the "[Current Character's short name] CANNOT HELP YOU " text at 52770 even though this text already ends with two SPACE characters. It is possible that this was intentional, to enable variations of the message, e.g. "[Character] CANNOT HELP YOU YET", or "[Character] CANNOT HELP YOU HERE".
the instruction at 63721 is a jump to the instruction immediately after
the instruction at 64753 loads A with zero unnecessarily
the text entry at 50360 has an instruction to change INK colour to yellow, followed by an instruction to change INK colour to white
the text entry at 50640 has a repeated instruction to change INK colour to yellow
the instruction at 46929 causes a conditional jump to 47178 if the end of the text to print is encountered. However the instruction at 47178 is a simple RET. The same result could have been achieved with a RET Z instruction at 46929.
the instruction at 37636 loads RAM address 23364 with zero, however this address is never used.
the instruction at 38109 loads RAM address 23486 with zero, however this address is never used.
Commanding a character makes him or her happier
When Magic Knight uses the Wand of Command to command a character, that character's happiness is increased by two points (see 43092-43094).
This is the opposite effect to that in Knight Tyme, where characters' happiness is decreased when Magic Knight commands them. It is possible that this
is intended behaviour, however it diminishes the effect of the lower limit on happiness before a character will obey Magic Knight, as he can repeatedly
command an unhappy and unwilling character until that character's happiness is raised above the threshold for compliance.
Drawing Off-White Knight
The instructions between 39904 - 39907 inclusive (part of the character drawing routine at 39883) are executed only if the character being
drawn has a graphic index of zero, i.e. the character should not be drawn. For any other character, these instructions skip over the block of code that
draws the character to screen. Off-White, however, is drawn even if his graphic index has been set to zero, in which case, he would appear as a jumbled
The purpose of this check is not clear as Off-White's graphic index cannot be set to zero by any means other than a POKE.
Certain objects in the game are not readable unless Magic Knight is holding the Crystal Ball. If he attempts to read one of these objects without the
Crystal Ball, a message is shown stating that there is writing present in a magic language that cannot be read. The instructions between 43541 -
43590 check whether the object being read is one of these objects, and if so allow Magic Knight to read the language if he is also carrying the Crystal
Ball. The instructions between 43568 - 43572 deal with the Sword, however the index of the text revealed is 3, corresponding to the original
unreadable text message! One of the two unused texts, which is located at 53294, seems a likely, if silly, candidate for the true text on the sword.
Perhaps this was ultimately rejected because it is a little too silly.
Unreadable teddy bear
When the Teddy Bear is read, the text shown is "TNORF OT KCAB" (52964). Given that some objects have texts that cannot be read unless Magic Knight is
in possession of the Crystal Ball, one would assume that the Mirror would reveal the Teddy Bear's text, however this is not the case. Although the Teddy
Bear's true text is in the game (53607), it cannot be accessed. This text contains a spelling error ("HUNNEY" instead of "HONEY"). The name of the
bear, Milne, is undoubtedly a reference to A. A. Milne and "HUNNEY" is close to Winnie-the-Pooh's spelling, "HUNNY". See also
Placeholder data is used in a number of locations:
one entry in the list of object names at 56565 ("X" at 56841)
a number of entries in the common words table, part 2 at 58459 ("*191*" at 58459, "*192*" at 58465, "*FC*" at 58821, "*FE*" at 58831, "*FF*" at 58836)
Smashable objects thrown
When an object is thrown, a check is made at 43830 to see if that object is the Mirror. If so, a special message is displayed, describing how the
object has smashed. This message is only shown for the Mirror, even though other objects (i.e. the Bottles of Liquid and the Empty Bottles) will also
smash when thrown.
Axe frame numbers
The routine 46560 that draws the axes to screen relies on offset frame numbers (116, 117, 118 and 119) rather than absolute frame numbers (e.g. 0, 1,
2 and 3). These are the same frame numbers used by the Odd Ball in Spellbound.
Common code for 48k and 128k versions
There appear to be some code fragments that aren't necessary for the 48k version of the game. Generally speaking, these appear to be indications that
the 48k version and the 128k version use much code in common. A few examples are:
split common words table, handled by routine at 47179
In addition, several blocks from Spellbound are also defined here:
Evil never sleeps
One of the requirements for the success of Magic Knight's mission is that Off-White is asleep when Dimension Merge is cast. An essential task for Magic
Knight to complete is to put Off-White to sleep by throwing the Magic Missile. Unlike other characters, Off-White does not tire while awake; in fact he
continually regenerates. The rates of change of his stats while awake are all positive ensuring he never falls asleep independently.