Skip to content

0x67 — fade_control

Branches on handler_arg_byte >> 4 and calls CRadiFade::SetColorFade, CRadiFade::SetDissolves, or CRadiFade::SetBattleInFade.

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

At a glance

Opcode0x67 (103)
HandlerCRadiScript::Command_67
SignatureCRadiScript::Command_67(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run6.cpp
Address— debug build; click for all 3
Handler size0x278 (632 bytes)
Engine namefade_control
FamilyPrimitives, textures, sound and movies
Command size4 + extra_words * 4 bytes

Handler behaviour

Branches on handler_arg_byte >> 4 and calls CRadiFade::SetColorFade, CRadiFade::SetDissolves, or CRadiFade::SetBattleInFade.

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

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

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

FieldRoleMeaning
bit4inputSingle bit whose meaning is not yet traced; preserved so the command round-trips.
colorinputFade colour: black, white, current (the global fade colour), or an explicit 0xAARRGGBB word.
controlinputBitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries.
curveinputInterpolation curve index; the engine scales the duration through a per-curve table.
directioninputout fades the screen to the colour, in fades from it. Control bit 0 picks which end of the colour pair carries the alpha byte.
dissolve_valueinputValue used for dissolve.
durationinputHow long the fade takes. This is the value itself, not a rendering of another field.
holdderivedKeep the finished fade on screen instead of releasing it (control bit 1). A fade-to-black needs this or the screen uncovers itself.
modeinputHandler path selector taken from the argument byte. The meaning is specific to each command.
yieldderivedPause 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:

  • CRadiFade::SetBattleInFade(unsigned int,float,CVector*)
  • CRadiFade::SetColorFade(unsigned int,unsigned int,float,unsigned int,unsigned char)
  • CRadiFade::SetDissolves(unsigned int,unsigned int,float,unsigned int,float)

Bit masks

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

0x0001 0xFFFF 0x000F 0x0004