per-channel oscilloscope, part 2

AY8930, K00, C64 and NES
This commit is contained in:
tildearrow 2022-04-30 14:36:12 -05:00
parent b3b747a67a
commit c738ece374
10 changed files with 102 additions and 5 deletions

View file

@ -49,6 +49,7 @@ const char* DivPlatformBubSysWSG::getEffectName(unsigned char effect) {
}
void DivPlatformBubSysWSG::acquire(short* bufL, short* bufR, size_t start, size_t len) {
int chanOut=0;
for (size_t h=start; h<start+len; h++) {
signed int out=0;
// K005289 part
@ -56,8 +57,14 @@ void DivPlatformBubSysWSG::acquire(short* bufL, short* bufR, size_t start, size_
// Wavetable part
for (int i=0; i<2; i++) {
if (isMuted[i]) continue;
out+=chan[i].waveROM[k005289->addr(i)]*(regPool[2+i]&0xf);
if (isMuted[i]) {
oscBuf[i]->data[oscBuf[i]->needle++]=0;
continue;
} else {
chanOut=chan[i].waveROM[k005289->addr(i)]*(regPool[2+i]&0xf);
out+=chanOut;
oscBuf[i]->data[oscBuf[i]->needle++]=chanOut;
}
}
out<<=6; // scale output to 16 bit
@ -267,6 +274,10 @@ void* DivPlatformBubSysWSG::getChanState(int ch) {
return &chan[ch];
}
DivDispatchOscBuffer* DivPlatformBubSysWSG::getOscBuffer(int ch) {
return oscBuf[ch];
}
unsigned char* DivPlatformBubSysWSG::getRegisterPool() {
return (unsigned char*)regPool;
}
@ -335,6 +346,7 @@ int DivPlatformBubSysWSG::init(DivEngine* p, int channels, int sugRate, unsigned
skipRegisterWrites=false;
for (int i=0; i<2; i++) {
isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer;
}
setFlags(flags);
k005289=new k005289_core();
@ -343,6 +355,9 @@ int DivPlatformBubSysWSG::init(DivEngine* p, int channels, int sugRate, unsigned
}
void DivPlatformBubSysWSG::quit() {
for (int i=0; i<2; i++) {
delete oscBuf[i];
}
delete k005289;
}