Marko Mäkelä’s old computers: Vic Flash Plugin

In 2000, a Vic-20 was for sale on a flea market for 50 FIM, approximately €8.40. I already had two, so I gave it to Juha Kouri, who did not have one. He wanted to have a flash memory cartridge that would hold some games. Being a hardware guy, he suggested the simple idea of storing cartridge images in uncompressed format. Being a software guy, I suggested compressing the images with PuCrunch and extracting them to a 32 KiB RAM expansion. That approach would work with arbitrary-sized programs, without wasting a single byte to memory alignment.

Fast forward to 2010. The Vic Flash Plugin is finally here. You can try it in VICE, starting with release 2.2.5.

Features[Vic Flash Plugin circuit board, wooden case and a VC-20]

Hardware

4 MiB Flash ROM
enough space for all Vic-20 software you can think of
32 KiB RAM
memory configuration features

Menu Software

The menu software automatically selects the correct RAM expansion type for program images. The selection can be overridden at image creation time.

By holding a key during hardware reset or pressing a key in the menu, you can enter the Commodore BASIC interpreter in different memory configurations:

key memory configuration
STOP unexpanded (3583 bytes free)
3 3 KiB memory expansion (6655 bytes free)
8 24 KiB memory expansion (28159 bytes free; compatible with 8 KiB and 16 KiB)

Because the menu software skips the slow memory test, it will exit to BASIC instantaneously.

If you additionally hold the SHIFT key, you can hide the configuration registers until hardware reset, for maximum compatibility with programs that write to normally unmapped address space.

The menu software is accessed by the keyboard as follows.

Keyboard assignment in the menu software
key memory configuration
az jump to the next item starting with the letter
AZ jump to the previous item starting with the letter
CRSR⇅ line down
SHIFT+CRSR⇅ line up
CRSR⇆ page down
SHIFT+CRSR⇆ page up
HOME first item
SHIFT+HOME last item
RETURN activate the selected item
SHIFT+RETURN activate the selected item, hiding the configuration registers

Download

Software

The machine language software has been translated with the XA (xa65) cross-assembler.

Small sample menu image. Contains a RAM test and flash programming software. Usage: xvic -cartfp menu-s.bin.gz (in VICE 2.2.5 or later). The source code is in vfp.zip.
vfp.zip
Source code for all software and a recipe for generating a flash ROM image containing many Vic-20 software titles. Includes two flash image loaders.

Hardware

vfp-brd.zip
schematic diagram and circuit board layout (CadSoft Eagle)
(to be released later)
VHDL code for the Lattice ispLSI1016

This section will be updated once the first production batch of circuit boards has been completed.

History

By 2002, I had written a menu software that would decompress the images to memory. The first hardware prototype had 512 KiB of Flash, and all images were in a single directory that had to fit in the first 8 KiB bank. To save that precious memory window, I devised a menu entry format comprising a 10-byte file name [A-Z.'()-]{16} and a 3-byte start address. With about 2 KiB of menu software, that would leave room for 472 titles. Having that many entries in a single directory could make navigation difficult. Besides, there are more than one thousand Vic-20 titles, comprising more than 3 MiB in compressed format.

To address these limitations, another prototype was built, with the biggest 5-volt flash memory device that is available, the AMD Am29F032B, 4 MiB. I also started reworking the menu software to something that would support subdirectories stored anywhere in the flash memory, and full PETSCII file names. The last mile was the image generator software that I should rewrite to support the new format. This lingered for some six years, as I was busy looking after my sons. Finally, they started getting addicted to a different type of Flash games, and I had to get my act together.

In December 2009, I implemented the hardware emulation in VICE and made some design simplifications in the image generator software. Gone were the file system abstraction layer and a configuration file grammar (XML-based even?) for specifying directory trees. In the end, the implemented parser does little beyond lexical analysis. Instead of enforcing a tree topology for subdirectories, it allows arbitrary pointers to menu entries (not just to the start of a menu).

After completing the menu software, the image generator and the flash programming software and having Juha Kouri revise the VHDL code, I submitted my patch to VICE and prepared the software for release.

In 2011, a wooden case for the circuit board was built by Turo Heikkinen. The main body is one solid block of wood, with a slot carved for the circuit board and a hole drilled for a wooden reset button. The circuit board is attached to the wood with two screws. The bottom part of the case is a thin piece of plywood that slides in place.

In January 2012, I finally downloaded a 4 MB image of software to two cartridge prototypes, using the uIEC/SD from Jim Brain’s RETRO Innovations. My original plan was to write something for my C2N232 so that it would allow such a large file to be loaded. But, I never came around to it. With the uIEC/SD and the standard serial bus routines, it went smoothly at almost 2 MB/h, without using JiffyDOS.

Future Directions

The sd2iec approach could be a practical alternative to storing everything in custom format in a huge non-removable ROM chip. A simple approach could be to replace the 4 MB flash with a small one that would only allow the memory configuration to be chosen, and a menu to be automatically loaded from a SD card that is in convenient FAT format. When the software library is in such an interoperable format, you can easily configure it. The cumbersome step of rebuilding and reloading a huge image file would be avoided.

A step further could be to equip the cartridge with a SD card slot and a microcontroller that would run a modified version of sd2iec to load images directly from a memory card to the on-cartridge RAM, without involving the slow host system (Vic-20). This ought to lead to somewhat faster transfer times, but is it worth the complexity? When loading to the internal memory, the Vic-20 would copy the data from the cartridge RAM to the main memory.

June 2016 update: UltiMem is the future.

Acknowledgements

I would like to express my thanks to the following people:

Juha Kouri for
Pasi Ojala for
Turo Heikkinen for
Jim Brain and the sd2iec team for
The VICE team for
Hannu Nuotio for
my sons Väinö and Otso for
my wife Heli for