quicknes: use bootgod db to display helpful information about roms (except galaxian). no effect on emulation
This commit is contained in:
parent
2cb1cfa7df
commit
e87f0ceba7
|
@ -3091,6 +3091,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
Global.Game.Status = nes.RomStatus;
|
Global.Game.Status = nes.RomStatus;
|
||||||
}
|
}
|
||||||
|
else if (loader.LoadedEmulator is QuickNES)
|
||||||
|
{
|
||||||
|
var qns = loader.LoadedEmulator as QuickNES;
|
||||||
|
if (!string.IsNullOrWhiteSpace(qns.BootGodName))
|
||||||
|
{
|
||||||
|
Global.Game.Name = qns.BootGodName;
|
||||||
|
}
|
||||||
|
if (qns.BootGodStatus.HasValue)
|
||||||
|
{
|
||||||
|
Global.Game.Status = qns.BootGodStatus.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetWindowText();
|
SetWindowText();
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
||||||
static QuickNES()
|
static QuickNES()
|
||||||
{
|
{
|
||||||
LibQuickNES.qn_setup_mappers();
|
LibQuickNES.qn_setup_mappers();
|
||||||
|
Emulation.Cores.Nintendo.NES.NES.BootGodDB.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuickNES(CoreComm nextComm, byte[] Rom, object Settings)
|
public QuickNES(CoreComm nextComm, byte[] Rom, object Settings)
|
||||||
|
@ -85,6 +86,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
||||||
CoreComm.VsyncNum = 39375000;
|
CoreComm.VsyncNum = 39375000;
|
||||||
CoreComm.VsyncDen = 655171;
|
CoreComm.VsyncDen = 655171;
|
||||||
PutSettings(Settings ?? new QuickNESSettings());
|
PutSettings(Settings ?? new QuickNESSettings());
|
||||||
|
|
||||||
|
ComputeBootGod();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -385,6 +388,44 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region bootgod
|
||||||
|
|
||||||
|
public RomStatus? BootGodStatus { get; private set; }
|
||||||
|
public string BootGodName { get; private set; }
|
||||||
|
|
||||||
|
void ComputeBootGod()
|
||||||
|
{
|
||||||
|
// inefficient, sloppy, etc etc
|
||||||
|
var chrrom = MemoryDomains["CHR VROM"];
|
||||||
|
var prgrom = MemoryDomains["PRG ROM"];
|
||||||
|
|
||||||
|
var ms = new System.IO.MemoryStream();
|
||||||
|
for (int i = 0; i < prgrom.Size; i++)
|
||||||
|
ms.WriteByte(prgrom.PeekByte(i));
|
||||||
|
if (chrrom != null)
|
||||||
|
for (int i = 0; i < chrrom.Size; i++)
|
||||||
|
ms.WriteByte(chrrom.PeekByte(i));
|
||||||
|
|
||||||
|
string sha1 = BizHawk.Common.BufferExtensions.BufferExtensions.HashSHA1(ms.ToArray());
|
||||||
|
Console.WriteLine("Hash for BootGod: {0}", sha1);
|
||||||
|
sha1 = "sha1:" + sha1; // huh?
|
||||||
|
var carts = Emulation.Cores.Nintendo.NES.NES.BootGodDB.Instance.Identify(sha1);
|
||||||
|
if (carts.Count > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("BootGod entry found: {0}", carts[0].name);
|
||||||
|
BootGodStatus = RomStatus.GoodDump;
|
||||||
|
BootGodName = carts[0].name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("No BootGod entry found.");
|
||||||
|
BootGodStatus = null;
|
||||||
|
BootGodName = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region settings
|
#region settings
|
||||||
|
|
||||||
public class QuickNESSettings
|
public class QuickNESSettings
|
||||||
|
|
Loading…
Reference in New Issue