summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorLPFaint99 <lpfaint99@gmail.com>2010-01-11 05:07:56 +0000
committerLPFaint99 <lpfaint99@gmail.com>2010-01-11 05:07:56 +0000
commit183804e44265ab35a237f34efa1d0c2292d1cc9a (patch)
treeb56c7bdb62506f603c9a483e7628bf7b12f4ab73 /Source/Core/DiscIO
parenta19be73be32b3117719b201fbfd9f909df1a65ed (diff)
Small unicode fix for extracting files (ISOProperties.cpp)
Change some PanicYesNo to AskYesNo so that they will always show (WiiSaveCrypted.cpp) Adds more country filtering options to Gamelist (france, italy, korea, taiwan, and unknown country) Misc. fixes for potential crashes that can only occur with a corrupted dump == check filesize of a dump before spending time looking for the cause of a crash :P git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4802 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/Src/BannerLoaderGC.cpp32
-rw-r--r--Source/Core/DiscIO/Src/BannerLoaderGC.h1
-rw-r--r--Source/Core/DiscIO/Src/FileMonitor.cpp1
-rw-r--r--Source/Core/DiscIO/Src/FileSystemGCWii.cpp2
-rw-r--r--Source/Core/DiscIO/Src/VolumeCreator.cpp9
5 files changed, 28 insertions, 17 deletions
diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
index 104249cbeb..54c681c43a 100644
--- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
+++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp
@@ -31,16 +31,20 @@ CBannerLoaderGC::CBannerLoaderGC(DiscIO::IFileSystem& _rFileSystem)
{
// load the opening.bnr
size_t FileSize = (size_t) _rFileSystem.GetFileSize("opening.bnr");
-
- if (FileSize > 0)
+ if (FileSize == sizeof(DVDBanner) || FileSize == sizeof(DVDBanner2))
{
m_pBannerFile = new u8[FileSize];
if (m_pBannerFile)
{
_rFileSystem.ReadFile("opening.bnr", m_pBannerFile, FileSize);
- m_IsValid = true;
+ m_BNRType = getBannerType();
+ if (m_BNRType == BANNER_UNKNOWN)
+ PanicAlert("Invalid opening.bnr found in gcm:\n%s\n You may need to redump this game.",
+ _rFileSystem.GetVolume()->GetName().c_str());
+ else m_IsValid = true;
}
}
+ else WARN_LOG(DISCIO, "Invalid opening.bnr size: %0x", FileSize);
}
@@ -54,15 +58,13 @@ CBannerLoaderGC::~CBannerLoaderGC()
}
-bool
-CBannerLoaderGC::IsValid()
+bool CBannerLoaderGC::IsValid()
{
return m_IsValid;
}
-bool
-CBannerLoaderGC::GetBanner(u32* _pBannerImage)
+bool CBannerLoaderGC::GetBanner(u32* _pBannerImage)
{
if (!IsValid())
{
@@ -76,8 +78,7 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage)
}
-bool
-CBannerLoaderGC::GetName(std::string _rName[])
+bool CBannerLoaderGC::GetName(std::string _rName[])
{
bool returnCode = false;
@@ -87,7 +88,7 @@ CBannerLoaderGC::GetName(std::string _rName[])
}
// find Banner type
- switch (getBannerType())
+ switch (m_BNRType)
{
case CBannerLoaderGC::BANNER_BNR1:
{
@@ -139,8 +140,7 @@ CBannerLoaderGC::GetName(std::string _rName[])
}
-bool
-CBannerLoaderGC::GetCompany(std::string& _rCompany)
+bool CBannerLoaderGC::GetCompany(std::string& _rCompany)
{
_rCompany = "N/A";
@@ -157,8 +157,7 @@ CBannerLoaderGC::GetCompany(std::string& _rCompany)
}
-bool
-CBannerLoaderGC::GetDescription(std::string* _rDescription)
+bool CBannerLoaderGC::GetDescription(std::string* _rDescription)
{
bool returnCode = false;
@@ -168,7 +167,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription)
}
// find Banner type
- switch (getBannerType())
+ switch (m_BNRType)
{
case CBannerLoaderGC::BANNER_BNR1:
{
@@ -202,8 +201,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription)
}
-void
-CBannerLoaderGC::decode5A3image(u32* dst, u16* src, int width, int height)
+void CBannerLoaderGC::decode5A3image(u32* dst, u16* src, int width, int height)
{
for (int y = 0; y < height; y += 4)
{
diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.h b/Source/Core/DiscIO/Src/BannerLoaderGC.h
index bc9c1249f1..0527c721c1 100644
--- a/Source/Core/DiscIO/Src/BannerLoaderGC.h
+++ b/Source/Core/DiscIO/Src/BannerLoaderGC.h
@@ -80,6 +80,7 @@ class CBannerLoaderGC
u8* m_pBannerFile;
bool m_IsValid;
+ BANNER_TYPE m_BNRType;
void decode5A3image(u32* dst, u16* src, int width, int height);
BANNER_TYPE getBannerType();
diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp
index 5bf60e53cf..0a68d71ffc 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.cpp
+++ b/Source/Core/DiscIO/Src/FileMonitor.cpp
@@ -83,6 +83,7 @@ void ReadGC(std::string FileName)
if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO))
{
pFileSystem = DiscIO::CreateFileSystem(OpenISO);
+ if(!pFileSystem) return;
pFileSystem->GetFileList(GCFiles);
}
FileAccess = true;
diff --git a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
index 0a8314c959..12b5cfc21d 100644
--- a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
+++ b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
@@ -83,6 +83,8 @@ u64 CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _Max
if (pFileInfo->m_FileSize > _MaxBufferSize)
return 0;
+ DEBUG_LOG(DISCIO, "Filename: %s. Offset: %0x. Size: %0x",_rFullPath, pFileInfo->m_Offset, pFileInfo->m_FileSize);
+
m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer);
return pFileInfo->m_FileSize;
}
diff --git a/Source/Core/DiscIO/Src/VolumeCreator.cpp b/Source/Core/DiscIO/Src/VolumeCreator.cpp
index 7d877d0c13..60a277356a 100644
--- a/Source/Core/DiscIO/Src/VolumeCreator.cpp
+++ b/Source/Core/DiscIO/Src/VolumeCreator.cpp
@@ -28,6 +28,7 @@
#include "VolumeWad.h"
#include "Hash.h"
+#include "StringUtil.h"
namespace DiscIO
{
@@ -103,6 +104,11 @@ IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionG
case DISC_TYPE_UNK:
default:
+ std::string Filename, ext;
+ SplitPath(_rFilename, NULL, &Filename, &ext);
+ Filename += ext;
+ NOTICE_LOG(DISCIO, "%s does not have the Magic word for a gcm, wiidisc or wad file\n"
+ "Set Log Verbosity to Warning and attempt to load the game again to view the values", Filename.c_str());
delete pReader;
return NULL;
}
@@ -220,6 +226,7 @@ EDiscType GetDiscType(IBlobReader& _rReader)
else
return(DISC_TYPE_WII_CONTAINER);
}
+ WARN_LOG(DISCIO, "Wiidisc magicword not found.\n Offset: 0x18 value: %04x", MagicWord);
}
// check for WAD
@@ -229,6 +236,7 @@ EDiscType GetDiscType(IBlobReader& _rReader)
// 0x206962 for boot2 wads
if (MagicWord == 0x00204973 || MagicWord == 0x00206962)
return(DISC_TYPE_WAD);
+ WARN_LOG(DISCIO, "Wad magicword not found.\n Offset: 0x02 value: %04x", MagicWord);
}
// check for GC
@@ -237,6 +245,7 @@ EDiscType GetDiscType(IBlobReader& _rReader)
if (MagicWord == 0xC2339F3D)
return(DISC_TYPE_GC);
+ WARN_LOG(DISCIO, "GCM magicword not found.\n Offset: 0x1C value: %04x", MagicWord);
}
return DISC_TYPE_UNK;