Skip to content

gameiolib

These functions read the game ports from the hardware, so they work in both modes. Each takes the port: 0 is the port the mouse is normally plugged into, 1 the joystick port. With runtime error checking, any other port is the error “Joyport must be 0 or 1”.

Repeat
  VWait
  x+Joyx(1) : y+Joyy(1)
Until Joyb(1)

Joyr gives the direction as one number:

DirectionJoyrDirectionJoyr
up0down4
up and right1down and left5
right2left6
down and right3up and left7
none8

Based on the gameiolib guide by Acid Software.

Library number 190.

Commands

Gameb

The buttons held down on a CD32 game pad in the port, the sum of 1 play/pause, 2 reverse, 4 forward, 8 green, 16 yellow, 32 red and 64 blue.

Function, result .w. Help text: (Port)
Arguments: .w

Test a single button with And, for example If Gameb(1) And 32 for the red button. Reading a pad sets back the control lines of its port only and leaves the other port as it is.

Joyb

The buttons held down on the joystick or mouse in the port, 1 for the left (fire) button, 2 for the right one, 3 for both and 0 for none.

Function, result .w. Help text: (Port)
Arguments: .w

Joyr

The direction of the joystick in the port as a number from 0 to 7, clockwise from up, or 8 if it is not moved, as the table of the introduction shows.

Function, result .w. Help text: (Port)
Arguments: .w

Joyx

The horizontal direction of the joystick in the port, -1 for left, 1 for right and 0 for neither.

Function, result .w. Help text: (Port)
Arguments: .w

Joyy

The vertical direction of the joystick in the port, -1 for up, 1 for down and 0 for neither.

Function, result .w. Help text: (Port)
Arguments: .w