new chan osc, part 6
more adaptations how can I get you out of my head... I want to go back to work!
This commit is contained in:
parent
fe00ee805d
commit
6265d2cd39
14
extern/SAASound/src/SAADevice.cpp
vendored
14
extern/SAASound/src/SAADevice.cpp
vendored
|
@ -307,7 +307,7 @@ BYTE CSAADevice::_ReadData(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CSAADevice::_TickAndOutputStereo(unsigned int& left_mixed, unsigned int& right_mixed, DivDispatchOscBuffer** oscBuf)
|
void CSAADevice::_TickAndOutputStereo(unsigned int& left_mixed, unsigned int& right_mixed, DivDispatchOscBuffer** oscBuf, unsigned int where)
|
||||||
{
|
{
|
||||||
unsigned int temp_left, temp_right;
|
unsigned int temp_left, temp_right;
|
||||||
unsigned int accum_left = 0, accum_right = 0;
|
unsigned int accum_left = 0, accum_right = 0;
|
||||||
|
@ -316,27 +316,27 @@ void CSAADevice::_TickAndOutputStereo(unsigned int& left_mixed, unsigned int& ri
|
||||||
m_Noise0.Tick();
|
m_Noise0.Tick();
|
||||||
m_Noise1.Tick();
|
m_Noise1.Tick();
|
||||||
m_Amp0.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp0.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[0]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
m_Amp1.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp1.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[1]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
m_Amp2.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp2.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[2]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
m_Amp3.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp3.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[3]->data[oscBuf[3]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[3]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
m_Amp4.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp4.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[4]->data[oscBuf[4]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[4]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
m_Amp5.TickAndOutputStereo(temp_left, temp_right);
|
m_Amp5.TickAndOutputStereo(temp_left, temp_right);
|
||||||
oscBuf[5]->data[oscBuf[5]->needle++]=(temp_left+temp_right)<<5;
|
oscBuf[5]->putSample(where,(temp_left+temp_right)<<5);
|
||||||
accum_left += temp_left;
|
accum_left += temp_left;
|
||||||
accum_right += temp_right;
|
accum_right += temp_right;
|
||||||
}
|
}
|
||||||
|
|
2
extern/SAASound/src/SAADevice.h
vendored
2
extern/SAASound/src/SAADevice.h
vendored
|
@ -53,7 +53,7 @@ public:
|
||||||
void _SetClockRate(unsigned int nClockRate);
|
void _SetClockRate(unsigned int nClockRate);
|
||||||
void _SetSampleRate(unsigned int nSampleRate);
|
void _SetSampleRate(unsigned int nSampleRate);
|
||||||
void _SetOversample(unsigned int nOversample);
|
void _SetOversample(unsigned int nOversample);
|
||||||
void _TickAndOutputStereo(unsigned int& left_mixed, unsigned int& right_mixed, DivDispatchOscBuffer** oscBuf);
|
void _TickAndOutputStereo(unsigned int& left_mixed, unsigned int& right_mixed, DivDispatchOscBuffer** oscBuf, unsigned int where);
|
||||||
void _TickAndOutputSeparate(unsigned int& left_mixed, unsigned int& right_mixed,
|
void _TickAndOutputSeparate(unsigned int& left_mixed, unsigned int& right_mixed,
|
||||||
unsigned int& left0, unsigned int& right0,
|
unsigned int& left0, unsigned int& right0,
|
||||||
unsigned int& left1, unsigned int& right1,
|
unsigned int& left1, unsigned int& right1,
|
||||||
|
|
3
extern/SAASound/src/SAAImpl.cpp
vendored
3
extern/SAASound/src/SAAImpl.cpp
vendored
|
@ -373,9 +373,10 @@ void CSAASoundInternal::GenerateMany(BYTE* pBuffer, unsigned int nSamples, DivDi
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
unsigned int where=0;
|
||||||
while (nSamples--)
|
while (nSamples--)
|
||||||
{
|
{
|
||||||
m_chip._TickAndOutputStereo(left_mixed, right_mixed, oscBuf);
|
m_chip._TickAndOutputStereo(left_mixed, right_mixed, oscBuf, where++);
|
||||||
scale_for_output(left_mixed, right_mixed, oversample, m_bHighpass, nBoost, filterout_z1_left_mixed, filterout_z1_right_mixed, pBuffer);
|
scale_for_output(left_mixed, right_mixed, oversample, m_bHighpass, nBoost, filterout_z1_left_mixed, filterout_z1_right_mixed, pBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,10 @@ void DivPlatformGenesis::acquire_nuked(short** buf, size_t len) {
|
||||||
thread_local short o[2];
|
thread_local short o[2];
|
||||||
thread_local int os[2];
|
thread_local int os[2];
|
||||||
|
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
processDAC(rate);
|
processDAC(rate);
|
||||||
|
|
||||||
|
@ -193,18 +197,18 @@ void DivPlatformGenesis::acquire_nuked(short** buf, size_t len) {
|
||||||
if (i==5) {
|
if (i==5) {
|
||||||
if (fm.dacen) {
|
if (fm.dacen) {
|
||||||
if (softPCM) {
|
if (softPCM) {
|
||||||
oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<6;
|
oscBuf[5]->putSample(h,chan[5].dacOutput<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<6;
|
oscBuf[6]->putSample(h,chan[6].dacOutput<<6);
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=((fm.dacdata^0x100)-0x100)<<6;
|
oscBuf[i]->putSample(h,((fm.dacdata^0x100)-0x100)<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767);
|
oscBuf[i]->putSample(h,CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767));
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767);
|
oscBuf[i]->putSample(h,CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +223,10 @@ void DivPlatformGenesis::acquire_nuked(short** buf, size_t len) {
|
||||||
buf[0][h]=os[0];
|
buf[0][h]=os[0];
|
||||||
buf[1][h]=os[1];
|
buf[1][h]=os[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
|
void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
|
||||||
|
@ -226,6 +234,10 @@ void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
|
||||||
|
|
||||||
ymfm::ym2612::fm_engine* fme=fm_ymfm->debug_engine();
|
ymfm::ym2612::fm_engine* fme=fm_ymfm->debug_engine();
|
||||||
|
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
processDAC(rate);
|
processDAC(rate);
|
||||||
|
|
||||||
|
@ -278,18 +290,18 @@ void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
|
||||||
if (i==5) {
|
if (i==5) {
|
||||||
if (fm_ymfm->debug_dac_enable()) {
|
if (fm_ymfm->debug_dac_enable()) {
|
||||||
if (softPCM) {
|
if (softPCM) {
|
||||||
oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<6;
|
oscBuf[5]->putSample(h,chan[5].dacOutput<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<6;
|
oscBuf[6]->putSample(h,chan[6].dacOutput<<6);
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=((fm_ymfm->debug_dac_data()^0x100)-0x100)<<6;
|
oscBuf[i]->putSample(h,((fm_ymfm->debug_dac_data()^0x100)-0x100)<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=chOut;
|
oscBuf[i]->putSample(h,chOut);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=chOut;
|
oscBuf[i]->putSample(h,chOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,6 +314,10 @@ void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
|
||||||
buf[0][h]=os[0];
|
buf[0][h]=os[0];
|
||||||
buf[1][h]=os[1];
|
buf[1][h]=os[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned char chanMap276[6]={
|
const unsigned char chanMap276[6]={
|
||||||
|
@ -309,7 +325,7 @@ const unsigned char chanMap276[6]={
|
||||||
};
|
};
|
||||||
|
|
||||||
// thanks LTVA
|
// thanks LTVA
|
||||||
void DivPlatformGenesis::acquire276OscSub() {
|
inline void DivPlatformGenesis::acquire276OscSub(int h) {
|
||||||
if (fm_276.fsm_cnt2[1]==0 && llePrevCycle!=0) {
|
if (fm_276.fsm_cnt2[1]==0 && llePrevCycle!=0) {
|
||||||
lleCycle=0;
|
lleCycle=0;
|
||||||
}
|
}
|
||||||
|
@ -326,22 +342,22 @@ void DivPlatformGenesis::acquire276OscSub() {
|
||||||
|
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
if ((softPCM && ((chanMap276[i]!=5) || !chan[5].dacMode)) || (!softPCM)) {
|
if ((softPCM && ((chanMap276[i]!=5) || !chan[5].dacMode)) || (!softPCM)) {
|
||||||
oscBuf[chanMap276[i]]->data[oscBuf[chanMap276[i]]->needle++]=lleOscData[i];
|
oscBuf[chanMap276[i]]->putSample(h,lleOscData[i]);
|
||||||
}
|
}
|
||||||
lleOscData[i]=0;
|
lleOscData[i]=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (softPCM && chan[5].dacMode) {
|
if (softPCM && chan[5].dacMode) {
|
||||||
oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<6;
|
oscBuf[5]->putSample(h,chan[5].dacOutput<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<6;
|
oscBuf[6]->putSample(h,chan[6].dacOutput<<6);
|
||||||
} else {
|
} else {
|
||||||
oscBuf[6]->data[oscBuf[6]->needle++]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
if (lleCycle==((7+i)*12)) {
|
if (lleCycle==((7+i)*12)) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle]=(fm_276.osc_out>>1)*8;
|
oscBuf[i]->putSample(h,(fm_276.osc_out>>1)*4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,18 +367,15 @@ void DivPlatformGenesis::acquire276OscSub() {
|
||||||
lleCycle=0;
|
lleCycle=0;
|
||||||
|
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle]>>=1;
|
// we cannot do this anymore
|
||||||
|
//oscBuf[i]->putSample(h,>>=1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (softPCM && chan[5].dacMode) {
|
if (softPCM && chan[5].dacMode) {
|
||||||
oscBuf[5]->data[oscBuf[5]->needle]=chan[5].dacOutput<<6;
|
oscBuf[5]->putSample(h,chan[5].dacOutput<<6);
|
||||||
oscBuf[6]->data[oscBuf[6]->needle]=chan[6].dacOutput<<6;
|
oscBuf[6]->putSample(h,chan[6].dacOutput<<6);
|
||||||
} else {
|
} else {
|
||||||
oscBuf[6]->data[oscBuf[6]->needle]=0;
|
oscBuf[6]->putSample(h,0);
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<7; i++) {
|
|
||||||
oscBuf[i]->needle++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,6 +383,10 @@ void DivPlatformGenesis::acquire276OscSub() {
|
||||||
|
|
||||||
// thanks LTVA
|
// thanks LTVA
|
||||||
void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
processDAC(rate);
|
processDAC(rate);
|
||||||
|
|
||||||
|
@ -402,14 +419,14 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
fm_276.input.wr=0;
|
fm_276.input.wr=0;
|
||||||
FMOPN2_Clock(&fm_276,1);
|
FMOPN2_Clock(&fm_276,1);
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
if (chipType==2) {
|
if (chipType==2) {
|
||||||
if (!o_bco && fm_276.o_bco) {
|
if (!o_bco && fm_276.o_bco) {
|
||||||
|
@ -432,13 +449,13 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
FMOPN2_Clock(&fm_276,1);
|
FMOPN2_Clock(&fm_276,1);
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
if (chipType==2) {
|
if (chipType==2) {
|
||||||
if (!o_bco && fm_276.o_bco) {
|
if (!o_bco && fm_276.o_bco) {
|
||||||
|
@ -465,13 +482,13 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
fm_276.input.wr=0;
|
fm_276.input.wr=0;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
FMOPN2_Clock(&fm_276,1);
|
FMOPN2_Clock(&fm_276,1);
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
if (chipType==2) {
|
if (chipType==2) {
|
||||||
if (!o_bco && fm_276.o_bco) {
|
if (!o_bco && fm_276.o_bco) {
|
||||||
|
@ -494,13 +511,13 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
FMOPN2_Clock(&fm_276,1);
|
FMOPN2_Clock(&fm_276,1);
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
if (chipType==2) {
|
if (chipType==2) {
|
||||||
if (!o_bco && fm_276.o_bco) {
|
if (!o_bco && fm_276.o_bco) {
|
||||||
|
@ -549,13 +566,13 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
FMOPN2_Clock(&fm_276,1);
|
FMOPN2_Clock(&fm_276,1);
|
||||||
sum_l+=fm_276.out_l;
|
sum_l+=fm_276.out_l;
|
||||||
sum_r+=fm_276.out_r;
|
sum_r+=fm_276.out_r;
|
||||||
|
|
||||||
acquire276OscSub();
|
acquire276OscSub(h);
|
||||||
|
|
||||||
if (chipType==2) {
|
if (chipType==2) {
|
||||||
if (!o_bco && fm_276.o_bco) {
|
if (!o_bco && fm_276.o_bco) {
|
||||||
|
@ -582,6 +599,10 @@ void DivPlatformGenesis::acquire_nuked276(short** buf, size_t len) {
|
||||||
buf[1][h]=(sum_r*3)>>2;
|
buf[1][h]=(sum_r*3)>>2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<7; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::acquire(short** buf, size_t len) {
|
void DivPlatformGenesis::acquire(short** buf, size_t len) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
||||||
|
|
||||||
inline void processDAC(int iRate);
|
inline void processDAC(int iRate);
|
||||||
inline void commitState(int ch, DivInstrument* ins);
|
inline void commitState(int ch, DivInstrument* ins);
|
||||||
void acquire276OscSub();
|
inline void acquire276OscSub(int h);
|
||||||
void acquire_nuked(short** buf, size_t len);
|
void acquire_nuked(short** buf, size_t len);
|
||||||
void acquire_nuked276(short** buf, size_t len);
|
void acquire_nuked276(short** buf, size_t len);
|
||||||
void acquire_ymfm(short** buf, size_t len);
|
void acquire_ymfm(short** buf, size_t len);
|
||||||
|
|
|
@ -55,6 +55,10 @@ inline void DivPlatformK007232::chWrite(unsigned char ch, unsigned int addr, uns
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformK007232::acquire(short** buf, size_t len) {
|
void DivPlatformK007232::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<2; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
if ((--delay)<=0) {
|
if ((--delay)<=0) {
|
||||||
delay=MAX(0,delay);
|
delay=MAX(0,delay);
|
||||||
|
@ -81,7 +85,7 @@ void DivPlatformK007232::acquire(short** buf, size_t len) {
|
||||||
if (++oscDivider>=8) {
|
if (++oscDivider>=8) {
|
||||||
oscDivider=0;
|
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]->putSample(h,(lout[i]+rout[i])<<3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -91,11 +95,15 @@ void DivPlatformK007232::acquire(short** buf, size_t len) {
|
||||||
if (++oscDivider>=8) {
|
if (++oscDivider>=8) {
|
||||||
oscDivider=0;
|
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]->putSample(h,out[i]<<4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<2; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 DivPlatformK007232::read_sample(u8 ne, u32 address) {
|
u8 DivPlatformK007232::read_sample(u8 ne, u32 address) {
|
||||||
|
@ -490,7 +498,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/8;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,11 @@ u8 DivPlatformK053260::read_sample(u32 address) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformK053260::acquire(short** buf, size_t len) {
|
void DivPlatformK053260::acquire(short** buf, size_t len) {
|
||||||
for (size_t i=0; i<len; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t h=0; h<len; h++) {
|
||||||
k053260.tick(TICK_DIVIDER);
|
k053260.tick(TICK_DIVIDER);
|
||||||
int lout=(k053260.output(0)); // scale to 16 bit
|
int lout=(k053260.output(0)); // scale to 16 bit
|
||||||
int rout=(k053260.output(1)); // scale to 16 bit
|
int rout=(k053260.output(1)); // scale to 16 bit
|
||||||
|
@ -77,13 +81,17 @@ void DivPlatformK053260::acquire(short** buf, size_t len) {
|
||||||
if (lout<-32768) lout=-32768;
|
if (lout<-32768) lout=-32768;
|
||||||
if (rout>32767) rout=32767;
|
if (rout>32767) rout=32767;
|
||||||
if (rout<-32768) rout=-32768;
|
if (rout<-32768) rout=-32768;
|
||||||
buf[0][i]=lout;
|
buf[0][h]=lout;
|
||||||
buf[1][i]=rout;
|
buf[1][h]=rout;
|
||||||
|
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=(k053260.voice_out(i,0)+k053260.voice_out(i,1))>>1;
|
oscBuf[i]->putSample(h,(k053260.voice_out(i,0)+k053260.voice_out(i,1))>>1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformK053260::tick(bool sysTick) {
|
void DivPlatformK053260::tick(bool sysTick) {
|
||||||
|
@ -427,7 +435,7 @@ void DivPlatformK053260::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/TICK_DIVIDER;
|
rate=chipClock/TICK_DIVIDER;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,12 @@ void DivPlatformLynx::processDAC(int sRate) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformLynx::acquire(short** buf, size_t len) {
|
void DivPlatformLynx::acquire(short** buf, size_t len) {
|
||||||
|
thread_local int chanBuf[4];
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
processDAC(rate);
|
processDAC(rate);
|
||||||
|
|
||||||
|
@ -163,7 +169,15 @@ void DivPlatformLynx::acquire(short** buf, size_t len) {
|
||||||
writes.pop_front();
|
writes.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
mikey->sampleAudio(buf[0]+h,buf[1]+h,1,oscBuf);
|
mikey->sampleAudio(buf[0]+h,buf[1]+h,1,chanBuf);
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->putSample(h,chanBuf[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,7 +569,7 @@ void DivPlatformLynx::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/128;
|
rate=chipClock/128;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,10 @@ const char** DivPlatformMMC5::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMMC5::acquire(short** buf, size_t len) {
|
void DivPlatformMMC5::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
if (dacSample!=-1) {
|
if (dacSample!=-1) {
|
||||||
dacPeriod+=dacRate;
|
dacPeriod+=dacRate;
|
||||||
|
@ -85,11 +89,15 @@ void DivPlatformMMC5::acquire(short** buf, size_t len) {
|
||||||
|
|
||||||
if (++writeOscBuf>=32) {
|
if (++writeOscBuf>=32) {
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:((mmc5->S3.output)<<11);
|
oscBuf[0]->putSample(i,isMuted[0]?0:((mmc5->S3.output)<<11));
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:((mmc5->S4.output)<<11);
|
oscBuf[1]->putSample(i,isMuted[1]?0:((mmc5->S4.output)<<11));
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:((mmc5->pcm.output)<<7);
|
oscBuf[2]->putSample(i,isMuted[2]?0:((mmc5->pcm.output)<<7));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMMC5::tick(bool sysTick) {
|
void DivPlatformMMC5::tick(bool sysTick) {
|
||||||
|
@ -427,7 +435,7 @@ void DivPlatformMMC5::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock;
|
rate=chipClock;
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
oscBuf[i]->rate=rate/32;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ const char** DivPlatformMSM5232::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
while (!writes.empty()) {
|
while (!writes.empty()) {
|
||||||
QueuedWrite w=writes.front();
|
QueuedWrite w=writes.front();
|
||||||
|
@ -56,7 +60,7 @@ void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
||||||
|
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
if (isMuted[i]) {
|
if (isMuted[i]) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=0;
|
oscBuf[i]->putSample(h,0);
|
||||||
} else {
|
} else {
|
||||||
int o=(
|
int o=(
|
||||||
((regPool[12+(i>>2)]&1)?((msm->vo16[i]*partVolume[3+(i&4)])>>8):0)+
|
((regPool[12+(i>>2)]&1)?((msm->vo16[i]*partVolume[3+(i&4)])>>8):0)+
|
||||||
|
@ -64,7 +68,7 @@ void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
||||||
((regPool[12+(i>>2)]&4)?((msm->vo4[i]*partVolume[1+(i&4)])>>8):0)+
|
((regPool[12+(i>>2)]&4)?((msm->vo4[i]*partVolume[1+(i&4)])>>8):0)+
|
||||||
((regPool[12+(i>>2)]&8)?((msm->vo2[i]*partVolume[i&4])>>8):0)
|
((regPool[12+(i>>2)]&8)?((msm->vo2[i]*partVolume[i&4])>>8):0)
|
||||||
)<<2;
|
)<<2;
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(o,-32768,32767);
|
oscBuf[i]->putSample(h,CLAMP(o,-32768,32767));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +88,10 @@ void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
||||||
buf[0][h]+=(temp[i]*partVolume[i])>>8;
|
buf[0][h]+=(temp[i]*partVolume[i])>>8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int attackMap[8]={
|
const int attackMap[8]={
|
||||||
|
@ -400,7 +408,7 @@ void DivPlatformMSM5232::setFlags(const DivConfig& flags) {
|
||||||
msm->set_clock(chipClock+detune*1024);
|
msm->set_clock(chipClock+detune*1024);
|
||||||
rate=msm->get_rate();
|
rate=msm->get_rate();
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
initPartVolume[0]=flags.getInt("partVolume0",255);
|
initPartVolume[0]=flags.getInt("partVolume0",255);
|
||||||
initPartVolume[1]=flags.getInt("partVolume1",255);
|
initPartVolume[1]=flags.getInt("partVolume1",255);
|
||||||
|
|
|
@ -41,6 +41,8 @@ int DivPlatformMSM6258::calcVGMRate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6258::acquire(short** buf, size_t len) {
|
void DivPlatformMSM6258::acquire(short** buf, size_t len) {
|
||||||
|
oscBuf[0]->begin(len);
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
if (--msmClockCount<0) {
|
if (--msmClockCount<0) {
|
||||||
if (--msmDividerCount<=0) {
|
if (--msmDividerCount<=0) {
|
||||||
|
@ -86,13 +88,15 @@ void DivPlatformMSM6258::acquire(short** buf, size_t len) {
|
||||||
if (isMuted[0]) {
|
if (isMuted[0]) {
|
||||||
buf[0][h]=0;
|
buf[0][h]=0;
|
||||||
buf[1][h]=0;
|
buf[1][h]=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=0;
|
oscBuf[0]->putSample(h,0);
|
||||||
} else {
|
} else {
|
||||||
buf[0][h]=(msmPan&2)?0:msmOut;
|
buf[0][h]=(msmPan&2)?0:msmOut;
|
||||||
buf[1][h]=(msmPan&1)?0:msmOut;
|
buf[1][h]=(msmPan&1)?0:msmOut;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=msmPan?(msmOut>>1):0;
|
oscBuf[0]->putSample(h,msmPan?(msmOut>>1):0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oscBuf[0]->end(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6258::tick(bool sysTick) {
|
void DivPlatformMSM6258::tick(bool sysTick) {
|
||||||
|
@ -407,7 +411,7 @@ void DivPlatformMSM6258::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/256;
|
rate=chipClock/256;
|
||||||
for (int i=0; i<1; i++) {
|
for (int i=0; i<1; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
variableRate=flags.getBool("variableRate",false);
|
variableRate=flags.getBool("variableRate",false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,10 @@ u8 DivPlatformMSM6295::read_byte(u32 address) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6295::acquire(short** buf, size_t len) {
|
void DivPlatformMSM6295::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
if (delay<=0) {
|
if (delay<=0) {
|
||||||
if (!writes.empty()) {
|
if (!writes.empty()) {
|
||||||
|
@ -106,10 +110,14 @@ void DivPlatformMSM6295::acquire(short** buf, size_t len) {
|
||||||
if (++updateOsc>=22) {
|
if (++updateOsc>=22) {
|
||||||
updateOsc=0;
|
updateOsc=0;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=msm.voice_out(i)<<5;
|
oscBuf[i]->putSample(h,msm.voice_out(i)<<5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6295::tick(bool sysTick) {
|
void DivPlatformMSM6295::tick(bool sysTick) {
|
||||||
|
@ -560,7 +568,7 @@ void DivPlatformMSM6295::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/3;
|
rate=chipClock/3;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->rate=rate/22;
|
oscBuf[i]->setRate(rate);;
|
||||||
}
|
}
|
||||||
if (rateSel!=rateSelInit) {
|
if (rateSel!=rateSelInit) {
|
||||||
rWrite(12,!rateSelInit);
|
rWrite(12,!rateSelInit);
|
||||||
|
|
|
@ -109,6 +109,10 @@ const char** DivPlatformN163::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformN163::acquire(short** buf, size_t len) {
|
void DivPlatformN163::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
n163.tick();
|
n163.tick();
|
||||||
int out=(n163.out()<<6)*2; // scale to 16 bit
|
int out=(n163.out()<<6)*2; // scale to 16 bit
|
||||||
|
@ -116,8 +120,8 @@ void DivPlatformN163::acquire(short** buf, size_t len) {
|
||||||
if (out<-32768) out=-32768;
|
if (out<-32768) out=-32768;
|
||||||
buf[0][i]=out;
|
buf[0][i]=out;
|
||||||
|
|
||||||
if (n163.voice_cycle()==0x78) for (int i=0; i<8; i++) {
|
if (n163.voice_cycle()==0x78) for (int j=0; j<8; j++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=n163.voice_out(i)<<7;
|
oscBuf[j]->putSample(i,n163.voice_out(j)<<7);
|
||||||
}
|
}
|
||||||
|
|
||||||
// command queue
|
// command queue
|
||||||
|
@ -128,6 +132,10 @@ void DivPlatformN163::acquire(short** buf, size_t len) {
|
||||||
writes.pop();
|
writes.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformN163::updateWave(int ch, int wave, int pos, int len) {
|
void DivPlatformN163::updateWave(int ch, int wave, int pos, int len) {
|
||||||
|
@ -595,7 +603,7 @@ void DivPlatformN163::setFlags(const DivConfig& flags) {
|
||||||
n163.set_multiplex(multiplex);
|
n163.set_multiplex(multiplex);
|
||||||
rWrite(0x7f,initChanMax<<4);
|
rWrite(0x7f,initChanMax<<4);
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
oscBuf[i]->rate=rate/(initChanMax+1);
|
oscBuf[i]->setRate(rate);//=rate/(initChanMax+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
lenCompensate=flags.getBool("lenCompensate",false);
|
lenCompensate=flags.getBool("lenCompensate",false);
|
||||||
|
|
|
@ -171,15 +171,24 @@ void DivPlatformNamcoWSG::acquire(short** buf, size_t len) {
|
||||||
regPool[w.addr&0x3f]=w.val;
|
regPool[w.addr&0x3f]=w.val;
|
||||||
writes.pop();
|
writes.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
short* bufC[2]={
|
short* bufC[2]={
|
||||||
buf[0]+h, buf[1]+h
|
buf[0]+h, buf[1]+h
|
||||||
};
|
};
|
||||||
namco->sound_stream_update(bufC,1);
|
namco->sound_stream_update(bufC,1);
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=(namco->m_channel_list[i].last_out*chans)>>1;
|
oscBuf[i]->putSample(h,(namco->m_channel_list[i].last_out*chans)>>1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNamcoWSG::updateWave(int ch) {
|
void DivPlatformNamcoWSG::updateWave(int ch) {
|
||||||
|
@ -579,7 +588,7 @@ void DivPlatformNamcoWSG::setFlags(const DivConfig& flags) {
|
||||||
rate=chipClock/32;
|
rate=chipClock/32;
|
||||||
namco->device_clock_changed(96000);
|
namco->device_clock_changed(96000);
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
newNoise=flags.getBool("newNoise",true);
|
newNoise=flags.getBool("newNoise",true);
|
||||||
romMode=flags.getBool("romMode",false);
|
romMode=flags.getBool("romMode",false);
|
||||||
|
|
|
@ -69,7 +69,11 @@ const char** DivPlatformNDS::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNDS::acquire(short** buf, size_t len) {
|
void DivPlatformNDS::acquire(short** buf, size_t len) {
|
||||||
for (size_t i=0; i<len; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t h=0; h<len; h++) {
|
||||||
nds.tick(coreQuality);
|
nds.tick(coreQuality);
|
||||||
int lout=((nds.loutput()-0x200)<<5); // scale to 16 bit
|
int lout=((nds.loutput()-0x200)<<5); // scale to 16 bit
|
||||||
int rout=((nds.routput()-0x200)<<5); // scale to 16 bit
|
int rout=((nds.routput()-0x200)<<5); // scale to 16 bit
|
||||||
|
@ -77,13 +81,17 @@ void DivPlatformNDS::acquire(short** buf, size_t len) {
|
||||||
if (lout<-32768) lout=-32768;
|
if (lout<-32768) lout=-32768;
|
||||||
if (rout>32767) rout=32767;
|
if (rout>32767) rout=32767;
|
||||||
if (rout<-32768) rout=-32768;
|
if (rout<-32768) rout=-32768;
|
||||||
buf[0][i]=lout;
|
buf[0][h]=lout;
|
||||||
buf[1][i]=rout;
|
buf[1][h]=rout;
|
||||||
|
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=(nds.chan_lout(i)+nds.chan_rout(i))>>1;
|
oscBuf[i]->putSample(h,(nds.chan_lout(i)+nds.chan_rout(i))>>1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<16; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 DivPlatformNDS::read_byte(u32 addr) {
|
u8 DivPlatformNDS::read_byte(u32 addr) {
|
||||||
|
@ -564,7 +572,7 @@ void DivPlatformNDS::setFlags(const DivConfig& flags) {
|
||||||
chipClock=33513982;
|
chipClock=33513982;
|
||||||
rate=chipClock/2/coreQuality;
|
rate=chipClock/2/coreQuality;
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
memCompo.capacity=(isDSi?16777216:4194304);
|
memCompo.capacity=(isDSi?16777216:4194304);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,10 @@ void DivPlatformNES::doWrite(unsigned short addr, unsigned char data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNES::acquire_puNES(short** buf, size_t len) {
|
void DivPlatformNES::acquire_puNES(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
doPCM;
|
doPCM;
|
||||||
|
|
||||||
|
@ -127,18 +131,27 @@ void DivPlatformNES::acquire_puNES(short** buf, size_t len) {
|
||||||
buf[0][i]=sample;
|
buf[0][i]=sample;
|
||||||
if (++writeOscBuf>=32) {
|
if (++writeOscBuf>=32) {
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:(nes->S1.output<<11);
|
oscBuf[0]->putSample(i,isMuted[0]?0:(nes->S1.output<<11));
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:(nes->S2.output<<11);
|
oscBuf[1]->putSample(i,isMuted[1]?0:(nes->S2.output<<11));
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:(nes->TR.output<<11);
|
oscBuf[2]->putSample(i,isMuted[2]?0:(nes->TR.output<<11));
|
||||||
oscBuf[3]->data[oscBuf[3]->needle++]=isMuted[3]?0:(nes->NS.output<<11);
|
oscBuf[3]->putSample(i,isMuted[3]?0:(nes->NS.output<<11));
|
||||||
oscBuf[4]->data[oscBuf[4]->needle++]=isMuted[4]?0:(nes->DMC.output<<8);
|
oscBuf[4]->putSample(i,isMuted[4]?0:(nes->DMC.output<<8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNES::acquire_NSFPlay(short** buf, size_t len) {
|
void DivPlatformNES::acquire_NSFPlay(short** buf, size_t len) {
|
||||||
int out1[2];
|
int out1[2];
|
||||||
int out2[2];
|
int out2[2];
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
doPCM;
|
doPCM;
|
||||||
|
|
||||||
|
@ -161,18 +174,27 @@ void DivPlatformNES::acquire_NSFPlay(short** buf, size_t len) {
|
||||||
buf[0][i]=sample;
|
buf[0][i]=sample;
|
||||||
if (++writeOscBuf>=4) {
|
if (++writeOscBuf>=4) {
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=nes1_NP->out[0]<<11;
|
oscBuf[0]->putSample(i,nes1_NP->out[0]<<11);
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=nes1_NP->out[1]<<11;
|
oscBuf[1]->putSample(i,nes1_NP->out[1]<<11);
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=nes2_NP->out[0]<<11;
|
oscBuf[2]->putSample(i,nes2_NP->out[0]<<11);
|
||||||
oscBuf[3]->data[oscBuf[3]->needle++]=nes2_NP->out[1]<<11;
|
oscBuf[3]->putSample(i,nes2_NP->out[1]<<11);
|
||||||
oscBuf[4]->data[oscBuf[4]->needle++]=nes2_NP->out[2]<<8;
|
oscBuf[4]->putSample(i,nes2_NP->out[2]<<8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNES::acquire_NSFPlayE(short** buf, size_t len) {
|
void DivPlatformNES::acquire_NSFPlayE(short** buf, size_t len) {
|
||||||
int out1[2];
|
int out1[2];
|
||||||
int out2[2];
|
int out2[2];
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
doPCM;
|
doPCM;
|
||||||
|
|
||||||
|
@ -195,13 +217,17 @@ void DivPlatformNES::acquire_NSFPlayE(short** buf, size_t len) {
|
||||||
buf[0][i]=sample;
|
buf[0][i]=sample;
|
||||||
if (++writeOscBuf>=4) {
|
if (++writeOscBuf>=4) {
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=e1_NP->out[0]<<11;
|
oscBuf[0]->putSample(i,e1_NP->out[0]<<11);
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=e1_NP->out[1]<<11;
|
oscBuf[1]->putSample(i,e1_NP->out[1]<<11);
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=e2_NP->out[0]<<11;
|
oscBuf[2]->putSample(i,e2_NP->out[0]<<11);
|
||||||
oscBuf[3]->data[oscBuf[3]->needle++]=e2_NP->out[1]<<11;
|
oscBuf[3]->putSample(i,e2_NP->out[1]<<11);
|
||||||
oscBuf[4]->data[oscBuf[4]->needle++]=e2_NP->out[2]<<8;
|
oscBuf[4]->putSample(i,e2_NP->out[2]<<8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<5; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNES::acquire(short** buf, size_t len) {
|
void DivPlatformNES::acquire(short** buf, size_t len) {
|
||||||
|
@ -929,7 +955,7 @@ void DivPlatformNES::setFlags(const DivConfig& flags) {
|
||||||
rate/=8;
|
rate/=8;
|
||||||
}
|
}
|
||||||
for (int i=0; i<5; i++) {
|
for (int i=0; i<5; i++) {
|
||||||
oscBuf[i]->rate=rate/(useNP?4:32);
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
dpcmModeDefault=flags.getBool("dpcmMode",true);
|
dpcmModeDefault=flags.getBool("dpcmMode",true);
|
||||||
|
|
|
@ -29,11 +29,14 @@
|
||||||
void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
||||||
const int depthScale=(15-outDepth);
|
const int depthScale=(15-outDepth);
|
||||||
int output=0;
|
int output=0;
|
||||||
|
|
||||||
|
oscBuf->begin(len);
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
if (!chan[0].active) {
|
if (!chan[0].active) {
|
||||||
buf[0][h]=0;
|
buf[0][h]=0;
|
||||||
buf[1][h]=0;
|
buf[1][h]=0;
|
||||||
oscBuf->data[oscBuf->needle++]=0;
|
oscBuf->putSample(h,0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (chan[0].useWave || (chan[0].sample>=0 && chan[0].sample<parent->song.sampleLen)) {
|
if (chan[0].useWave || (chan[0].sample>=0 && chan[0].sample<parent->song.sampleLen)) {
|
||||||
|
@ -229,7 +232,7 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
||||||
} else {
|
} else {
|
||||||
output=((output*MIN(volMax,chan[0].vol)*MIN(chan[0].envVol,64))>>6)/volMax;
|
output=((output*MIN(volMax,chan[0].vol)*MIN(chan[0].envVol,64))>>6)/volMax;
|
||||||
}
|
}
|
||||||
oscBuf->data[oscBuf->needle++]=((output>>depthScale)<<depthScale)>>1;
|
oscBuf->putSample(h,((output>>depthScale)<<depthScale)>>1);
|
||||||
if (outStereo) {
|
if (outStereo) {
|
||||||
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
|
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
|
||||||
buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;
|
buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;
|
||||||
|
@ -239,6 +242,8 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
||||||
buf[1][h]=output;
|
buf[1][h]=output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oscBuf->end(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCMDAC::tick(bool sysTick) {
|
void DivPlatformPCMDAC::tick(bool sysTick) {
|
||||||
|
@ -542,7 +547,7 @@ void DivPlatformPCMDAC::setFlags(const DivConfig& flags) {
|
||||||
outDepth=(flags.getInt("outDepth",15))&15;
|
outDepth=(flags.getInt("outDepth",15))&15;
|
||||||
outStereo=flags.getBool("stereo",true);
|
outStereo=flags.getBool("stereo",true);
|
||||||
interp=flags.getInt("interpolation",0);
|
interp=flags.getInt("interpolation",0);
|
||||||
oscBuf->rate=rate;
|
oscBuf->setRate(rate);
|
||||||
volMax=flags.getInt("volMax",255);
|
volMax=flags.getInt("volMax",255);
|
||||||
if (volMax<1) volMax=1;
|
if (volMax<1) volMax=1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ void DivPlatformPET::rWrite(unsigned int addr, unsigned char val) {
|
||||||
|
|
||||||
void DivPlatformPET::acquire(short** buf, size_t len) {
|
void DivPlatformPET::acquire(short** buf, size_t len) {
|
||||||
bool hwSROutput=((regPool[11]>>2)&7)==4;
|
bool hwSROutput=((regPool[11]>>2)&7)==4;
|
||||||
|
oscBuf->begin(len);
|
||||||
if (chan[0].enable) {
|
if (chan[0].enable) {
|
||||||
int reload=regPool[8]*2+4;
|
int reload=regPool[8]*2+4;
|
||||||
if (!hwSROutput) {
|
if (!hwSROutput) {
|
||||||
|
@ -71,7 +72,7 @@ void DivPlatformPET::acquire(short** buf, size_t len) {
|
||||||
chan[0].cnt-=SAMP_DIVIDER;
|
chan[0].cnt-=SAMP_DIVIDER;
|
||||||
}
|
}
|
||||||
buf[0][h]=chan[0].out;
|
buf[0][h]=chan[0].out;
|
||||||
oscBuf->data[oscBuf->needle++]=chan[0].out;
|
oscBuf->putSample(h,chan[0].out);
|
||||||
}
|
}
|
||||||
// emulate driver writes to PCR
|
// emulate driver writes to PCR
|
||||||
if (!hwSROutput) regPool[12]=chan[0].out?0xe0:0xc0;
|
if (!hwSROutput) regPool[12]=chan[0].out?0xe0:0xc0;
|
||||||
|
@ -79,9 +80,10 @@ void DivPlatformPET::acquire(short** buf, size_t len) {
|
||||||
chan[0].out=0;
|
chan[0].out=0;
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
buf[0][h]=0;
|
buf[0][h]=0;
|
||||||
oscBuf->data[oscBuf->needle++]=0;
|
oscBuf->putSample(h,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oscBuf->end(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPET::writeOutVol() {
|
void DivPlatformPET::writeOutVol() {
|
||||||
|
@ -311,7 +313,7 @@ int DivPlatformPET::init(DivEngine* p, int channels, int sugRate, const DivConfi
|
||||||
rate=chipClock/SAMP_DIVIDER; // = 250000kHz
|
rate=chipClock/SAMP_DIVIDER; // = 250000kHz
|
||||||
isMuted=false;
|
isMuted=false;
|
||||||
oscBuf=new DivDispatchOscBuffer;
|
oscBuf=new DivDispatchOscBuffer;
|
||||||
oscBuf->rate=rate;
|
oscBuf->setRate(rate);
|
||||||
reset();
|
reset();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ void DivPlatformPokeMini::rWrite(unsigned char addr, unsigned char val) {
|
||||||
|
|
||||||
void DivPlatformPokeMini::acquire(short** buf, size_t len) {
|
void DivPlatformPokeMini::acquire(short** buf, size_t len) {
|
||||||
int out=0;
|
int out=0;
|
||||||
|
oscBuf->begin(len);
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
for (int j=0; j<PCSPKR_DIVIDER; j++) {
|
for (int j=0; j<PCSPKR_DIVIDER; j++) {
|
||||||
elapsedMain++;
|
elapsedMain++;
|
||||||
|
@ -103,12 +104,13 @@ void DivPlatformPokeMini::acquire(short** buf, size_t len) {
|
||||||
if (on) {
|
if (on) {
|
||||||
out=(pos>=pivot && !isMuted[0])?volTable[vol&3]:0;
|
out=(pos>=pivot && !isMuted[0])?volTable[vol&3]:0;
|
||||||
buf[0][i]=out;
|
buf[0][i]=out;
|
||||||
oscBuf->data[oscBuf->needle++]=out;
|
oscBuf->putSample(i,out);
|
||||||
} else {
|
} else {
|
||||||
buf[0][i]=0;
|
buf[0][i]=0;
|
||||||
oscBuf->data[oscBuf->needle++]=0;
|
oscBuf->putSample(i,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oscBuf->end(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPokeMini::tick(bool sysTick) {
|
void DivPlatformPokeMini::tick(bool sysTick) {
|
||||||
|
@ -323,7 +325,7 @@ void DivPlatformPokeMini::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
|
|
||||||
rate=chipClock/PCSPKR_DIVIDER;
|
rate=chipClock/PCSPKR_DIVIDER;
|
||||||
oscBuf->rate=rate;
|
oscBuf->setRate(rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPokeMini::notifyInsDeletion(void* ins) {
|
void DivPlatformPokeMini::notifyInsDeletion(void* ins) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
void DivPlatformPong::acquire(short** buf, size_t len) {
|
void DivPlatformPong::acquire(short** buf, size_t len) {
|
||||||
int out=0;
|
int out=0;
|
||||||
|
oscBuf->begin(len);
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
if (on) {
|
if (on) {
|
||||||
if (--pos<=0) {
|
if (--pos<=0) {
|
||||||
|
@ -33,13 +34,14 @@ void DivPlatformPong::acquire(short** buf, size_t len) {
|
||||||
}
|
}
|
||||||
out=(flip && !isMuted[0])?32767:0;
|
out=(flip && !isMuted[0])?32767:0;
|
||||||
buf[0][i]=out;
|
buf[0][i]=out;
|
||||||
oscBuf->data[oscBuf->needle++]=out;
|
oscBuf->putSample(i,out);
|
||||||
} else {
|
} else {
|
||||||
buf[0][i]=0;
|
buf[0][i]=0;
|
||||||
oscBuf->data[oscBuf->needle++]=0;
|
oscBuf->putSample(i,0);
|
||||||
flip=false;
|
flip=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oscBuf->end(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPong::tick(bool sysTick) {
|
void DivPlatformPong::tick(bool sysTick) {
|
||||||
|
@ -237,7 +239,7 @@ void DivPlatformPong::setFlags(const DivConfig& flags) {
|
||||||
chipClock=1000000;
|
chipClock=1000000;
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/64;
|
rate=chipClock/64;
|
||||||
oscBuf->rate=rate;
|
oscBuf->setRate(rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPong::notifyInsDeletion(void* ins) {
|
void DivPlatformPong::notifyInsDeletion(void* ins) {
|
||||||
|
|
|
@ -82,17 +82,25 @@ const char** DivPlatformPowerNoise::getRegisterSheet() {
|
||||||
void DivPlatformPowerNoise::acquire(short** buf, size_t len) {
|
void DivPlatformPowerNoise::acquire(short** buf, size_t len) {
|
||||||
short left, right;
|
short left, right;
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
pwrnoise_step(&pn,coreQuality,&left,&right);
|
pwrnoise_step(&pn,coreQuality,&left,&right);
|
||||||
|
|
||||||
oscBuf[0]->data[oscBuf[0]->needle++]=mapAmp((pn.n1.out_latch&0xf)+(pn.n1.out_latch>>4));
|
oscBuf[0]->putSample(h,mapAmp((pn.n1.out_latch&0xf)+(pn.n1.out_latch>>4)));
|
||||||
oscBuf[1]->data[oscBuf[1]->needle++]=mapAmp((pn.n2.out_latch&0xf)+(pn.n2.out_latch>>4));
|
oscBuf[1]->putSample(h,mapAmp((pn.n2.out_latch&0xf)+(pn.n2.out_latch>>4)));
|
||||||
oscBuf[2]->data[oscBuf[2]->needle++]=mapAmp((pn.n3.out_latch&0xf)+(pn.n3.out_latch>>4));
|
oscBuf[2]->putSample(h,mapAmp((pn.n3.out_latch&0xf)+(pn.n3.out_latch>>4)));
|
||||||
oscBuf[3]->data[oscBuf[3]->needle++]=mapAmp((pn.s.out_latch&0xf)+(pn.s.out_latch>>4));
|
oscBuf[3]->putSample(h,mapAmp((pn.s.out_latch&0xf)+(pn.s.out_latch>>4)));
|
||||||
|
|
||||||
buf[0][h]=left;
|
buf[0][h]=left;
|
||||||
buf[1][h]=right;
|
buf[1][h]=right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* macros:
|
/* macros:
|
||||||
|
@ -506,7 +514,7 @@ void DivPlatformPowerNoise::setFlags(const DivConfig& flags) {
|
||||||
rate=chipClock/coreQuality;
|
rate=chipClock/coreQuality;
|
||||||
|
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,13 +38,21 @@ const char** DivPlatformPV1000::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPV1000::acquire(short** buf, size_t len) {
|
void DivPlatformPV1000::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
short samp=d65010g031_sound_tick(&d65010g031,1);
|
short samp=d65010g031_sound_tick(&d65010g031,1);
|
||||||
buf[0][h]=samp;
|
buf[0][h]=samp;
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=MAX(d65010g031.out[i]<<2,0);
|
oscBuf[i]->putSample(h,MAX(d65010g031.out[i]<<2,0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<3; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPV1000::tick(bool sysTick) {
|
void DivPlatformPV1000::tick(bool sysTick) {
|
||||||
|
@ -263,7 +271,7 @@ void DivPlatformPV1000::setFlags(const DivConfig& flags) {
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/1024;
|
rate=chipClock/1024;
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,6 +265,10 @@ const char** DivPlatformQSound::getRegisterSheet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformQSound::acquire(short** buf, size_t len) {
|
void DivPlatformQSound::acquire(short** buf, size_t len) {
|
||||||
|
for (int i=0; i<19; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t h=0; h<len; h++) {
|
for (size_t h=0; h<len; h++) {
|
||||||
qsound_update(&chip);
|
qsound_update(&chip);
|
||||||
buf[0][h]=chip.out[0];
|
buf[0][h]=chip.out[0];
|
||||||
|
@ -274,9 +278,13 @@ void DivPlatformQSound::acquire(short** buf, size_t len) {
|
||||||
int data=chip.voice_output[i]<<1;
|
int data=chip.voice_output[i]<<1;
|
||||||
if (data<-32768) data=-32768;
|
if (data<-32768) data=-32768;
|
||||||
if (data>32767) data=32767;
|
if (data>32767) data=32767;
|
||||||
oscBuf[i]->data[oscBuf[i]->needle++]=data;
|
oscBuf[i]->putSample(h,data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<19; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformQSound::tick(bool sysTick) {
|
void DivPlatformQSound::tick(bool sysTick) {
|
||||||
|
@ -861,7 +869,7 @@ int DivPlatformQSound::init(DivEngine* p, int channels, int sugRate, const DivCo
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
for (int i=0; i<19; i++) {
|
for (int i=0; i<19; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->setRate(rate);
|
||||||
}
|
}
|
||||||
return 19;
|
return 19;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,13 @@ void DivPlatformSAA1099::acquire_saaSound(short** buf, size_t len) {
|
||||||
regPool[w.addr&0x1f]=w.val;
|
regPool[w.addr&0x1f]=w.val;
|
||||||
writes.pop();
|
writes.pop();
|
||||||
}
|
}
|
||||||
|
for (int i=0; i<6; i++) {
|
||||||
|
oscBuf[i]->begin(len);
|
||||||
|
}
|
||||||
saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len,oscBuf);
|
saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len,oscBuf);
|
||||||
|
for (int i=0; i<6; i++) {
|
||||||
|
oscBuf[i]->end(len);
|
||||||
|
}
|
||||||
#ifdef TA_BIG_ENDIAN
|
#ifdef TA_BIG_ENDIAN
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
buf[0][i]=(short)((((unsigned short)saaBuf[0][i<<1])<<8)|(((unsigned short)saaBuf[0][i<<1])>>8));
|
buf[0][i]=(short)((((unsigned short)saaBuf[0][i<<1])<<8)|(((unsigned short)saaBuf[0][i<<1])>>8));
|
||||||
|
|
|
@ -485,7 +485,7 @@ public:
|
||||||
return mAudioChannels[timer].fireAction( tick );
|
return mAudioChannels[timer].fireAction( tick );
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioSample sampleAudio( DivDispatchOscBuffer** oscb ) const
|
AudioSample sampleAudio( int* oscb ) const
|
||||||
{
|
{
|
||||||
int left{};
|
int left{};
|
||||||
int right{};
|
int right{};
|
||||||
|
@ -509,7 +509,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oscb!=NULL) {
|
if (oscb!=NULL) {
|
||||||
oscb[i]->data[oscb[i]->needle++]=oscbWrite;
|
oscb[i]=oscbWrite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ void Mikey::enqueueSampling()
|
||||||
mQueue->push( ( mNextTick & ~15 ) | 4 );
|
mQueue->push( ( mNextTick & ~15 ) | 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mikey::sampleAudio( int16_t* bufL, int16_t* bufR, size_t size, DivDispatchOscBuffer** oscb )
|
void Mikey::sampleAudio( int16_t* bufL, int16_t* bufR, size_t size, int* oscb )
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
while ( i < size )
|
while ( i < size )
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
~Mikey();
|
~Mikey();
|
||||||
|
|
||||||
void write( uint8_t address, uint8_t value );
|
void write( uint8_t address, uint8_t value );
|
||||||
void sampleAudio( int16_t* bufL, int16_t* bufR, size_t size, DivDispatchOscBuffer** oscb = NULL );
|
void sampleAudio( int16_t* bufL, int16_t* bufR, size_t size, int* oscb = NULL );
|
||||||
|
|
||||||
uint8_t const* getRegisterPool();
|
uint8_t const* getRegisterPool();
|
||||||
|
|
||||||
|
|
|
@ -460,8 +460,6 @@ void FurnaceGUI::drawChanOsc() {
|
||||||
// I have a feeling this could be simplified to two FFTs or even one...
|
// I have a feeling this could be simplified to two FFTs or even one...
|
||||||
// if you know how, please tell me
|
// if you know how, please tell me
|
||||||
|
|
||||||
// TODO: utterly broken!
|
|
||||||
|
|
||||||
// initialization
|
// initialization
|
||||||
double phase=0.0;
|
double phase=0.0;
|
||||||
int displaySize=65536.0f*(fft->windowSize/1000.0f);
|
int displaySize=65536.0f*(fft->windowSize/1000.0f);
|
||||||
|
|
Loading…
Reference in a new issue