diff --git a/BizHawk.Emulation.Common/CodeDataLog.cs b/BizHawk.Emulation.Common/CodeDataLog.cs index 4ce09f858c..7f17185bba 100644 --- a/BizHawk.Emulation.Common/CodeDataLog.cs +++ b/BizHawk.Emulation.Common/CodeDataLog.cs @@ -48,6 +48,11 @@ namespace BizHawk.Emulation.Common /// Dictionary Pins = new Dictionary(); + /// + /// Whether the CDL is tracking a block with the given name + /// + public bool Has(string blockname) { return ContainsKey(blockname); } + /// /// This is just a hook, if needed, to readily suspend logging, without having to rewire the core /// diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs index 392f88b995..93c514e285 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi_QUERY.cs @@ -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); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index 3f0ed40510..ad7b619b62 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -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]; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs index 537bfed059..1f3ac22c98 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/SNESGraphicsDecoder.cs @@ -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