http://www.guru-group.fi/~too/sw/runcart.readme

runcart.perl generates a CBM BASIC runnable VIC20 or Commodore 64 file
             from VIC20/C64 cardridge ROM files.

The coal is achieved so, that in the beginning fo generated file
there is a CBM BASIC line `1 sys 256 * peek(44) + peek(43) + 33'.
This is 33 bytes off the start where this file is loaded with LOAD
command. At this point starts a small 6502 code, which copies ROM 
images written after this routine to the actual place it is originally
copied from (this making it re-executable).

So, the file contents is like the following:

<6502 copy code>[]

There is no problems writing such a file on Commorore 64, since that has
always 64 Megs of memory available...

But with Vic20, there must be enough contiquous memory at memory blocks 
1, 2 and 3 for this executable file... with 8k ROM, there must be memory
at BLOCK1, and with 16, ROM, at BLOCK1 and BLOCK2. Also, the there must
be memory at destination blocks too (at least BLOCK5).
With VICE this is not a problem, since all these blocks has memory by default.
(thus making this quite useful w/ to generate runnable programs for VICE).


Using `runcart.perl' is very easy. The only requirement is that the ROM image
files that are to be processed must have their destination location stored
in first 2 bytes of the file (When saving data w/ CBM kernal routines this
happens by default, and the VIC20 cartridge files located at www.funet.fi 
fulfills this requirement).

The usage is:

./runcart  [ROM image2] > program_file

This way input and output files does not mix up. Perhaps a better way
would be to require output file given with `-o' -option.


Examples: (order of given input files does not matter)

% ./runcart.perl Lode%20Runner-6000.exe Lode%20Runner-a000.exe > "lode runner"
**** File Lode%20Runner-6000.exe, start address 24576, length 8192
**** File Lode%20Runner-a000.exe, start address 40960, length 8192
Writing Vic20 Reset code

% ./runcart.perl Shamus.prg > shamus
**** File Shamus.prg, start address 40960, length 8192
Writing Vic20 Reset code

Now "lode runner" and "shamus" are loadable and runnable with simple
`load' and `run' -commands on a Vic20 Platform.


The current requirements for files are that ROM image size (per file) is
4096, 8192 or 16384 and the destination address must be divisible by 4096.
These are safe defaults, the program could handle much looser requirements.

Other requirement is that every destination address is at least 256 bytes
bigger than the load address the program was loaded (peek(43) + 256*peek(44)),
and the destination areas doesn't overlap (well, it would be error
in the files, then). These are not checked during `runcart.perl' execution.

And here is the software.