Skip to content

0x8F — text_output

Configures the global CTextMessage object, then branches on handler_arg_byte >> 5. Mode 0 (sjis_text) calls CTextMessage::TextOutforSJIS(const char*) with the current script cursor. Mode 1 (event_value_number) reads an event-value id from the low 16 bits of the first operand, fetches it through GetEventValueForScript, converts it with NumberToWideText, and outputs it. Mode 7 (clear_text) clears text id 0xFA through ClearByID and ClearTextCache.

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

At a glance

Opcode0x8F (143)
HandlerCRadiScript::Command_8f
SignatureCRadiScript::Command_8f(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run8.cpp
Address— debug build; click for all 3
Handler size0x134 (308 bytes)
Engine nametext_output
FamilyVibration, dialogue and text
Command size4 + extra_words * 4 bytes

Handler behaviour

Configures the global CTextMessage object, then branches on handler_arg_byte >> 5. Mode 0 (sjis_text) calls CTextMessage::TextOutforSJIS(const char*) with the current script cursor. Mode 1 (event_value_number) reads an event-value id from the low 16 bits of the first operand, fetches it through GetEventValueForScript, converts it with NumberToWideText, and outputs it. Mode 7 (clear_text) clears text id 0xFA through ClearByID and ClearTextCache.

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

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

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

FieldRoleMeaning
clear_message_idderivedWhich previously written line to clear, for mode=7.
modeinput0 writes Shift-JIS text, 1 writes an event value as a number, 7 clears a previously written line.
mode_namederivedFriendly spelling of mode.
textinputThe Shift-JIS string, for mode=0.
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::GetEventValueForScript(int,const SCR_DATA*)
  • CTextMessage::ClearByID(int)
  • CTextMessage::ClearTextCache(int)
  • CTextMessage::TextOutforSJIS(const char*)
  • NumberToWideText(unsigned int,char*,int,char)

Bit masks

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

0xFFFF 0x00FF