From 7bb1baf2abcb78c543cfafa49c142ff56b13f7cd Mon Sep 17 00:00:00 2001 From: goyuken Date: Wed, 12 Dec 2012 03:47:05 +0000 Subject: [PATCH] the hsc in a 7800 is supposed to be a saverammy thing, so hook it up as such. dunno if it actually works --- .../Consoles/Atari/7800/Atari7800.Core.cs | 2 +- .../Consoles/Atari/7800/Atari7800.cs | 31 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.Core.cs b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.Core.cs index ded76dc2c1..0ea5e497be 100644 --- a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.Core.cs +++ b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.Core.cs @@ -17,6 +17,6 @@ namespace BizHawk Cart cart; MachineBase theMachine; EMU7800.Win.GameProgram GameInfo; - + public byte[] hsram = new byte[2048]; } } diff --git a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs index 2b7c262a8a..387df677ed 100644 --- a/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs +++ b/BizHawk.Emulation/Consoles/Atari/7800/Atari7800.cs @@ -56,10 +56,31 @@ namespace BizHawk private int _lagcount = 0; private int _frame = 0; - public byte[] ReadSaveRam() { return null; } - public void StoreSaveRam(byte[] data) { } - public void ClearSaveRam() { } - public bool SaveRamModified { get; set; } + public byte[] ReadSaveRam() + { + return (byte[])hsram.Clone(); + } + public void StoreSaveRam(byte[] data) + { + Buffer.BlockCopy(data, 0, hsram, 0, data.Length); + } + public void ClearSaveRam() + { + for (int i = 0; i < hsram.Length; i++) + hsram[i] = 0; + } + public bool SaveRamModified + { + get + { + return GameInfo.MachineType == MachineType.A7800PAL || GameInfo.MachineType == MachineType.A7800NTSC; + } + set + { + throw new Exception("No one ever uses this, and it won't work with the way MainForm is set up."); + } + } + public void Dispose() { if (avProvider != null) @@ -168,7 +189,7 @@ namespace BizHawk //DeserializationContext george = new DeserializationContext(blah); ILogger logger = new ConsoleLogger(); - HSC7800 hsc7800 = new HSC7800(hsbios, new byte[2048]); //TODO: why should I have to feed it ram? how much? + HSC7800 hsc7800 = new HSC7800(hsbios, hsram); Bios7800 bios7800 = new Bios7800(bios); theMachine = MachineBase.Create (GameInfo.MachineType,