From 73dd66b439c35f8b79febc37b6584798db7c0a80 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 10 Feb 2022 02:56:36 -0500 Subject: [PATCH] GB: fix wave orientation --- src/engine/platform/gb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 8f83502de..556084974 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -57,8 +57,8 @@ void DivPlatformGB::updateWave() { if (wt->max<1 || wt->len<1) { rWrite(0x30+i,0); } else { - unsigned char nibble1=(wt->data[(i*2)*wt->len/32]*15)/wt->max; - unsigned char nibble2=(wt->data[(1+i*2)*wt->len/32]*15)/wt->max; + unsigned char nibble1=15-((wt->data[(i*2)*wt->len/32]*15)/wt->max); + unsigned char nibble2=15-((wt->data[(1+i*2)*wt->len/32]*15)/wt->max); rWrite(0x30+i,(nibble1<<4)|nibble2); } }