1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Refactor of game loading

This commit is contained in:
Cornee Traas 2013-09-05 09:45:33 +02:00
parent f4b98074b0
commit f25fa26b42

View File

@ -144,59 +144,29 @@ void MainFrame::BootGame(wxCommandEvent& WXUNUSED(event))
Emu.Stop(); Emu.Stop();
const wxString& elf0 = ctrl.GetPath() + "\\PS3_GAME\\USRDIR\\BOOT.BIN"; wxString elf[6] = {
const wxString& elf1 = ctrl.GetPath() + "\\USRDIR\\BOOT.BIN"; "\\PS3_GAME\\USRDIR\\BOOT.BIN",
const wxString& elf2 = ctrl.GetPath() + "\\BOOT.BIN"; "\\USRDIR\\BOOT.BIN",
const wxString& self0 = ctrl.GetPath() + "\\PS3_GAME\\USRDIR\\EBOOT.BIN"; "\\BOOT.BIN",
const wxString& self1 = ctrl.GetPath() + "\\USRDIR\\EBOOT.BIN"; "\\PS3_GAME\\USRDIR\\EBOOT.BIN",
const wxString& self2 = ctrl.GetPath() + "\\EBOOT.BIN"; "\\USRDIR\\EBOOT.BIN",
"\\EBOOT.BIN"
};
if(wxFile::Access(elf0, wxFile::read)) for(int i=0;i<6;i++)
{ {
Emu.SetPath(elf0); if(wxFile::Access(ctrl.GetPath() + elf[i], wxFile::read))
{
Emu.SetPath(ctrl.GetPath() + elf[i]);
ConLog.Write("Elf: booting..."); ConLog.Write("Elf: booting...");
}
else if(wxFile::Access(elf1, wxFile::read))
{
Emu.SetPath(elf1);
ConLog.Write("Elf: booting...");
}
else if(wxFile::Access(elf2, wxFile::read))
{
Emu.SetPath(elf2);
ConLog.Write("Elf: booting...");
}
else if(wxFile::Access(self0, wxFile::read))
{
goto _ELF_NOT_FOUND_;
Emu.SetPath(self0);
ConLog.Warning("Self: booting...");
}
else if(wxFile::Access(self1, wxFile::read))
{
goto _ELF_NOT_FOUND_;
Emu.SetPath(self1);
ConLog.Warning("Self: booting...");
}
else if(wxFile::Access(self2, wxFile::read))
{
goto _ELF_NOT_FOUND_;
Emu.SetPath(self2);
ConLog.Warning("Self: booting...");
}
else
{
ConLog.Error("Not found ps3 game in selected folder! (%s)", ctrl.GetPath());
return;
}
Emu.Load(); Emu.Load();
ConLog.Write("Game: boot done."); ConLog.Write("Game: boot done.");
return; return;
}
}
_ELF_NOT_FOUND_: ConLog.Error("Ps3 executable not found in selected folder (%s)", ctrl.GetPath());
ConLog.Error("Elf not found!"); return;
} }
void MainFrame::BootElf(wxCommandEvent& WXUNUSED(event)) void MainFrame::BootElf(wxCommandEvent& WXUNUSED(event))