Game Boy: fix wave being offset by 1

This commit is contained in:
tildearrow 2023-05-03 02:30:39 -05:00
parent 05b10bb50a
commit 64145166ba

View file

@ -82,8 +82,8 @@ void DivPlatformGB::acquire(short** buf, size_t len) {
void DivPlatformGB::updateWave() { void DivPlatformGB::updateWave() {
rWrite(0x1a,0); rWrite(0x1a,0);
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
int nibble1=15-ws.output[((i<<1)+antiClickWavePos-1)&31]; int nibble1=15-ws.output[((i<<1)+antiClickWavePos)&31];
int nibble2=15-ws.output[((1+(i<<1))+antiClickWavePos-1)&31]; int nibble2=15-ws.output[((1+(i<<1))+antiClickWavePos)&31];
rWrite(0x30+i,(nibble1<<4)|nibble2); rWrite(0x30+i,(nibble1<<4)|nibble2);
} }
antiClickWavePos&=31; antiClickWavePos&=31;