Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Joystick Library
Attached is included my joystick library to manage the joystick
Basically includes constants and macros to keep the same speed access that reading directly the keyboard ports.

The file keyboard.bas is a interface library to manage the keyboard.
Keyboard.bas is used by joystick.bas. It includes all the functions to manage the access to the joystick, The structure of joystick.bas as the following:

- Keyboard (OPQA/Enter), Kempston, Sinclair (Two players) and Cursor Joystick are supported.
- The active joystick is stored internally in the CtrlSelected variable and includes two functions to access it (SelectControl/GetSelectedControl).
- The other functions lets read the state of all joystick buttons.
- In order to let control two players (Sinclair case), are included in all functions a parameter called "played" with possible values PLAYER1/PLAYER2 (0/1).
- The Sinclair right player is used for player 2.

<!-- m --><a class="postlink" href=""> ... sp=sharing</a><!-- m -->
Awesome!! I would like to include it in the ZX Basic library. May I, please?
Of course.
For me will be a honour. Please use it.

Forum Jump:

Users browsing this thread: 1 Guest(s)