summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authornotaz2011-09-06 20:18:34 +0300
committernotaz2011-09-08 00:48:33 +0300
commit2f1c528a6c37558760b28638d271f5ff9ba45e4f (patch)
treecf0efc8e28469726fd231e54f8655ae94ecdc891 /common.h
parenta231964c3570be4cf3d2efd023090b6a9e730935 (diff)
downloadpicogpsp-2f1c528a6c37558760b28638d271f5ff9ba45e4f.tar.gz
picogpsp-2f1c528a6c37558760b28638d271f5ff9ba45e4f.tar.bz2
picogpsp-2f1c528a6c37558760b28638d271f5ff9ba45e4f.zip
tweak sound buffering and timing to better match pandora's refresh.
this also changes how direct sound channels are started and sample step precision is increased to hopefully fix gbc + direct channel desync that has been reported on the forums.
Diffstat (limited to 'common.h')
-rw-r--r--common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.h b/common.h
index 7eea8b6..da22d2e 100644
--- a/common.h
+++ b/common.h
@@ -180,6 +180,7 @@
typedef u32 fixed16_16;
+typedef u32 fixed8_24;
#define float_to_fp16_16(value) \
(fixed16_16)((value) * 65536.0) \
@@ -196,6 +197,12 @@ typedef u32 fixed16_16;
#define fp16_16_fractional_part(value) \
((value) & 0xFFFF) \
+#define float_to_fp8_24(value) \
+ (fixed8_24)((value) * 16777216.0) \
+
+#define fp8_24_fractional_part(value) \
+ ((value) & 0xFFFFFF) \
+
#define fixed_div(numerator, denominator, bits) \
(((numerator * (1 << bits)) + (denominator / 2)) / denominator) \