ENTER - The Enterprise Emulator
(c) Copyright Kevin Thacker 1999-2001

Enterprise ROMs (c) Intelligent Software Ltd, All rights reserved.

This source is released under the GNU Public License. See the file "Copying"
for the full license.

License:

   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, 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

INTRODUCTION
============

ENTER emulates the Enterprise computer.

This computer is a 8-bit computer, with a Z80 as the CPU. It has two custom chips,
called Nick (graphics) and Dave (sound, i/o, interrupts). The computer is a powerful
system with many different resolutions, 256 colours, and great 3 channel sound. In addition,
the Operating System has been written so that it can be expanded easily using additional
expansion roms, or utility programs.

CONTROL
=======

Keyboard:

Most keys are mapped as you would expect,
but some are not so obvious:

PC KEY			ENTERPRISE KEY
------ 			--------------

SCROLL LOCK		HOLD
CAPS LOCK		LOCK
DELETE			DEL
BACKSPACE		ERASE
KEYPAD 1		F1
KEYPAD 2		F2
KEYPAD 3		F3
KEYPAD 4		F4
KEYPAD 5		F5
KEYPAD 6		F6
KEYPAD 7		F7
KEYPAD 8		F8
CURSOR LEFT		INTERNAL JOYSTICK LEFT
CURSOR RIGHT	INTERNAL JOYSTICK RIGHT
CURSOR UP		INTERNAL JOYSTICK UP
CURSOR DOWN		INTERNAL JOYSTICK DOWN
INSERT			INS
ALT/ALT GR		ALT
END				STOP


Joysticks:

At this time only External Joystick 1 can be used.
For the external joystick you need a gameport on your PC. 
Please configure and calibrate your joypad/joystick 
using the Windows or DirectX control panel.

SOFTWARE
========

A) Transfering software from a real Enterprise computer

1) Discs
The Enterprise uses a PC DOS filesystem. You can either copy the files from the disc
onto your PC and use the tape patch to load them, or you can create a disc image
using CPCTRANS or CPDRead.

I have been told by Zoltan Nemeth, that there is a Turbo EXDOS interface which can use
High Density and greater disc capacities. Unfortunatly, these are not emulated yet.
The basic EXDOS interface that supports 720K PC discs is emulated. The two disc image
utilities cannot handle disc images with these formats.

2) Tapes

Daniel Stocker has written an excellent utility called EPTE. EPTE is a virtual tape
recorder. When you run this program you can load and save programs from a real Enterprise
onto the PC. This program can therefore extract tape files from a .WAV.
This program uses it's own format to store the tape data, which I plan to use
in a future version, however, it can also save the files to the PC filesystem so that
the tape-patch feature can be used to load the files.

B) Loading software

Software is available at the Enterprise Depository, or you can transfer programs yourself
using the methods described above.

If the EXDOS rom has been loaded, disk images can be accessed.

Some useful EXDOS commands are:

EXDOS			- Go to EXDOS Command Line Interface
DIR			- Show listing of current directory 
CHDIR <name>	- Change directory to <name>
A:			- Select drive A 
B:			- Select drive B
C:			- Select drive C
D:			- Select drive D

If you are using these commands from BASIC, prefix them with ":".
If you are using these commands from the EXDOS CLI, no prefix is required.

LOAD"<name>"	- load program <name>. If program is machine code, it will
			  be executed. If it is BASIC, it will not.
RUN"<name>"		- load and execute program <name>

Notes on Disk Images:

NOTE: In Windows, direct access to the PC floppy drive is not as easy as in DOS.
To access the floppy hardware, a device driver must be used. Writing a device
driver is a complex and long task. So at this time, direct access to discs is not
possible in the emulator. However, so that you can use your disc software,
disc images are used.

Disc images are files containing all the data on a single disc in a special data structure. 
These can be created using the "cpctrans" utility with CPCEMU v1.5 utility,
or CPDRead available from www.classicgaming.com/caprice
(Please remember to configure these programs to read 2 sides, 80 tracks, with sector id's
of 1-9).

I have chosen to use the disk image format from these utilitys because it is the
same as that used in my Amstrad CPC Emulator, and so I have already written code
to support this.

Other disk image formats may be used in the future. Tell me if this disc image format
is not sufficient for your needs.

Notes on EXOS:

