Flash programmer software for Nicolas Welte's 6502-RAMROM board
(http://people.freenet.de/x1541/hardware/petram.html)
installed in a VIC-20 or a BASIC 4.0 PET

Hardware Features:
- 32 kilobytes SRAM (62256 or equivalent)
- 128 kilobytes Flash ROM (AT29C010A), writable in 128-byte sectors
- installed in the 6502 processor socket
- bank selection and other configuration with on-board DIP switches
- different "personality chip" GALs for PET, VIC-20 and Commodore disk drives

Software Features:
- Short program file, fits in one disk block
- The flash memory bank can be switched while the computer is running
- Any contiguous range of 256-byte memory pages can be written
- Does not access any mass storage; can be loaded from any medium

The program is Copyright  2003 Marko Mkel.

The program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation (http://www.fsf.org/copyleft/gpl.html).

Usage:

1. Choose the appropriate program file, flasher-pet.prg or flasher-vic.prg.
2. Prepare a flash image file (say, image.prg) in the Commodore program format:
  - The start address (16 bits, LSB first) must
    (a) be at a 256-byte boundary (LSB = 0)
    (b) reside within the flash memory (PET: MSB >= $90, VIC: MSB >= $a0)
  - The start address must be followed by n*256 bytes of data
3. Concatenate the program file and the flash image file:
  (a) Unix: cat flasher-pet.prg image.prg > program.prg
  (b) MS-DOS: copy/b flasher-pet.prg + image.prg program.prg
  (c) CBM-DOS: c:program=flasher-pet,image
4. Load and start the concatenated program file on the PET or VIC
   using your favourite method.
5. The program should tell you to configure the DIP switches and to
   press a key.
  (a) Be careful not to touch DIP4 or DIP5 (or even DIP3 on the PET),
      or the memory in which the program resides will disappear momentarily.
      If necessary, flip the neighbouring switches with a screwdriver
      tip or a pencil instead of your finger.
  (b) Select the desired target bank with DIP6..DIP9.
  (c) Flip DIP1 and DIP2 (and DIP3 on the VIC-20) to the ON position.
  (d) After you have pressed a key, the whole screen or a cursor at
      the top left corner will flash for a while.
  (e) If the target bank contains a working operating system, the computer
      should display a READY prompt again.

The program may fail with one of the following messages.

START<>$XX00 OR <$?000
  Did you load the concatenated program file?  Is the start address
  of the image within the flash area?  Is it on a 256-byte boundary?
  Were the files accidentally padded to a larger size by Xmodem, CP/M
  or something else?
WANT 256*N BYTES
  Is the length of the flash image a positive integer multiple of 256?
  Was the concatenated file accidentally padded to a larger size?
END>$FFFF
  The flash image must not "wrap around" in memory.  Is its start address
  correct?  An image starting at $a000 can be at most 24576 bytes long,
  or 24578 bytes if the start address bytes are counted.

Note that the program does not verify whether the data were properly written.

26th April 2003, Marko Mkel (msmakela@nic.funet.fi)
