Remove obsolete CWIID driver support and guest pairing.

This commit is contained in:
sorgelig
2021-08-17 05:31:59 +08:00
parent f079816f69
commit 110fdaca7e
2 changed files with 2 additions and 94 deletions

View File

@@ -844,7 +844,6 @@ uint32_t get_key_mod()
enum QUIRK
{
QUIRK_NONE = 0,
QUIRK_CWIID,
QUIRK_WIIMOTE,
QUIRK_DS3,
QUIRK_DS4,
@@ -2724,11 +2723,6 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
int hrange = (absinfo->maximum - absinfo->minimum) / 2;
int dead = hrange/63;
if (input[sub_dev].quirk == QUIRK_CWIID)
{
if(ev->code == 3 || ev->code == 4) dead = 10;
}
if (input[sub_dev].quirk == QUIRK_DS3 || input[sub_dev].quirk == QUIRK_DS4)
{
dead = 10;
@@ -3639,12 +3633,6 @@ int input_test(int getchar)
}
}
if (strcasestr(input[n].name, "Wiimote") && input[n].vid == 1 && input[n].pid == 1)
{
input[n].quirk = QUIRK_CWIID;
input[n].lightgun = 1;
}
// RasPad3 touchscreen
if (input[n].vid == 0x222a && input[n].pid == 1)
{
@@ -4017,15 +4005,6 @@ int input_test(int getchar)
}
else continue;
}
if (input[i].quirk == QUIRK_CWIID)
{
if (ev.code == 3 || ev.code == 4)
{
absinfo.minimum = 30;
absinfo.maximum = 225;
}
}
}
if (input[dev].quirk == QUIRK_VCS && !vcs_proc(i, &ev)) continue;
@@ -4159,15 +4138,6 @@ int input_test(int getchar)
}
}
if (input[i].quirk == QUIRK_CWIID && ev.type == EV_ABS)
{
if (ev.code <= 1 && user_io_osd_is_visible())
{
// don't pass IR tracking to OSD
continue;
}
}
if (ev.type == EV_ABS && input[i].quirk == QUIRK_WIIMOTE && input[dev].lightgun)
{
menu_lightgun_cb(i, ev.type, ev.code, ev.value);

View File

@@ -105,8 +105,6 @@ enum MENU
MENU_KBDMAP,
MENU_KBDMAP1,
MENU_BTPAIR,
MENU_WMPAIR,
MENU_WMPAIR1,
MENU_LGCAL,
MENU_LGCAL1,
MENU_LGCAL2,
@@ -607,40 +605,6 @@ static uint32_t menu_key_get(void)
return(c);
}
static int has_bt()
{
return hci_get_route(0) >= 0;
}
static int toggle_wminput()
{
if (access("/bin/wminput", F_OK) < 0 || access("/media/fat/linux/wiimote.cfg", F_OK) < 0) return -1;
FILE *fp;
static char out[1035];
fp = popen("pidof wminput", "r");
if (!fp) return -1;
int ret = -1;
if (fgets(out, sizeof(out) - 1, fp) != NULL)
{
if (strlen(out))
{
system("killall wminput");
ret = 0;
}
}
else
{
system("taskset 1 wminput --daemon --config /media/fat/linux/wiimote.cfg &");
ret = 1;
}
pclose(fp);
return ret;
}
static char* getNet(int spec)
{
int netType = 0;
@@ -1117,11 +1081,7 @@ void HandleUI(void)
break;
case KEY_F10:
if (user_io_osd_is_visible() && !access("/bin/wminput", F_OK))
{
menustate = MENU_WMPAIR;
}
else if (input_has_lightgun())
if (input_has_lightgun())
{
menustate = MENU_LGCAL;
}
@@ -5842,28 +5802,6 @@ void HandleUI(void)
menusub = 0;
break;
case MENU_WMPAIR:
{
OsdSetTitle("Wiimote", 0);
int res = toggle_wminput();
menu_timer = GetTimer(2000);
for (int i = 0; i < OsdGetSize(); i++) OsdWrite(i);
if (res < 0) OsdWrite(7, " Cannot enable Wiimote");
else if (res == 0) OsdWrite(7, " Wiimote disabled");
else
{
OsdWrite(7, " Wiimote enabled");
OsdWrite(9, " Press 1+2 to connect");
menu_timer = GetTimer(3000);
}
menustate = MENU_WMPAIR1;
}
//fall through
case MENU_WMPAIR1:
if (CheckTimer(menu_timer)) menustate = MENU_NONE1;
break;
case MENU_LGCAL:
helptext_idx = 0;
OsdSetTitle("Lightgun Calibration", 0);
@@ -6271,7 +6209,7 @@ void HandleUI(void)
int netType = (int)getNet(0);
if (netType) str[8] = 0x1b + netType;
if (has_bt()) str[9] = 4;
if (hci_get_route(0) >= 0) str[9] = 4;
if (user_io_get_sdram_cfg() & 0x8000)
{
switch (user_io_get_sdram_cfg() & 7)