Mercurial > repos > blastem
changeset 1450:08bc099a622f
Save entirety of fnum register, not just the low 8 bits
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 29 Aug 2017 19:42:14 -0700 |
parents | f82decf0537d |
children | 9c65819afec3 |
files | ym2612.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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); }