From d27753796e2085f0129818779b886f6c23cebdb2 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Mon, 2 May 2011 05:02:18 +0000 Subject: [PATCH] only create the data directory for a title, not data/nocopy. fixes issue 4453 fs::open does not need to create the data directory, es_diVerify does that. change applied to CBoot::Boot_WiiWAD as well (es_diVerify isn't used for wads). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7503 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp | 13 +++--------- .../Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp | 20 ------------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp index 3646678f87..4f5af5cfdb 100644 --- a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp @@ -29,6 +29,7 @@ #include "Boot_DOL.h" #include "Volume.h" #include "VolumeCreator.h" +#include "CommonPaths.h" bool CBoot::IsWiiWAD(const char *filename) @@ -42,15 +43,8 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename) if (!ContentLoader.IsValid()) return false; - // create Home directory - char Path[260+1]; - u64 TitleID = ContentLoader.GetTitleID(); - char* pTitleID = (char*)&TitleID; - sprintf(Path, "%stitle/%02x%02x%02x%02x/%02x%02x%02x%02x/data/nocopy/", - File::GetUserPath(D_WIIUSER_IDX).c_str(), - (u8)pTitleID[7], (u8)pTitleID[6], (u8)pTitleID[5], (u8)pTitleID[4], - (u8)pTitleID[3], (u8)pTitleID[2], (u8)pTitleID[1], (u8)pTitleID[0]); - File::CreateFullPath(Path); + // create data directory + File::CreateFullPath(Common::CreateTitleDataPath(ContentLoader.GetTitleID()) + DIR_SEP); // setup wii mem if (!SetupWiiMemory(ContentLoader.GetCountry())) @@ -85,7 +79,6 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename) return true; } - u64 CBoot::Install_WiiWAD(const char* _pFilename) { if (!IsWiiWAD(_pFilename)) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp index 759688a674..7e73369513 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp @@ -51,26 +51,6 @@ bool CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode) File::CreateDir(Path.c_str()); } - // create home directory - if (VolumeHandler::IsValid()) - { - char Path[260+1]; - u32 TitleID, GameID; - VolumeHandler::RAWReadToPtr((u8*)&TitleID, 0x0F8001DC, 4); - - TitleID = Common::swap32(TitleID); - GameID = VolumeHandler::Read32(0); - - _dbg_assert_(WII_IPC_FILEIO, GameID != 0); - if (GameID == 0) GameID = 0xF00DBEEF; - if (TitleID == 0) TitleID = 0x00010000; - - snprintf(Path, sizeof(Path), "%stitle/%08x/%08x/data/nocopy/", - File::GetUserPath(D_WIIUSER_IDX).c_str(), TitleID, GameID); - - File::CreateFullPath(Path); - } - Memory::Write_U32(GetDeviceID(), _CommandAddress+4); m_Active = true; return true;