Replace tabs with spaces

This commit is contained in:
LuigiBlood 2019-01-25 21:32:26 +01:00
parent 95e31542cf
commit 047f611c81
11 changed files with 501 additions and 501 deletions

View File

@ -344,12 +344,12 @@ bool CN64System::LoadFileImage(const char * FileLoc)
g_Settings->SaveBool(Setting_EnableDisk, true);
}
g_System->RefreshGameSettings();
g_System->RefreshGameSettings();
if (g_Rom->CicChipID() != CIC_NUS_8303 && g_Rom->CicChipID() != CIC_NUS_DDUS)
{
g_Settings->SaveString(Game_File, FileLoc);
}
if (g_Rom->CicChipID() != CIC_NUS_8303 && g_Rom->CicChipID() != CIC_NUS_DDUS)
{
g_Settings->SaveString(Game_File, FileLoc);
}
g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
WriteTrace(TraceN64System, TraceDebug, "Finished Loading (GoodName: %s)", g_Settings->LoadStringVal(Rdb_GoodName).c_str());
@ -384,44 +384,44 @@ bool CN64System::RunFileImage(const char * FileLoc)
bool CN64System::RunDiskImage(const char * FileLoc)
{
if (!LoadFileImage(g_Settings->LoadStringVal(File_DiskIPLPath).c_str()))
{
g_Settings->SaveString(File_DiskIPLPath, "");
return false;
}
if (!LoadDiskImage(FileLoc, false))
{
return false;
}
if (g_Settings->LoadBool(Setting_AutoStart) != 0)
{
WriteTrace(TraceN64System, TraceDebug, "Automattically starting rom");
RunLoadedImage();
}
return true;
if (!LoadFileImage(g_Settings->LoadStringVal(File_DiskIPLPath).c_str()))
{
g_Settings->SaveString(File_DiskIPLPath, "");
return false;
}
if (!LoadDiskImage(FileLoc, false))
{
return false;
}
if (g_Settings->LoadBool(Setting_AutoStart) != 0)
{
WriteTrace(TraceN64System, TraceDebug, "Automattically starting rom");
RunLoadedImage();
}
return true;
}
bool CN64System::RunDiskComboImage(const char * FileLoc, const char * FileLocDisk)
{
if (!LoadFileImageIPL(g_Settings->LoadStringVal(File_DiskIPLPath).c_str()))
{
g_Settings->SaveString(File_DiskIPLPath, "");
return false;
}
if (!LoadDiskImage(FileLocDisk, true))
{
return false;
}
if (!LoadFileImage(FileLoc))
{
return false;
}
if (g_Settings->LoadBool(Setting_AutoStart) != 0)
{
WriteTrace(TraceN64System, TraceDebug, "Automattically starting rom");
RunLoadedImage();
}
return true;
if (!LoadFileImageIPL(g_Settings->LoadStringVal(File_DiskIPLPath).c_str()))
{
g_Settings->SaveString(File_DiskIPLPath, "");
return false;
}
if (!LoadDiskImage(FileLocDisk, true))
{
return false;
}
if (!LoadFileImage(FileLoc))
{
return false;
}
if (g_Settings->LoadBool(Setting_AutoStart) != 0)
{
WriteTrace(TraceN64System, TraceDebug, "Automattically starting rom");
RunLoadedImage();
}
return true;
}
@ -526,10 +526,10 @@ bool CN64System::LoadDiskImage(const char * FileLoc, const bool Expansion)
{
g_System->RefreshGameSettings();
if (!Expansion)
{
g_Settings->SaveString(Game_File, FileLoc);
}
if (!Expansion)
{
g_Settings->SaveString(Game_File, FileLoc);
}
g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
}
else

View File

@ -59,8 +59,8 @@ public:
//Methods
static bool LoadFileImage(const char * FileLoc);
static bool RunFileImage(const char * FileLoc);
static bool RunDiskImage(const char * FileLoc);
static bool RunDiskComboImage(const char * FileLoc, const char * FileLocDisk);
static bool RunDiskImage(const char * FileLoc);
static bool RunDiskComboImage(const char * FileLoc, const char * FileLocDisk);
static bool LoadFileImageIPL(const char * FileLoc);
static bool LoadDiskImage(const char * FileLoc, const bool Expansion);
static void RunLoadedImage(void);

View File

