I'm looking for the best Kempston Joystick interface schematic.
It has to be as cheap as possible.
But it must be as compatible as possible.
I've come up with this:
Any other ideas?
D5 is log.1 ?
Correct kempston joy port return only state of joystisk (left,right,up,down and fire1...firexx, all other bits is better set to log.0).
Some ZX games work incorrect if joystick port return D7,D6 or D5 in log.1 state. D5 on port 31 work in some games as next button (pause, bomb, etc...).
Pull-up resistors is ideal use 4K7 for possibility connect also real amiga mouse to this port. And for full amiga mouse support is good connect all three fire buttons:
KEMPSTON JOYSTICK / AMIGA MOUSE : port 31(#1F)
==========================================
D0- joy RIGHT / XB
D1- joy LEFT / YB
D2- joy DOWN / XA
D3- joy UP / YA
D4- joy FIRE 1 / left button
D5- joy FIRE 2 / right button
D6- joy FIRE 3 / middle button
D7- always 0
(all signals on port #1F is active in log.1)
1- UP
2- DOWN
3- LEFT
4- RIGHT
5- FIRE 3
6- FIRE 1
7- +5V
8- GND
9- FIRE 2
Port adressation via A7=0,A6=0,A5=0 can collide with AY or +3 FDD ports or with keyboad port (external keyboard interface or internal keyboard in +2A/+3 models).
This basic program can active AY + keyb + joy and data of all ports will mixed = data collision
1 PRINT IN 49152:RUN
If you need low price design, then use your schematic, only connect data from your interface to ZX bus via resistors (can be used resistor net, type B) 120 Ohm (data bus protector). And M1 line is often dead on old ZX Spectrum models, then you can disconnect M1 and detect only IORQ,RD and adress lines. Or place switch on board (accept M1 / ignore M1).
What if you fully decode A7-0 ? How does that affect compatibility?
I've just built an interface that expects A7-0 to be 00011111. Before I finish it, will it be okay?
Yes. Ideal kempston joystick use full adressation (as kempston in K-MOUSE interface). Full adressation = no collision with other interfaces.
Kempston joystick with uncomplette adressation can be used, but is better use resistors on data bus (elimination of data collision with other devices). Some computers use internal kempston joystick...
Some games read kempston joystick from different port than #1F, but all this games exist in fixed version.
Some games need data D7-D5 on port #1F always in log.0 = can't be used kempston interfaces with unused lines D7-D5 (then D7-D5=part of floating data bus, D4-D0=joystick data)
Also exist small part of games, that not work if D7-D5 is in log.0 , but this is very small part...
Also is possible use original adressation (only accept A5=0 , IORQ=0 , RD=0 and connect D0-D7)
Comments
D5 is log.1 ?
Correct kempston joy port return only state of joystisk (left,right,up,down and fire1...firexx, all other bits is better set to log.0).
Some ZX games work incorrect if joystick port return D7,D6 or D5 in log.1 state. D5 on port 31 work in some games as next button (pause, bomb, etc...).
Pull-up resistors is ideal use 4K7 for possibility connect also real amiga mouse to this port. And for full amiga mouse support is good connect all three fire buttons:
KEMPSTON JOYSTICK / AMIGA MOUSE : port 31(#1F)
==========================================
D0- joy RIGHT / XB
D1- joy LEFT / YB
D2- joy DOWN / XA
D3- joy UP / YA
D4- joy FIRE 1 / left button
D5- joy FIRE 2 / right button
D6- joy FIRE 3 / middle button
D7- always 0
(all signals on port #1F is active in log.1)
1- UP
2- DOWN
3- LEFT
4- RIGHT
5- FIRE 3
6- FIRE 1
7- +5V
8- GND
9- FIRE 2
Port adressation via A7=0,A6=0,A5=0 can collide with AY or +3 FDD ports or with keyboad port (external keyboard interface or internal keyboard in +2A/+3 models).
This basic program can active AY + keyb + joy and data of all ports will mixed = data collision
1 PRINT IN 49152:RUN
If you need low price design, then use your schematic, only connect data from your interface to ZX bus via resistors (can be used resistor net, type B) 120 Ohm (data bus protector). And M1 line is often dead on old ZX Spectrum models, then you can disconnect M1 and detect only IORQ,RD and adress lines. Or place switch on board (accept M1 / ignore M1).
I've just built an interface that expects A7-0 to be 00011111. Before I finish it, will it be okay?
Yes. Ideal kempston joystick use full adressation (as kempston in K-MOUSE interface). Full adressation = no collision with other interfaces.
Kempston joystick with uncomplette adressation can be used, but is better use resistors on data bus (elimination of data collision with other devices). Some computers use internal kempston joystick...
Some games read kempston joystick from different port than #1F, but all this games exist in fixed version.
Some games need data D7-D5 on port #1F always in log.0 = can't be used kempston interfaces with unused lines D7-D5 (then D7-D5=part of floating data bus, D4-D0=joystick data)
Also exist small part of games, that not work if D7-D5 is in log.0 , but this is very small part...
Also is possible use original adressation (only accept A5=0 , IORQ=0 , RD=0 and connect D0-D7)