Skip to content

0x62 — sprite_config

Reads a bitfield word and consumes variable operands to configure one CSpriteG_Base slot. Proven fields include halfword coordinate/rect values, texture page setup through CSpriteG_Base::MakeTexturePage, floats at sprite offsets 0x24/0x28, and virtual sprite methods from vtable offsets 0x14, 0x1C, 0x3C, 0x48, and 0x4C.

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

At a glance

Opcode0x62 (98)
HandlerCRadiScript::Command_62
SignatureCRadiScript::Command_62(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run6.cpp
Address— debug build; click for all 3
Handler size0x3E0 (992 bytes)
Engine namesprite_config
FamilyPrimitives, textures, sound and movies
Command size4 + extra_words * 4 bytes

Handler behaviour

Reads a bitfield word and consumes variable operands to configure one CSpriteG_Base slot. Proven fields include halfword coordinate/rect values, texture page setup through CSpriteG_Base::MakeTexturePage, floats at sprite offsets 0x24/0x28, and virtual sprite methods from vtable offsets 0x14, 0x1C, 0x3C, 0x48, and 0x4C.

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

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

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

FieldRoleMeaning
arginputRaw handler argument byte from the command header. It is printed only when it differs from the value the named fields already imply, so seeing it means the command uses an unusual argument encoding.
blend_alphainputBlend parameters applied when the sprite is drawn.
colorinputPacked colour word written to the sprite slot.
controlderivedBitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries.
corner_offsetinputOffset applied to corner.
maskderivedBitmask selecting which parts of the command apply.
rotateinputSet when rotation is included on this line.
scaleinputSet when scale is animated by this line; the scale values follow.
sizeinputSprite size as width,height.
sprite_indexinputIndex selecting which sprite to act on.
status_bitsinputNames of the bits set in the matching packed value.
texture_pageinputWhich texture page and palette the sprite draws from.
time_baseinputTiming base word for the sprite's animation.
trailinginputWords left after the decoded operands, preserved verbatim.
xyinputTop-left corner of the sprite, as x,y screen coordinates.
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:

  • CSpriteG_Base::MakeTexturePage(unsigned int,unsigned int,unsigned int,int)
  • vtable: color / rotation / blend / size / UV

Bit masks

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

0x00FF 0x0003 0x0001 0x0002 0x0004 0x0008 0x000F 0x0010 0x0020 0x0040