From ddf15234f2a1cb27cb15597f4c07088ca646b959 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 28 Aug 2021 00:45:35 +0600 Subject: [PATCH] Implement pause command --- src/unix/unix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/unix/unix.c b/src/unix/unix.c index c3294aeb7..4051d5de2 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -647,7 +647,22 @@ char *local_strsep(char **str, const char *sep) return s; } +void +plat_pause(int p) +{ + static wchar_t oldtitle[512]; + wchar_t title[512]; + dopause = p; + if (p) { + wcsncpy(oldtitle, ui_window_title(NULL), sizeof_w(oldtitle) - 1); + wcscpy(title, oldtitle); + wcscat(title, L" - PAUSED -"); + ui_window_title(title); + } else { + ui_window_title(oldtitle); + } +} void monitor_thread(void* param) { @@ -683,6 +698,10 @@ void monitor_thread(void* param) { exit_event = 1; } + else if (strncasecmp(xargv[0], "pause", 5) == 0) + { + plat_pause(dopause ^ 1); + } else if (strncasecmp(xargv[0], "hardreset", 9) == 0) { pc_reset_hard();