Virtual Boy: more mod table work

This commit is contained in:
tildearrow 2022-10-11 13:10:17 -05:00
parent 8b87905304
commit 79f1b350ae

View file

@ -310,12 +310,12 @@ int DivPlatformVB::dispatch(DivCommand c) {
break; break;
case DIV_CMD_FDS_MOD_DEPTH: // set modulation case DIV_CMD_FDS_MOD_DEPTH: // set modulation
if (c.chan!=4) break; if (c.chan!=4) break;
modulation=c.value; modulation=(c.value<<4)&15;
modType=true; modType=true;
chWrite(4,0x07,modulation); chWrite(4,0x07,modulation);
if (modulation!=0) { if (modulation!=0) {
chan[c.chan].envHigh&=~0x70; chan[c.chan].envHigh&=~0x70;
chan[c.chan].envHigh|=0x70; chan[c.chan].envHigh|=0x40|((c.value&15)<<4);
} else { } else {
chan[c.chan].envHigh&=~0x70; chan[c.chan].envHigh&=~0x70;
} }