use state instead of accessing ins for block

This commit is contained in:
tildearrow 2025-01-28 04:24:10 -05:00
parent e713742985
commit dd9d220f33
16 changed files with 59 additions and 59 deletions

View file

@ -89,7 +89,7 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
opChan[ch].insChanged=false;
if (c.value!=DIV_NOTE_NULL) {
opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11,opChan[ch].ins);
opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11,chan[extChanOffs].state.block);
opChan[ch].portaPause=false;
opChan[ch].note=c.value;
opChan[ch].freqChanged=true;
@ -184,7 +184,7 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
}
break;
}
PLEASE_HELP_ME(opChan[ch]);
PLEASE_HELP_ME(opChan[ch],chan[extChanOffs].state.block);
break;
}
case DIV_CMD_LEGATO: {
@ -193,7 +193,7 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
commitStateExt(ch,ins);
opChan[ch].insChanged=false;
}
opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11,opChan[ch].ins);
opChan[ch].baseFreq=NOTE_FNUM_BLOCK(c.value,11,chan[extChanOffs].state.block);
opChan[ch].freqChanged=true;
break;
}
@ -465,7 +465,7 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
if (opChan[i].std.arp.had) {
if (!opChan[i].inPorta) {
opChan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(opChan[i].note,opChan[i].std.arp.val),11,opChan[i].ins);
opChan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(opChan[i].note,opChan[i].std.arp.val),11,chan[extChanOffs].state.block);
}
opChan[i].freqChanged=true;
}
@ -586,7 +586,7 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
if (extMode) for (int i=0; i<4; i++) {
if (opChan[i].freqChanged) {
if (parent->song.linearPitch==2) {
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,parent->getIns(chan[i].ins)->fm.block);
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
} else {
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2);
int block=(opChan[i].baseFreq&0xf800)>>11;