Embedded ZX Roms (allowed for distribution from AMSTRAD)

This commit is contained in:
Asnivor 2017-12-11 09:05:12 +00:00
parent b6ddf03c96
commit e155bb05fc
12 changed files with 90 additions and 2 deletions

View File

@ -308,6 +308,7 @@ namespace BizHawk.Emulation.Common
break;
case ".TAP":
byte[] head = File.ReadAllBytes(fileName).Take(8).ToArray();
if (System.Text.Encoding.Default.GetString(head).Contains("C64-TAPE"))
game.System = "C64";

View File

@ -51,10 +51,12 @@ namespace BizHawk.Emulation.Common
FirmwareAndOption("D3B78C3DBAC55F5199F33F3FE0036439811F7FB3", 16384, "C64", "Drive1541II", "drive-1541ii.bin", "1541-II Disk Drive Rom");
// ZX Spectrum
/* These are now shipped with bizhawk
FirmwareAndOption("5EA7C2B824672E914525D1D5C419D71B84A426A2", 16384, "ZXSpectrum", "48ROM", "48.ROM", "Spectrum 48K ROM");
FirmwareAndOption("16375D42EA109B47EDDED7A16028DE7FDB3013A1", 32768, "ZXSpectrum", "128ROM", "128.ROM", "Spectrum 128K ROM");
FirmwareAndOption("8CAFB292AF58617907B9E6B9093D3588A75849B8", 32768, "ZXSpectrum", "PLUS2ROM", "PLUS2.ROM", "Spectrum 128K +2 ROM");
FirmwareAndOption("929BF1A5E5687EBD8D7245F9B513A596C0EC21A4", 65536, "ZXSpectrum", "PLUS3ROM", "PLUS3.ROM", "Spectrum 128K +3 ROM");
*/
// for saturn, we think any bios region can pretty much run any iso
// so, we're going to lay this out carefully so that we choose things in a sensible order, but prefer the correct region

View File

@ -1399,8 +1399,12 @@
<None Include="Consoles\Nintendo\NES\Docs\BoardTable.xlsx" />
<None Include="Consoles\Nintendo\NES\Docs\MapperCompatibilityList.url" />
<None Include="Consoles\Nintendo\NES\Docs\nesasm.pdf" />
<None Include="Resources\128.ROM.gz" />
<None Include="Resources\48.ROM.gz" />
<None Include="Resources\cgb_boot.bin.gz" />
<None Include="Resources\dmg_boot.bin.gz" />
<None Include="Resources\plus2.rom.gz" />
<None Include="Resources\plus3.rom.gz" />
<None Include="Resources\sgb-cart-present.spc.gz" />
</ItemGroup>
<ItemGroup />

View File

@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public string SystemId => "ZXSpectrum";
public bool DeterministicEmulation => true;
public bool DeterministicEmulation => false;
public void ResetCounters()
{

View File

@ -116,6 +116,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <summary>
/// The speed at which the tape is loaded
/// NOT IN USE YET
/// </summary>
public enum TapeLoadSpeed
{

View File

@ -1,6 +1,8 @@
using BizHawk.Emulation.Common;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Components;
using BizHawk.Emulation.Cores.Components.Z80A;
using BizHawk.Emulation.Cores.Properties;
using System;
using System.Collections.Generic;
using System.IO;
@ -121,6 +123,32 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return rom;
}
// Amstrad licensed ROMs are free to distribute and shipped with BizHawk
byte[] embeddedRom = new byte[length];
bool embeddedFound = true;
switch (names.FirstOrDefault())
{
case "48ROM":
embeddedRom = Util.DecompressGzipFile(new MemoryStream(Resources.ZX_48_ROM));
break;
case "128ROM":
embeddedRom = Util.DecompressGzipFile(new MemoryStream(Resources.ZX_128_ROM));
break;
case "PLUS2ROM":
embeddedRom = Util.DecompressGzipFile(new MemoryStream(Resources.ZX_plus2_rom));
break;
case "PLUS3ROM":
embeddedRom = Util.DecompressGzipFile(new MemoryStream(Resources.ZX_plus3_rom));
break;
default:
embeddedFound = false;
break;
}
if (embeddedFound)
return embeddedRom;
// Embedded ROM not found, maybe this is a peripheral ROM?
var result = names.Select(n => CoreComm.CoreFileProvider.GetFirmware("ZXSpectrum", n, false)).FirstOrDefault(b => b != null && b.Length == length);
if (result == null)
{

View File

@ -89,5 +89,45 @@ namespace BizHawk.Emulation.Cores.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] ZX_128_ROM {
get {
object obj = ResourceManager.GetObject("ZX_128_ROM", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] ZX_48_ROM {
get {
object obj = ResourceManager.GetObject("ZX_48_ROM", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] ZX_plus2_rom {
get {
object obj = ResourceManager.GetObject("ZX_plus2_rom", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] ZX_plus3_rom {
get {
object obj = ResourceManager.GetObject("ZX_plus3_rom", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View File

@ -127,4 +127,16 @@
<data name="SgbCartPresent_SPC" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sgb-cart-present.spc.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ZX_128_ROM" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\128.ROM.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ZX_48_ROM" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\48.ROM.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ZX_plus2_rom" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\plus2.rom.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ZX_plus3_rom" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\plus3.rom.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.