Timex 2000 series
The Timex Machines
The TS2068, the TC2068 and the TC2048 each share the same basic internal design, described immediately below:
- The TC2068 is the Portuguese made European version operating at 50Hz on a 230-240v power supply and generates a PAL television signal (used throughout Europe, except in France where SECAM is used instead) with a normal expansion bus. Both machines feature an AY-3-8912 sound chip (not 128 compatible), an extended version of BASIC in 24K of ROM (semi-compatible), two non-standard joystick ports, a cartridge dock (not IF2 compatible), and a new ULA with extra video modes, but some incompatiblities. There is also a Polish clone of the TC2068, called the UK2086, which substitutes an RS232 port for one of the joystick ports.
- The TC2048 was designed and produced in Portugal. Basically, the TC2048 is a TC2068 with all the extra hardware removed, except the new ULA, but a normal BASIC ROM (only slightly modified), a BNC composite out (but no RGB signals on the bus), and a Kempston joystick port (but no +5v as needed by autofire joysticks).
- The TS2068 is an American machine operating at 60Hz on a 110v power supply and generates an NTSC television picture (just like the Spectrums sold by mail order in the US by Sinclair) but with a TS1000 (ZX81) compatible expansion bus.
There are also two modified versions of the TC2048; the TC2128 (Rebuiltion or similar) and the TC2144 (by Jarek Adamski). The TC2128 extends the TC2048 to 128K using the Spectrum 128 memory scheme. The TC2144 does the same but provides an extra 16K of memory between 0x8000 and 0xc000. Both upgrades allow the ULA to use the shadow screen in Bank 7 giving the machine a total of four screen areas.
Although the Timex machines are similar to the 48K machine there are some timing differences:
- The AY-3-8910 sound chip runs at 1.76475 Mhz.
- The American machines have a 60 Hz interrupt as opposed to 50 Hz on the European machines.
- The scanline timings are different.
The ULA used by the Timex machines provides a number of additional screen modes. These are controlled using Port 0xff. An unfortunate side effect of this is that a few games, like Arkanoid, which expect reading 0xff to produce screen and ATTR data bytes when the ULA is reading the screen memory, will not work, since reading 0xff on the Timex returns the last byte sent to the port. It is not known if this port is fully decoded but it seems likely that it is partially decoded, as on the Spectrum. Port 0xff is also used to enable/disable the timer interrupt and select which bank of memory to use for the horizontal MMU. The byte to output will be interpreted thus:
Bits 0-2: Screen mode. 000=screen 0, 001=screen 1, 010=hi-colour, 110=hi-res Bits 3-5: Sets the screen colour in hi-res mode. 000 - Black on White 100 - Green on Magenta 001 - Blue on Yellow 101 - Cyan on Red 010 - Red on Cyan 110 - Yellow on Blue 011 - Magenta on Green 111 - White on Black Bit 6: If set disables the generation of the timer interrupt. Bit 7: Selects which bank the horizontal MMU should use. 0=DOCK, 1=EX-ROM.
Screen 0 is the normal screen at 0x4000. Screen 1 uses the same format but at 0x6000.
The hi-colour screen uses the data area of screen 0 and screen 1 to create a 512x192 pixel screen. Columns are taken alternately from screen 0 and screen 1. The attribute area is not used. In this mode all colurs, including the BORDER, are BRIGHT, and the BORDER colour is the same as the PAPER colour.
The multi-colour screen uses the data area of screen 0 for its data and the data area of screen 1 for its attributes, giving 2 colours per 8x1 pixel block. The attribute area is in the same byte order as the data area, which means MLT files, which have the attribute are in series, must be converted to be displayed.
Bit 6 is the hardware equivalent of issuing a DI (disable interrupts) instruction in machine code, and is unaffected by the instruction EI (enable interrupts), so should be used with caution. Bit 6 can be useful for getting ROM routines which normally enable interrupts to run slightly faster.
With careful timing it is possible to mix screen modes so you could have a screen where the top half is hi-colour and the bottom half is hi-res - perfect for text adventures with graphics. Using a similar technique it is also possible to have more than two colours on a hi-res screen. However, it is believed that no commercial software ever actually did this.
The Timex machines feature a horizontal memory management unit. In the TS2068 and TC2068 it is used to support the extended BASIC and cartridges plugged into the dock. It is present in the TC2048 but there is no direct way to connect anything to it (although the refresh signals are available to connect an additional 128K of RAM to the horizontal MMU).
The memory map of these computers is: EX-ROM HOME DOCK 0xffff +----------+----------+----------+ | Bank 7' | 32K RAM | Bank 7 | | | | | 0xe000 +----------+ +----------+ | Bank 6' | | Bank 6 | | | | | 0xc000 +----------+ +----------+ | Bank 5' | | Bank 5 | | | | | 0xa000 +----------+ +----------+ | Bank 4' | | Bank 4 | | | | | 0x8000 +----------+----------+----------+ | Bank 3' | Screen 1 | Bank 3 | | | | | 0x6000 +----------+----------+----------+ | Bank 2' | Screen 0 | Bank 2 | | | | | 0x4000 +----------+----------+----------+ | Bank 1' | 16K ROM | Bank 1 | | | | | 0x2000 +----------+ +----------+ | Bank 0' | | Bank 0 | | | | | 0x0000 +----------+----------+----------+
Memory is paged in 8K banks from either the DOCK or the EX-ROM, but these banks are mutually exclusive - you cannot page in a bank from both simultaneously. Bit 7 of port 0xff determines which bank to use (0=DOCK, 1=EX-ROM). Port 0xf4 determines which banks are to be paged in with each bit referring to the relevant bank (0-7 or 0'-7'). When memory is being paged, interrupts should be disabled and the stack should be in an area which is not going to change.
The HOME bank is the normal Spectrum memory area. The top 32K is uncontended but the 16K screen area below that is contended. Banks are overlaid on this bank, but paging over the screen area does not change the RAM used by the ULA. This does mean it is possible to set up a screen and page it out.
On a TC2048, BASIC is contained in the 16K ROM area and banks 0-7 and 0'-7' are not normally available, while on a TS2068 or a TC2068 part of the BASIC is stored in an 8K ROM in bank 0' and cartridges plugged into the dock use banks 0-7.
The contended memory timings for these machines are unknown but should be similar to that for the 48K machine, except that the pattern starts at a different number of T-states after the interrupt, than the usual 14344.
Reading this port returns the last byte sent to it.
The AY-3-8912 used in the TS2068 and TC2068 is controlled by two I/O ports:
OUT (0xf5) - Select a register 0-14 IN (0xf6) - Read the value of the selected register OUT (0xf6) - Write to the selected register
IN 0xf5 always returns 255.
Most Spectrum software written to use the AY chip expects to find it at the addresses used by the Spectrum 128.
Typically, the AY chip is written to inside 128K games using:
LD BC,0xfffd 01 FD FF OUT (C),D ED 51 LD B,0xbf 06 BF OUT (C),E ED 59
To convert to a TS2068 or TC2068 poke a few values as follows:
LD BC,0xfff5 01 F5 FF OUT (C),D ED 51 LD C,0xf6 0E F6 OUT (C),E ED 59
If you've got a Fuller box, you can do the same mod, replacing F5 with 3F and F6 with 5F. Joysticks
On the 128K ZX Spectrum 128, AY chip is used to control MIDI and RS232 but on the TS2068 and TC2068 it is used to read the Timex joysticks instead, using register R14.
T/S 2000 BASIC
T/S 2000 BASIC is a superset of Sinclair BASIC, with additional commands allowing access to the hardware features found on the Timex systems. Generally speaking, BASIC programs written for the ZX Spectrum will run on Timex machines without modification. The additional commands found in Timex BASIC are listed below:
- DELETE: The DELETE command is used to remove lines of a program between two supplied values, from the beginning of a program to the line specified, or from the line specified to the end of the program. Example: DELETE [n,n] (between values) or DELETE [ ,n] (to value) or DELETE [n, ] (from value)
- FREE: FREE can be used at any time within a program, or from immediate mode, to return the amount of available internal memory. Example: PRINT FREE
- ON ERR: ON ERR allows errors to be trapped and handled before the program automatically stops with an error. GOTO jumps to a specified line number, CONT continues operation from the point at which the error occurred and RESET disables ON ERR, raising the normal system error messages instead. After ON ERR GOTO, PEEK 23736 will give the error code, while PEEK 23739 and PEEK 23738 respectively give the line number and statement number within the line where the error occured. Example: ON ERR [GOTO, CONT, RESET]
- RESET: RESET is typically used to return attached peripherals to their original state. In addition, it can be used to reset the entire system. Example: RESET 0 (resets machine)
- SOUND: The SOUND command accepts pairs of numbers separated by semi-colons. Up to 15 pairs are permitted for each SOUND command. The first number in each pair designates the register, while the second number contains the value. Example: SOUND [n,n];[n,n] ..... [n,n];[n,n]. The available registers are:
- 0 - Fine Tune, Channel A. Permitted values: 0-255
- 1 - Coarse Tune, Channel A. Permitted values: 0-15
- 2 - Fine Tune, Channel B. Permitted values: 0-255
- 3 - Coarse Tune, Channel B. Permitted values: 0-15
- 4 - Fine Tune, Channel C. Permitted values: 0-255
- 5 - Coarse Tune, Channel C. Permitted values: 0-15
- 6 - Noise. Permitted values: 0-31
- 7 - Enable. Permitted values: 0-63
- 8 - Amplitude, Channel A. Permitted values: 0-15
- 9 - Amplitude, Channel B. Permitted values: 0-15
- 10 - Amplitude, Channel C. Permitted values: 0-15 (16 enables envelope)
- 11 - Fine Tune envelope period. Permitted values: 0-255
- 12 - Coarse Tune envelope period. Permitted values: 0-255
- 13 - Envelope shape. Permitted values: 0-15
- STICK: The STICK command is used to read the signal generated by devices connected to one of the two Joystick ports available. The first number represents the device type being read - (1) is the Joystick and (2) is the button. The second number is the Joystick number - (1) is left and (2) is right. Example: IF STICK([n,n]) THEN ... Valid return values are 1 (pressed) or 0 (not pressed) if reading the button, and:
- 0 - Centred
- 1 - Up
- 2 - Down
- 4 - Left
- 5 - Up and Left
- 6 - Down and Left
- 8 - Right
- 9 - Up and Right
- 10 - Down and Right