DEV9: Always open HDD image as binary

Previously the file was only opened in binary mode if it existed before starting emulation
This commit is contained in:
TheLastRar 2021-05-21 14:57:18 +01:00 committed by lightningterror
parent 48961ed3df
commit 286b6448be
1 changed files with 2 additions and 5 deletions

View File

@ -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);