summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-27 20:03:52 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-27 20:03:52 +0000
commita14f545ded073205f06ffc851432420fa0e0d8c2 (patch)
tree6b8b7c6bf4c921116acb6addf347d5e3c8b359cd /apps
parent00866dbf86ad9fe3a65c94d2f7b5b0052a7e2738 (diff)
Adjusted mandelbrot plugin to H1x0: (1) Working button assignment. (2) Different LCD aspect. Note that there is something wrong with the aspect when zooming; this was in fact there before, also on archos. (3) Grayscale library init for variable LCD resolution.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7245 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/mandelbrot.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index 1037212b15..9dde520747 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -20,16 +20,7 @@
#ifndef SIMULATOR
#include "plugin.h"
-#if CONFIG_LCD == LCD_SSD1815 /* only for Recorder/Ondio displays */
-/*
- FIX:
-
- This would be a lot nicer if it depended on HAVE_LCD_BITMAP only, but we
- need to fix the grayscale lib for Gmini and iRiver. Either with true
- grayscale or 1bit.
-
-*/
-
+#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
#include "gray.h"
/* variable button definitions */
@@ -53,11 +44,11 @@
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
#define MANDELBROT_QUIT BUTTON_OFF
-#define MANDELBROT_ZOOM_IN BUTTON_ON
-#define MANDELBROT_ZOOM_OUT BUTTON_SELECT
-#define MANDELBROT_MAXITER_INC (BUTTON_MODE | BUTTON_RIGHT)
-#define MANDELBROT_MAXITER_DEC (BUTTON_MODE | BUTTON_LEFT)
-#define MANDELBROT_RESET (BUTTON_MODE | BUTTON_SELECT)
+#define MANDELBROT_ZOOM_IN BUTTON_SELECT
+#define MANDELBROT_ZOOM_OUT BUTTON_MODE
+#define MANDELBROT_MAXITER_INC (BUTTON_ON | BUTTON_RIGHT)
+#define MANDELBROT_MAXITER_DEC (BUTTON_ON | BUTTON_LEFT)
+#define MANDELBROT_RESET BUTTON_REC
#endif
static struct plugin_api* rb;
@@ -75,8 +66,13 @@ static unsigned char graybuffer[LCD_HEIGHT];
void init_mandelbrot_set(void){
- x_min = -5<<25; // -2.0<<26
+#if CONFIG_LCD == LCD_LCD_SSD1815 /* non-square aspect */
+ x_min = -5<<25; // -2.5<<26
x_max = 1<<26; // 1.0<<26
+#else
+ x_min = -2<<26; // -2.0<<26
+ x_max = 3<<24; // 0.75<<26
+#endif
y_min = -1<<26; // -1.0<<26
y_max = 1<<26; // 1.0<<26
delta = (x_max - x_min) >> 3; // /8
@@ -162,7 +158,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
/* initialize the grayscale buffer:
* 112 pixels wide, 8 rows (64 pixels) high, (try to) reserve
* 16 bitplanes for 17 shades of gray.*/
- grayscales = gray_init(rb, gbuf, gbuf_size, false, 112, 8, 8, NULL) + 1;
+ grayscales = gray_init(rb, gbuf, gbuf_size, false, LCD_WIDTH,
+ (LCD_HEIGHT*LCD_DEPTH/8), 8, NULL) + 1;
if (grayscales != 9){
rb->snprintf(buff, sizeof(buff), "%d", grayscales);
rb->lcd_puts(0, 1, buff);