mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-15 02:57:37 -04:00
Adapt OSD in plugin lib to be greylib compatible.
Requires addition of viewports and alternate framebuffers to greylib which are essentially similar to the core implementation except that the framebuffer can be any size and relationship to a viewport. Drawing is always fully clipped to the intersecting area. Adapt oscilloscope.c to the API change. FFT will use the new features (later update). Get rid of silly and wrong lcd_bmp_part use in OSD. Remove it from plugin API (must be made incompatible now). Change-Id: Iafa5e2174148fb8ad11db6b9d4add0dcabc5c563
This commit is contained in:
parent
f668c36241
commit
371c86bf3f
11 changed files with 1057 additions and 356 deletions
|
@ -28,11 +28,14 @@
|
|||
#include "plugin.h"
|
||||
#include "grey.h"
|
||||
|
||||
extern struct viewport _grey_default_vp;
|
||||
|
||||
/*** Scrolling ***/
|
||||
|
||||
/* Scroll left */
|
||||
void grey_scroll_left(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *data, *data_end;
|
||||
int length, blank;
|
||||
|
||||
|
@ -45,8 +48,8 @@ void grey_scroll_left(int count)
|
|||
data = _grey_info.buffer;
|
||||
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
|
||||
length = _grey_info.width - count;
|
||||
blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness : _grey_info.bg_brightness;
|
||||
blank = (vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) : _GREY_BG_BRIGHTNESS(vp);
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -61,6 +64,7 @@ void grey_scroll_left(int count)
|
|||
/* Scroll right */
|
||||
void grey_scroll_right(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *data, *data_end;
|
||||
int length, blank;
|
||||
|
||||
|
@ -73,8 +77,8 @@ void grey_scroll_right(int count)
|
|||
data = _grey_info.buffer;
|
||||
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
|
||||
length = _grey_info.width - count;
|
||||
blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness : _grey_info.bg_brightness;
|
||||
blank = (vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) : _GREY_BG_BRIGHTNESS(vp);
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -88,6 +92,7 @@ void grey_scroll_right(int count)
|
|||
/* Scroll up */
|
||||
void grey_scroll_up(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
long shift, length;
|
||||
int blank;
|
||||
|
||||
|
@ -99,8 +104,8 @@ void grey_scroll_up(int count)
|
|||
|
||||
shift = _GREY_MULUQ(_grey_info.width, count);
|
||||
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
|
||||
blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness : _grey_info.bg_brightness;
|
||||
blank = (vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) : _GREY_BG_BRIGHTNESS(vp);
|
||||
|
||||
rb->memmove(_grey_info.buffer, _grey_info.buffer + shift,
|
||||
length);
|
||||
|
@ -110,6 +115,7 @@ void grey_scroll_up(int count)
|
|||
/* Scroll down */
|
||||
void grey_scroll_down(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
long shift, length;
|
||||
int blank;
|
||||
|
||||
|
@ -121,8 +127,8 @@ void grey_scroll_down(int count)
|
|||
|
||||
shift = _GREY_MULUQ(_grey_info.width, count);
|
||||
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
|
||||
blank = (_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness : _grey_info.bg_brightness;
|
||||
blank = (vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) : _GREY_BG_BRIGHTNESS(vp);
|
||||
|
||||
rb->memmove(_grey_info.buffer + shift, _grey_info.buffer,
|
||||
length);
|
||||
|
@ -134,6 +140,7 @@ void grey_scroll_down(int count)
|
|||
/* Scroll left */
|
||||
void grey_ub_scroll_left(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *data, *data_end;
|
||||
int blank, length;
|
||||
|
||||
|
@ -147,9 +154,9 @@ void grey_ub_scroll_left(int count)
|
|||
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
|
||||
length = (_grey_info.width - count) << _GREY_BSHIFT;
|
||||
count <<= _GREY_BSHIFT;
|
||||
blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness :
|
||||
_grey_info.bg_brightness];
|
||||
blank = _grey_info.gvalue[(vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) :
|
||||
_GREY_BG_BRIGHTNESS(vp)];
|
||||
do
|
||||
{
|
||||
rb->memmove(data, data + count, length);
|
||||
|
@ -167,6 +174,7 @@ void grey_ub_scroll_left(int count)
|
|||
/* Scroll right */
|
||||
void grey_ub_scroll_right(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *data, *data_end;
|
||||
int blank, length;
|
||||
|
||||
|
@ -180,9 +188,9 @@ void grey_ub_scroll_right(int count)
|
|||
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
|
||||
length = (_grey_info.width - count) << _GREY_BSHIFT;
|
||||
count <<= _GREY_BSHIFT;
|
||||
blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness :
|
||||
_grey_info.bg_brightness];
|
||||
blank = _grey_info.gvalue[(vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) :
|
||||
_GREY_BG_BRIGHTNESS(vp)];
|
||||
do
|
||||
{
|
||||
rb->memmove(data + count, data, length);
|
||||
|
@ -199,6 +207,7 @@ void grey_ub_scroll_right(int count)
|
|||
/* Scroll up */
|
||||
void grey_ub_scroll_up(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *dst, *end, *src;
|
||||
int blank;
|
||||
|
||||
|
@ -210,9 +219,9 @@ void grey_ub_scroll_up(int count)
|
|||
|
||||
dst = _grey_info.values;
|
||||
end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width);
|
||||
blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness :
|
||||
_grey_info.bg_brightness];
|
||||
blank = _grey_info.gvalue[(vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) :
|
||||
_GREY_BG_BRIGHTNESS(vp)];
|
||||
|
||||
#if (LCD_PIXELFORMAT == VERTICAL_PACKING) \
|
||||
|| (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
|
||||
|
@ -274,6 +283,7 @@ void grey_ub_scroll_up(int count)
|
|||
/* Scroll down */
|
||||
void grey_ub_scroll_down(int count)
|
||||
{
|
||||
struct viewport *vp = &_grey_default_vp;
|
||||
unsigned char *start, *dst;
|
||||
int blank;
|
||||
|
||||
|
@ -285,9 +295,9 @@ void grey_ub_scroll_down(int count)
|
|||
|
||||
start = _grey_info.values;
|
||||
dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width);
|
||||
blank = _grey_info.gvalue[(_grey_info.drawmode & DRMODE_INVERSEVID) ?
|
||||
_grey_info.fg_brightness :
|
||||
_grey_info.bg_brightness];
|
||||
blank = _grey_info.gvalue[(vp->drawmode & DRMODE_INVERSEVID) ?
|
||||
_GREY_FG_BRIGHTNESS(vp) :
|
||||
_GREY_BG_BRIGHTNESS(vp)];
|
||||
|
||||
#if (LCD_PIXELFORMAT == VERTICAL_PACKING) \
|
||||
|| (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue