pcsx2:cli: support the elf option properly

This commit is contained in:
Gregory Hainaut 2015-12-22 16:34:33 +01:00
parent 49123cca59
commit 81891ac109
2 changed files with 23 additions and 0 deletions

View File

@ -290,11 +290,14 @@ public:
// is set to ISO.
wxString IsoFile;
wxString ElfFile;
// Specifies the CDVD source type to use when AutoRunning
CDVD_SourceType CdvdSource;
// Indicates if PCSX2 should autorun the configured CDVD source and/or ISO file.
bool SysAutoRun;
bool SysAutoRunElf;
StartupOptions()
{
@ -303,7 +306,10 @@ public:
PortableMode = false;
NoFastBoot = false;
SysAutoRun = false;
SysAutoRunElf = false;
CdvdSource = CDVDsrc_NoDisc;
IsoFile = "";
ElfFile = "";
}
};

View File

@ -346,6 +346,14 @@ bool Pcsx2App::OnCmdLineParsed( wxCmdLineParser& parser )
Startup.IsoFile = parser.GetParam( 0 );
Startup.SysAutoRun = true;
}
else
{
wxString elf_file;
if (parser.Found(L"elf", &elf_file) && !elf_file.IsEmpty()) {
Startup.SysAutoRunElf = true;
Startup.ElfFile = elf_file;
}
}
if( parser.Found(L"usecd") )
{
@ -485,6 +493,15 @@ bool Pcsx2App::OnInit()
SysUpdateIsoSrcFile( Startup.IsoFile );
sApp.SysExecute( Startup.CdvdSource );
}
else if ( Startup.SysAutoRunElf )
{
g_Conf->EmuOptions.UseBOOT2Injection = true;
// Enable iop/ee logging
SysConsole.eeConsole.Enabled = true;
SysConsole.iopConsole.Enabled = true;
sApp.SysExecute( Startup.CdvdSource, Startup.ElfFile );
}
}
// ----------------------------------------------------------------------------
catch( Exception::StartupAborted& ex ) // user-aborted, no popups needed.