10 /* A statically linked driver was named on the compiler's command line.
11 ** Make sure that it is used instead of a dynamic one.
17 * link existing drivers like this:
19 * cl65 -DJOYSTICK_DRIVER=c64_hitjoy_joy -o joy-test.prg joy-test.c
21 * for testing a new driver you will have to uncomment the define below, and
22 * link your driver like this:
24 * co65 ../../target/c64/drv/joy/c64-hitjoy.joy -o hitjoy.s --code-label _hitjoy
25 * cl65 -DJOYSTICK_DRIVER=hitjoy -o joy-test.prg joy-test.c hitjoy.s
29 /* extern char JOYSTICK_DRIVER; */
33 /* Use a dynamically loaded driver, by default. */
50 Res = joy_load_driver (joy_stddrv);
51 #elif defined(JOYSTICK_DRIVER)
52 Res = joy_install (&JOYSTICK_DRIVER);
54 Res = joy_install (&joy_static_stddrv);
57 if (Res != JOY_ERR_OK) {
58 cprintf ("Error in joy_load_driver: %u\r\n", Res);
60 cprintf ("os: %u, %s\r\n", _oserror, _stroserror (_oserror));
66 #if defined(__ATARI5200__) || defined(__CREATIVISION__)
67 cprintf ("JOYSTICKS: %d", count);
69 cprintf ("Driver supports %d joystick(s)", count);
72 for (i = 0; i < count; ++i) {
75 #if defined(__ATARI5200__) || defined(__CREATIVISION__)
76 cprintf ("%1d:%-3s%-3s%-3s%-3s%-3s %02x",
78 JOY_UP(j)? " U " : " - ",
79 JOY_DOWN(j)? " D " : " - ",
80 JOY_LEFT(j)? " L " : " - ",
81 JOY_RIGHT(j)? " R " : " - ",
82 JOY_BTN_1(j)? " 1 " : " - ", j);
84 cprintf ("%2d: %-6s%-6s%-6s%-6s%-6s %02x",
86 JOY_UP(j)? " up " : " ---- ",
87 JOY_DOWN(j)? " down " : " ---- ",
88 JOY_LEFT(j)? " left " : " ---- ",
89 JOY_RIGHT(j)? "right " : " ---- ",
90 JOY_BTN_1(j)? "button" : " ---- ", j);