2
2
* macosx/joy.c - Mac OS X joystick support.
5
* Christian Vogelsang <C.Vogelgsang@web.de>
5
* Christian Vogelgsang <C.Vogelgsang@web.de>
7
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
8
* See README for copyright notice.
34
34
#include "resources.h"
37
39
/* (Used by `kbd.c'). */
38
40
int joystick_port_map[2];
42
int joy_arch_init(void)
47
int joystick_init_resources(void)
52
int joystick_init_cmdline_options(void)
57
#else /* HAS_JOYSTICK */
59
42
/* NOTE: We use the HID Utilites Library provided by Apple for free
61
44
http://developer.apple.com/samplecode/HID_Utilities_Source/index.html
70
53
/* ----- VICE Resources ----- */
72
static int joyport1select(resource_value_t v, void *param)
74
joystick_port_map[0] = (int)v;
78
static int joyport2select(resource_value_t v, void *param)
80
joystick_port_map[1] = (int)v;
84
static const resource_t resources[] = {
85
{ "JoyDevice1", RES_INTEGER, (resource_value_t)0,
87
(void *)&joystick_port_map[0], joyport1select, NULL },
88
{ "JoyDevice2", RES_INTEGER, (resource_value_t)0,
90
(void *)&joystick_port_map[1], joyport2select, NULL },
55
static int joyport1select(int val, void *param)
57
joystick_port_map[0] = val;
61
static int joyport2select(int val, void *param)
63
joystick_port_map[1] = val;
67
static const resource_int_t resources_int[] = {
68
{ "JoyDevice1", 0, RES_EVENT_NO, NULL,
69
&joystick_port_map[0], joyport1select, NULL },
70
{ "JoyDevice2", 0, RES_EVENT_NO, NULL,
71
&joystick_port_map[1], joyport2select, NULL },
104
int joystick_init_resources(void)
85
int joystick_arch_init_resources(void)
106
return resources_register(resources);
87
return resources_register_int(resources_int);
109
90
int joystick_init_cmdline_options(void)