@ -50,24 +50,24 @@ bool CN64Disk::LoadDiskImage(const char * FileLoc)
}
}
char RomName[5];
//Get the disk ID from the disk image
RomName[0] = (char)*(m_DiskImage + 0x43673);
RomName[1] = (char)*(m_DiskImage + 0x43672);
RomName[2] = (char)*(m_DiskImage + 0x43671);
RomName[3] = (char)*(m_DiskImage + 0x43670);
RomName[4] = '\0';
char RomName[5];
//Get the disk ID from the disk image
RomName[0] = (char)*(m_DiskImage + 0x43673);
RomName[1] = (char)*(m_DiskImage + 0x43672);
RomName[2] = (char)*(m_DiskImage + 0x43671);
RomName[3] = (char)*(m_DiskImage + 0x43670);
RomName[4] = '\0';
m_RomName = RomName;
m_RomName = RomName;
m_FileName = FileLoc;
m_DiskIdent.Format("%08X-%08X-C:%X", *(uint32_t *)(&m_DiskImage[0]), *(uint32_t *)(&m_DiskImage[0x43670]), m_DiskImage[0x43670]);
m_Country = (Country)m_DiskImage[0x43670];
m_DiskIdent.Format("%08X-%08X-C:%X", *(uint32_t *)(&m_DiskImage[0]), *(uint32_t *)(&m_DiskImage[0x43670]), m_DiskImage[0x43670]);
m_Country = (Country)m_DiskImage[0x43670];
if (g_Disk == this)
{
g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
SaveDiskSettingID(false);
}
if (g_Disk == this)
{
g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
SaveDiskSettingID(false);
}
return true;
}
@ -136,28 +136,28 @@ bool CN64Disk::IsValidDiskImage(uint8_t Test[4])
//this rom
void CN64Disk::SaveDiskSettingID(bool temp)
{
g_Settings->SaveBool(Game_TempLoaded, temp);
g_Settings->SaveString(Game_GameName, m_RomName.c_str());
g_Settings->SaveString(Game_IniKey, m_DiskIdent.c_str());
//g_Settings->SaveString(Game_UniqueSaveDir, stdstr_f("%s-%s", m_RomName.c_str(), m_MD5.c_str()).c_str());
g_Settings->SaveBool(Game_TempLoaded, temp);
g_Settings->SaveString(Game_GameName, m_RomName.c_str());
g_Settings->SaveString(Game_IniKey, m_DiskIdent.c_str());
//g_Settings->SaveString(Game_UniqueSaveDir, stdstr_f("%s-%s", m_RomName.c_str(), m_MD5.c_str()).c_str());
switch (GetCountry())
{
case Germany: case french: case Italian:
case Europe: case Spanish: case Australia:
case X_PAL: case Y_PAL:
g_Settings->SaveDword(Game_SystemType, SYSTEM_PAL);
break;
default:
g_Settings->SaveDword(Game_SystemType, SYSTEM_NTSC);
break;
}
switch (GetCountry())
{
case Germany: case french: case Italian:
case Europe: case Spanish: case Australia:
case X_PAL: case Y_PAL:
g_Settings->SaveDword(Game_SystemType, SYSTEM_PAL);
break;
default:
g_Settings->SaveDword(Game_SystemType, SYSTEM_NTSC);
break;
}
}
void CN64Disk::ClearDiskSettingID()
{
g_Settings->SaveString(Game_GameName, "");
g_Settings->SaveString(Game_IniKey, "");
g_Settings->SaveString(Game_GameName, "");
g_Settings->SaveString(Game_IniKey, "");
}
bool CN64Disk::AllocateDiskImage(uint32_t DiskFileSize)

View File

@ -23,15 +23,15 @@ public:
bool SaveDiskImage();
void SwapDiskImage(const char * FileLoc);
static bool IsValidDiskImage(uint8_t Test[4]);
void SaveDiskSettingID(bool temp);
void ClearDiskSettingID();
void SaveDiskSettingID(bool temp);
void ClearDiskSettingID();
uint8_t * GetDiskAddress() { return m_DiskImage; }
uint8_t * GetDiskAddressBuffer() { return m_DiskImage + m_DiskBufAddress; }
void SetDiskAddressBuffer(uint32_t address) { m_DiskBufAddress = address; }
stdstr GetRomName() const { return m_RomName; }
stdstr GetFileName() const { return m_FileName; }
stdstr GetDiskIdent() const { return m_DiskIdent; }
Country GetCountry() const { return m_Country; }
stdstr GetRomName() const { return m_RomName; }
stdstr GetFileName() const { return m_FileName; }
stdstr GetDiskIdent() const { return m_DiskIdent; }
Country GetCountry() const { return m_Country; }
void UnallocateDiskImage();
LanguageStringID GetError() const { return m_ErrorMsg; }
@ -56,7 +56,7 @@ private:
uint32_t m_DiskFileSize;
uint32_t m_DiskBufAddress;
LanguageStringID m_ErrorMsg;
Country m_Country;
Country m_Country;
stdstr m_RomName, m_FileName, m_DiskIdent;
uint8_t m_DiskFormat; //0 = MAME, 1 = SDK

View File

