Level markers in move instructions
ScriptMoveLevelMarker · 1 byte, before each level operand in the item branches of
Move the party or objects
Move instruction targets · Virtual machine
When a script moves items, each source and destination says which level it is on. A marker byte either means "the current level" or announces a signed level byte.1
typedef enum ScriptMoveLevelMarker {
SCRIPT_MOVE_EXPLICIT_LEVEL = 0xe5, /* A signed level byte follows; the marker used by the reference scripts. */
SCRIPT_MOVE_CURRENT_LEVEL = 0xeb /* Use the current level; no byte follows. */
} ScriptMoveLevelMarker;
SCRIPT_MOVE_EXPLICIT_LEVEL is never tested: any byte other than
SCRIPT_MOVE_CURRENT_LEVEL is followed by a level byte. A decoder must accept
any such byte; an encoder should write SCRIPT_MOVE_EXPLICIT_LEVEL, which
precedes all 118 explicit levels of the 16 reference INF files. An explicit
level equal to the current level is handled as the current level.
Sources
Locations refer to the game executable reference.