Add a mode to use a dummy Wii NAND.

Eventually, netplay will be able to use the host's NAND, but this could
still be useful in some cases; for TAS it definitely makes sense to have
a way to avoid using any preexisting NAND.

In terms of implementation: remove D_WIIUSER_IDX, which was just WIIROOT
+ "/", as well as some other indices which are pointless to have as
separate variables rather than just using the actual path (fixed, since
they're actual Wii NAND paths) at the call site.  Then split off
D_SESSION_WIIROOT_IDX, which can point to the dummy NAND directory, from
D_WIIROOT_IDX, which always points to the "real" one the user
configured.
This commit is contained in:
comex
2014-11-17 20:59:14 -05:00
parent f6c6822f71
commit dc91e8b607
23 changed files with 127 additions and 59 deletions

View File

@ -35,7 +35,7 @@ void CSharedContent::UpdateLocation()
{
m_Elements.clear();
m_lastID = 0;
m_contentMap = StringFromFormat("%sshared1/content.map", File::GetUserPath(D_WIIUSER_IDX).c_str());
m_contentMap = StringFromFormat("%s/shared1/content.map", File::GetUserPath(D_WIIROOT_IDX).c_str());
File::IOFile pFile(m_contentMap, "rb");
SElement Element;
@ -55,7 +55,7 @@ std::string CSharedContent::GetFilenameFromSHA1(const u8* _pHash)
{
if (memcmp(_pHash, Element.SHA1Hash, 20) == 0)
{
return StringFromFormat("%sshared1/%c%c%c%c%c%c%c%c.app", File::GetUserPath(D_WIIUSER_IDX).c_str(),
return StringFromFormat("%s/shared1/%c%c%c%c%c%c%c%c.app", File::GetUserPath(D_WIIROOT_IDX).c_str(),
Element.FileName[0], Element.FileName[1], Element.FileName[2], Element.FileName[3],
Element.FileName[4], Element.FileName[5], Element.FileName[6], Element.FileName[7]);
}
@ -80,7 +80,7 @@ std::string CSharedContent::AddSharedContent(const u8* _pHash)
File::IOFile pFile(m_contentMap, "ab");
pFile.WriteArray(&Element, 1);
filename = StringFromFormat("%sshared1/%s.app", File::GetUserPath(D_WIIUSER_IDX).c_str(), id.c_str());
filename = StringFromFormat("%s/shared1/%s.app", File::GetUserPath(D_WIIROOT_IDX).c_str(), id.c_str());
m_lastID++;
}
@ -371,7 +371,7 @@ void cUIDsys::UpdateLocation()
{
m_Elements.clear();
m_lastUID = 0x00001000;
m_uidSys = StringFromFormat("%ssys/uid.sys", File::GetUserPath(D_WIIUSER_IDX).c_str());
m_uidSys = File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/sys/uid.sys";
File::IOFile pFile(m_uidSys, "rb");
SElement Element;