mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 01:35:07 +00:00
NES: NSFPlay per-channel osc
This commit is contained in:
parent
61b4e3745f
commit
de09073232
3 changed files with 10 additions and 2 deletions
|
@ -154,6 +154,14 @@ void DivPlatformNES::acquire_NSFPlay(short* bufL, short* bufR, size_t start, siz
|
||||||
if (sample>32767) sample=32767;
|
if (sample>32767) sample=32767;
|
||||||
if (sample<-32768) sample=-32768;
|
if (sample<-32768) sample=-32768;
|
||||||
bufL[i]=sample;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ namespace xgm
|
||||||
|
|
||||||
unsigned int gclock;
|
unsigned int gclock;
|
||||||
unsigned char reg[0x20];
|
unsigned char reg[0x20];
|
||||||
int out[2];
|
|
||||||
double rate, clock;
|
double rate, clock;
|
||||||
|
|
||||||
int square_table[32]; // nonlinear mixer
|
int square_table[32]; // nonlinear mixer
|
||||||
|
@ -63,6 +62,7 @@ namespace xgm
|
||||||
int calc_sqr (int ch, unsigned int clocks);
|
int calc_sqr (int ch, unsigned int clocks);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
int out[2];
|
||||||
NES_APU ();
|
NES_APU ();
|
||||||
~NES_APU ();
|
~NES_APU ();
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ namespace xgm
|
||||||
unsigned int len_reg;
|
unsigned int len_reg;
|
||||||
unsigned int adr_reg;
|
unsigned int adr_reg;
|
||||||
std::function<void(unsigned short, unsigned int&)> memory;
|
std::function<void(unsigned short, unsigned int&)> memory;
|
||||||
unsigned int out[3];
|
|
||||||
unsigned int daddress;
|
unsigned int daddress;
|
||||||
unsigned int dlength;
|
unsigned int dlength;
|
||||||
unsigned int data;
|
unsigned int data;
|
||||||
|
@ -91,6 +90,7 @@ namespace xgm
|
||||||
inline unsigned int calc_noise (unsigned int clocks);
|
inline unsigned int calc_noise (unsigned int clocks);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
unsigned int out[3];
|
||||||
NES_DMC ();
|
NES_DMC ();
|
||||||
~NES_DMC ();
|
~NES_DMC ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue