Revision: 45738
http://sourceforge.net/p/vice-emu/code/45738
Author: gpz
Date: 2025-08-22 18:03:48 +0000 (Fri, 22 Aug 2025)
Log Message:
-----------
init vte_console.console_cannot_output with 0 once the window was created, and set mon_console_suspend_on_leaving to 0 when leaving the monitor with 'g'. should fix #2158
Modified Paths:
--------------
trunk/vice/src/arch/gtk3/uimon.c
trunk/vice/src/arch/shared/console_unix.c
trunk/vice/src/monitor/mon_util.c
trunk/vice/src/monitor/monitor.c
Modified: trunk/vice/src/arch/gtk3/uimon.c
===================================================================
--- trunk/vice/src/arch/gtk3/uimon.c 2025-08-18 13:33:45 UTC (rev 45737)
+++ trunk/vice/src/arch/gtk3/uimon.c 2025-08-22 18:03:48 UTC (rev 45738)
@@ -81,6 +81,14 @@
#include "widgethelpers.h"
#include "uidata.h"
+/*#define DEBUG_UIMON*/
+
+#ifdef DEBUG_UIMON
+#define DBG(x) log_printf
+#else
+#define DBG(x)
+#endif
+
static gboolean uimon_window_open_impl(gpointer user_data);
static gboolean uimon_window_resume_impl(gpointer user_data);
@@ -1376,6 +1384,7 @@
NULL);
vte_console.console_can_stay_open = 1;
+ vte_console.console_cannot_output = 0;
uimon_set_font();
} else {
Modified: trunk/vice/src/arch/shared/console_unix.c
===================================================================
--- trunk/vice/src/arch/shared/console_unix.c 2025-08-18 13:33:45 UTC (rev 45737)
+++ trunk/vice/src/arch/shared/console_unix.c 2025-08-22 18:03:48 UTC (rev 45738)
@@ -46,7 +46,14 @@
#include "lib/linenoise-ng/linenoise.h"
+/*#define DEBUG_CONSOLE*/
+#ifdef DEBUG_CONSOLE
+#define DBG(x) log_printf
+#else
+#define DBG(x)
+#endif
+
typedef struct console_private_s {
FILE *input;
FILE *output;
@@ -98,6 +105,9 @@
console->console_can_stay_open = 1;
console->console_cannot_output = 0;
+ DBG(("native_console_open console:%p console_can_stay_open:%d console_cannot_output:%d",
+ console, console->console_can_stay_open, console->console_cannot_output));
+
return console;
exitnull:
Modified: trunk/vice/src/monitor/mon_util.c
===================================================================
--- trunk/vice/src/monitor/mon_util.c 2025-08-18 13:33:45 UTC (rev 45737)
+++ trunk/vice/src/monitor/mon_util.c 2025-08-22 18:03:48 UTC (rev 45738)
@@ -49,10 +49,18 @@
#include "uimon.h"
#include "vsyncapi.h"
+/*#define DEBUG_MONUTIL*/
+
+#ifdef DEBUG_MONUTIL
+#define DBG(x) log_printf
+#else
+#define DBG(x)
+#endif
+
static char *bigbuffer = NULL;
static const unsigned int bigbuffersize = 10000;
static unsigned int bigbufferwrite = 0;
-static unsigned int bigbuffermode = 0; /* 0: ascii, 1: petscii, 2: scrcode */
+static unsigned int bigbuffermode = 0; /* 0: ascii, 1: petscii, 2: scrcode, 3: petscii (uppercase), 4: scrcode (uppercase) */
static FILE *mon_log_file = NULL;
@@ -188,6 +196,9 @@
int rv = 0;
int len;
+ DBG(("console_log:%p console_cannot_output:%d",
+ console_log, console_log ? console_log->console_cannot_output : -1));
+
if (!console_log || console_log->console_cannot_output) {
if (mode != bigbuffermode) {
Modified: trunk/vice/src/monitor/monitor.c
===================================================================
--- trunk/vice/src/monitor/monitor.c 2025-08-18 13:33:45 UTC (rev 45737)
+++ trunk/vice/src/monitor/monitor.c 2025-08-22 18:03:48 UTC (rev 45738)
@@ -93,6 +93,14 @@
#include "video.h"
#include "vsync.h"
+/*#define DEBUG_MONITOR*/
+
+#ifdef DEBUG_MONITOR
+#define DBG(x) log_printf
+#else
+#define DBG(x)
+#endif
+
/*
INITBREAK switched to a break point so that the first instruction doesn't
run when '-initbreak reset' is used.
@@ -161,6 +169,7 @@
* different from what keep_monitor_open does :)
*/
static int mon_console_suspend_on_leaving = 1;
+
/* flag used by the eXit command. it will force the monitor to close regardless
* of keep_monitor_open.
*/
@@ -989,6 +998,7 @@
void mon_go(void)
{
exit_mon = 1;
+ mon_console_suspend_on_leaving = 0;
if (should_pause_on_exit_mon || ui_pause_active()) {
should_pause_on_exit_mon = false;
@@ -3043,7 +3053,8 @@
mon_console_close_on_leaving = 0;
if (console_mode) {
- /* Shitty hack. We should support the console size etc. */
+ /* Shitty hack. We should support the console size etc.
+ NOTE: this is (only) for the case when VICE runs in console mode (-console) */
static console_t console_log_console = { TTY_COLUMNS, TTY_ROWS, 0, 0, NULL };
console_log = &console_log_console;
} else if (monitor_is_remote() || monitor_is_binary()) {
@@ -3058,6 +3069,7 @@
uimon_set_interface(mon_interfaces, NUM_MEMSPACES);
}
}
+ DBG(("monitor_open console_mode:%d console_log:%p", console_mode, console_log));
if (console_log == NULL) {
log_error(LOG_DEFAULT, "monitor_open: could not open monitor console.");
@@ -3235,7 +3247,7 @@
last_cmd = cmd;
}
- uimon_notify_change(); /* @SRT */
+ uimon_notify_change();
return exit_mon;
}
@@ -3283,6 +3295,7 @@
console_log = NULL;
}
+ DBG(("monitor_close console_log:%p", console_log));
vsync_suspend_speed_eval();
}
@@ -3291,6 +3304,8 @@
char prompt[40];
char *p;
+ DBG(("monitor_startup console_log:%p", console_log));
+
if (inside_monitor) {
/*
* Drive cpu interrupt can enter the monitor .. and then the monitor
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|