nc100em  - an NC100 emulator for VGA PCs running Linux
xnc100em - an NC100 emulator for X
tnc100em - an NC100 emulator for ttys

Z80 emulation from `xz80', copyright (C) 1994 Ian Collier.
NC100 support and VGA/X/tty front-ends (C) 1995-1996 Russell Marks.


This 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; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


The `nc100.rom' provided here (written by me) is a public domain
replacement ROM which is capable of booting ZCN (my free CP/M-like
OS), context saving and restoring, and nothing else - perfect for ZCN,
but useless if you want to run the ROM software. (A copy of ZCN should
be available from ftp.nvg.unit.no in /pub/cpc/nc100. ZCN is
essentially a free NC100 CP/M clone.)

If you own an NC100, you should be able to copy the original Amstrad
ROM for your own personal use with the emulator (which is capable of
running the ROM software), but it's up to you to correctly observe
copyright law. I'm no lawyer.

It's probably not worth it, IMHO. The ROM software's pretty cack
anyway. ;-)


Roadmap
-------

The COPYING file contains a copy of the GPL described above.

ChangeLog describes differences between all versions.


Description
-----------

`nc100em' is an Amstrad NC100 emulator. It supports both the ROM
software and my free CP/M-like replacement OS `ZCN'.

There are two versions - `nc100em', which runs under svgalib on a
Linux console; and `xnc100em', which runs under X and should work on
any POSIX-ish Unix box with X. (I've only tested it under Linux,
though.)

There's also another (experimental) version, `tnc100em', which needs
neither svgalib nor X, where the terminal is simply hooked up to the
emulated serial port. When it starts up, tnc100em emulates both shifts
being held for 1/5th sec, then types `|s' then enter. If you're
running ZCN, this is enough to reboot and redirect console I/O to the
serial port. Obviously, this *only* works with ZCN.

I'm afraid that at the moment you need to kill off tnc100em by hand
(with `kill') from another console/tty. Using `kill' (i.e. sending a
SIGTERM) will act like F10 in (x)nc100em. See later for details, but
basically it means that while the memory card is saved, the ram isn't.
This is probably what you want, as otherwise the console would be left
redirected to serial, which is usually bearable with the X version but
makes things very tricky for the svgalib version.)


Installation
------------

Do one of these:

- `make', to make all versions.
- `make vga', to make only the svgalib version.
- `make text', to make only the text version.
- `make x', to make only the X version.


Then (as root) do `make install', which installs any programs
compiled, in /usr/local/bin.

`z80.c' will take a while to compile (two minutes on my dx2-66). Don't
worry about this, it's simply because of the mind-bending - and above
all, fast - way the Z80 emulator works.

Be sure to read all of this README. (x)nc100em is a quick hack, so
you'd better know all about the gotchas before running it. :-)


History
-------

I decided to write a NC100 emulator on February 26th 1996. For some
reason. :-)

Thanks to the GNU GPL, I could use Ian Collier's Z80 emulator from
xz80, a ZX Spectrum emulator for X, and replace the X and Spectrum
support code with that for svgalib/rawkey and the NC100, as I did with
my ZX81 emulator Z81. And here I am writing the README the following
evening (again). This is an argument for free software. :-)

I give Ian the main author credit for nc100em, as the Z80 emulation is
much harder to do than emulating the NC100's hardware etc. However,
any correspondence regarding nc100em should be to me, as Ian hasn't
had anything else to do with it and may not appreciate being hassled
by NC100 fans. :-)


Using nc100em
-------------

There's no man page yet (due to this being a quick hack), so this'll
have to do. Sorry. :-)

You can quit with F10. Quitting with F5 is 110% better, as this acts
like the power on/off button. (Whereas F10 just stops it dead, which
is generally a Bad Thing.) With the svgalib version, virtual console
switching works as usual. The emulated NC100 attempts to run at 6MHz;
you probably need a 486dx4-100 or better to achieve this. At the
moment, nc100em will just run as fast as it can. This may be a problem
on high-end 586s and (esp.) DEC Alphas and the like.

The keyboard more-or-less assumes a UK layout, I'm afraid, and some
keys may be inaccessible on some other layouts. Most keys are mapped
in the obvious way, but there are some exceptions:

Keyboard		Emulated as

Esc			Stop
<--			<-Del
Delete			Del->
`			Menu
Alt			Symbol
Insert			Function	(I know this is weird... :-))

In X, both Backspace and Delete are mapped to `<-Del'. This is bogus,
but saves trouble with funny setups (like on Linux - X setups on Linux
commonly follow the PC backspace/delete model, which can be handy but
can also be a pain).


