diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs index d9b84a5947..c397dccb03 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/FDS/FDS.cs @@ -92,6 +92,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /// 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; diskdiffs = new byte[NumSides][]; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index 478b963af8..9ae4b580ca 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -590,7 +590,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES hash_sha1_several.Add(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 origin = EDetectionOrigin.FDS;