redo opnx csm
This commit is contained in:
parent
901bb110cc
commit
5f47166012
17 changed files with 572 additions and 147 deletions
|
|
@ -434,6 +434,9 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
if (writeSomething) {
|
||||
if (chan[csmChan].active) { // CSM
|
||||
writeMask^=0xf0;
|
||||
}
|
||||
immWrite(0x28,writeMask);
|
||||
}
|
||||
}
|
||||
|
|
@ -607,7 +610,28 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (extMode) {
|
||||
if (chan[csmChan].freqChanged) {
|
||||
chan[csmChan].freq=parent->calcFreq(chan[csmChan].baseFreq,chan[csmChan].pitch,chan[csmChan].fixedArp?chan[csmChan].baseNoteOverride:chan[csmChan].arpOff,chan[csmChan].fixedArp,true,0,chan[csmChan].pitch2,chipClock,CHIP_DIVIDER);
|
||||
if (chan[csmChan].freq<1) chan[csmChan].freq=1;
|
||||
if (chan[csmChan].freq>1024) chan[csmChan].freq=1024;
|
||||
int wf=0x400-chan[csmChan].freq;
|
||||
immWrite(0x24,wf>>2);
|
||||
immWrite(0x25,wf&3);
|
||||
chan[csmChan].freqChanged=false;
|
||||
}
|
||||
|
||||
if (chan[csmChan].keyOff || chan[csmChan].keyOn) {
|
||||
writeNoteOn=true;
|
||||
for (int i=0; i<4; i++) {
|
||||
writeMask|=opChan[i].active<<(4+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (writeNoteOn) {
|
||||
if (chan[csmChan].active) { // CSM
|
||||
writeMask^=0xf0;
|
||||
}
|
||||
writeMask^=hardResetMask;
|
||||
immWrite(0x28,writeMask);
|
||||
writeMask^=hardResetMask;
|
||||
|
|
@ -629,6 +653,17 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
|
|||
immWrite(0x28,writeMask);
|
||||
}
|
||||
}
|
||||
|
||||
if (extMode) {
|
||||
if (chan[csmChan].keyOn) {
|
||||
immWrite(0x27,0x81);
|
||||
chan[csmChan].keyOn=false;
|
||||
}
|
||||
if (chan[csmChan].keyOff) {
|
||||
immWrite(0x27,0x40);
|
||||
chan[csmChan].keyOff=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformYM2610BExt::muteChannel(int ch, bool mute) {
|
||||
|
|
@ -718,6 +753,11 @@ void DivPlatformYM2610BExt::forceIns() {
|
|||
opChan[i].freqChanged=true;
|
||||
}
|
||||
}
|
||||
if (extMode && chan[csmChan].active) { // CSM
|
||||
chan[csmChan].insChanged=true;
|
||||
chan[csmChan].freqChanged=true;
|
||||
chan[csmChan].keyOn=true;
|
||||
}
|
||||
if (!extMode) {
|
||||
immWrite(0x27,0x00);
|
||||
}
|
||||
|
|
@ -737,6 +777,7 @@ DivMacroInt* DivPlatformYM2610BExt::getChanMacroInt(int ch) {
|
|||
}
|
||||
|
||||
unsigned short DivPlatformYM2610BExt::getPan(int ch) {
|
||||
if (ch==4+csmChan) return 0;
|
||||
if (ch>=4+extChanOffs) return DivPlatformYM2610B::getPan(ch-3);
|
||||
if (ch>=extChanOffs) {
|
||||
if (extMode) {
|
||||
|
|
@ -805,7 +846,7 @@ int DivPlatformYM2610BExt::init(DivEngine* parent, int channels, int sugRate, co
|
|||
extSys=true;
|
||||
|
||||
reset();
|
||||
return 19;
|
||||
return 20;
|
||||
}
|
||||
|
||||
void DivPlatformYM2610BExt::quit() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue