make the plugin API frambuffer agnostic

Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
This commit is contained in:
Moshe Piekarski 2020-10-06 13:34:04 -05:00 committed by William Wilgus
parent 5d5f8169b5
commit 12f3ed1699
25 changed files with 92 additions and 93 deletions

View file

@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Björn Stenberg
* Copyright (C) 2002 Björn Stenberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -194,7 +194,7 @@ static const struct plugin_api rockbox_api = {
lcd_putsf,
lcd_puts_scroll,
lcd_scroll_stop,
&lcd_static_framebuffer[0][0],
&lcd_framebuffer,
lcd_set_viewport,
lcd_set_framebuffer,
lcd_bmp_part,
@ -281,7 +281,7 @@ static const struct plugin_api rockbox_api = {
lcd_remote_mono_bitmap_part,
lcd_remote_mono_bitmap,
lcd_remote_putsxy,
&lcd_remote_static_framebuffer[0][0],
&lcd_remote_framebuffer;
lcd_remote_update,
lcd_remote_update_rect,
#if (LCD_REMOTE_DEPTH > 1)

View file

@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Björn Stenberg
* Copyright (C) 2002 Björn Stenberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -155,12 +155,12 @@ int plugin_open(char *plugin, char *parameter);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 241
#define PLUGIN_API_VERSION 242
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 241
#define PLUGIN_MIN_API_VERSION 242
/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
@ -204,7 +204,7 @@ struct plugin_api {
void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...);
bool (*lcd_puts_scroll)(int x, int y, const unsigned char* string);
void (*lcd_scroll_stop)(void);
fb_data* lcd_framebuffer;
fb_data** lcd_framebuffer;
void (*lcd_set_viewport)(struct viewport* vp);
void (*lcd_set_framebuffer)(fb_data *fb);
void (*lcd_bmp_part)(const struct bitmap *bm, int src_x, int src_y,
@ -314,7 +314,7 @@ struct plugin_api {
void (*lcd_remote_mono_bitmap)(const unsigned char *src, int x, int y,
int width, int height);
void (*lcd_remote_putsxy)(int x, int y, const unsigned char *string);
fb_remote_data* lcd_remote_framebuffer;
fb_remote_data** lcd_remote_framebuffer;
void (*lcd_remote_update)(void);
void (*lcd_remote_update_rect)(int x, int y, int width, int height);
#if (LCD_REMOTE_DEPTH > 1)

View file

@ -1059,7 +1059,7 @@ void I_FinishUpdate (void)
for (y = 1; y <= SCREENHEIGHT; y++)
{
fb_data *dst = rb->lcd_framebuffer + LCD_WIDTH - y;
fb_data *dst = *rb->lcd_framebuffer + LCD_WIDTH - y;
count = SCREENWIDTH;
do
@ -1073,7 +1073,7 @@ void I_FinishUpdate (void)
else
#endif
{
fb_data *dst = rb->lcd_framebuffer;
fb_data *dst = *rb->lcd_framebuffer;
count = SCREENWIDTH*SCREENHEIGHT;
do

View file

@ -251,7 +251,7 @@ static inline void fire_draw(struct fire* fire)
#ifndef HAVE_LCD_COLOR
dest = draw_buffer;
#else
dest = rb->lcd_framebuffer + LCD_WIDTH * y + FIRE_XPOS;
dest = *rb->lcd_framebuffer + LCD_WIDTH * y + FIRE_XPOS;
#endif
end = dest + FIRE_WIDTH;

View file

@ -526,7 +526,7 @@ static void pan_view_down(struct image_info *info)
*/
move++, info->y--;
rb->memcpy(rgb_linebuf,
rb->lcd_framebuffer + (LCD_HEIGHT - move)*LCD_WIDTH,
*rb->lcd_framebuffer + (LCD_HEIGHT - move)*LCD_WIDTH,
LCD_WIDTH*sizeof (fb_data));
}
#endif
@ -539,7 +539,7 @@ static void pan_view_down(struct image_info *info)
&& settings.jpeg_dither_mode == DITHER_DIFFUSION)
{
/* Cover the first row drawn with previous image data. */
rb->memcpy(rb->lcd_framebuffer + (LCD_HEIGHT - move)*LCD_WIDTH,
rb->memcpy(*rb->lcd_framebuffer + (LCD_HEIGHT - move)*LCD_WIDTH,
rgb_linebuf, LCD_WIDTH*sizeof (fb_data));
info->y++;
}

View file

@ -239,12 +239,12 @@ static fb_data (* const pixel_funcs[COLOUR_NUM_MODES][DITHER_NUM_MODES])(void) =
/* These defines are used fornormal horizontal strides and vertical strides. */
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
#define LCDADDR(x, y) (rb->lcd_framebuffer + LCD_HEIGHT*(x) + (y))
#define LCDADDR(x, y) (*rb->lcd_framebuffer + LCD_HEIGHT*(x) + (y))
#define ROWENDOFFSET (width*LCD_HEIGHT)
#define ROWOFFSET (1)
#define COLOFFSET (LCD_HEIGHT)
#else
#define LCDADDR(x, y) (rb->lcd_framebuffer + LCD_WIDTH*(y) + (x))
#define LCDADDR(x, y) (*rb->lcd_framebuffer + LCD_WIDTH*(y) + (x))
#define ROWENDOFFSET (width)
#define ROWOFFSET (LCD_WIDTH)
#define COLOFFSET (1)

View file

@ -776,12 +776,12 @@ bool aliens_down, aliens_right, hit_left_border, hit_right_border;
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
static inline fb_data get_pixel(int x, int y)
{
return rb->lcd_framebuffer[x*LCD_HEIGHT+y];
return *rb->lcd_framebuffer[x*LCD_HEIGHT+y];
}
#else
static inline fb_data get_pixel(int x, int y)
{
return rb->lcd_framebuffer[ytab[y] + x];
return *rb->lcd_framebuffer[ytab[y] + x];
}
#endif
@ -794,7 +794,7 @@ static const unsigned char shifts[4] = {
/* Horizontal packing */
static inline fb_data get_pixel(int x, int y)
{
return (rb->lcd_framebuffer[ytab[y] + (x >> 2)] >> shifts[x & 3]) & 3;
return (*rb->lcd_framebuffer[ytab[y] + (x >> 2)] >> shifts[x & 3]) & 3;
}
#else
/* Vertical packing */
@ -803,7 +803,7 @@ static const unsigned char shifts[4] = {
};
static inline fb_data get_pixel(int x, int y)
{
return (rb->lcd_framebuffer[ytab[y] + x] >> shifts[y & 3]) & 3;
return (*rb->lcd_framebuffer[ytab[y] + x] >> shifts[y & 3]) & 3;
}
#endif /* Horizontal/Vertical packing */

View file

@ -845,7 +845,7 @@ static void grey_screendump_hook(int fd)
gsrc = _grey_info.values + _GREY_MULUQ(_grey_info.width, gy);
#if LCD_DEPTH == 2
src = rb->lcd_framebuffer + _GREY_MULUQ(LCD_FBWIDTH, y);
src = *rb->lcd_framebuffer + _GREY_MULUQ(LCD_FBWIDTH, y);
do
{
@ -876,7 +876,7 @@ static void grey_screendump_hook(int fd)
#if LCD_DEPTH == 1
mask = BIT_N(y & 7);
src = rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
src = *rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
do
{
@ -908,7 +908,7 @@ static void grey_screendump_hook(int fd)
#elif LCD_DEPTH == 2
shift = 2 * (y & 3);
src = rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 2);
src = *rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 2);
do
{
@ -933,7 +933,7 @@ static void grey_screendump_hook(int fd)
#if LCD_DEPTH == 2
shift = y & 7;
src = rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
src = *rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
do
{

View file

@ -227,7 +227,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags,
osd->back_bitmap_stride = w;
#endif /* end stride type selection */
osd->lcd_bitmap_data = (void *)rb->lcd_framebuffer;
osd->lcd_bitmap_data = (void *)*rb->lcd_framebuffer;
osd->back_bitmap_data = buf;
osd->maxwidth = w;

View file

@ -377,7 +377,7 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
src += stride * src_y + src_x; /* move starting point */
src_end = src + stride * height;
dst = rb->lcd_framebuffer + LCD_WIDTH * y + x;
dst = *rb->lcd_framebuffer + LCD_WIDTH * y + x;
do
{
@ -444,7 +444,7 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
src += 3 * (stride * src_y + src_x); /* move starting point */
src_end = src + 3 * stride * height;
dst = rb->lcd_framebuffer + LCD_WIDTH * y + x;
dst = *rb->lcd_framebuffer + LCD_WIDTH * y + x;
do
{

View file

@ -43,7 +43,7 @@ void xlcd_scroll_left(int count)
length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
rb->memmove(rb->lcd_framebuffer, rb->lcd_framebuffer + LCD_HEIGHT*count,
rb->memmove(*rb->lcd_framebuffer, *rb->lcd_framebuffer + LCD_HEIGHT*count,
length * sizeof(fb_data));
oldmode = rb->lcd_get_drawmode();
@ -65,8 +65,8 @@ void xlcd_scroll_right(int count)
length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
rb->memmove(rb->lcd_framebuffer + LCD_HEIGHT*count,
rb->lcd_framebuffer, length * sizeof(fb_data));
rb->memmove(*rb->lcd_framebuffer + LCD_HEIGHT*count,
*rb->lcd_framebuffer, length * sizeof(fb_data));
oldmode = rb->lcd_get_drawmode();
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@ -90,7 +90,7 @@ void xlcd_scroll_up(int count)
length = LCD_HEIGHT - count;
width = LCD_WIDTH-1;
data = rb->lcd_framebuffer;
data = *rb->lcd_framebuffer;
do {
rb->memmove(data,data + count,length * sizeof(fb_data));
@ -119,7 +119,7 @@ void xlcd_scroll_down(int count)
length = LCD_HEIGHT - count;
width = LCD_WIDTH-1;
data = rb->lcd_framebuffer;
data = *rb->lcd_framebuffer;
do {
rb->memmove(data + count, data, length * sizeof(fb_data));
@ -155,7 +155,7 @@ void xlcd_scroll_left(int count)
if (blockcount)
{
unsigned char *data = rb->lcd_framebuffer;
unsigned char *data = *rb->lcd_framebuffer;
unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
do
@ -168,7 +168,7 @@ void xlcd_scroll_left(int count)
if (bitcount)
{
int bx, y;
unsigned char *addr = rb->lcd_framebuffer + blocklen;
unsigned char *addr = *rb->lcd_framebuffer + blocklen;
#if LCD_DEPTH == 2
unsigned fill = (0x55 * (~rb->lcd_get_background() & 3)) << bitcount;
#endif
@ -213,7 +213,7 @@ void xlcd_scroll_right(int count)
if (blockcount)
{
unsigned char *data = rb->lcd_framebuffer;
unsigned char *data = *rb->lcd_framebuffer;
unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
do
@ -226,7 +226,7 @@ void xlcd_scroll_right(int count)
if (bitcount)
{
int bx, y;
unsigned char *addr = rb->lcd_framebuffer + blockcount;
unsigned char *addr = *rb->lcd_framebuffer + blockcount;
#if LCD_DEPTH == 2
unsigned fill = 0x55 * (~rb->lcd_get_background() & 3);
#endif
@ -265,7 +265,7 @@ void xlcd_scroll_left(int count)
return;
}
data = rb->lcd_framebuffer;
data = *rb->lcd_framebuffer;
data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
length = LCD_WIDTH - count;
@ -294,7 +294,7 @@ void xlcd_scroll_right(int count)
return;
}
data = rb->lcd_framebuffer;
data = *rb->lcd_framebuffer;
data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
length = LCD_WIDTH - count;
@ -328,8 +328,8 @@ void xlcd_scroll_up(int count)
length = LCD_HEIGHT - count;
rb->memmove(rb->lcd_framebuffer,
rb->lcd_framebuffer + count * LCD_FBWIDTH,
rb->memmove(*rb->lcd_framebuffer,
*rb->lcd_framebuffer + count * LCD_FBWIDTH,
length * LCD_FBWIDTH * sizeof(fb_data));
oldmode = rb->lcd_get_drawmode();
@ -351,8 +351,8 @@ void xlcd_scroll_down(int count)
length = LCD_HEIGHT - count;
rb->memmove(rb->lcd_framebuffer + count * LCD_FBWIDTH,
rb->lcd_framebuffer,
rb->memmove(*rb->lcd_framebuffer + count * LCD_FBWIDTH,
*rb->lcd_framebuffer,
length * LCD_FBWIDTH * sizeof(fb_data));
oldmode = rb->lcd_get_drawmode();
@ -388,8 +388,8 @@ void xlcd_scroll_up(int count)
if (blockcount)
{
rb->memmove(rb->lcd_framebuffer,
rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
rb->memmove(*rb->lcd_framebuffer,
*rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
blocklen * LCD_FBWIDTH * sizeof(fb_data));
}
if (bitcount)
@ -424,7 +424,7 @@ void xlcd_scroll_up(int count)
: /* inputs */
[wide]"r"(LCD_FBWIDTH),
[rows]"r"(blocklen),
[addr]"a"(rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
[addr]"a"(*rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
[cnt] "d"(bitcount),
[bkg] "d"(0x55 * (~rb->lcd_get_background() & 3))
: /* clobbers */
@ -432,7 +432,7 @@ void xlcd_scroll_up(int count)
);
#else /* C version */
int x, by;
unsigned char *addr = rb->lcd_framebuffer + blocklen * LCD_FBWIDTH;
unsigned char *addr = *rb->lcd_framebuffer + blocklen * LCD_FBWIDTH;
#if LCD_DEPTH == 2
unsigned fill = 0x55 * (~rb->lcd_get_background() & 3);
#else
@ -457,7 +457,7 @@ void xlcd_scroll_up(int count)
#if LCD_DEPTH == 2
int x, by;
fb_data *addr = rb->lcd_framebuffer + blocklen * LCD_FBWIDTH;
fb_data *addr = *rb->lcd_framebuffer + blocklen * LCD_FBWIDTH;
unsigned fill, mask;
fill = patterns[rb->lcd_get_background() & 3] << 8;
@ -512,8 +512,8 @@ void xlcd_scroll_down(int count)
if (blockcount)
{
rb->memmove(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
rb->lcd_framebuffer,
rb->memmove(*rb->lcd_framebuffer + blockcount * LCD_FBWIDTH,
*rb->lcd_framebuffer,
blocklen * LCD_FBWIDTH * sizeof(fb_data));
}
if (bitcount)
@ -548,7 +548,7 @@ void xlcd_scroll_down(int count)
: /* inputs */
[wide]"r"(LCD_WIDTH),
[rows]"r"(blocklen),
[addr]"a"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
[addr]"a"(*rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
[cnt] "d"(bitcount),
[bkg] "d"((0x55 * (~rb->lcd_get_background() & 3)) << bitcount)
: /* clobbers */
@ -556,7 +556,7 @@ void xlcd_scroll_down(int count)
);
#else /* C version */
int x, by;
unsigned char *addr = rb->lcd_framebuffer + blockcount * LCD_FBWIDTH;
unsigned char *addr = *rb->lcd_framebuffer + blockcount * LCD_FBWIDTH;
#if LCD_DEPTH == 2
unsigned fill = (0x55 * (~rb->lcd_get_background() & 3)) << bitcount;
#else
@ -581,7 +581,7 @@ void xlcd_scroll_down(int count)
#if LCD_DEPTH == 2
int x, by;
fb_data *addr = rb->lcd_framebuffer + blockcount * LCD_FBWIDTH;
fb_data *addr = *rb->lcd_framebuffer + blockcount * LCD_FBWIDTH;
unsigned fill, mask;
fill = patterns[rb->lcd_get_background() & 3] >> (8 - bitcount);

View file

@ -1379,7 +1379,7 @@ RB_WRAP(font_getstringsize)
RB_WRAP(lcd_framebuffer)
{
rli_wrap(L, rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT);
rli_wrap(L, *rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT);
return 1;
}

View file

@ -821,7 +821,7 @@ static void draw_oriented_mono_bitmap_part(const unsigned char *src,
src_y &= 7;
src_end = src + width;
dst = rb->lcd_framebuffer + (LCD_WIDTH - y) + x*LCD_WIDTH;
dst = *rb->lcd_framebuffer + (LCD_WIDTH - y) + x*LCD_WIDTH;
do
{
const unsigned char *src_col = src++;
@ -953,7 +953,7 @@ static void draw_oriented_alpha_bitmap_part(const unsigned char *src,
fg_pattern = rb->lcd_get_foreground();
/*bg_pattern=*/ rb->lcd_get_background();
dst_start = rb->lcd_framebuffer + (LCD_WIDTH - y - 1) + x*LCD_WIDTH;
dst_start = *rb->lcd_framebuffer + (LCD_WIDTH - y - 1) + x*LCD_WIDTH;
int col, row = height;
unsigned data, pixels;
unsigned skip_end = (stride - width);

View file

@ -704,7 +704,7 @@ static int gameProc( void )
rb->lcd_blit_pal256( video_buffer, 0, 0, XOFS, YOFS,
ScreenWidth, ScreenHeight);
#else
blit_display(rb->lcd_framebuffer,video_buffer);
blit_display(*rb->lcd_framebuffer,video_buffer);
#endif
if (settings.showfps) {

View file

@ -190,7 +190,7 @@ GREY_INFO_STRUCT
#define BUFFER_HEIGHT _grey_info.height
typedef unsigned char pix_t;
#else /* LCD_DEPTH >= 8 */
#define LCD_BUF rb->lcd_framebuffer
#define LCD_BUF *rb->lcd_framebuffer
#define G_PIX LCD_RGBPACK
#define N_PIX LCD_RGBPACK
#define G_BRIGHT(y) LCD_RGBPACK(y,y,y)

View file

@ -201,9 +201,9 @@ int main(void)
#ifdef HAVE_LCD_COLOR
shades_generate(time++); /* dynamically */
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
ptr = (unsigned char*)rb->lcd_framebuffer;
ptr = (unsigned char*)*rb->lcd_framebuffer;
#else
ptr = rb->lcd_framebuffer;
ptr = *rb->lcd_framebuffer;
#endif
#else
@ -237,7 +237,7 @@ int main(void)
p4-=sp4;
#ifdef HAVE_LCD_COLOR
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
rb->lcd_blit_pal256( (unsigned char*)rb->lcd_framebuffer,
rb->lcd_blit_pal256( (unsigned char*)*rb->lcd_framebuffer,
0,0,0,0,LCD_WIDTH,LCD_HEIGHT);
#else
rb->lcd_update();

View file

@ -1016,7 +1016,7 @@ static void rb_draw_line(void *handle, int x1, int y1, int x2, int y2,
}
else
#endif
draw_antialiased_line(rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
draw_antialiased_line(*rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
}
else
{
@ -1294,7 +1294,7 @@ static void rb_draw_poly(void *handle, int *coords, int npoints,
x2, y2);
}
else
draw_antialiased_line(rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
draw_antialiased_line(*rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
#ifdef DEBUG_MENU
if(debug_settings.polyanim)
@ -1319,7 +1319,7 @@ static void rb_draw_poly(void *handle, int *coords, int npoints,
x2, y2);
}
else
draw_antialiased_line(rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
draw_antialiased_line(*rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, x1, y1, x2, y2);
}
else
{
@ -1474,7 +1474,7 @@ static void rb_blitter_save(void *handle, blitter *bl, int x, int y)
trim_rect(&x, &y, &w, &h);
fb_data *fb = zoom_enabled ? zoom_fb : rb->lcd_framebuffer;
fb_data *fb = zoom_enabled ? zoom_fb : *rb->lcd_framebuffer;
LOGF("rb_blitter_save(%d, %d, %d, %d)", x, y, w, h);
for(int i = 0; i < h; ++i)
{
@ -1778,9 +1778,9 @@ static void timer_cb(void)
static bool what = false;
what = !what;
if(what)
rb->lcd_framebuffer[0] = LCD_BLACK;
*rb->lcd_framebuffer[0] = LCD_BLACK;
else
rb->lcd_framebuffer[0] = LCD_WHITE;
*rb->lcd_framebuffer[0] = LCD_WHITE;
rb->lcd_update();
}
#endif
@ -2909,7 +2909,7 @@ static void bench_aa(void)
int i = 0;
while(*rb->current_tick < next)
{
draw_antialiased_line(rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, 0, 0, 20, 31);
draw_antialiased_line(*rb->lcd_framebuffer, LCD_WIDTH, LCD_HEIGHT, 0, 0, 20, 31);
++i;
}
rb->splashf(HZ, "%d AA lines/sec", i);

View file

@ -742,9 +742,9 @@ static void spr_scan(void)
void lcd_begin(void)
{
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
vdest=(unsigned char*)rb->lcd_framebuffer;
vdest=(unsigned char*)*rb->lcd_framebuffer;
#else
vdest=rb->lcd_framebuffer;
vdest=*rb->lcd_framebuffer;
#endif
#ifdef HAVE_LCD_COLOR
@ -975,9 +975,9 @@ void lcd_refreshline(void)
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
if(options.scaling==3) {
rb->lcd_blit_pal256((unsigned char*)rb->lcd_framebuffer,(LCD_WIDTH-160)/2, (LCD_HEIGHT-144)/2, (LCD_WIDTH-160)/2, (LCD_HEIGHT-144)/2, 160, 144);
rb->lcd_blit_pal256((unsigned char*)*rb->lcd_framebuffer,(LCD_WIDTH-160)/2, (LCD_HEIGHT-144)/2, (LCD_WIDTH-160)/2, (LCD_HEIGHT-144)/2, 160, 144);
} else {
rb->lcd_blit_pal256((unsigned char*)rb->lcd_framebuffer,0,0,0,0,LCD_WIDTH,LCD_HEIGHT);
rb->lcd_blit_pal256((unsigned char*)*rb->lcd_framebuffer,0,0,0,0,LCD_WIDTH,LCD_HEIGHT);
}
#else
if(options.scaling==3) {

View file

@ -290,7 +290,7 @@ void vid_update(int scanline)
else if (fb.mode==2)
scanline-=8;
scanline_remapped = scanline / 16;
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
frameb = *rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
while (cnt < 160) {
balance += LCD_WIDTH;
if (balance > 0)
@ -316,7 +316,7 @@ void vid_update(int scanline)
else if (fb.mode==2)
scanline-=8;
scanline_remapped = scanline / 4;
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
frameb = *rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
while (cnt < 160) {
*(frameb++) = (scan.buf[0][cnt]&0x3) |
((scan.buf[1][cnt]&0x3)<<2) |

View file

@ -639,7 +639,7 @@ SDL_Surface *ROCKBOX_SetVideoMode(_THIS, SDL_Surface *current,
this->hidden->w = current->w = width;
this->hidden->h = current->h = height;
current->pitch = current->w * (bpp / 8);
current->pixels = this->hidden->direct ? rb->lcd_framebuffer : this->hidden->buffer;
current->pixels = this->hidden->direct ? *rb->lcd_framebuffer : this->hidden->buffer;
/* We're done */
return(current);
@ -674,7 +674,7 @@ static void flip_pixels(int x, int y, int w, int h)
for(int x_0 = x; x_0 < x + w; ++x_0)
{
/* swap pixels directly in the framebuffer */
rb->lcd_framebuffer[y_0 * LCD_WIDTH + x_0] = swap16(rb->lcd_framebuffer[y_0 * LCD_WIDTH + x_0]);
*rb->lcd_framebuffer[y_0 * LCD_WIDTH + x_0] = swap16(*rb->lcd_framebuffer[y_0 * LCD_WIDTH + x_0]);
}
}
}
@ -684,7 +684,7 @@ static void blit_rotated(fb_data *src, int x, int y, int w, int h)
{
for(int y_0 = y; y_0 < y + h; ++y_0)
for(int x_0 = x; x_0 < x + w; ++x_0)
rb->lcd_framebuffer[x_0 * LCD_WIDTH + y_0] = src[(LCD_WIDTH - y_0) * LCD_HEIGHT + x_0];
*rb->lcd_framebuffer[x_0 * LCD_WIDTH + y_0] = src[(LCD_WIDTH - y_0) * LCD_HEIGHT + x_0];
}
static void ROCKBOX_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
@ -720,7 +720,7 @@ static void ROCKBOX_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
out_bmp.width = LCD_WIDTH;
out_bmp.height = LCD_HEIGHT;
out_bmp.data = (char*)rb->lcd_framebuffer;
out_bmp.data = (char*)*rb->lcd_framebuffer;
simple_resize_bitmap(&in_bmp, &out_bmp);
}
else

View file

@ -65,7 +65,7 @@ enum plugin_status plugin_start(const void* parameter)
{
(void)parameter;
b = rb->lcd_framebuffer;
b = *rb->lcd_framebuffer;
rb->lcd_set_background(LCD_RGBPACK(0,0,0));
rb->lcd_clear_display(); // TODO: Optimizes this by e.g. invalidating rects

View file

@ -584,7 +584,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
struct bitmap out_bmp;
out_bmp.width = LCD_WIDTH;
out_bmp.height = LCD_HEIGHT;
out_bmp.data = (unsigned char*) rb->lcd_framebuffer;
out_bmp.data = (unsigned char*) *rb->lcd_framebuffer;
#ifdef HAVE_LCD_COLOR
if(sys->settings.scaling_quality == 1)
@ -631,25 +631,25 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
{
#ifdef HAVE_LCD_COLOR
int r, g, b;
fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x];
fb_data pix = *rb->lcd_framebuffer[y * LCD_WIDTH + x];
#if (LCD_DEPTH > 24)
r = 0xff - pix.r;
g = 0xff - pix.g;
b = 0xff - pix.b;
rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 };
*rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 };
#elif (LCD_DEPTH == 24)
r = 0xff - pix.r;
g = 0xff - pix.g;
b = 0xff - pix.b;
rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r };
*rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r };
#else
r = RGB_UNPACK_RED (pix);
g = RGB_UNPACK_GREEN(pix);
b = RGB_UNPACK_BLUE (pix);
rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(0xff - r, 0xff - g, 0xff - b);
*rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(0xff - r, 0xff - g, 0xff - b);
#endif
#else
rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_BRIGHTNESS(0xff - rb->lcd_framebuffer[y * LCD_WIDTH + x]);
*rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_BRIGHTNESS(0xff - *rb->lcd_framebuffer[y * LCD_WIDTH + x]);
#endif
}
}
@ -671,14 +671,14 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
if(prev_frames && orig_fb)
{
rb->memcpy(orig_fb, rb->lcd_framebuffer, sizeof(fb_data) * LCD_WIDTH * LCD_HEIGHT);
rb->memcpy(orig_fb, *rb->lcd_framebuffer, sizeof(fb_data) * LCD_WIDTH * LCD_HEIGHT);
/* fancy useless slow motion blur */
for(int y = 0; y < LCD_HEIGHT; ++y)
{
for(int x = 0; x < LCD_WIDTH; ++x)
{
int r, g, b;
fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x];
fb_data pix = *rb->lcd_framebuffer[y * LCD_WIDTH + x];
r = RGB_UNPACK_RED (pix);
g = RGB_UNPACK_GREEN(pix);
b = RGB_UNPACK_BLUE (pix);
@ -695,7 +695,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
r /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
g /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
b /= (BLUR_FRAMES + 1) / 2 * (1 + BLUR_FRAMES + 1);
rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(r, g, b);
*rb->lcd_framebuffer[y * LCD_WIDTH + x] = LCD_RGBPACK(r, g, b);
}
}
prev_baseidx -= LCD_WIDTH * LCD_HEIGHT;

View file

@ -58,7 +58,7 @@ void update_screen(void)
byte *scrptr;
scrptr = (byte *) SPNM(image);
*/
frameb = rb->lcd_framebuffer;
frameb = *rb->lcd_framebuffer;
for ( y = 0 ; y < HEIGHT*WIDTH; y++ ){
frameb[y] = FB_SCALARPACK(_16bpp_colors[(unsigned)sp_image[y]]);
}
@ -68,7 +68,7 @@ void update_screen(void)
int srcx, srcy=0; /* x / y coordinates in source image */
unsigned char* image;
image = sp_image + ( (Y_OFF)*(WIDTH) ) + X_OFF;
frameb = rb->lcd_framebuffer;
frameb = *rb->lcd_framebuffer;
for(y = 0; y < LCD_HEIGHT; y++)
{
srcx = 0; /* reset our x counter before each row... */

View file

@ -51,7 +51,7 @@ void update_screen(void)
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
for(y = 0; y < LCD_HEIGHT; y++)
{
frameb = rb->lcd_framebuffer + (y) * FB_WIDTH;
frameb = *rb->lcd_framebuffer + (y) * FB_WIDTH;
srcx = 0; /* reset our x counter before each row... */
for(x = 0; x < LCD_WIDTH; x++)
{
@ -67,7 +67,7 @@ void update_screen(void)
int shift;
for(y = 0; y < LCD_HEIGHT; y++)
{
frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
frameb = *rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
srcx = 0; /* reset our x counter before each row... */
shift = ((y & 3 ) * 2 );
mask = ~pixmask[y & 3];
@ -84,7 +84,7 @@ void update_screen(void)
int shift;
for(y = 0; y < LCD_HEIGHT; y++)
{
frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH;
frameb = *rb->lcd_framebuffer + (y/8) * LCD_WIDTH;
srcx = 0; /* reset our x counter before each row... */
shift = (y & 7);
mask = ~pixmask[y & 7];

View file

@ -434,13 +434,12 @@ static inline unsigned fb_to_scalar(fb_data p)
#endif
/* The actual framebuffer */
extern fb_data *lcd_framebuffer;
extern fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
#define FBADDR(x, y) (lcd_framebuffer + ((x) * LCD_FBHEIGHT) + (y))
#else
#define FBADDR(x, y) (lcd_framebuffer + ((y) * LCD_FBWIDTH) + (x))
#endif
#define FRAMEBUFFER_SIZE (sizeof(lcd_static_framebuffer))
#define FRAMEBUFFER_SIZE (sizeof(fb_data)*LCD_FBWIDTH*LCD_FBHEIGHT)
/** Port-specific functions. Enable in port config file. **/
#ifdef HAVE_REMOTE_LCD_AS_MAIN