# HG changeset patch # User Michael Pavone # Date 1504060934 25200 # Node ID 08bc099a622faf9809e5287ceb0bca9128b63dc1 # Parent f82decf0537d32a4245e416bbeef6bc38404868d Save entirety of fnum register, not just the low 8 bits diff -r f82decf0537d -r 08bc099a622f ym2612.c --- a/ym2612.c Tue Aug 29 00:36:25 2017 -0700 +++ b/ym2612.c Tue Aug 29 19:42:14 2017 -0700 @@ -1077,7 +1077,7 @@ //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 @@ 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); }