The Arduino Mega is a useful tool for the maker. Generally, once one has come up with plans for blinking LEDs that require more IO than is available on the Arduino Uno, one graduates to the Mega and goes for broke. However, it’s not typically what we’d consider as our first choice for video work. [Stephane] begs to differ, and coded this Bad Apple!! demo for the Arduino Mega 2560.
For those unfamiliar, video on the Arduino is actually somewhat of a solved problem – merely requiring a pair of resistors and some nifty code. The real meat of this hack is the video storage itself. It’s been done before, but by streaming data off an SD card or serial link. [Stephane] was determined to store everything on the Arduino itself, and thus the hack begun. Video data is stored as 1 bit per pixel, as it’s a simple black and white video as per the original inspiration. LZ77 compression was used to cram the data down without requiring too much RAM, which is a limited resource on the Mega. It’s video only, as the Mega is tapped out handling 3 minutes and 39 seconds of video storage, but future work may include syncing with a second Arduino to deliver the soundtrack.
It’s a hack that shows off [Stephane]’s ability to get impressive performance out of limited platforms. We’ve seen this before, with his excellent Star Fox port to the Arduboy. Video after the break.
Continue reading “Bad Apple!! Via The Arduino Mega”
[Sprite_TM] had a Vectrex console that he wanted to play with. Alas, his makeshift multicart had fallen into disrepair. Rolling up his hacking sleeves, he set about making a new one, a better one. His PCB design included his microcontroller of choice: the ST STM32F411, a 32-bit 100Mhz ARM Cortex M4, along with a 16MB SPI flash chip. [Sprite_TM] wanted to make programming games onto the multicart simple. Using the libopencm3 firmware library for the STM in conjunction with Elm-Chans FatFS, the multicart could be plugged into a computer’s USB port and have any game data dragged and dropped onto it like a USB stick. The PCB then connects directly into the Vectrex’s cartridge port. The first cartridge file is a basic menu that lists all of the game ROMs stored in the flash memory. When the user selects the game the STM loads that ROM file which the menu software then boots.
After loading his entire Vectrex ROM library onto the multicart, [Sprite_TM] realized he had far too much space left over – so he decided to add some extras. His first choice was Bad Apple (YouTube link), a music video made by fans of the Touhou Project game series. The video features black and white silhouettes of the many game characters in a shadow art style. Since its debut, Bad Apple has been ported from everything from the Sega Genesis (YouTube link) to laser scanners (YouTube link). It was time for the Vectrex to join the list.
After ripping the video from YouTube, [Sprite_TM] used MPlayer to save each frame as a PNG along with a wave file of the music. Next, he ran Potrace on the PNG files to get vector versions. Using a custom PHP script, the resulting JSON file was post-processed into relative vectors the Vectrex uses. Digital audio was possible by having the Vectrex’s 8-bit DA-converter perform double duty both for the video circuit and the audio. However, the volume must be turned to the max in order to hear the music. Incidentally, the DAC can only output audio in this scenario when vectors are not being drawn, so the event timing needed to be adjusted. The video and audio data was re-parsed after a modified version of VecX was used to get the timing events synchronized before transferring Bad Apple onto the multicart.
You can see the Vectrex version of Bad Apple after the break, along with a 3D-engine based on Doom levels. The engine is written in C and makes use of the Z-buffer, creating the effect of solid 3D-objects in front of each other. There are no weapons or enemies to dispatch here, but the effect is impressive nonetheless.
Continue reading “Extreme Vectrex Multicart Plays Bad Apple”