0x320 create-polygon
Opcode 0x320 (800), draw. Investigated by OME, with high confidence (from investigation).
(handle)(xs)(ys)(zs)(alphas)(colors)(us)(vs)(count)(flags) — make the handle's polygon object: a retained object of vertices with a colour each, drawn in handle order with the other retained objects.
Operands
| # | Role | Types seen | Access |
|---|---|---|---|
| 1 | handle | imm, l-int | read |
| 2 | each vertex's x (float cells) | g-float, l-float, l-float-ptr | address |
| 3 | each vertex's y (float cells) | g-float, l-float, l-float-ptr | address |
| 4 | each vertex's z (float cells) | g-float, l-float | address |
| 5 | each vertex's alpha (integer cells) | g-int, l-int | address |
| 6 | each vertex's RGB (integer cells) | g-int, l-int | address |
| 7 | each vertex's u (float cells) | g-float, l-float | address |
| 8 | each vertex's v (float cells) | g-float, l-float | address |
| 9 | vertex count | imm | read |
| 10 | flags: bit 0 = triangle fan, else triangle strip | imm | 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 | — |
4.33G (SYS4433) | Kamidori Alchemy Meister | no | — |
4.38D (SYS4438) | Soukoku no Arterial | yes | 1 |
Evidence
- native-re on SYS4438, high confidence; Arterial SYS4438 Ghidra /arterial/4.38D and the complete Arterial catalog (
vm-map/opcodes.toml opcode 0x320): op_0x320_create_polygon@0x42e4a0 reads the count (operand 9; below 1 it traces a script error and returns), resolves the integer cells of operands 5 and 6 and the float cells of operands 7, 8, 4, 3 and 2 (vm_operand_resolve_float_address@0x4291a0), packs alpha << 24 | RGB for each vertex, makes an array of 1.0 for rhw and calls gfx_polygon_create@0x4965c0, which builds a vertex buffer of FVF 0x244 (x - 0.5, y - 0.5, z, rhw, diffuse, and u, v for two stages) and keeps the x, y and diffuse arrays. Operand 10's bit 0 draws a triangle fan, else a triangle strip (gfx_render_polygon@0x496d10). LOGO@0x4e makes a full-screen quad of four vertices.
Details
OME’s notes on it, as the registry keeps them.
The port keeps the polygon in the graphics state (GfxState.CreatePolygon) and draws it as a polygon item of the frame description, which both renderers draw (docs/superpowers/specs/2026-11-19-polygon-objects-design.md). It halts on a count above 1,048,576 and on an array operand that names no float cell. 創刻のアテリアル has 3,856 sites.