summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-04-16 23:14:36 -0400
committerLioncash <mathew1800@gmail.com>2013-04-16 23:14:36 -0400
commit2316cb6876e6d79584ce0cc50771d2fb8495fe45 (patch)
tree325aefd07068f7163d5616347cec36e6fac5754e /Source/Core/DiscIO
parentf4986862892d437bfcd1cc475ebe7af97c6923d8 (diff)
Remove all tab/space mismatches from the Core project. For anyone working on a branch that heavily involves the core, I am so sorry.
- Also killed off some trailing spaces/tabs. - Updated the license header to be consistent with the rest of the project (All projects are now done moving over to this) - Also, killed some dangling else's (where appropriate) Now all the tab fixing is done. No more of this crap should be needed to be pushed. Rejoice!
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/Src/FileMonitor.cpp19
-rw-r--r--Source/Core/DiscIO/Src/NANDContentLoader.cpp17
-rw-r--r--Source/Core/DiscIO/Src/NANDContentLoader.h2
-rw-r--r--Source/Core/DiscIO/Src/VolumeCommon.cpp2
-rw-r--r--Source/Core/DiscIO/Src/VolumeDirectory.cpp2
-rw-r--r--Source/Core/DiscIO/Src/WiiWad.cpp5
6 files changed, 30 insertions, 17 deletions
diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp
index 465784fe8f..ad83c95a22 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.cpp
+++ b/Source/Core/DiscIO/Src/FileMonitor.cpp
@@ -46,7 +46,7 @@ bool ShowSound(std::string FileName)
SplitPath(FileName, NULL, NULL, &Ending);
std::transform(Ending.begin(),Ending.end(),Ending.begin(),::tolower);
- if (
+ if (
(Ending == ".adp") // 1080 Avalanche, Crash Bandicoot, etc
|| (Ending == ".afc") // Zelda WW
|| (Ending == ".ast") // Zelda TP, Mario Kart
@@ -76,6 +76,7 @@ void ReadGC(std::string FileName)
delete pFileSystem;
pFileSystem = NULL;
}
+
// GCFiles' pointers are no longer valid after pFileSystem is cleared
GCFiles.clear();
OpenISO = DiscIO::CreateVolumeFromFilename(FileName);
@@ -99,7 +100,9 @@ void CheckFile(std::string File, u64 Size)
if (CurrentFile == File)
return;
- if (Size > 0) Size = (Size / 1000);
+ if (Size > 0)
+ Size = (Size / 1000);
+
std::string Str = StringFromFormat("%s kB %s", ThousandSeparate(Size, 7).c_str(), File.c_str());
if (ShowSound(File))
{
@@ -119,10 +122,16 @@ void CheckFile(std::string File, u64 Size)
void FindFilename(u64 offset)
{
// Don't do anything if a game is not running
- if (Core::GetState() != Core::CORE_RUN) return;
+ if (Core::GetState() != Core::CORE_RUN)
+ return;
+
// Or if the log is unselected
- if (!LogManager::GetInstance()->IsEnabled(LogTypes::FILEMON)) return;
- if (!FileAccess) return;
+ if (!LogManager::GetInstance()->IsEnabled(LogTypes::FILEMON))
+ return;
+
+ // Or if we don't have file access
+ if (!FileAccess)
+ return;
if (!pFileSystem || ISOFile != SConfig::GetInstance().m_LastFilename)
{
diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp
index b60e5ae94a..36e1e959f5 100644
--- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp
+++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp
@@ -260,17 +260,18 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
rContent.m_Size= (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
memcpy(rContent.m_SHA1Hash, pTMD + 0x01f4 + 0x24*i, 20);
memcpy(rContent.m_Header, pTMD + 0x01e4 + 0x24*i, 36);
+
if (m_isWAD)
{
- u32 RoundedSize = ROUND_UP(rContent.m_Size, 0x40);
- rContent.m_pData = new u8[RoundedSize];
+ u32 RoundedSize = ROUND_UP(rContent.m_Size, 0x40);
+ rContent.m_pData = new u8[RoundedSize];
- memset(IV, 0, sizeof IV);
- memcpy(IV, pTMD + 0x01e8 + 0x24*i, 2);
- AESDecode(DecryptTitleKey, IV, pDataApp, RoundedSize, rContent.m_pData);
+ memset(IV, 0, sizeof IV);
+ memcpy(IV, pTMD + 0x01e8 + 0x24*i, 2);
+ AESDecode(DecryptTitleKey, IV, pDataApp, RoundedSize, rContent.m_pData);
- pDataApp += RoundedSize;
- continue;
+ pDataApp += RoundedSize;
+ continue;
}
rContent.m_pData = NULL;
@@ -282,7 +283,9 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
strcpy(szFilename, Filename.c_str());
}
else
+ {
sprintf(szFilename, "%s/%08x.app", m_Path.c_str(), rContent.m_ContentID);
+ }
INFO_LOG(DISCIO, "NANDContentLoader: load %s", szFilename);
diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.h b/Source/Core/DiscIO/Src/NANDContentLoader.h
index a5d9e1523f..b2de34f61d 100644
--- a/Source/Core/DiscIO/Src/NANDContentLoader.h
+++ b/Source/Core/DiscIO/Src/NANDContentLoader.h
@@ -62,7 +62,7 @@ public:
virtual const u8* GetTMDHeader() const = 0;
virtual u32 GetTIKSize() const = 0;
virtual const u8* GetTIK() const = 0;
- virtual const std::vector<SNANDContent>& GetContent() const = 0;
+ virtual const std::vector<SNANDContent>& GetContent() const = 0;
virtual u16 GetTitleVersion() const = 0;
virtual u16 GetNumEntries() const = 0;
virtual DiscIO::IVolume::ECountry GetCountry() const = 0;
diff --git a/Source/Core/DiscIO/Src/VolumeCommon.cpp b/Source/Core/DiscIO/Src/VolumeCommon.cpp
index 71ac85cf2c..22012e3f4a 100644
--- a/Source/Core/DiscIO/Src/VolumeCommon.cpp
+++ b/Source/Core/DiscIO/Src/VolumeCommon.cpp
@@ -69,7 +69,7 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
case 'T': // Korea with English language
case 'Q': // Korea with Japanese language
return IVolume::COUNTRY_KOREA;
- break;
+ break;
case 'O':
return IVolume::COUNTRY_SDK;
diff --git a/Source/Core/DiscIO/Src/VolumeDirectory.cpp b/Source/Core/DiscIO/Src/VolumeDirectory.cpp
index f1a33f8177..9f0fd5c4f0 100644
--- a/Source/Core/DiscIO/Src/VolumeDirectory.cpp
+++ b/Source/Core/DiscIO/Src/VolumeDirectory.cpp
@@ -469,7 +469,7 @@ void CVolumeDirectory::WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u
if(entry.isDirectory)
{
u32 myOffset = fstOffset;
- u32 myEntryNum = myOffset / ENTRY_SIZE;
+ u32 myEntryNum = myOffset / ENTRY_SIZE;
WriteEntryData(fstOffset, DIRECTORY_ENTRY, nameOffset, parentEntryNum, (u32)(myEntryNum + entry.size + 1));
WriteEntryName(nameOffset, entry.virtualName);
diff --git a/Source/Core/DiscIO/Src/WiiWad.cpp b/Source/Core/DiscIO/Src/WiiWad.cpp
index 8736071c8b..aba7efc167 100644
--- a/Source/Core/DiscIO/Src/WiiWad.cpp
+++ b/Source/Core/DiscIO/Src/WiiWad.cpp
@@ -112,10 +112,11 @@ bool WiiWAD::ParseWAD(DiscIO::IBlobReader& _rReader)
m_TMDSize = ReaderBig.Read32(0x14);
m_DataAppSize = ReaderBig.Read32(0x18);
m_FooterSize = ReaderBig.Read32(0x1C);
+
#if MAX_LOGLEVEL >= DEBUG_LEVEL
- _dbg_assert_msg_(BOOT, Reserved==0x00, "WiiWAD: Reserved must be 0x00");
+ _dbg_assert_msg_(BOOT, Reserved==0x00, "WiiWAD: Reserved must be 0x00");
#else
- (void)Reserved;
+ (void)Reserved;
#endif
u32 Offset = 0x40;