Extreme Vectrex Multicart Plays Bad Apple

[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.

Thanks for the great tip, [Morris]!

17 thoughts on “Extreme Vectrex Multicart Plays Bad Apple

  1. HOLY CRAP.

    Not just one revolutionary Vectrex hack (streaming vector data from a powerful co-processor on the flashcart) but TWO (abusing the infamous bad shielding of the audio cable to generate arbitrary audio, as well). This is flooring the homebrew scene at the moment.

    Does [Sprite_TM] ever sleep?

    1. Vectrex is just the coolest console ever and this is awesome!

      Don’t think there’s any abuse happening to generate the audio though. There’s a spare mux output from the single DAC used for vector dx, dy, z and digitizing the analog sticks that is actually mixed into the audio channel. Not many original games used it (not surprising given rom size was usually only 2k or 4k) and there’s no support for it in the system rom afaik, but some other home brew stuff uses it, e.g.. Spikes Circus has samples.

      1. You’re absolutely right. Spike (non-‘circus’, the platformer) uses it as well. It’s unfortunate the DAC-mux-to-audio-line-thing is such an afterthought: if they’d just added a single sample-and-hold circuit extra, I could’ve done 11KHz 8-bit instead of the noisy sound I do now.

        1. Didn’t a bunch of CPC geeks bastardize the AY-3 to produce reasonable digitized sound? ISTR they did something like set the envelope generator to oscillate at the sample rate and stream the samples into the tone generators, mixing them to get ~8 bits of resolution.

          Very nice work BTW!

          1. Yep, that’s possible. To do that, you need to modify quite some AY-3 registers per sample, and the AY-3 is accessed through the VIA… all in all, you need quite a few clock cycles to do it, making it non-viable for this application.

Leave a Reply to dingusCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.