User Tools

Site Tools


oric:hardware:dktronics_drivers

Notes about the DK'tronics Interface

The DK'tronics Joystick interface plugs into the Expansion port and maps itself to two locations in Page 3.

Page 3 AddressJoystick
$0310Port 1 (Left)
$0320Port 2 (Right)

This unfortunately prohibits the interface to be used with the Microdisc Disk Interface since this maps to the same address space.

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

Generic Joystick Driver for the DK'tronics Interface

The following code provides a standard output for detection of joystick movements in your own code.

   GenericReadDKTronics
     LDX dkt_LeftJoy
     JSR ReformatJoystickBits
     STA joy_Left
     LDX dkt_RightJoy
     JSR ReformatJoystickBits
     STA joy_Right
     RTS
   temp01  .byt 0
   ReformatJoystickBits
     ;Reformat Fire
     TXA
     AND #4
     ASL
     ASL
     ASL
     STA temp01
     ;Reformat Left/Right
     TXA
     AND #24
     LSR
     LSR
     LSR
     ORA temp01
     STA temp01
     ;Reformat Up
     TXA
     AND #1
     ASL
     ASL
     ASL
     ASL
     ORA temp01
     STA temp01
     ;Reformat Down
     TXA
     AND #2
     ASL
     ASL
     ORA temp01
     RTS              

This provides the following bits to joystick movements.

BitValueJoystick Movement
01Left
12Right
24
38Down
416Up
532Fire

Outstanding issues

1) It is unknown if the DK'tronics interface Joystick ports supported autofire.

oric/hardware/dktronics_drivers.txt · Last modified: 2008/03/28 11:57 by twilighte