diff --git a/src/gb/audio.c b/src/gb/audio.c index a0e5ef1b9..f356f45b8 100644 --- a/src/gb/audio.c +++ b/src/gb/audio.c @@ -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; diff --git a/src/gba/audio.c b/src/gba/audio.c index 14f47ff56..c0ed7cf4c 100644 --- a/src/gba/audio.c +++ b/src/gba/audio.c @@ -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) {