@ -33,7 +33,7 @@ static const char* ROM_extensions[] =
"usa",
"eur",
"bin",
"ndd",
"ndd",
};
CRomList::CRomList() :
@ -399,46 +399,46 @@ bool CRomList::LoadDataFromRomFile(const char * FileName, uint8_t * Data, int32_
}
FileFormat = Format_Zip;
}
else
{
CFile File;
if (!File.Open(FileName, CFileBase::modeRead))
{
return false;
}
File.SeekToBegin();
if (!File.Read(Test, sizeof(Test)))
{
return false;
}
if (!CN64Rom::IsValidRomImage(Test) && !CN64Disk::IsValidDiskImage(Test))
{
return false;
}
else
{
CFile File;
if (!File.Open(FileName, CFileBase::modeRead))
{
return false;
}
File.SeekToBegin();
if (!File.Read(Test, sizeof(Test)))
{
return false;
}
if (!CN64Rom::IsValidRomImage(Test) && !CN64Disk::IsValidDiskImage(Test))
{
return false;
}
if (CN64Rom::IsValidRomImage(Test))
{
File.SeekToBegin();
if (!File.Read(Data, DataLen))
{
return false;
}
}
if (CN64Rom::IsValidRomImage(Test))
{
File.SeekToBegin();
if (!File.Read(Data, DataLen))
{
return false;
}
}
if (CN64Disk::IsValidDiskImage(Test))
{
//Is a Disk Image
File.SeekToBegin();
if (!File.Read(Data, 0x20))
{
return false;
}
File.Seek(0x43670, CFileBase::begin);
if (!File.Read(Data + 0x20, 0x20))
{
return false;
}
}
if (CN64Disk::IsValidDiskImage(Test))
{
//Is a Disk Image
File.SeekToBegin();
if (!File.Read(Data, 0x20))
{
return false;
}
File.Seek(0x43670, CFileBase::begin);
if (!File.Read(Data + 0x20, 0x20))
{
return false;
}
}
*RomSize = File.GetLength();
FileFormat = Format_Uncompressed;
}
@ -461,37 +461,37 @@ bool CRomList::FillRomInfo(ROM_INFO * pRomInfo)
strncpy(pRomInfo->FileName, g_Settings->LoadBool(RomList_ShowFileExtensions) ? CPath(pRomInfo->szFullFileName).GetNameExtension().c_str() : CPath(pRomInfo->szFullFileName).GetName().c_str(), sizeof(pRomInfo->FileName) / sizeof(pRomInfo->FileName[0]));
}
if (CPath(pRomInfo->szFullFileName).GetExtension() != "ndd")
{
char InternalName[22];
memcpy(InternalName, (void *)(RomData + 0x20), 20);
CN64Rom::CleanRomName(InternalName);
strcpy(pRomInfo->InternalName, InternalName);
pRomInfo->CartID[0] = *(RomData + 0x3F);
pRomInfo->CartID[1] = *(RomData + 0x3E);
pRomInfo->CartID[2] = '\0';
pRomInfo->Manufacturer = *(RomData + 0x38);
pRomInfo->Country = *(RomData + 0x3D);
pRomInfo->CRC1 = *(uint32_t *)(RomData + 0x10);
pRomInfo->CRC2 = *(uint32_t *)(RomData + 0x14);
pRomInfo->CicChip = CN64Rom::GetCicChipID(RomData);
FillRomExtensionInfo(pRomInfo);
}
else
{
char InternalName[22];
memcpy(InternalName, (void *)(RomData + 0x20), 4);
strcpy(pRomInfo->InternalName, InternalName);
pRomInfo->CartID[0] = *(RomData + 0x20);
pRomInfo->CartID[1] = *(RomData + 0x21);
pRomInfo->CartID[2] = *(RomData + 0x22);
pRomInfo->Manufacturer = '\0';
pRomInfo->Country = *(RomData + 0x20);
pRomInfo->CRC1 = *(uint32_t *)(RomData + 0x00);
pRomInfo->CRC2 = *(uint32_t *)(RomData + 0x20);
pRomInfo->CicChip = CIC_NUS_8303;
FillRomExtensionInfo(pRomInfo);
}
if (CPath(pRomInfo->szFullFileName).GetExtension() != "ndd")
{
char InternalName[22];
memcpy(InternalName, (void *)(RomData + 0x20), 20);
CN64Rom::CleanRomName(InternalName);
strcpy(pRomInfo->InternalName, InternalName);
pRomInfo->CartID[0] = *(RomData + 0x3F);
pRomInfo->CartID[1] = *(RomData + 0x3E);
pRomInfo->CartID[2] = '\0';
pRomInfo->Manufacturer = *(RomData + 0x38);
pRomInfo->Country = *(RomData + 0x3D);
pRomInfo->CRC1 = *(uint32_t *)(RomData + 0x10);
pRomInfo->CRC2 = *(uint32_t *)(RomData + 0x14);
pRomInfo->CicChip = CN64Rom::GetCicChipID(RomData);
FillRomExtensionInfo(pRomInfo);
}
else
{
char InternalName[22];
memcpy(InternalName, (void *)(RomData + 0x20), 4);
strcpy(pRomInfo->InternalName, InternalName);
pRomInfo->CartID[0] = *(RomData + 0x20);
pRomInfo->CartID[1] = *(RomData + 0x21);
pRomInfo->CartID[2] = *(RomData + 0x22);
pRomInfo->Manufacturer = '\0';
pRomInfo->Country = *(RomData + 0x20);
pRomInfo->CRC1 = *(uint32_t *)(RomData + 0x00);
pRomInfo->CRC2 = *(uint32_t *)(RomData + 0x20);
pRomInfo->CicChip = CIC_NUS_8303;
FillRomExtensionInfo(pRomInfo);
}
return true;
}
return false;
@ -565,9 +565,9 @@ void CRomList::ByteSwapRomData(uint8_t * Data, int32_t DataLen)
switch (*((uint32_t *)&Data[0]))
{
case 0x12408037:
case 0x07408027: //64DD IPL
case 0xD316E848: //64DD JP Disk
case 0xEE562263: //64DD US Disk
case 0x07408027: //64DD IPL
case 0xD316E848: //64DD JP Disk
case 0xEE562263: //64DD US Disk
for (count = 0; count < DataLen; count += 4)
{
Data[count] ^= Data[count + 2];
@ -579,8 +579,8 @@ void CRomList::ByteSwapRomData(uint8_t * Data, int32_t DataLen)
}
break;
case 0x40072780: //64DD IPL
case 0x16D348E8: //64DD JP Disk
case 0x56EE6322: //64DD US Disk
case 0x16D348E8: //64DD JP Disk
case 0x56EE6322: //64DD US Disk
case 0x40123780:
for (count = 0; count < DataLen; count += 4)
{
@ -593,10 +593,10 @@ void CRomList::ByteSwapRomData(uint8_t * Data, int32_t DataLen)
}
break;
case 0x80371240:
case 0x80270740: //64DD IPL
case 0xE848D316: //64DD JP Disk
case 0x2263EE56: //64DD US Disk
break;
case 0x80270740: //64DD IPL
case 0xE848D316: //64DD JP Disk
case 0x2263EE56: //64DD US Disk
break;
}
}

View File

