psxsdk

flame

A sheet of fire at 640 by 480: a model built in memory and recolored every frame.

Controls

The d-pad tilts the sheet, L1 and L2 roll it, and R1 and R2 move it nearer and further. Start and Select together quit.

A port of Sony's Net Yaroze demo "flame" (S. Ashley, 1997): a sheet of fire, drawn at 640 by 480. A grid of heat values is seeded along its bottom edge with random hot spots every frame, blurred with its neighbors, and scrolled upwards, so that the heat rises, spreads and dies out. The grid is a single TMD built in memory at startup, a flat sheet of gouraud quads with lighting switched off, and every frame the four corner colors of each quad are rewritten from the heat values through a palette running from black through red and yellow to white. The GTE and the 3D library then draw it like any other model, so the sheet can be turned and moved. The library's font prints the count of horizontal syncs a frame takes.

Differences from the original:

  • The heat grid is one row and one column larger than the original's, which reads one past its edges in the blur and so takes whatever is next to the array in memory for the heat beyond them. Here that heat is zero.
  • The sheet has a coordinate system of its own. The original points it at WORLD, the library's nil coordinate system, and writes its transformation through that pointer, which in C silently overwrites the kernel's memory at address 0.

Nothing allocates after startup.

Source on GitHub