KiNGKiMO noticed a crash when specifying a iso filename in the cmdline, to make pcsx2 auto-boot that file. I fixed that, and while I was at it, change the bootmodes around.

The way it works now is:
 - Base mode: 0=normal (cdvd plugin), 1=load elf, 2=use iso loader, 3=emulate no disc
 - Bios flag: 65536+base = mode startup through bios boot process. Default is to skip bios.

So for example to load X.iso using the internal iso loader, and executing through the bios, you would now do: pcsx2.exe -bootmode 65538 X.iso

This needs implementing in linux side, and maybe changing it so it's nicer user-wise (for example, reading the number as HEX would make it 10002 instead of 65538).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1593 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2009-08-01 14:25:19 +00:00
parent 5c38811967
commit 4bb4bebd46
5 changed files with 28 additions and 8 deletions

View File

@ -49,7 +49,8 @@ void CALLBACK ISOshutdown()
s32 CALLBACK ISOopen(const char* pTitle)
{
//if (pTitle != NULL) strcpy(isoFileName, pTitle);
if ((pTitle != NULL) && (strlen(pTitle) > 0))
strcpy(isoFileName, pTitle);
iso = isoOpen(isoFileName);
if (iso == NULL)

View File

@ -23,10 +23,15 @@
enum StartupMode
{
BootMode_Bios,
BootMode_Quick,
BootMode_Elf,
BootMode_Normal
BootMode_Normal = 0,
BootMode_Elf = 1, // not compatible with bios flag, probably
BootMode_Iso = 2,
BootMode_NoDisc = 3, // nodisc implies bios.
BootMode_Quick = 0,
BootMode_Bios = 0x10000,
BootMode_ModeMask = 0xFFFF,
};
class StartupParams

View File

@ -965,6 +965,10 @@ int OpenPlugins(const char* pTitleFilename)
{
if (!plugins_initialized)
{
// prevent a crash
if(CDVD.init == NULL)
CDVD = ISO; // CDVD_plugin;
if( InitPlugins() == -1 ) return -1;
}

View File

@ -373,16 +373,26 @@ void RunGui()
{
// Initially bypass GUI and start PCSX2 directly.
// Manually load plugins using the user's configured image (if non-elf).
int mode = g_Startup.BootMode & BootMode_ModeMask;
if( g_Startup.Enabled && (g_Startup.BootMode != BootMode_Elf) )
if( g_Startup.Enabled && (mode != BootMode_Elf) )
{
if(mode == BootMode_Iso)
CDVD=ISO;
else if(mode == BootMode_NoDisc)
CDVD=NODISC;
else
CDVD=CDVD_plugin;
if (OpenPlugins(g_Startup.ImageName) == -1)
return;
}
SysPrepareExecution(
(g_Startup.BootMode == BootMode_Elf) ? g_Startup.ImageName : NULL,
(g_Startup.BootMode == BootMode_Bios)
((g_Startup.BootMode & BootMode_Bios) != 0)
);
}

View File

@ -66,7 +66,7 @@ int SysPageFaultExceptionFilter( EXCEPTION_POINTERS* eps )
int ParseCommandLine( int tokenCount, TCHAR *const *const tokens )
{
int tidx = 0;
g_Startup.BootMode = BootMode_Bios;
g_Startup.BootMode = BootMode_Normal;
while( tidx < tokenCount )
{