Boot: Move CreateVirtualFATFilesystem to Boot_WiiWAD

It has nothing to do in the filesystem code.

(It also smells like a workaround for some kind of timing issue.)
This commit is contained in:
Léo Lam
2018-03-03 19:35:46 +01:00
parent fcfe4e2a26
commit 78478a651d
3 changed files with 38 additions and 44 deletions

View File

@ -16,7 +16,6 @@
#include "Common/File.h"
#include "Common/FileUtil.h"
#include "Common/NandPaths.h"
#include "Core/CommonTitles.h"
#include "Core/HW/Memmap.h"
#include "Core/IOS/IOS.h"
@ -37,41 +36,6 @@ std::string BuildFilename(const std::string& wii_path)
return nand_path;
}
void CreateVirtualFATFilesystem()
{
const int cdbSize = 0x01400000;
const std::string cdbPath =
Common::GetTitleDataPath(Titles::SYSTEM_MENU, Common::FROM_SESSION_ROOT) + "cdb.vff";
if ((int)File::GetSize(cdbPath) < cdbSize)
{
// cdb.vff is a virtual Fat filesystem created on first launch of sysmenu
// we create it here as it is faster ~3 minutes for me when sysmenu does it ~1 second created
// here
const u8 cdbHDR[0x20] = {'V', 'F', 'F', 0x20, 0xfe, 0xff, 1, 0, 1, 0x40, 0, 0, 0, 0x20};
const u8 cdbFAT[4] = {0xf0, 0xff, 0xff, 0xff};
File::IOFile cdbFile(cdbPath, "wb");
if (cdbFile)
{
cdbFile.WriteBytes(cdbHDR, 0x20);
cdbFile.WriteBytes(cdbFAT, 0x4);
cdbFile.Seek(0x14020, SEEK_SET);
cdbFile.WriteBytes(cdbFAT, 0x4);
// 20 MiB file
cdbFile.Seek(cdbSize - 1, SEEK_SET);
// write the final 0 to 0 file from the second FAT to 20 MiB
cdbFile.WriteBytes(cdbHDR + 14, 1);
if (!cdbFile.IsGood())
{
cdbFile.Close();
File::Delete(cdbPath);
}
cdbFile.Flush();
cdbFile.Close();
}
}
}
namespace Device
{
FileIO::FileIO(Kernel& ios, const std::string& device_name)

View File

@ -23,7 +23,6 @@ namespace IOS
namespace HLE
{
std::string BuildFilename(const std::string& wii_path);
void CreateVirtualFATFilesystem();
namespace Device
{