mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
X5 remote LCD drawing. This will break target linking atm - lcd_remote_update[_rect]() are not yet implemented.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10347 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cb36fec392
commit
05ddd9a44e
16 changed files with 1182 additions and 38 deletions
|
@ -73,6 +73,10 @@
|
||||||
#define SLIDER_OK BUTTON_SELECT
|
#define SLIDER_OK BUTTON_SELECT
|
||||||
#define SLIDER_CANCEL BUTTON_PLAY
|
#define SLIDER_CANCEL BUTTON_PLAY
|
||||||
|
|
||||||
|
/* FIXME: chosen at will to make it compile */
|
||||||
|
#define SLIDER_RC_OK BUTTON_RC_PLAY
|
||||||
|
#define SLIDER_RC_CANCEL BUTTON_RC_REC
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const int max_val[3] = {LCD_MAX_RED,LCD_MAX_GREEN,LCD_MAX_BLUE};
|
static const int max_val[3] = {LCD_MAX_RED,LCD_MAX_GREEN,LCD_MAX_BLUE};
|
||||||
|
|
|
@ -454,6 +454,14 @@ static const struct plugin_api rockbox_api = {
|
||||||
font_get_bits,
|
font_get_bits,
|
||||||
font_load,
|
font_load,
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
|
||||||
|
lcd_remote_set_foreground,
|
||||||
|
lcd_remote_get_foreground,
|
||||||
|
lcd_remote_set_background,
|
||||||
|
lcd_remote_get_background,
|
||||||
|
lcd_remote_bitmap_part,
|
||||||
|
lcd_remote_bitmap,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int plugin_load(const char* plugin, void* parameter)
|
int plugin_load(const char* plugin, void* parameter)
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||||
|
|
||||||
/* increase this every time the api struct changes */
|
/* increase this every time the api struct changes */
|
||||||
#define PLUGIN_API_VERSION 24
|
#define PLUGIN_API_VERSION 25
|
||||||
|
|
||||||
/* update this to latest version if a change to the api struct breaks
|
/* update this to latest version if a change to the api struct breaks
|
||||||
backwards compatibility (and please take the opportunity to sort in any
|
backwards compatibility (and please take the opportunity to sort in any
|
||||||
|
@ -221,7 +221,7 @@ struct plugin_api {
|
||||||
void (*lcd_remote_puts_style)(int x, int y, const unsigned char *str, int style);
|
void (*lcd_remote_puts_style)(int x, int y, const unsigned char *str, int style);
|
||||||
void (*lcd_remote_puts_scroll_style)(int x, int y, const unsigned char* string,
|
void (*lcd_remote_puts_scroll_style)(int x, int y, const unsigned char* string,
|
||||||
int style);
|
int style);
|
||||||
unsigned char* lcd_remote_framebuffer;
|
fb_remote_data* lcd_remote_framebuffer;
|
||||||
void (*lcd_remote_update)(void);
|
void (*lcd_remote_update)(void);
|
||||||
void (*lcd_remote_update_rect)(int x, int y, int width, int height);
|
void (*lcd_remote_update_rect)(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
@ -529,6 +529,16 @@ struct plugin_api {
|
||||||
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
|
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
|
||||||
struct font* (*font_load)(const char *path);
|
struct font* (*font_load)(const char *path);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
|
||||||
|
void (*lcd_remote_set_foreground)(unsigned foreground);
|
||||||
|
unsigned (*lcd_remote_get_foreground)(void);
|
||||||
|
void (*lcd_remote_set_background)(unsigned foreground);
|
||||||
|
unsigned (*lcd_remote_get_background)(void);
|
||||||
|
void (*lcd_remote_bitmap_part)(const fb_remote_data *src, int src_x, int src_y,
|
||||||
|
int stride, int x, int y, int width, int height);
|
||||||
|
void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
|
||||||
|
int height);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* plugin header */
|
/* plugin header */
|
||||||
|
|
|
@ -140,7 +140,7 @@ static void snow_move(void)
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
if (particles[i][0] <= LCD_REMOTE_WIDTH
|
if (particles[i][0] <= LCD_REMOTE_WIDTH
|
||||||
&& particles[i][1] <= LCD_REMOTE_HEIGHT) {
|
&& particles[i][1] <= LCD_REMOTE_HEIGHT) {
|
||||||
rb->lcd_remote_bitmap(flake,particles[i][0],particles[i][1],
|
rb->lcd_remote_mono_bitmap(flake,particles[i][0],particles[i][1],
|
||||||
FLAKE_WIDTH,FLAKE_WIDTH);
|
FLAKE_WIDTH,FLAKE_WIDTH);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,20 +30,30 @@ static int fontwidth, fontheight;
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == PLAYER_PAD
|
#if CONFIG_KEYPAD == PLAYER_PAD
|
||||||
#define STATS_STOP BUTTON_STOP
|
#define STATS_STOP BUTTON_STOP
|
||||||
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == IPOD_3G_PAD)
|
#elif (CONFIG_KEYPAD == RECORDER_PAD) \
|
||||||
|
|| (CONFIG_KEYPAD == ONDIO_PAD)
|
||||||
|
#define STATS_STOP BUTTON_OFF
|
||||||
|
|
||||||
|
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \
|
||||||
|
|| (CONFIG_KEYPAD == IRIVER_H300_PAD)
|
||||||
|
#define STATS_STOP BUTTON_OFF
|
||||||
|
#define STATS_STOP_REMOTE BUTTON_RC_STOP
|
||||||
|
|
||||||
|
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) \
|
||||||
|
|| (CONFIG_KEYPAD == IPOD_3G_PAD)
|
||||||
#define STATS_STOP BUTTON_MENU
|
#define STATS_STOP BUTTON_MENU
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
|
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
|
||||||
#define STATS_STOP BUTTON_PLAY
|
#define STATS_STOP BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
|
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
|
||||||
#define STATS_STOP BUTTON_POWER
|
#define STATS_STOP BUTTON_POWER
|
||||||
|
#define STATS_STOP_REMOTE BUTTON_RC_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
||||||
#define STATS_STOP BUTTON_A
|
#define STATS_STOP BUTTON_A
|
||||||
#else
|
|
||||||
#define STATS_STOP BUTTON_OFF
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_STOP
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO: Better get the exts from the filetypes var in tree.c */
|
/* TODO: Better get the exts from the filetypes var in tree.c */
|
||||||
|
|
|
@ -80,6 +80,13 @@ drivers/lcd-h100.c
|
||||||
drivers/lcd-16bit.c
|
drivers/lcd-16bit.c
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
#if LCD_REMOTE_DEPTH == 1
|
||||||
|
drivers/lcd-h100-remote.c
|
||||||
|
#elif LCD_REMOTE_DEPTH == 2
|
||||||
|
drivers/lcd-remote-2bit-vi.c
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR || CONFIG_LCD == LCD_IPOD2BPP
|
#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR || CONFIG_LCD == LCD_IPOD2BPP
|
||||||
drivers/lcd-ipod.c
|
drivers/lcd-ipod.c
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,9 +185,6 @@ usb.c
|
||||||
bitswap.S
|
bitswap.S
|
||||||
descramble.S
|
descramble.S
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
drivers/lcd-h100-remote.c
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_UDA1380) && !defined(SIMULATOR)
|
#if defined(HAVE_UDA1380) && !defined(SIMULATOR)
|
||||||
drivers/uda1380.c
|
drivers/uda1380.c
|
||||||
#elif defined(HAVE_WM8975) && !defined(SIMULATOR)
|
#elif defined(HAVE_WM8975) && !defined(SIMULATOR)
|
||||||
|
|
1085
firmware/drivers/lcd-remote-2bit-vi.c
Executable file
1085
firmware/drivers/lcd-remote-2bit-vi.c
Executable file
File diff suppressed because it is too large
Load diff
|
@ -27,17 +27,18 @@
|
||||||
|
|
||||||
/* remote LCD */
|
/* remote LCD */
|
||||||
#define LCD_REMOTE_WIDTH 128
|
#define LCD_REMOTE_WIDTH 128
|
||||||
#define LCD_REMOTE_HEIGHT 64
|
#define LCD_REMOTE_HEIGHT 96
|
||||||
#define LCD_REMOTE_DEPTH 1
|
#define LCD_REMOTE_DEPTH 2
|
||||||
|
|
||||||
|
#define LCD_REMOTE_PIXELFORMAT VERTICAL_INTERLEAVED
|
||||||
|
|
||||||
#define CONFIG_KEYPAD IAUDIO_X5_PAD
|
#define CONFIG_KEYPAD IAUDIO_X5_PAD
|
||||||
|
|
||||||
/* Define this if you do software codec */
|
/* Define this if you do software codec */
|
||||||
#define CONFIG_CODEC SWCODEC
|
#define CONFIG_CODEC SWCODEC
|
||||||
|
|
||||||
/* Define this if you have an remote lcd
|
/* Define this if you have an remote lcd */
|
||||||
#define HAVE_REMOTE_LCD
|
#define HAVE_REMOTE_LCD
|
||||||
*/
|
|
||||||
|
|
||||||
#define CONFIG_LCD LCD_X5
|
#define CONFIG_LCD LCD_X5
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,8 @@
|
||||||
/* LCD_PIXELFORMAT */
|
/* LCD_PIXELFORMAT */
|
||||||
#define HORIZONTAL_PACKING 1
|
#define HORIZONTAL_PACKING 1
|
||||||
#define VERTICAL_PACKING 2
|
#define VERTICAL_PACKING 2
|
||||||
|
#define HORIZONTAL_INTERLEAVED 3
|
||||||
|
#define VERTICAL_INTERLEAVED 4
|
||||||
#define RGB565 565
|
#define RGB565 565
|
||||||
#define RGB565SWAPPED 3553
|
#define RGB565SWAPPED 3553
|
||||||
|
|
||||||
|
|
|
@ -327,6 +327,12 @@ int transform_bitmap(const struct RGBQUAD *src, int width, int height,
|
||||||
dst_d = 8;
|
dst_d = 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 7: /* greyscale X5 remote 4-grey */
|
||||||
|
dst_w = width;
|
||||||
|
dst_h = (height + 7) / 8;
|
||||||
|
dst_d = 16;
|
||||||
|
break;
|
||||||
|
|
||||||
default: /* unknown */
|
default: /* unknown */
|
||||||
debugf("error - Undefined destination format\n");
|
debugf("error - Undefined destination format\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -405,6 +411,17 @@ int transform_bitmap(const struct RGBQUAD *src, int width, int height,
|
||||||
(~brightness(src[row * width + col]) & 0xC0) >> (2 * (col & 3));
|
(~brightness(src[row * width + col]) & 0xC0) >> (2 * (col & 3));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 7: /* greyscale X5 remote 4-grey */
|
||||||
|
for (row = 0; row < height; row++)
|
||||||
|
for (col = 0; col < width; col++)
|
||||||
|
{
|
||||||
|
unsigned short data = (~brightness(src[row * width + col]) & 0xC0) >> 6;
|
||||||
|
|
||||||
|
data = (data | (data << 7)) & 0x0101;
|
||||||
|
(*dest)[(row/8) * dst_w + col] |= data << (row & 7);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -514,10 +531,11 @@ void print_usage(void)
|
||||||
"\t 0 Archos recorder, Ondio, Gmini 120/SP, Iriver H1x0 mono\n"
|
"\t 0 Archos recorder, Ondio, Gmini 120/SP, Iriver H1x0 mono\n"
|
||||||
"\t 1 Archos player graphics library\n"
|
"\t 1 Archos player graphics library\n"
|
||||||
"\t 2 Iriver H1x0 4-grey\n"
|
"\t 2 Iriver H1x0 4-grey\n"
|
||||||
"\t 3 Canonical 8-bit grayscale\n"
|
"\t 3 Canonical 8-bit greyscale\n"
|
||||||
"\t 4 16-bit packed 5-6-5 RGB (iriver H300)\n"
|
"\t 4 16-bit packed 5-6-5 RGB (iriver H300)\n"
|
||||||
"\t 5 16-bit packed and byte-swapped 5-6-5 RGB (iPod)\n"
|
"\t 5 16-bit packed and byte-swapped 5-6-5 RGB (iPod)\n"
|
||||||
"\t 6 Greayscale iPod 4-grey\n"
|
"\t 6 Greyscale iPod 4-grey\n"
|
||||||
|
"\t 7 Greyscale X5 remote 4-grey\n"
|
||||||
, APPLICATION_NAME);
|
, APPLICATION_NAME);
|
||||||
printf("build date: " __DATE__ "\n\n");
|
printf("build date: " __DATE__ "\n\n");
|
||||||
}
|
}
|
||||||
|
|
2
tools/configure
vendored
2
tools/configure
vendored
|
@ -705,7 +705,7 @@ toolsdir='\$(ROOTDIR)/tools'
|
||||||
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
||||||
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
|
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
|
||||||
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
|
bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
|
||||||
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
|
bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 7"
|
||||||
output="rockbox.iaudio"
|
output="rockbox.iaudio"
|
||||||
appextra="recorder:gui"
|
appextra="recorder:gui"
|
||||||
archosrom=""
|
archosrom=""
|
||||||
|
|
|
@ -6,7 +6,7 @@ lcd-bitmap.c
|
||||||
lcd-charcell.c
|
lcd-charcell.c
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
lcd-remote.c
|
lcd-remote-bitmap.c
|
||||||
#endif
|
#endif
|
||||||
lcd-sdl.c
|
lcd-sdl.c
|
||||||
sound.c
|
sound.c
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "uisdl.h"
|
#include "uisdl.h"
|
||||||
#include "lcd-sdl.h"
|
#include "lcd-sdl.h"
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote-bitmap.h"
|
||||||
|
|
||||||
SDL_Surface *remote_surface;
|
SDL_Surface *remote_surface;
|
||||||
|
|
||||||
|
@ -27,10 +27,15 @@ SDL_Color remote_color_zero = {UI_REMOTE_BGCOLOR, 0};
|
||||||
SDL_Color remote_backlight_color_zero = {UI_REMOTE_BGCOLORLIGHT, 0};
|
SDL_Color remote_backlight_color_zero = {UI_REMOTE_BGCOLORLIGHT, 0};
|
||||||
SDL_Color remote_color_max = {0, 0, 0, 0};
|
SDL_Color remote_color_max = {0, 0, 0, 0};
|
||||||
|
|
||||||
extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
|
|
||||||
|
|
||||||
static unsigned long get_lcd_remote_pixel(int x, int y) {
|
static unsigned long get_lcd_remote_pixel(int x, int y) {
|
||||||
return ((lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 1);
|
#if LCD_REMOTE_DEPTH == 1
|
||||||
|
return (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 1;
|
||||||
|
#elif LCD_REMOTE_DEPTH == 2
|
||||||
|
#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
|
||||||
|
unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
|
||||||
|
return (bits | (bits >> 7)) & 3;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_remote_update (void)
|
void lcd_remote_update (void)
|
|
@ -21,6 +21,7 @@
|
||||||
#define __LCDREMOTE_H__
|
#define __LCDREMOTE_H__
|
||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
#include "lcd-remote.h"
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
void sim_lcd_remote_init(void);
|
void sim_lcd_remote_init(void);
|
|
@ -31,7 +31,7 @@
|
||||||
#include "lcd-charcell.h"
|
#include "lcd-charcell.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote-bitmap.h"
|
||||||
#endif
|
#endif
|
||||||
#include "thread-sdl.h"
|
#include "thread-sdl.h"
|
||||||
#include "SDL_mutex.h"
|
#include "SDL_mutex.h"
|
||||||
|
|
|
@ -176,22 +176,18 @@
|
||||||
#elif defined(IAUDIO_X5)
|
#elif defined(IAUDIO_X5)
|
||||||
#define UI_TITLE "iAudio X5"
|
#define UI_TITLE "iAudio X5"
|
||||||
#define UI_WIDTH 300 /* width of GUI window */
|
#define UI_WIDTH 300 /* width of GUI window */
|
||||||
#define UI_HEIGHT 462 /* height of GUI window */
|
#define UI_HEIGHT 558 /* height of GUI window */
|
||||||
#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
|
/* high-colour */
|
||||||
#define UI_LCD_BGCOLORLIGHT 230, 160, 60 /* bkgnd color of LCD (backlight) */
|
|
||||||
#define UI_LCD_BLACK 0, 0, 0 /* black */
|
|
||||||
#define UI_LCD_POSX 55 /* x position of lcd */
|
#define UI_LCD_POSX 55 /* x position of lcd */
|
||||||
#define UI_LCD_POSY 61 /* y position of lcd (74 for real aspect) */
|
#define UI_LCD_POSY 61 /* y position of lcd (74 for real aspect) */
|
||||||
#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
|
#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
|
||||||
#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
|
#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
|
||||||
|
|
||||||
#define UI_REMOTE_POSX 12 /* x position of remote lcd */
|
|
||||||
#define UI_REMOTE_POSY 478 /* y position of remote lcd */
|
|
||||||
#define UI_REMOTE_WIDTH 128
|
|
||||||
#define UI_REMOTE_HEIGHT 64
|
|
||||||
|
|
||||||
#define UI_REMOTE_BGCOLORLIGHT 250, 180, 130 /* bkgnd of remote lcd (bklight) */
|
|
||||||
#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
|
#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
|
||||||
|
#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
|
||||||
|
#define UI_REMOTE_POSX 12 /* x position of remote lcd */
|
||||||
|
#define UI_REMOTE_POSY 462 /* y position of remote lcd */
|
||||||
|
#define UI_REMOTE_WIDTH 128
|
||||||
|
#define UI_REMOTE_HEIGHT 96
|
||||||
|
|
||||||
#elif defined(GIGABEAT_F)
|
#elif defined(GIGABEAT_F)
|
||||||
#define UI_TITLE "Toshiba Gigabeat"
|
#define UI_TITLE "Toshiba Gigabeat"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue