This is a simple library for use with the cc65 C compiler, targetting
Atari 8-bit computers , and using aMultiJoy adapter to allow up to 8 joysticks to be connected to an unmodified Atari computer.References
- MULTIJOY - Radek Štěrba / RASTER & Atariklub Prostějov (Czech)
- MULTIJOY8
- How to query the MultiJoy Interface
This is a work in progress
mj_test
- Read all 8 joystick directions and firebuttons
and show symbols on the screen to reflect their state
mj_draw
- Each of 8 joysticks controls a number which
can be moved around the screen independently. Hold fire to leave a
trail; release to erase
mj_robo
- A simple four-player game using two joysticks
per player, one controlling movement, and one controlling the firing
of bullets (up to 4 at a time, per player), à la
As of 2019-01-27:
mj_robo
game.
Include the header
#include <atari.h> #include "atari_multijoy.h"Initialize the port
multijoy_init(true);Set up screen and display list
For example, here's a "
" screen set up to invoke the DLIs every modeline (so query, and read, consecutive sticks 12 times per frame). GRAPHICS 0
unsigned char i; unsigned char * DLIST; unsigned char old_sdmctl; DLIST = (unsigned char *) SDLST; _graphics(0); old_sdmctl = multijoy_dli_init_1(); DLIST[3] = DL_DLI(DL_LMS(DL_GRAPHICS0)); for (i = 6; i < 29; i++) { DLIST[i] = DL_DLI(DL_GRAPHICS0); } multijoy_dli_init_2(old_sdmctl);Read whatever stick & firebutton state you want
unsigned char * PAGE6 = (char *) (0x600); unsigned char s; bool f; s = PAGE6[2]; /* Joystick #3 */ f = PAGE6[2 + 8]; /* Firebutton #3 */