summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-08 22:38:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-08 22:38:23 +0000
commitaa3ab739ab9af715d72d77af830747bc4d51d263 (patch)
treef08aa2019c810942cb4161e454e7284533fd2d40 /apps/plugins
parent83d2e00aa69f4d5039f6843989bcc9f83a4ee299 (diff)
downloadrockbox-aa3ab739ab9af715d72d77af830747bc4d51d263.zip
rockbox-aa3ab739ab9af715d72d77af830747bc4d51d263.tar.gz
rockbox-aa3ab739ab9af715d72d77af830747bc4d51d263.tar.bz2
rockbox-aa3ab739ab9af715d72d77af830747bc4d51d263.tar.xz
Adjusted for iRiver LCD screen size.
Press SELECT on iRiver to change mode (ON on Recorders) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5858 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/bounce.c55
1 files changed, 48 insertions, 7 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index e7fc7de..232d9a9 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -46,14 +46,55 @@
static struct plugin_api* rb;
+#define TABLE_SIZE (sizeof(table)/sizeof(table[0]))
+
+#if LCD_HEIGHT < 128
+
static unsigned char table[]={
26,28,30,33,35,37,39,40,42,43,45,46,46,47,47,47,47,47,46,46,45,43,42,40,39,37,35,33,30,28,26,24,21,19,17,14,12,10,8,7,5,4,2,1,1,0,0,0,0,0,1,1,2,4,5,7,8,10,12,14,17,19,21,23,
};
static unsigned char xtable[]={
-54,58,63,67,71,75,79,82,85,88,91,93,95,97,98,99,99,99,99,99,97,96,94,92,90,87,84,80,77,73,69,65,60,56,52,47,43,39,34,30,26,22,19,15,12,9,7,5,3,2,0,0,0,0,0,1,2,4,6,8,11,14,17,20,24,28,32,36,41,45,49
+ 50, 54, 59, 64, 69, 73, 77, 81, 85, 88, 91, 94, 96, 97, 99, 99, 99, 99,
+ 99, 97, 96, 94, 91, 88, 85, 81, 77, 73, 69, 64, 59, 54, 50, 45, 40, 35,
+ 30, 26, 22, 18, 14, 11, 8, 5, 3, 2, 0, 0, 0, 0, 0, 2, 3, 5, 8, 11, 14,
+ 18, 22, 26, 30, 35, 40, 45,
+};
+#else
+
+/* 160 - 12 = 148
+ 148 / 2 = 74 (radius)
+*/
+
+static unsigned char xtable[]={
+74, 77, 81, 84, 88, 91, 95, 98, 102, 105, 108, 112, 115, 118, 120, 123,
+126, 128, 131, 133, 135, 137, 139, 140, 142, 143, 144, 145, 146, 147, 147,
+147, 147, 147, 147, 147, 146, 145, 144, 143, 142, 140, 139, 137, 135, 133,
+131, 128, 126, 123, 120, 118, 115, 112, 108, 105, 102, 98, 95, 91, 88,
+84, 81, 77, 74, 70, 66, 63, 59, 56, 52, 49, 45, 42, 39, 35, 32, 29, 27,
+24, 21, 19, 16, 14, 12, 10, 8, 7, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1,
+2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 19, 21, 24, 27, 29, 32, 35, 39, 42, 45,
+49, 52, 56, 59, 63, 66, 70,
+
};
+/* 128 - 16 = 116
+ 112 / 2 = 56 (radius)
+*/
+static unsigned char table[]={
+56, 58, 61, 64, 66, 69, 72, 74, 77, 79, 82, 84, 87, 89, 91, 93, 95, 97,
+99, 100, 102, 104, 105, 106, 107, 108, 109, 110, 110, 111, 111, 111, 111,
+111, 111, 111, 110, 110, 109, 108, 107, 106, 105, 104, 102, 100, 99, 97,
+95, 93, 91, 89, 87, 84, 82, 79, 77, 74, 72, 69, 66, 64, 61, 58, 56, 53,
+50, 47, 45, 42, 39, 37, 34, 32, 29, 27, 24, 22, 20, 18, 16, 14, 12, 11,
+9, 7, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 7,
+9, 11, 12, 14, 16, 18, 20, 22, 24, 27, 29, 32, 34, 37, 39, 42, 45, 47,
+50, 53,
+
+};
+
+#endif
+
static signed char speed[]={
1,2,3,3,3,2,1,0,-1,-2,-2,-2,-1,0,0,1,
};
@@ -181,7 +222,7 @@ struct counter values[]={
{"xsanke", 1},
{"ysanke", 1},
{"xadd", 1},
- {"yadd", 1},
+ {"yadd", 2},
{"xdist", -4},
{"ydist", -6},
};
@@ -267,7 +308,7 @@ static int scrollit(void)
letter = rock[(i+textpos) % rocklen ];
rb->lcd_bitmap((char *)char_gen_12x16[letter-0x20],
- xx, table[yy&63],
+ xx, table[yy&(TABLE_SIZE-1)],
11, 16, false);
yy += YADD;
xx+= LCD_WIDTH/LETTERS_ON_SCREEN;
@@ -349,15 +390,15 @@ static int loopit(void)
}
rb->snprintf(buffer, 30, "%s: %d",
values[show].what, values[show].num);
- rb->lcd_putsxy(0, 56, buffer);
+ rb->lcd_putsxy(0, LCD_HEIGHT - 8, buffer);
timeout--;
}
for(i=0, yy=y, xx=x;
i<rocklen;
i++, yy+=values[NUM_YDIST].num, xx+=values[NUM_XDIST].num)
- rb->lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20],
- xtable[xx%71], table[yy&63],
- 11, 16, false);
+ rb->lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20],
+ xtable[xx&(TABLE_SIZE-1)], table[yy&(TABLE_SIZE-1)],
+ 11, 16, false);
rb->lcd_update();
ysanke+= values[NUM_YSANKE].num;