Skip to content

0x76 — stop_sound_effect

Sound-effect stop helper. It resolves optional character abstractions and calls CSoundManager::FadeoutAllSE or CRadiSound::StopSe.

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

At a glance

Opcode0x76 (118)
HandlerCRadiScript::Command_76
SignatureCRadiScript::Command_76(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run7.cpp
Address— debug build; click for all 3
Handler size0x230 (560 bytes)
Engine namestop_sound_effect
FamilyPrimitives, textures, sound and movies
Command size4 + extra_words * 4 bytes

Handler behaviour

Sound-effect stop helper. It resolves optional character abstractions and calls CSoundManager::FadeoutAllSE or CRadiSound::StopSe.

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

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

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

FieldRoleMeaning
bankinputSound bank byte passed to CRadiSound::StopSe.
explicit_flagderivedBoolean option controlling explicit.
modeinputHandler path selector taken from the argument byte. The meaning is specific to each command.
selectorinputSub-selector byte choosing which variant of the command's behaviour runs.
sound_idinputIdentifier selecting which sound to use.
stop_modeinputMode selector for stop; the handler branches on it.
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:

  • CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)
  • CRadiSound::StopSe(unsigned int,unsigned int,int)
  • CSoundManager::FadeoutAllSE(int)

Bit masks

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

0xFFFF 0x00FF 0x0003 0x0001 0x000F 0x007F 0x1FFF