return v;
}
-// reject same joystick in parallel ports if it is already in normal ports, AF2008 workaround
-static bool checkjpc (struct uae_prefs *p, int portnum, int idnum)
-{
- if (portnum < 2 || idnum < 0)
- return true;
- for (int i = 0; i < MAX_JPORTS; i++) {
- if (p->jports[i].id == idnum && portnum != i)
- return false;
- }
- return true;
-}
-
int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum, int mode, int type)
{
switch (type)
TCHAR *name1 = idf->get_friendlyname (i);
TCHAR *name2 = idf->get_uniquename (i);
if ((name1 && !_tcscmp (name1, value)) || (name2 && !_tcscmp (name2, value))) {
- if (!checkjpc (p, portnum, idnum + 1))
- return 0;
p->jports[portnum].id = idnum + i;
if (mode >= 0)
p->jports[portnum].mode = mode;
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)txt);
}
} else {
- SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)"");
+ SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)L"");
}
}
WORD weight;
BYTE italic;
BYTE charset;
- WCHAR typeface[0];
+ WCHAR typeface[1];
} DLGTEMPLATEEX_END;
typedef struct {
short cy;
WORD id;
WORD reserved;
- WCHAR windowClass[0];
+ WCHAR windowClass[1];
/* variable data after this */
/* sz_Or_Ord title; */
/* WORD extraCount; */
static TCHAR font_vista[] = L"Segoe UI";
static TCHAR font_xp[] = L"Tahoma";
+static BYTE *skiptextone (BYTE *s)
+{
+ s -= sizeof (WCHAR);
+ if (s[0] == 0xff && s[1] == 0xff) {
+ s += 4;
+ return s;
+ }
+ while (s[0] != 0 || s[1] != 0)
+ s += 2;
+ s += 2;
+ return s;
+}
static BYTE *skiptext (BYTE *s)
{
d2 = (DLGTEMPLATEEX_END*)p;
p2 = p;
p2 += sizeof (DLGTEMPLATEEX_END);
- p2 = skiptext (p2);
+ p2 = skiptextone (p2);
p2 = todword (p2);
modifytemplatefont (d, d2);
p += sizeof (DLGTEMPLATEEX_END);
- p = skiptext (p);
+ p = skiptextone (p);
p = todword (p);
if (p != p2)
dt = (DLGITEMTEMPLATEEX*)p;
modifyitem (d, d2, dt, ns->tmpl, mult);
p += sizeof (DLGITEMTEMPLATEEX);
- p = skiptext(p);
- p = skiptext(p);
+ p = skiptextone (p);
+ p = skiptext (p);
p += ((WORD*)p)[0];
p += sizeof (WORD);
p = todword (p);
void *geteventhandleIPC (void *vipc)
{
struct uaeipc *ipc = (struct uaeipc*)vipc;
+ if (!ipc)
+ return INVALID_HANDLE_VALUE;
return ipc->olevent;
}
BOOL ok;
DWORD ret, err;
+ if (!ipc)
+ return 0;
if (ipc->hipc == INVALID_HANDLE_VALUE)
return 0;
if (WaitForSingleObject(ipc->olevent, 0) != WAIT_OBJECT_0)