about summary refs log tree commit diff stats
path: root/src/core.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-14 17:36:45 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-14 17:36:45 +0200
commit9fa43f2386b6ee9370e69eda7f8023cf857f0bb9 (patch)
treedbb81791df55192dea635e4e7b26b37c1949c8ba /src/core.c
parentf2397256e2942500f6a7577c103bdb6fb3a98ac7 (diff)
downloadbox64-9fa43f2386b6ee9370e69eda7f8023cf857f0bb9.tar.gz
box64-9fa43f2386b6ee9370e69eda7f8023cf857f0bb9.zip
Added a hack so program that wprintf to the console actualy work if box64 already printed something
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 91223596..2e91eef2 100644
--- a/src/core.c
+++ b/src/core.c
@@ -46,6 +46,7 @@ int box64_exit_code = 0;
 int box64_log = LOG_INFO; //LOG_NONE;
 int box64_dump = 0;
 int box64_nobanner = 0;
+int box64_stdout_no_w = 0;
 int box64_dynarec_log = LOG_NONE;
 uintptr_t box64_pagesize;
 uintptr_t box64_load_addr = 0;
@@ -252,8 +253,10 @@ void openFTrace(const char* newtrace)
                 ftrace_name = strdup(p);
                 /*fclose(ftrace);
                 ftrace = NULL;*/
-                if(!box64_nobanner)
+                if(!box64_nobanner) {
                     printf("BOX64 Trace %s to \"%s\"\n", append?"appended":"redirected", p);
+                    box64_stdout_no_w = 1;
+                }
                 PrintBox64Version();
             }
         }
@@ -611,6 +614,8 @@ void LoadLogEnv()
         if(!box64_nobanner)
             printf_log(LOG_INFO, "Debug level is %d\n", box64_log);
     }
+    if((box64_nobanner || box64_log) && ftrace==stdout)
+        box64_stdout_no_w = 1;
 
 #if !defined(DYNAREC) && (defined(ARM64) || defined(RV64) || defined(LA64))
     printf_log(LOG_INFO, "Warning: DynaRec is available on this host architecture, an interpreter-only build is probably not intended.\n");