mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 22:21:09 +00:00
now actually finish SAA1099
This commit is contained in:
parent
0e2230d036
commit
10c78e3fd2
1 changed files with 11 additions and 4 deletions
|
@ -30,7 +30,7 @@ void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned char applyPan(unsigned char vol, unsigned char pan) {
|
inline unsigned char applyPan(unsigned char vol, unsigned char pan) {
|
||||||
return (((vol*(pan>>4))/15)<<4)|((vol*(pan&15))/15);
|
return ((vol*(pan>>4))/15)|(((vol*(pan&15))/15)<<4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::tick() {
|
void DivPlatformSAA1099::tick() {
|
||||||
|
@ -152,7 +152,6 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
|
||||||
if (chan[c.chan].active) rWrite(c.chan,applyPan(chan[c.chan].vol&15,chan[c.chan].pan));
|
if (chan[c.chan].active) rWrite(c.chan,applyPan(chan[c.chan].vol&15,chan[c.chan].pan));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case DIV_CMD_GET_VOLUME: {
|
case DIV_CMD_GET_VOLUME: {
|
||||||
return chan[c.chan].vol;
|
return chan[c.chan].vol;
|
||||||
|
@ -192,6 +191,14 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DIV_CMD_PANNING:
|
||||||
|
chan[c.chan].pan=c.value;
|
||||||
|
if (isMuted[c.chan]) {
|
||||||
|
rWrite(c.chan,0);
|
||||||
|
} else {
|
||||||
|
if (chan[c.chan].active) rWrite(c.chan,applyPan(chan[c.chan].vol&15,chan[c.chan].pan));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case DIV_CMD_LEGATO: {
|
case DIV_CMD_LEGATO: {
|
||||||
chan[c.chan].baseFreq=round(PSG_FREQ_BASE/pow(2.0f,((float)c.value/12.0f)));
|
chan[c.chan].baseFreq=round(PSG_FREQ_BASE/pow(2.0f,((float)c.value/12.0f)));
|
||||||
chan[c.chan].freqChanged=true;
|
chan[c.chan].freqChanged=true;
|
||||||
|
@ -205,8 +212,8 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
|
||||||
rWrite(0x16,saaNoise[0]|(saaNoise[1]<<4));
|
rWrite(0x16,saaNoise[0]|(saaNoise[1]<<4));
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_SAA_ENVELOPE:
|
case DIV_CMD_SAA_ENVELOPE:
|
||||||
saaEnv[c.value/3]=c.value;
|
saaEnv[c.chan/3]=c.value;
|
||||||
rWrite(0x18+(c.value/3),c.value);
|
rWrite(0x18+(c.chan/3),c.value);
|
||||||
break;
|
break;
|
||||||
case DIV_ALWAYS_SET_VOLUME:
|
case DIV_ALWAYS_SET_VOLUME:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue