MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / remove_compa_config

Function remove_compa_config

src/inputdevice.cpp:7346–7381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7344}
7345
7346static void remove_compa_config (struct uae_prefs *prefs, int index)
7347{
7348 int typelist;
7349 const int *atpp;
7350 int inputlist[MAX_COMPA_INPUTLIST];
7351
7352 if (inputdevice_get_compatibility_input (prefs, index, &typelist, inputlist, &atpp) <= 0)
7353 return;
7354 for (int i = 0; inputlist[i] >= 0; i++) {
7355 int evtnum = inputlist[i];
7356 const int *atp = atpp;
7357
7358 int atpidx = 0;
7359 while (*atp >= 0) {
7360 if (*atp == evtnum) {
7361 atp++;
7362 atpidx = 2;
7363 break;
7364 }
7365 if (atp[1] == evtnum || atp[2] == evtnum) {
7366 atpidx = 1;
7367 break;
7368 }
7369 atp += 3;
7370 }
7371 while (atpidx >= 0) {
7372 for (int l = 0; l < MAX_INPUT_DEVICES; l++) {
7373 clearevent (&prefs->joystick_settings[GAMEPORT_INPUT_SETTINGS][l], evtnum);
7374 clearevent (&prefs->mouse_settings[GAMEPORT_INPUT_SETTINGS][l], evtnum);
7375 clearkbrevent (&prefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS][l], evtnum);
7376 }
7377 evtnum = *atp++;
7378 atpidx--;
7379 }
7380 }
7381}
7382
7383static void cleardev_custom (struct uae_input_device *uid, int num, int index)
7384{

Callers 3

inputdevice_compa_clearFunction · 0.85
compatibility_copyFunction · 0.85

Calls 3

cleareventFunction · 0.85
clearkbreventFunction · 0.85

Tested by

no test coverage detected