Small refactor in `DiscMountJob.RunBizHawk`
This commit is contained in:
parent
10478e23f1
commit
2b59cfc1c4
|
@ -189,25 +189,17 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
LoadCue(Path.GetDirectoryName(IN_FromPath), File.ReadAllText(IN_FromPath));
|
LoadCue(Path.GetDirectoryName(IN_FromPath), File.ReadAllText(IN_FromPath));
|
||||||
break;
|
break;
|
||||||
case ".iso":
|
case ".iso":
|
||||||
{
|
// make a fake .cue file to represent this .iso and mount that
|
||||||
// make a fake .cue file to represent this .iso and mount that
|
// however... to save many users from a stupid mistake, check if the size is NOT a multiple of 2048 (but IS a multiple of 2352) and in that case consider it a mode2 disc
|
||||||
//however... to save many users from a stupid mistake, check if the size is NOT a multiple of 2048 (but IS a multiple of 2352) and in that case consider it a mode2 disc
|
//TODO try it both ways and check the disc type to use whichever one succeeds in identifying a disc type
|
||||||
//TODO - try it both ways and check the disc type to use whichever one succeeds in identifying a disc type
|
var len = new FileInfo(IN_FromPath).Length;
|
||||||
var len = new FileInfo(IN_FromPath).Length;
|
LoadCue(
|
||||||
string mode1cue = $@"
|
Path.GetDirectoryName(IN_FromPath),
|
||||||
FILE ""{Path.GetFileName(IN_FromPath)}"" BINARY
|
$@"
|
||||||
TRACK 01 MODE1/2048
|
FILE ""{Path.GetFileName(IN_FromPath)}"" BINARY
|
||||||
INDEX 01 00:00:00";
|
TRACK 01 {(len % 2048 is not 0 && len % 2352 is 0 ? "MODE2/2352" : "MODE1/2048")}
|
||||||
string mode2cue = $@"
|
INDEX 01 00:00:00");
|
||||||
FILE ""{Path.GetFileName(IN_FromPath)}"" BINARY
|
break;
|
||||||
TRACK 01 MODE2/2352
|
|
||||||
INDEX 01 00:00:00";
|
|
||||||
if (len % 2048 != 0 && len % 2352 == 0)
|
|
||||||
LoadCue(Path.GetDirectoryName(IN_FromPath), mode2cue);
|
|
||||||
else
|
|
||||||
LoadCue(Path.GetDirectoryName(IN_FromPath), mode1cue);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ".mds":
|
case ".mds":
|
||||||
OUT_Disc = new MDS_Format().LoadMDSToDisc(IN_FromPath, IN_DiscMountPolicy);
|
OUT_Disc = new MDS_Format().LoadMDSToDisc(IN_FromPath, IN_DiscMountPolicy);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue