forked from len0rd/rockbox
Preparations for implementing the new graphics api: Ordered lcd bitmap driver defines, variables and functions by function groups. Centralised some definitions, code cleanup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6844 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bec1afada5
commit
6a556c1740
6 changed files with 1511 additions and 1601 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -64,20 +64,6 @@ extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8];
|
|||
|
||||
/*** generic code ***/
|
||||
|
||||
struct scrollinfo {
|
||||
int mode;
|
||||
char text[MAX_PATH];
|
||||
int textlen;
|
||||
int offset;
|
||||
int turn_offset;
|
||||
int startx;
|
||||
int starty;
|
||||
long scroll_start_tick;
|
||||
int direction; /* +1 for right or -1 for left*/
|
||||
int jump_scroll;
|
||||
int jump_scroll_steps;
|
||||
};
|
||||
|
||||
#define MAX_CURSOR_CHARS 8
|
||||
struct cursorinfo {
|
||||
int len;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -7,7 +7,7 @@
|
|||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Richard S. La Charité
|
||||
* Copyright (C) 2005 by Richard S. La Charité
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
|
|
@ -25,74 +25,61 @@
|
|||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
||||
#define REMOTE_DRAW_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] |= (1<<((y)&7))
|
||||
#define REMOTE_CLEAR_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7))
|
||||
#define REMOTE_INVERT_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
|
||||
#define REMOTE_INVERT_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
|
||||
|
||||
#define STYLE_DEFAULT 0
|
||||
#define STYLE_INVERT 1
|
||||
|
||||
extern void lcd_remote_init(void);
|
||||
extern void lcd_remote_clear_display(void);
|
||||
extern void lcd_remote_backlight_on(void);
|
||||
extern void lcd_remote_backlight_off(void);
|
||||
extern void lcd_remote_stop_scroll(void);
|
||||
extern void lcd_remote_scroll_speed( int speed );
|
||||
extern void lcd_remote_scroll_delay( int ms );
|
||||
extern void lcd_remote_set_contrast(int val);
|
||||
extern int lcd_remote_default_contrast(void);
|
||||
extern void lcd_remote_update(void);
|
||||
extern void lcd_remote_update_rect (int x_start, int y,
|
||||
int width, int height);
|
||||
extern void lcd_remote_set_contrast(int val);
|
||||
|
||||
extern void lcd_remote_clear_display(void);
|
||||
extern void lcd_remote_puts(int x, int y, const unsigned char *string);
|
||||
extern void lcd_remote_puts_style(int x, int y, const unsigned char *string,
|
||||
int style);
|
||||
|
||||
extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string );
|
||||
extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char* string,
|
||||
int style);
|
||||
|
||||
extern void lcd_remote_putc(int x, int y, unsigned short ch);
|
||||
extern void lcd_remote_stop_scroll(void);
|
||||
extern void lcd_remote_scroll_speed(int speed);
|
||||
extern void lcd_remote_scroll_delay(int ms);
|
||||
extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string);
|
||||
extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char* string,
|
||||
int style);
|
||||
|
||||
extern void lcd_remote_update(void);
|
||||
extern void lcd_remote_update_rect int x_start, int y, int width, int height);
|
||||
|
||||
/* Memory copy of display bitmap */
|
||||
extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
|
||||
|
||||
extern void lcd_remote_set_invert_display(bool yesno);
|
||||
extern void lcd_remote_set_flip(bool yesno);
|
||||
extern void lcd_remote_roll(int pixels);
|
||||
extern void lcd_remote_setmargins(int xmargin, int ymargin);
|
||||
extern int lcd_remote_getxmargin(void);
|
||||
extern int lcd_remote_getymargin(void);
|
||||
|
||||
/*
|
||||
* Memory copy of display bitmap
|
||||
*/
|
||||
extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
|
||||
|
||||
extern void lcd_remote_bitmap (const unsigned char *src, int x, int y,
|
||||
int nx, int ny, bool clear);
|
||||
extern void lcd_remote_clearrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_fillrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_invertrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_drawrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_invertrect (int x, int y, int nx, int ny);
|
||||
//extern void lcd_invertscroll(int x, int y);
|
||||
extern void lcd_remote_drawline( int x1, int y1, int x2, int y2 );
|
||||
extern void lcd_remote_clearline( int x1, int y1, int x2, int y2 );
|
||||
extern void lcd_remote_setfont(int font);
|
||||
extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h);
|
||||
extern void lcd_remote_drawpixel(int x, int y);
|
||||
extern void lcd_remote_clearpixel(int x, int y);
|
||||
extern void lcd_remote_invertpixel(int x, int y);
|
||||
extern void lcd_remote_roll(int pixels);
|
||||
extern void lcd_remote_set_invert_display(bool yesno);
|
||||
extern void lcd_remote_set_flip(bool yesno);
|
||||
extern void lcd_remote_drawline(int x1, int y1, int x2, int y2);
|
||||
extern void lcd_remote_clearline(int x1, int y1, int x2, int y2);
|
||||
extern void lcd_remote_drawrect(int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_clearrect(int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_fillrect(int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_invertrect(int x, int y, int nx, int ny);
|
||||
extern void lcd_remote_bitmap(const unsigned char *src, int x, int y,
|
||||
int nx, int ny, bool clear);
|
||||
extern void lcd_remote_putsxy(int x, int y, const unsigned char *string);
|
||||
extern void lcd_remote_invertscroll(int x, int y);
|
||||
extern void lcd_remote_bidir_scroll(int threshold);
|
||||
extern void lcd_remote_scroll_step(int pixels);
|
||||
extern void lcd_remote_setfont(int font);
|
||||
extern void lcd_remote_putsxy(int x, int y, const unsigned char *string);
|
||||
extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,35 +29,38 @@
|
|||
|
||||
#ifdef SIMULATOR
|
||||
#define lcd_icon(x,y) sim_lcd_icon(x,y)
|
||||
#define MAX_PATH 260
|
||||
#else
|
||||
#include "file.h" /* for MAX_PATH; FIXME: Why does this not work for sims? */
|
||||
#endif
|
||||
|
||||
/* common functions */
|
||||
extern void lcd_write_command(int byte);
|
||||
extern void lcd_write_command_ex(int cmd, int data1, int data2);
|
||||
extern void lcd_write_data(const unsigned char* p_bytes, int count);
|
||||
extern void lcd_init(void);
|
||||
extern void lcd_clear_display(void);
|
||||
extern void lcd_backlight(bool on);
|
||||
extern int lcd_default_contrast(void);
|
||||
extern void lcd_set_contrast(int val);
|
||||
|
||||
extern void lcd_clear_display(void);
|
||||
extern void lcd_puts(int x, int y, const unsigned char *string);
|
||||
extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
|
||||
extern void lcd_putc(int x, int y, unsigned short ch);
|
||||
|
||||
extern void lcd_puts_scroll(int x, int y, const unsigned char* string );
|
||||
extern void lcd_stop_scroll(void);
|
||||
extern void lcd_scroll_speed(int speed);
|
||||
extern void lcd_scroll_delay(int ms);
|
||||
extern void lcd_puts_scroll(int x, int y, const unsigned char* string);
|
||||
extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string,
|
||||
int style);
|
||||
extern void lcd_icon(int icon, bool enable);
|
||||
extern void lcd_stop_scroll(void);
|
||||
extern void lcd_scroll_speed( int speed );
|
||||
extern void lcd_scroll_delay( int ms );
|
||||
extern void lcd_set_contrast(int val);
|
||||
extern void lcd_write_command( int byte );
|
||||
extern void lcd_write_command_ex( int cmd, int data1, int data2);
|
||||
extern void lcd_write_data( const unsigned char* p_bytes, int count );
|
||||
extern int lcd_default_contrast(void);
|
||||
|
||||
#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
|
||||
extern void lcd_update(void);
|
||||
/* performance function */
|
||||
extern void lcd_blit (const unsigned char* p_data, int x, int y, int width,
|
||||
int height, int stride);
|
||||
extern void lcd_blit(const unsigned char* p_data, int x, int y, int width,
|
||||
int height, int stride);
|
||||
|
||||
extern void lcd_update(void);
|
||||
/* update a fraction of the screen */
|
||||
extern void lcd_update_rect(int x, int y, int width, int height);
|
||||
|
||||
|
|
@ -97,56 +100,84 @@ enum
|
|||
ICON_PARAM
|
||||
};
|
||||
|
||||
extern void lcd_define_hw_pattern (int which,const char *pattern,int length);
|
||||
extern void lcd_define_pattern (int which,const char *pattern);
|
||||
extern void lcd_double_height (bool on);
|
||||
#define JUMP_SCROLL_ALWAYS 5
|
||||
extern void lcd_jump_scroll (int mode); /* 0=off, 1=once, ..., ALWAYS */
|
||||
extern void lcd_jump_scroll_delay( int ms );
|
||||
extern void lcd_double_height(bool on);
|
||||
extern void lcd_define_hw_pattern(int which,const char *pattern,int length);
|
||||
extern void lcd_define_pattern(int which,const char *pattern);
|
||||
unsigned char lcd_get_locked_pattern(void);
|
||||
void lcd_unlock_pattern(unsigned char pat);
|
||||
extern void lcd_bidir_scroll(int threshold);
|
||||
void lcd_put_cursor(int x, int y, char cursor_char);
|
||||
void lcd_remove_cursor(void);
|
||||
extern void lcd_bidir_scroll(int threshold);
|
||||
#define JUMP_SCROLL_ALWAYS 5
|
||||
extern void lcd_jump_scroll(int mode); /* 0=off, 1=once, ..., ALWAYS */
|
||||
extern void lcd_jump_scroll_delay(int ms);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
||||
#if defined(HAVE_LCD_CHARCELLS) && defined(SIMULATOR)
|
||||
#endif
|
||||
|
||||
#define DRAW_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] |= (1<<((y)&7))
|
||||
#define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7))
|
||||
#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] ^= (1<<((y)&7))
|
||||
|
||||
/*
|
||||
* Memory copy of display bitmap
|
||||
*/
|
||||
/* Memory copy of display bitmap */
|
||||
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
|
||||
|
||||
extern void lcd_set_invert_display(bool yesno);
|
||||
extern void lcd_set_flip(bool yesno);
|
||||
extern void lcd_roll(int pixels);
|
||||
extern void lcd_setmargins(int xmargin, int ymargin);
|
||||
extern int lcd_getxmargin(void);
|
||||
extern int lcd_getymargin(void);
|
||||
extern void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
|
||||
bool clear);
|
||||
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_drawrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_invertrect (int x, int y, int nx, int ny);
|
||||
extern void lcd_invertscroll(int x, int y);
|
||||
extern void lcd_drawline( int x1, int y1, int x2, int y2 );
|
||||
extern void lcd_clearline( int x1, int y1, int x2, int y2 );
|
||||
extern void lcd_setfont(int font);
|
||||
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
|
||||
extern void lcd_drawpixel(int x, int y);
|
||||
extern void lcd_clearpixel(int x, int y);
|
||||
extern void lcd_invertpixel(int x, int y);
|
||||
extern void lcd_roll(int pixels);
|
||||
extern void lcd_set_invert_display(bool yesno);
|
||||
extern void lcd_set_flip(bool yesno);
|
||||
extern void lcd_drawline(int x1, int y1, int x2, int y2);
|
||||
extern void lcd_clearline(int x1, int y1, int x2, int y2);
|
||||
extern void lcd_drawrect(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_invertrect(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);
|
||||
extern void lcd_putsxy(int x, int y, const unsigned char *string);
|
||||
extern void lcd_invertscroll(int x, int y);
|
||||
extern void lcd_bidir_scroll(int threshold);
|
||||
extern void lcd_scroll_step(int pixels);
|
||||
extern void lcd_setfont(int font);
|
||||
extern void lcd_putsxy(int x, int y, const unsigned char *string);
|
||||
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
|
||||
|
||||
#endif /* CHARCELLS / BITMAP */
|
||||
|
||||
/* internal usage, but in multiple drivers */
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#define SCROLL_SPACING 3
|
||||
|
||||
struct scrollinfo {
|
||||
char line[MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2];
|
||||
int len; /* length of line in chars */
|
||||
int width; /* length of line in pixels */
|
||||
int offset;
|
||||
int startx;
|
||||
bool backward; /* scroll presently forward or backward? */
|
||||
bool bidir;
|
||||
bool invert; /* invert the scrolled text */
|
||||
long start_tick;
|
||||
};
|
||||
#else /* !HAVE_LCD_BITMAP */
|
||||
|
||||
struct scrollinfo {
|
||||
int mode;
|
||||
char text[MAX_PATH];
|
||||
int textlen;
|
||||
int offset;
|
||||
int turn_offset;
|
||||
int startx;
|
||||
int starty;
|
||||
long scroll_start_tick;
|
||||
int direction; /* +1 for right or -1 for left*/
|
||||
int jump_scroll;
|
||||
int jump_scroll_steps;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* __LCD_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue