diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-07-19 21:46:37 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-07-19 21:46:37 +0000 |
commit | 638dd6786a75e5d3e87a9e04f80138d80665f230 (patch) | |
tree | ef376ff7e32e88913f833344d33b9810a023187e | |
parent | 5846aab6542104003bf03c29851bc3c12bc8da7a (diff) | |
download | rockbox-638dd6786a75e5d3e87a9e04f80138d80665f230.tar.gz rockbox-638dd6786a75e5d3e87a9e04f80138d80665f230.zip |
Const'ed the logo, the bitmaps and the credits (optimization for running from ROM)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4896 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/credits.c | 2 | ||||
-rw-r--r-- | apps/filetypes.c | 2 | ||||
-rw-r--r-- | apps/filetypes.h | 4 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 4 | ||||
-rw-r--r-- | apps/plugin.h | 4 | ||||
-rw-r--r-- | apps/recorder/icons.c | 10 | ||||
-rw-r--r-- | apps/recorder/icons.h | 10 | ||||
-rw-r--r-- | apps/tree.c | 4 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 11 | ||||
-rw-r--r-- | firmware/export/lcd.h | 4 |
10 files changed, 25 insertions, 30 deletions
diff --git a/apps/credits.c b/apps/credits.c index 71d77a6feb..9ab14345fa 100644 --- a/apps/credits.c +++ b/apps/credits.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "button.h" | 24 | #include "button.h" |
25 | #include "sprintf.h" | 25 | #include "sprintf.h" |
26 | 26 | ||
27 | char* credits[] = { | 27 | char* const credits[] = { |
28 | #include "credits.raw" /* generated list of names from docs/CREDITS */ | 28 | #include "credits.raw" /* generated list of names from docs/CREDITS */ |
29 | }; | 29 | }; |
30 | 30 | ||
diff --git a/apps/filetypes.c b/apps/filetypes.c index b7004f58db..cab9618f36 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -136,7 +136,7 @@ void filetype_init(void) | |||
136 | 136 | ||
137 | /* get icon */ | 137 | /* get icon */ |
138 | #ifdef HAVE_LCD_BITMAP | 138 | #ifdef HAVE_LCD_BITMAP |
139 | char* filetype_get_icon(int attr) | 139 | const char* filetype_get_icon(int attr) |
140 | #else | 140 | #else |
141 | int filetype_get_icon(int attr) | 141 | int filetype_get_icon(int attr) |
142 | #endif | 142 | #endif |
diff --git a/apps/filetypes.h b/apps/filetypes.h index 22668fd725..c5bccf4498 100644 --- a/apps/filetypes.h +++ b/apps/filetypes.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | int filetype_get_attr(char*); | 26 | int filetype_get_attr(char*); |
27 | #ifdef HAVE_LCD_BITMAP | 27 | #ifdef HAVE_LCD_BITMAP |
28 | char* filetype_get_icon(int); | 28 | const char* filetype_get_icon(int); |
29 | #else | 29 | #else |
30 | int filetype_get_icon(int); | 30 | int filetype_get_icon(int); |
31 | #endif | 31 | #endif |
@@ -37,7 +37,7 @@ int filetype_load_plugin(char*,char*); | |||
37 | 37 | ||
38 | struct file_type { | 38 | struct file_type { |
39 | #ifdef HAVE_LCD_BITMAP | 39 | #ifdef HAVE_LCD_BITMAP |
40 | unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */ | 40 | const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */ |
41 | #else | 41 | #else |
42 | int icon; /* the icon which shall be used for it, -1 if unknown */ | 42 | int icon; /* the icon which shall be used for it, -1 if unknown */ |
43 | #endif | 43 | #endif |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index b7e81eeac6..c30daf48ba 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -118,10 +118,6 @@ static struct playlist_entry tracks[MAX_PLAYLIST_ENTRIES]; | |||
118 | /* Used when viewing playlists on disk */ | 118 | /* Used when viewing playlists on disk */ |
119 | static struct playlist_info temp_playlist; | 119 | static struct playlist_info temp_playlist; |
120 | 120 | ||
121 | #ifdef HAVE_LCD_BITMAP | ||
122 | extern unsigned char bitmap_icons_6x8[LastIcon][6]; | ||
123 | #endif | ||
124 | |||
125 | static bool initialize(char* filename, bool reload); | 121 | static bool initialize(char* filename, bool reload); |
126 | static void load_playlist_entries(int start_index); | 122 | static void load_playlist_entries(int start_index); |
127 | static void load_playlist_entries_r(int end_index); | 123 | static void load_playlist_entries_r(int end_index); |
diff --git a/apps/plugin.h b/apps/plugin.h index 659e6dbda3..085cccfc6b 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -120,8 +120,8 @@ struct plugin_api { | |||
120 | void (*lcd_unlock_pattern)(unsigned char pat); | 120 | void (*lcd_unlock_pattern)(unsigned char pat); |
121 | void (*lcd_putc)(int x, int y, unsigned short ch); | 121 | void (*lcd_putc)(int x, int y, unsigned short ch); |
122 | #else | 122 | #else |
123 | void (*lcd_putsxy)(int x, int y, unsigned char *string); | 123 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
124 | void (*lcd_bitmap)(unsigned char *src, int x, int y, | 124 | void (*lcd_bitmap)(const unsigned char *src, int x, int y, |
125 | int nx, int ny, bool clear); | 125 | int nx, int ny, bool clear); |
126 | void (*lcd_drawline)(int x1, int y1, int x2, int y2); | 126 | void (*lcd_drawline)(int x1, int y1, int x2, int y2); |
127 | void (*lcd_clearline)(int x1, int y1, int x2, int y2); | 127 | void (*lcd_clearline)(int x1, int y1, int x2, int y2); |
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index b831e59f53..41e584ed35 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #include "icons.h" | 29 | #include "icons.h" |
30 | 30 | ||
31 | unsigned char slider_bar[] = | 31 | const unsigned char slider_bar[] = |
32 | { | 32 | { |
33 | 0x38, 0x28, 0x28, 0x28, 0x28, | 33 | 0x38, 0x28, 0x28, 0x28, 0x28, |
34 | 0x7c, 0x28, 0x28, 0x28, 0x28, | 34 | 0x7c, 0x28, 0x28, 0x28, 0x28, |
@@ -40,13 +40,13 @@ unsigned char slider_bar[] = | |||
40 | 0x7c, 0x28, 0x28, 0x28, 0x28, 0x38 | 40 | 0x7c, 0x28, 0x28, 0x28, 0x28, 0x38 |
41 | }; | 41 | }; |
42 | 42 | ||
43 | unsigned char bitmap_icons_5x8[][5] = | 43 | const unsigned char bitmap_icons_5x8[][5] = |
44 | { | 44 | { |
45 | /* Lock */ | 45 | /* Lock */ |
46 | {0x78,0x7f,0x49,0x7f,0x78} | 46 | {0x78,0x7f,0x49,0x7f,0x78} |
47 | }; | 47 | }; |
48 | 48 | ||
49 | unsigned char bitmap_icons_6x8[LastIcon][6] = | 49 | const unsigned char bitmap_icons_6x8[LastIcon][6] = |
50 | { | 50 | { |
51 | { 0x00, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, /* Box_Filled */ | 51 | { 0x00, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, /* Box_Filled */ |
52 | { 0x00, 0x7f, 0x41, 0x41, 0x41, 0x7f }, /* Box_Empty */ | 52 | { 0x00, 0x7f, 0x41, 0x41, 0x41, 0x7f }, /* Box_Empty */ |
@@ -67,7 +67,7 @@ unsigned char bitmap_icons_6x8[LastIcon][6] = | |||
67 | { 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */ | 67 | { 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */ |
68 | }; | 68 | }; |
69 | 69 | ||
70 | unsigned char bitmap_icons_7x8[][7] = | 70 | const unsigned char bitmap_icons_7x8[][7] = |
71 | { | 71 | { |
72 | {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */ | 72 | {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */ |
73 | {0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* Speaker */ | 73 | {0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* Speaker */ |
@@ -86,7 +86,7 @@ unsigned char bitmap_icons_7x8[][7] = | |||
86 | {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */ | 86 | {0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */ |
87 | }; | 87 | }; |
88 | 88 | ||
89 | unsigned char rockbox112x37[]={ | 89 | const unsigned char rockbox112x37[]={ |
90 | 0x00, 0x00, 0x02, 0xff, 0x02, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, | 90 | 0x00, 0x00, 0x02, 0xff, 0x02, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, |
91 | 0xf8, 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, | 91 | 0xf8, 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, |
92 | 0x7c, 0x7d, 0xfd, 0xfa, 0xfa, 0xf4, 0xe8, 0x90, 0x60, 0x80, 0xe0, 0x10, 0xc8, | 92 | 0x7c, 0x7d, 0xfd, 0xfa, 0xfa, 0xf4, 0xe8, 0x90, 0x60, 0x80, 0xe0, 0x10, 0xc8, |
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index afea0b1ae4..cf7687e0bd 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -60,13 +60,13 @@ enum icons_7x8 { | |||
60 | Icon_Last | 60 | Icon_Last |
61 | }; | 61 | }; |
62 | 62 | ||
63 | extern unsigned char bitmap_icons_5x8[1][5]; | 63 | extern const unsigned char bitmap_icons_5x8[1][5]; |
64 | extern unsigned char bitmap_icons_6x8[LastIcon][6]; | 64 | extern const unsigned char bitmap_icons_6x8[LastIcon][6]; |
65 | extern unsigned char bitmap_icons_7x8[Icon_Last][7]; | 65 | extern const unsigned char bitmap_icons_7x8[Icon_Last][7]; |
66 | 66 | ||
67 | extern unsigned char rockbox112x37[]; | 67 | extern const unsigned char rockbox112x37[]; |
68 | 68 | ||
69 | extern unsigned char slider_bar[]; | 69 | extern const unsigned char slider_bar[]; |
70 | 70 | ||
71 | #define STATUSBAR_X_POS 0 | 71 | #define STATUSBAR_X_POS 0 |
72 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ | 72 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ |
diff --git a/apps/tree.c b/apps/tree.c index 988e6b3d93..754e84f508 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -163,8 +163,6 @@ void tree_get_filetypes(struct filetype** types, int* count) | |||
163 | #define SCROLLBAR_Y lcd_getymargin() | 163 | #define SCROLLBAR_Y lcd_getymargin() |
164 | #define SCROLLBAR_WIDTH 6 | 164 | #define SCROLLBAR_WIDTH 6 |
165 | 165 | ||
166 | extern unsigned char bitmap_icons_6x8[LastIcon][6]; | ||
167 | |||
168 | #else /* HAVE_LCD_BITMAP */ | 166 | #else /* HAVE_LCD_BITMAP */ |
169 | 167 | ||
170 | #define TREE_MAX_ON_SCREEN 2 | 168 | #define TREE_MAX_ON_SCREEN 2 |
@@ -461,7 +459,7 @@ static int showdir(char *path, int start, int *dirfilter) | |||
461 | bool dir_buffer_full; | 459 | bool dir_buffer_full; |
462 | 460 | ||
463 | #ifdef HAVE_LCD_BITMAP | 461 | #ifdef HAVE_LCD_BITMAP |
464 | char* icon; | 462 | const char* icon; |
465 | int line_height; | 463 | int line_height; |
466 | int fw, fh; | 464 | int fw, fh; |
467 | lcd_setfont(FONT_UI); | 465 | lcd_setfont(FONT_UI); |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index cf3c7615e1..3d3763ca50 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -371,7 +371,7 @@ void lcd_puts_style(int x, int y, unsigned char *str, int style) | |||
371 | } | 371 | } |
372 | 372 | ||
373 | /* put a string at a given pixel position, skipping first ofs pixel columns */ | 373 | /* put a string at a given pixel position, skipping first ofs pixel columns */ |
374 | static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str) | 374 | static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) |
375 | { | 375 | { |
376 | int ch; | 376 | int ch; |
377 | struct font* pf = font_get(curfont); | 377 | struct font* pf = font_get(curfont); |
@@ -428,7 +428,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str) | |||
428 | } | 428 | } |
429 | 429 | ||
430 | /* put a string at a given pixel position */ | 430 | /* put a string at a given pixel position */ |
431 | void lcd_putsxy(int x, int y, unsigned char *str) | 431 | void lcd_putsxy(int x, int y, const unsigned char *str) |
432 | { | 432 | { |
433 | lcd_putsxyofs(x, y, 0, str); | 433 | lcd_putsxyofs(x, y, 0, str); |
434 | } | 434 | } |
@@ -450,12 +450,13 @@ void lcd_putsxy(int x, int y, unsigned char *str) | |||
450 | * Draw a bitmap at (x, y), size (nx, ny) | 450 | * Draw a bitmap at (x, y), size (nx, ny) |
451 | * if 'clear' is true, clear destination area first | 451 | * if 'clear' is true, clear destination area first |
452 | */ | 452 | */ |
453 | void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny, | 453 | void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny, |
454 | bool clear) __attribute__ ((section (".icode"))); | 454 | bool clear) __attribute__ ((section (".icode"))); |
455 | void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny, | 455 | void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny, |
456 | bool clear) | 456 | bool clear) |
457 | { | 457 | { |
458 | unsigned char *src_col, *dst, *dst_col; | 458 | const unsigned char *src_col; |
459 | unsigned char *dst, *dst_col; | ||
459 | unsigned int data, mask1, mask2, mask3, mask4; | 460 | unsigned int data, mask1, mask2, mask3, mask4; |
460 | int stride, shift; | 461 | int stride, shift; |
461 | 462 | ||
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 20023bf1c6..1a408d448c 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -123,7 +123,7 @@ extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | |||
123 | extern void lcd_setmargins(int xmargin, int ymargin); | 123 | extern void lcd_setmargins(int xmargin, int ymargin); |
124 | extern int lcd_getxmargin(void); | 124 | extern int lcd_getxmargin(void); |
125 | extern int lcd_getymargin(void); | 125 | extern int lcd_getymargin(void); |
126 | extern void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny, | 126 | extern void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny, |
127 | bool clear); | 127 | bool clear); |
128 | extern void lcd_clearrect (int x, int y, int nx, int ny); | 128 | extern void lcd_clearrect (int x, int y, int nx, int ny); |
129 | extern void lcd_fillrect (int x, int y, int nx, int ny); | 129 | extern void lcd_fillrect (int x, int y, int nx, int ny); |
@@ -141,7 +141,7 @@ extern void lcd_set_flip(bool yesno); | |||
141 | extern void lcd_bidir_scroll(int threshold); | 141 | extern void lcd_bidir_scroll(int threshold); |
142 | extern void lcd_scroll_step(int pixels); | 142 | extern void lcd_scroll_step(int pixels); |
143 | extern void lcd_setfont(int font); | 143 | extern void lcd_setfont(int font); |
144 | extern void lcd_putsxy(int x, int y, unsigned char *string); | 144 | extern void lcd_putsxy(int x, int y, const unsigned char *string); |
145 | extern int lcd_getstringsize(unsigned char *str, int *w, int *h); | 145 | extern int lcd_getstringsize(unsigned char *str, int *w, int *h); |
146 | extern int lcd_getstringsize(unsigned char *str, int *w, int *h); | 146 | extern int lcd_getstringsize(unsigned char *str, int *w, int *h); |
147 | 147 | ||