Skip to content

0x50 — camera_select

Reads two halfwords from the command stream. Non-0xFFFF low halfword calls CRadiCameraSystem::SelectCamera; non-0xFFFF high halfword calls CRadiCameraSystem::SetCameraTarget. Then it marks character display/camera instant update state.

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

At a glance

Opcode0x50 (80)
HandlerCRadiScript::Command_50
SignatureCRadiScript::Command_50(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run5.cpp
Address— debug build; click for all 3
Handler size0xBC (188 bytes)
Engine namecamera_select
FamilyBackground, map, landscape and camera
Command size4 + extra_words * 4 bytes

Handler behaviour

Reads two halfwords from the command stream. Non-0xFFFF low halfword calls CRadiCameraSystem::SelectCamera; non-0xFFFF high halfword calls CRadiCameraSystem::SetCameraTarget. Then it marks character display/camera instant update state.

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   |  0x50          |
+----------------+----------------+----------------+----------------+

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

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

FieldRoleMeaning
camerainputCamera id for CRadiCameraSystem::SelectCamera; 0xFFFF leaves the camera unchanged.
select_slotinputIndex into the runtime table of select.
targetinputWhat the command acts on or moves towards.
target_slotinputDestination index into a runtime table owned by this command's subsystem.

Engine calls

Engine functions this handler was observed calling:

  • CCharaDispManager::SetInstantMode()
  • CCharacterManager::GetCharacterSubManager(int)
  • CRadiCameraSystem::SelectCamera(unsigned int,unsigned int,float)
  • CRadiCameraSystem::SetCameraTarget(unsigned int,unsigned int,float)

Bit masks

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

0x0003 0xFFFF