TI-8X emulator v0.2        |
by Randy Gluvna            |
randman@home.com           |
http://ti8xemu.home.ml.org |
---------------------------/

\\\\\\\\\\\
Description  
\\\\\\\\\\\

This program will emulate the TI-8X series of calculators, which include the
TI-82, TI-83, TI-85, and TI-86.  This program requires a ROM dump of all the
calculators you want to emulate.  ROM dumps have the filename TIXX.ROM, where
XX represents the calculator.  To make ROM dumps, use the ROM dumper software
which I have included.

\\\\\\\\\\\\
Saved Images
\\\\\\\\\\\\

The TI-8X emulator uses saved image files to save the current state of the
calculator.  You can specify a saved image file as a paramater.  Saved image
files have the extension: .XX where XX represents the calculator you are
emulating.  Alternatively, you can use a default saved image, by just typing
in the name of the calculator you want to emulate.  Default saved images are
saved as DEFAULT.XX on your disk.  Saved images made with one ROM version are
not compatible with those made with another.

eg. to use the TI-83 emulator using the default image

D:\TI8XEMU> ti8xemu 83

eg. to use the TI-86 emulator with a saved image called MYCALC.86

D:\TI8XEMU> ti8xemu MYCALC.86

\\\\\\\
Linking
\\\\\\\

You can connect your computer running the emulator to a TI-8X calculator with
a graphlink, parallel, or serial cable.  This will enable you to send/receive
programs and data from the emulator.  To enable this feature, use the /link
option from the command-line.

The syntax of this command is:  /link <Gx,Px,Sx,K>
G = graphlink
P = parallel
S = serial
K = speaker (default)

The communications port is represented by 'x'

Note: When sending files from the emulator to your calc using a graphlink
cable, you might have to set the /speed option at a large value to prevent
a link transmission error from occuring.

\\\\\\\\
Debugger
\\\\\\\\

Press END to activate the debugger.  There are several commands you can use
in the debugger.  Here is a listing of them:

	? = help
	C = Clear screen
	D = Display registers
	E = Edit registers
	I = In
	O = Out
	Q = Quit to emulator
	R = Read memory
	S = Save image, then quit
	W = Write memory
	X = eXit debugger without saving

\\\\\\\\\\\\\\
File structure
\\\\\\\\\\\\\\

Here is the C code I used for saving RAM images:

	xInt = RAMSIZE;

	RAM[++xInt] = R.AF.B.h;
	RAM[++xInt] = R.AF.B.l;
	RAM[++xInt] = R.BC.B.h;
	RAM[++xInt] = R.BC.B.l;
	RAM[++xInt] = R.DE.B.h;
	RAM[++xInt] = R.DE.B.l;
	RAM[++xInt] = R.HL.B.h;
	RAM[++xInt] = R.HL.B.l;
	RAM[++xInt] = R.IX.B.h;
	RAM[++xInt] = R.IX.B.l;
	RAM[++xInt] = R.IY.B.h;
	RAM[++xInt] = R.IY.B.l;
	RAM[++xInt] = R.PC.B.h;
	RAM[++xInt] = R.PC.B.l;
	RAM[++xInt] = R.SP.B.h;
	RAM[++xInt] = R.SP.B.l;
	RAM[++xInt] = R.AF2.B.h;
	RAM[++xInt] = R.AF2.B.l;
	RAM[++xInt] = R.BC2.B.h;
	RAM[++xInt] = R.BC2.B.l;
	RAM[++xInt] = R.DE2.B.h;
	RAM[++xInt] = R.DE2.B.l;
	RAM[++xInt] = R.HL2.B.h;
	RAM[++xInt] = R.HL2.B.l;
	RAM[++xInt] = R.IFF1;
	RAM[++xInt] = R.IFF2;
	RAM[++xInt] = R.HALT;
	RAM[++xInt] = R.IM;
	RAM[++xInt] = R.I;
	RAM[++xInt] = R.R;
	RAM[++xInt] = R.R2;

	RAM[++xInt] = KeypadMask;
	RAM[++xInt] = ONmask;
	RAM[++xInt] = LinkReg;
	RAM[++xInt] = LCDmask;
	RAM[++xInt] = LCDon;
	RAM[++xInt] = Contrast;

	if(CALC == 83)
		RAM[++xInt] = Z80_In(0);

	if((CALC == 82) || (CALC == 83))
	{
		RAM[++xInt] = Z80_In(2);             
		RAM[++xInt] = VidX;
		RAM[++xInt] = VidY;
		RAM[++xInt] = VidDir;
		RAM[++xInt] = VidMode;
		RAM[++xInt] = VidScroll;
		memcpy(RAM + (++xInt),VidRAM,768);
	}
	if((CALC == 85) || (CALC == 86))
		RAM[++xInt] = Z80_In(5);
	if(CALC == 86)     
		RAM[++xInt] = Z80_In(6);

	if((CALC == 85) || (CALC == 86))
	{
		RAM[++xInt] = VidOffset;
		RAM[++xInt] = PowerReg;
	}

