diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ISettable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ISettable.cs index 215cc38911..79217600e4 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ISettable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.ISettable.cs @@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } [DisplayName("RTC Initial Time")] - [Description("Set the initial RTC time in terms of elapsed seconds. Only used when RealTimeRTC is false.")] + [Description("Set the initial RTC time in terms of elapsed seconds.")] [DefaultValue(0)] public int RTCInitialTime { @@ -84,6 +84,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk set { _RTCInitialTime = Math.Max(0, Math.Min(1024 * 24 * 60 * 60, value)); } } + [DisplayName("Use Existing SaveRAM")] + [Description("When true, existing SaveRAM will be loaded at boot up")] + [DefaultValue(false)] + public bool Use_SRAM { get; set; } + + [JsonIgnore] private int _RTCInitialTime; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs index 5645334864..e5c4948c6a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs @@ -262,9 +262,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk cart_RAM = new byte[0x200]; } + Console.Write("RAM: ");Console.WriteLine(cart_RAM.Length); + mapper.Core = this; mapper.Initialize(); + if (cart_RAM != null) + { + if (_syncSettings.Use_SRAM) + { + // load cartRAM here + } + else + { + for (int i = 0; i < cart_RAM.Length; i++) + { + cart_RAM[i] = 0xFF; + } + } + } + + // Extra RTC initialization for mbc3 if (mppr == "MBC3") { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs index 2bcabc644d..08066f9e45 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Mappers/Mapper_MBC1.cs @@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk } else { - return 0; + return 0xFF; } } }