properly identify Wii-mode DOL files
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1848 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
018cb993e3
commit
4d4ff5c8f5
|
@ -78,3 +78,19 @@ u32 CDolLoader::GetEntryPoint()
|
|||
{
|
||||
return m_dolheader.entryPoint;
|
||||
}
|
||||
|
||||
bool CDolLoader::IsDolWii(const char* filename)
|
||||
{
|
||||
// try to open file
|
||||
FILE* pStream = fopen(filename, "rb");
|
||||
if (pStream)
|
||||
{
|
||||
fseek(pStream, 0xe0, SEEK_SET);
|
||||
u32 entrypt = fgetc(pStream) << 24 | fgetc(pStream) << 16 |
|
||||
fgetc(pStream) << 8 | fgetc(pStream);
|
||||
|
||||
fclose(pStream);
|
||||
return entrypt >= 0x80004000;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
CDolLoader(const char* _szFilename);
|
||||
u32 GetEntryPoint();
|
||||
|
||||
static bool IsDolWii(const char* filename);
|
||||
private:
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "VolumeCreator.h" // DiscIO
|
||||
|
||||
#include "Boot/Boot.h" // Core
|
||||
#include "Boot/Boot_DOL.h"
|
||||
#include "CoreParameter.h"
|
||||
#include "Core.h" // for bWii
|
||||
|
||||
|
@ -114,13 +115,14 @@ bool SCoreStartupParameter::AutoSetup(EBootBios _BootBios)
|
|||
}
|
||||
else if (!strcasecmp(Extension.c_str(), ".elf"))
|
||||
{
|
||||
bWii = CBoot::IsElfWii(m_strFilename.c_str());
|
||||
bWii = CBoot::IsElfWii(m_strFilename.c_str());
|
||||
Region = USA_DIR;
|
||||
m_BootType = BOOT_ELF;
|
||||
bNTSC = true;
|
||||
}
|
||||
else if (!strcasecmp(Extension.c_str(), ".dol"))
|
||||
{
|
||||
bWii = CDolLoader::IsDolWii(m_strFilename.c_str());
|
||||
Region = USA_DIR;
|
||||
m_BootType = BOOT_DOL;
|
||||
bNTSC = true;
|
||||
|
|
Loading…
Reference in New Issue