From 2190b15099570f08d2cbc9430d103802cfb42856 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 21 Jul 2014 19:07:21 +0000 Subject: [PATCH] snes - a sneaky hack to enforce that compatibility profile is ALWAYS in deterministic mode, and that performance profile is NEVER in deterministic mode, this fixes a lot of undefined and bugged behavior when the deterministic flag gets out of whack with the act of loading a savestate --- .../Consoles/Nintendo/SNES/LibsnesCore.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index f312cc0fba..8c320047f1 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -327,7 +327,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES else return api.CMD_load_cartridge_super_game_boy(CurrLoadParams.rom_xml, CurrLoadParams.rom_data, CurrLoadParams.rom_size, CurrLoadParams.dmg_xml, CurrLoadParams.dmg_data, CurrLoadParams.dmg_size); } - public void Load(GameInfo game, byte[] romData, bool DeterministicEmulation, byte[] xmlData) + public void Load(GameInfo game, byte[] romData, bool deterministicEmulation, byte[] xmlData) { byte[] sgbRomData = null; if (game["SGB"]) @@ -433,7 +433,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES SetupMemoryDomains(romData,sgbRomData); - this.DeterministicEmulation = DeterministicEmulation; + DeterministicEmulation = deterministicEmulation; if (DeterministicEmulation) // save frame-0 savestate now { MemoryStream ms = new MemoryStream(); @@ -719,10 +719,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public string BoardName { get; private set; } + // adelikat: Nasty hack to force new business logic. Compatibility (and Accuracy when fully supported) will ALWAYS be in deterministic mode, + // a consequence is a permanent performance hit to the compatibility core + // Perormance will NEVER be in deterministic mode (and the client side logic will prohibit movie recording on it) public bool DeterministicEmulation { - get; - private set; + get { return SyncSettings.Profile == "Compatibility" || SyncSettings.Profile == "Accuracy"; } + private set { /* Do nothing */ } }