There are different versions of EXOS, and because of this, some programs will
not work if they are used with a version of EXOS that they were not designed for.
Some programs for instance will show a bad display on EXOS 2.0, but will be perfect
on EXOS 2.1. If you find a program that has a bad display, please try another version
of EXOS before you report the problem. If the display is still bad, please report
the problem to me.

C) ROMS

You can use roms with ENTER, but you will need to save the data to a file.
If a ROM uses more than 16k of data, then you can either save the 16k blocks seperatly,
or in one file.


CONFIG FILE
===========

The emulator memory is setup by a configuration file called "enter.cfg".

This file is simple and contains the following keywords with their parameters:

EP_PAGE = <number>
	<number> is a number in the range 0-255, and specifies a EP memory page.
	EP_PAGE_TYPE and EP_PAGE_DATA will act on this block.

	If the number is prefixed with a "#" it is a hexidecimal number, if the
	number doesn't have a prefix it is a decimal number.

	If pages #FC-#FF are specified, they are ignored. Pages #FC-#FF contain
	the standard 64k memory.


EP_PAGE_TYPE=<type>		
	<type> is RAM, SRAM or ROM.
	This memory type applies to the EP memory page specified with EP_PAGE.

<type> information:

ROM	
	This page contains a rom. Writes will be ignored and reads will return rom
	data. If a rom is specified which is larger than 16k, it will use more than
	one EP memory page.

RAM 
	Standard ram. This EP memory page can be read and written to like
	normal ram.

SRAM = "Saved-RAM". 
	This block is saved when the emulator is quit. The filename is
	"XX-SRAM.RAM". XX is the hexidecimal number of the EP memory page.
	When the emulator is started, this file will be loaded if found.
	Using this memory type is like having CMOS or battery powered RAM
	connected to your Enterprise.

EP_PAGE_DATA="<filename>"		
	The data applies to the EP memory page specified with EP_PAGE.
	This is only needed if EP_PAGE_TYPE = ROM.

e.g.

EP_PAGE=#0
EP_PAGE_TYPE=ROM
EP_PAGE_DATA="EXOS.ROM"

This tells the emulator to load EXOS.ROM as a ROM starting at page 0. If the file
is 32k, it will use page 0 and page 1.

With ENTER you can use different EXOS versions. I suggest you use v2.1 or v2.3 because
many programs are written to use the features in these versions.

I have found that some utility ROMS will not work if the incorrect version of EXOS
is loaded. If you find a rom doesn't work, please try another EXOS version before
reporting the problem to me.

STATUS OF EMULATION
===================

What is emulated:
=================

NICK:
- All documented video modes. 
(The emulation is accurate to the line. Any mid-line changes will not be shown
correctly).

- Video interrupts.

- Some interlace modes.

- VRES operation in pixel and lpixel.

DAVE:
- Keyboard. 

- External joysticks. 

- Programmable/Sound chip interrupts:
	tone channel 0, tone channel 1, 1Hz, 50Hz and 1Khz interrupts.

- tone channel 0,1 and 2 simple tone

- syn/hold/run bits in Dave register A7

- volume mixing, including left or right channel as DAC. 
(Digitisted and Sampled sounds work).

WD1772/EXDOS:

- FDC Operations: Seek, Restore, Step In, Step Out, Read Sector, Read Address
Force Interrupt. (some operations may not return correct codes or may not operate
correctly yet)
- 4 drives supported

NOT EMULATED
============

What is *not* emulated:

NICK:

- any changes made mid-line are not emulated
- VRES operation in some modes
- some Interlace modes
- some screens do not display correct

DAVE:

- noise
- polynomials
- ring modulation
- filters
- z80 wait states
- onboard ram choice
- input clock
- tape sound, rem1, rem2
- printer
- serial

WD1772/EXDOS
- Format, write commands
- Turbo Exdos features

LINKS

Enterprise Depository
	http://www.mumm.ac.be/~cammejpm/enterprise.html

Z80 Lives
	http://

CONTACT

If you have any problems, find any bugs, or there is a program/game/utility that doesn't run
as it would on a real EP, please e-mail me with details. If the program is not
available from the Enterprise Depository, please e-mail this to me so I can use it
to help me fix the problems:

amstrad@aiind.upv.es

ACKNOWLEDGEMENTS

Many thanks to the following people who have helped during development (in no particular
order):

	James Boulton
	Zoltan Nemeth
	Endre Barath
	Jean-Pierre Malisse

	.. and many more that I have forgotten at this time.

	Thankyou to all!