nes: try (and fail) to support some bad dumps of FAMICOM JUMP 2. meh. the good one works anyway.

batchrunner: keep track of number of lag frames and print to output
This commit is contained in:
goyuken 2014-01-21 19:08:11 +00:00
parent 7d73f700bc
commit 3c357a7d83
2 changed files with 22 additions and 2 deletions
BizHawk.Client.EmuHawk/tools
BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards

View File

@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk
public string Filename; // name of file
public string Fullname; // filename + subfilename
public GameInfo GI;
public Type CoreType; // actual type of the core that was returned
public enum EStatus
{
@ -52,9 +52,12 @@ namespace BizHawk.Client.EmuHawk
public EStatus Status; // what happened
public List<string> Messages = new List<string>();
public int Frames; // number of frames successfully run
public int LaggedFrames; // number of those that were lagged
public void DumpToTW(System.IO.TextWriter tw)
{
tw.WriteLine("{0}\t{1}\t{2}\t{3}", Filename, Fullname, CoreType, Status);
tw.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", Filename, Fullname, CoreType, Status, Frames, LaggedFrames);
}
}
@ -156,6 +159,9 @@ namespace BizHawk.Client.EmuHawk
current.CoreType = emu.GetType();
emu.Controller = new Controller(emu.ControllerDefinition);
current.Frames = 0;
current.LaggedFrames = 0;
for (int i = 0; i < numframes; i++)
{
try
@ -165,6 +171,9 @@ namespace BizHawk.Client.EmuHawk
emu.FrameAdvance(true, true);
// some cores really really really like it if you drain their audio every frame
emu.SyncSoundProvider.GetSamples(out samp, out nsamp);
current.Frames++;
if (emu.IsLagFrame)
current.LaggedFrames++;
}
catch (Exception e)
{

View File

@ -105,6 +105,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
regs_wram_enable = false;
break;
case "MAPPER016": // [7]
if (Cart.prg_size > 256)
{
// you have two options:
// 1) assume prg > 256 => jump2 (aka mapper 153, type [5])
// this will break hypothetical prg oversize hacks
// 2) assume prg > 256 => oversize regular FCG
// this will break famicom 2 dumps without hash match,
// which are marked mapper016 usually
goto case "MAPPER153";
}
AssertPrg(128, 256); AssertChr(128, 256);
Cart.wram_size = 0;
regs_prg_enable = true;
@ -118,6 +128,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
Cart.wram_size = 8;
regs_prg_enable = true;
regs_wram_enable = false;
jump2 = true;
break;
case "BANDAI-JUMP2": // [5]
AssertPrg(512);