PCE: more work
This commit is contained in:
parent
1379b4c935
commit
8dffdca25a
|
@ -11,7 +11,7 @@
|
||||||
} \
|
} \
|
||||||
rWrite(a,v);
|
rWrite(a,v);
|
||||||
|
|
||||||
#define FREQ_BASE 1712.0f
|
#define FREQ_BASE 1712.0f*2
|
||||||
|
|
||||||
void DivPlatformPCE::acquire(int& l, int& r) {
|
void DivPlatformPCE::acquire(int& l, int& r) {
|
||||||
while (!writes.empty()) {
|
while (!writes.empty()) {
|
||||||
|
@ -20,7 +20,7 @@ void DivPlatformPCE::acquire(int& l, int& r) {
|
||||||
writes.pop();
|
writes.pop();
|
||||||
}
|
}
|
||||||
tempL=0; tempR=0;
|
tempL=0; tempR=0;
|
||||||
pce->Update(2);
|
pce->Update(4);
|
||||||
pce->ResetTS(0);
|
pce->ResetTS(0);
|
||||||
|
|
||||||
//printf("tempL: %d tempR: %d\n",tempL,tempR);
|
//printf("tempL: %d tempR: %d\n",tempL,tempR);
|
||||||
|
@ -35,6 +35,9 @@ void DivPlatformPCE::updateWave(int ch) {
|
||||||
for (int i=0; i<32; i++) {
|
for (int i=0; i<32; i++) {
|
||||||
chWrite(ch,0x06,wt->data[i]&31);
|
chWrite(ch,0x06,wt->data[i]&31);
|
||||||
}
|
}
|
||||||
|
if (chan[ch].active) {
|
||||||
|
chWrite(ch,0x04,0x80|chan[ch].outVol);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCE::tick() {
|
void DivPlatformPCE::tick() {
|
||||||
|
@ -103,6 +106,7 @@ int DivPlatformPCE::dispatch(DivCommand c) {
|
||||||
chan[c.chan].note=c.value;
|
chan[c.chan].note=c.value;
|
||||||
chan[c.chan].active=true;
|
chan[c.chan].active=true;
|
||||||
chan[c.chan].keyOn=true;
|
chan[c.chan].keyOn=true;
|
||||||
|
chWrite(c.chan,0x04,0x80|chan[c.chan].vol);
|
||||||
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
|
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_NOTE_OFF:
|
case DIV_CMD_NOTE_OFF:
|
||||||
|
@ -116,11 +120,19 @@ int DivPlatformPCE::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_VOLUME:
|
case DIV_CMD_VOLUME:
|
||||||
|
if (chan[c.chan].vol!=c.value) {
|
||||||
chan[c.chan].vol=c.value;
|
chan[c.chan].vol=c.value;
|
||||||
//rWrite(16+c.chan*5+2,gbVolMap[chan[c.chan].vol]);
|
if (!chan[c.chan].std.hasVol) {
|
||||||
|
chan[c.chan].outVol=c.value;
|
||||||
|
chWrite(c.chan,0x04,0x80|chan[c.chan].outVol);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_GET_VOLUME:
|
case DIV_CMD_GET_VOLUME:
|
||||||
|
if (chan[c.chan].std.hasVol) {
|
||||||
return chan[c.chan].vol;
|
return chan[c.chan].vol;
|
||||||
|
}
|
||||||
|
return chan[c.chan].outVol;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PITCH:
|
case DIV_CMD_PITCH:
|
||||||
chan[c.chan].pitch=c.value;
|
chan[c.chan].pitch=c.value;
|
||||||
|
|
|
@ -28,6 +28,7 @@ class DivPlatformPCE: public DivDispatch {
|
||||||
keyOff(false),
|
keyOff(false),
|
||||||
inPorta(false),
|
inPorta(false),
|
||||||
vol(31),
|
vol(31),
|
||||||
|
outVol(31),
|
||||||
wave(-1) {}
|
wave(-1) {}
|
||||||
};
|
};
|
||||||
Channel chan[6];
|
Channel chan[6];
|
||||||
|
|
Loading…
Reference in a new issue