https://github.com/greggman/rockfall/blob/main/ROCK4.ACT
I've since ported that code multiple times. Once to Gameboy (unshipped, it was just for learning when I was hired to make a gameboy game). Once to C. Once to Java for a feature phone software interview. A couple of years ago to JavaScript
https://greggman.github.io/rockfall/