]> git.sesse.net Git - pistorm/commitdiff
Disable keyboard input for now
authorbeeanyew <Bjorn Astrom>
Fri, 4 Dec 2020 07:35:22 +0000 (08:35 +0100)
committerbeeanyew <Bjorn Astrom>
Fri, 4 Dec 2020 07:35:22 +0000 (08:35 +0100)
Apparently termios performance is terrible. Should probably be in a thread non-blocked by the CPU emulation as well.

emulator.c
input/input.c

index 23e83b8eecf22eeeffed8216e5e191a105206a60..dbd4096b45adebfaf660442d7967910c3828ef0d 100644 (file)
@@ -361,6 +361,7 @@ int main(int argc, char *argv[]) {
     if (cpu_emulation_running)
       m68k_execute(loop_cycles);
     
+    // FIXME: Rework this to use keyboard events instead.
     /*while (kbhit()) {
       char c = getchar();
       if (c == cfg->keyboard_toggle_key && !kb_hook_enabled) {
index 0a7f53de4c4ac3020ec810c31092126ec5653dae..b0274e34366f08f4d6cb0aebb2467897e3a76d73 100644 (file)
@@ -4,19 +4,7 @@
 
 int kbhit()
 {
-  struct termios term;
-  tcgetattr(0, &term);
-
-  struct termios term2 = term;
-  term2.c_lflag &= ~ICANON;
-  tcsetattr(0, TCSANOW, &term2);
-
-  int byteswaiting;
-  ioctl(0, FIONREAD, &byteswaiting);
-
-  tcsetattr(0, TCSANOW, &term);
-
-  return byteswaiting > 0;
+  return 0;
 }
 
 extern int mouse_fd;