changeset 851:b10cf2c921ad

Fix mapping of key on/off reg bits to operators
author Michael Pavone <pavone@retrodev.com>
date Sun, 01 Nov 2015 20:44:12 -0800
parents 215b5dabbc20
children 5de8759b87af
files ym2612.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ym2612.c	Sun Nov 01 20:40:30 2015 -0800
+++ b/ym2612.c	Sun Nov 01 20:44:12 2015 -0800
@@ -691,8 +691,9 @@
 				if (channel > 2) {
 					channel--;
 				}
-				for (uint8_t op = channel * 4, bit = 0x10; op < (channel + 1) * 4; op++, bit <<= 1) {
-					if (value & bit) {
+				uint8_t bits[] = {0x10, 0x40, 0x20, 0x80};
+				for (uint8_t op = channel * 4, bit = 0; op < (channel + 1) * 4; op++, bit++) {
+					if (value & bits[bit]) {
 						if (context->operators[op].env_phase == PHASE_RELEASE)
 						{
 							first_key_on = 1;