0x11 — scene_save_env
Scene environment save/restore helper. It creates CRadiSceneSaveEnv as needed and pushes or pops radi time enable, map animation, camera halt, ambient, light, character halt/disp, map disp, camera system, and window status.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x11 (17) |
|---|---|
| Handler | CRadiScript::Command_11 |
| Signature | CRadiScript::Command_11(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x32C (812 bytes) |
| Engine name | scene_save_env |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Scene environment save/restore helper. It creates CRadiSceneSaveEnv as needed and pushes or pops radi time enable, map animation, camera halt, ambient, light, character halt/disp, map disp, camera system, and window status.
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 | 0x11 |
+----------------+----------------+----------------+----------------+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
15 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.
| Field | Role | Meaning |
|---|---|---|
camera_halt_mode | derived | Mode selector for camera halt; the handler branches on it. |
character_disp | derived | Whether character display state is in the saved set; unpacked from mask. |
character_halt_arg0 | derived | Argument 0 passed to the engine call for character halt. |
character_halt_arg1 | derived | Argument 1 passed to the engine call for character halt. |
control | input | Bitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries. |
light_arg0 | derived | Argument 0 passed to the engine call for light. |
light_arg1 | derived | Argument 1 passed to the engine call for light. |
map_animation_mode | derived | Mode selector for map animation; the handler branches on it. |
map_disp | derived | Whether map display state is in the saved set; unpacked from mask. |
mask | input | Bitmask selecting which parts of the command apply. |
mask_bits | derived | Names of the bits set in the matching packed value. |
pop | derived | 0 pushes (saves) the selected scene state, 1 pops (restores) it. |
radi_time_enable | derived | Whether radi time is enabled. |
window_status_mode | derived | Mode selector for window status; the handler branches on it. |
yield | derived | Pause the script here for one game frame; the next command runs on the following update. Lines without it keep running immediately. |
Engine calls
Engine functions this handler was observed calling:
CRadiSceneSaveEnv::CRadiSceneSaveEnv()CRadiSceneSaveEnv::Pop*CRadiSceneSaveEnv::PopCameraSystem(bool)CRadiSceneSaveEnv::PopWindowStatus(bool)CRadiSceneSaveEnv::Push*CRadiSceneSaveEnv::PushAmbient()CRadiSceneSaveEnv::PushCameraHalt(unsigned char,unsigned char)CRadiSceneSaveEnv::PushCameraSystem()CRadiSceneSaveEnv::PushCharacterDisp(unsigned int)CRadiSceneSaveEnv::PushCharacterHalt(unsigned char,unsigned char)CRadiSceneSaveEnv::PushLightGF(unsigned int,unsigned int)CRadiSceneSaveEnv::PushMapAnimation(unsigned char,unsigned char)CRadiSceneSaveEnv::PushMapDisp(unsigned int)CRadiSceneSaveEnv::PushRadiTimeEnable(unsigned int)CRadiSceneSaveEnv::PushWindowStatus(bool,bool)operator new(unsigned int,int,const char*)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0003 0x00FF 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080