It’s the school holidays, and again, I have been left really bored. So, I dug out my CAS calculator, put Ndless on and began writing programs. Eventually, I came up with calculator RickRoll.
I hacked up some programs and put it on the calculator that allowed to me to watch videos (though they are extremely horrible). I soldered a piezoelectric buzzer onto a spare USB AVR I had lying around and programmed it to sing the melody of Never Gonna Give You Up. Put the two together and you have RickRoll on the TI-Nspire with sound and all!
To convert to the video to a playable format, I simply converted the video to a series of grayscale pixmaps, extracted the 8bit color information and converted it to 4bit color and stored each frame sequentially into a giant file. The video player simply reads each frame into the framebuffer, delays and loads the next frame and so on.
The audio was done on an AVR since the NSpire doesn’t have any audio output. I simply coded it so play a melody on the piezoelectric buzzer.
Things that need improving:
- Video compression – I have none. A one minuteish video takes up roughly 13MB which is basically all of the remaining free space on the Nspire.
- Proper controls on the player (the player was hacked together at the last minute).
- The converting process – The current way I do it is terrible.
As promised, here is the source code to all my work (sound part excepted because that source code is not in a distributable state). All code is licensed under the GPLv3.