From 04a185101a8055e7e25ffec17497ad4ffcf96926 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 16 Feb 2020 12:55:32 -0600 Subject: [PATCH] fix gbhawk text states, had to leave duplicate data just with a different key name, in order to keep backwards compatibiliy with old binary states --- BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs | 8 ++++---- .../Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs index b653dac9c2..08e9cc62ff 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs @@ -951,7 +951,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(SQ1_vol_done), ref SQ1_vol_done); ser.Sync(nameof(SQ1_calc_done), ref SQ1_calc_done); ser.Sync(nameof(SQ1_swp_enable), ref SQ1_swp_enable); - ser.Sync(nameof(SQ1_len_cntr), ref SQ1_len_cntr); + //ser.Sync("Duplicate_SQ1_len_center", ref SQ1_len_cntr); // Deleting this breaks backwards compatibility with binary states ser.Sync(nameof(SQ1_enable), ref SQ1_enable); ser.Sync(nameof(SQ1_vol_state), ref SQ1_vol_state); ser.Sync(nameof(SQ1_duty_cntr), ref SQ1_duty_cntr); @@ -974,7 +974,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(SQ1_output), ref SQ1_output); ser.Sync(nameof(SQ2_vol_done), ref SQ2_vol_done); - ser.Sync(nameof(SQ2_len_cntr), ref SQ2_len_cntr); + ser.Sync("Duplicate_SQ2_len_counter", ref SQ2_len_cntr); // Deleting this breaks backwards compatibility with binary states ser.Sync(nameof(SQ2_enable), ref SQ2_enable); ser.Sync(nameof(SQ2_vol_state), ref SQ2_vol_state); ser.Sync(nameof(SQ2_duty_cntr), ref SQ2_duty_cntr); @@ -992,7 +992,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(SQ2_output), ref SQ2_output); ser.Sync(nameof(WAVE_can_get), ref WAVE_can_get); - ser.Sync(nameof(WAVE_len_cntr), ref WAVE_len_cntr); + ser.Sync("duplicate_WAVE_len_counter", ref WAVE_len_cntr); // Deleting this breaks backwards compatibility with binary states ser.Sync(nameof(WAVE_enable), ref WAVE_enable); ser.Sync(nameof(WAVE_wave_cntr), ref WAVE_wave_cntr); ser.Sync(nameof(WAVE_intl_cntr), ref WAVE_intl_cntr); @@ -1006,7 +1006,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync(nameof(WAVE_output), ref WAVE_output); ser.Sync(nameof(NOISE_vol_done), ref NOISE_vol_done); - ser.Sync(nameof(NOISE_len_cntr), ref NOISE_len_cntr); + ser.Sync("NOISE_len_counter", ref NOISE_len_cntr); // Deleting this breaks backwards compatibility with binary states ser.Sync(nameof(NOISE_enable), ref NOISE_enable); ser.Sync(nameof(NOISE_vol_state), ref NOISE_vol_state); ser.Sync(nameof(NOISE_intl_cntr), ref NOISE_intl_cntr); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs index 32554acd1b..b7be7f9c7e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs @@ -14,6 +14,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ms.Close(); core = ms.ToArray(); } + + ser.BeginSection("Gameboy"); cpu.SyncState(ser); mapper.SyncState(ser); timer.SyncState(ser); @@ -21,7 +23,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk serialport.SyncState(ser); audio.SyncState(ser); - ser.BeginSection("Gameboy"); ser.Sync(nameof(core), ref core, false); ser.Sync("Lag", ref _lagcount); ser.Sync("Frame", ref _frame);