From 25cab8195f827e1cd531128e302b50d9ad05bdf6 Mon Sep 17 00:00:00 2001 From: harry Date: Tue, 26 Mar 2024 20:20:01 -0400 Subject: [PATCH] Bug fix for Qt win64 netplay, make sure rom files are opened in binary mode. --- src/drivers/Qt/NetPlay.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/Qt/NetPlay.cpp b/src/drivers/Qt/NetPlay.cpp index 2898471f..158e1fbe 100644 --- a/src/drivers/Qt/NetPlay.cpp +++ b/src/drivers/Qt/NetPlay.cpp @@ -343,7 +343,7 @@ int NetPlayServer::sendRomLoadReq( NetPlayClient *client ) return -1; } printf("Prep ROM Load Request: %s \n", filepath ); - FILE *fp = ::fopen( filepath, "r"); + FILE *fp = ::fopen( filepath, "rb"); if (fp == nullptr) { @@ -722,7 +722,7 @@ void NetPlayServer::serverProcessMessage( NetPlayClient *client, void *msgBuf, s printf("Load ROM Request Received: %s\n", filepath.c_str()); //printf("Dumping Temp Rom to: %s\n", filepath.c_str()); - fp = ::fopen( filepath.c_str(), "w"); + fp = ::fopen( filepath.c_str(), "wb"); if (fp == nullptr) { @@ -1201,7 +1201,7 @@ int NetPlayClient::requestRomLoad( const char *romPath ) QFileInfo fi( romPath ); printf("Prep ROM Load Request: %s \n", romPath ); - FILE *fp = ::fopen( romPath, "r"); + FILE *fp = ::fopen( romPath, "rb"); if (fp == nullptr) { @@ -1497,7 +1497,7 @@ void NetPlayClient::clientProcessMessage( void *msgBuf, size_t msgSize ) FCEU_printf("Load ROM Request Received: %s\n", filepath.c_str()); //printf("Dumping Temp Rom to: %s\n", filepath.c_str()); - fp = ::fopen( filepath.c_str(), "w"); + fp = ::fopen( filepath.c_str(), "wb"); if (fp == nullptr) {