NesHawk- move CartInfo into its own file

This commit is contained in:
adelikat 2020-03-19 21:15:07 -05:00
parent dc56dd87e8
commit daab35fc39
4 changed files with 47 additions and 42 deletions

View File

@ -32,7 +32,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public virtual void ClockCpu() { }
public virtual void AtVsyncNmi() { }
public NES.CartInfo Cart => NES.cart;
public CartInfo Cart => NES.cart;
public NES NES { get; set; }
//this is set to true when SyncState is called, so that we know the base class SyncState was used

View File

@ -0,0 +1,44 @@
using System.Collections.Generic;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
/// <summary>
/// All information necessary for a board to set itself up
/// </summary>
public class CartInfo
{
public GameInfo DB_GameInfo;
public string name;
public int trainer_size;
public int chr_size;
public int prg_size;
public int wram_size, vram_size;
public byte pad_h, pad_v;
public bool wram_battery;
public bool bad;
/// <summary>in [0,3]; combination of bits 0 and 3 of flags6. try not to use; will be null for bootgod-identified roms always</summary>
public int? inesmirroring;
public string board_type;
public string pcb;
public string sha1;
public string system;
public List<string> chips = new List<string>();
public string palette; // Palette override for VS system
public byte vs_security; // for VS system games that do a ppu dheck
public override string ToString() => string.Join(",",
$"pr={prg_size}",
$"ch={chr_size}",
$"wr={wram_size}",
$"vr={vram_size}",
$"ba={(wram_battery ? 1 : 0)}",
$"pa={pad_h}|{pad_v}",
$"brd={board_type}",
$"sys={system}");
}
}

View File

@ -106,45 +106,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
INESBoardImplementors.AddRange(normalPriority);
}
/// <summary>
/// All information necessary for a board to set itself up
/// </summary>
public class CartInfo
{
public GameInfo DB_GameInfo;
public string name;
public int trainer_size;
public int chr_size;
public int prg_size;
public int wram_size, vram_size;
public byte pad_h, pad_v;
public bool wram_battery;
public bool bad;
/// <summary>in [0,3]; combination of bits 0 and 3 of flags6. try not to use; will be null for bootgod-identified roms always</summary>
public int? inesmirroring;
public string board_type;
public string pcb;
public string sha1;
public string system;
public List<string> chips = new List<string>();
public string palette; // Palette override for VS system
public byte vs_security; // for VS system games that do a ppu dheck
public override string ToString() => string.Join(",",
$"pr={prg_size}",
$"ch={chr_size}",
$"wr={wram_size}",
$"vr={vram_size}",
$"ba={(wram_battery ? 1 : 0)}",
$"pa={pad_h}|{pad_v}",
$"brd={board_type}",
$"sys={system}");
}
/// <summary>
/// finds a board class which can handle the provided cart
/// </summary>

View File

@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
/// </summary>
public class Unif
{
NES.CartInfo ci = new NES.CartInfo();
CartInfo ci = new CartInfo();
byte[] prgrom;
byte[] chrrom;
@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
chrrom = null;
}
public NES.CartInfo CartInfo => ci;
public CartInfo CartInfo => ci;
public byte[] PRG => prgrom;
public byte[] CHR => chrrom;
}