CDL - fix snes games with no cartram

This commit is contained in:
zeromus 2015-11-03 23:59:42 -06:00
parent fb7ed39944
commit c68fdc511b
4 changed files with 24 additions and 4 deletions

View File

@ -48,6 +48,11 @@ namespace BizHawk.Emulation.Common
/// </summary>
Dictionary<string, GCHandle> Pins = new Dictionary<string, GCHandle>();
/// <summary>
/// Whether the CDL is tracking a block with the given name
/// </summary>
public bool Has(string blockname) { return ContainsKey(blockname); }
/// <summary>
/// This is just a hook, if needed, to readily suspend logging, without having to rewire the core
/// </summary>

View File

@ -209,9 +209,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
{
WritePipePointer(cdl.GetPin("CARTROM"),false);
bwPipe.Write(cdl["CARTROM"].Length);
WritePipePointer(cdl.GetPin("CARTRAM"), false);
bwPipe.Write(cdl["CARTRAM"].Length);
if (cdl.Has("CARTRAM"))
{
WritePipePointer(cdl.GetPin("CARTRAM"), false);
bwPipe.Write(cdl["CARTRAM"].Length);
}
else
{
WritePipePointer(IntPtr.Zero);
WritePipePointer(IntPtr.Zero);
}
WritePipePointer(cdl.GetPin("WRAM"));
bwPipe.Write(cdl["WRAM"].Length);

View File

@ -185,7 +185,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public void NewCDL(CodeDataLog cdl)
{
cdl["CARTROM"] = new byte[MemoryDomains["CARTROM"].Size];
cdl["CARTRAM"] = new byte[MemoryDomains["CARTRAM"].Size];
if (MemoryDomains.Has("CARTRAM"))
cdl["CARTRAM"] = new byte[MemoryDomains["CARTRAM"].Size];
cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];
cdl["APURAM"] = new byte[MemoryDomains["APURAM"].Size];

View File

@ -5,6 +5,10 @@
//helpful detailed reg list
//http://wiki.superfamicom.org/snes/show/Registers
//TODO
//SF2 title art doesnt seem to show up..
//scanline control doesnt work?
using System;
namespace BizHawk.Emulation.Cores.Nintendo.SNES