curr -> cur
This commit is contained in:
parent
305ee2cbb0
commit
07822de0a2
|
@ -115,7 +115,7 @@ const unsigned char dacLogTableAY[256]={
|
|||
|
||||
void DivPlatformAY8910::runDAC() {
|
||||
for (int i=0; i<3; i++) {
|
||||
if (chan[i].active && chan[i].currPSGMode.dac && chan[i].dac.sample!=-1) {
|
||||
if (chan[i].active && chan[i].curPSGMode.dac && chan[i].dac.sample!=-1) {
|
||||
chan[i].dac.period+=chan[i].dac.rate;
|
||||
bool end=false;
|
||||
bool changed=false;
|
||||
|
@ -215,22 +215,22 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
void DivPlatformAY8910::updateOutSel(bool immediate) {
|
||||
if (immediate) {
|
||||
immWrite(0x07,
|
||||
~((chan[0].currPSGMode.getTone())|
|
||||
((chan[1].currPSGMode.getTone())<<1)|
|
||||
((chan[2].currPSGMode.getTone())<<2)|
|
||||
((chan[0].currPSGMode.getNoise())<<2)|
|
||||
((chan[1].currPSGMode.getNoise())<<3)|
|
||||
((chan[2].currPSGMode.getNoise())<<4)|
|
||||
~((chan[0].curPSGMode.getTone())|
|
||||
((chan[1].curPSGMode.getTone())<<1)|
|
||||
((chan[2].curPSGMode.getTone())<<2)|
|
||||
((chan[0].curPSGMode.getNoise())<<2)|
|
||||
((chan[1].curPSGMode.getNoise())<<3)|
|
||||
((chan[2].curPSGMode.getNoise())<<4)|
|
||||
((!ioPortA)<<6)|
|
||||
((!ioPortB)<<7)));
|
||||
} else {
|
||||
rWrite(0x07,
|
||||
~((chan[0].currPSGMode.getTone())|
|
||||
((chan[1].currPSGMode.getTone())<<1)|
|
||||
((chan[2].currPSGMode.getTone())<<2)|
|
||||
((chan[0].currPSGMode.getNoise())<<2)|
|
||||
((chan[1].currPSGMode.getNoise())<<3)|
|
||||
((chan[2].currPSGMode.getNoise())<<4)|
|
||||
~((chan[0].curPSGMode.getTone())|
|
||||
((chan[1].curPSGMode.getTone())<<1)|
|
||||
((chan[2].curPSGMode.getTone())<<2)|
|
||||
((chan[0].curPSGMode.getNoise())<<2)|
|
||||
((chan[1].curPSGMode.getNoise())<<3)|
|
||||
((chan[2].curPSGMode.getNoise())<<4)|
|
||||
((!ioPortA)<<6)|
|
||||
((!ioPortB)<<7)));
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ void DivPlatformAY8910::tick(bool sysTick) {
|
|||
if (!chan[i].nextPSGMode.dac) {
|
||||
chan[i].nextPSGMode.val=(chan[i].std.wave.val+1)&7;
|
||||
if (chan[i].active) {
|
||||
chan[i].currPSGMode.val=chan[i].nextPSGMode.val;
|
||||
chan[i].curPSGMode.val=chan[i].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[i]) {
|
||||
rWrite(0x08+i,0);
|
||||
|
@ -340,11 +340,11 @@ void DivPlatformAY8910::tick(bool sysTick) {
|
|||
//rWrite(16+i*5+1,((chan[i].duty&3)<<6)|(63-(ins->gb.soundLen&63)));
|
||||
//rWrite(16+i*5+2,((chan[i].vol<<4))|(ins->gb.envLen&7)|((ins->gb.envDir&1)<<3));
|
||||
if (!chan[i].nextPSGMode.dac) {
|
||||
chan[i].currPSGMode.val=chan[i].nextPSGMode.val;
|
||||
chan[i].curPSGMode.val=chan[i].nextPSGMode.val;
|
||||
}
|
||||
}
|
||||
if (chan[i].keyOff) {
|
||||
chan[i].currPSGMode.val=0;
|
||||
chan[i].curPSGMode.val=0;
|
||||
rWrite(0x08+i,0);
|
||||
}
|
||||
rWrite((i)<<1,chan[i].freq&0xff);
|
||||
|
@ -448,7 +448,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
|
|||
}
|
||||
chan[c.chan].dac.furnaceDAC=false;
|
||||
}
|
||||
chan[c.chan].currPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
break;
|
||||
}
|
||||
if (c.value!=DIV_NOTE_NULL) {
|
||||
|
@ -553,7 +553,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
|
|||
if (c.value<16) {
|
||||
chan[c.chan].nextPSGMode.val=(c.value+1)&7;
|
||||
if (chan[c.chan].active) {
|
||||
chan[c.chan].currPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
chan[c.chan].curPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[c.chan]) {
|
||||
rWrite(0x08+c.chan,0);
|
||||
|
@ -579,7 +579,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
|
|||
chan[c.chan].nextPSGMode.envelope&=~1;
|
||||
}
|
||||
if (!chan[c.chan].nextPSGMode.dac && chan[c.chan].active) {
|
||||
chan[c.chan].currPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
chan[c.chan].curPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[c.chan]) {
|
||||
rWrite(0x08+c.chan,0);
|
||||
|
@ -626,7 +626,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
|
|||
case DIV_CMD_SAMPLE_MODE:
|
||||
chan[c.chan].nextPSGMode.dac=(c.value>0)?1:0;
|
||||
if (chan[c.chan].active) {
|
||||
chan[c.chan].currPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
}
|
||||
break;
|
||||
case DIV_CMD_SAMPLE_BANK:
|
||||
|
|
|
@ -57,7 +57,7 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
PSGMode(unsigned char v=0):
|
||||
val(v) {}
|
||||
};
|
||||
PSGMode currPSGMode;
|
||||
PSGMode curPSGMode;
|
||||
PSGMode nextPSGMode;
|
||||
|
||||
struct DAC {
|
||||
|
@ -85,7 +85,7 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
pitch2=0;
|
||||
}
|
||||
Channel():
|
||||
currPSGMode(PSGMode(0)),
|
||||
curPSGMode(PSGMode(0)),
|
||||
nextPSGMode(PSGMode(1)),
|
||||
dac(DAC()),
|
||||
freq(0),
|
||||
|
|
|
@ -111,7 +111,7 @@ const unsigned char dacLogTableAY8930[256]={
|
|||
|
||||
void DivPlatformAY8930::runDAC() {
|
||||
for (int i=0; i<3; i++) {
|
||||
if (chan[i].active && chan[i].currPSGMode.dac && chan[i].dac.sample!=-1) {
|
||||
if (chan[i].active && chan[i].curPSGMode.dac && chan[i].dac.sample!=-1) {
|
||||
chan[i].dac.period+=chan[i].dac.rate;
|
||||
bool end=false;
|
||||
bool changed=false;
|
||||
|
@ -195,22 +195,22 @@ void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
void DivPlatformAY8930::updateOutSel(bool immediate) {
|
||||
if (immediate) {
|
||||
immWrite(0x07,
|
||||
~((chan[0].currPSGMode.getTone())|
|
||||
((chan[1].currPSGMode.getTone())<<1)|
|
||||
((chan[2].currPSGMode.getTone())<<2)|
|
||||
((chan[0].currPSGMode.getNoise())<<2)|
|
||||
((chan[1].currPSGMode.getNoise())<<3)|
|
||||
((chan[2].currPSGMode.getNoise())<<4)|
|
||||
~((chan[0].curPSGMode.getTone())|
|
||||
((chan[1].curPSGMode.getTone())<<1)|
|
||||
((chan[2].curPSGMode.getTone())<<2)|
|
||||
((chan[0].curPSGMode.getNoise())<<2)|
|
||||
((chan[1].curPSGMode.getNoise())<<3)|
|
||||
((chan[2].curPSGMode.getNoise())<<4)|
|
||||
((!ioPortA)<<6)|
|
||||
((!ioPortB)<<7)));
|
||||
} else {
|
||||
rWrite(0x07,
|
||||
~((chan[0].currPSGMode.getTone())|
|
||||
((chan[1].currPSGMode.getTone())<<1)|
|
||||
((chan[2].currPSGMode.getTone())<<2)|
|
||||
((chan[0].currPSGMode.getNoise())<<2)|
|
||||
((chan[1].currPSGMode.getNoise())<<3)|
|
||||
((chan[2].currPSGMode.getNoise())<<4)|
|
||||
~((chan[0].curPSGMode.getTone())|
|
||||
((chan[1].curPSGMode.getTone())<<1)|
|
||||
((chan[2].curPSGMode.getTone())<<2)|
|
||||
((chan[0].curPSGMode.getNoise())<<2)|
|
||||
((chan[1].curPSGMode.getNoise())<<3)|
|
||||
((chan[2].curPSGMode.getNoise())<<4)|
|
||||
((!ioPortA)<<6)|
|
||||
((!ioPortB)<<7)));
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ void DivPlatformAY8930::tick(bool sysTick) {
|
|||
if (!chan[i].nextPSGMode.dac) {
|
||||
chan[i].nextPSGMode.val=(chan[i].std.wave.val+1)&7;
|
||||
if (chan[i].active) {
|
||||
chan[i].currPSGMode.val=chan[i].nextPSGMode.val;
|
||||
chan[i].curPSGMode.val=chan[i].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[i]) {
|
||||
rWrite(0x08+i,0);
|
||||
|
@ -337,7 +337,7 @@ void DivPlatformAY8930::tick(bool sysTick) {
|
|||
if (chan[i].freq>65535) chan[i].freq=65535;
|
||||
if (chan[i].keyOn) {
|
||||
if (!chan[i].nextPSGMode.dac) {
|
||||
chan[i].currPSGMode.val=chan[i].nextPSGMode.val;
|
||||
chan[i].curPSGMode.val=chan[i].nextPSGMode.val;
|
||||
}
|
||||
if (chan[i].insChanged) {
|
||||
if (!chan[i].std.ex1.will) immWrite(0x16+i,chan[i].duty);
|
||||
|
@ -345,7 +345,7 @@ void DivPlatformAY8930::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
if (chan[i].keyOff) {
|
||||
chan[i].currPSGMode.val=0;
|
||||
chan[i].curPSGMode.val=0;
|
||||
rWrite(0x08+i,0);
|
||||
}
|
||||
rWrite((i)<<1,chan[i].freq&0xff);
|
||||
|
@ -449,7 +449,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
|
|||
}
|
||||
chan[c.chan].dac.furnaceDAC=false;
|
||||
}
|
||||
chan[c.chan].currPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
break;
|
||||
}
|
||||
if (c.value!=DIV_NOTE_NULL) {
|
||||
|
@ -547,7 +547,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
|
|||
if (!chan[c.chan].nextPSGMode.dac) {
|
||||
chan[c.chan].nextPSGMode.val=(c.value+1)&7;
|
||||
if (chan[c.chan].active) {
|
||||
chan[c.chan].currPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
chan[c.chan].curPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[c.chan]) {
|
||||
rWrite(0x08+c.chan,0);
|
||||
|
@ -572,7 +572,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
|
|||
chan[c.chan].nextPSGMode.envelope&=~1;
|
||||
}
|
||||
if (!chan[c.chan].nextPSGMode.dac && chan[c.chan].active) {
|
||||
chan[c.chan].currPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
chan[c.chan].curPSGMode.val=chan[c.chan].nextPSGMode.val;
|
||||
}
|
||||
if (isMuted[c.chan]) {
|
||||
rWrite(0x08+c.chan,0);
|
||||
|
@ -627,7 +627,7 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
|
|||
break;
|
||||
case DIV_CMD_SAMPLE_MODE:
|
||||
chan[c.chan].nextPSGMode.dac=(c.value>0)?1:0;
|
||||
chan[c.chan].currPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
|
||||
break;
|
||||
case DIV_CMD_SAMPLE_BANK:
|
||||
sampleBank=c.value;
|
||||
|
|
|
@ -65,7 +65,7 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
PSGMode(unsigned char v=0):
|
||||
val(v) {}
|
||||
};
|
||||
PSGMode currPSGMode;
|
||||
PSGMode curPSGMode;
|
||||
PSGMode nextPSGMode;
|
||||
|
||||
struct DAC {
|
||||
|
@ -94,7 +94,7 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
}
|
||||
Channel():
|
||||
envelope(Envelope()),
|
||||
currPSGMode(PSGMode(0)),
|
||||
curPSGMode(PSGMode(0)),
|
||||
nextPSGMode(PSGMode(1)),
|
||||
dac(DAC()),
|
||||
freq(0),
|
||||
|
|
|
@ -846,10 +846,10 @@ void putDispatchChan(void* data, int chanNum, int type) {
|
|||
ImGui::Text("- ins: %d",ch->ins);
|
||||
ImGui::Text("* psgMode:");
|
||||
ImGui::Text(" * curr:");
|
||||
ImGui::Text(" - tone: %d",ch->currPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->currPSGMode.noise);
|
||||
ImGui::Text(" - envelope: %d",ch->currPSGMode.envelope);
|
||||
ImGui::Text(" - dac: %d",ch->currPSGMode.dac);
|
||||
ImGui::Text(" - tone: %d",ch->curPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->curPSGMode.noise);
|
||||
ImGui::Text(" - envelope: %d",ch->curPSGMode.envelope);
|
||||
ImGui::Text(" - dac: %d",ch->curPSGMode.dac);
|
||||
ImGui::Text(" * next:");
|
||||
ImGui::Text(" - tone: %d",ch->nextPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->nextPSGMode.noise);
|
||||
|
@ -892,10 +892,10 @@ void putDispatchChan(void* data, int chanNum, int type) {
|
|||
ImGui::Text(" - low: %d",ch->envelope.slideLow);
|
||||
ImGui::Text("* psgMode:");
|
||||
ImGui::Text(" * curr:");
|
||||
ImGui::Text(" - tone: %d",ch->currPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->currPSGMode.noise);
|
||||
ImGui::Text(" - envelope: %d",ch->currPSGMode.envelope);
|
||||
ImGui::Text(" - dac: %d",ch->currPSGMode.dac);
|
||||
ImGui::Text(" - tone: %d",ch->curPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->curPSGMode.noise);
|
||||
ImGui::Text(" - envelope: %d",ch->curPSGMode.envelope);
|
||||
ImGui::Text(" - dac: %d",ch->curPSGMode.dac);
|
||||
ImGui::Text(" * next:");
|
||||
ImGui::Text(" - tone: %d",ch->nextPSGMode.tone);
|
||||
ImGui::Text(" - noise: %d",ch->nextPSGMode.noise);
|
||||
|
|
Loading…
Reference in New Issue