0x236 play-movie-to-surface
Opcode 0x236 (566), draw. Investigated by OME, with high confidence (from investigation).
(packed_resource_id)(surface_slot)(movie_flags)(start_delay_ms) - synchronously open a universal packed SYS4INI/AAI movie and construct its DirectShow graph, then start asynchronous frame delivery into the retained destination surface after the requested service-tick delay. The opcode itself is non-blocking: the VM advances to the next instruction. SC0000's 0x33 and BTL's 0x2axx/0x2bxx MVB ids are already absolute base-catalog indexes.
Operands
| # | Role | Types seen | Access |
|---|---|---|---|
| 1 | resource_id | imm, l-int, l-ptr | read |
| 2 | surface_slot (an index into surface, 1000 entries, not bounds-checked) | imm, g-int, l-int, l-ptr | read |
| 3 | movie_flags | imm, g-int, l-ptr | read |
| 4 | start_delay_ms | imm, l-ptr | read |
Named by 0x241, 0x24d 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 0x236): Ghidra /v2 op_0x236_play_movie_to_surface@0x423ee0 fetches operand 1 and passes it unchanged to movie_to_texture_open_asset_graph@0x463e20, which passes it unchanged to asset_open_indexed_entry@0x44f390. The opener directly indexes the flat base table or selected AAI table and has no scene input. The handler leaves playback pending through movie_play_configure@0x4625e0; movie_start_pending_after_sync_delay@0x4633b0 records the first service tick and calls the shared IMediaControl::Run worker after operand 4's delay, giving non-modal playback the same DirectShow first-sample preroll as 0x20f. SC0000 native operand capture and exact 0x13c8->0x13d1 trace prove nonblocking behavior. BTL's live 0x2b21 site supplies 0x2af1/0x2af5/0x2bca/0x2bd8/0x2bde, the exact base entries MVB001/MVB004/MVB914/MVB958/MVB955.
Details
OME’s notes on it, as the registry keeps them.
The handler requires an existing destination texture, allocates/reuses a 0x478-byte movie-to-texture object for the surface without replacing its resource identity/color key, opens operand 1 through the native universal packed-id reader, builds FilterGraph/IGraphBuilder/IMediaControl/IMediaPosition/IMediaEvent/IBasicAudio, and presents bottom-up RGB samples through the movie texture renderer. Operand 3 selects movie/sound routing policy: bits 0x10000/0x20000/0x40000/0x80000 force mute/music/SE/voice routes. Otherwise set:DependMovieSound (SYS4INI DEPENDMOVIESOUND, registered default 1) picks the route by the same numbering, with 4 the movie category and any value outside 1..4 silent (movie_sound_route_from_flags@0x405490; SYS4433 0x405200): Himegari's 1 is music and Kamidori's 2 is SFX, while Kamidori's LOGO/OP pass 0x20004 and so follow music. The movie plays at master x that category's volume and is silent while that route is off. SC0000's low value 2 is retained as native movie mode state. The port resolves the category with MovieSoundRoute (until 2026-11-07 it used the movie category for every unflagged movie). Godot maps those categories to audio buses and sends FFmpeg-decoded timestamped stereo float PCM through a per-playback AudioStreamGenerator. Both native demuxers begin at the common timeline origin; the first image is latched before audio start and later video/audio retain their source timing. This recovers valid MPEG video preroll before AVStream.start_time instead of advancing picture by roughly 600 ms. Audio-bearing completion retains the terminal frame through the full graph endpoint. Operand 4 delays the pending graph start in native service ticks. Static layer preparation after 0x236 does not terminate the retained movie; it plays on until EOF and subsequent surface cleanup stops/detaches both decoder and audio output. Whether a 0x21c effect wait also waits for it depends on operand 3 alone: (flags & 5) == 4 holds the wait for the movie object's lifetime (surface_movie_is_playing@0x405150), any other value does not. SC0000's flags 2 do not hold it; its 0x21c waits for the movie because op 0x238 sets the anim clock to the op 0x23f layer stop time. At EOF the tick loops the movie when bit 0 is set, otherwise detaches it and clears the surface unless (flags & 3) == 2. The port type-checks the selected ResolvePacked record as MPEG without adding a scene base or fallback.