diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-08-29 19:42:44 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-08-29 19:42:44 -0700 |
commit | 149fd84f3f55ebbb8eaefe4e66fb60c8adadba39 (patch) | |
tree | 74de80ac230cf873e564254c8da8e06e7f6121f2 | |
parent | 756cbc6e48e3e415ad1934bdf7623c5a87556885 (diff) |
Fix operator precedence in psg serialize/deserialize
-rw-r--r-- | psg.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -174,11 +174,11 @@ void psg_deserialize(deserialize_buffer *buf, void *vcontext) load_buffer16(buf, context->counters, 4); load_buffer8(buf, context->volume, 4); uint8_t output_state = load_int8(buf); - context->output_state[0] = output_state & 8 >> 3; - context->output_state[1] = output_state & 4 >> 2; - context->output_state[2] = output_state & 2 >> 1; + context->output_state[0] = output_state >> 3 & 1; + context->output_state[1] = output_state >> 2 & 1; + context->output_state[2] = output_state >> 1 & 1; context->output_state[3] = output_state & 1; - context->noise_use_tone = output_state & 0x10 >> 4; + context->noise_use_tone = output_state >> 4 & 1; context->noise_type = load_int8(buf); context->latch = load_int8(buf); context->cycles = load_int32(buf); |