At the moment, the following bugs and restrictions apply:

All the data files (`nc100.rom', `nc100.ram' and the optional
`nc100.card') must be in the current directory. You could hack
`main.c'/`xmain.c' to fix this. It's probably better to just make a
directory for those files and always run nc100em from there.

The screen is *tiny*. This is tricky to fix; scaling it up would
definitely mean a slowdown. (Indeed, xnc100em supports scaling on
colour screens, and it *crawls*.) If you're running ZCN under the X
version, try redirecting output to the serial port with `|s'. It then
acts a little like the text version, but with a graphics window so you
can still run ZCN invaders. :-) This works surprisingly well.

There's no support for the parallel port. I could add it if somebody
really wants it.

The serial support is great for high-speed output and low-speed input
(e.g. using it for serial console in ZCN), but bloody awful for
high-speed input (as you'd want for serial file transfer). Sorry. This
is unlikely to get better, due to the overhead of emulating serial
interrupts (calling select(), etc.) for serial input.

Nc100em runs full speed without attempting to slow down if it's
running faster than a real NC. This might be a problem on fast
machines.

You'll probably want to disable auto-shut-off, as this isn't really
what you want when running an emulator. :-)


Using ZCN with nc100em and the supplied `nc100.rom'
---------------------------------------------------

Run `makecard' to create an empty unformatted 1MB virtual PCMCIA
memory card `nc100.card', then just run the appropriate version of
nc100em like this to cold-boot the system:

nc100em zcn.bin		(for VGA)
xnc100em zcn.bin	(for X)
tnc100em zcn.bin	(for ttys)

...where zcn.bin is from the `bin' directory in the ZCN distribution.
If you use the (recommended) F5 key to exit, it's just a case of
`nc100em' (or whatever) to run it from then on. This way, you don't
have to have a copy of the system on the virtual A: drive in
nc100.card.

(BTW, you can cold-boot like this in future too, if something crashes
or whatever, as long as you delete the `nc100.ram' file beforehand.)

Once you've booted ZCN, go through `doc/zcn.txt' in the ZCN
distribution. You'll probably want to skip most of the installation
stuff. "Installation epilogue" is a good place to stop skipping. For
reference, your `memory card' is 1024k, and you'll want to format
drives a:, b:, c: and d:.

Note that serial transfer isn't possible. Under ZCN this isn't a
problem, as the utility `zcndisk' can transfer files to/from a
ZCN-format nc100.card. It's a pretty quick and dirty hack, and the
interface really sucks, but it works well enough. You can format the
drives from zcndisk if you want. BTW, you shouldn't expect
transferring files while {x,t,}nc100em is running to work. (Quit the
emulator, run zcndisk, do the transfer, quit it, then run the emulator
again. That works.)

Note that anything which uses the NC100 ROM is bound to have problems
with my tiny replacement `ROM'. See below.


Using ZCN with nc100em and the real NC100 ROM
---------------------------------------------

Don't. :-) It's more hassle, and buys you little.

Actually, this is a bit unfair. If you want `zcnclock' and `spellwd'
to work, you *need* the real NC100 ROM. `spellwd' will crash horribly
without it. And, while using the real ROM doesn't buy you much, it
doesn't hurt either.

Just make sure you stick with one or the other - the context-saving
works slightly differently with each. If you really want to switch
ROMs, make sure you delete `nc100.ram', then cold-boot as described
previously.


Using the ROM software with nc100em
-----------------------------------

This is easy enough - just get the 256k of ROM across from your NC100
(this takes a while...), call it `nc100.rom' and run nc100em. The
problem is, you can't really get data in or out other than by the
serial support, which is far too slow at serial input for this to be
workable. If you're really desperate to use the ROM software with
nc100em but want to get stuff in and out of it, contact me and I'll
help as much as I can.


(Lack of) Future developments
-----------------------------

While I'm unlikely to do much (if any) hacking on nc100em in future -
it's a fairly pointless hack, really - feel free to try and prod me
into making it better, if you want. :-)


Contacting me
-------------

No email address at the moment I'm afraid. :-(

Postal address:
		Russell Marks,
		3 Rapley Close,
		Camberley,
		Surrey,
		GU15 4ER,
		United Kingdom.

If you insist on abbreviating my name, please use "R. J. Marks".


Share and enjoy! 

-Rus.
