timex-computer.jpg (19841 bytes)

Timex I/O Ports

Timex Sinclair 2068 has additional I/O ports. It seems that low byte of these I/O addresses are fully decodes. I have no informations whether other ports (like ULA port) is decoded fully, or partial like ordinary Spectrum.

PORT 255 (TIMEX CONTROL REGISTER):

Output:
bit D0: When D0=0, main video data (data about pixels on the screen) is located in block at address 16384 (like on ordinary Spectrum), else it is located in block at address 24576

bit D1: When D1=0, color attributes are 8x8 pixels in size, they occupies 768 bytes, and they are located just after main video memory (address 22528 like on ordinary Spectrum if D0=0, or 30720 when D0=1); when D1=1, color attributes are 8x1 pixels in size, occupies 6144 bytes, and they are located at address 24576 (more precise, when D1=0, every 8x1 attribute is multiplicated eight times to make one 8x8 attribute)

bit D2: When D2=0, main video data and attributes are used as described above; D2=1 activates extended resolution of 512x192 pixels (64x24 text), where main video data (from address determined by D0) will be inserted in even columns (0, 2, 4...), and in odd columns (1, 3, 5...) will be inserted values which normally would be color attributes data, determined by D1 (this usually has sense only with D1=1, when odd columns will be inserted from block at address 24576); color attributes does not exist when D2=1 (then only two colors exist: unique ink color and unique paper color)

bits D3-D5: Selection of ink and paper color in extended screen resolution mode (000=black/white, 001=blue/yellow, 010=red/cyan, 011=magenta/green, 100=green/magenta, 101=cyan/red, 110=yellow/blue, 111=white/black); these bits are ignored when D2=0

bit D6: D6=1 forbid generation of the timer interrupt

bit D7: Selection of alternate memory bank which will be activated using horizontal MMU register (0 = DOCK, 1 = EXROM)

From the description above, one can conclude that only four combinations of bits D0-D2 may be useful:

000 - Video data at address 16384 and 8x8 color attributes at address 22528 (like on ordinary Spectrum);

001 - Video data at address 24576 and 8x8 color attributes at address 30720;

010 - Multicolor mode: video data at address 16384 and 8x1 color attributes at address 24576;

110 - Extended resolution: without color attributes, even columns of video data are taken from address 16384, and odd columns of video data are taken from address 24576

Combinations 011, 100, 101 and 111 are possible, but they will not give usable results.

Input: Returns last value sent to this port.

PORT 244 (HORIZONTAL MMU REGISTER):

Output: Every bit in this register is linked with one 8-Kbyte chunk of 64-Kbyte Z80 address space (bit D0 corresponds to addresses 0-8191, D1 to addresses 8192-16383 and so on). When a bit is reset, linked chunk belongs to HOME bank, and when a bit is set, linked chunk belongs to one of alternative banks (DOCK or EXROM, depending of bit D7 in port 255). Notice that DOCK and EXROM chunks never can be simultaneously present in the address space.

Input: Returns last value sent to this port.

PORT 245 (SOUND CHIP REGISTER SELECTION):

Output: Selects active sound chip register, like port 65533 on Spectrum 128.

Input: Always 255.

PORT 246 (SOUND CHIP REGISTERS):

Output: Writes sent value to active sound chip register, like port 49149 on Spectrum 128.

Input: Reads a value from active sound chip register.

Everything is here similar like on Spectrum 128, except usage of register R14 is different, mainly for joystick reading. Then address bits A8 and A9 determines whether left or right joystick will be read (01=left, 10=right, 11=both reading are OR-ed). So, for left joystick reading mainly port 502 is used, and for right joystick reading port 758 is used (of course, with R14 as active register). When R14 acts as output port (bit D6=1 in register R7), bits in register R14 have following meaning:

Output:
bits D0-D4: 'masks' for bits D0-D4 reading (see text below); also these bits may be used in various independent peripherals

bit D5: D5=0 enables access to 16 MB bus expansion unit which seems to never have been released

bits D6-D7: usable in various independent peripherals

Input:

bit D0: joystick moving to up (0=active)

bit D1: joystick moving to down

bit D2: joystick moving to left

bit D3: joystick moving to right

bit D4: status of joystick fire button (0=active)

bits D5-D7: last values sent to these bits

The bits D0-D4 when reading return valid values only if they are not masked, i.e. if corresponding mask bits is one, else they will return zeroes. When register R14 acts as input port (bit D6=0 in register R7, this is the only reliable way for joystick reading), bits in register R14 have following meaning:

Output: Ignored!

Input:
bit D0: joystick moving to up (0=active)

bit D1: joystick moving to down

bit D2: joystick moving to left

bit D3: joystick moving to right

bit D4: status of joystick fire button (0=active)

bits D5-D7: always one

In this case, bits D0-D4 could not be masked.

VIDEO MEMORY

Alternate reading and writing from this port generates 'strobe' signal for the printer.
On real Timex it is possible using very dirty interrupt based routines to make more than two colors in 512x192 mode. As extremely simplified example, BASIC program

10 OUT 255,6: OUT 255,14: PAUSE 1: GO TO 10

will produce blue_on_yellow stripe across black_on_white screen, in hires mode. Also, it is possible (using similar method) that one part of the screen has one video mode, other part other video mode, etc. For example, BASIC program

10 OUT 255,0: OUT 255,6: PAUSE 1: GO TO 10

will produce one hires (512x192) stripe in medres (256x192) surrounding on real Timex.
it seems that nobody produces a software which uses described effects, although such effects was very popular on Commodore 64.

In Warajevo emulator, this efects doesn't work, but in Multimachine they work ok.