NES: NSFPlay per-channel osc

This commit is contained in:
tildearrow 2022-05-02 00:05:28 -05:00
parent 61b4e3745f
commit de09073232
3 changed files with 10 additions and 2 deletions

View File

@ -154,6 +154,14 @@ void DivPlatformNES::acquire_NSFPlay(short* bufL, short* bufR, size_t start, siz
if (sample>32767) sample=32767;
if (sample<-32768) sample=-32768;
bufL[i]=sample;
if (++writeOscBuf>=32) {
writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=nes1_NP->out[0]<<11;
oscBuf[1]->data[oscBuf[1]->needle++]=nes1_NP->out[1]<<11;
oscBuf[2]->data[oscBuf[2]->needle++]=nes2_NP->out[0]<<11;
oscBuf[3]->data[oscBuf[3]->needle++]=nes2_NP->out[1]<<11;
oscBuf[4]->data[oscBuf[4]->needle++]=nes2_NP->out[2]<<8;
}
}
}

View File

@ -27,7 +27,6 @@ namespace xgm
unsigned int gclock;
unsigned char reg[0x20];
int out[2];
double rate, clock;
int square_table[32]; // nonlinear mixer
@ -63,6 +62,7 @@ namespace xgm
int calc_sqr (int ch, unsigned int clocks);
public:
int out[2];
NES_APU ();
~NES_APU ();

View File

@ -36,7 +36,6 @@ namespace xgm
unsigned int len_reg;
unsigned int adr_reg;
std::function<void(unsigned short, unsigned int&)> memory;
unsigned int out[3];
unsigned int daddress;
unsigned int dlength;
unsigned int data;
@ -91,6 +90,7 @@ namespace xgm
inline unsigned int calc_noise (unsigned int clocks);
public:
unsigned int out[3];
NES_DMC ();
~NES_DMC ();