mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Move the cdb.vff file creation out of the wx code
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7293 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -63,6 +63,7 @@ Core::GetWindowHandle().
|
||||
#include "HW/GCPad.h"
|
||||
#include "HW/Wiimote.h"
|
||||
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
||||
#include "IPC_HLE/WII_IPC_HLE_Device_FileIO.h"
|
||||
#include "State.h"
|
||||
#include "VolumeHandler.h"
|
||||
#include "NANDContentLoader.h"
|
||||
@ -1310,27 +1311,7 @@ void CFrame::OnLoadWiiMenu(wxCommandEvent& event)
|
||||
{
|
||||
if (event.GetId() == IDM_LOAD_WII_MENU)
|
||||
{
|
||||
const std::string cdbPath = Common::CreateTitleDataPath(TITLEID_SYSMENU) + "/cdb.vff";
|
||||
if (!File::Exists(cdbPath))
|
||||
{
|
||||
// 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
|
||||
u8 cdbHDR[0x20] = {'V', 'F', 'F', 0x20, 0xfe, 0xff, 1, 0, 1, 0x40, 0, 0, 0, 0x20};
|
||||
u8 cdbFAT[4] = {0xf0, 0xff, 0xff, 0xff};
|
||||
FILE * cdbFile = fopen(cdbPath.c_str(), "wb");
|
||||
if (cdbFile)
|
||||
{
|
||||
bool success = true;
|
||||
if (fwrite(cdbHDR, 0x20, 1, cdbFile) != 1) success = false;
|
||||
if (fwrite(cdbFAT, 0x4, 1, cdbFile) != 1) success = false;
|
||||
fseeko(cdbFile, 0x14020, SEEK_SET);
|
||||
if (fwrite(cdbFAT, 0x4, 1, cdbFile) != 1)success = false;
|
||||
fseeko(cdbFile, 0x01400000 - 1, SEEK_SET); // 20 MiB file
|
||||
if (fwrite(cdbHDR+14, 1, 1, cdbFile) != 1) success = false; // write the final 0 to 0 file from the second FAT to 20 MiB
|
||||
fclose(cdbFile);
|
||||
if (!success) File::Delete(cdbPath);
|
||||
}
|
||||
}
|
||||
HLE_IPC_CreateVirtualFATFilesystem();
|
||||
BootGame(Common::CreateTitleContentPath(TITLEID_SYSMENU));
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user