43
46
/* ------------------------------------------------------------------------- */
48
static int set_userport_joystick_enable(int val, void *param)
50
userport_joystick_enable = val;
54
static int set_userport_joystick_type(int val, void *param)
56
if (val >= USERPORT_JOYSTICK_NUM) {
59
userport_joystick_type = val;
63
static const resource_int_t resources_int[] = {
64
{ "UserportJoy", 0, RES_EVENT_NO, NULL,
65
&userport_joystick_enable, set_userport_joystick_enable, NULL },
66
{ "UserportJoyType", 0, RES_EVENT_NO, NULL,
67
&userport_joystick_type, set_userport_joystick_type, NULL },
71
int userport_joystick_resources_init(void)
73
return resources_register_int(resources_int);
76
static const cmdline_option_t cmdline_options[] =
78
{ "-userportjoy", SET_RESOURCE, 0,
79
NULL, NULL, "UserportJoy", (resource_value_t)1,
80
USE_PARAM_STRING, USE_DESCRIPTION_ID,
81
IDCLS_UNUSED, IDCLS_ENABLE_USERPORT_JOY,
83
{ "+userportjoy", SET_RESOURCE, 0,
84
NULL, NULL, "UserportJoy", (resource_value_t)0,
85
USE_PARAM_STRING, USE_DESCRIPTION_ID,
86
IDCLS_UNUSED, IDCLS_DISABLE_USERPORT_JOY,
88
{ "-userportjoytype", SET_RESOURCE, 1,
89
NULL, NULL, "UserportJoyType", (resource_value_t)0,
90
USE_PARAM_ID, USE_DESCRIPTION_ID,
91
IDCLS_P_TYPE, IDCLS_SET_USERPORT_JOY_TYPE,
96
int userport_joystick_cmdline_options_init(void)
98
return cmdline_register_options(cmdline_options);
101
/* ------------------------------------------------------------------------- */
45
103
/* FIXME: direction and unused bits are not yet taken into account */
47
105
/* C64/C128 only */
108
166
retval = (BYTE)~((jv3 & 0xf) | ((jv4 & 0xf) << 4));
110
168
case USERPORT_JOYSTICK_CGA:
111
retval = (BYTE)~((jv3 & 0x10) | ((jv4 & 0x10) << 1)
112
| (get_joystick_value(userport_joystick_cga_select + 3) & 0xf));
169
retval = (BYTE)~((jv3 & 0x10) | ((jv4 & 0x10) << 1) | (get_joystick_value(userport_joystick_cga_select + 3) & 0xf));
114
171
case USERPORT_JOYSTICK_PET:
115
172
retval = ((jv3 & 0xf) | ((jv4 & 0xf) << 4));