Revert "Remove "direct" bin file handling"
This reverts commit a2d97dfb5f
.
This commit is contained in:
parent
e29a4bc052
commit
7514ea73c7
|
@ -485,6 +485,34 @@ namespace BizHawk.Client.Common
|
|||
game.System = VSystemID.Raw.SGB;
|
||||
}
|
||||
break;
|
||||
case VSystemID.Raw.PSX when ext is ".bin":
|
||||
const string FILE_EXT_CUE = ".cue";
|
||||
var cuePath = TempFileManager.GetTempFilename(friendlyName: "syn", dotAndExtension: FILE_EXT_CUE, delete: false);
|
||||
DiscMountJob.CreateSyntheticCue(cueFilePath: cuePath, binFilePath: file.Name);
|
||||
var gameBak = game;
|
||||
var nextEmulatorBak = nextEmulator;
|
||||
try
|
||||
{
|
||||
if (LoadDisc(
|
||||
path: cuePath,
|
||||
nextComm,
|
||||
new(cuePath),
|
||||
ext: FILE_EXT_CUE,
|
||||
forcedCoreName: forcedCoreName,
|
||||
out nextEmulator,
|
||||
out game))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Console.WriteLine("synthesised .cue failed to load");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"synthesised .cue failed to load: {e}");
|
||||
}
|
||||
game = gameBak;
|
||||
nextEmulator = nextEmulatorBak;
|
||||
break;
|
||||
}
|
||||
var cip = new CoreInventoryParameters(this)
|
||||
{
|
||||
|
|
|
@ -230,5 +230,10 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
var len = new FileInfo(binFilePath).Length;
|
||||
return GenerateCue(binFilename, isMode2: len % 2048 is not 0 && len % 2352 is 0);
|
||||
}
|
||||
|
||||
public static void CreateSyntheticCue(string cueFilePath, string binFilePath)
|
||||
=> File.WriteAllText(
|
||||
path: cueFilePath,
|
||||
contents: GenerateCue(binFilename: binFilePath/*abs is fine here*/, binFilePath: binFilePath)); //TODO as with .iso, may want to try both
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue