Sand Sim

Published 2023-06-12


Happy Saturday!

This is an attempt to create a faster falling sand simulation (60fps) by reading and writing directly to screen memory. All pixels / sand particles are active at all times.

I was inspired by Helado's Tiny Terrarium and Axnjxn's Falling sand.
https://www.lexaloffle.com/bbs/?uid=10783
https://www.lexaloffle.com/bbs/?uid=23000

I'm writing 1X2 pixel blocks in order to work directly with bytes and avoid bit-masking to address individual pixels. Then, I am using the display mode hack ( poke(0x5f2c, 2) ) to stretch the vertical scale of the display by 2X without requiring me to write any more data to screen memory.

-Electric Gryphon