@ -126,25 +126,25 @@ void CMainMenu::OnOpenRom(HWND hWnd)
return;
}
// Open Disk
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(File.c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(File.c_str());
}
}
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(File.c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(File.c_str());
}
}
}
void CMainMenu::OnRomInfo(HWND hWnd)
{
if (g_Disk)
{
RomInformation Info(g_Disk);
Info.DisplayInformation(hWnd);
}
if (g_Disk)
{
RomInformation Info(g_Disk);
Info.DisplayInformation(hWnd);
}
else if (g_Rom)
{
RomInformation Info(g_Rom);
@ -471,9 +471,9 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
case ID_DEBUG_DISABLE_GAMEFIX:
g_Settings->SaveBool(Debugger_DisableGameFixes, !g_Settings->LoadBool(Debugger_DisableGameFixes));
break;
case ID_DEBUG_ENANCEMENT:
g_Settings->SaveBool(Setting_Enhancement, !g_Settings->LoadBool(Setting_Enhancement));
break;
case ID_DEBUG_ENANCEMENT:
g_Settings->SaveBool(Setting_Enhancement, !g_Settings->LoadBool(Setting_Enhancement));
break;
case ID_DEBUGGER_TRACE_MD5: SetTraceModuleSetttings(Debugger_TraceMD5); break;
case ID_DEBUGGER_TRACE_SETTINGS: SetTraceModuleSetttings(Debugger_TraceSettings); break;
case ID_DEBUGGER_TRACE_UNKNOWN: SetTraceModuleSetttings(Debugger_TraceUnknown); break;
@ -546,21 +546,21 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
if (UISettingsLoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) &&
FileName.length() > 0)
{
if (CPath(FileName).GetExtension() != "ndd")
g_BaseSystem->RunFileImage(FileName.c_str());
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(FileName.c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(FileName.c_str());
}
}
}
if (CPath(FileName).GetExtension() != "ndd")
g_BaseSystem->RunFileImage(FileName.c_str());
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(FileName.c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(FileName.c_str());
}
}
}
}
}
if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END)
@ -652,8 +652,8 @@ std::wstring CMainMenu::GetSaveSlotString(int Slot)
{
FileName.AppendDirectory(g_Settings->LoadStringVal(Game_UniqueSaveDir).c_str());
}
FileName.NormalizePath(CPath(CPath::MODULE_DIRECTORY));
if (Slot != 0)
FileName.NormalizePath(CPath(CPath::MODULE_DIRECTORY));
if (Slot != 0)
{
FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Rdb_GoodName).c_str(), Slot).c_str());
}
@ -1241,13 +1241,13 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
DebugMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugNotificationMenu, L"Notification");
DebugMenu.push_back(Item);
Item.Reset(ID_DEBUG_ENANCEMENT, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Enable Enhancement");
if (g_Settings->LoadBool(Setting_Enhancement))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_DEBUG_ENANCEMENT, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Enable Enhancement");
if (g_Settings->LoadBool(Setting_Enhancement))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_DEBUG_SHOW_TLB_MISSES, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Show TLB Misses");
if (g_Settings->LoadBool(Debugger_ShowTLBMisses))
{

View File

@ -982,43 +982,43 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
switch (LOWORD(wParam)) {
case ID_POPUPMENU_PLAYGAME:
{
if (CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd")
{
g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom());
}
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(_this->CurrentedSelectedRom()))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(_this->CurrentedSelectedRom());
}
}
}
break;
}
{
if (CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd")
{
g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom());
}
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(_this->CurrentedSelectedRom()))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(_this->CurrentedSelectedRom());
}
}
}
break;
}
case ID_POPUPMENU_PLAYGAMEWITHDISK:
{
CPath FileName;
const char * Filter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskComboImage(_this->CurrentedSelectedRom(), FileName))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskComboImage(_this->CurrentedSelectedRom(), FileName);
}
}
}
CPath FileName;
const char * Filter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskComboImage(_this->CurrentedSelectedRom(), FileName))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskComboImage(_this->CurrentedSelectedRom(), FileName);
}
}
}
}
break;
case ID_POPUPMENU_ROMDIRECTORY: _this->SelectRomDir(); break;
@ -1031,78 +1031,78 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case ID_POPUPMENU_EDITSETTINGS:
case ID_POPUPMENU_EDITCHEATS:
case ID_POPUPMENU_CHOOSEENHANCEMENT:
case ID_POPUPMENU_CHOOSEENHANCEMENT:
{
if (CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd")
{
CN64Rom Rom;
Rom.LoadN64Image(_this->CurrentedSelectedRom(), true);
Rom.SaveRomSettingID(true);
if (CPath(_this->CurrentedSelectedRom()).GetExtension() != "ndd")
{
CN64Rom Rom;
Rom.LoadN64Image(_this->CurrentedSelectedRom(), true);
Rom.SaveRomSettingID(true);
if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS)
{
CSettingConfig SettingConfig(true);
SettingConfig.Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_CHOOSEENHANCEMENT)
{
CEnhancementConfig().Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS)
{
CCheatsUI * cheatUI = new CCheatsUI;
g_cheatUI = cheatUI;
cheatUI->SelectCheats(hWnd, true);
if (g_cheatUI == cheatUI)
{
g_cheatUI = NULL;
}
}
if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS)
{
CSettingConfig SettingConfig(true);
SettingConfig.Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_CHOOSEENHANCEMENT)
{
CEnhancementConfig().Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS)
{
CCheatsUI * cheatUI = new CCheatsUI;
g_cheatUI = cheatUI;
cheatUI->SelectCheats(hWnd, true);
if (g_cheatUI == cheatUI)
{
g_cheatUI = NULL;
}
}
if (g_Rom)
{
g_Rom->SaveRomSettingID(false);
}
else
{
Rom.ClearRomSettingID();
}
}
else
{
CN64Disk Disk;
Disk.LoadDiskImage(_this->CurrentedSelectedRom());
Disk.SaveDiskSettingID(true);
if (g_Rom)
{
g_Rom->SaveRomSettingID(false);
}
else
{
Rom.ClearRomSettingID();
}
}
else
{
CN64Disk Disk;
Disk.LoadDiskImage(_this->CurrentedSelectedRom());
Disk.SaveDiskSettingID(true);
if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS)
{
CSettingConfig SettingConfig(true);
SettingConfig.Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_CHOOSEENHANCEMENT)
{
CEnhancementConfig().Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS)
{
CCheatsUI * cheatUI = new CCheatsUI;
g_cheatUI = cheatUI;
cheatUI->SelectCheats(hWnd, true);
if (g_cheatUI == cheatUI)
{
g_cheatUI = NULL;
}
}
if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS)
{
CSettingConfig SettingConfig(true);
SettingConfig.Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_CHOOSEENHANCEMENT)
{
CEnhancementConfig().Display(hWnd);
}
else if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS)
{
CCheatsUI * cheatUI = new CCheatsUI;
g_cheatUI = cheatUI;
cheatUI->SelectCheats(hWnd, true);
if (g_cheatUI == cheatUI)
{
g_cheatUI = NULL;
}
}
if (g_Disk)
{
g_Disk->SaveDiskSettingID(false);
}
else
{
Disk.ClearDiskSettingID();
}
}
if (g_Disk)
{
g_Disk->SaveDiskSettingID(false);
}
else
{
Disk.ClearDiskSettingID();
}
}
}
break;
default:
@ -1175,16 +1175,16 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
else
{
// Open Disk
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(filename))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(filename);
}
}
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(filename))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(filename);
}
}
}
}
break;

