TIA: fixes fixes fixes
This commit is contained in:
parent
fcefbb4909
commit
917a03eb07
|
|
@ -53,6 +53,9 @@ void Audio::reset(bool st)
|
||||||
myCurrentSample[0]=0;
|
myCurrentSample[0]=0;
|
||||||
myCurrentSample[1]=0;
|
myCurrentSample[1]=0;
|
||||||
|
|
||||||
|
myChannelOut[0]=0;
|
||||||
|
myChannelOut[1]=0;
|
||||||
|
|
||||||
myChannel0.reset();
|
myChannel0.reset();
|
||||||
myChannel1.reset();
|
myChannel1.reset();
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +123,9 @@ void Audio::addSample(unsigned char sample0, unsigned char sample1)
|
||||||
else {
|
else {
|
||||||
myCurrentSample[0] = myMixingTableSum[sample0 + sample1];
|
myCurrentSample[0] = myMixingTableSum[sample0 + sample1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myChannelOut[0] = myMixingTableIndividual[sample0];
|
||||||
|
myChannelOut[1] = myMixingTableIndividual[sample1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ namespace TIA {
|
||||||
AudioChannel& channel1();
|
AudioChannel& channel1();
|
||||||
|
|
||||||
short myCurrentSample[2];
|
short myCurrentSample[2];
|
||||||
|
short myChannelOut[2];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void phase1();
|
void phase1();
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,19 @@ const char** DivPlatformTIA::getRegisterSheet() {
|
||||||
void DivPlatformTIA::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
void DivPlatformTIA::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||||
for (size_t h=start; h<start+len; h++) {
|
for (size_t h=start; h<start+len; h++) {
|
||||||
tia.tick();
|
tia.tick();
|
||||||
bufL[h]=tia.myCurrentSample[0];
|
if (mixingType==2) {
|
||||||
|
bufL[h]=tia.myCurrentSample[0];
|
||||||
|
bufR[h]=tia.myCurrentSample[1];
|
||||||
|
} else if (mixingType==1) {
|
||||||
|
bufL[h]=(tia.myCurrentSample[0]+tia.myCurrentSample[1])>>1;
|
||||||
|
} else {
|
||||||
|
bufL[h]=tia.myCurrentSample[0];
|
||||||
|
}
|
||||||
|
if (++chanOscCounter>=114) {
|
||||||
|
chanOscCounter=0;
|
||||||
|
oscBuf[0]->data[oscBuf[0]->needle++]=tia.myChannelOut[0];
|
||||||
|
oscBuf[1]->data[oscBuf[1]->needle++]=tia.myChannelOut[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -303,7 +315,7 @@ int DivPlatformTIA::getRegisterPoolSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformTIA::reset() {
|
void DivPlatformTIA::reset() {
|
||||||
tia.reset(false);
|
tia.reset(mixingType);
|
||||||
memset(regPool,0,16);
|
memset(regPool,0,16);
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
chan[i]=DivPlatformTIA::Channel();
|
chan[i]=DivPlatformTIA::Channel();
|
||||||
|
|
@ -313,7 +325,7 @@ void DivPlatformTIA::reset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformTIA::isStereo() {
|
bool DivPlatformTIA::isStereo() {
|
||||||
return false;
|
return (mixingType==2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformTIA::keyOffAffectsArp(int ch) {
|
bool DivPlatformTIA::keyOffAffectsArp(int ch) {
|
||||||
|
|
@ -341,15 +353,19 @@ void DivPlatformTIA::setFlags(unsigned int flags) {
|
||||||
rate=COLOR_NTSC;
|
rate=COLOR_NTSC;
|
||||||
}
|
}
|
||||||
chipClock=rate;
|
chipClock=rate;
|
||||||
|
mixingType=(flags>>1)&3;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate/114;
|
||||||
}
|
}
|
||||||
|
tia.reset(mixingType);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformTIA::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformTIA::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
mixingType=0;
|
||||||
|
chanOscCounter=0;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
isMuted[i]=false;
|
isMuted[i]=false;
|
||||||
oscBuf[i]=new DivDispatchOscBuffer;
|
oscBuf[i]=new DivDispatchOscBuffer;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class DivPlatformTIA: public DivDispatch {
|
||||||
Channel chan[2];
|
Channel chan[2];
|
||||||
DivDispatchOscBuffer* oscBuf[2];
|
DivDispatchOscBuffer* oscBuf[2];
|
||||||
bool isMuted[2];
|
bool isMuted[2];
|
||||||
|
unsigned char mixingType;
|
||||||
|
unsigned char chanOscCounter;
|
||||||
TIA::Audio tia;
|
TIA::Audio tia;
|
||||||
unsigned char regPool[16];
|
unsigned char regPool[16];
|
||||||
friend void putDispatchChan(void*,int,int);
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
|
||||||
|
|
@ -402,6 +402,24 @@ void FurnaceGUI::drawSysConf(int chan, DivSystem type, unsigned int& flags, bool
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DIV_SYSTEM_TIA: {
|
||||||
|
ImGui::Text("Mixing mode:");
|
||||||
|
if (ImGui::RadioButton("Mono",(flags&6)==0)) {
|
||||||
|
copyOfFlags=(flags&(~6));
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Mono (no distortion)",(flags&6)==2)) {
|
||||||
|
copyOfFlags=(flags&(~6))|2;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton("Stereo",(flags&6)==4)) {
|
||||||
|
copyOfFlags=(flags&(~6))|4;
|
||||||
|
}
|
||||||
|
|
||||||
|
sysPal=flags&1;
|
||||||
|
if (ImGui::Checkbox("PAL",&sysPal)) {
|
||||||
|
copyOfFlags=(flags&(~1))|(unsigned int)sysPal;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DIV_SYSTEM_PCSPKR: {
|
case DIV_SYSTEM_PCSPKR: {
|
||||||
ImGui::Text("Speaker type:");
|
ImGui::Text("Speaker type:");
|
||||||
if (ImGui::RadioButton("Unfiltered",(flags&3)==0)) {
|
if (ImGui::RadioButton("Unfiltered",(flags&3)==0)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue