From a729949d4c0789b9350f64950bc2e8849364d906 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Mon, 1 Feb 2021 00:58:00 +0100 Subject: [PATCH] Fixed error when trying to read keyboard when there are no chars ready --- src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 78be83d..cf72bd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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