support some rogue FDS disk format
This commit is contained in:
parent
d3f088a0bc
commit
de71c0d8c7
|
@ -92,6 +92,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
/// <param name="diskimage"></param>
|
/// <param name="diskimage"></param>
|
||||||
public void SetDiskImage(byte[] diskimage)
|
public void SetDiskImage(byte[] diskimage)
|
||||||
{
|
{
|
||||||
|
// each FDS format is worse than the last
|
||||||
|
if (diskimage.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("\x01*NI")))
|
||||||
|
{
|
||||||
|
int nsides = diskimage.Length / 65500;
|
||||||
|
|
||||||
|
MemoryStream ms = new MemoryStream();
|
||||||
|
ms.Write(System.Text.Encoding.ASCII.GetBytes("FDS\x1A"), 0, 4);
|
||||||
|
ms.WriteByte((byte)nsides);
|
||||||
|
byte[] nulls = new byte[11];
|
||||||
|
ms.Write(nulls, 0, 11);
|
||||||
|
ms.Write(diskimage, 0, diskimage.Length);
|
||||||
|
ms.Close();
|
||||||
|
diskimage = ms.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
this.diskimage = diskimage;
|
this.diskimage = diskimage;
|
||||||
diskdiffs = new byte[NumSides][];
|
diskdiffs = new byte[NumSides][];
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,7 +590,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
hash_sha1_several.Add(hash_sha1);
|
hash_sha1_several.Add(hash_sha1);
|
||||||
LoadWriteLine("headerless rom hash: {0}", hash_sha1);
|
LoadWriteLine("headerless rom hash: {0}", hash_sha1);
|
||||||
}
|
}
|
||||||
else if (file.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("FDS\x1A")))
|
else if (file.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("FDS\x1A"))
|
||||||
|
|| file.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("\x01*NI")))
|
||||||
{
|
{
|
||||||
// there's not much else to do with FDS images other than to feed them to the board
|
// there's not much else to do with FDS images other than to feed them to the board
|
||||||
origin = EDetectionOrigin.FDS;
|
origin = EDetectionOrigin.FDS;
|
||||||
|
|
Loading…
Reference in New Issue