Fire demo using LCD DRAM as screen buffer

Full screen fire effect in hi-res hi-color with no screen buffer in RAM, except a single line buffer of 220 bytes.

Bin: FireDemo.bin (5.3 KB)
Source code: FireDemo.zip (22.0 KB)

The demo includes three modes. Use button A to switch modes. First two use slightly modified algorithm from How DOOM fire was done. The first one is for comparison and uses 220x136x8 bit screen buffer (full screen buffer wouldn’t fit into RAM).

firedemo

Second one is the one that uses only a single 220 byte line buffer. For each line it fills the buffer with pixels read from the LCD and then uses the buffer to draw the line one row higher directly to LCD.

Third one uses a more traditional fire algorithm where you calculate the average of a few neighbouring pixels and save the result to a pixel one row higher. It also uses line buffers, but it needs two of them.

Code is based on MiniLib added with functions to read pixel data from the LCD. It looks like the Pokitto emulator does not support reading pixel data. You can run this on emulator, but you will see only the first mode (the one using screen buffer).

9 Likes

Nice fire effect! :fire::fire::fire:

You had my hopes up for a moment there, I thought you figured how to right pixels outside the screen area to do some sort of double buffering! :frowning:

Excellent work though!