This is an implementation of ABC80 in an FPGA by H. Peter Anvin
<hpa@zytor.com>.  Some of this information may be out of date; check
the CHANGES file.

This version uses an "Altera Nios Development Kit, Cyclone Edition"
combined with a "AleaRep Lancelot" daughtercard (for
VGA/Keyboard/Mouse/Sound -- see http://www.fpga.nl/).

To build, run "make" in the top directory on a Unix/Linux machine,
or under Cygwin on a Windows machine, then build the Quartus II
project "abc80.qsf".

As provided, the design runs at 25 MHz (the real ABC80 ran at 3 MHz.)
SW3 is set up as a "turbo button", selecting 25, 12, 6, or 3 MHz
operation. Turbo can also be selected via "out (144),n" where n=0 for
3 MHz and 3 for 25 MHz.  The speed is shown on the display.

There is an MMU which can address the 1 MB of SRAM on the card.  This
MMU works as follows:

There are 4 memory maps each consisting of 256 pages of 256 bytes

To write the MMU:

   out (128),vpage
   out (129),map
   out (130),ppage_lo
   out (131),ppage_hi

To read the MMU:

   out (128),vpage
   out (129),map
   in ppage_lo,(130)
   in ppage_hi,(131)

To select which memory maps to use:

   ; Separate maps for read, write, and code
   out (132),(xmap << 4)+(wmap << 2)+rmap

To read the current memory maps:

   in maps,(132)

The MMU also supports "out (7),map" for compatibility with
Mikrodatorn's 64K expansion.  This sets all the maps to the same

The top 4 bits of the physical page indicate memory device; the rest
is address; see data/mmuinit.pl for which memory devices exist.

The MMU replaces the address direction ROM in the real ABC80.

80-column mode is now fully supported.  Switching is via INP(4)/INP(3)
as normal. The script data/munge_basic.pl does the appropriate
patching of the BASIC ROM; it is specifically configured for a
checksum 9913 ROM; if you want to replace the BASIC ROM with an 11273
ROM you have to adjust this script.  The MMU controls whether or not
memory contents should be modified in 80-character mode, see
data/mmuinit.pl for details.  The BASIC checksum in 80-column mode is

In 80-column mode the low 1K is at address 29696 (0x7400).  This is
definitely different from the MyAB module, and I *think* from the GeJo
one, but is more efficient with the memory layout.  As far as I know
most (all?) programs that are 80-column aware use the table at address
884 anyway; I there were at least three different 80-column cards on
the market, and at least two of which had different memory layout.  If
you don't like the one I picked, just reprogram the MMU :)

The CompactFlash is now supported; the controller blindly assumes a
64 MB or larger card (specifically, 62,390,272 bytes or 121,856
512-byte sectors.)  It appears under UFD-DOS as HD0: to HD3:; the
UFD-DOS ROM for ABC80 from ABC-klubben is included.  Note that it uses
the top 64 bytes of the POKE-area (65472 to 65535) since it is a
binary port from ABC800.  It would probably be an easy patch to
provide it with some RAM in the lower memory map using the MMU and
avoid that hassle.  The "tools" directory contains a Perl script which
creates an empty UFD-DOS filesystem.