DC offset improvements
This commit is contained in:
parent
46bf69769b
commit
38ca437190
14 changed files with 95 additions and 10 deletions
|
|
@ -74,6 +74,14 @@ int DivDispatch::getPortaFloor(int ch) {
|
|||
return 0x00;
|
||||
}
|
||||
|
||||
float DivDispatch::getPostAmp() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
bool DivDispatch::getDCOffRequired() {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* DivDispatch::getEffectName(unsigned char effect) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -497,6 +497,10 @@ void DivPlatformAY8910::flushWrites() {
|
|||
while (!writes.empty()) writes.pop();
|
||||
}
|
||||
|
||||
bool DivPlatformAY8910::getDCOffRequired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void DivPlatformAY8910::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
ay->device_reset();
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
void setFlags(unsigned int flags);
|
||||
bool isStereo();
|
||||
bool keyOffAffectsArp(int ch);
|
||||
bool getDCOffRequired();
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
void poke(std::vector<DivRegWrite>& wlist);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ void DivPlatformMMC5::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
if (!isMuted[2]) {
|
||||
sample+=mmc5->pcm.output*2;
|
||||
}
|
||||
sample=(sample-128)<<6;
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
|
|
@ -336,6 +335,10 @@ int DivPlatformMMC5::getRegisterPoolSize() {
|
|||
return 32;
|
||||
}
|
||||
|
||||
float DivPlatformMMC5::getPostAmp() {
|
||||
return 64.0f;
|
||||
}
|
||||
|
||||
void DivPlatformMMC5::reset() {
|
||||
for (int i=0; i<3; i++) {
|
||||
chan[i]=DivPlatformMMC5::Channel();
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class DivPlatformMMC5: public DivDispatch {
|
|||
void tick();
|
||||
void muteChannel(int ch, bool mute);
|
||||
bool keyOffAffectsArp(int ch);
|
||||
float getPostAmp();
|
||||
void setFlags(unsigned int flags);
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,14 @@ void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
DivSample* s=parent->getSample(dacSample);
|
||||
if (s->samples>0) {
|
||||
if (!isMuted[4]) {
|
||||
rWrite(0x4011,((unsigned char)s->data8[dacPos]+0x80)>>1);
|
||||
unsigned char next=((unsigned char)s->data8[dacPos]+0x80)>>1;
|
||||
if (dacAntiClickOn && dacAntiClick<next) {
|
||||
dacAntiClick+=8;
|
||||
rWrite(0x4011,dacAntiClick);
|
||||
} else {
|
||||
dacAntiClickOn=false;
|
||||
rWrite(0x4011,next);
|
||||
}
|
||||
}
|
||||
if (++dacPos>=s->samples) {
|
||||
if (s->loopStart>=0 && s->loopStart<(int)s->samples) {
|
||||
|
|
@ -101,7 +108,7 @@ void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
if (nes->apu.clocked) {
|
||||
nes->apu.clocked=false;
|
||||
}
|
||||
int sample=(pulse_output(nes)+tnd_output(nes)-128)<<7;
|
||||
int sample=(pulse_output(nes)+tnd_output(nes));
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
|
|
@ -454,6 +461,10 @@ int DivPlatformNES::getRegisterPoolSize() {
|
|||
return 32;
|
||||
}
|
||||
|
||||
float DivPlatformNES::getPostAmp() {
|
||||
return 128.0f;
|
||||
}
|
||||
|
||||
void DivPlatformNES::reset() {
|
||||
for (int i=0; i<5; i++) {
|
||||
chan[i]=DivPlatformNES::Channel();
|
||||
|
|
@ -476,6 +487,9 @@ void DivPlatformNES::reset() {
|
|||
rWrite(0x4015,0x1f);
|
||||
rWrite(0x4001,chan[0].sweep);
|
||||
rWrite(0x4005,chan[1].sweep);
|
||||
|
||||
dacAntiClickOn=true;
|
||||
dacAntiClick=0;
|
||||
}
|
||||
|
||||
bool DivPlatformNES::keyOffAffectsArp(int ch) {
|
||||
|
|
|
|||
|
|
@ -54,10 +54,11 @@ class DivPlatformNES: public DivDispatch {
|
|||
Channel chan[5];
|
||||
bool isMuted[5];
|
||||
int dacPeriod, dacRate;
|
||||
unsigned int dacPos;
|
||||
unsigned int dacPos, dacAntiClick;
|
||||
int dacSample;
|
||||
unsigned char sampleBank;
|
||||
unsigned char apuType;
|
||||
bool dacAntiClickOn;
|
||||
struct NESAPU* nes;
|
||||
unsigned char regPool[128];
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ class DivPlatformNES: public DivDispatch {
|
|||
void tick();
|
||||
void muteChannel(int ch, bool mute);
|
||||
bool keyOffAffectsArp(int ch);
|
||||
float getPostAmp();
|
||||
void setFlags(unsigned int flags);
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
|
|
|
|||
|
|
@ -414,6 +414,16 @@ void DivPlatformSAA1099::reset() {
|
|||
|
||||
extMode=false;
|
||||
|
||||
rWrite(8,255);
|
||||
rWrite(9,255);
|
||||
rWrite(10,255);
|
||||
rWrite(11,255);
|
||||
rWrite(12,255);
|
||||
rWrite(13,255);
|
||||
rWrite(16,0x77);
|
||||
rWrite(17,0x77);
|
||||
rWrite(18,0x77);
|
||||
rWrite(0x1c,2);
|
||||
rWrite(0x1c,1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,8 @@ void apu_turn_on(struct NESAPU* a, BYTE apu_type) {
|
|||
a->S2.sweep.delay = 1;
|
||||
a->S2.sweep.divider = 1;
|
||||
a->TR.frequency = 1;
|
||||
a->TR.sequencer = 0;
|
||||
/* questo era 0 ma produce click nell'audio */
|
||||
a->TR.sequencer = 7;
|
||||
a->NS.frequency = 1;
|
||||
a->NS.shift = 1;
|
||||
a->DMC.frequency = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue