summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/menu.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/uisimulator/menu.c b/uisimulator/menu.c
index 6a6b61e755..5c8356c93a 100644
--- a/uisimulator/menu.c
+++ b/uisimulator/menu.c
@@ -117,6 +117,52 @@ void add_menu_item(int location, char *string)
117 menu_bottom = location; 117 menu_bottom = location;
118} 118}
119 119
120void show_logo(void)
121{
122 unsigned char buffer[112 * 8];
123
124 int failure;
125 int width=0;
126 int height=0;
127
128 failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer);
129
130 debugf("read_bmp_file() returned %d, width %d height %d\n",
131 failure, width, height);
132
133 if(!failure) {
134 int i;
135 int eline;
136 for(i=0, eline=0; i< height; i+=8, eline++) {
137 int x,y;
138
139 /* the bitmap function doesn't work with full-height bitmaps
140 so we "stripe" the logo output */
141
142 lcd_bitmap(&buffer[eline*width], 0, 24+i, width,
143 (height-i)>8?8:height-i, false);
144
145#if 0
146 /* for screen output debugging */
147 for(y=0; y<8 && (i+y < height); y++) {
148 for(x=0; x < width; x++) {
149
150 if(buffer[eline*width + x] & (1<<y)) {
151 printf("*");
152 }
153 else
154 printf(" ");
155 }
156 printf("\n");
157 }
158#endif
159 }
160
161 lcd_update();
162 }
163
164}
165
120void menu_init(void) 166void menu_init(void)
121{ 167{
122 menu_top = Tetris; 168 menu_top = Tetris;
@@ -132,7 +178,7 @@ void menu_draw(void)
132 for (i = i; i < Last_Id; i++) 178 for (i = i; i < Last_Id; i++)
133 add_menu_item(items[i].menu_id, (char *) items[i].menu_desc); 179 add_menu_item(items[i].menu_id, (char *) items[i].menu_desc);
134 180
135 lcd_putsxy(8, 38, "Rockbox!",2); 181 show_logo();
136 redraw_cursor(); 182 redraw_cursor();
137} 183}
138 184