I've fixed the crash bug that Captain Calc experienced. I've uploaded the updated version to the archives, as well as adding a new
release on GitHub. The issue was tough to track down, and despite only being visible on the restart menu is actually located in the function that checked how many moves are available.
The gist of the issue is that, to count the number of moves, I count how many of each tile can be removed and store the totals in an array. 0 corresponds to no tile, so I subtracted 1 from the tile type when getting the index to save a byte of space. However, I didn't check whether the tile type was non-zero, so the total number of spaces not occupied by a tile was being stored to position -1 of the array. This memory location happened to be the last byte of the tile backup that I restore from when restarting a game. This resulted in a garbage tile being placed in the front bottom left corner. When calculating the number of moves after restarting the level, this garbage tile, often with a larger-than-normal type, was counted. This caused yet another out-of-bounds issue, which crashed the calculator.
This issue produced a crash on a physical calc that I'd never seen before. Every other line on the screen turned dark, causing the screen to resemble a CRT. The game's normal graphics were still visible in between the dark lines. Then, every pixel got lighter and lighter until it was completely white after about 30 seconds. I then had to reset using the button.
Anyways, now that I've revisited this project a bit, I kinda want to work on it more. If I have time, I'll try to implement a better generation algorithm that's guaranteed to make a level with at least one solution, rather than varying from "almost always possible" to "almost never possible" depending on the layout. I also think it would be neat if you could connect two calculators over USB to share high scores or even play collaboratively, which would definitely be possible now that usbdrvce and srldrvce are nearing completion. However, I would want players to still be able to use the game even if they don't have the USB libraries, which the toolchain currently doesn't support.