all repos — mgba @ 4eece81b8c914f4ecb323d29890eb788ca1d5f4b

mGBA Game Boy Advance Emulator

GB Audio: Fix square sample range (fixes #546)
Vicki Pfau vi@endrift.com
Sat, 17 Jun 2017 09:44:55 -0700
commit

4eece81b8c914f4ecb323d29890eb788ca1d5f4b

parent

700ab0bd36c19379163980c351b811bcb5e3b81a

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gb/audio.csrc/gb/audio.c

@@ -709,7 +709,7 @@ return (envelope->initialVolume || envelope->direction) && envelope->dead != 2;

} static void _updateSquareSample(struct GBAudioSquareChannel* ch) { - ch->sample = (ch->control.hi * ch->envelope.currentVolume - 8) * 0x10; + ch->sample = (ch->control.hi * 2 - 1) * ch->envelope.currentVolume * 0x8; } static int32_t _updateSquareChannel(struct GBAudioSquareChannel* ch) {