Implement diagnostic output opcodes
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
struct_name = "EngineCtx"
|
||||
size = 0xa1000
|
||||
|
||||
[[field]]
|
||||
offset = 0x4
|
||||
name = "host_ui_interface"
|
||||
type = "void*"
|
||||
note = "host-facing UI interface used by the ctx+4 virtual-dispatch thunks; default slot +4 logs and presents AGE message boxes"
|
||||
[[field]]
|
||||
offset = 0x814
|
||||
name = "input_action_count"
|
||||
@@ -248,6 +253,11 @@ name = "frame_instruction_word_count"
|
||||
type = "int"
|
||||
note = "current decoded instruction length in dwords for each 0x78-byte script frame; interpreter advances PC by this value * 4"
|
||||
[[field]]
|
||||
offset = 0x54fe8
|
||||
name = "owner_window_handle"
|
||||
type = "void*"
|
||||
note = "native owner HWND forwarded to host UI/message-box calls, including op 0x1b4 diagnostic presentation"
|
||||
[[field]]
|
||||
offset = 0x54ff0
|
||||
name = "initial_root_run"
|
||||
type = "int"
|
||||
@@ -453,6 +463,21 @@ name = "message_skip_queued_voice_arg"
|
||||
type = "int"
|
||||
note = "second argument retained with message_skip_queued_voice_id; Himegari op 0xc4 stores zero"
|
||||
[[field]]
|
||||
offset = 0x6ddac
|
||||
name = "opcode_debug_metadata_table"
|
||||
type = "void*"
|
||||
note = "base of 512 optional per-opcode debug-metadata pointers; Himegari's release image zero-initializes the table and has no writer, so diagnostic COMMAND names render as '-'"
|
||||
[[field]]
|
||||
offset = 0x6f798
|
||||
name = "script_source_line_table"
|
||||
type = "void*"
|
||||
note = "base of 41 optional per-frame source-line-map pointers; Himegari's release image zero-initializes the table and has no writer, so diagnostic LINE values render as -1"
|
||||
[[field]]
|
||||
offset = 0x6f880
|
||||
name = "diagnostic_text_buffer"
|
||||
type = "int"
|
||||
note = "base of an embedded 28-byte MSVC string accumulator; op 0x1b2 appends formatted operand text, op 0x1b3 appends CRLF, and op 0x1b4 presents then clears it"
|
||||
[[field]]
|
||||
offset = 0x6f89c
|
||||
name = "script_launch_queue"
|
||||
type = "int"
|
||||
|
||||
@@ -3904,18 +3904,19 @@ argc = 1
|
||||
abi_source = "kelebek+decode-validated"
|
||||
|
||||
[opcode.semantics]
|
||||
name = "u00425790"
|
||||
category = "unknown"
|
||||
summary = ""
|
||||
name = "append-diagnostic-value"
|
||||
category = "control"
|
||||
summary = "Format operand 1 with AGE's generic operand-to-string conversion and append its exact bytes to the context diagnostic accumulator. This does not present or clear the accumulated text."
|
||||
details = "Implemented with an EngineCtx-lifetime accumulator shared across GameSession scene VMs. String operands append decoded text, integer and pointer forms append signed decimal, and float forms reproduce native `%lf`'s six fractional digits."
|
||||
noop_headless = false
|
||||
source = "kelebek"
|
||||
confidence = "low"
|
||||
source = "investigation"
|
||||
confidence = "high"
|
||||
depends_on = []
|
||||
evidence = ""
|
||||
evidence = "The real /v2 dispatch slot ctx+0x9b914 registers op_0x1b2_append_diagnostic_value@0x41f4b0. It formats operand 1 through vm_operand_format_as_string@0x41af90, measures the returned NUL-terminated bytes, and appends them to the embedded MSVC string at ctx+0x6f880. Himegari has two literal-string sites and one SYSTEM4 global-integer site."
|
||||
|
||||
[[opcode.semantics.args]]
|
||||
i = 1
|
||||
role = ""
|
||||
role = "value to format and append"
|
||||
observed_types = ["string", "g-int"]
|
||||
|
||||
[[opcode]]
|
||||
@@ -3925,14 +3926,15 @@ argc = 0
|
||||
abi_source = "kelebek+decode-validated"
|
||||
|
||||
[opcode.semantics]
|
||||
name = "u004257D0"
|
||||
category = "unknown"
|
||||
summary = ""
|
||||
name = "append-diagnostic-newline"
|
||||
category = "control"
|
||||
summary = "Append the literal CRLF byte pair to the context diagnostic accumulator without presenting or clearing it."
|
||||
details = "Implemented as an exact `\\r\\n` append to the shared diagnostic accumulator, including FIELD's persistent line and SYSTEM4's native post-clear newline."
|
||||
noop_headless = false
|
||||
source = "kelebek"
|
||||
confidence = "low"
|
||||
depends_on = []
|
||||
evidence = ""
|
||||
source = "investigation"
|
||||
confidence = "high"
|
||||
depends_on = [0x1b2]
|
||||
evidence = "The real /v2 dispatch slot ctx+0x9b918 registers op_0x1b3_append_diagnostic_newline@0x41a400. Its one operation appends two bytes from DAT_0057082c to the same embedded string at ctx+0x6f880; memory at that address is 0d 0a 00. Both Himegari sites immediately follow diagnostic construction."
|
||||
|
||||
[[opcode]]
|
||||
op = 0x1b4
|
||||
@@ -3941,14 +3943,15 @@ argc = 0
|
||||
abi_source = "kelebek+decode-validated"
|
||||
|
||||
[opcode.semantics]
|
||||
name = "u004237C0"
|
||||
category = "unknown"
|
||||
summary = ""
|
||||
name = "show-and-clear-diagnostic"
|
||||
category = "control"
|
||||
summary = "Show the accumulated text plus native script-location context in a synchronous owner-window information message box, then erase the complete accumulator."
|
||||
details = "Implemented as a synchronous host effect. Himegari's release-only null debug tables make the native suffix deterministic (`LINE=-1 COMMAND=-(436)`); FILE, dword ADDRESS, and zero-based frame DEPTH come from the live instruction. Godot marshals `OS.Alert` to the main thread and parks the VM until dismissal; CaptureHost records the effect. The accumulator clears only after the host call returns."
|
||||
noop_headless = false
|
||||
source = "kelebek"
|
||||
confidence = "low"
|
||||
depends_on = []
|
||||
evidence = ""
|
||||
source = "investigation"
|
||||
confidence = "high"
|
||||
depends_on = [0x1b2]
|
||||
evidence = "The real /v2 dispatch slot ctx+0x9b91c registers op_0x1b4_show_and_clear_diagnostic@0x419240. It resolves the MSVC string bytes at ctx+0x6f880 and calls engine_host_show_message@0x403820 with owner HWND ctx+0x54fe8 and flags 0x10004. The thunk dispatches host_ui_interface vslot +4; the default host implementation at 0x431520 logs the raw text and calls age_show_message_box@0x409370. Flag 0x10000 appends `FILE=%s ADDRESS=%X LINE=%d COMMAND=%s(%d) DEPTH=%d`; low mode 4 formats `%s%s`, uses caption `エラーが発生しました`, and calls USER32 MessageBoxA with style 0x40 (MB_OK|MB_ICONINFORMATION). The optional command metadata at ctx+0x6ddac and source-line maps at ctx+0x6f798 are zero-initialized and have no writer in Himegari's release image, yielding `LINE=-1 COMMAND=-(436)` at this opcode. The opcode ignores the return, then calls msvc_string_erase(buffer,0,0xffffffff). SYSTEM4's sole site presents its invalid-execution-mode text and value; a following 0x1b3 appends CRLF to the now-empty accumulator."
|
||||
|
||||
[[opcode]]
|
||||
op = 0x1b5
|
||||
|
||||
Reference in New Issue
Block a user