Merge pull request 'Update Slim scancodes for the row unswap' (#20) from calamari/gint-slim:dev into dev

Reviewed-on: https://gitea.planet-casio.com/Lephenixnoir/gint/pulls/20
This commit is contained in:
Lephenixnoir 2022-10-10 00:38:37 +02:00
commit 48db9bf09d
1 changed files with 11 additions and 13 deletions

View File

@ -112,31 +112,31 @@ uint8_t iokbd_row(int row)
}
static const uint16_t SLIM_SC[] = {
0x0940, 0x0920, 0x0910, 0x0908, 0x0904, 0x0902,
0x0840, 0x0820, 0x0810, 0x0808,
0x0940, 0x0920, 0x0910, 0x0908,
0x0840, 0x0820, 0x0810, 0x0808, 0x0804, 0x0802,
0x0740, 0x0720, 0x0710, 0x0708, 0x0704, 0x0702,
0x0640, 0x0620, 0x0610, 0x0608, 0x0604, 0x0602,
0x0540, 0x0520, 0x0510, 0x0508, 0x0504, 0x0502,
0x0440, 0x0420, 0x0410, 0x0408, 0x0404, 0x0402,
0x0340, 0x0320, 0x0310, 0x0308, 0x0304, 0x0302,
0x0240, 0x0220, 0x0210, 0x0208, 0x0204, 0x0202,
0x0101,
0x0020, 0x0010, 0x0008, 0x0004, 0x0002
0x0120, 0x0110, 0x0108, 0x0104, 0x0102,
0x0001
};
#define SCANCODE_COUNT (sizeof(SLIM_SC) / sizeof(uint16_t))
static const uint16_t SLIM_TR[] = {
0x0940, 0x0620, 0x0720, 0x0710, 0x0804, 0x0802,
0x0808, 0x0640, 0x0840, 0x0740,
0x0910, 0x0608, 0x0502, 0x0810, 0x0280, 0x0180,
0x0940, 0x0620, 0x0720, 0x0710, 0x0804, 0x0802,
0x0920, 0x0610, 0x0504, 0x0820, 0x0704, 0x0702,
0x0904, 0x0602, 0x0420, 0x0320, 0x0220, 0x0120,
0x0910, 0x0608, 0x0502, 0x0810, 0x0280, 0x0180,
0x0908, 0x0604, 0x0440, 0x0340, 0x0240, 0x0140,
0x0708, 0x0520, 0x0408, 0x0308, 0x0208, 0x0108,
0x0904, 0x0602, 0x0420, 0x0320, 0x0220, 0x0120,
0x0902, 0x0540, 0x0410, 0x0310, 0x0210, 0x0110,
0x0001,
0x0510, 0x0508, 0x0304, 0x0104, 0x0204
0x0708, 0x0520, 0x0408, 0x0308, 0x0208, 0x0108,
0x0510, 0x0508, 0x0304, 0x0104, 0x0204,
0x0001
};
/* iokbd_scan() - scan ports A/B/M to generate 12 rows of key data */
@ -156,11 +156,9 @@ void iokbd_scan(uint8_t *scan)
scan[i] = 0x00;
}
for(uint i = 0; i < SCANCODE_COUNT; ++i)
{
for(uint i = 0; i < SCANCODE_COUNT; i++)
if(slim_scan[SLIM_SC[i] >> 8] & (SLIM_SC[i] & 0xFF))
scan[SLIM_TR[i] >> 8] |= (SLIM_TR[i] & 0xFF);
}
}
}