diff --git a/src/drivers/Qt/MsgLogViewer.cpp b/src/drivers/Qt/MsgLogViewer.cpp index 498b2518..f29fc0cd 100644 --- a/src/drivers/Qt/MsgLogViewer.cpp +++ b/src/drivers/Qt/MsgLogViewer.cpp @@ -24,6 +24,10 @@ #include #include +#ifdef WIN32 +#include +#endif + #include #include #include @@ -44,9 +48,21 @@ class msgLogBuf_t public: msgLogBuf_t(void) { - char filename[256]; + char filename[512]; + #ifdef WIN32 + if ( GetTempPathA( sizeof(filename), filename ) > 0 ) + { + //printf("PATH: %s \n", filename ); + strcat( filename, "fceux.log"); + } + else + { + strcpy( filename, "fceux.log" ); + } + #else strcpy( filename, "/tmp/fceux.log" ); + #endif fp = ::fopen( filename, "w+");