Author: Marc Rousseau

TI-99/Sim

a Texas Instruments Home Computer Emulator

NOTE: This page designed to use CSS styles - you may want to upgrade your browser.

Introduction

Installation

Overview

General Features

Graphics Support

Sound Support

Joystick Support

Disk Support

Included Programs

convert-ctg

decode

disk

dumpcpu

dumpgrom

ti99sim-console

ti99sim-sdl

# Introduction

This is the latest incarnation of an emulator for the TI-99/4A that I've been working on for a few years. At first it was a simple text-based simulation of the TI. Then I added graphical support for the OS/2 Presentation Manager. Later, I ported it to Windows and added sound support. Now I'm porting it to Linux and hope to add a few more features along the way.

DISCLAIMER: I'm not one for writing a lot of documentation, so you're encouraged to look at the code to see how some things work if they're not described here. If you're interested in writing documentation, let me know.

NOTE: In order to run the emulator, you need to create a cartridge that contains the console ROM & GROMs from the TI-99/4A. Texas Instruments will not allow these to be distributed, so you'll need to find a way to get them yourself. If you have a working copy of v9t9, instructions are included to help you create the required cartridge. If you don't, I would suggest you download it as it contains documentation on how to get the files you need to do this.

# Installation

In order to run the emulator, you will need to download and install the Simple DirectMedia Layer library available at http://www.libsdl.org/download-1.0.html. I've been developing with versions 1.0.8 and 1.1.3 and don't know how other versions will work.

After installing SDL, type 'make' in the directory where you placed the emulator. If the SDL include files are not located at /usr/include/SDL you will need to edit src/sdl/Makefile to point to the correct path. After compiling the emulator, become root and type 'make install'. If downloaded the binary only package, you can skip the initial 'make'.

            make
            su
            make install
            exit

If you want to use the original x86 assembly coded engine (which does not track the emulated speed as accurately as the C engine but is about 12Kbytes smaller and slightly faster), type 'make USE_ASM=1'. Typing 'make install' will install the binaries under /usr/local/games/ti99sim and create directories under /usr/local/share/games/ti99sim. These directories are used to hold all the roms and cartridge files. When loading files, ti99sim will look in the directories under ~/.ti99sim first, then /usr/local/share/games/ti99sim.

Once make is complete you will need to create the console ROM cartridge TI-994A.ctg (see the section on 'convert-ctg' below for instructions) in order to run the emulator. This ROM cartridge contains the operating system and the BASIC interpreter for the computer. Without it, the emulator will not do anything useful. Once you have created the console ROM cartridge, copy it to either ~/.ti99sim/roms or /usr/local/share/games/ti99sim/roms. You may also want to create a symbolic link to ti99sim to make running it easier. On a Red Hat system, you can easily do this by creating a personal bin directory and placing the link there i.e.:

            mkdir ~/bin
            ln -s /usr/local/games/ti99sim/ti99sim-sdl ~/bin/ti99sim
            ln -s /usr/local/games/ti99sim/convert-ctg ~/bin/convert-ctg

Now you're all set to run the emulator, just type:

            ti99sim

If everything is installed correctly, you should see a window on your screen with the TI-99/4A startup screen followed by a beep. Enjoy!

# Overview

The following section describes the basic features of the emulator. Entries in italics are items on my to-do list for a future release.

## General Features:

- Emulation of the TI-99/4A Home Computer.
- Runs under Linux or Win32 (Windows 9X, Windows NT)
- Speed is kept as close as possible to the actual speed of the TI.
- Support banked cartridges (like TI Extended BASIC).
- 32K RAM Expansion.
- Save/Restore the complete computer state.
- Save battery-backed RAM to disk when cartridge is removed.
- Add a GUI and port menus/hot-keys/features from Windows version.

## Graphics Support:

- All modes except multi-color.
- Scaled window.
- Full screen mode.
- Multi-color support.
- Hardware sprite co-incidence.

## Sound Support:

- Three voice support using native sound device.
- Noise generation supported.

## Joystick Support:

- Press NUM-LOCK and use arrow keys.
- Add real joystick support

## Disk Support:

- Requires a TI disk controller ROM dump.
- Supports disk images created by AnaDisk.
- Modify 'convert-ctg' to allow CRU base for DSR ROMs to be specified.
- Modify the disk routines to support the PC99 file format.

# Included Programs

## convert-ctg

The ti99sim emulator uses special .ctg files to store the ROM and/or GROM images contained within the computer console and the plug in cartridges. The 'convert-ctg' program allows you to create these cartridges. It will convert your existing v9t9 ROMs or create cartridges using output from a hex dump of a ROM image. A set of sample files, TI-994A.dat, Mini-Memory.dat, and Gram Kracker.dat, located in the roms directory, are supplied as examples of the format of the hex dump file. NOTE: These files do not contain complete hex dumps of their corresponding ROMs but can be used as templates if you have the required information.

