0x90 register-hotspot-callbacks
Opcode 0x90 (144), input. Investigated by OME, with high confidence (from investigation).
(x)(y)(w)(h)(on_enter_pc)(on_leave_pc)(on_activate_pc) - append an inclusive cursor rectangle and three callback PCs to the current script frame's native input registry. This opcode only registers; the ADV input service dispatches callbacks later.
Operands
| # | Role | Types seen | Access |
|---|---|---|---|
| 1 | rectangle left x | imm, l-int | read |
| 2 | rectangle top y | imm, l-int | read |
| 3 | rectangle width added to x for inclusive right bound | imm | read |
| 4 | rectangle height added to y for inclusive bottom bound | imm | read |
| 5 | target:pointer enter | imm | read |
| 6 | target:pointer leave | imm | read |
| 7 | target:activate/click | imm | read |
Named by 0x97 as one it works with.
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 | yes | 1 |
4.33G (SYS4433) | Kamidori Alchemy Meister | yes | — |
4.38D (SYS4438) | Soukoku no Arterial | yes | — |
Evidence
- native-re on SYS4422, high confidence; Himegari AGE.EXE Ghidra /v2 and decoded script corpus (
vm-map/opcodes.toml opcode 0x90): Ghidra /v2: op_0x90_handler@0x41fc80 fetches x/y/w/h, forms x+w/y+h, fetches operands 5/6/7, and calls input_hotspot_register_rect_callbacks@0x403d70 on the current frame registry. The worker appends rect + callbacks to arrays and returns without changing PC. input_hotspot_poll_hover_callback@0x4040b0 returns operand 5 on entry and operand 6 on exit; at the ADV text wait, adv_input_service_poll@0x411230 pushes the waiting op's offset (delta -3) and takes operand 7 through input_hotspot_current_click_callback@0x404f70, which keeps the registry and its hovered record (native Frida trace 2026-11-04, SC0000 read-skip click: count 8 and hovered 3 unchanged, no reset or re-registration). Only the modal waits of ops 0x91/0x92/0x95 take the click through input_hotspot_take_click_callback@0x404330, which resets the registry. All 301 ADV scripts contain the identical five control-strip records plus three keyed records.
Details
OME’s notes on it, as the registry keeps them.
op 0x90 (u0041BEB0, argc 7): `0x90 x y w h tgt_a tgt_b tgt_c`. Kelebek left it "ukn" noting args
5-7 are code locations. Native RE plus corpus analysis resolves it:
- The opcode APPENDS a record; it is not an immediate branch. Rect bounds are stored as
`(x,y,x+w,y+h)` and the cursor hit-test compares them inclusively.
- The later input service maps targets exactly: target A = pointer enter, target B = pointer leave,
target C = activation/click. Moving directly between records emits leave first, then enter on the
next service poll. At the ADV text wait, activation keeps the registry: the callback returns into
the wait, and the clicked record stays hovered until the pointer leaves it. Only the modal waits
(ops 0x91/0x92/0x95) reset the registry on a click.
- Two forms, both ONLY in one shared ADV-chrome subroutine copied into every ADV script:
* Mode A (1505 = 5x301): immediate x,y,w,h with w=h=20; the five on-screen buttons at
(684|706|728|750|772, 572): History, Auto message, Message skip, Read-message skip, and
Hide window. Their enter/leave callbacks set G[0x6c9..0x6cd] to 1/0 and redraw SO001's
tooltip + generic 20x20 translucent hover overlay; target C runs the per-button action.
* Mode B (903 = 3x301): local-int operands, w=h=1, only tgt_c real. Companion op 0x97 binds
input-bit ids 0, 8, and 7 to these records for keyboard/pad activation.
- Every one of the 301 scripts has EXACTLY 8 sites (5 A + 3 B); zero scene-specific use.
- Registration returns normally to pc+1; later callbacks temporarily redirect execution.
- Headless (no cursor/input) can ignore registration; the 12 EMPTY sweep scenes
are gated by state + this input-wait chrome, NOT by unmodelled 0x90. Model live in A2.
- The handler also clears the registry's current hit (ctx+0xc6f8 = -1) and pending enter
(ctx+0xc6f0 = 0), and the worker clears the arm flag +0x74a4, so the next op 0x94 hit-tests
GetCursorPos (input_hotspot_arm_cursor_tracking@0x404230). Otherwise only a WM_MOUSEMOVE at a
new point hit-tests (age_main_window_proc -> input_mouse_move_update_hotspot_hits@0x485db0),
and a click takes the current hit, never the point under the button. Op 0x7c clears the hit
too. Port: HotspotRegistry (engine-re.md, "The hit and the hovered record"; 2026-11-05).