Replace pinKeyToLetter with a C implementation, minor cleanup

This commit is contained in:
Aurora
2016-08-29 18:11:59 +02:00
parent 46227e6763
commit abf7c8e565
4 changed files with 6 additions and 9 deletions

View File

@@ -216,7 +216,7 @@ void applyLegacyFirmPatches(u8 *pos, FirmwareType firmType)
void patchTwlBg(u8 *pos)
{
u8 *dst = pos + (isN3DS ? 0xFEA4 : 0xFCA0);
u8 *dst = pos + (isN3DS ? 0xFEA4 : 0xFCA0);
memcpy(dst, twl_k11modules, twl_k11modules_size); //Install K11 hook

View File

@@ -39,7 +39,7 @@ static char pinKeyToLetter(u32 pressed)
const char keys[] = "AB--------XY";
u32 i;
__asm__ volatile("clz %[i], %[pressed]" : [i] "=r" (i) : [pressed] "r" (pressed));
for(i = 31; pressed > 1; i--) pressed /= 2;
return keys[31 - i];
}