mirror of https://github.com/mgba-emu/mgba.git
GB, GBA Audio: Adjust mixdown
This commit is contained in:
parent
6e7c250b19
commit
b6f3a2929d
|
@ -576,47 +576,47 @@ void GBAudioUpdateFrame(struct GBAudio* audio, struct mTiming* timing) {
|
|||
}
|
||||
|
||||
void GBAudioSamplePSG(struct GBAudio* audio, int16_t* left, int16_t* right) {
|
||||
int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x8;
|
||||
int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : -0x8;
|
||||
int sampleLeft = dcOffset;
|
||||
int sampleRight = dcOffset;
|
||||
|
||||
if (audio->playingCh1 && !audio->forceDisableCh[0]) {
|
||||
if (audio->ch1Left) {
|
||||
sampleLeft -= audio->ch1.sample;
|
||||
sampleLeft += audio->ch1.sample;
|
||||
}
|
||||
|
||||
if (audio->ch1Right) {
|
||||
sampleRight -= audio->ch1.sample;
|
||||
sampleRight += audio->ch1.sample;
|
||||
}
|
||||
}
|
||||
|
||||
if (audio->playingCh2 && !audio->forceDisableCh[1]) {
|
||||
if (audio->ch2Left) {
|
||||
sampleLeft -= audio->ch2.sample;
|
||||
sampleLeft += audio->ch2.sample;
|
||||
}
|
||||
|
||||
if (audio->ch2Right) {
|
||||
sampleRight -= audio->ch2.sample;
|
||||
sampleRight += audio->ch2.sample;
|
||||
}
|
||||
}
|
||||
|
||||
if (audio->playingCh3 && !audio->forceDisableCh[2]) {
|
||||
if (audio->ch3Left) {
|
||||
sampleLeft -= audio->ch3.sample;
|
||||
sampleLeft += audio->ch3.sample;
|
||||
}
|
||||
|
||||
if (audio->ch3Right) {
|
||||
sampleRight -= audio->ch3.sample;
|
||||
sampleRight += audio->ch3.sample;
|
||||
}
|
||||
}
|
||||
|
||||
if (audio->playingCh4 && !audio->forceDisableCh[3]) {
|
||||
if (audio->ch4Left) {
|
||||
sampleLeft -= audio->ch4.sample;
|
||||
sampleLeft += audio->ch4.sample;
|
||||
}
|
||||
|
||||
if (audio->ch4Right) {
|
||||
sampleRight -= audio->ch4.sample;
|
||||
sampleRight += audio->ch4.sample;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -632,8 +632,8 @@ static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {
|
|||
int16_t sampleLeft = 0;
|
||||
int16_t sampleRight = 0;
|
||||
GBAudioSamplePSG(audio, &sampleLeft, &sampleRight);
|
||||
sampleLeft = (sampleLeft * audio->masterVolume * 9) >> 7;
|
||||
sampleRight = (sampleRight * audio->masterVolume * 9) >> 7;
|
||||
sampleLeft = (sampleLeft * audio->masterVolume * 6) >> 7;
|
||||
sampleRight = (sampleRight * audio->masterVolume * 6) >> 7;
|
||||
|
||||
mCoreSyncLockAudio(audio->p->sync);
|
||||
unsigned produced;
|
||||
|
|
|
@ -253,7 +253,7 @@ static int _applyBias(struct GBAAudio* audio, int sample) {
|
|||
} else if (sample < 0) {
|
||||
sample = 0;
|
||||
}
|
||||
return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume) >> 2;
|
||||
return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume * 3) >> 4;
|
||||
}
|
||||
|
||||
static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {
|
||||
|
|
Loading…
Reference in New Issue