Skip to content

Adult titles

The games this site covers are adult titles. Their data, pictures and text include sexual content.

Continue only if you are an adult where you live.

0x32 scale-copy-surface-rect

Opcode 0x32 (50), draw. Investigated by OME, with high confidence (from investigation).

(source_surface)(destination_surface)(source_x)(source_y)(source_width)(source_height)(destination_x)(destination_y)(destination_width)(destination_height) — clip and scale a source surface rectangle into an independently sized destination rectangle.

Operands

#RoleTypes seenAccess
1source surface slot (an index into surface, 1000 entries, not bounds-checked)immread
2destination surface slot (an index into surface, 1000 entries, not bounds-checked)immread
3source ximmread
4source yimmread
5source widthimmread
6source heightimmread
7destination ximmread
8destination yimmread
9destination widthimmread
10destination heightimmread

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.

BuildGameUsed by its scriptsEvidence
4.24J (SYS4422)Himegari Dungeon Meisterno1
4.33G (SYS4433)Kamidori Alchemy Meisteryes1
4.38D (SYS4438)Soukoku no Arterialyes—

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 0x32): SYS4422 op_0x32_scale_copy_surface_rect@0x41db20 -> gfx_scale_copy_surface_rect@0x47c6c0 and SYS4433 op_0x32_scale_copy_surface_rect@0x41bbf0 -> gfx_scale_copy_surface_rect@0x483410 have the same ten-operand contract. Both workers proportionally clip paired rectangles, mark the destination dirty, select direct/down/up scaling by the relative dimensions, and use scratch surface 0x20 when the two axes require different directions. SYS4433's two corpus sites are ALLMAP@0x4e2 and SAVE@0xbb6, both immediate 1024x576 -> 384x216 copies.

Details

OME’s notes on it, as the registry keeps them.

Both revision handlers convert origin/extent operands into paired edge rectangles, validate the two surfaces, mark the destination dirty, and dispatch to direct copy, area-weighted shrink, interpolating enlargement, or a two-pass mixed-axis route through scratch surface 0x20, which it creates over slot 32 and releases after, so a script surface there is lost (the port does the same). Kamidori's only two calls, ALLMAP@0x4e2 and SAVE@0xbb6, downsample the full 1024x576 surface 2 into a 384x216 thumbnail on surfaces 193 and 195. The portable host implements that observed shrink contract with an area-weighted RGBA sampler; equal-sized rectangles continue through the established exact-copy path.