Mercurial > repos > blastem
comparison ym2612.c @ 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 | a094815b1168 |
children | ce1f93be0104 |
comparison
equal
deleted
inserted
replaced
1449:f82decf0537d | 1450:08bc099a622f |
---|---|
1075 save_int16(buf, context->channels[i].output); | 1075 save_int16(buf, context->channels[i].output); |
1076 save_int16(buf, context->channels[i].op1_old); | 1076 save_int16(buf, context->channels[i].op1_old); |
1077 //Due to the latching behavior, these need to be saved | 1077 //Due to the latching behavior, these need to be saved |
1078 //even though duplicate info is probably in the regs array | 1078 //even though duplicate info is probably in the regs array |
1079 save_int8(buf, context->channels[i].block); | 1079 save_int8(buf, context->channels[i].block); |
1080 save_int8(buf, context->channels[i].fnum); | 1080 save_int16(buf, context->channels[i].fnum); |
1081 save_int8(buf, context->channels[i].keyon); | 1081 save_int8(buf, context->channels[i].keyon); |
1082 } | 1082 } |
1083 for (int i = 0; i < 3; i++) | 1083 for (int i = 0; i < 3; i++) |
1084 { | 1084 { |
1085 //Due to the latching behavior, these need to be saved | 1085 //Due to the latching behavior, these need to be saved |
1137 context->operators[i].output = load_int16(buf); | 1137 context->operators[i].output = load_int16(buf); |
1138 context->operators[i].env_phase = load_int8(buf); | 1138 context->operators[i].env_phase = load_int8(buf); |
1139 if (context->operators[i].env_phase > PHASE_RELEASE) { | 1139 if (context->operators[i].env_phase > PHASE_RELEASE) { |
1140 context->operators[i].env_phase = PHASE_RELEASE; | 1140 context->operators[i].env_phase = PHASE_RELEASE; |
1141 } | 1141 } |
1142 context->operators[i].inverted = load_int8(buf) != 0; | 1142 context->operators[i].inverted = load_int8(buf) != 0 ? SSG_INVERT : 0; |
1143 } | 1143 } |
1144 for (int i = 0; i < NUM_CHANNELS; i++) | 1144 for (int i = 0; i < NUM_CHANNELS; i++) |
1145 { | 1145 { |
1146 context->channels[i].output = load_int16(buf); | 1146 context->channels[i].output = load_int16(buf); |
1147 context->channels[i].op1_old = load_int16(buf); | 1147 context->channels[i].op1_old = load_int16(buf); |
1148 context->channels[i].block = load_int8(buf); | 1148 context->channels[i].block = load_int8(buf); |
1149 context->channels[i].fnum = load_int8(buf); | 1149 context->channels[i].fnum = load_int16(buf); |
1150 context->channels[i].keycode = context->channels[i].block << 2 | fnum_to_keycode[context->channels[i].fnum >> 7]; | 1150 context->channels[i].keycode = context->channels[i].block << 2 | fnum_to_keycode[context->channels[i].fnum >> 7]; |
1151 context->channels[i].keyon = load_int8(buf); | 1151 context->channels[i].keyon = load_int8(buf); |
1152 } | 1152 } |
1153 for (int i = 0; i < 3; i++) | 1153 for (int i = 0; i < 3; i++) |
1154 { | 1154 { |