Skip to content

0x06 — load_script_file

Reads one script-file operand, optionally forces bit 0x8000, converts zero to -1, and calls CRadiScript::LoadScriptFile(int).

proven— handler traced, and exercised by at least one shipped script.

At a glance

Opcode0x06 (6)
HandlerCRadiScript::Command_06
SignatureCRadiScript::Command_06(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run0.cpp
Address— debug build; click for all 3
Handler size0x48 (72 bytes)
FamilyScript control, flags and values
Command size4 + extra_words * 4 bytes

Handler behaviour

Reads one script-file operand, optionally forces bit 0x8000, converts zero to -1, and calls CRadiScript::LoadScriptFile(int).

Encoding

The command header is one 32-bit word, as described in §3 Instruction encoding:

 31            24 23            16 15             8 7              0
+----------------+----------------+----------------+----------------+
|  flags         |  argument byte |  extra words   |  0x06          |
+----------------+----------------+----------------+----------------+

Bits 8–15 give the number of 32-bit operand words that follow. Bits 16–23 are handed to the handler as a bitfield; on character commands bit 0 normally says whether a character selector word is present. Bit 31 is the keep-going bit.

Operand fields

2 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.

FieldRoleMeaning
fileinputWhich event file to load: the operand's low 15 bits.
force_high_bitinputArgument bit 0, which forces bit 15 of the file id on. Command_06 masks the operand with 0x7FFF first, so this bit is the only way to set it.

Engine calls

Engine functions this handler was observed calling:

  • CRadiScript::LoadScriptFile(int)

Bit masks

Masks the handler applies to its argument byte or operand words:

0x7FFF 0x0001