View File

@ -807,21 +807,21 @@ void CRomBrowser::RomList_OpenRom(uint32_t /*pnmh*/)
delete g_DDRom;
g_DDRom = NULL;
if (CPath(pRomInfo->szFullFileName).GetExtension() != "ndd")
CN64System::RunFileImage(pRomInfo->szFullFileName);
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(pRomInfo->szFullFileName))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(m_MainWindow, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(pRomInfo->szFullFileName);
}
}
}
if (CPath(pRomInfo->szFullFileName).GetExtension() != "ndd")
CN64System::RunFileImage(pRomInfo->szFullFileName);
else
{
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(pRomInfo->szFullFileName))
{
CPath FileName;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileName.SelectFile(m_MainWindow, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileName);
g_BaseSystem->RunDiskImage(pRomInfo->szFullFileName);
}
}
}
}
void CRomBrowser::RomList_PopupMenu(uint32_t /*pnmh*/)
@ -857,14 +857,14 @@ void CRomBrowser::RomList_PopupMenu(uint32_t /*pnmh*/)
MenuSetText(hPopupMenu, 6, wGS(POPUP_INFO).c_str(), NULL);
MenuSetText(hPopupMenu, 7, wGS(POPUP_GFX_PLUGIN).c_str(), NULL);
MenuSetText(hPopupMenu, 9, wGS(POPUP_SETTINGS).c_str(), NULL);
MenuSetText(hPopupMenu, 10, wGS(POPUP_CHEATS).c_str(), NULL);
MenuSetText(hPopupMenu, 11, wGS(POPUP_ENHANCEMENTS).c_str(), NULL);
MenuSetText(hPopupMenu, 10, wGS(POPUP_CHEATS).c_str(), NULL);
MenuSetText(hPopupMenu, 11, wGS(POPUP_ENHANCEMENTS).c_str(), NULL);
if (m_SelectedRom.size() == 0)
{
DeleteMenu(hPopupMenu, 11, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 10, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 9, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 11, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 10, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 9, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 8, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 7, MF_BYPOSITION);
DeleteMenu(hPopupMenu, 6, MF_BYPOSITION);
@ -876,15 +876,15 @@ void CRomBrowser::RomList_PopupMenu(uint32_t /*pnmh*/)
else
{
bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
bool CheatsRemembered = g_Settings->LoadBool(Setting_RememberCheats);
bool Enhancement = !inBasicMode && g_Settings->LoadBool(Setting_Enhancement);
bool CheatsRemembered = g_Settings->LoadBool(Setting_RememberCheats);
bool Enhancement = !inBasicMode && g_Settings->LoadBool(Setting_Enhancement);
if (!Enhancement) { DeleteMenu(hPopupMenu, 11, MF_BYPOSITION); }
if (!CheatsRemembered) { DeleteMenu(hPopupMenu, 10, MF_BYPOSITION); }
if (inBasicMode) { DeleteMenu(hPopupMenu, 9, MF_BYPOSITION); }
if (!Enhancement) { DeleteMenu(hPopupMenu, 11, MF_BYPOSITION); }
if (!CheatsRemembered) { DeleteMenu(hPopupMenu, 10, MF_BYPOSITION); }
if (inBasicMode) { DeleteMenu(hPopupMenu, 9, MF_BYPOSITION); }
if (inBasicMode && !CheatsRemembered) { DeleteMenu(hPopupMenu, 8, MF_BYPOSITION); }
DeleteMenu(hPopupMenu, 7, MF_BYPOSITION);
if (CPath(m_SelectedRom).GetExtension() == "ndd") { DeleteMenu(hPopupMenu, 1, MF_BYPOSITION); }
if (CPath(m_SelectedRom).GetExtension() == "ndd") { DeleteMenu(hPopupMenu, 1, MF_BYPOSITION); }
if (!inBasicMode && g_Plugins && g_Plugins->Gfx() && g_Plugins->Gfx()->GetRomBrowserMenu != NULL)
{
HMENU GfxMenu = (HMENU)g_Plugins->Gfx()->GetRomBrowserMenu();

View File

@ -20,26 +20,26 @@ m_pRomInfo(NULL),
m_pDiskInfo(NULL)
{
if (m_FileName.length() == 0) { return; }
if (CPath(m_FileName).GetExtension() != "ndd")
{
m_pRomInfo = new CN64Rom;
if (!m_pRomInfo->LoadN64Image(m_FileName.c_str()))
{
delete m_pRomInfo;
m_pRomInfo = NULL;
return;
}
}
else
{
m_pDiskInfo = new CN64Disk;
if (!m_pDiskInfo->LoadDiskImage(m_FileName.c_str()))
{
delete m_pDiskInfo;
m_pDiskInfo = NULL;
return;
}
}
if (CPath(m_FileName).GetExtension() != "ndd")
{
m_pRomInfo = new CN64Rom;
if (!m_pRomInfo->LoadN64Image(m_FileName.c_str()))
{
delete m_pRomInfo;
m_pRomInfo = NULL;
return;
}
}
else
{
m_pDiskInfo = new CN64Disk;
if (!m_pDiskInfo->LoadDiskImage(m_FileName.c_str()))
{
delete m_pDiskInfo;
m_pDiskInfo = NULL;
return;
}
}
}
RomInformation::RomInformation(CN64Rom * RomInfo) :
@ -62,8 +62,8 @@ RomInformation::~RomInformation()
{
if (m_DeleteRomInfo)
delete m_pRomInfo;
if (m_DeleteDiskInfo)
delete m_pDiskInfo;
if (m_DeleteDiskInfo)
delete m_pDiskInfo;
}
#include <windows.h>
@ -80,145 +80,145 @@ DWORD CALLBACK RomInfoProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam)
{
case WM_INITDIALOG:
{
//record class for future usage
SetProp(hDlg, "this", (RomInformation *)lParam);
RomInformation * _this = (RomInformation *)lParam;
//record class for future usage
SetProp(hDlg, "this", (RomInformation *)lParam);
RomInformation * _this = (RomInformation *)lParam;
if (_this->m_pDiskInfo == NULL)
{
SetWindowTextW(hDlg, wGS(INFO_TITLE).c_str());
if (_this->m_pDiskInfo == NULL)
{
SetWindowTextW(hDlg, wGS(INFO_TITLE).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_NAME, wGS(INFO_ROM_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_FILE_NAME, wGS(INFO_FILE_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_LOCATION, wGS(INFO_LOCATION_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_MD5, wGS(INFO_MD5_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_SIZE, wGS(INFO_SIZE_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CART_ID, wGS(INFO_CART_ID_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_MANUFACTURER, wGS(INFO_MANUFACTURER_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_COUNTRY, wGS(INFO_COUNTRY_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CRC1, wGS(INFO_CRC1_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CRC2, wGS(INFO_CRC2_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CIC_CHIP, wGS(INFO_CIC_CHIP_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CLOSE_BUTTON, wGS(BOTTOM_CLOSE).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_NAME, wGS(INFO_ROM_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_FILE_NAME, wGS(INFO_FILE_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_LOCATION, wGS(INFO_LOCATION_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_MD5, wGS(INFO_MD5_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_SIZE, wGS(INFO_SIZE_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CART_ID, wGS(INFO_CART_ID_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_MANUFACTURER, wGS(INFO_MANUFACTURER_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_COUNTRY, wGS(INFO_COUNTRY_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CRC1, wGS(INFO_CRC1_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CRC2, wGS(INFO_CRC2_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CIC_CHIP, wGS(INFO_CIC_CHIP_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CLOSE_BUTTON, wGS(BOTTOM_CLOSE).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMNAME, _this->m_pRomInfo->GetRomName().ToUTF16(stdstr::CODEPAGE_932).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMNAME, _this->m_pRomInfo->GetRomName().ToUTF16(stdstr::CODEPAGE_932).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_FILENAME, stdstr(CPath(_this->m_pRomInfo->GetFileName()).GetNameExtension()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_LOCATION, stdstr(CPath(_this->m_pRomInfo->GetFileName()).GetDriveDirectory()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_FILENAME, stdstr(CPath(_this->m_pRomInfo->GetFileName()).GetNameExtension()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_LOCATION, stdstr(CPath(_this->m_pRomInfo->GetFileName()).GetDriveDirectory()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_MD5, _this->m_pRomInfo->GetRomMD5().ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMSIZE, stdstr_f("%.1f MBit", (float)_this->m_pRomInfo->GetRomSize() / 0x20000).ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_MD5, _this->m_pRomInfo->GetRomMD5().ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMSIZE, stdstr_f("%.1f MBit", (float)_this->m_pRomInfo->GetRomSize() / 0x20000).ToUTF16().c_str());
BYTE * RomHeader = _this->m_pRomInfo->GetRomAddress();
SetDlgItemTextW(hDlg, IDC_INFO_CARTID, stdstr_f("%c%c", RomHeader[0x3F], RomHeader[0x3E]).ToUTF16().c_str());
BYTE * RomHeader = _this->m_pRomInfo->GetRomAddress();
SetDlgItemTextW(hDlg, IDC_INFO_CARTID, stdstr_f("%c%c", RomHeader[0x3F], RomHeader[0x3E]).ToUTF16().c_str());
switch (RomHeader[0x38])
{
case 'N': SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"Nintendo"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"None"); break;
default: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"(Unknown)"); break;
}
switch (RomHeader[0x38])
{
case 'N': SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"Nintendo"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"None"); break;
default: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"(Unknown)"); break;
}
switch (RomHeader[0x3D])
{
case NTSC_BETA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Beta"); break;
case X_NTSC: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"NTSC"); break;
case Germany: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Germany"); break;
case USA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"America"); break;
case french: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"France"); break;
case Italian: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Italy"); break;
case Japan: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Japan"); break;
case Europe: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Europe"); break;
case Spanish: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Spain"); break;
case Australia: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Australia"); break;
case X_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case Y_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"None"); break;
default:
SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, stdstr_f(" Unknown %c (%02X)", RomHeader[0x3D], RomHeader[0x3D]).ToUTF16().c_str());
}
SetDlgItemTextW(hDlg, IDC_INFO_CRC1, stdstr_f("0x%08X", *(uint32_t *)(RomHeader + 0x10)).ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_CRC2, stdstr_f("0x%08X", *(DWORD *)(RomHeader + 0x14)).ToUTF16().c_str());
switch (RomHeader[0x3D])
{
case NTSC_BETA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Beta"); break;
case X_NTSC: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"NTSC"); break;
case Germany: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Germany"); break;
case USA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"America"); break;
case french: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"France"); break;
case Italian: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Italy"); break;
case Japan: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Japan"); break;
case Europe: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Europe"); break;
case Spanish: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Spain"); break;
case Australia: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Australia"); break;
case X_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case Y_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"None"); break;
default:
SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, stdstr_f(" Unknown %c (%02X)", RomHeader[0x3D], RomHeader[0x3D]).ToUTF16().c_str());
}
SetDlgItemTextW(hDlg, IDC_INFO_CRC1, stdstr_f("0x%08X", *(uint32_t *)(RomHeader + 0x10)).ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_CRC2, stdstr_f("0x%08X", *(DWORD *)(RomHeader + 0x14)).ToUTF16().c_str());
std::wstring CicChip;
switch (_this->m_pRomInfo->CicChipID())
{
case CIC_UNKNOWN: CicChip = L"Unknown"; break;
case CIC_NUS_8303: CicChip = L"CIC-NUS-8303"; break;
case CIC_NUS_5167: CicChip = L"CIC-NUS-5167"; break;
case CIC_NUS_DDUS: CicChip = L"CIC-NUS-????"; break;
default: CicChip = stdstr_f("CIC-NUS-610%d", _this->m_pRomInfo->CicChipID()).ToUTF16(); break;
}
SetDlgItemTextW(hDlg, IDC_INFO_CIC, CicChip.c_str());
}
else
{
SetWindowTextW(hDlg, wGS(INFO_TITLE).c_str());
std::wstring CicChip;
switch (_this->m_pRomInfo->CicChipID())
{
case CIC_UNKNOWN: CicChip = L"Unknown"; break;
case CIC_NUS_8303: CicChip = L"CIC-NUS-8303"; break;
case CIC_NUS_5167: CicChip = L"CIC-NUS-5167"; break;
case CIC_NUS_DDUS: CicChip = L"CIC-NUS-????"; break;
default: CicChip = stdstr_f("CIC-NUS-610%d", _this->m_pRomInfo->CicChipID()).ToUTF16(); break;
}
SetDlgItemTextW(hDlg, IDC_INFO_CIC, CicChip.c_str());
}
else
{
SetWindowTextW(hDlg, wGS(INFO_TITLE).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_NAME, wGS(INFO_ROM_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_FILE_NAME, wGS(INFO_FILE_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_LOCATION, wGS(INFO_LOCATION_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_ROM_MD5, wGS(INFO_MD5_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_ROM_SIZE, wGS(INFO_SIZE_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CART_ID, wGS(INFO_CART_ID_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_MANUFACTURER, wGS(INFO_MANUFACTURER_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_COUNTRY, wGS(INFO_COUNTRY_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CRC1, wGS(INFO_CRC1_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CRC2, wGS(INFO_CRC2_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CIC_CHIP, wGS(INFO_CIC_CHIP_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CLOSE_BUTTON, wGS(BOTTOM_CLOSE).c_str());
SetDlgItemTextW(hDlg, IDC_ROM_NAME, wGS(INFO_ROM_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_FILE_NAME, wGS(INFO_FILE_NAME_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_LOCATION, wGS(INFO_LOCATION_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_ROM_MD5, wGS(INFO_MD5_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_ROM_SIZE, wGS(INFO_SIZE_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CART_ID, wGS(INFO_CART_ID_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_MANUFACTURER, wGS(INFO_MANUFACTURER_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_COUNTRY, wGS(INFO_COUNTRY_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CRC1, wGS(INFO_CRC1_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CRC2, wGS(INFO_CRC2_TEXT).c_str());
//SetDlgItemTextW(hDlg, IDC_CIC_CHIP, wGS(INFO_CIC_CHIP_TEXT).c_str());
SetDlgItemTextW(hDlg, IDC_CLOSE_BUTTON, wGS(BOTTOM_CLOSE).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMNAME, _this->m_pDiskInfo->GetRomName().ToUTF16(stdstr::CODEPAGE_932).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_ROMNAME, _this->m_pDiskInfo->GetRomName().ToUTF16(stdstr::CODEPAGE_932).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_FILENAME, stdstr(CPath(_this->m_pDiskInfo->GetFileName()).GetNameExtension()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_LOCATION, stdstr(CPath(_this->m_pDiskInfo->GetFileName()).GetDriveDirectory()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_FILENAME, stdstr(CPath(_this->m_pDiskInfo->GetFileName()).GetNameExtension()).ToUTF16(CP_ACP).c_str());
SetDlgItemTextW(hDlg, IDC_INFO_LOCATION, stdstr(CPath(_this->m_pDiskInfo->GetFileName()).GetDriveDirectory()).ToUTF16(CP_ACP).c_str());
//SetDlgItemTextW(hDlg, IDC_INFO_MD5, _this->m_pRomInfo->GetRomMD5().ToUTF16().c_str());
//SetDlgItemTextW(hDlg, IDC_INFO_ROMSIZE, stdstr_f("%.1f MBit", (float)_this->m_pDiskInfo->GetRomSize() / 0x20000).ToUTF16().c_str());
//SetDlgItemTextW(hDlg, IDC_INFO_MD5, _this->m_pRomInfo->GetRomMD5().ToUTF16().c_str());
//SetDlgItemTextW(hDlg, IDC_INFO_ROMSIZE, stdstr_f("%.1f MBit", (float)_this->m_pDiskInfo->GetRomSize() / 0x20000).ToUTF16().c_str());
BYTE * DiskHeader = _this->m_pDiskInfo->GetDiskAddress() + 0x43670;
SetDlgItemTextW(hDlg, IDC_INFO_CARTID, stdstr_f("%c%c", DiskHeader[0x02], DiskHeader[0x01]).ToUTF16().c_str());
BYTE * DiskHeader = _this->m_pDiskInfo->GetDiskAddress() + 0x43670;
SetDlgItemTextW(hDlg, IDC_INFO_CARTID, stdstr_f("%c%c", DiskHeader[0x02], DiskHeader[0x01]).ToUTF16().c_str());
/*switch (DiskHeader[0x00])
{
case 'N': SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"Nintendo"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"None"); break;
default: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"(Unknown)"); break;
}*/
/*switch (DiskHeader[0x00])
{
case 'N': SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"Nintendo"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"None"); break;
default: SetDlgItemTextW(hDlg, IDC_INFO_MANUFACTURER, L"(Unknown)"); break;
}*/
switch (DiskHeader[0x00])
{
case NTSC_BETA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Beta"); break;
case X_NTSC: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"NTSC"); break;
case Germany: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Germany"); break;
case USA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"America"); break;
case french: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"France"); break;
case Italian: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Italy"); break;
case Japan: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Japan"); break;
case Europe: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Europe"); break;
case Spanish: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Spain"); break;
case Australia: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Australia"); break;
case X_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case Y_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"None"); break;
default:
SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, stdstr_f(" Unknown %c (%02X)", DiskHeader[0x03], DiskHeader[0x03]).ToUTF16().c_str());
}
SetDlgItemTextW(hDlg, IDC_INFO_CRC1, stdstr_f("0x%08X", *(uint32_t *)(_this->m_pDiskInfo->GetDiskAddress())).ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_CRC2, stdstr_f("0x%08X", *(DWORD *)(DiskHeader)).ToUTF16().c_str());
/*
std::wstring CicChip;
switch (_this->m_pRomInfo->CicChipID())
{
case CIC_UNKNOWN: CicChip = L"Unknown"; break;
case CIC_NUS_8303: CicChip = L"CIC-NUS-8303"; break;
case CIC_NUS_5167: CicChip = L"CIC-NUS-5167"; break;
case CIC_NUS_DDUS: CicChip = L"CIC-NUS-????"; break;
default: CicChip = stdstr_f("CIC-NUS-610%d", _this->m_pRomInfo->CicChipID()).ToUTF16(); break;
}
SetDlgItemTextW(hDlg, IDC_INFO_CIC, CicChip.c_str());
*/
}
switch (DiskHeader[0x00])
{
case NTSC_BETA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Beta"); break;
case X_NTSC: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"NTSC"); break;
case Germany: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Germany"); break;
case USA: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"America"); break;
case french: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"France"); break;
case Italian: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Italy"); break;
case Japan: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Japan"); break;
case Europe: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Europe"); break;
case Spanish: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Spain"); break;
case Australia: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"Australia"); break;
case X_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case Y_PAL: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"PAL"); break;
case 0: SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, L"None"); break;
default:
SetDlgItemTextW(hDlg, IDC_INFO_COUNTRY, stdstr_f(" Unknown %c (%02X)", DiskHeader[0x03], DiskHeader[0x03]).ToUTF16().c_str());
}
SetDlgItemTextW(hDlg, IDC_INFO_CRC1, stdstr_f("0x%08X", *(uint32_t *)(_this->m_pDiskInfo->GetDiskAddress())).ToUTF16().c_str());
SetDlgItemTextW(hDlg, IDC_INFO_CRC2, stdstr_f("0x%08X", *(DWORD *)(DiskHeader)).ToUTF16().c_str());
/*
std::wstring CicChip;
switch (_this->m_pRomInfo->CicChipID())
{
case CIC_UNKNOWN: CicChip = L"Unknown"; break;
case CIC_NUS_8303: CicChip = L"CIC-NUS-8303"; break;
case CIC_NUS_5167: CicChip = L"CIC-NUS-5167"; break;
case CIC_NUS_DDUS: CicChip = L"CIC-NUS-????"; break;
default: CicChip = stdstr_f("CIC-NUS-610%d", _this->m_pRomInfo->CicChipID()).ToUTF16(); break;
}
SetDlgItemTextW(hDlg, IDC_INFO_CIC, CicChip.c_str());
*/
}
}
break;
case WM_COMMAND:

View File

@ -13,17 +13,17 @@
class RomInformation
{
bool const m_DeleteRomInfo;
bool const m_DeleteDiskInfo;
bool const m_DeleteDiskInfo;
stdstr const m_FileName;
CN64Rom * m_pRomInfo;
CN64Disk * m_pDiskInfo;
CN64Disk * m_pDiskInfo;
friend DWORD CALLBACK RomInfoProc(HWND, DWORD, DWORD, DWORD);
public:
RomInformation(const char* RomFile);
RomInformation(CN64Rom* RomInfo);
RomInformation(CN64Disk* DiskInfo);
RomInformation(CN64Disk* DiskInfo);
~RomInformation();
void DisplayInformation(HWND hParent) const;

View File

@ -37,16 +37,16 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
else
{
//Ext is *.ndd, so it should be a disk file.
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(NULL, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str());
}
}
if (!CPath(g_Settings->LoadStringVal(File_DiskIPLPath)).Exists() || !g_BaseSystem->RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str()))
{
CPath FileNameIPL;
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
if (FileNameIPL.SelectFile(NULL, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
g_Settings->SaveString(File_DiskIPLPath, (const char *)FileNameIPL);
g_BaseSystem->RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str());
}
}
}
}
else