K007232: oscBuf was too fast
This commit is contained in:
parent
91c3c04082
commit
55d7a5e9bc
|
@ -78,18 +78,24 @@ void DivPlatformK007232::acquire(short** buf, size_t len) {
|
||||||
const signed int rout[2]={(k007232.output(0)*((vol1>>4)&0xf)),(k007232.output(1)*((vol2>>4)&0xf))};
|
const signed int rout[2]={(k007232.output(0)*((vol1>>4)&0xf)),(k007232.output(1)*((vol2>>4)&0xf))};
|
||||||
buf[0][h]=(lout[0]+lout[1])<<4;
|
buf[0][h]=(lout[0]+lout[1])<<4;
|
||||||
buf[1][h]=(rout[0]+rout[1])<<4;
|
buf[1][h]=(rout[0]+rout[1])<<4;
|
||||||
|
if (++oscDivider>=8) {
|
||||||
|
oscDivider=0;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=(lout[i]+rout[i])<<3;
|
oscBuf[i]->data[oscBuf[i]->needle++]=(lout[i]+rout[i])<<3;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const unsigned char vol=regPool[0xc];
|
const unsigned char vol=regPool[0xc];
|
||||||
const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))};
|
const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))};
|
||||||
buf[0][h]=(out[0]+out[1])<<4;
|
buf[0][h]=(out[0]+out[1])<<4;
|
||||||
|
if (++oscDivider>=8) {
|
||||||
|
oscDivider=0;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<4;
|
oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 DivPlatformK007232::read_sample(u8 ne, u32 address) {
|
u8 DivPlatformK007232::read_sample(u8 ne, u32 address) {
|
||||||
|
@ -484,7 +490,7 @@ void DivPlatformK007232::setFlags(const DivConfig& flags) {
|
||||||
stereo=flags.getBool("stereo",false);
|
stereo=flags.getBool("stereo",false);
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
chan[i].volumeChanged=true;
|
chan[i].volumeChanged=true;
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate/8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,6 +581,7 @@ int DivPlatformK007232::init(DivEngine* p, int channels, int sugRate, const DivC
|
||||||
}
|
}
|
||||||
sampleMem=new unsigned char[getSampleMemCapacity()];
|
sampleMem=new unsigned char[getSampleMemCapacity()];
|
||||||
sampleMemLen=0;
|
sampleMemLen=0;
|
||||||
|
oscDivider=0;
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
||||||
bool sampleLoaded[256];
|
bool sampleLoaded[256];
|
||||||
|
|
||||||
int delay;
|
int delay;
|
||||||
unsigned char lastLoop, lastVolume;
|
unsigned char lastLoop, lastVolume, oscDivider;
|
||||||
bool stereo;
|
bool stereo;
|
||||||
|
|
||||||
unsigned char* sampleMem;
|
unsigned char* sampleMem;
|
||||||
|
|
Loading…
Reference in a new issue