AMCAF Extension V1.40 Manual  Index

Four Player Adapter


If you are writing games, it's a good thing to add a multi player option.
Given the case even four or more players may compete against each others, you should think about implementing the four player adapter.
Obviously, it's more comfortable to enjoy a game when using a joystick than a keyboard.


PJOY
function: acquire direction of a joystick
bitmap=Pjoy(j)

This command corresponds to the AMOS function Joy, with the difference, that one of the parallel port joysticks is checked instead of the normal joysticks.
'j' must be either 0 or 1.

The value 'bitmap' contains the following bits:

Bit 0=1: the joystick is currently moved up
Bit 1=1: the joystick is currently moved down
Bit 2=1: the joystick is pressed to the left
Bit 3=1: the joystick is pressed to the right
Bit 4=1: the fire button has been pressed

PJUP
function: check if the joystick is pressed up
flag=Pjup(j)

This command corresponds to the Jup(j) function for normal joysticks. Pjup tests, if the joystick in the parallel port is currently pressed up.
If this is the case, True (-1) will be returned otherwise False (0).


PJDOWN
function: check if joystick is pressed down
flag=Pjdown(j)

Corresponds to the Jdown(j) function for normal joysticks. Pjdown tests, if the joystick in the parallel port is currently pressed down.
If this is the case, True (-1) will be returned otherwise False (0).


PJLEFT
function: check if joystick is pressed left
flag=Pjleft(j)

Corresponds to the Jleft(j) function for normal joysticks. Pjleft tests, if the joystick in the parallel port is currently pressed to the left.
If this is the case, True (-1) will be returned otherwise False (0).


PJRIGHT
function: check if joystick is pressed right
flag=Pjright(j)

Corresponds to the Jright(j) function for normal joysticks. Pjright tests, if the joystick in the parallel port is currently pressed to the right.
If this is the case, True (-1) will be returned otherwise False (0).


PFIRE
function: check if fire button is pressed
flag=Pfire(j)

Corresponds to the Fire(j) function for normal joysticks. Fire(j) tests, if the firebutton for the joystick in the parallel port is currently pressed.
If this is the case, True (-1) will be returned otherwise False (0).


Commands for Other Gamepads

XFIRE
function: return the state of the fire buttons on a gamepad
flag=Xfire(port,button)

This function returns the state of a possibly existent second fire button on a joystick or joypad in the gameport numbered port.
If the lowlevel-library is available, all the other buttons can be checked as well. This library is distributed along with Kickstart 3.1 but even works with 2.0.

Possible values for the button parameter:

0: This is the normal fire button which exists on every joystick.
1: Second fire button on a few joysticks or the blue button on a gamepad.
2: Yellow fire button on a CD³² controller.
3: Green fire button
4: Reverse button on the gamepad
5: Forward button
6: Play/Pause button

Build a Game Adapter

Remark: I do NOT guarantee the correctness of this plan, nor I am responsible for any damage done to your computer if you're doing something wrong.
If you don't feel skilled enough to build the adapter yourself, you will find it in better electronic shops for a bargain.

Requirements: 1 25 pins male parallel socket.
              2 9 pins female joystick sockets.
              1 25 lines cable.


Blueprint of the parallel and joystick sockets.

                              Parallelport
  ____________________________________________________________________
 (                                                                    )
  \  1    2    3    4    5    6    7    8    9   10   11   12   13   /
   \   14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22   23 | 24   25 |  /
    \___|_|____|____|____|__|_|____|____|____|_________|_________|_/
        | |    |    |    |  | |    |    |    |         |         |
        | |    | .--|----|--^-|----|----|----|---------|-.       |
        `-|----|-|--|-v--|----|----|----|----|------.  `-|-------|-.
          |    | |  | |  |    |    |    |    |      `----|----.  | |
          |  .-|-|--|-|--' .--|----|----|----|-----------|----|--' |
          |  | | | /  |    |  `--. |    |    `--------.  |    |    |
          |  | `-|-|--|-.  |     | |    `-------------|--|-.  |    |
          |   \  | |  | |  |     | `------------------|--|-|--|-.  |
          `---|--|-|--|-|--|-.   `--------------------|--|-|--|-|--|-.
      ________|__|_|__|_|__|_|___             ________|__|_|__|_|__|_|___
     (        |  | |  | |  | |   )           (        |  | |  | |  | |   )
      \  5    4  | 3  | 2  | 1  /             \  5    4  | 3  | 2  | 1  /
       \    9    8    7    6   /               \    9    8    7    6   /
        \_____________________/                 \_____________________/

                 Joy 3                                   Joy 4

For the ones that think this plan is to confusing:

      Parallelport:     Joy 3:     Joy 4:
      P0     2                     UP     1
      P1     3                     DOWN   2
      P2     4                     LEFT   3
      P3     5                     RIGHT  4
      P4     6          UP     1
      P5     7          DOWN   2
      P6     8          LEFT   3
      P7     9          RIGHT  4
      BUSY  11          FIRE   6
      SEL   13                     FIRE   6
      +5 V  14          +5 V   7   +5 V   7
      GND   18          GND    8   GND    8

As already said, there's no guarantee that it will work (although mine perfectly does!).