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

This commit is contained in:
adelikat 2020-02-16 12:55:32 -06:00
parent aa6654cf9d
commit 04a185101a
2 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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);