From 756cbc6e48e3e415ad1934bdf7623c5a87556885 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 29 Aug 2017 19:42:14 -0700 Subject: Save entirety of fnum register, not just the low 8 bits --- ym2612.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ym2612.c') diff --git a/ym2612.c b/ym2612.c index c34ba08..7b45e67 100644 --- a/ym2612.c +++ b/ym2612.c @@ -1077,7 +1077,7 @@ void ym_serialize(ym2612_context *context, serialize_buffer *buf) //Due to the latching behavior, these need to be saved //even though duplicate info is probably in the regs array save_int8(buf, context->channels[i].block); - save_int8(buf, context->channels[i].fnum); + save_int16(buf, context->channels[i].fnum); save_int8(buf, context->channels[i].keyon); } for (int i = 0; i < 3; i++) @@ -1139,14 +1139,14 @@ void ym_deserialize(deserialize_buffer *buf, void *vcontext) if (context->operators[i].env_phase > PHASE_RELEASE) { context->operators[i].env_phase = PHASE_RELEASE; } - context->operators[i].inverted = load_int8(buf) != 0; + context->operators[i].inverted = load_int8(buf) != 0 ? SSG_INVERT : 0; } for (int i = 0; i < NUM_CHANNELS; i++) { context->channels[i].output = load_int16(buf); context->channels[i].op1_old = load_int16(buf); context->channels[i].block = load_int8(buf); - context->channels[i].fnum = load_int8(buf); + context->channels[i].fnum = load_int16(buf); context->channels[i].keycode = context->channels[i].block << 2 | fnum_to_keycode[context->channels[i].fnum >> 7]; context->channels[i].keyon = load_int8(buf); } -- cgit v1.2.3