summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-08-29 19:42:14 -0700
committerMichael Pavone <pavone@retrodev.com>2017-08-29 19:42:14 -0700
commit756cbc6e48e3e415ad1934bdf7623c5a87556885 (patch)
tree2084e8edac4d63601647b42360995b4570f9328f
parent9b2b6f6170065d71fba9cdb05d0f94e9a7facd0d (diff)
Save entirety of fnum register, not just the low 8 bits
-rw-r--r--ym2612.c6
1 files changed, 3 insertions, 3 deletions
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);
}