Hello again and this time a special treat for all ZX81 dinosaurs: It's ZEX time for the ZX81, turning your ATARI joystick or IBM PC into a virtual ZX81 keyboard. The joystick can emulate any key or combination of keys on the old ZX81 membrane or ZEX will translate parallel ASCII to ZX81 characters for you. ZEX includes a 2K RAM chip for storing the joystick key codes or ASCII lookup table and unlike most interfaces this one requires NO special software drivers or changes to existing ZX software. A short program is required for the ZX to upload the translation codes to the ZEX RAM before you can use it. The complete schematic for this circuit is too complex to draw with ASCII symbols but will soon be available in GIF format together with the programming software from Steve's or Kevin's web sites. I have included a functional block diagram to help explain the inner workings of ZEX. Next time I will describe a 2 chip EPROM "brute force" version of ZEX called TYRANNOSAURUS ZEX. Until then, my fellow ZX81 dinosaurs, I hope you will enjoy ZEX as much as I do! wilf ZEX - ZX81 EXPANSION INPUT PORT FOR PC OR ATARI JOYSTICK The ZEX input port uses a novel method of translating the digital inputs (ie your joystick positions) into any combination of ZX81 keys. You simply stick your joystick to the ZEX port and plug the ZEX port into the ZX81 rear edge connector. Next load the programming software, KEMASUTRA, and select which ZX keys correspond to what position. The positions are defined as any combination of directions North, East, South, West and Fire. The program promps the user through the programming steps and the screen graphically shows the ZX81 keys which have been programmed to represent the joystick position. For example: Enter the letter N to represent the North (UP) direction and the corresponding keyboard pops up on the screen with inverse characters (ie. SHIFT and 7) indicating the keys that are simulated when the joystick is pushed to the UP position. You can erase the key combination and program a new combination by pressing keys one at the time and the display indicates the current combination by inverting the key character. Combinations like NW or NEF can also be given unique key codes. In total a joystick can output 16 different key combinations. Programming combinations like NS are not very useful since the joystick can not be simultaneously pushed North and South but if instead of a joystick you use 8 seperate switches or a connection to the printer port of a PC, you can program up to 256 different key combinations. Aother short setup program, KEMOSABI, is run on the ZX81 to program the ASCII to ZX lookup table into the ZEX RAM. ZEX operation can be explained by looking at the block diagram below. The hardware on the left shows the normal ZX81 keyboard interface with the A8-15 address lines scanning the keyboard rows one at a time and the column data read through the ULA input port at I/O address FE. ZEX is connected to the rear edge connector but operates in parallel with the existing keyboard. ZEX is scanned at the same I/O address as the keyboard, so the decoder enables the RAM at address FE. The data in the RAM is scanned by the CPU A8-15 address lines which are encoded to 3 RAM address bits with the 74LS148 encoder. These 3 bits are combined with the 5 joystick switch contacts to form the RAM address. The 74LS157 chips are used to select the joystick and encoded address lines at I/O address FE. I/O addresss DE is also decoded and causes the 74LS157 chips to connect the CPU A8-15 address directly to the RAM address lines in order to program and read the RAM contents. ZEX RAM address line A8-10 are available for selecting different stored key combinations for each game or can be used with PC printer port D5-7 data lines to enter keyboard data from the PC to the ZX81. Transistor Q1 enables ZEX RAM OE when any joystick contact is closed and also turns on a indication LED to confirm proper operation of the joystick. This is important when debugging ZEX since bad contacts are often a source of problems. When connected to the PC, the base of the transistor is connected to the STROBE line and a capacitor on the collector is used to stretch the strobe pulse. The ZX81 keyboard can also be read independently from ZEX at address BE. After programming the ZEX RAM, it is write protected with switch S1 and a simple battery backup circuit makes the whole thing nonvolatile. ZX81 EDGE CONNECTOR ZX81/TS1000 . ZEX . _____________________________________________ | | ADDRESS A8-A15 | | | /8 . /8 /8 | _______|_______ . | _______|______ | | | . | | 74LS148 | | | ZX81 keyboard | . | | data encoder | | |_______________| . | |______________| | | . | | | /5 . | /3 connect only one | | . | |___ ____/5_________________ | _______|_______ . _|_________\/_ _____|_____ ____|___ | | | . | B 74LS157 A | | D0-4 | | ATARI | | | SINCLAIR ULA | . ____|S selector | | PC LPT1 | |Joystick| | |_______________| . | |______________| |_D5-7__STB_| |________| | | . | | | |_________| /8 /5 . | /8 ___/3________| +5V | | | DATA BUS . | __|____|______ | | | | . | | A0-7 A8-10 | [LED] | | | ______________|____|D0-4 OE|_______________| | | | | _____|____|WR 2K RAM CE|_____ _|_ | | | | | | . | |______________| | -+- C1 | | | | /5 | . |________ DE __ | | | | | | | \ . |----| \ | 0V | | | | | S1 | . | FE| OR >------+ Q1 \|___| | _______|/_____ | . | +-|___/ /| |_|A8-15 D0-4 WR|___| . __|__|_________ | | A0,6,7|_______________|A-C 74LS138 | | | Z80 CPU IORQ|_______________|E decoder | 0V |______________| . |_______________| .