mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
5846aab654
commit
638dd6786a
10 changed files with 25 additions and 30 deletions
|
@ -24,7 +24,7 @@
|
||||||
#include "button.h"
|
#include "button.h"
|
||||||
#include "sprintf.h"
|
#include "sprintf.h"
|
||||||
|
|
||||||
char* credits[] = {
|
char* const credits[] = {
|
||||||
#include "credits.raw" /* generated list of names from docs/CREDITS */
|
#include "credits.raw" /* generated list of names from docs/CREDITS */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ void filetype_init(void)
|
||||||
|
|
||||||
/* get icon */
|
/* get icon */
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
char* filetype_get_icon(int attr)
|
const char* filetype_get_icon(int attr)
|
||||||
#else
|
#else
|
||||||
int filetype_get_icon(int attr)
|
int filetype_get_icon(int attr)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
int filetype_get_attr(char*);
|
int filetype_get_attr(char*);
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
char* filetype_get_icon(int);
|
const char* filetype_get_icon(int);
|
||||||
#else
|
#else
|
||||||
int filetype_get_icon(int);
|
int filetype_get_icon(int);
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,7 +37,7 @@ int filetype_load_plugin(char*,char*);
|
||||||
|
|
||||||
struct file_type {
|
struct file_type {
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */
|
const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */
|
||||||
#else
|
#else
|
||||||
int icon; /* the icon which shall be used for it, -1 if unknown */
|
int icon; /* the icon which shall be used for it, -1 if unknown */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -118,10 +118,6 @@ static struct playlist_entry tracks[MAX_PLAYLIST_ENTRIES];
|
||||||
/* Used when viewing playlists on disk */
|
/* Used when viewing playlists on disk */
|
||||||
static struct playlist_info temp_playlist;
|
static struct playlist_info temp_playlist;
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
extern unsigned char bitmap_icons_6x8[LastIcon][6];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool initialize(char* filename, bool reload);
|
static bool initialize(char* filename, bool reload);
|
||||||
static void load_playlist_entries(int start_index);
|
static void load_playlist_entries(int start_index);
|
||||||
static void load_playlist_entries_r(int end_index);
|
static void load_playlist_entries_r(int end_index);
|
||||||
|
|
|
@ -120,8 +120,8 @@ struct plugin_api {
|
||||||
void (*lcd_unlock_pattern)(unsigned char pat);
|
void (*lcd_unlock_pattern)(unsigned char pat);
|
||||||
void (*lcd_putc)(int x, int y, unsigned short ch);
|
void (*lcd_putc)(int x, int y, unsigned short ch);
|
||||||
#else
|
#else
|
||||||
void (*lcd_putsxy)(int x, int y, unsigned char *string);
|
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
|
||||||
void (*lcd_bitmap)(unsigned char *src, int x, int y,
|
void (*lcd_bitmap)(const unsigned char *src, int x, int y,
|
||||||
int nx, int ny, bool clear);
|
int nx, int ny, bool clear);
|
||||||
void (*lcd_drawline)(int x1, int y1, int x2, int y2);
|
void (*lcd_drawline)(int x1, int y1, int x2, int y2);
|
||||||
void (*lcd_clearline)(int x1, int y1, int x2, int y2);
|
void (*lcd_clearline)(int x1, int y1, int x2, int y2);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
|
|
||||||
unsigned char slider_bar[] =
|
const unsigned char slider_bar[] =
|
||||||
{
|
{
|
||||||
0x38, 0x28, 0x28, 0x28, 0x28,
|
0x38, 0x28, 0x28, 0x28, 0x28,
|
||||||
0x7c, 0x28, 0x28, 0x28, 0x28,
|
0x7c, 0x28, 0x28, 0x28, 0x28,
|
||||||
|
@ -40,13 +40,13 @@ unsigned char slider_bar[] =
|
||||||
0x7c, 0x28, 0x28, 0x28, 0x28, 0x38
|
0x7c, 0x28, 0x28, 0x28, 0x28, 0x38
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char bitmap_icons_5x8[][5] =
|
const unsigned char bitmap_icons_5x8[][5] =
|
||||||
{
|
{
|
||||||
/* Lock */
|
/* Lock */
|
||||||
{0x78,0x7f,0x49,0x7f,0x78}
|
{0x78,0x7f,0x49,0x7f,0x78}
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char bitmap_icons_6x8[LastIcon][6] =
|
const unsigned char bitmap_icons_6x8[LastIcon][6] =
|
||||||
{
|
{
|
||||||
{ 0x00, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, /* Box_Filled */
|
{ 0x00, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }, /* Box_Filled */
|
||||||
{ 0x00, 0x7f, 0x41, 0x41, 0x41, 0x7f }, /* Box_Empty */
|
{ 0x00, 0x7f, 0x41, 0x41, 0x41, 0x7f }, /* Box_Empty */
|
||||||
|
@ -67,7 +67,7 @@ unsigned char bitmap_icons_6x8[LastIcon][6] =
|
||||||
{ 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */
|
{ 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char bitmap_icons_7x8[][7] =
|
const unsigned char bitmap_icons_7x8[][7] =
|
||||||
{
|
{
|
||||||
{0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */
|
{0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */
|
||||||
{0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* Speaker */
|
{0x00,0x1c,0x1c,0x3e,0x7f,0x00,0x00}, /* Speaker */
|
||||||
|
@ -86,7 +86,7 @@ unsigned char bitmap_icons_7x8[][7] =
|
||||||
{0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */
|
{0x20,0x30,0x38,0x3c,0x38,0x30,0x20}, /* Up-arrow */
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char rockbox112x37[]={
|
const unsigned char rockbox112x37[]={
|
||||||
0x00, 0x00, 0x02, 0xff, 0x02, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa,
|
0x00, 0x00, 0x02, 0xff, 0x02, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa,
|
||||||
0xf8, 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc,
|
0xf8, 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x80, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc,
|
||||||
0x7c, 0x7d, 0xfd, 0xfa, 0xfa, 0xf4, 0xe8, 0x90, 0x60, 0x80, 0xe0, 0x10, 0xc8,
|
0x7c, 0x7d, 0xfd, 0xfa, 0xfa, 0xf4, 0xe8, 0x90, 0x60, 0x80, 0xe0, 0x10, 0xc8,
|
||||||
|
|
|
@ -60,13 +60,13 @@ enum icons_7x8 {
|
||||||
Icon_Last
|
Icon_Last
|
||||||
};
|
};
|
||||||
|
|
||||||
extern unsigned char bitmap_icons_5x8[1][5];
|
extern const unsigned char bitmap_icons_5x8[1][5];
|
||||||
extern unsigned char bitmap_icons_6x8[LastIcon][6];
|
extern const unsigned char bitmap_icons_6x8[LastIcon][6];
|
||||||
extern unsigned char bitmap_icons_7x8[Icon_Last][7];
|
extern const unsigned char bitmap_icons_7x8[Icon_Last][7];
|
||||||
|
|
||||||
extern unsigned char rockbox112x37[];
|
extern const unsigned char rockbox112x37[];
|
||||||
|
|
||||||
extern unsigned char slider_bar[];
|
extern const unsigned char slider_bar[];
|
||||||
|
|
||||||
#define STATUSBAR_X_POS 0
|
#define STATUSBAR_X_POS 0
|
||||||
#define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
|
#define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
|
||||||
|
|
|
@ -163,8 +163,6 @@ void tree_get_filetypes(struct filetype** types, int* count)
|
||||||
#define SCROLLBAR_Y lcd_getymargin()
|
#define SCROLLBAR_Y lcd_getymargin()
|
||||||
#define SCROLLBAR_WIDTH 6
|
#define SCROLLBAR_WIDTH 6
|
||||||
|
|
||||||
extern unsigned char bitmap_icons_6x8[LastIcon][6];
|
|
||||||
|
|
||||||
#else /* HAVE_LCD_BITMAP */
|
#else /* HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
#define TREE_MAX_ON_SCREEN 2
|
#define TREE_MAX_ON_SCREEN 2
|
||||||
|
@ -461,7 +459,7 @@ static int showdir(char *path, int start, int *dirfilter)
|
||||||
bool dir_buffer_full;
|
bool dir_buffer_full;
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
char* icon;
|
const char* icon;
|
||||||
int line_height;
|
int line_height;
|
||||||
int fw, fh;
|
int fw, fh;
|
||||||
lcd_setfont(FONT_UI);
|
lcd_setfont(FONT_UI);
|
||||||
|
|
|
@ -371,7 +371,7 @@ void lcd_puts_style(int x, int y, unsigned char *str, int style)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put a string at a given pixel position, skipping first ofs pixel columns */
|
/* put a string at a given pixel position, skipping first ofs pixel columns */
|
||||||
static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str)
|
static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
struct font* pf = font_get(curfont);
|
struct font* pf = font_get(curfont);
|
||||||
|
@ -428,7 +428,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, unsigned char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put a string at a given pixel position */
|
/* put a string at a given pixel position */
|
||||||
void lcd_putsxy(int x, int y, unsigned char *str)
|
void lcd_putsxy(int x, int y, const unsigned char *str)
|
||||||
{
|
{
|
||||||
lcd_putsxyofs(x, y, 0, str);
|
lcd_putsxyofs(x, y, 0, str);
|
||||||
}
|
}
|
||||||
|
@ -450,12 +450,13 @@ void lcd_putsxy(int x, int y, unsigned char *str)
|
||||||
* Draw a bitmap at (x, y), size (nx, ny)
|
* Draw a bitmap at (x, y), size (nx, ny)
|
||||||
* if 'clear' is true, clear destination area first
|
* if 'clear' is true, clear destination area first
|
||||||
*/
|
*/
|
||||||
void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny,
|
void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
|
||||||
bool clear) __attribute__ ((section (".icode")));
|
bool clear) __attribute__ ((section (".icode")));
|
||||||
void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny,
|
void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
|
||||||
bool clear)
|
bool clear)
|
||||||
{
|
{
|
||||||
unsigned char *src_col, *dst, *dst_col;
|
const unsigned char *src_col;
|
||||||
|
unsigned char *dst, *dst_col;
|
||||||
unsigned int data, mask1, mask2, mask3, mask4;
|
unsigned int data, mask1, mask2, mask3, mask4;
|
||||||
int stride, shift;
|
int stride, shift;
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
|
||||||
extern void lcd_setmargins(int xmargin, int ymargin);
|
extern void lcd_setmargins(int xmargin, int ymargin);
|
||||||
extern int lcd_getxmargin(void);
|
extern int lcd_getxmargin(void);
|
||||||
extern int lcd_getymargin(void);
|
extern int lcd_getymargin(void);
|
||||||
extern void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny,
|
extern void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
|
||||||
bool clear);
|
bool clear);
|
||||||
extern void lcd_clearrect (int x, int y, int nx, int ny);
|
extern void lcd_clearrect (int x, int y, int nx, int ny);
|
||||||
extern void lcd_fillrect (int x, int y, int nx, int ny);
|
extern void lcd_fillrect (int x, int y, int nx, int ny);
|
||||||
|
@ -141,7 +141,7 @@ extern void lcd_set_flip(bool yesno);
|
||||||
extern void lcd_bidir_scroll(int threshold);
|
extern void lcd_bidir_scroll(int threshold);
|
||||||
extern void lcd_scroll_step(int pixels);
|
extern void lcd_scroll_step(int pixels);
|
||||||
extern void lcd_setfont(int font);
|
extern void lcd_setfont(int font);
|
||||||
extern void lcd_putsxy(int x, int y, unsigned char *string);
|
extern void lcd_putsxy(int x, int y, const unsigned char *string);
|
||||||
extern int lcd_getstringsize(unsigned char *str, int *w, int *h);
|
extern int lcd_getstringsize(unsigned char *str, int *w, int *h);
|
||||||
extern int lcd_getstringsize(unsigned char *str, int *w, int *h);
|
extern int lcd_getstringsize(unsigned char *str, int *w, int *h);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue