Knight Tyme 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 both Magic Knight's current room, and the current location of the USS Pisces. Pressing LEFT or RIGHT decreases or
increases, respectively, Magic Knight's current room index by one, and draws the new room. Pressing UP or DOWN increases or decreases, respectively,
the index of the current location of the USS Pisces by one. Pressing FIRE causes a return to the game.
If this POKE is entered after the game has loaded, but before execution has reached 26640, then in addition to enabling cheat mode,
the Valid I.D. Card will be placed in The Recreation Room aboard the USS Pisces, meaning that Magic Knight will not have to have his photograph taken or
validate the Blank I.D. Card.
Extra data copied
The instructions between 27029 - 27035 copy inventory data from the characters' initial inventories table at 36805 to the characters' current
inventories table at 25164. However these instructions also copy an additional 10 bytes after this (first 10 bytes of the characters' initial
positions table at 36875) into 25234 - 25243.
The instructions after this (27037 - 27043) then copy position data from the characters' initial positions table at 36875 to the characters'
current positions table at 25244. Again, an extra six bytes (first six bytes of the objects' initial positions table at 36911) are copied as well.
Combined magic level / attribute data
Characters' attributes and magic levels are both encoded in a single value.
Drawing the strength bar
In drawing the strength bar, if Magic Knight's strength is not a multiple of eight, then the strength bar is drawn as groups of eight pixels, then the
remainder over and above a multiple of eight is drawn. If the Magic Knight's strength IS a multiple of eight, however, the second part of the routine
(draw the remainder over and above a multiple of eight) is still executed, but draws nothing (see JR 34619 instruction at 34611 - it seems
more logical to have JR 34626 here to skip over the "fractional part drawing").
Common code for 48k and 128k versions
There appear to be many data structures and code fragments that aren't necessary, or have different lengths than is required, 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:
character-related routines having loops with 16 iterations (28368, 34202, 53585) [48k has 12 characters, 128k has 16]
split common words table, handled by routine at 34976
a check of the USS Pisces' current location against index 27 (Starbase 2 in 128k version) at 32044
a check of Magic Knight's current room against index 36 ("YE OLDE TRANSPORTER" in 128k version) at 32656
the index of the Current Character is stored by the instruction at 33173 to distinguish between Klink and S3 E3 but this data is never used
bit 6 of byte 0 of an object's properties encodes its blow status, however blowable objects only appear in the 128k version
several unused entries in the graphic lookup data table at 55950 that contain data
extra space for visited room flags, starting at 23527
The routine at 33952 will display a list of objects in a window for a given group of inventory slots. Before anything is displayed, the first slot in
the group is checked (instructions at 33961 and 33964), and if it is empty, then a jump occurs to 34087. The code at 34087 appears to display
the "YOU HAVE DESTROYED YOURSELF..." text that is usually seen upon dropping the Quark Bomb, however it displays this text in a normal information
window and then returns to the main game loop.
Fortunately, this strange behaviour should never occur because an empty inventory is already checked for before the routine at 33952 is ever reached.
If an empty inventory is detected then this routine is never reached.
Redundant instructions / code
There are many instances of redundant code, or redundant instructions in several texts. These may or may not be related to the
entry above. Some examples are:
the text entry at 37967 has an instruction to change INK colour to yellow, followed immediately by an instruction to change INK colour to white
the text entry at 38238 has a repeated instruction to change INK colour to yellow
the text entry at 39577 contains two explicitly coded [CR] control codes instead of a reference to entry 91 in the common words table
the text entries at 48005 and 49691 are almost identical and could have been defined as an entry in the common words table
the content of address 53813 is modified as part of the call at 53795, then again immediately after at 53798
the value in A is set at 53147 and 53150 but is not used
the instruction at 26959 is a jump to the instruction immediately after
the routine at 53703 includes code to preserve the MSB of the value in A, however the calls to this routine at 29937 and 29957 are surrounded by unnecessary code to preserve the same MSB
the instructions between 30097 and 30105 are unnecessary, and replacing them with LD C,A; JR 30111 results in the same functionality. The table at 36749 is likewise unnecessary
the instructions at 33069 and 33072 are identical (i.e. unnecessarily duplicated)
the routine at 33657 iterates over 50 rooms when the game only has 25 (this code has been taken from Spellbound)
the instruction at 54628 is a jump to the instruction immediately after
For the purposes of this disassembly, the flag held in bit 1 of byte 6 of the characters' stats data has been labelled the "is-artificial flag". This
flag determines whether or not a character can see through the Cloak of Invisibility, and also whether or not that character will also respond to Magic
Knight's commands without him wearing the Valid I.D. Card. Most of the artificial characters (i.e. Klink, S3 E3 and Derby IV) have this flag set, so
they will happily obey Magic Knight's commands whether or not he is invisible / wearing the Valid I.D. Card. The obvious exception, however, is Julie 8
who, despite being an android, does not have her is-artificial flag set.
It is possible that there is a logical reason why Julie 8 does not have her is-artificial flag set, but it is also possible that this flag actually
signifies something else!
Leftover debug code, part 1
The routine at 26670 displays and handles the input device selection menu, and the instructions from 26704 onward are executed when the currently
selected input device is changed. The instructions between 26705 and 26724 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 26723 to a different value can make the highlighting
No spell effect for Consult Oracle
When casting the Consult Oracle spell, no colour-cycling / sound effects are shown, i.e. there is no call to 55651.
No restriction on magic level for casting fortify character / yourself
Unlike the other spells, there is no minimum magic level requirement for casting Fortify Yourself or Fortify Character. Regardless of Magic Knight's
magic level when he casts these spells, the amount by which the target is fortified is always the same, and the spell always costs ALL of Magic Knight's
Leftover debug code, part 2
The routine at 53731 handles characters' movement, however execution of this routine is dependent upon whether or not bit 7 of Gordon's stamina is
set. If this bit is set, then all characters become frozen in place.