diff options
author | Oxore <oxore@protonmail.com> | 2024-05-25 14:18:24 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2024-05-25 15:01:47 +0300 |
commit | 12b7d3674f006d1916cc3df49938dd9b61b78e2c (patch) | |
tree | edd3da6f5a2b99740fdf98027020fad9e22d90d2 /emulator.cpp | |
parent | e2c2cabaece87279a69b4e8e0c0929bbef178078 (diff) |
Make it render regularly while idling
Diffstat (limited to 'emulator.cpp')
-rw-r--r-- | emulator.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/emulator.cpp b/emulator.cpp index 0fb50dd..7dab3af 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -532,8 +532,10 @@ static int emulator(M68KDebuggingControl& m68k_debug, Graphics& graphics, CharDe } else { struct pollfd fds[1] = { {/*.fd = */socket_fd, /*.events = */POLLIN, /*.revents = */0}}; - const int timeout_msecs = 30; - poll(fds, 1, timeout_msecs); + const int timeout_msecs = 200; + if (0 == poll(fds, 1, timeout_msecs)) { + graphics.ReRender(); + } } continue; } @@ -578,8 +580,10 @@ static int emulator(M68KDebuggingControl& m68k_debug, Graphics& graphics, CharDe } else if (err == EWOULDBLOCK) { struct pollfd fds[1] = { {/*.fd = */conn_fd, /*.events = */POLLIN, /*.revents = */0}}; - const int timeout_msecs = 30; - poll(fds, 1, timeout_msecs); + const int timeout_msecs = 200; + if (0 == poll(fds, 1, timeout_msecs)) { + graphics.ReRender(); + } } } close(conn_fd); |