static const TCHAR *abspointers[] = { L"none", L"mousehack", L"tablet", 0 };
static const TCHAR *magiccursors[] = { L"both", L"native", L"host", 0 };
static const TCHAR *autoscale[] = { L"none", L"scale", L"resize", 0 };
+static const TCHAR *joyportmodes[] = { NULL, L"mouse", L"djoy", L"ajoy", L"cdtvjoy", L"cd32joy", L"lightpen", 0 };
static const TCHAR *obsolete[] = {
L"accuracy", L"gfx_opengl", L"gfx_32bit_blits", L"32bit_blits",
xfree (tmp1);
}
-void cfgfile_write_bool (struct zfile *f, TCHAR *option, int b)
+void cfgfile_write_bool (struct zfile *f, const TCHAR *option, int b)
{
cfg_dowrite (f, option, b ? L"true" : L"false", 0, 0);
}
-void cfgfile_dwrite_bool (struct zfile *f, TCHAR *option, int b)
+void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, int b)
{
cfg_dowrite (f, option, b ? L"true" : L"false", 1, 0);
}
-void cfgfile_write_str (struct zfile *f, TCHAR *option, const TCHAR *value)
+void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value)
{
cfg_dowrite (f, option, value, 0, 0);
}
-void cfgfile_dwrite_str (struct zfile *f, TCHAR *option, const TCHAR *value)
+void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value)
{
cfg_dowrite (f, option, value, 1, 0);
}
-void cfgfile_target_write_bool (struct zfile *f, TCHAR *option, int b)
+void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, int b)
{
cfg_dowrite (f, option, b ? L"true" : L"false", 0, 1);
}
-void cfgfile_target_dwrite_bool (struct zfile *f, TCHAR *option, int b)
+void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, int b)
{
cfg_dowrite (f, option, b ? L"true" : L"false", 1, 1);
}
-void cfgfile_target_write_str (struct zfile *f, TCHAR *option, const TCHAR *value)
+void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value)
{
cfg_dowrite (f, option, value, 0, 1);
}
-void cfgfile_target_dwrite_str (struct zfile *f, TCHAR *option, const TCHAR *value)
+void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value)
{
cfg_dowrite (f, option, value, 1, 1);
}
-void cfgfile_write (struct zfile *f, TCHAR *option, TCHAR *format,...)
+void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
{
va_list parms;
TCHAR tmp[CONFIG_BLEN];
cfg_dowrite (f, option, tmp, 0, 0);
va_end (parms);
}
-void cfgfile_dwrite (struct zfile *f, TCHAR *option, TCHAR *format,...)
+void cfgfile_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
{
va_list parms;
TCHAR tmp[CONFIG_BLEN];
cfg_dowrite (f, option, tmp, 1, 0);
va_end (parms);
}
-void cfgfile_target_write (struct zfile *f, TCHAR *option, TCHAR *format,...)
+void cfgfile_target_write (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
{
va_list parms;
TCHAR tmp[CONFIG_BLEN];
cfg_dowrite (f, option, tmp, 0, 1);
va_end (parms);
}
-void cfgfile_target_dwrite (struct zfile *f, TCHAR *option, TCHAR *format,...)
+void cfgfile_target_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
{
va_list parms;
TCHAR tmp[CONFIG_BLEN];
if (p->override_dga_address)
cfgfile_write (f, L"override_dga_address", L"0x%08x", p->override_dga_address);
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < MAX_JPORTS; i++) {
struct jport *jp = &p->jports[i];
int v = jp->id;
TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH];
if (v - JSEM_MICE > 0)
_stprintf (tmp2, L"mouse%d", v - JSEM_MICE);
}
- _stprintf (tmp1, L"joyport%d", i);
- cfgfile_write (f, tmp1, tmp2);
- if (jp->name) {
- _stprintf (tmp1, L"joyportfriendlyname%d", i);
- cfgfile_write (f, tmp1, jp->name);
- }
- if (jp->configname) {
- _stprintf (tmp1, L"joyportname%d", i);
- cfgfile_write (f, tmp1, jp->configname);
+ if (i < 2 || jp->id >= 0) {
+ _stprintf (tmp1, L"joyport%d", i);
+ cfgfile_write (f, tmp1, tmp2);
+ if (i < 2 && jp->mode > 0) {
+ _stprintf (tmp1, L"joyport%dmode", i);
+ cfgfile_write (f, tmp1, joyportmodes[jp->mode]);
+ }
+ if (jp->name) {
+ _stprintf (tmp1, L"joyportfriendlyname%d", i);
+ cfgfile_write (f, tmp1, jp->name);
+ }
+ if (jp->configname) {
+ _stprintf (tmp1, L"joyportname%d", i);
+ cfgfile_write (f, tmp1, jp->configname);
+ }
}
}
inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportfriendlyname0") == 0 ? 0 : 1, 2);
return 1;
}
+ if (_tcscmp (option, L"joyportfriendlyname2") == 0 || _tcscmp (option, L"joyportfriendlyname3") == 0) {
+ inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportfriendlyname2") == 0 ? 2 : 3, 2);
+ return 1;
+ }
if (_tcscmp (option, L"joyportname0") == 0 || _tcscmp (option, L"joyportname1") == 0) {
inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportname0") == 0 ? 0 : 1, 1);
return 1;
}
-
+ if (_tcscmp (option, L"joyportname2") == 0 || _tcscmp (option, L"joyportname3") == 0) {
+ inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportname2") == 0 ? 2 : 3, 1);
+ return 1;
+ }
if (_tcscmp (option, L"joyport0") == 0 || _tcscmp (option, L"joyport1") == 0) {
inputdevice_joyport_config (p, value, _tcscmp (option, L"joyport0") == 0 ? 0 : 1, 0);
return 1;
}
+ if (_tcscmp (option, L"joyport2") == 0 || _tcscmp (option, L"joyport3") == 0) {
+ inputdevice_joyport_config (p, value, _tcscmp (option, L"joyport2") == 0 ? 2 : 3, 0);
+ return 1;
+ }
+ if (cfgfile_strval (option, value, L"joyport0mode", &p->jports[0].mode, joyportmodes, 0))
+ return 1;
+ if (cfgfile_strval (option, value, L"joyport1mode", &p->jports[1].mode, joyportmodes, 0))
+ return 1;
+ if (cfgfile_strval (option, value, L"joyport2mode", &p->jports[2].mode, joyportmodes, 0))
+ return 1;
+ if (cfgfile_strval (option, value, L"joyport3mode", &p->jports[3].mode, joyportmodes, 0))
+ return 1;
if (cfgfile_string (option, value, L"statefile", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) {
_tcscpy (savestate_fname, tmpbuf);
}
for (i = 0; i < 4; i++)
- subst (p->path_floppy, p->df[i], sizeof p->df[i]);
+ subst (p->path_floppy, p->df[i], sizeof p->df[i] / sizeof (TCHAR));
subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR));
subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR));
memset (&p->jports[0], 0, sizeof (struct jport));
memset (&p->jports[1], 0, sizeof (struct jport));
+ memset (&p->jports[2], 0, sizeof (struct jport));
+ memset (&p->jports[3], 0, sizeof (struct jport));
p->jports[0].id = JSEM_MICE;
p->jports[1].id = JSEM_KBDLAYOUT;
+ p->jports[2].id = -1;
+ p->jports[3].id = -1;
p->keyboard_lang = KBD_LANG_US;
p->produce_sound = 3;
{
if (nr < toscr_nr_planes) {
#if NEW_BPL
- uaecptr p = f_bplpt[nr];
+ uaecptr p = f_bplpt[nr] + bpl_off[nr];
#else
uaecptr p = bplpt[nr];
bplpt[nr] += 2 << fm;
hsync_counter = 0;
vsync_counter = 0;
ciavsync_counter = 0;
- lightpen_x = lightpen_y = lightpen_triggered = 0;
+ lightpen_x = lightpen_y = -1;
+ lightpen_triggered = 0;
lightpen_cx = lightpen_cy = -1;
if (! savestate_state) {
currprefs.chipset_mask = changed_prefs.chipset_mask;
extern int inputdevice_get_widget_type (int devnum, int num, TCHAR *name);
extern int input_get_default_mouse (struct uae_input_device *uid, int num, int port);
-extern int input_get_default_joystick (struct uae_input_device *uid, int num, int port);
+extern int input_get_default_lightpen (struct uae_input_device *uid, int num, int port);
+extern int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int cd32);
+extern int input_get_default_joystick_analog (struct uae_input_device *uid, int num, int port);
#define DEFEVENT(A, B, C, D, E, F) INPUTEVENT_ ## A,
enum inputevents {
extern void inputdevice_tablet_strobe (void);
+#define JSEM_MODE_DEFAULT 0
+#define JSEM_MODE_MOUSE 1
+#define JSEM_MODE_JOYSTICK 2
+#define JSEM_MODE_JOYSTICK_ANALOG 3
+#define JSEM_MODE_MOUSE_CDTV 4
+#define JSEM_MODE_JOYSTICK_CD32 5
+#define JSEM_MODE_LIGHTPEN 6
+
#define JSEM_KBDLAYOUT 0
#define JSEM_JOYS 100
#define JSEM_MICE 200
extern int get_next_key (void);
extern int keys_available (void);
-extern void record_key (int);
-extern void record_key_direct (int);
+extern int record_key (int);
+extern int record_key_direct (int);
extern void keybuf_init (void);
extern void joystick_setting_changed (void);
extern int getcapslockstate (void);
TCHAR *custom[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT];
uae_u16 flags[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT];
uae_s16 extra[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SIMULTANEOUS_KEYS];
- uae_u8 enabled;
+ uae_s8 enabled;
};
+#define MAX_JPORTS 4
#define MAX_JPORTNAME 128
struct jport {
int id;
+ int mode; // 0=def,1=mouse,2=joy,3=anajoy,4=lightpen
TCHAR name[MAX_JPORTNAME];
TCHAR configname[MAX_JPORTNAME];
};
/* input */
TCHAR inputname[256];
- struct jport jports[2];
+ struct jport jports[MAX_JPORTS];
int input_selected_setting;
int input_joymouse_multiplier;
int input_joymouse_deadzone;
extern TCHAR optionsfile[];
extern void save_options (struct zfile *, struct uae_prefs *, int);
-extern void cfgfile_write (struct zfile *, TCHAR *option, TCHAR *format,...);
-extern void cfgfile_dwrite (struct zfile *, TCHAR *option, TCHAR *format,...);
-extern void cfgfile_target_write (struct zfile *, TCHAR *option, TCHAR *format,...);
-extern void cfgfile_target_dwrite (struct zfile *, TCHAR *option, TCHAR *format,...);
+extern void cfgfile_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
+extern void cfgfile_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
+extern void cfgfile_target_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
+extern void cfgfile_target_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
-extern void cfgfile_write_bool (struct zfile *f, TCHAR *option, int b);
-extern void cfgfile_dwrite_bool (struct zfile *f, TCHAR *option, int b);
-extern void cfgfile_target_write_bool (struct zfile *f, TCHAR *option, int b);
-extern void cfgfile_target_dwrite_bool (struct zfile *f, TCHAR *option, int b);
+extern void cfgfile_write_bool (struct zfile *f, const TCHAR *option, int b);
+extern void cfgfile_dwrite_bool (struct zfile *f,const TCHAR *option, int b);
+extern void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, int b);
+extern void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, int b);
-extern void cfgfile_write_str (struct zfile *f, TCHAR *option, const TCHAR *value);
-extern void cfgfile_dwrite_str (struct zfile *f, TCHAR *option, const TCHAR *value);
-extern void cfgfile_target_write_str (struct zfile *f, TCHAR *option, const TCHAR *value);
-extern void cfgfile_target_dwrite_str (struct zfile *f, TCHAR *option, const TCHAR *value);
+extern void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
+extern void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
+extern void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
+extern void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
extern void cfgfile_backup (const TCHAR *path);
extern struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
extern struct zfile *zfile_gunzip (struct zfile *z);
extern int zfile_isdiskimage (const TCHAR *name);
extern int iszip (struct zfile *z);
+extern int zfile_convertimage (const TCHAR *src, const TCHAR *dst);
#define ZFILE_UNKNOWN 0
#define ZFILE_CONFIGURATION 1
#define DIR_UP 4
#define DIR_DOWN 8
+#define IE_INVERT 0x80
+#define IE_CDTV 0x100
+
struct inputevent {
const TCHAR *confname;
const TCHAR *name;
int data;
};
-#define IE_INVERT 0x80
#define JOYBUTTON_1 0 /* fire/left mousebutton */
#define JOYBUTTON_2 1 /* 2nd/right mousebutton */
#define AM_CUSTOM 256 /* custom event */
#define AM_K (AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT|AM_AF) /* generic button/switch */
+#define JOYMOUSE_CDTV 8
+
/* event flags */
#define ID_FLAG_AUTOFIRE 1
_tcscpy (dst->jports[num].configname, src->jports[num].configname);
_tcscpy (dst->jports[num].name, src->jports[num].name);
dst->jports[num].id = src->jports[num].id;
+ dst->jports[num].mode = src->jports[num].mode;
}
static void out_config (struct zfile *f, int id, int num, TCHAR *s1, TCHAR *s2)
evt = kbr->eventid[i][j];
if (custom == NULL && evt <= 0) {
for (k = j + 1; k < MAX_INPUT_SUB_EVENT; k++) {
- if (kbr->eventid[i][k] > 0 || kbr->custom[i][k] != NULL) break;
+ if (kbr->eventid[i][k] > 0 || kbr->custom[i][k] != NULL)
+ break;
}
if (k == MAX_INPUT_SUB_EVENT)
break;
int i;
for (i = 0; i < INPUT_QUEUE_SIZE; i++) {
iq = &input_queue[i];
- if (iq->event == event) return i;
+ if (iq->event == event)
+ return i;
}
return -1;
}
} else if (i < 0) {
for (i = 0; i < INPUT_QUEUE_SIZE; i++) {
iq = &input_queue[i];
- if (iq->framecnt < 0) break;
+ if (iq->framecnt < 0)
+ break;
}
if (i == INPUT_QUEUE_SIZE) {
write_log (L"input queue overflow\n");
memset (keybuf, 0, sizeof (keybuf));
uae_reset (r);
}
- record_key ((uae_u8)((key << 1) | (key >> 7)));
- if (inputdevice_logging & 1)
- write_log (L"Amiga key %02X %d\n", key & 0x7f, key >> 7);
+ if (record_key ((uae_u8)((key << 1) | (key >> 7)))) {
+ if (inputdevice_logging & 1)
+ write_log (L"Amiga key %02X %d\n", key & 0x7f, key >> 7);
+ }
return;
}
inputdevice_add_inputcode (code, state);
{
case 5: /* lightpen/gun */
{
- int delta = state * currprefs.input_mouse_speed / 100;
- if (ie->data)
- lightpen_y += delta;
- else
- lightpen_x += delta;
+ if (lightpen_x < 0 && lightpen_y < 0) {
+ lightpen_x = gfxvidinfo.width / 2;
+ lightpen_y = gfxvidinfo.height / 2;
+ }
+ if (ie->type == 0) {
+ int delta = 0;
+ if (max == 0)
+ delta = state * currprefs.input_mouse_speed / 100;
+ else if (state > 0)
+ delta = currprefs.input_joymouse_speed;
+ else if (state < 0)
+ delta = -currprefs.input_joymouse_speed;
+ if (ie->data)
+ lightpen_y += delta;
+ else
+ lightpen_x += delta;
+ } else {
+ int delta = currprefs.input_joymouse_speed;
+ if (ie->data & DIR_LEFT)
+ lightpen_x -= delta;
+ if (ie->data & DIR_RIGHT)
+ lightpen_x += delta;
+ if (ie->data & DIR_UP)
+ lightpen_y -= delta;
+ if (ie->data & DIR_DOWN)
+ lightpen_y += delta;
+ }
}
break;
case 1: /* ->JOY1 */
delta = state;
mouse_deltanoreset[joy][unit] = 0;
}
+ if (ie->data & IE_CDTV) {
+ delta = 0;
+ if (state > 0)
+ delta = JOYMOUSE_CDTV;
+ else if (state < 0)
+ delta = -JOYMOUSE_CDTV;
+ }
mouse_delta[joy][unit] += delta * ((ie->data & IE_INVERT) ? -1 : 1);
} else if (ie->type & 32) { /* button mouse emulation vertical */
- int speed = currprefs.input_joymouse_speed;
+ int speed = (ie->data & IE_CDTV) ? JOYMOUSE_CDTV : currprefs.input_joymouse_speed;
+
if (state && (ie->data & DIR_UP)) {
mouse_delta[joy][1] = -speed;
mouse_deltanoreset[joy][1] = 1;
} else if (ie->type & 64) { /* button mouse emulation horizontal */
- int speed = currprefs.input_joymouse_speed;
+ int speed = (ie->data & IE_CDTV) ? JOYMOUSE_CDTV : currprefs.input_joymouse_speed;
+
if (state && (ie->data & DIR_LEFT)) {
mouse_delta[joy][0] = -speed;
mouse_deltanoreset[joy][0] = 1;
} else
mouse_deltanoreset[joy][0] = 0;
- } else if (ie->type & 128) { /* analog (paddle) */
+ } else if (ie->type & 128) { /* analog joystick / paddle */
int deadzone = currprefs.input_joymouse_deadzone * max / 100;
int unit = ie->data & 0x7f;
}
if (ie->data & IE_INVERT)
state = -state;
- state = state / (312 * 100 / currprefs.input_analog_joystick_mult) + (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
+ state = state * currprefs.input_analog_joystick_mult / max;
+ state += (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
if (state < 0)
state = 0;
+ if (state > 255)
+ state = 255;
joydirpot[joy][unit] = state;
} else {
{
if (currprefs.jports[0].id != changed_prefs.jports[0].id ||
currprefs.jports[1].id != changed_prefs.jports[1].id ||
+ currprefs.jports[2].id != changed_prefs.jports[2].id ||
+ currprefs.jports[3].id != changed_prefs.jports[3].id ||
currprefs.input_selected_setting != changed_prefs.input_selected_setting ||
currprefs.input_joymouse_multiplier != changed_prefs.input_joymouse_multiplier ||
currprefs.input_joymouse_deadzone != changed_prefs.input_joymouse_deadzone ||
for (k = 0; k < MAX_INPUT_SUB_EVENT; k++) {
for (j = 0; j < ID_BUTTON_TOTAL; j++) {
- if (joysticks[i].enabled && i < n_joy) {
+ if ((joysticks[i].enabled && i < n_joy) || joysticks[i].enabled < 0) {
ei = joysticks[i].eventid[ID_BUTTON_OFFSET + j][k];
e = &events[ei];
iscd32 (ei);
if (joysticks[i].eventid[ID_BUTTON_OFFSET + j][k] > 0)
use_joysticks[i] = 1;
}
- if (mice[i].enabled && i < n_mouse) {
+ if ((mice[i].enabled && i < n_mouse) || mice[i].enabled < 0) {
ei = mice[i].eventid[ID_BUTTON_OFFSET + j][k];
e = &events[ei];
iscd32 (ei);
for (j = 0; j < ID_AXIS_TOTAL; j++) {
- if (joysticks[i].enabled && i < n_joy) {
+ if ((joysticks[i].enabled && i < n_joy) || joysticks[i].enabled < 0) {
ei = joysticks[i].eventid[ID_AXIS_OFFSET + j][k];
iscd32 (ei);
isparport (ei);
if (ei > 0)
use_joysticks[i] = 1;
}
- if (mice[i].enabled && i < n_mouse) {
+ if ((mice[i].enabled && i < n_mouse) || mice[i].enabled < 0) {
ei = mice[i].eventid[ID_AXIS_OFFSET + j][k];
iscd32 (ei);
isparport (ei);
}
#endif
-int compatibility_device[2];
+int compatibility_device[MAX_JPORTS];
static void compatibility_mode (struct uae_prefs *prefs)
{
int joy, i;
- int used[4] = { 0, 0, 0, 0};
+ int used[MAX_INPUT_DEVICES] = { 0 };
prefs->jports[0].name[0] = prefs->jports[1].name[0] = 0;
prefs->jports[0].configname[0] = prefs->jports[1].configname[0] = 0;
+ prefs->jports[2].name[0] = prefs->jports[3].name[0] = 0;
+ prefs->jports[2].configname[0] = prefs->jports[3].configname[0] = 0;
compatibility_device[0] = -1;
compatibility_device[1] = -1;
+ compatibility_device[2] = -1;
+ compatibility_device[3] = -1;
for (i = 0; i < MAX_INPUT_DEVICES; i++) {
clear_id (&mice[i]);
clear_id (&joysticks[i]);
}
- if ((joy = jsem_ismouse (0, prefs)) >= 0) {
- input_get_default_mouse (mice, joy, 0);
- mice[joy].enabled = 1;
- _tcsncpy (prefs->jports[0].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1);
- _tcsncpy (prefs->jports[0].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1);
- }
- if ((joy = jsem_ismouse (1, prefs)) >= 0) {
- input_get_default_mouse (mice, joy, 1);
- mice[joy].enabled = 1;
- _tcsncpy (prefs->jports[1].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1);
- _tcsncpy (prefs->jports[1].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1);
- }
-
- joy = jsem_isjoy (1, prefs);
- if (joy >= 0) {
- used[joy] = 1;
- input_get_default_joystick (joysticks, joy, 1);
- joysticks[joy].enabled = 1;
- _tcsncpy (prefs->jports[1].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
- _tcsncpy (prefs->jports[1].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
- }
-
- joy = jsem_isjoy (0, prefs);
- if (joy >= 0) {
- used[joy] = 1;
- input_get_default_joystick (joysticks, joy, 0);
- joysticks[joy].enabled = 1;
- _tcsncpy (prefs->jports[0].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
- _tcsncpy (prefs->jports[0].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
- }
-
- for (joy = 0; used[joy]; joy++);
- if (JSEM_ISANYKBD (0, prefs)) {
- joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_JOY1_HORIZ;
- joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_JOY1_VERT;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = INPUTEVENT_JOY1_FIRE_BUTTON;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 1][0] = INPUTEVENT_JOY1_2ND_BUTTON;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 2][0] = INPUTEVENT_JOY1_3RD_BUTTON;
- joysticks[joy].enabled = 1;
- used[joy] = 1;
- compatibility_device[0] = joy;
- }
- for (joy = 0; used[joy]; joy++);
- if (JSEM_ISANYKBD (1, prefs)) {
- joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_JOY2_HORIZ;
- joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_JOY2_VERT;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = INPUTEVENT_JOY2_FIRE_BUTTON;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 1][0] = INPUTEVENT_JOY2_2ND_BUTTON;
- joysticks[joy].eventid[ID_BUTTON_OFFSET + 2][0] = INPUTEVENT_JOY2_3RD_BUTTON;
-#ifdef CD32
- if (currprefs.cs_cd32cd)
- setcd32 (joy, 1);
-#endif
- joysticks[joy].enabled = 1;
- used[joy] = 1;
- compatibility_device[1] = joy;
+ for (i = 0; i < 2; i++) {
+ int mode = prefs->jports[i].mode;
+ if ((joy = jsem_ismouse (i, prefs)) >= 0) {
+ switch (mode)
+ {
+ case JSEM_MODE_DEFAULT:
+ case JSEM_MODE_MOUSE:
+ default:
+ input_get_default_mouse (mice, joy, i);
+ break;
+ case JSEM_MODE_LIGHTPEN:
+ input_get_default_lightpen (mice, joy, i);
+ break;
+ }
+ _tcsncpy (prefs->jports[i].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ _tcsncpy (prefs->jports[i].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1);
+ mice[joy].enabled = 1;
+ }
+ }
+ for (i = 1; i >= 0; i--) {
+ int mode = prefs->jports[i].mode;
+ joy = jsem_isjoy (i, prefs);
+ if (joy >= 0) {
+ switch (mode)
+ {
+ case JSEM_MODE_DEFAULT:
+ case JSEM_MODE_JOYSTICK:
+ case JSEM_MODE_JOYSTICK_CD32:
+ default:
+ input_get_default_joystick (joysticks, joy, i, (mode == JSEM_MODE_JOYSTICK_CD32 || (mode == JSEM_MODE_DEFAULT && prefs->cs_cd32cd)));
+ break;
+ case JSEM_MODE_JOYSTICK_ANALOG:
+ input_get_default_joystick_analog (joysticks, joy, i);
+ break;
+ case JSEM_MODE_MOUSE:
+ input_get_default_mouse (joysticks, joy, i);
+ break;
+ case JSEM_MODE_LIGHTPEN:
+ input_get_default_lightpen (joysticks, joy, i);
+ break;
+ }
+ _tcsncpy (prefs->jports[i].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ _tcsncpy (prefs->jports[i].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
+ joysticks[joy].enabled = 1;
+ used[joy] = 1;
+ }
+ }
+ for (i = 2; i < 4; i++) {
+ joy = jsem_isjoy (i, prefs);
+ if (joy >= 0) {
+ input_get_default_joystick (joysticks, joy, i, 0);
+ _tcsncpy (prefs->jports[i].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ _tcsncpy (prefs->jports[i].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
+ joysticks[joy].enabled = 1;
+ used[joy] = 1;
+ }
+ }
+
+ for (i = 0; i < 2; i++) {
+ int mode = prefs->jports[i].mode;
+ for (joy = 0; used[joy]; joy++);
+ if (JSEM_ISANYKBD (i, prefs)) {
+ switch (mode)
+ {
+ case JSEM_MODE_JOYSTICK:
+ case JSEM_MODE_JOYSTICK_CD32:
+ case JSEM_MODE_DEFAULT:
+ default:
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = i ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = i ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = i ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 1][0] = i ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 2][0] = i ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ if (mode == JSEM_MODE_JOYSTICK_CD32 || (mode == JSEM_MODE_DEFAULT && prefs->cs_cd32cd))
+ setcd32 (joy, i);
+ break;
+ case JSEM_MODE_MOUSE_CDTV:
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_MOUSE_CDTV_HORIZ;
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_MOUSE_CDTV_VERT;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = INPUTEVENT_JOY1_FIRE_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 1][0] = INPUTEVENT_JOY1_2ND_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 2][0] = INPUTEVENT_JOY1_3RD_BUTTON;
+ break;
+ case JSEM_MODE_MOUSE:
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = i ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ;
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = i ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = i ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 1][0] = i ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 2][0] = i ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ break;
+ case JSEM_MODE_LIGHTPEN:
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_LIGHTPEN_HORIZ;
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_LIGHTPEN_VERT;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = i ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ break;
+
+ }
+ joysticks[joy].enabled = -1;
+ used[joy] = 1;
+ compatibility_device[i] = joy;
+ }
+ }
+ for (i = 2; i < 4; i++) {
+ for (joy = 0; used[joy]; joy++);
+ if (JSEM_ISANYKBD (i, prefs)) {
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 0][0] = i == 3 ? INPUTEVENT_PAR_JOY2_HORIZ : INPUTEVENT_PAR_JOY1_HORIZ;
+ joysticks[joy].eventid[ID_AXIS_OFFSET + 1][0] = i == 3 ? INPUTEVENT_PAR_JOY2_VERT : INPUTEVENT_PAR_JOY1_VERT;
+ joysticks[joy].eventid[ID_BUTTON_OFFSET + 0][0] = i == 3 ? INPUTEVENT_PAR_JOY2_FIRE_BUTTON : INPUTEVENT_PAR_JOY1_FIRE_BUTTON;
+ joysticks[joy].enabled = -1;
+ used[joy] = 1;
+ compatibility_device[i] = joy;
+ }
}
}
{
int i;
- int j = jsem_isjoy (1, &currprefs);
- int m = jsem_ismouse (1, &currprefs);
- int k = jsem_iskbdjoy (1, &currprefs);
-
copyjport (&changed_prefs, &currprefs, 0);
copyjport (&changed_prefs, &currprefs, 1);
+ copyjport (&changed_prefs, &currprefs, 2);
+ copyjport (&changed_prefs, &currprefs, 3);
#ifdef RETROPLATFORM
rp_input_change (0);
rp_input_change (1);
+ rp_input_change (2);
+ rp_input_change (3);
#endif
joybutton[0] = joybutton[1] = 0;
scanevents (prefs);
+#if 0
#ifdef CD32
if (currprefs.input_selected_setting == 0 && currprefs.cs_cd32cd)
cd32_pad_enabled[1] = 1;
#endif
-
+#endif
}
/* called when devices get inserted or removed */
{
int acc = input_acquired;
int i, idx;
- TCHAR *jports[2];
+ TCHAR *jports[MAX_JPORTS];
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < MAX_JPORTS; i++) {
jports[i] = 0;
idx = inputdevice_getjoyportdevice (prefs->jports[i].id) - JSEM_LASTKBD;
if (idx >= 0) {
matchdevices (&idev[IDTYPE_JOYSTICK], joysticks);
matchdevices (&idev[IDTYPE_KEYBOARD], keyboards);
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < MAX_JPORTS; i++) {
freejport (prefs, i);
if (jports[i])
inputdevice_joyport_config (prefs, jports[i], i, 2);
p->input_joymouse_deadzone = 33;
p->input_joystick_deadzone = 33;
p->input_joymouse_speed = 10;
- p->input_analog_joystick_mult = 100;
- p->input_analog_joystick_offset = 0;
+ p->input_analog_joystick_mult = 15;
+ p->input_analog_joystick_offset = -1;
p->input_mouse_speed = 100;
p->input_autofire_framecnt = 10;
for (i = 0; i <= MAX_INPUT_SETTINGS; i++) {
for (j = 0; j < MAX_INPUT_DEVICES; j++) {
if (input_get_default_mouse (p->mouse_settings[i], j, j & 1))
p->mouse_settings[i]->enabled = 1;
- if (input_get_default_joystick (p->joystick_settings[i], j, j & 1))
+ if (input_get_default_joystick (p->joystick_settings[i], j, j & 1, 0))
p->joystick_settings[i]->enabled = 1;
}
}
if (!use_joysticks[joy])
return 0;
if (currprefs.input_selected_setting == 0) {
- if (jsem_isjoy (0, &currprefs) != joy && jsem_isjoy (1, &currprefs) != joy)
+ if (jsem_isjoy (0, &currprefs) != joy && jsem_isjoy (1, &currprefs) != joy &&
+ jsem_isjoy (2, &currprefs) != joy && jsem_isjoy (3, &currprefs) != joy)
return 1;
}
return 0;
id2 = &joysticks2[nr];
axis = 0;
- state = fake[1] ? -100 : (fake[2] ? 100 : 0);
+ state = fake[1] ? -1 : (fake[2] ? 1 : 0);
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++)
- handle_input_event (id1->eventid[ID_AXIS_OFFSET + axis][i], state, 100,
+ handle_input_event (id1->eventid[ID_AXIS_OFFSET + axis][i], state, 1,
id1->flags[ID_AXIS_OFFSET + axis][i]);
id2->states[axis] = state;
axis = 1;
- state = fake[0] ? -100 : (fake[3] ? 100 : 0);
+ state = fake[0] ? -1 : (fake[3] ? 1 : 0);
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++)
- handle_input_event (id1->eventid[ID_AXIS_OFFSET + axis][i], state, 100,
+ handle_input_event (id1->eventid[ID_AXIS_OFFSET + axis][i], state, 1,
id1->flags[ID_AXIS_OFFSET + axis][i]);
id2->states[axis] = state;
{
int fr, fr2;
- write_log (L"%d %d %d\n", currprefs.gfx_framerate, turbo_emulation, mode);
-
fr = currprefs.gfx_framerate;
if (fr == 0)
fr = -1;
case 2:
{
int i, j;
- for (j = 0; j < 2; j++) {
+ for (j = 0; j < MAX_JPORTS; j++) {
struct inputdevice_functions *idf;
int type = IDTYPE_MOUSE;
int idnum = JSEM_MICE;
TCHAR *name2 = idf->get_uniquename (i);
if ((name1 && !_tcscmp (name1, value)) || (name2 && !_tcscmp (name2, value))) {
p->jports[portnum].id = idnum + i;
+ p->jports[portnum].mode = 0;
return 1;
}
}
}
if (got == 2) {
p->jports[portnum].id = start;
+ p->jports[portnum].mode = 0;
return 1;
}
}
DEFEVENT(MOUSE1_WHEEL,L"Mouse1 Wheel",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,2)
+DEFEVENT(MOUSE_CDTV_HORIZ,L"CDTV Mouse Horizontal",AM_JOY_AXIS,8,1,0|IE_CDTV)
+DEFEVENT(MOUSE_CDTV_VERT,L"CDTV Mouse Vertical",AM_JOY_AXIS,8,1,1|IE_CDTV)
+DEFEVENT(MOUSE_CDTV_UP,L"CDTV Mouse Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP|IE_CDTV)
+DEFEVENT(MOUSE_CDTV_DOWN,L"CDTV Mouse Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN|IE_CDTV)
+DEFEVENT(MOUSE_CDTV_LEFT,L"CDTV Mouse Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT|IE_CDTV)
+DEFEVENT(MOUSE_CDTV_RIGHT,L"CDTV Mouse Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT|IE_CDTV)
+
DEFEVENT(JOY1_HORIZ,L"Joy1 Horizontal",AM_JOY_AXIS,0,1,DIR_LEFT|DIR_RIGHT)
DEFEVENT(JOY1_VERT,L"Joy1 Vertical",AM_JOY_AXIS,0,1,DIR_UP|DIR_DOWN)
DEFEVENT(JOY1_HORIZ_POT,L"Joy1 Horizontal (Analog)",AM_JOY_AXIS,128,1,1)
DEFEVENT(JOY2_CD32_RED,L"Joy2 CD32 Red",AM_K,4,2,JOYBUTTON_CD32_RED)
DEFEVENT(JOY2_CD32_BLUE,L"Joy2 CD32 Blue",AM_K,4,2,JOYBUTTON_CD32_BLUE)
-DEFEVENT(LIGHTPEN_HORIZ,L"Lightpen Horizontal",AM_MOUSE_AXIS,0,5,0)
-DEFEVENT(LIGHTPEN_VERT,L"Lightpen Vertical",AM_MOUSE_AXIS,0,5,1)
+DEFEVENT(LIGHTPEN_HORIZ,L"Lightpen Horizontal",AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,0)
+DEFEVENT(LIGHTPEN_VERT,L"Lightpen Vertical",AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,1)
+DEFEVENT(LIGHTPEN_LEFT,L"Lightpen Left",AM_K,1,5,DIR_LEFT)
+DEFEVENT(LIGHTPEN_RIGHT,L"Lightpen Right",AM_K,1,5,DIR_RIGHT)
+DEFEVENT(LIGHTPEN_UP,L"Lightpen Up",AM_K,1,5,DIR_UP)
+DEFEVENT(LIGHTPEN_DOWN,L"Lightpen Down",AM_K,1,5,DIR_DOWN)
/* parallel port joystick adapter */
#include "custom.h"
#include "savestate.h"
-static int fakestate[2][7] = { {0},{0} };
+static int fakestate[MAX_JPORTS][7] = { {0},{0} };
static int *fs_np, *fs_ck, *fs_se;
#ifdef ARCADIA
static int *fs_xa1, *fs_xa2;
#endif
-/* Not static so the DOS code can mess with them */
-int kpb_first, kpb_last;
+static int kpb_first, kpb_last;
static int keybuf[256];
static void do_fake (int nr)
{
int *fake = fakestate[nr];
- do_fake_joystick(nr, fake);
+ do_fake_joystick (nr, fake);
}
-void record_key (int kc)
+int record_key (int kc)
{
if (input_recording < 0 || pause_emulation)
- return;
- record_key_direct (kc);
+ return 0;
+ return record_key_direct (kc);
}
-void record_key_direct (int kc)
+int record_key_direct (int kc)
{
int fs = 0;
int kpb_next = kpb_first + 1;
kpb_next = 0;
if (kpb_next == kpb_last) {
write_log (L"Keyboard buffer overrun. Congratulations.\n");
- return;
+ return 0;
}
if (fs_np != 0) {
do_fake (0);
if (JSEM_ISANYKBD (1, &currprefs))
do_fake (1);
- return;
+ if (JSEM_ISANYKBD (2, &currprefs))
+ do_fake (2);
+ if (JSEM_ISANYKBD (3, &currprefs))
+ do_fake (3);
+ return 0;
} else {
if ((kc >> 1) == AK_RCTRL) {
kc ^= AK_RCTRL << 1;
keybuf[kpb_first] = kc;
kpb_first = kpb_next;
+ return 1;
}
void joystick_setting_changed (void)
{
+ int i;
+
fs_np = fs_ck = fs_se = 0;
#ifdef ARCADIA
fs_xa1 = fs_xa2 = 0;
#endif
- if (JSEM_ISNUMPAD (0, &currprefs))
- fs_np = fakestate[0];
- else if (JSEM_ISNUMPAD (1, &currprefs))
- fs_np = fakestate[1];
-
- if (JSEM_ISCURSOR (0, &currprefs))
- fs_ck = fakestate[0];
- else if (JSEM_ISCURSOR (1, &currprefs))
- fs_ck = fakestate[1];
-
- if (JSEM_ISSOMEWHEREELSE (0, &currprefs))
- fs_se = fakestate[0];
- else if (JSEM_ISSOMEWHEREELSE (1, &currprefs))
- fs_se = fakestate[1];
-
+ for (i = 0; i < MAX_JPORTS; i++) {
+ if (JSEM_ISNUMPAD (i, &currprefs))
+ fs_np = fakestate[i];
+ if (JSEM_ISCURSOR (i, &currprefs))
+ fs_ck = fakestate[i];
+ if (JSEM_ISSOMEWHEREELSE (i, &currprefs))
+ fs_se = fakestate[i];
#ifdef ARCADIA
- if (JSEM_ISXARCADE1 (0, &currprefs))
- fs_xa1 = fakestate[0];
- else if (JSEM_ISXARCADE1 (1, &currprefs))
- fs_xa1 = fakestate[1];
-
- if (JSEM_ISXARCADE2 (0, &currprefs))
- fs_xa2 = fakestate[0];
- else if (JSEM_ISXARCADE2 (1, &currprefs))
- fs_xa2 = fakestate[1];
+ if (JSEM_ISXARCADE1 (i, &currprefs))
+ fs_xa1 = fakestate[i];
+ if (JSEM_ISXARCADE2 (i, &currprefs))
+ fs_xa2 = fakestate[i];
#endif
+ }
}
void keybuf_init (void)
uae_u8 *restore_rom (uae_u8 *src)
{
uae_u32 crc32, mem_start, mem_size, mem_type, version;
- TCHAR *s;
- int i;
+ TCHAR *s, *romn;
+ int i, crcdet;
mem_start = restore_u32 ();
mem_size = restore_u32 ();
mem_type = restore_u32 ();
version = restore_u32 ();
crc32 = restore_u32 ();
- s = restore_string ();
+ romn = restore_string ();
+ crcdet = 0;
for (i = 0; i < romlist_cnt; i++) {
if (rl[i].rd->crc32 == crc32 && crc32) {
switch (mem_type)
{
case 0:
- _tcsncmp (changed_prefs.romfile, rl[i].path, 255);
+ _tcsncpy (changed_prefs.romfile, rl[i].path, 255);
break;
case 1:
- _tcsncmp (changed_prefs.romextfile, rl[i].path, 255);
+ _tcsncpy (changed_prefs.romextfile, rl[i].path, 255);
break;
}
+ write_log (L"ROM '%s' = '%s'\n", romn, rl[i].path);
+ crcdet = 1;
break;
}
}
- xfree (s);
s = restore_string ();
- if (zfile_exists (s)) {
+ if (!crcdet && zfile_exists (s)) {
switch (mem_type)
{
case 0:
- _tcsncmp (changed_prefs.romfile, s, 255);
+ _tcsncpy (changed_prefs.romfile, s, 255);
break;
case 1:
- _tcsncmp (changed_prefs.romextfile, s, 255);
+ _tcsncpy (changed_prefs.romextfile, s, 255);
break;
}
+ write_log (L"ROM detected (path) as '%s'\n", s);
+ crcdet = 1;
}
xfree (s);
+ if (!crcdet)
+ write_log (L"WARNING: ROM '%s' not found!\n", romn);
+ xfree (romn);
return src;
}
return 0;
}
-int input_get_default_joystick (struct uae_input_device *uid, int i, int port)
+int input_get_default_lightpen (struct uae_input_device *uid, int i, int port)
+{
+ struct didata *did;
+
+ if (i >= num_mouse)
+ return 0;
+ did = &di_mouse[i];
+ if (did->wininput)
+ port = 0;
+ uid[i].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_LIGHTPEN_HORIZ;
+ uid[i].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_LIGHTPEN_VERT;
+ uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ if (i == 0)
+ return 1;
+ return 0;
+}
+
+int input_get_default_joystick (struct uae_input_device *uid, int i, int port, int cd32)
{
int j;
struct didata *did;
+ int h, v;
if (i >= num_joystick)
return 0;
did = &di_joystick[i];
- uid[i].eventid[ID_AXIS_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;
- uid[i].eventid[ID_AXIS_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
- uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON;
- if (isrealbutton (did, 1))
- uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON;
- if (isrealbutton (did, 2))
- uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ if (port >= 2) {
+ h = port == 3 ? INPUTEVENT_PAR_JOY2_HORIZ : INPUTEVENT_PAR_JOY1_HORIZ;
+ v = port == 3 ? INPUTEVENT_PAR_JOY2_VERT : INPUTEVENT_PAR_JOY1_VERT;
+ } else {
+ h = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;;
+ v = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
+ }
+ uid[i].eventid[ID_AXIS_OFFSET + 0][0] = h;
+ uid[i].eventid[ID_AXIS_OFFSET + 1][0] = v;
+
+ if (port >= 2) {
+ uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port == 3 ? INPUTEVENT_PAR_JOY2_FIRE_BUTTON : INPUTEVENT_PAR_JOY1_FIRE_BUTTON;
+ } else {
+ uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON;
+ if (isrealbutton (did, 1))
+ uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON;
+ if (isrealbutton (did, 2))
+ uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
+ }
+
for (j = 2; j < MAX_MAPPINGS - 1; j++) {
int am = did->axismappings[j];
if (am == DIJOFS_POV(0) || am == DIJOFS_POV(1) || am == DIJOFS_POV(2) || am == DIJOFS_POV(3)) {
- uid[i].eventid[ID_AXIS_OFFSET + j + 0][0] = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;
- uid[i].eventid[ID_AXIS_OFFSET + j + 1][0] = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
+ uid[i].eventid[ID_AXIS_OFFSET + j + 0][0] = h;
+ uid[i].eventid[ID_AXIS_OFFSET + j + 1][0] = v;
j++;
}
}
- if (currprefs.cs_cd32cd) {
+ if (cd32) {
uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED;
if (isrealbutton (did, 1))
uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE;
return 1;
return 0;
}
+
+int input_get_default_joystick_analog (struct uae_input_device *uid, int i, int port)
+{
+ int j;
+ struct didata *did;
+
+ if (i >= num_joystick)
+ return 0;
+ did = &di_joystick[i];
+ uid[i].eventid[ID_AXIS_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT;
+ uid[i].eventid[ID_AXIS_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT;
+ uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_LEFT : INPUTEVENT_JOY1_LEFT;
+ if (isrealbutton (did, 1))
+ uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_RIGHT : INPUTEVENT_JOY1_RIGHT;
+ if (isrealbutton (did, 2))
+ uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_UP : INPUTEVENT_JOY1_UP;
+ if (isrealbutton (did, 3))
+ uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = port ? INPUTEVENT_JOY2_DOWN : INPUTEVENT_JOY1_DOWN;
+ for (j = 2; j < MAX_MAPPINGS - 1; j++) {
+ int am = did->axismappings[j];
+ if (am == DIJOFS_POV(0) || am == DIJOFS_POV(1) || am == DIJOFS_POV(2) || am == DIJOFS_POV(3)) {
+ uid[i].eventid[ID_AXIS_OFFSET + j + 0][0] = port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT;
+ uid[i].eventid[ID_AXIS_OFFSET + j + 1][0] = port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT;
+ j++;
+ }
+ }
+ if (i == 0)
+ return 1;
+ return 0;
+}
+
{
case 0xb7: //DE_ERROR_MAX
case 0x7c: //DE_INVALIDFILES
+ case 0x402: // "unknown error"
v = ERROR_FILE_NOT_FOUND;
break;
case 0x75: //DE_OPCANCELLED:
#define IDS_SB_CUSTOMEVENT 335
#define IDS_FLOPPYTYPE35DDPC 336
#define IDS_FLOPPYTYPE35HDPC 337
+#define IDS_JOYMODE_DEFAULT 338
+#define IDS_JOYMODE_MOUSE 339
+#define IDS_JOYMODE_JOYSTICK 340
+#define IDS_JOYMODE_JOYSTICKANALOG 341
+#define IDS_JOYMODE_LIGHTPEN 342
+#define IDS_JOYMODE_MOUSE_CDTV 343
+#define IDS_JOYMODE_JOYSTICK_CD32 344
+#define IDS_TABLET_BOTH_CURSORS 345
+#define IDS_TABLET_NATIVE_CURSOR 346
+#define IDS_TABLET_HOST_CURSOR 347
#define IDS_QS_MODELS 1000
#define IDS_QS_MODEL_A500 1001
#define IDS_QS_MODEL_A500P 1002
#define IDC_SCREENMODE_RTG 1027
#define IDC_MBMEM1 1028
#define IDC_PORT_TABLET_CURSOR 1028
+#define IDC_PORT0_JOYSMODE 1029
#define IDC_SLOWMEM 1030
+#define IDC_PORT1_JOYSMODE 1030
#define IDC_MBMEM2 1031
+#define IDC_PORT2_JOYS 1031
+#define IDC_PORT4_JOYS 1032
+#define IDC_PORT3_JOYS 1032
#define IDC_PARALLEL 1033
#define IDC_JULIAN 1040
#define IDC_FASTTEXT 1043
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 335
+#define _APS_NEXT_RESOURCE_VALUE 345
#define _APS_NEXT_COMMAND_VALUE 40045
#define _APS_NEXT_CONTROL_VALUE 1790
#define _APS_NEXT_SYMED_VALUE 101
CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,123,78,12\r
END\r
\r
-IDD_GAMEPORTS DIALOGEX 0, 0, 300, 178\r
+IDD_GAMEPORTS DIALOGEX 0, 0, 300, 236\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
COMBOBOX IDC_PORT0_JOYS,45,29,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- COMBOBOX IDC_PORT1_JOYS,45,50,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- PUSHBUTTON "Swap ports",IDC_SWAP,211,69,75,14\r
+ COMBOBOX IDC_PORT1_JOYS,45,65,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ PUSHBUTTON "Swap port 0 and 1",IDC_SWAP,194,101,93,14\r
RTEXT "Port 0:",IDC_STATIC,11,28,25,15,SS_CENTERIMAGE\r
- RTEXT "Port 1:",IDC_STATIC,11,49,25,15,SS_CENTERIMAGE\r
- LTEXT "X-Arcade layout information []#1",IDC_STATIC,16,68,106,15,SS_NOTIFY | SS_CENTERIMAGE\r
- GROUPBOX "Mouse and Joystick settings",IDC_STATIC,4,15,292,76\r
- GROUPBOX "Mouse extra settings",IDC_STATIC,4,92,292,76\r
- RTEXT "Mouse speed:",IDC_STATIC,17,106,56,10,SS_CENTERIMAGE\r
- EDITTEXT IDC_INPUTSPEEDM,87,106,25,12,ES_NUMBER\r
- CONTROL "Install virtual mouse driver",IDC_PORT_TABLET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,118,120,10\r
+ RTEXT "Port 1:",IDC_STATIC,11,64,25,15,SS_CENTERIMAGE\r
+ LTEXT "X-Arcade layout information []#1",IDC_STATIC,64,87,106,15,SS_NOTIFY | SS_CENTERIMAGE\r
+ GROUPBOX "Mouse and Joystick settings",IDC_STATIC,4,15,292,148\r
+ GROUPBOX "Mouse extra settings",IDC_STATIC,4,165,292,69\r
+ RTEXT "Mouse speed:",IDC_STATIC,17,180,56,10,SS_CENTERIMAGE\r
+ EDITTEXT IDC_INPUTSPEEDM,87,180,25,12,ES_NUMBER\r
+ CONTROL "Install virtual mouse driver",IDC_PORT_TABLET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,187,120,10\r
CONTROL "Full tablet input emulation",IDC_PORT_TABLET_FULL,\r
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,151,121,10\r
- CONTROL "Magic Mouse",IDC_PORT_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,106,119,10\r
- COMBOBOX IDC_PORT_TABLET_CURSOR,167,132,119,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "Magic Mouse cursor mode:",IDC_STATIC,17,135,138,10,SS_CENTERIMAGE\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,220,121,10\r
+ CONTROL "Magic Mouse",IDC_PORT_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,167,175,119,10\r
+ COMBOBOX IDC_PORT_TABLET_CURSOR,167,201,119,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Magic Mouse cursor mode:",IDC_STATIC,17,204,138,10,SS_CENTERIMAGE\r
+ COMBOBOX IDC_PORT0_JOYSMODE,195,47,91,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT1_JOYSMODE,195,82,91,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_PORT2_JOYS,45,125,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ LTEXT "Parallel port joystick adapter",IDC_STATIC,10,105,147,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_PORT3_JOYS,45,143,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
END\r
\r
IDD_CONTRIBUTORS DIALOGEX 0, 0, 411, 242\r
BEGIN\r
IDS_FLOPPYTYPE35DDPC "3.5"" DD (PC)"\r
IDS_FLOPPYTYPE35HDPC "3.5"" HD (PC)"\r
+ IDS_JOYMODE_DEFAULT "Default"\r
+ IDS_JOYMODE_MOUSE "Mouse"\r
+ IDS_JOYMODE_JOYSTICK "Joystick"\r
+ IDS_JOYMODE_JOYSTICKANALOG "Analog joystick"\r
+ IDS_JOYMODE_LIGHTPEN "Light pen"\r
+ IDS_JOYMODE_MOUSE_CDTV "CDTV remote mouse"\r
+ IDS_JOYMODE_JOYSTICK_CD32 "CD32 pad"\r
+ IDS_TABLET_BOTH_CURSORS "Show both cursors"\r
+ IDS_TABLET_NATIVE_CURSOR "Show native cursor only"\r
+ IDS_TABLET_HOST_CURSOR "Show host cursor only"\r
END\r
\r
#endif // English (U.S.) resources\r
type = 1;
_tcscpy (tmp2, name);
- for (i = 1; i <= 4; i++) {
+ for (i = 1; i <= MAX_JPORTS; i++) {
TCHAR tmp1[1000];
_stprintf (tmp1, L"Mouse%d", i);
if (!_tcscmp (name, tmp1)) {
{
TCHAR tmp1[1000];
- if (num < 0 || num > 1)
+ if (num < 0 || num >= MAX_JPORTS)
return FALSE;
if (_tcslen (name) == 0) {
inputdevice_joyport_config (&changed_prefs, L"none", num, 0);
}
RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_FLOPPY, floppy_mask, NULL, 0, &guestinfo, NULL);
- RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_INPUTPORT, 3, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_INPUTPORT, (1 << MAX_JPORTS) - 1, NULL, 0, &guestinfo, NULL);
rp_input_change (0);
rp_input_change (1);
+ rp_input_change (2);
+ rp_input_change (3);
hd_mask = 0;
cd_mask = 0;
static SYSTEM_INFO SystemInfo;
static int logging_started;
static DWORD minidumpmode = MiniDumpNormal;
+static int doquit;
void *globalipc, *serialipc;
int qpcdivisor = 0;
DWORD disposition;
const TCHAR *progid = L"WinUAE";
int def = !_tcscmp (extension, L".uae");
- TCHAR *defprogid;
+ const TCHAR *defprogid;
UAEREG *fkey;
_tcscpy (progid2, progid);
}
}
-static int parseargs (const TCHAR *arg, const TCHAR *np)
+static int parseargs (const TCHAR *arg, const TCHAR *np, const TCHAR *np2)
{
+ if (!_tcscmp (arg, L"-convert") && np && np2) {
+ zfile_convertimage (np, np2);
+ return -1;
+ }
if (!_tcscmp (arg, L"-log")) {
console_logging = 1;
for (i = 0; i < cnt; i++) {
TCHAR *arg = args[i];
TCHAR *next = i + 1 < cnt ? args[i + 1] : NULL;
- int v = parseargs (arg, next);
- if (!v)
+ TCHAR *next2 = i + 2 < cnt ? args[i + 2] : NULL;
+ int v = parseargs (arg, next, next2);
+ if (!v) {
xargv[xargc++] = my_strdup (arg);
- else if (v == 2)
+ } else if (v == 2) {
i++;
+ } else if (v < 0) {
+ doquit = 1;
+ return NULL;
+ }
}
return args;
}
for (i = 0; argv[i]; i++) {
TCHAR *arg = argv[i];
TCHAR *next = argv[i + 1];
- int v = parseargs (arg, next);
- if (!v)
+ TCHAR *next2 = next != NULL ? argv[i + 2] : NULL;
+ int v = parseargs (arg, next, next2);
+ if (!v) {
xargv[xargc++] = my_strdup (arg);
- else if (v == 2)
+ } else if (v == 2) {
i++;
+ } else if (v < 0) {
+ doquit = 1;
+ return 0;
+ }
}
#if 0
argv = 0;
hInst = hInstance;
hMutex = CreateMutex (NULL, FALSE, L"WinUAE Instantiated"); // To tell the installer we're running
-#ifdef AVIOUTPUT
- AVIOutput_Initialize ();
-#endif
+
argv = xcalloc (sizeof (TCHAR*), 32);
argv3 = NULL;
argc = process_arg (lpCmdLine, argv, &argv3);
+ if (doquit)
+ return 0;
argv2 = WIN32_InitRegistry (argv);
getstartpaths ();
else
default_freq = 60;
}
- WIN32_HandleRegistryStuff ();
+#ifdef AVIOUTPUT
+ AVIOutput_Initialize ();
+#endif WIN32_HandleRegistryStuff ();
WIN32_InitLang ();
WIN32_InitHtmlHelp ();
DirectDraw_Release ();
#define WINUAEPUBLICBETA 1
-#define WINUAEBETA L"19"
-#define WINUAEDATE MAKEBD(2009, 3, 28)
+#define WINUAEBETA L"20"
+#define WINUAEDATE MAKEBD(2009, 3, 30)
#define WINUAEEXTRA L""
#define WINUAEREV L""
openFileName.Flags |= OFN_ALLOWMULTISELECT;
if (flag == 1 || flag == 3 || flag == 5 || flag == 9 || flag == 11 || flag == 16) {
if (!(result = GetSaveFileName_2 (&openFileName, guid)))
- write_log (L"GetSaveFileNameX() failed, err=%d.\n", GetLastError());
+ write_log (L"GetSaveFileNameX() failed, err=%d.\n", GetLastError ());
} else {
if (!(result = GetOpenFileName_2 (&openFileName, guid)))
- write_log (L"GetOpenFileNameX() failed, err=%d.\n", GetLastError());
+ write_log (L"GetOpenFileNameX() failed, err=%d.\n", GetLastError ());
}
previousfilter[flag] = openFileName.nFilterIndex;
struct serialportinfo comports[MAX_SERIAL_PORTS];
static int ghostscript_available;
-static int joy0previous, joy1previous;
+static int joyxprevious[4];
static BOOL bNoMidiIn = FALSE;
static void enable_for_gameportsdlg (HWND hDlg)
#endif
}
+static int joys[] = { IDC_PORT0_JOYS, IDC_PORT1_JOYS, IDC_PORT2_JOYS, IDC_PORT3_JOYS };
+static int joysm[] = { IDC_PORT0_JOYSMODE, IDC_PORT1_JOYSMODE, -1, -1 };
+
static void updatejoyport (HWND hDlg)
{
int i, j;
CheckDlgButton (hDlg, IDC_PORT_TABLET, workprefs.input_tablet > 0);
CheckDlgButton (hDlg, IDC_PORT_TABLET_FULL, workprefs.input_tablet == TABLET_REAL);
- if (joy0previous < 0)
- joy0previous = inputdevice_get_device_total (IDTYPE_JOYSTICK) + 1;
- if (joy1previous < 0)
- joy1previous = JSEM_LASTKBD + 1;
- for (i = 0; i < 2; i++) {
+ if (joyxprevious[0] < 0)
+ joyxprevious[0] = inputdevice_get_device_total (IDTYPE_JOYSTICK) + 1;
+ if (joyxprevious[1] < 0)
+ joyxprevious[1] = JSEM_LASTKBD + 1;
+
+ for (i = 0; i < MAX_JPORTS; i++) {
int total = 2;
- int idx = i == 0 ? joy0previous : joy1previous;
- int id = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
+ int idx = joyxprevious[i];
+ int id = joys[i];
+ int idm = joysm[i];
int v = workprefs.jports[i].id;
+ int vm = workprefs.jports[i].mode;
TCHAR *p1, *p2;
+ if (idm > 0)
+ SendDlgItemMessage (hDlg, idm, CB_SETCURSEL, vm, 0);
+
SendDlgItemMessage (hDlg, id, CB_RESETCONTENT, 0, 0L);
SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)L"");
WIN32GUI_LoadUIString (IDS_NONE, tmp, sizeof (tmp) / sizeof (TCHAR) - 3);
static void values_from_gameportsdlg (HWND hDlg, int d)
{
- int i, success;
+ int i, j, success;
int changed = 0;
- int lastside = 0;
if (d) {
i = GetDlgItemInt (hDlg, IDC_INPUTSPEEDM, &success, FALSE);
return;
}
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < MAX_JPORTS; i++) {
int idx = 0;
int *port = &workprefs.jports[i].id;
+ int *portm = &workprefs.jports[i].mode;
int prevport = *port;
- int id = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
+ int id = joys[i];
+ int idm = joysm[i];
LRESULT v = SendDlgItemMessage (hDlg, id, CB_GETCURSEL, 0, 0L);
if (v != CB_ERR && v > 0) {
- v-=2;
+ v -= 2;
if (v < 0)
*port = -1;
else if (v < JSEM_LASTKBD)
else
*port = JSEM_JOYS + (int)v - JSEM_LASTKBD;
}
- if (*port != prevport) {
- lastside = i;
+ v = SendDlgItemMessage (hDlg, idm, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR && v > 0)
+ *portm = v;
+ if (*port != prevport)
changed = 1;
- }
}
if (changed) {
- if (lastside)
- fixjport (&workprefs.jports[0], workprefs.jports[1].id);
- else
- fixjport (&workprefs.jports[1], workprefs.jports[0].id);
+ for (i = 0; i < MAX_JPORTS; i++) {
+ for (j = 0; j < MAX_JPORTS; j++) {
+ if (j != i)
+ fixjport (&workprefs.jports[i], workprefs.jports[j].id);
+ }
+ }
}
-
+
}
static void values_from_portsdlg (HWND hDlg)
unload_ghostscript ();
ghostscript_available = 1;
}
- joy0previous = joy1previous = -1;
}
if (!ghostscript_available) {
workprefs.parallel_postscript_emulation = 0;
/* Handle messages for the Joystick Settings page of our property-sheet */
static INT_PTR CALLBACK GamePortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ TCHAR tmp[MAX_DPATH];
static int recursive = 0;
- int temp;
+ static int first;
+ int temp, i;
switch (msg)
{
recursive++;
pages[GAMEPORTS_ID] = hDlg;
currentpage = GAMEPORTS_ID;
+
+ if (!first) {
+ first = 1;
+ joyxprevious[0] = -1;
+ joyxprevious[1] = -1;
+ joyxprevious[2] = -1;
+ joyxprevious[3] = -1;
+ }
+
SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)L"Show both cursors");
- SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)L"Show native cursor only");
- SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)L"Show host cursor only");
+ WIN32GUI_LoadUIString (IDS_TABLET_BOTH_CURSORS, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_TABLET_NATIVE_CURSOR, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_TABLET_HOST_CURSOR, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_ADDSTRING, 0, (LPARAM)tmp);
+
+ for (i = 0; i < 2; i++) {
+ int id = i == 0 ? IDC_PORT0_JOYSMODE : IDC_PORT1_JOYSMODE;
+ SendDlgItemMessage (hDlg, id, CB_RESETCONTENT, 0, 0L);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_DEFAULT, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_MOUSE, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_JOYSTICK, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_JOYSTICKANALOG, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_MOUSE_CDTV, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_JOYSTICK_CD32, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_JOYMODE_LIGHTPEN, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ }
+
inputdevice_updateconfig (&workprefs);
enable_for_gameportsdlg (hDlg);
updatejoyport (hDlg);
memcpy (&tmp, &workprefs.jports[0], sizeof (struct jport));
memcpy (&workprefs.jports[0], &workprefs.jports[1], sizeof (struct jport));
memcpy (&workprefs.jports[1], &tmp, sizeof (struct jport));
- temp = joy0previous;
- joy0previous = joy1previous;
- joy1previous = temp;
+ temp = joyxprevious[0];
+ joyxprevious[0] = joyxprevious[1];
+ joyxprevious[1] = temp;
enable_for_gameportsdlg (hDlg);
updatejoyport (hDlg);
inputdevice_updateconfig (&workprefs);
{
case IDC_PORT0_JOYS:
case IDC_PORT1_JOYS:
+ case IDC_PORT2_JOYS:
+ case IDC_PORT3_JOYS:
+ case IDC_PORT0_JOYSMODE:
+ case IDC_PORT1_JOYSMODE:
values_from_gameportsdlg (hDlg, 0);
enable_for_gameportsdlg (hDlg);
updatejoyport (hDlg);
+Beta 20: (feature complete now. I think..)
+
+- added controller type to gameports panel, easier way to enable
+ more complex standard controller configurations without need for
+ input panel (analog joystick, lightpen, joystick mouse emulation..)
+ Note that impossible configurations like emulating joystick with
+ mouse aren't supported even if GUI seems to allow it, also
+ non-mouse lightpen isn't really supported, it works but moves
+ badly (not worth the trouble really, maybe)
+- added "CDTV Mouse" which is CDTV remote controller mouse emulation,
+ only difference between normal and CDTV mouse is speed setting,
+ normal mouse speed is adjustable in input-panel, CDTV mouse speed
+ is not adjustable and is same as real CDTV mouse emulation (there
+ are CDTV programs that expect CDTV remote controller -like mouse
+ speed and they do not work very well with normal mouse)
+ NOTE: speed not yet calibrated!
+- added CD32 controller type to gameports GUI, enables CD32 controller
+ emulation. Now it is possible to emulate normal joysticks in CD32
+ emulation mode (without using input panel)
+- parallel port joystick adapter configuration added to gameports panel
+ (GUI lists all devices but only joystick/keyboard supported)
+- light pen cursor is centered when used for the first time
+- added more compatible default analog joystick parameters
+- digital joystick/buttons mapped to analog stick axis work correctly
+- state restore rom detection fixed (b15), added logging
+- support "0x402 An unknown error occurred" when deleting non-existing
+ directory with recycle bin enabled
+- drives 1 to 3 config load didn't work (b15)
+- added possibly pointless command line image conversion option,
+ "winuae -convert <src> <dst>" where src can be any supported archive
+ and/or disk image (even archive.lha\fileinsidearchive.dms should
+ unpack to adf) Separate command line unpacker maybe in future..
+
Beta 19:
- missing command line unicode support added
TCHAR *bufp;
va_list parms;
+ if (!cs_init)
+ return;
EnterCriticalSection (&cs);
va_start (parms, format);
bufp = buffer;
*/
static uae_u32 emulib_GetUaeConfig (uaecptr place)
{
- int i;
+ int i, j;
put_long (place, version);
put_long (place + 4, allocated_chipmem);
else
put_byte (place + 35, 1);
- for (i = 0; i < 256; i++) {
- put_byte ((place + 36 + i), currprefs.df[0][i]);
- put_byte ((place + 36 + i + 256), currprefs.df[1][i]);
- put_byte ((place + 36 + i + 512), currprefs.df[2][i]);
- put_byte ((place + 36 + i + 768), currprefs.df[3][i]);
+ for (j = 0; j < 4; j++) {
+ char *s = ua (currprefs.df[j]);
+ for (i = 0; i < 256; i++)
+ put_byte (place + 36 + i + j * 256, s[i]);
+ xfree (s);
}
return 1;
}
return zn ? 1 : 0;
}
+int zfile_convertimage (const TCHAR *src, const TCHAR *dst)
+{
+ struct zfile *s, *d;
+ int ret = 0;
+
+ s = zfile_fopen (src, L"rb");
+ if (s) {
+ uae_u8 *b;
+ int size;
+ zfile_fseek (s, 0, SEEK_END);
+ size = zfile_ftell (s);
+ zfile_fseek (s, 0, SEEK_SET);
+ b = xcalloc (size, 1);
+ if (b) {
+ if (zfile_fread (b, size, 1, s) == 1) {
+ d = zfile_fopen (dst, L"wb");
+ if (d) {
+ if (zfile_fwrite (b, size, 1, d) == 1)
+ ret = 1;
+ zfile_fclose (d);
+ }
+ }
+ xfree (b);
+ }
+ zfile_fclose (s);
+ }
+ return ret;
+}
\ No newline at end of file