Vic UltiMem

The UltiMem is an "all-in-one" cartridge for the Commodore Vic-20 that
consists of in-system programmable Flash ROM and RAM, enough for
storing and running almost all Vic-20 software ever produced. The
hardware is a product of RETRO Innovations
(http://store.go4retro.com/).

The UltiMem is a similar to the Vic Flash Plugin (4MiB flash and 32KiB
RAM), of which only some prototypes were built. It comes in two
variants: 512KiB+512KiB and 8MiB+1MiB.

You can try the UltiMem in VICE, starting with r30371, as follows.

	xvic -ultimem ultimem512k-s.img
	xvic -ultimem ultimem8m-s.img

The files are sample menu images generated by makecart according to
the file prg.txt. You can generate a more useful menu image from
filelist.txt. It expects to find a collection of Vic-20 software in
the "vic20" subdirectory.  Invoke it as follows:

	make ultimem8m.img
	xvic -ultimem ultimem8m.img

or (on real hardware)

	make flash4file.prg ultimem8m.bin

Copy the files flash4file.prg and ultimem8m.bin to a medium that is
accessible from a Vic-20 that is equipped with the Flash Plugin
cartridge.  Start the Vic-20 and invoke the loader, editing the file
name if necessary.

	LOAD"FLASH4FILE.PRG",8
	LIST
	2015 SYS4127"ULTIMEM.BIN":::::
	2015 SYS4127"ULTIMEM8M.BIN":::
	RUN

The flash file system format is different from the Vic Flash
Plugin. The main differences are that the files are no longer
compressed, and that ROM images can be stored in 8KiB blocks on their
own, so that ROM cartridge images can be switched quickly, without
involving any copying.

Features

The RAM expansion type can be selected programmatically. Flash or RAM
can be mapped at any of the expansion areas: RAM[123] ($0400-$0fff),
BLK1 ($2000-$3fff), BLK2 ($4000-$5fff), BLK3 ($6000-$7fff), BLK5
($a000-$bfff), I/O2 ($9800-$9bff), I/O3 ($9c00-$9fff). For each block,
there are four possible settings: unmapped, RAM, write-protected RAM,
and flash.

The register file is mapped at $9ff0-$9fff. For maximum compatibility,
it can be disabled until reset or a special re-enabling sequence.

There are two push-button switches and one LED attached to one
register. The third switch on the cartridge (the rightmost one when
viewed from the front of the keyboard) is a reset button. Holding the
middle button while pressing the right button (reset) will unmap the
flash from memory, which is useful if a non-working image was written.

Software

All software is licensed under the GNU General Public License, either
version 2 (or at your option) any later version of the license.

The machine language software has been translated with the XA (xa65)
cross-assembler by Andre Fachat and others.

makecart
	Cartridge image generator software.
	Sample source files are in prg.txt and filelist.txt.
flash4file
	Generates a flash programming image file for flash4.s
	out of a 4M image generated by makecart.
ramtest.s
	RAM test. Starts in the unexpanded configuration.
flash.s
	Source code for flash*.prg.
flash4file.prg
	Copies data from a file (default "ultimem.bin") to Flash ROM.
	The file is to be generated like this:
	"flash4file menu-s.bin flash.bin".
	You may change the file name on the SYS line, provided that you do
	not change the length of the line. The program can be rerun.
flash8m.prg
	A stand-alone program that copies the sample image ultimem8m-s.bin
	to the flash memory. This can be used for testing the hardware.
	Requires a 24K memory configuration (POKE40946,63:SYS64802).
flash512k.prg
	A stand-alone program that copies the sample image ultimem512k-s.bin
	to the flash memory. This can be used for testing the hardware.
	Requires a 24K memory configuration (POKE40946,63:SYS64802).
readme.s
	Quick reference for using the menu software.
menu.s
	The menu software.

The menu software automatically selects the correct RAM expansion type
for program images. The selection can be overridden at image creation
time (with a '3' or '8' immediately after the closing quote; see
makecart.c, and see filelist.txt for examples).

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)

If you additionally hold the SHIFT key, the configuration registers
will be hidden, for maximum compatibility with programs that write to
normally unmapped address space ($9ff0-$9fff).

The menu software is accessed by the keyboard as follows.

key	 	memory configuration
a-z 		jump to the next item starting with the letter
A-Z 		jump to the previous item starting with the letter
CRSR UP		line up
CRSR DOWN	line down
CRSR LEFT	page up
CRSR RIGHT	page down
HOME 		first item
SHIFT+HOME	last item
RETURN 		activate the selected item
SHIFT+RETURN 	activate the selected item, hiding the configuration registers

Acknowledgements

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

Jim Brain for

* warming up the old idea
* developing the hardware and VHDL
* sample hardware for testing

The VICE team for

* perfecting VICE so that it runs the menu software without glitches
* "reference implementations" of bank-switched memory expansions

my sons for

* showing interest in retro computing
* motivating me to complete this project

my wife Heli for

* bearing said sons
* bearing with me while I worked on this project

http://www.iki.fi/~msmakela/8bit/ultimem/
