Fixed error when trying to read keyboard when there are no chars ready

This commit is contained in:
Dreaded_X 2021-02-01 00:58:00 +01:00
parent 1b093acfe6
commit a729949d4c

View File

@ -489,9 +489,13 @@ class Emulator {
// Input
case 0x1E: {
uint8_t c = e->input.front();
e->input.pop();
return c;
if (e->input.size()) {
uint8_t c = e->input.front();
e->input.pop();
return c;
} else {
return 0x00;
}
}
// Has input