Skip to content
Snippets Groups Projects
Commit 30b7b398 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Heh, fix codes over 255 as well.

parent 357a25b9
No related branches found
No related tags found
No related merge requests found
Pipeline #8078 passed
......@@ -8,8 +8,8 @@
#include "libretro.h"
#define KEYBUFSIZE 32
static uint16_t keybuf[KEYBUFSIZE];
#define KEYBUFSIZE 128
static uint8_t keybuf[KEYBUFSIZE];
static size_t keybufremove = 0;
static size_t keybufadd = 0;
static size_t keybuffill = 0;
......@@ -153,9 +153,13 @@ retro_keyboard(bool down, unsigned keycode, uint32_t character, uint16_t key_mod
}
}
}
if (add) {
keybuf[keybufadd++] = add;
if (add && keybuffill < KEYBUFSIZE - 2) {
keybuf[keybufadd++] = add & 0xff;
keybuffill++;
if (add > 255) {
keybuf[keybufadd++] = add >> 8;
keybuffill++;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment