SCRYMAMEReferenceScreenAlso in DOSBox-X

The Screen tools

These tools answer what a colour snapshot cannot: which palette entry each pixel is. MAME calls a palette entry a pen. They show bytes in a format you state, never what a driver's GFXDECODE says, which is what you want when the driver is the thing being fixed.

palette and screen_view read the pens and the screen. gfx_view decodes tiles; with an unknown format, gfx_sweep draws candidates, gfx_locate checks one against the screen and gfx_draft writes down what was proved. gfx_blits and gfx_blit_source read the draws a board makes.

Tilemaps and the graphics MAME itself has decoded are out of reach: MAME's stock Lua exposes neither.

The picture a reply attaches

Every tool that draws attaches its PNG after the JSON and describes it in image: path, bytes, sha256, width, height, scale, indexed and inline. A picture too large to reach the client unresampled is written but not attached, and not_inlined says why. Resampled pixel art is a plausible wrong picture: pens blend and one-pixel lines vanish.

scale enlarges by a whole factor, so each pixel stays a square of one pen; 0 picks the largest that fits. dest names a new file; left empty, the picture goes to the session's temporary folder, removed at close. A picture made inside a perform step is never attached (nested).

An indexed PNG keeps each pixel's pen, so the file is the data and two files can be compared pen by pen. The screen is indexed when its palette has at most 256 entries, a tile sheet always. A picture that is a view of the data, dimmed or outlined, is RGB; the reply names the data file beside it.

Which instant a decode shows

At a stop inside the vblank handler, screen_view matches the framebuffer decoded at the same stop. At a stop in the middle of a frame, what it shows is not established. So choose the stop by the write to what you are about to read: a block of memory, or the palette's pens.

A watch_add in count mode counts writes, not changes, so compare a table at two stops to know whether it moved. One in change mode stops after the write, also when the value written is the one already there. A run_to to the writing instruction's own address stops before the write.

The tools