Alive
News Team Current issue History Online Support Download Forum @Pouet

01 - 02 - SE - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14

Alive 6
[ Back to Main ]

6. Advanced Joystick, Paddle and Lightpen ports
-----------------------------------------------
Registers:
  Fire-Buttons for 4 Joysticks:
    $FFFF9200  - - - -  - - - -  - - - -  X X X X

    This address features the fire buttons of 4 joysticks that
    can be connected to these ports. Bit 0 represents joystick
    0, bit 1 joystick 2, bit 2 joystick 1 and bit 3 joystick 3.
    This register is "low active", meaning that a "0" implies
    "active" (button pressed) and a "1" means "inactive"
    (button not pressed).

  Joysticks:
    $FFFF9202  X X X X  X X X X  X X X X  X X X X

    Read this address to get the directions of 4 digital
    joysticks connected. The lowest 4 bits (0-3) represent
    joystick 0, the middle low 4 bits (4-7) represent
    joystick 2, the next 4 bits (8-11) joystick 1 and
    the highest 4 bits (12-15) joystick 3.
    The lowest bit encodes "right", the next bit "left",
    the next bit means "down" and the highest bit "up".
    This whole register is low-active as well.

  Paddles:
    $FFFF9210  - - - -  - - - -  X X X X  X X X X  Paddle 0 X
    $FFFF9212  - - - -  - - - -  X X X X  X X X X  Paddle 0 Y
    $FFFF9214  - - - -  - - - -  X X X X  X X X X  Paddle 1 X
    $FFFF9216  - - - -  - - - -  X X X X  X X X X  Paddle 1 Y

    The advanced joystick ports allow analogue devices such as
    paddles. Two paddles usually connect to one port, meaning
    the connection of 4 paddles is possible. Instead of
    "paddle X/Y coordinate", you might also read this as
    "paddle 1/2 coordinate".
    The fire buttons of each paddle can be read at the same
    address as for the joysticks, $FFFF9200

  Lightpen:
    $FFFF9220  - - - -  - - X X  X X X X  X X X X  X-Position
    $FFFF9222  - - - -  - - X X  X X X X  X X X X  Y-Position

    Connection of a light-pen is only possible at port 0. It
    has a precision of 4 pixels in ST Low, 8 pixels in ST Mid
    and 16 pixels in ST High resolution (horizontally).
    Vertically, the light-pen is pixel-perfect. The values
    read in this register always refer to ST Low. For usage
    in midres, you need to multiply by 2, for usage in hires,
    you need to multiply by 4.

These interfaces allow a lot of connections. What do you need
to watch out for ?

? Can't read out these registers. Why ?
! In contrast to any joystick/mouse/keyboard function on the
  ordinary ST, these interfaces are _not_ being maintained and
  supervised by the IKBD subsystem of the ST keyboard but are
  directly accessible by hardware. You need to be in supervisor
  mode to access these registers.

? The paddles i have from my good old 800XL can't be connected
  since the plug doesn't fit. Can i connect and use them on the
  ordinary joystick port of the ST ?
! No, unfortunately, the IKBD does not have the hardware that
  is necessary to drive paddles. Paddles are very "dumb" devices
  that need quite a bit of hardware logic to work in a "digital"
  environment. You will need to built yourself an adapter.

? I want to build myself a 4-player adapter so i can connect 4
  joysticks to these ports. What pins do i need to connect ?
! The hardware layout of each of these joystick ports is
  (seen from the outside of each connector):
    _______________________________  1 - Joystick 0 "up"
    \   5   4    3    2    1      /  2 - Joystick 0 "down"
     \     10   9    8    7   6  /   3 - Joystick 0 "left"
      \ 15  14   13  12   11    /    4 - Joystick 0 "right"
       \_______________________/     5 - Paddle 0 Y coord
     6 - Joystick 0 "fire"          11 - Joystick 2 "up"
     7 - VCC                        12 - Joystick 2 "down"
     8 - NC                         13 - Joystick 2 "left"
     9 - Mass                       14 - Joystick 2 "right"
    10 - Joystick 2 "fire"          15 - Paddle 0 X coord

  The ordinary 9 pin socket for an ordinary digital joystick
  look like this:
     ___________________           1 - Up     5 - reserved
     \  1  2  3  4  5  /           2 - Down   6 - fire
      \  6  7   8  9  /            3 - Left   7 - +5V
       \_____________/             4 - Right  8 - Mass
                       (9 is officially unused, might be 2nd "fire")
  This should be sufficient to build an adapter.

? Which models have the extended joystick ports ? Is it sensible
  to use them at all ?
! Depends on what you are planning to do. Only the 1040 STE and the
  Falcon have these additional ports. Neither the Mega STE nor the
  TT have these. Games/Programs that can only use joysticks/paddles
  connected to these ports cannot be played on Mega STE/TT computers.

? How can i write a program that uses paddle controllers for the
  Mega STE and TT then ?
! You cannot. Both these computers lack the logic required to drive
  paddle controllers.

? But isn't the mouse a paddle controller, too ?
! No, surprisingly, it is not. The mouse is using an internal
  logic to convert "analogue" movement into digital impulses,
  similar to rapidly moving a joystick in a direction and letting
  it go again. The mouse is, unlike a paddle, not being read "by
  position", but like a joystick "by movement".
  For games however, you might use the mouse as a paddle.
  GEM programs can use an AES routine to read mouse position,
  otherwise you can use the IKBD to read the mouse.

? My light pen doesn't work at all.
! The light pen is only supported on connector 0. Connector 1
  cannot be used to drive a light pen.

? I want to connect jaguar powerpads, which can connect directly
  to the advanced joystick ports. How do i read those ?
! The directional pad and the 3 action buttons can be read
  relatively easily. The D-pad represents one joystick connected
  to the port, the 3 fire buttons and the Option button the
  other joystick. The Pause-Button is the firebutton of one
  joystick. Reading the numerical pad of the powerpad is more
  difficult however.

[ Back to Main ]
[ Onto next Chapter ]

Alive 6