aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-10-24 15:03:47 +1000
committerinmarket <andrewh@inmarket.com.au>2013-10-24 15:03:47 +1000
commite6f17baf6133fb83c5c72f7b173cf50c9c275224 (patch)
treed9bfb55a08c61ffa018d5c1bb6bdb32320d31d85 /demos
parent21afd2b8f19d522fab6b78670bf1afcf11388cd5 (diff)
downloaduGFX-e6f17baf6133fb83c5c72f7b173cf50c9c275224.tar.gz
uGFX-e6f17baf6133fb83c5c72f7b173cf50c9c275224.tar.bz2
uGFX-e6f17baf6133fb83c5c72f7b173cf50c9c275224.zip
GMISC invsqrt() function.
Fix a 64bit processor bug. Add support for processors where the floating point and integer endianness don't match. Add support for processors with a non-standard floating point format. Update gdisp_streaming demo with extra comments to reflect the above changes.
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/gdisp/gdisp_streaming/gfxconf.h10
-rw-r--r--demos/modules/gdisp/gdisp_streaming/main.c32
2 files changed, 29 insertions, 13 deletions
diff --git a/demos/modules/gdisp/gdisp_streaming/gfxconf.h b/demos/modules/gdisp/gdisp_streaming/gfxconf.h
index 4db07fb9..b38be854 100644
--- a/demos/modules/gdisp/gdisp_streaming/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_streaming/gfxconf.h
@@ -35,9 +35,11 @@
/* Builtin Fonts */
#define GDISP_INCLUDE_FONT_UI2 FALSE
-#define GFX_USE_GMISC TRUE
-#define GMISC_NEED_FIXEDTRIG FALSE
-#define GMISC_NEED_FASTTRIG FALSE
-#define GMISC_NEED_INVSQRT TRUE
+#define GFX_USE_GMISC TRUE
+#define GMISC_NEED_FIXEDTRIG FALSE
+#define GMISC_NEED_FASTTRIG FALSE
+#define GMISC_NEED_INVSQRT TRUE
+//#define GDISP_INVSQRT_MIXED_ENDIAN TRUE
+//#define GDISP_INVSQRT_REAL_SLOW TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/gdisp_streaming/main.c b/demos/modules/gdisp/gdisp_streaming/main.c
index 774ee833..5b857eeb 100644
--- a/demos/modules/gdisp/gdisp_streaming/main.c
+++ b/demos/modules/gdisp/gdisp_streaming/main.c
@@ -31,15 +31,29 @@
#include "gfx.h"
#include <math.h>
-#define Lightgrey ()
-#define Midgrey ()
-#define Darkgrey (HTML2COLOR(0x303030))
-
-#define BALLCOLOR1 Red
-#define BALLCOLOR2 Yellow
-#define WALLCOLOR HTML2COLOR(0x303030)
-#define BACKCOLOR HTML2COLOR(0xC0C0C0)
-#define FLOORCOLOR HTML2COLOR(0x606060)
+/**
+ * NOTE:
+ *
+ * This demo uses floating point operations. Don't expect it to work with any
+ * speed unless your processor has an FPU.
+ *
+ * If you see garbage inside the ball as it is running rather than the red and yellow
+ * checkerboard pattern then the fast invsqrt() function in GMISC does not work on
+ * your processor.
+ *
+ * You can modify the implementation of invsqrt() by firstly defining
+ * #define GDISP_INVSQRT_MIXED_ENDIAN TRUE
+ * in your gfxconf.h file.
+ *
+ * If it still doesn't work then instead define
+ * #define GDISP_INVSQRT_REAL_SLOW TRUE
+ * in your gfxconf.h file. This should always work although it will probably be slow.
+ */
+#define BALLCOLOR1 Red
+#define BALLCOLOR2 Yellow
+#define WALLCOLOR HTML2COLOR(0x303030)
+#define BACKCOLOR HTML2COLOR(0xC0C0C0)
+#define FLOORCOLOR HTML2COLOR(0x606060)
#define SHADOWALPHA (255-255*0.2)
int main(void) {