Merge pull request #94 from davidgfnet/master
Small fixes to division by zero
This commit is contained in:
commit
28aa08de99
|
@ -199,7 +199,7 @@ static void sound_control_x(u32 value)
|
|||
|
||||
#define sound_update_frequency_step(timer_number) \
|
||||
timer[timer_number].frequency_step = \
|
||||
float_to_fp8_24(GBC_BASE_RATE / (timer_reload * sound_frequency)) \
|
||||
float_to_fp8_24((GBC_BASE_RATE / sound_frequency) / (timer_reload)) \
|
||||
|
||||
/* Main */
|
||||
extern timer_type timer[4];
|
||||
|
|
7
sound.c
7
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); \
|
||||
|
|
Loading…
Reference in New Issue