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

Function checkcompakb

src/inputdevice.cpp:7096–7149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7094};
7095
7096static void checkcompakb (int *kb, const int *srcmap)
7097{
7098 int found = 0, avail = 0;
7099 int j, k;
7100
7101 k = j = 0;
7102 while (kb[j] >= 0) {
7103 struct uae_input_device *uid = &keyboards[0];
7104 while (kb[j] >= 0 && srcmap[k] >= 0) {
7105 int id = kb[j];
7106 for (int l = 0; l < MAX_INPUT_DEVICE_EVENTS; l++) {
7107 if (uid->extra[l] == id) {
7108 avail++;
7109 if (uid->eventid[l][0] == srcmap[k])
7110 found++;
7111 break;
7112 }
7113 }
7114 j++;
7115 }
7116 if (srcmap[k] < 0)
7117 break;
7118 j++;
7119 k++;
7120 }
7121 if (avail != found || avail == 0)
7122 return;
7123 k = j = 0;
7124 while (kb[j] >= 0) {
7125 struct uae_input_device *uid = &keyboards[0];
7126 while (kb[j] >= 0) {
7127 int id = kb[j];
7128 k = 0;
7129 while (keyboard_default[k].scancode >= 0) {
7130 if (keyboard_default[k].scancode == kb[j]) {
7131 for (int l = 0; l < MAX_INPUT_DEVICE_EVENTS; l++) {
7132 if (uid->extra[l] == id && uid->port[l][0] == 0) {
7133 for (int m = 0; m < MAX_INPUT_SUB_EVENT && keyboard_default[k].node[m].evt; m++) {
7134 uid->eventid[l][m] = keyboard_default[k].node[m].evt;
7135 uid->port[l][m] = 0;
7136 uid->flags[l][m] = 0;
7137 }
7138 break;
7139 }
7140 }
7141 break;
7142 }
7143 k++;
7144 }
7145 j++;
7146 }
7147 j++;
7148 }
7149}
7150
7151static void inputdevice_sparerestore (struct uae_input_device *uid, int num, int sub)
7152{

Callers 1

compatibility_copyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected