User Tools

Site Tools


oric:hardware:altai_drivers

Notes about the Altai Joystick Interface

The ALTAI interface connects to the Printer port which is also used when transferring data to the sound chip. Sound corruption is therefore in most cases unavoidable.

Note all drivers use a common label list that is found here generic_joystick_drivers

Hardware Notes

The Altai (Commonly mistaken for a PASE interface) was the most common joystick interface and supported in many games. However it affected sound badly as it acted directly on the Parralel port.

The Altai interface connected to the Centronics Parralel port.

B7 Select Left Joystick(Though neither sockets were distinguishable)
B6 Select Right Joystick
B5 Fire(Inverted)
B4 Up(Inverted)
B3 Down(Inverted)
B2 -
B1 Right(Inverted)
B0 Left(Inverted)

DDRA must be set to 11000000 whilst reading Joystick. Please note that setting both top bits does not permit both joystick ports to be read at the same time. I have now tested this and it doesn't work :(

Original Driver

The First Driver is the code taken directly out of the leaflet that came with the ALTAI interface, disassembled, corrected and optimised.

       LDA #%11000000
       STA via_ddra
       lda #%10000000
       STA via_porta
       LDA via_porta
       STA joy_Left
       LDA #%01000000
       STA via_porta
       LDA via_porta
       STA joy_Right
       LDA #%11111111
       STA via_ddra
       RTS

Each joystick movements will produce the following codes.

Left Joystick MovementValue(Decimal)Value(Binary)
19110111111
Up17510101111
Up Right17310101101
Right18910111101
Right Down18110110101
Down18310110111
Down Left18210110110
Left19010111110
Up Left17410101110
Fire15910011111
Right Joystick MovementValue(Decimal)Value(Binary)
12701111111
Up11101101111
Up Right10901101101
Right12501111101
Right Down11701110101
Down11901110111
Down Left11801110110
Left12601111110
Up Left11001101110
Fire9501011111

As the Bit pattern suggests when a joystick is moved, its corresponding bit is reset. Also Bit7 selects the Left joystick and Bit6 selects the right joystick.

Generic Joystick Driver for the ALTAI Interface

The following code provides a standard output for detection of joystick movements in your own code. Whilst the corresponding bits remain the same they are inverted to conform to the Generic Format.

     GenericReadAltai
       LDA #%11000000
       STA via_ddra
       lda #%10000000
       STA via_porta
       LDA via_porta
       AND #%00111111
       EOR #%00111111
       STA joy_Left
       LDA #%01000000
       STA via_porta
       LDA via_porta
       AND #%00111111
       EOR #%00111111
       STA joy_Right
       LDA #%11111111
       STA via_ddra
       RTS

This provides the following bits to joystick movements.

BitValueJoystick Movement
01Left
12Right
24
38Down
416Up
532Fire
oric/hardware/altai_drivers.txt · Last modified: 2010/07/01 22:43 by twilighte