diff options
Diffstat (limited to 'backends/platform/psp/trace.cpp')
-rw-r--r-- | backends/platform/psp/trace.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp index 4bf5450177..7bac6534da 100644 --- a/backends/platform/psp/trace.cpp +++ b/backends/platform/psp/trace.cpp @@ -30,8 +30,9 @@ #include <stdio.h> int psp_debug_indent = 0; +bool firstWriteToFile = true; -void PSPDebugTrace(bool alsoToScreen, const char *format, ...) { +void PspDebugTrace(bool alsoToScreen, const char *format, ...) { va_list opt; char buffer[2048]; int bufsz; @@ -41,8 +42,12 @@ void PSPDebugTrace(bool alsoToScreen, const char *format, ...) { bufsz = vsnprintf(buffer, (size_t) sizeof(buffer), format, opt); va_end(opt); - //fd = fopen("MS0:/SCUMMTRACE.TXT", "ab"); - fd = fopen("SCUMMTRACE.TXT", "ab"); + if (firstWriteToFile) { + fd = fopen("SCUMMTRACE.TXT", "wb"); // erase the file the first time we write + firstWriteToFile = false; + } else { + fd = fopen("SCUMMTRACE.TXT", "ab"); + } if (fd == 0) return; |