=======
xc16emu
=======

This is an emulator of the Commodore C16/C116/plus/4 computers for X11
using the Qt widget set (s.b.).


General notes:
--------------
 - No sound yet. 
 - Load/Save works (floppy: device #8 or use DLOAD/DSAVE).
 - The keyboard is adapted to standard PC Keyboards as good as possible
   (Shift is Shift, Ctrl is Ctrl, Alt/Meta is Commodore, Pause/Tab=RunStop
   Backslash// is Sterling; most other keys are 1:1 if possible, just try
   typing, it's much better than the original; take a look at the bottom 
   of emuwid.cc for all bindings)
   There are still problems with the Key Up/Down behavior with Modifiers :(
   This is all so difficult, because the Keyboard is simulated on the native
   8x8 bitmap matrix of the C16.
 - The 6510 engine does not keep track of the exact execution cycles,
   (every instruction has a length of 3 cycles as a guess so far :)
   but this is not very important I think
 - The 'split screen mode' in BASIC works without a workaround, so there is
   a chance that assembler games might work too. (Not yet tested: I have no
   idea how to save the games from the tapes as a normal file :)
 - You can enable/disable the rom banks and change the memory size at runtime,
   but this will always reset the (emulated) machine.
 - Blinking does not work, yet ...
 

Tested Platforms:
------------------
Linux/Intel, Linux/Alpha, SGI IRIX/mips
  (The main platform is Linux/Intel, so newer versions may not always work
  on the other platforms)

Compiler notes:
---------------
  Tested with g++ >= 2.7.2 and egcs >= 1.0.0 (but others may work, too)
  (egcs is the development compiler, so newer versions may not always work
  on the other compilers)

Libraries:
----------
xc16emu is based on the Qt widget set. You can get Qt from http://www.troll.no 
Qt 1.3 1.31 and 1.40 works, others may or may not work
No X11 specific functions are used
No Linux specific stuff is used (as far as I know)


=============
INSTALLATION:
=============

 - Edit the Makefile
   Make sure the X and Qt include and library paths are correct
   
 - Type 'make' 
   This will build the executable 'xc16emu'
 
 - Type 'xc16emu --create-rc-file=.xc16emurc'
   This will create a rc-file '.xc16emurc'
   
 - Edit '.xc16emurc' to your requirements
   (Set the 'rompath' to the directory where the rom images are located)
 
 - Move '.xc16emurc' in your home directory (or to /etc/xc16emurc as root if
   you want it to be the system global default (~/.xc16emurc will override
   /etc/xc16emurc))

 - Type 'xc16emu --help' to see a list of command line options (command line
   options override rc-files)
   
Now everything should be ready. Type './xc16emu' to start the emulator.
Inside the emulator window type 'DLOAD"BASIC/PAINT.BAS' to test the emulator.


===========
ROM images:
===========

The ROM images are not included in this package due to copyright restrictions.
You must grab the images from your C16/C116/plus/4: (I will write a tool
to grab them in the future, till then, you must try yourself)

The following images are required:

basrom.dat (16384 bytes == 16k) $8000-$bfff of rom bank 0
sysrom.dat (16384 bytes == 16k) $c000-$ffff of rom bank 0
(the IO section in $fd00-$ff40 will be ignored, but just grab everything)

The following images are optional:

solrom.dat (16384 bytes == 16k) $8000-$bfff of rom bank 1
sohrom.dat (16384 bytes == 16k) $c000-$ffff of rom bank 1
($fc00-$ffff will be ignored, but just grab everything)
(For the plus/4, this is the build in software package)

e1lrom.dat (16384 bytes == 16k) $8000-$bfff of rom bank 2
e1hrom.dat (16384 bytes == 16k) $c000-$ffff of rom bank 2
(1st expansion rom bank (i.e. from expansion cartridge))

e2lrom.dat (16384 bytes == 16k) $8000-$bfff of rom bank 3
e2hrom.dat (16384 bytes == 16k) $c000-$ffff of rom bank 3
(2nd expansion rom bank (i.e. from expansion cartridge))


Store these images under /usr/local/lib/xc16emu_roms/ (or somewhere else and
use the -p option (see xc16emu --help) to set the location)

Of course you can also write your own operating system :) Just set the start
address in $fffc/$fffd. (Perhaps a port of Linux?)

Please don't ask me for the images. I won't send them anywhere.


