summaryrefslogtreecommitdiff
path: root/sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound.c')
-rw-r--r--sound.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound.c b/sound.c
index 126fb5d..10a3261 100644
--- a/sound.c
+++ b/sound.c
@@ -273,8 +273,11 @@ u32 gbc_sound_master_volume;
else \
rate = rate + (rate >> gs->sweep_shift); \
\
- if(rate > 2048) \
- rate = 2048; \
+ if(rate > 2047) { \
+ rate = 2047; \
+ gs->active_flag = 0; \
+ break; \
+ } \
\
frequency_step = float_to_fp16_16(((131072.0f / (2048 - rate)) * 8.0f) \
/ sound_frequency); \