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
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 :(
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 Movement||Value(Decimal)||Value(Binary)|
|Right Joystick Movement||Value(Decimal)||Value(Binary)|
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.
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.