mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user