To convert existing v9t9 cartridges, type 'convert-ctg foo.bin' where foo is the base name of a set of ROM files. The base name is usually the portion of the filenames that are common between all files associated with a particular cartridge. 'convert-ctg' understands the naming conventions used by present and past versions of v9t9, and will attempt to determine which version of files that you have installed. For example, the following command will convert the files PARSECC.BIN and PARSECG.BIN to PARSEC.ctg:

              convert-ctg /your-path-here/v9t9/v6.0/modules/PARSEC.BIN

Files to be converted can be in any directory. The new cartridge will be created in the current working directory. To create the console ROM cartridge you need to specify either 994a.bin or ti.hex (depending on your version of v9t9 or TI Emulator) as the filename. For example:

              convert-ctg /your-path-here/v9t9/v6.0/roms/994a.bin

This will create the special TI-994A.ctg file that contains the console ROM, the system GROMs, scratch-pad RAM, and 32K memory expansion RAM. Without this file, ti99sim will not run!

When creating cartridges, 'convert-ctg' will attempt to add a cartridge title by searching for valid GROM headers in the files being converted. If it doesn't find any valid names, or if you want to change the one it uses, you can specify a title on the command line after the base filename. ti99sim uses the cartridge title when saving/loading memory images to ensure that the correct cartridges are present when loading. If you intend to use this feature, please make sure that all of you catridges have unique names.

'convert-ctg' will also allow you to dump the contents of a cartridge to a specially formatted hex dump file. This feature is useful if you want to see the contents of a cartridge's ROM/GROM code, or to patch the code and rebuild the cartridge with your changes.

## decode

If you have old audio tapes hanging around, 'decode' will decode them into binary files that can be used (in some future version) by ti99sim. This code is currently in the experimental stage, and currently only decodes .wav files directly to binary files on disk. It attempts to intelligently find sections of stored data while ignoring all other sounds it finds.

## disk

NOTE: Disk emulation is not yet in the Linux version. Actually, it is included, but there is no way to specify the disk images for DSKn.

The emulator allows you to use disks created by a TI-99/4A computer within the emulator. You need to create a disk image using the dump feature of AnaDisk and include the 8 byte header for each sector.

The 'disk' utility allows you to look at the contents of a disk image and optionally create native files from those in the disk image. This allows you to create files that can be used by 'convert-ctg' to create cartridge files that you can use with the emulator.

## dumpcpu

This program will allow you to un-assemble any CPU ROM section in a cartridge file. Through the use of an external configuration file, you can assign labels and EQUs to make the disassembly more readable.

NOTE: This program is a work in progress and doesn't always create good listings.

## dumpgrom

Ever wondered what the code behind that game looks like? This program is similar to 'dumpcpu' but disassembles that GPL code in the GROM cartridge. It uses the standard GROM headers to find starting addresses and strings.

NOTE: See 'dumpcpu' for pertinent NOTES.

## ti99sim-console

A simple text-based version of the emulator. It includes a simple interface that allows you to step through code at the assembly or GPL instruction level. It doesn't simulate VDP interrupts and doesn't support graphics at all. If you just want to see what the computer is doing, this is the program to do it with.

## ti99sim-sdl

The X11 based emulator. It will accept the following command-line syntax:

              ti99sim [-4] [-q] [cartrigde.ctg] [memory.img]

If you try to load a memory image, you must make sure that any cartridge(s) that were running when the image was made are currently running or the image will not load. So, if you want to load both a cartridge and an image, make sure you specify the cartridge before the image on the command line.

There is no GUI, and there aren't very many features implemented yet. The following keys are defined:

- ESC - exit
- F2 - Save memory image
- F3 - Load memory image
- F10 - Reboot

If you have created the Gram Kracker cartridge properly and placed the cartridge in the roms directory (the one where you placed the TI-994A.ctg file), the following extra keys are active:

- <Ctrl>-F1 - Toggle Gram Kracker On/Off
- <Ctrl>-F2 - Toggle GROM 0/Operating System
- <Ctrl>-F3 - Toggle GROMs 1&2/TI-BASIC
- <Ctrl>-F4 - Disable write-protect/Select BANK 1
- <Ctrl>-F5 - Enable write-protect
- <Ctrl>-F6 - Disable write-protect/Select BANK 2
- <Ctrl>-F7 - Toggle loader On/Off

Consult your Gram Kracker manual for a description of each of these switches. To create a Gram Kracker cartridge, the loader ROM must be added to the 'Gram Kracker.dat' file supplied in the roms directory. Getting the loader ROM is left as an exercise for the reader (hints: Save it to disk, transfer it to the PC using AnaDisk, extract it using the 'disk' utility, and a) make a hexdump after stripping off the header or b) create a normal cartridge file using the 'convert-ctg' utility then create a .dat file using the -d option. OR Find a program on the TI that can do a hex dump to the serial port and capture it on the PC to a disk file).

Homepage: http://www.mrousseau.org/programs/ti99sim/
Contact: ti99sim@mrousseau.org