\\\\\\\\\\\\\\\\\\\\
Command-line options
\\\\\\\\\\\\\\\\\\\\

There are several command-line options you can use to modify emulator options, 
these include:

/bmp <filename>         : use alternate BMP filename for snapshots
/grey                   : enable greyscale graphics
/int <x>                : adjust interrupt timing
/link <Gx,Px,Sx,K>      : enable linking (x = port)
/rom <filename>         : use alternate ROM dump
/speed <speed>          : adjust speed of emulator (0 = fastest)
				 
\\\\\\\\\
Key table
\\\\\\\\\

/// TI-82 and TI-83 key table \\\

Calc key                PC key
--------                ------
ON                      \
2nd                     Shift
ALPHA                   Ctrl
MODE                    Esc
x-VAR                   '
DEL                     Pad Insert or Pad Delete
Y=                      F1
WINDOW                  F2
ZOOM                    F3
TRACE                   F4
GRAPH                   F5
STAT                    F6
MATH                    F7
MATRX                   F8
PRGM                    F9
VARS                    F10
CLEAR                   Backspace
Cursor keys             Pad Cursor keys
A - Z                   A - Z
0 - 9                   0 - 9
+                       keypad +
-                       keypad -
*                       keypad *
/                       keypad /
^                       `
(-)                     -
STO>                    =
(                       [
)                       ]
,                       ,
.                       .

/// TI-85 and TI-86 key table \\\

Calc key                PC key
--------                ------
ON                      \
2nd                     Shift
ALPHA                   Ctrl
EXIT                    Esc
MORE                    Tab
x-VAR                   '
DEL                     Pad Insert or Pad Delete
GRAPH                   F7
TABLE                   F8
PRGM                    F9
CUSTOM                  F10
CLEAR                   Backspace
Cursor keys             Pad Cursor keys
F1 - F5                 F1 - F5
A - Z                   A - Z
0 - 9                   0 - 9
+                       keypad +
-                       keypad -
*                       keypad *
/                       keypad /
^                       `
(-)                     -
STO>                    =
(                       [
)                       ]
,                       ,
.                       .

\\\\\\\\\\\\
Special keys
\\\\\\\\\\\\

F11                     Quit emulator and save state
F12                     Quit emulator without saving state
PAGE UP                 Save state
PAGE DOWN               Load state
HOME                    Produce a BMP snapshot of the display
END                     Load the debugger

\\\\\\\
History
\\\\\\\

	v0.1b1 (2/03/98) - First release of TI-8X emulator
		 
	v0.1   (2/19/98) - Fixed NT4 compatibility problems
			   Added greyscale support
			   Added parallel/serial link support
			   Added speed control
			   Added BMP snapshot maker
			   Added command-line help
			   
        v0.2   (6/20/98) - Fixed file I/O bug
			   Added border around screen
			   Added graphlink support
			   Added debugger tool
                           Source code released

\\\\
Bugs
\\\\

If you find any bugs in the TI-8X emulator, please e-mail me at
randman@home.com

-------------------------
     TI-8X  emulator
  (c) 1998 Randy Gluvna
-------------------------
