Details for the flash chip image

A project log for Симон

The old "Simon" memory game.... with an evil twist

Nick SayerNick Sayer 08/12/2019 at 19:450 Comments

The flash chip needs to be programmed with the image of a FAT filesystem inside of an MBR partition table. I've got a mac, and the easy way to do this is to open up the Disk Utility and just ask it to make you a new disk image. For best results, make the image just slightly larger than the total size of the audio samples. Disk image will mount the new filesystem for you. Copy in all of the files required and "eject" the image. Once that's done, you need to pad the image with 0xff bytes to the exact length of the chip. Filling the unused portion of the chip with 0xff is better for it, as you're not needlessly setting bits to 0 and writing blocks of 0xff should be fast, as the chip doesn't actually have to do anything.

The audio sample files themselves are raw (no header or anything), single channel µ-law encoded 8 bit audio played back at 8 kHz sample-rate. You can turn any audio file into this format with sox. The output file arguments are "-t raw -r 8000 -c 1 -b 8 -e mu-law"

At present, the code in the controller expects at least 6 files. Files "1" through "4" represent the four sounds for the buttons. The nominal order (remember, the game can rearrange them) is red, green, blue, yellow. The next files are "LOSE_n" (where n counts up starting at 1). One of these is played when the player loses while blinking the correct light/button). The last files are called "WIN_n", one of which will be played when the player goes beyond the last level (which is 250, so it's unlikely an unaided human player could do it, but I wanted the firmware to not crash if it happens).