From 286b6448be332458c79f299736bb196ccc653659 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 21 May 2021 14:57:18 +0100 Subject: [PATCH] DEV9: Always open HDD image as binary Previously the file was only opened in binary mode if it existed before starting emulation --- pcsx2/DEV9/ATA/ATA_State.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pcsx2/DEV9/ATA/ATA_State.cpp b/pcsx2/DEV9/ATA/ATA_State.cpp index ecdfc78be4..6a42aefbc7 100644 --- a/pcsx2/DEV9/ATA/ATA_State.cpp +++ b/pcsx2/DEV9/ATA/ATA_State.cpp @@ -34,9 +34,7 @@ int ATA::Open(ghc::filesystem::path hddPath) CreateHDDinfo(config.HddSize); //Open File - if (ghc::filesystem::exists(hddPath)) - hddImage = ghc::filesystem::fstream(hddPath, std::ios::in | std::ios::out | std::ios::binary); - else + if (!ghc::filesystem::exists(hddPath)) { HddCreate hddCreator; hddCreator.filePath = hddPath; @@ -45,9 +43,8 @@ int ATA::Open(ghc::filesystem::path hddPath) if (hddCreator.errored) return -1; - - hddImage = ghc::filesystem::fstream(hddPath); } + hddImage = ghc::filesystem::fstream(hddPath, std::ios::in | std::ios::out | std::ios::binary); //Store HddImage size for later check hddImage.seekg(0, std::ios::end);