summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/emu8950.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/emu8950.h')
-rw-r--r--apps/codecs/libgme/emu8950.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/libgme/emu8950.h b/apps/codecs/libgme/emu8950.h
index 88d17b956e..02169050d2 100644
--- a/apps/codecs/libgme/emu8950.h
+++ b/apps/codecs/libgme/emu8950.h
@@ -238,11 +238,11 @@ void OPL_changeStatusMask(struct Y8950* this_, byte newMask);
238 238
239 239
240// Adjust envelope speed which depends on sampling rate 240// Adjust envelope speed which depends on sampling rate
241static inline unsigned int rate_adjust(double x, int rate, int clk) 241static inline unsigned int rate_adjust(int x, int rate, int clk)
242{ 242{
243 double tmp = x * clk / 72 / rate + 0.5; // +0.5 to round 243 unsigned int tmp = (long long)x * clk / 72 / rate;
244// assert (tmp <= 4294967295U); 244// assert (tmp <= 4294967295U);
245 return (unsigned int)tmp; 245 return tmp;
246} 246}
247 247
248#endif 248#endif