From 3c357a7d831f847e3cad8aab58de885cf9827c11 Mon Sep 17 00:00:00 2001 From: goyuken Date: Tue, 21 Jan 2014 19:08:11 +0000 Subject: [PATCH] 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 --- BizHawk.Client.EmuHawk/tools/BatchRunner.cs | 13 +++++++++++-- .../Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs | 11 +++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index 5271d817b1..156320226c 100644 --- a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -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 Messages = new List(); + 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) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs index 69ad2e57c1..0a41d773f5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/BANDAI-FCG-1.cs @@ -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);