0x82 redraw-retained-text-group
Opcode 0x82 (130), adv. Investigated by OME, with high confidence (from investigation).
(layout_slot)(record_index)(flags)(text_color)(effect_color) - clear and redraw an ordinary retained ADV text group into its original layout.
Operands
| # | Role | Types seen | Access |
|---|---|---|---|
| 1 | target ADV layout/surface slot (an index into layout, 10 entries, not bounds-checked) | g-int | read |
| 2 | first retained text record index | g-int | read |
| 3 | render flags | imm | read |
| 4 | temporary primary text color | imm | read |
| 5 | temporary text effect color | g-int | read |
In the port
OME’s port implements it. It never waits: a wait parks the engine until input, a sleep, a transition, a dialog or a movie ends. What it can do with control besides waiting:
falls: it returns to the next instruction
OME derives these facts from the port’s handler (its tools/opcode_flow.py), and they over-approximate: a fact some path can reach is given.
By build
Whether each build’s scripts use it, as OME’s survey of the game’s scripts saw them, and how many evidence items name the build.
| Build | Game | Used by its scripts | Evidence |
|---|---|---|---|
4.24J (SYS4422) | Himegari Dungeon Meister | no | 1 |
4.33G (SYS4433) | Kamidori Alchemy Meister | yes | 2 |
4.38D (SYS4438) | Soukoku no Arterial | yes | — |
Evidence
- native-re on SYS4422, SYS4433, high confidence; Himegari SYS4422 Ghidra /v2 and Kamidori SYS4433 Ghidra /kamidori/SYS4433 (4.33F), addresses given for /kamidori/4.33G (
vm-map/opcodes.toml opcode 0x82): SYS4422 op_0x82_redraw_retained_text_group@0x41edd0 calls text_redraw_retained_group@0x451530; SYS4433 equivalents are @0x41cef0 and @0x4553c0. Both validate record_index against the shared 0x48-byte record vector, clear the selected layout surface/object range, walk until the next group-start record, apply flags 1/2/4/8, and restore temporary font state. Kamidori has six calls in CONFIG1--CONFIG5 (two in CONFIG4); each immediately consumes 0x83's pair with flags 2, white text, and configured effect color. Himegari installs the equivalent handler but has no decoded corpus call. - frida on SYS4433, high confidence; tools/drive.py native and port, tools/drive/scenarios/kamidori-config-redraw.steps (
vm-map/opcodes.toml opcode 0x82): Native redraws the furigana page behind CONFIG in the new style, ruby included, and the page stays when CONFIG closes. With the per-record redraw no pixel of the port's text window differs from native's by more than 30 after either change (2026-11-07); the earlier reflowing port duplicated the text and then left the page blank.
Details
OME’s notes on it, as the registry keeps them.
This is the ordinary-page redraw sibling of 0x1d1's History renderer, which draws in the current style. It releases the layout's objects, clears its surface and draws each retained record again at its own rectangle, ruby records included: each text record keeps its colors (or bit 1's) and pixel height and takes the manager's current face, weight and render mode, and a ruby record draws in the ruby font in mode 0. It stops at the next group boundary, binds one object per record unless bit 2 is set, restores the font state, and leaves the live glyph vector and text cursor alone, so later text continues the page. Flag bit 0 crosses navigation-filtered records, bit 1 overrides both colors, bit 2 suppresses the binding, and bit 3 replays retained voice records. All six Kamidori calls are CONFIG setting handlers that run right after a change, so the page behind CONFIG shows it at once (not CONFIG return paths): 0x83 supplies layout_slot/record_index, flags is 2, text_color is white, and effect_color is the configured outline color. The port builds the per-record draws (AdvTextHistory.TryBuildRedrawBatch -> TextManager.RedrawGroup -> RetainedGlyphLayoutEngine.RenderRedraw) and binds its published glyphs again over the new pixels; bit 3's voice replay is not modelled. docs/engine-re.md, 'Op 0x82 redraw'.