summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/fixedpoint.h
diff options
context:
space:
mode:
authorKevin Ferrare <kevin@rockbox.org>2008-01-22 08:02:31 +0000
committerKevin Ferrare <kevin@rockbox.org>2008-01-22 08:02:31 +0000
commiteb93be2dd9fdca99ffae450e0630045ece449a2f (patch)
tree713c96efcdedfe54b7876d483de2c91e14b84d81 /apps/plugins/lib/fixedpoint.h
parent7da7e7bdd2d88cefe09f8c9953df076875750c25 (diff)
downloadrockbox-eb93be2dd9fdca99ffae450e0630045ece449a2f.zip
rockbox-eb93be2dd9fdca99ffae450e0630045ece449a2f.tar.gz
rockbox-eb93be2dd9fdca99ffae450e0630045ece449a2f.tar.bz2
rockbox-eb93be2dd9fdca99ffae450e0630045ece449a2f.tar.xz
Fire plugin : initializes palettes with a function instead of storing them in static arrays, changed the color LCD's palette to make it look nicer, switched the button API to the action API, reorganized code a little bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16138 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/fixedpoint.h')
-rw-r--r--apps/plugins/lib/fixedpoint.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/plugins/lib/fixedpoint.h b/apps/plugins/lib/fixedpoint.h
index 7199157..a9650e7 100644
--- a/apps/plugins/lib/fixedpoint.h
+++ b/apps/plugins/lib/fixedpoint.h
@@ -24,3 +24,11 @@ long fsqrt(long a, unsigned int fracbits);
long cos_int(int val);
long sin_int(int val);
long flog(int x);
+
+/* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
+ * whichever is faster for the architecture) */
+#ifdef CPU_ARM
+#define FMULU(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b))))
+#else /* SH1, coldfire */
+#define FMULU(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
+#endif