Pass forced core through other paths in RomLoader
fixes c0b6bf61b; not sure if this matters currently (PCE-CD maybe?) but it may become important if we add more alternate cores
This commit is contained in:
parent
e65e77e7cd
commit
d2fb794340
|
@ -305,7 +305,7 @@ namespace BizHawk.Client.Common
|
||||||
return game;
|
return game;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, out IEmulator nextEmulator, out GameInfo game)
|
private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, string forcedCoreName, out IEmulator nextEmulator, out GameInfo game)
|
||||||
{
|
{
|
||||||
var disc = DiscExtensions.CreateAnyType(path, str => DoLoadErrorCallback(str, "???", LoadErrorType.DiscError));
|
var disc = DiscExtensions.CreateAnyType(path, str => DoLoadErrorCallback(str, "???", LoadErrorType.DiscError));
|
||||||
if (disc == null)
|
if (disc == null)
|
||||||
|
@ -331,11 +331,11 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
nextEmulator = MakeCoreFromCoreInventory(cip);
|
nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadM3U(string path, CoreComm nextComm, HawkFile file, out IEmulator nextEmulator, out GameInfo game)
|
private void LoadM3U(string path, CoreComm nextComm, HawkFile file, string forcedCoreName, out IEmulator nextEmulator, out GameInfo game)
|
||||||
{
|
{
|
||||||
M3U_File m3u;
|
M3U_File m3u;
|
||||||
using (var sr = new StreamReader(path))
|
using (var sr = new StreamReader(path))
|
||||||
|
@ -370,7 +370,7 @@ namespace BizHawk.Client.Common
|
||||||
Game = game,
|
Game = game,
|
||||||
Discs = discs
|
Discs = discs
|
||||||
};
|
};
|
||||||
nextEmulator = MakeCoreFromCoreInventory(cip);
|
nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEmulator MakeCoreFromCoreInventory(CoreInventoryParameters cip, string forcedCoreName = null)
|
private IEmulator MakeCoreFromCoreInventory(CoreInventoryParameters cip, string forcedCoreName = null)
|
||||||
|
@ -523,7 +523,7 @@ namespace BizHawk.Client.Common
|
||||||
game = rom.GameInfo;
|
game = rom.GameInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadXML(string path, CoreComm nextComm, HawkFile file, out IEmulator nextEmulator, out RomGame rom, out GameInfo game)
|
private bool LoadXML(string path, CoreComm nextComm, HawkFile file, string forcedCoreName, out IEmulator nextEmulator, out RomGame rom, out GameInfo game)
|
||||||
{
|
{
|
||||||
nextEmulator = null;
|
nextEmulator = null;
|
||||||
rom = null;
|
rom = null;
|
||||||
|
@ -564,7 +564,7 @@ namespace BizHawk.Client.Common
|
||||||
})
|
})
|
||||||
.ToList(),
|
.ToList(),
|
||||||
};
|
};
|
||||||
nextEmulator = MakeCoreFromCoreInventory(cip);
|
nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -689,10 +689,10 @@ namespace BizHawk.Client.Common
|
||||||
switch (ext)
|
switch (ext)
|
||||||
{
|
{
|
||||||
case ".m3u":
|
case ".m3u":
|
||||||
LoadM3U(path, nextComm, file, out nextEmulator, out game);
|
LoadM3U(path, nextComm, file, forcedCoreName, out nextEmulator, out game);
|
||||||
break;
|
break;
|
||||||
case ".xml":
|
case ".xml":
|
||||||
if (!LoadXML(path, nextComm, file, out nextEmulator, out rom, out game))
|
if (!LoadXML(path, nextComm, file, forcedCoreName, out nextEmulator, out rom, out game))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case ".psf":
|
case ".psf":
|
||||||
|
@ -704,7 +704,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (file.IsArchive)
|
if (file.IsArchive)
|
||||||
throw new InvalidOperationException("Can't load CD files from archives!");
|
throw new InvalidOperationException("Can't load CD files from archives!");
|
||||||
if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game))
|
if (!LoadDisc(path, nextComm, file, ext, forcedCoreName, out nextEmulator, out game))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue