From 12b7d3674f006d1916cc3df49938dd9b61b78e2c Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 25 May 2024 14:18:24 +0300 Subject: Make it render regularly while idling --- emulator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'emulator.cpp') 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); -- cgit v1.2.3