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. */
51 Res = joy_load_driver (joy_stddrv);
52 #elif defined(JOYSTICK_DRIVER)
53 Res = joy_install (&JOYSTICK_DRIVER);
55 Res = joy_install (&joy_static_stddrv);
58 if (Res != JOY_ERR_OK) {
59 cprintf ("Error in joy_load_driver: %u\r\n", Res);
61 cprintf ("os: %u, %s\r\n", _oserror, _stroserror (_oserror));
67 #if defined(__ATARI5200__) || defined(__CREATIVISION__)
68 cprintf ("JOYSTICKS: %d", count);
70 cprintf ("Driver supports %d joystick(s)", count);
73 for (i = 0; i < count; ++i) {
76 #if defined(__ATARI5200__) || defined(__CREATIVISION__)
77 cprintf ("%1d:%-3s%-3s%-3s%-3s%-3s %02x",
79 JOY_UP(j)? " U " : " - ",
80 JOY_DOWN(j)? " D " : " - ",
81 JOY_LEFT(j)? " L " : " - ",
82 JOY_RIGHT(j)? " R " : " - ",
83 JOY_BTN_1(j)? " 1 " : " - ", j);
85 cprintf ("%2d: %-6s%-6s%-6s%-6s%-6s %02x",
87 JOY_UP(j)? " up " : " ---- ",
88 JOY_DOWN(j)? " down " : " ---- ",
89 JOY_LEFT(j)? " left " : " ---- ",
90 JOY_RIGHT(j)? "right " : " ---- ",
91 JOY_BTN_1(j)? "button" : " ---- ", j);
95 /* show pressed key, so we can verify keyboard is working */
97 ch = kb ? cgetc() : ' ';
100 cprintf("kbd: %c", ch);