Skip to content

Commit c64a6ed

Browse files
committed
Return last output of the sound channel 3 even if it's disabled.
This fixes the buzzing in "3D pocket pool" #3.
1 parent f68ab41 commit c64a6ed

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/src/main/java/eu/rekawek/coffeegb/core/sound/SoundMode3.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void start() {
122122

123123
@Override
124124
public void trigger() {
125+
i = 0;
125126
resetFreqDivider();
126127
triggered = !gbc;
127128
if (gbc) {
@@ -132,14 +133,10 @@ public void trigger() {
132133
@Override
133134
public int tick() {
134135
ticksSinceRead++;
135-
if (!updateLength()) {
136-
return 0;
136+
if (!channelEnabled) {
137+
return lastOutput;
137138
}
138-
if (!dacEnabled) {
139-
return 0;
140-
}
141-
142-
if ((getNr0() & (1 << 7)) == 0) {
139+
if (!updateLength()) {
143140
return 0;
144141
}
145142

0 commit comments

Comments
 (0)