Skip to main content

Pixel dissolve

Overlay 253 · image 0x4bf90–0x4c13f (432 bytes) · 1 stub entry

All overlays · ← 252 · Dialogues and scripted sequences · 254 · Transferring an Eye of the Beholder I party →

In brief​

Overlay 253 holds a single routine: a pixel dissolve. It copies a rectangle from one drawing page to another one pixel at a time, in a shuffled order, so that the new image appears as a scattering of dots until it is complete. Dialogue pictures drawn with SCRIPT_DIALOGUE_BITMAP_TRANSITION, the portal animation and a routine of the end of the game use it.

Addresses

Every address on this page is a file offset in START.EXE; calls into resident code are given as analysis addresses. See how addresses are written.

How it fits together​

Dashed boxes are outside this overlay.

Where it is used​

CallerRectangle (width × height)From → toPages
Dialogue picture, at 0x4b504160 × 96 or 320 × 121, from the frame tablesthe picture's source position → the frame's destination2 → 0 (the screen)
Portal animation, at 0x4ba6d144 × 104(24, 0) → (24, 0)2 → 0
Dissolve the work page of the ending, at 0x4f94b304 × 128(0, 0) → (8, 8)an argument (2 for THANKS and DESTROY1) → 0

These are the only three calls in the file. Page 0 is the visible screen; the dialogue pictures are loaded into page 2 before they are copied, as described for the dialogue picture.

Entry points​

Encoded entryTargetRole
0x7e8:0x200x4bf90 (image start)Pixel dissolve

Routines​

Dissolve a rectangle​

AddressRange
0x4bf900x4bf90–0x4c13f

0x4bf90(x1, y1, x2, y2, w, h, source page, destination page) copies the w × h rectangle at (x1, y1) of the source page to (x2, y2) of the destination page, in pixels:

  1. In the general scratch area (far pointer DS:0xcbc4), it fills a table of w column numbers 0 … w − 1 and, at +0x280, a table of h row numbers 0 … h − 1, as 16-bit words.
  2. It shuffles each table: entry i is swapped with entry 0x30644(0, w − 1), respectively (0, h − 1).
  3. It runs h passes. Pass t copies one pixel in every column i, at row number (t + i) mod h of the shuffled tables: it sets the current page (DS:0x62a5) to the source page and reads the pixel through driver slot 23, then sets it to the destination page and writes the pixel through driver slot 36.
  4. It restores the current page it found on entry.

Over the h passes every pixel of the rectangle is copied exactly once. The loops contain no wait and no screen update: how long the dissolve lasts depends only on the speed of the machine. No argument is checked. The counts are not bounded; the tables hold 320 columns and the work buffer 5,120 bytes; larger counts write past them (0x4bfbf, 0x4bfd5). Every caller passes a width of at most 320, except the dialogue picture when its frame operand lies outside 0 and 1.

Comparative source: REF-SCUMM-012, graphics/screen.cpp, Screen::crossFadeRegion.

Used by: Dialogue picture options, Dialogue screen › Drawing a picture, Run a sequence › Portal animation, The ending › How it works

Sources​

The executable is identified in the file inventory; the overlay layout is described on the overlays page. Comparative sources are listed in the technical references.