1
0
Fork 0
forked from len0rd/rockbox

Consistent naming scheme the various blit functions. * Removed lcd_blit_mono() for colour targets. Plugin API became incompatible, so sort, clean up & bump. * Implemented lcd_blit_mono() for M3.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16775 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-03-24 00:35:53 +00:00
parent 99c0978faa
commit 68a21689ae
31 changed files with 272 additions and 405 deletions

View file

@ -74,6 +74,7 @@ static const struct plugin_api rockbox_api = {
/* lcd */ /* lcd */
lcd_set_contrast, lcd_set_contrast,
lcd_update, lcd_update,
lcd_update_rect,
lcd_clear_display, lcd_clear_display,
lcd_setmargins, lcd_setmargins,
lcd_getstringsize, lcd_getstringsize,
@ -91,6 +92,7 @@ static const struct plugin_api rockbox_api = {
lcd_icon, lcd_icon,
lcd_double_height, lcd_double_height,
#else #else
&lcd_framebuffer[0][0],
lcd_set_drawmode, lcd_set_drawmode,
lcd_get_drawmode, lcd_get_drawmode,
lcd_setfont, lcd_setfont,
@ -115,21 +117,27 @@ static const struct plugin_api rockbox_api = {
#if LCD_DEPTH == 16 #if LCD_DEPTH == 16
lcd_bitmap_transparent_part, lcd_bitmap_transparent_part,
lcd_bitmap_transparent, lcd_bitmap_transparent,
lcd_blit_yuv,
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|| defined (IRIVER_H10)
lcd_yuv_set_options,
#endif #endif
#elif (LCD_DEPTH < 4) || !defined(SIMULATOR)
lcd_blit_mono,
lcd_blit_grey_phase,
#endif /* LCD_DEPTH */
lcd_puts_style,
lcd_puts_scroll_style,
bidi_l2v, bidi_l2v,
font_get_bits, font_get_bits,
font_load, font_load,
lcd_puts_style,
lcd_puts_scroll_style,
&lcd_framebuffer[0][0],
lcd_blit,
lcd_update_rect,
gui_scrollbar_draw,
font_get, font_get,
font_getstringsize, font_getstringsize,
font_get_width, font_get_width,
screen_clear_area, screen_clear_area,
gui_scrollbar_draw,
#endif #endif
backlight_on, backlight_on,
backlight_off, backlight_off,
backlight_set_timeout, backlight_set_timeout,
@ -137,6 +145,7 @@ static const struct plugin_api rockbox_api = {
backlight_set_timeout_plugged, backlight_set_timeout_plugged,
#endif #endif
gui_syncsplash, gui_syncsplash,
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
/* remote lcd */ /* remote lcd */
lcd_remote_set_contrast, lcd_remote_set_contrast,
@ -166,7 +175,11 @@ static const struct plugin_api rockbox_api = {
remote_backlight_on, remote_backlight_on,
remote_backlight_off, remote_backlight_off,
remote_backlight_set_timeout,
#if CONFIG_CHARGING
remote_backlight_set_timeout_plugged,
#endif #endif
#endif /* HAVE_REMOTE_LCD */
#if NB_SCREENS == 2 #if NB_SCREENS == 2
{&screens[SCREEN_MAIN], &screens[SCREEN_REMOTE]}, {&screens[SCREEN_MAIN], &screens[SCREEN_REMOTE]},
#else #else
@ -181,16 +194,6 @@ static const struct plugin_api rockbox_api = {
lcd_remote_bitmap, lcd_remote_bitmap,
#endif #endif
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && !defined(SIMULATOR)
lcd_grey_phase_blit,
#endif
#if defined(HAVE_LCD_COLOR)
lcd_yuv_blit,
#endif
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|| defined (IRIVER_H10)
lcd_yuv_set_options,
#endif
/* list */ /* list */
gui_synclist_init, gui_synclist_init,
gui_synclist_set_nb_items, gui_synclist_set_nb_items,
@ -233,9 +236,11 @@ static const struct plugin_api rockbox_api = {
ata_sleep, ata_sleep,
ata_disk_is_active, ata_disk_is_active,
#endif #endif
ata_spin,
ata_spindown, ata_spindown,
reload_directory, reload_directory,
create_numbered_filename, create_numbered_filename,
file_exists,
/* dir */ /* dir */
opendir, opendir,
@ -243,6 +248,7 @@ static const struct plugin_api rockbox_api = {
readdir, readdir,
mkdir, mkdir,
rmdir, rmdir,
dir_exists,
/* kernel/ system */ /* kernel/ system */
PREFIX(sleep), PREFIX(sleep),
@ -256,6 +262,14 @@ static const struct plugin_api rockbox_api = {
threads, threads,
create_thread, create_thread,
remove_thread, remove_thread,
thread_wait,
#if (CONFIG_CODEC == SWCODEC)
mutex_init,
mutex_lock,
mutex_unlock,
align_buffer,
#endif
reset_poweroff_timer, reset_poweroff_timer,
#ifndef SIMULATOR #ifndef SIMULATOR
system_memory_guard, system_memory_guard,
@ -267,7 +281,15 @@ static const struct plugin_api rockbox_api = {
#else #else
cpu_boost, cpu_boost,
#endif #endif
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
#endif /* !SIMULATOR */
#ifdef HAVE_SCHEDULER_BOOSTCTRL
trigger_cpu_boost,
cancel_cpu_boost,
#endif #endif
#ifdef CACHE_FUNCTIONS_AS_CALL
flush_icache,
invalidate_icache,
#endif #endif
timer_register, timer_register,
timer_unregister, timer_unregister,
@ -277,6 +299,13 @@ static const struct plugin_api rockbox_api = {
queue_delete, queue_delete,
queue_post, queue_post,
queue_wait_w_tmo, queue_wait_w_tmo,
#if CONFIG_CODEC == SWCODEC
queue_enable_queue_send,
queue_empty,
queue_wait,
queue_send,
queue_reply,
#endif
usb_acknowledge, usb_acknowledge,
#ifdef RB_PROFILE #ifdef RB_PROFILE
profile_thread, profile_thread,
@ -325,13 +354,12 @@ static const struct plugin_api rockbox_api = {
utf8seek, utf8seek,
/* sound */ /* sound */
#if CONFIG_CODEC == SWCODEC
sound_default,
#endif
sound_set, sound_set,
sound_default,
sound_min, sound_min,
sound_max, sound_max,
sound_unit,
sound_val2phys,
#ifndef SIMULATOR #ifndef SIMULATOR
mp3_play_data, mp3_play_data,
mp3_play_pause, mp3_play_pause,
@ -353,6 +381,8 @@ static const struct plugin_api rockbox_api = {
pcm_play_pause, pcm_play_pause,
pcm_get_bytes_waiting, pcm_get_bytes_waiting,
pcm_calculate_peaks, pcm_calculate_peaks,
pcm_play_lock,
pcm_play_unlock,
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
&rec_freq_sampr[0], &rec_freq_sampr[0],
pcm_init_recording, pcm_init_recording,
@ -367,6 +397,11 @@ static const struct plugin_api rockbox_api = {
audio_set_output_source, audio_set_output_source,
audio_set_input_source, audio_set_input_source,
#endif #endif
dsp_set_crossfeed,
dsp_set_eq,
dsp_dither_enable,
dsp_configure,
dsp_process,
#endif /* CONFIG_CODEC == SWCODEC */ #endif /* CONFIG_CODEC == SWCODEC */
/* playback control */ /* playback control */
@ -508,35 +543,6 @@ static const struct plugin_api rockbox_api = {
detect_flashed_romimage, detect_flashed_romimage,
#endif #endif
led, led,
#ifdef CACHE_FUNCTIONS_AS_CALL
flush_icache,
invalidate_icache,
#endif
/* new stuff at the end, sort into place next time
the API gets incompatible */
#if (CONFIG_CODEC == SWCODEC)
mutex_init,
mutex_lock,
mutex_unlock,
#endif
thread_wait,
#if (CONFIG_CODEC == SWCODEC)
align_buffer,
#endif
file_exists,
dir_exists,
#ifdef HAVE_REMOTE_LCD
remote_backlight_set_timeout,
#if CONFIG_CHARGING
remote_backlight_set_timeout_plugged,
#endif
#endif /* HAVE_REMOTE_LCD */
#if (CONFIG_CODEC == SWCODEC) #if (CONFIG_CODEC == SWCODEC)
bufopen, bufopen,
bufalloc, bufalloc,
@ -569,29 +575,9 @@ static const struct plugin_api rockbox_api = {
search_albumart_files, search_albumart_files,
#endif #endif
#if CONFIG_CODEC == SWCODEC /* new stuff at the end, sort into place next time
pcm_play_lock, the API gets incompatible */
pcm_play_unlock,
queue_enable_queue_send,
queue_empty,
queue_wait,
queue_send,
queue_reply,
#ifndef HAVE_FLASH_STORAGE
ata_spin,
#endif
#ifdef HAVE_SCHEDULER_BOOSTCTRL
trigger_cpu_boost,
cancel_cpu_boost,
#endif
sound_unit,
sound_val2phys,
dsp_set_crossfeed,
dsp_set_eq,
dsp_dither_enable,
dsp_configure,
dsp_process,
#endif /* CONFIG_CODEC == SWCODEC */
}; };
int plugin_load(const char* plugin, void* parameter) int plugin_load(const char* plugin, void* parameter)

View file

@ -119,12 +119,12 @@
#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 99 #define PLUGIN_API_VERSION 100
/* 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
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 98 #define PLUGIN_MIN_API_VERSION 100
/* plugin return codes */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -144,6 +144,7 @@ struct plugin_api {
/* lcd */ /* lcd */
void (*lcd_set_contrast)(int x); void (*lcd_set_contrast)(int x);
void (*lcd_update)(void); void (*lcd_update)(void);
void (*lcd_update_rect)(int x, int y, int width, int height);
void (*lcd_clear_display)(void); void (*lcd_clear_display)(void);
void (*lcd_setmargins)(int x, int y); void (*lcd_setmargins)(int x, int y);
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
@ -160,7 +161,8 @@ struct plugin_api {
void (*lcd_remove_cursor)(void); void (*lcd_remove_cursor)(void);
void (*lcd_icon)(int icon, bool enable); void (*lcd_icon)(int icon, bool enable);
void (*lcd_double_height)(bool on); void (*lcd_double_height)(bool on);
#else #else /* HAVE_LCD_BITMAP */
fb_data* lcd_framebuffer;
void (*lcd_set_drawmode)(int mode); void (*lcd_set_drawmode)(int mode);
int (*lcd_get_drawmode)(void); int (*lcd_get_drawmode)(void);
void (*lcd_setfont)(int font); void (*lcd_setfont)(int font);
@ -192,28 +194,40 @@ struct plugin_api {
int x, int y, int width, int height); int x, int y, int width, int height);
void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y,
int width, int height); int width, int height);
void (*lcd_blit_yuv)(unsigned char * const src[3],
int src_x, int src_y, int stride,
int x, int y, int width, int height);
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|| defined (IRIVER_H10)
void (*lcd_yuv_set_options)(unsigned options);
#endif #endif
unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); #elif (LCD_DEPTH < 4) || !defined(SIMULATOR)
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width,
struct font* (*font_load)(const char *path); int bheight, int stride);
void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases,
int bx, int by, int bwidth, int bheight,
int stride);
#endif /* LCD_DEPTH */
void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
int style); int style);
fb_data* lcd_framebuffer;
void (*lcd_blit) (const fb_data* data, int x, int by, int width, unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
int bheight, int stride); const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
void (*lcd_update_rect)(int x, int y, int width, int height); struct font* (*font_load)(const char *path);
void (*gui_scrollbar_draw)(struct screen * screen, int x, int y,
int width, int height, int items,
int min_shown, int max_shown,
unsigned flags);
struct font* (*font_get)(int font); struct font* (*font_get)(int font);
int (*font_getstringsize)(const unsigned char *str, int *w, int *h, int (*font_getstringsize)(const unsigned char *str, int *w, int *h,
int fontnumber); int fontnumber);
int (*font_get_width)(struct font* pf, unsigned short char_code); int (*font_get_width)(struct font* pf, unsigned short char_code);
void (*screen_clear_area)(struct screen * display, int xstart, int ystart, void (*screen_clear_area)(struct screen * display, int xstart, int ystart,
int width, int height); int width, int height);
#endif void (*gui_scrollbar_draw)(struct screen * screen, int x, int y,
int width, int height, int items,
int min_shown, int max_shown,
unsigned flags);
#endif /* HAVE_LCD_BITMAP */
/* backlight */
void (*backlight_on)(void); void (*backlight_on)(void);
void (*backlight_off)(void); void (*backlight_off)(void);
void (*backlight_set_timeout)(int index); void (*backlight_set_timeout)(int index);
@ -255,7 +269,11 @@ struct plugin_api {
void (*remote_backlight_on)(void); void (*remote_backlight_on)(void);
void (*remote_backlight_off)(void); void (*remote_backlight_off)(void);
void (*remote_backlight_set_timeout)(int index);
#if CONFIG_CHARGING
void (*remote_backlight_set_timeout_plugged)(int index);
#endif #endif
#endif /* HAVE_REMOTE_LCD */
struct screen* screens[NB_SCREENS]; struct screen* screens[NB_SCREENS];
#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) #if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
void (*lcd_remote_set_foreground)(unsigned foreground); void (*lcd_remote_set_foreground)(unsigned foreground);
@ -267,22 +285,6 @@ struct plugin_api {
void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
int height); int height);
#endif #endif
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && !defined(SIMULATOR)
void (*lcd_grey_phase_blit)(unsigned char *values, unsigned char *phases,
int bx, int by, int bwidth, int bheight,
int stride);
#endif
#if defined(HAVE_LCD_COLOR)
void (*lcd_yuv_blit)(unsigned char * const src[3],
int src_x, int src_y, int stride,
int x, int y, int width, int height);
#endif
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|| defined (IRIVER_H10)
void (*lcd_yuv_set_options)(unsigned options);
#endif
/* list */ /* list */
void (*gui_synclist_init)(struct gui_synclist * lists, void (*gui_synclist_init)(struct gui_synclist * lists,
list_get_name callback_get_item_name,void * data, list_get_name callback_get_item_name,void * data,
@ -329,11 +331,14 @@ struct plugin_api {
void (*ata_sleep)(void); void (*ata_sleep)(void);
bool (*ata_disk_is_active)(void); bool (*ata_disk_is_active)(void);
#endif #endif
void (*ata_spin)(void);
void (*ata_spindown)(int seconds); void (*ata_spindown)(int seconds);
void (*reload_directory)(void); void (*reload_directory)(void);
char *(*create_numbered_filename)(char *buffer, const char *path, char *(*create_numbered_filename)(char *buffer, const char *path,
const char *prefix, const char *suffix, const char *prefix, const char *suffix,
int numberlen IF_CNFN_NUM_(, int *num)); int numberlen IF_CNFN_NUM_(, int *num));
bool (*file_exists)(const char *file);
/* dir */ /* dir */
DIR* (*opendir)(const char* name); DIR* (*opendir)(const char* name);
@ -341,6 +346,7 @@ struct plugin_api {
struct dirent* (*readdir)(DIR* dir); struct dirent* (*readdir)(DIR* dir);
int (*mkdir)(const char *name); int (*mkdir)(const char *name);
int (*rmdir)(const char *name); int (*rmdir)(const char *name);
bool (*dir_exists)(const char *path);
/* kernel/ system */ /* kernel/ system */
void (*PREFIX(sleep))(int ticks); void (*PREFIX(sleep))(int ticks);
@ -358,6 +364,14 @@ struct plugin_api {
IF_PRIO(, int priority) IF_PRIO(, int priority)
IF_COP(, unsigned int core)); IF_COP(, unsigned int core));
void (*remove_thread)(struct thread_entry *thread); void (*remove_thread)(struct thread_entry *thread);
void (*thread_wait)(struct thread_entry *thread);
#if CONFIG_CODEC == SWCODEC
void (*mutex_init)(struct mutex *m);
void (*mutex_lock)(struct mutex *m);
void (*mutex_unlock)(struct mutex *m);
size_t (*align_buffer)(void **start, size_t size, size_t align);
#endif
void (*reset_poweroff_timer)(void); void (*reset_poweroff_timer)(void);
#ifndef SIMULATOR #ifndef SIMULATOR
int (*system_memory_guard)(int newmode); int (*system_memory_guard)(int newmode);
@ -368,7 +382,15 @@ struct plugin_api {
#else #else
void (*cpu_boost)(bool on_off); void (*cpu_boost)(bool on_off);
#endif #endif
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
#endif /* !SIMULATOR */
#ifdef HAVE_SCHEDULER_BOOSTCTRL
void (*trigger_cpu_boost)(void);
void (*cancel_cpu_boost)(void);
#endif #endif
#ifdef CACHE_FUNCTIONS_AS_CALL
void (*flush_icache)(void);
void (*invalidate_icache)(void);
#endif #endif
bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), bool (*timer_register)(int reg_prio, void (*unregister_callback)(void),
long cycles, int int_prio, long cycles, int int_prio,
@ -381,6 +403,16 @@ struct plugin_api {
void (*queue_post)(struct event_queue *q, long id, intptr_t data); void (*queue_post)(struct event_queue *q, long id, intptr_t data);
void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev,
int ticks); int ticks);
#if CONFIG_CODEC == SWCODEC
void (*queue_enable_queue_send)(struct event_queue *q,
struct queue_sender_list *send);
bool (*queue_empty)(const struct event_queue *q);
void (*queue_wait)(struct event_queue *q, struct queue_event *ev);
intptr_t (*queue_send)(struct event_queue *q, long id,
intptr_t data);
void (*queue_reply)(struct event_queue *q, intptr_t retval);
#endif /* CONFIG_CODEC == SWCODEC */
void (*usb_acknowledge)(long id); void (*usb_acknowledge)(long id);
#ifdef RB_PROFILE #ifdef RB_PROFILE
void (*profile_thread)(void); void (*profile_thread)(void);
@ -430,12 +462,12 @@ struct plugin_api {
int (*utf8seek)(const unsigned char* utf8, int offset); int (*utf8seek)(const unsigned char* utf8, int offset);
/* sound */ /* sound */
#if CONFIG_CODEC == SWCODEC
int (*sound_default)(int setting);
#endif
void (*sound_set)(int setting, int value); void (*sound_set)(int setting, int value);
int (*sound_default)(int setting);
int (*sound_min)(int setting); int (*sound_min)(int setting);
int (*sound_max)(int setting); int (*sound_max)(int setting);
const char * (*sound_unit)(int setting);
int (*sound_val2phys)(int setting, int value);
#ifndef SIMULATOR #ifndef SIMULATOR
void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size)); void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size));
void (*mp3_play_pause)(bool play); void (*mp3_play_pause)(bool play);
@ -458,6 +490,8 @@ struct plugin_api {
void (*pcm_play_pause)(bool play); void (*pcm_play_pause)(bool play);
size_t (*pcm_get_bytes_waiting)(void); size_t (*pcm_get_bytes_waiting)(void);
void (*pcm_calculate_peaks)(int *left, int *right); void (*pcm_calculate_peaks)(int *left, int *right);
void (*pcm_play_lock)(void);
void (*pcm_play_unlock)(void);
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
const unsigned long *rec_freq_sampr; const unsigned long *rec_freq_sampr;
void (*pcm_init_recording)(void); void (*pcm_init_recording)(void);
@ -473,6 +507,13 @@ struct plugin_api {
void (*audio_set_output_source)(int monitor); void (*audio_set_output_source)(int monitor);
void (*audio_set_input_source)(int source, unsigned flags); void (*audio_set_input_source)(int source, unsigned flags);
#endif #endif
void (*dsp_set_crossfeed)(bool enable);
void (*dsp_set_eq)(bool enable);
void (*dsp_dither_enable)(bool enable);
intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting,
intptr_t value);
int (*dsp_process)(struct dsp_config *dsp, char *dest,
const char *src[], int count);
#endif /* CONFIG_CODEC == SWCODC */ #endif /* CONFIG_CODEC == SWCODC */
/* playback control */ /* playback control */
@ -638,37 +679,8 @@ struct plugin_api {
void (*led)(bool on); void (*led)(bool on);
#ifdef CACHE_FUNCTIONS_AS_CALL
void (*flush_icache)(void);
void (*invalidate_icache)(void);
#endif
/* new stuff at the end, sort into place next time
the API gets incompatible */
#if (CONFIG_CODEC == SWCODEC)
void (*mutex_init)(struct mutex *m);
void (*mutex_lock)(struct mutex *m);
void (*mutex_unlock)(struct mutex *m);
#endif
void (*thread_wait)(struct thread_entry *thread);
#if (CONFIG_CODEC == SWCODEC)
size_t (*align_buffer)(void **start, size_t size, size_t align);
#endif
bool (*file_exists)(const char *file);
bool (*dir_exists)(const char *path);
#ifdef HAVE_REMOTE_LCD
void (*remote_backlight_set_timeout)(int index);
#if CONFIG_CHARGING
void (*remote_backlight_set_timeout_plugged)(int index);
#endif
#endif /* HAVE_REMOTE_LCD */
#if (CONFIG_CODEC == SWCODEC) #if (CONFIG_CODEC == SWCODEC)
/* buffering API */
int (*bufopen)(const char *file, size_t offset, enum data_type type); int (*bufopen)(const char *file, size_t offset, enum data_type type);
int (*bufalloc)(const void *src, size_t size, enum data_type type); int (*bufalloc)(const void *src, size_t size, enum data_type type);
bool (*bufclose)(int handle_id); bool (*bufclose)(int handle_id);
@ -704,33 +716,9 @@ struct plugin_api {
char *buf, int buflen); char *buf, int buflen);
#endif #endif
#if CONFIG_CODEC == SWCODEC /* new stuff at the end, sort into place next time
void (*pcm_play_lock)(void); the API gets incompatible */
void (*pcm_play_unlock)(void);
void (*queue_enable_queue_send)(struct event_queue *q,
struct queue_sender_list *send);
bool (*queue_empty)(const struct event_queue *q);
void (*queue_wait)(struct event_queue *q, struct queue_event *ev);
intptr_t (*queue_send)(struct event_queue *q, long id,
intptr_t data);
void (*queue_reply)(struct event_queue *q, intptr_t retval);
#ifndef HAVE_FLASH_STORAGE
void (*ata_spin)(void);
#endif
#ifdef HAVE_SCHEDULER_BOOSTCTRL
void (*trigger_cpu_boost)(void);
void (*cancel_cpu_boost)(void);
#endif
const char * (*sound_unit)(int setting);
int (*sound_val2phys)(int setting, int value);
void (*dsp_set_crossfeed)(bool enable);
void (*dsp_set_eq)(bool enable);
void (*dsp_dither_enable)(bool enable);
intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting,
intptr_t value);
int (*dsp_process)(struct dsp_config *dsp, char *dest,
const char *src[], int count);
#endif /* CONFIG_CODEC == SWCODEC */
}; };
/* plugin header */ /* plugin header */

View file

@ -1178,11 +1178,12 @@ static void chip8_update_display(void)
} }
#if defined(SIMULATOR) || (LCD_DEPTH > 1) #if defined(SIMULATOR) || (LCD_DEPTH > 1)
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, CHIP8_HEIGHT); rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH,
CHIP8_HEIGHT);
rb->lcd_update(); rb->lcd_update();
#else #else
rb->lcd_blit(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH, CHIP8_HEIGHT>>3 rb->lcd_blit_mono(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH,
, CHIP8_LCDWIDTH); CHIP8_HEIGHT>>3, CHIP8_LCDWIDTH);
#endif #endif
} }

View file

@ -239,12 +239,12 @@ static unsigned long _grey_get_pixel(int x, int y)
static void _timer_isr(void) static void _timer_isr(void)
{ {
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
_grey_info.rb->lcd_grey_phase_blit(_grey_info.values, _grey_info.phases, _grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases,
_grey_info.bx, _grey_info.y, _grey_info.bx, _grey_info.y,
_grey_info.bwidth, _grey_info.height, _grey_info.bwidth, _grey_info.height,
_grey_info.width); _grey_info.width);
#else #else
_grey_info.rb->lcd_grey_phase_blit(_grey_info.values, _grey_info.phases, _grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases,
_grey_info.x, _grey_info.by, _grey_info.x, _grey_info.by,
_grey_info.width, _grey_info.bheight, _grey_info.width, _grey_info.bheight,
_grey_info.width); _grey_info.width);
@ -457,7 +457,7 @@ void grey_release(void)
grey_deferred_update() instead. grey_deferred_update() instead.
Other functions to avoid are: Other functions to avoid are:
lcd_blit() (obviously), lcd_update_rect(), lcd_set_contrast(), lcd_blit_mono(), lcd_update_rect(), lcd_set_contrast(),
lcd_set_invert_display(), lcd_set_flip() */ lcd_set_invert_display(), lcd_set_flip() */
void grey_show(bool enable) void grey_show(bool enable)
{ {

View file

@ -104,7 +104,7 @@ static inline void yuv_blit(uint8_t * const * buf, int src_x, int src_y,
video_lock(); video_lock();
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
rb->lcd_yuv_blit(buf, src_x, src_y, stride, x, y , width, height); rb->lcd_blit_yuv(buf, src_x, src_y, stride, x, y , width, height);
#else #else
grey_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height); grey_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height);
#endif #endif

View file

@ -192,7 +192,7 @@ static void time_main_yuv(void)
time_start = *rb->current_tick; time_start = *rb->current_tick;
while((time_end = *rb->current_tick) - time_start < DURATION) while((time_end = *rb->current_tick) - time_start < DURATION)
{ {
rb->lcd_yuv_blit(yuvbuf, 0, 0, YUV_WIDTH, rb->lcd_blit_yuv(yuvbuf, 0, 0, YUV_WIDTH,
0, 0, YUV_WIDTH, YUV_HEIGHT); 0, 0, YUV_WIDTH, YUV_HEIGHT);
frame_count++; frame_count++;
} }
@ -208,7 +208,7 @@ static void time_main_yuv(void)
time_start = *rb->current_tick; time_start = *rb->current_tick;
while((time_end = *rb->current_tick) - time_start < DURATION) while((time_end = *rb->current_tick) - time_start < DURATION)
{ {
rb->lcd_yuv_blit(yuvbuf, 0, 0, YUV_WIDTH, rb->lcd_blit_yuv(yuvbuf, 0, 0, YUV_WIDTH,
part14_x, part14_y, part14_w, part14_h); part14_x, part14_y, part14_w, part14_h);
frame_count++; frame_count++;
} }
@ -260,7 +260,7 @@ static void time_remote_update(void)
} }
#endif #endif
#if LCD_DEPTH < 4 #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3)
GREY_INFO_STRUCT_IRAM GREY_INFO_STRUCT_IRAM
static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH]; static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH];
@ -357,7 +357,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
log_text("Main LCD YUV"); log_text("Main LCD YUV");
time_main_yuv(); time_main_yuv();
#endif #endif
#if LCD_DEPTH < 4 #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3)
log_text("Greyscale library"); log_text("Greyscale library");
time_greyscale(); time_greyscale();
#endif #endif

View file

@ -361,13 +361,13 @@ void timer4_isr(void)
height = MIN(LCD_HEIGHT/8-1, height); /* reserve bottom line */ height = MIN(LCD_HEIGHT/8-1, height); /* reserve bottom line */
if (gPlay.bDirtyOSD) if (gPlay.bDirtyOSD)
{ /* OSD to bottom line */ { /* OSD to bottom line */
rb->lcd_blit(gBuf.pOSD, 0, LCD_HEIGHT/8-1, rb->lcd_blit_mono(gBuf.pOSD, 0, LCD_HEIGHT/8-1,
LCD_WIDTH, 1, LCD_WIDTH); LCD_WIDTH, 1, LCD_WIDTH);
gPlay.bDirtyOSD = false; gPlay.bDirtyOSD = false;
} }
} }
rb->lcd_blit(gBuf.pReadVideo, 0, 0, rb->lcd_blit_mono(gBuf.pReadVideo, 0, 0,
gFileHdr.video_width, height, gFileHdr.video_width); gFileHdr.video_width, height, gFileHdr.video_width);
available = Available(gBuf.pReadVideo); available = Available(gBuf.pReadVideo);

View file

@ -134,21 +134,21 @@ extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string,
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
/* performance function */
#if defined(HAVE_LCD_COLOR) #if defined(HAVE_LCD_COLOR)
#define LCD_YUV_DITHER 0x1 #define LCD_YUV_DITHER 0x1
extern void lcd_yuv_set_options(unsigned options); extern void lcd_yuv_set_options(unsigned options);
extern void lcd_yuv_blit(unsigned char * const src[3], extern void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height); int x, int y, int width, int height);
#else #else
extern void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride);
extern void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int bx, int by, int bwidth, int bheight, int bx, int by, int bwidth, int bheight,
int stride); int stride);
#endif #endif
/* performance function */
extern void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride);
/* update a fraction of the screen */ /* update a fraction of the screen */
extern void lcd_update_rect(int x, int y, int width, int height); extern void lcd_update_rect(int x, int y, int width, int height);

View file

@ -174,7 +174,7 @@ extern void lcd_write_yuv420_lines_odither(fb_data *dst,
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
/* For the Gigabeat - show it rotated */ /* For the Gigabeat - show it rotated */
/* So the LCD_WIDTH is now the height */ /* So the LCD_WIDTH is now the height */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {
@ -235,18 +235,6 @@ void lcd_set_invert_display(bool yesno) {
// TODO: // TODO:
} }
void lcd_blit(const fb_data* data, int bx, int y, int bwidth,
int height, int stride)
{
(void) data;
(void) bx;
(void) y;
(void) bwidth;
(void) height;
(void) stride;
//TODO:
}
void lcd_set_flip(bool yesno) { void lcd_set_flip(bool yesno) {
(void) yesno; (void) yesno;
// TODO: // TODO:

View file

@ -109,20 +109,6 @@ void lcd_init_device(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
#define CSUB_X 2 #define CSUB_X 2
#define CSUB_Y 2 #define CSUB_Y 2
@ -155,7 +141,7 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
#define MAX_6BIT 0x3f #define MAX_6BIT 0x3f
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -277,8 +277,8 @@ void lcd_mono_data(const unsigned char *data, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that x, bwidtht and stride are in 8-pixel units! */ note that x, bwidtht and stride are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int bx, int y, int bwidth, void lcd_blit_mono(const unsigned char *data, int bx, int y, int bwidth,
int height, int stride) int height, int stride)
{ {
while (height--) while (height--)
{ {
@ -295,7 +295,7 @@ void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that bx and bwidth are in 8-pixel units! */ note that bx and bwidth are in 8-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int bx, int y, int bwidth, int height, int stride) int bx, int y, int bwidth, int height, int stride)
{ {
while (height--) while (height--)

View file

@ -247,20 +247,6 @@ void lcd_init_device(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
/* Update a fraction of the display. */ /* Update a fraction of the display. */
void lcd_update_rect(int x, int y, int width, int height) void lcd_update_rect(int x, int y, int width, int height)
{ {
@ -319,7 +305,7 @@ extern void lcd_write_yuv420_lines(unsigned char const * const src[3],
int stride); int stride);
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -381,20 +381,6 @@ void lcd_sleep(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
void lcd_yuv_set_options(unsigned options) void lcd_yuv_set_options(unsigned options)
{ {
lcd_yuv_options = options; lcd_yuv_options = options;
@ -411,7 +397,7 @@ extern void lcd_write_yuv420_lines_odither(unsigned char const * const src[3],
int y_screen); int y_screen);
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -112,20 +112,6 @@ void lcd_init_device(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
#define CSUB_X 2 #define CSUB_X 2
#define CSUB_Y 2 #define CSUB_Y 2
@ -141,7 +127,7 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
#define ROUNDOFFSG (63*257) #define ROUNDOFFSG (63*257)
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -118,8 +118,8 @@ void lcd_set_flip(bool yesno)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
/* TODO: Implement lcd_blit() */ /* TODO: Implement lcd_blit() */
(void)data; (void)data;
@ -132,7 +132,7 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */ note that by and bheight are in 4-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
/* TODO: Implement lcd_grey_phase_blit() */ /* TODO: Implement lcd_grey_phase_blit() */

View file

@ -145,8 +145,8 @@ void lcd_init_device(void)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
while (bheight--) while (bheight--)
@ -161,6 +161,20 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
} }
/* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */
void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride)
{
(void)values;
(void)phases;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
/* Update the display. /* Update the display.
This must be called after all other LCD functions that change the display. */ This must be called after all other LCD functions that change the display. */
void lcd_update(void) ICODE_ATTR; void lcd_update(void) ICODE_ATTR;

View file

@ -350,7 +350,7 @@ extern void lcd_write_yuv420_lines_odither(fb_data *dst,
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
/* For the Gigabeat - show it rotated */ /* For the Gigabeat - show it rotated */
/* So the LCD_WIDTH is now the height */ /* So the LCD_WIDTH is now the height */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {
@ -411,18 +411,6 @@ void lcd_set_invert_display(bool yesno) {
// TODO: // TODO:
} }
void lcd_blit(const fb_data* data, int bx, int y, int bwidth,
int height, int stride)
{
(void) data;
(void) bx;
(void) y;
(void) bwidth;
(void) height;
(void) stride;
//TODO:
}
void lcd_set_flip(bool yesno) { void lcd_set_flip(bool yesno) {
(void) yesno; (void) yesno;
// TODO: // TODO:

View file

@ -195,20 +195,6 @@ void lcd_set_flip(bool yesno)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
void lcd_yuv_set_options(unsigned options) void lcd_yuv_set_options(unsigned options)
{ {
lcd_yuv_options = options; lcd_yuv_options = options;
@ -224,7 +210,7 @@ extern void lcd_write_yuv420_lines_odither(unsigned char const * const src[3],
int x_screen, /* To align dither pattern */ int x_screen, /* To align dither pattern */
int y_screen); int y_screen);
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -612,18 +612,6 @@ void lcd_set_flip(bool yesno)
/* Blitting functions */ /* Blitting functions */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
void lcd_yuv_set_options(unsigned options) void lcd_yuv_set_options(unsigned options)
{ {
lcd_yuv_options = options; lcd_yuv_options = options;
@ -643,7 +631,7 @@ extern void lcd_write_yuv420_lines_odither(fb_data *dst,
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
/* For the e200 - show it rotated */ /* For the e200 - show it rotated */
/* So the LCD_WIDTH is now the height */ /* So the LCD_WIDTH is now the height */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -51,22 +51,8 @@ void lcd_init_device(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -190,8 +190,8 @@ void lcd_init_device(void)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
while (bheight--) while (bheight--)
@ -206,6 +206,20 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
} }
/* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */
void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride)
{
(void)values;
(void)phases;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
/* Update the display. /* Update the display.
This must be called after all other LCD functions that change the display. */ This must be called after all other LCD functions that change the display. */
void lcd_update(void) ICODE_ATTR; void lcd_update(void) ICODE_ATTR;

View file

@ -370,18 +370,6 @@ void lcd_set_invert_display(bool yesno)
(void)yesno; (void)yesno;
} }
void lcd_blit(const fb_data* data, int bx, int y, int bwidth,
int height, int stride)
{
// TODO
(void)data;
(void)bx;
(void)y;
(void)bwidth;
(void)height;
(void)stride;
}
void lcd_yuv_set_options(unsigned options) void lcd_yuv_set_options(unsigned options)
{ {
lcd_yuv_options = options; lcd_yuv_options = options;
@ -400,7 +388,7 @@ extern void lcd_write_yuv420_lines_odither(fb_data *dst,
int y_screen); int y_screen);
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -163,7 +163,7 @@ extern void lcd_write_yuv420_lines(fb_data *dst,
/* Performance function to blit a YUV bitmap directly to the LCD */ /* Performance function to blit a YUV bitmap directly to the LCD */
/* For the Gigabeat - show it rotated */ /* For the Gigabeat - show it rotated */
/* So the LCD_WIDTH is now the height */ /* So the LCD_WIDTH is now the height */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {
@ -210,18 +210,6 @@ void lcd_set_invert_display(bool yesno) {
// TODO: // TODO:
} }
void lcd_blit(const fb_data* data, int bx, int y, int bwidth,
int height, int stride)
{
(void) data;
(void) bx;
(void) y;
(void) bwidth;
(void) height;
(void) stride;
//TODO:
}
void lcd_set_flip(bool yesno) { void lcd_set_flip(bool yesno) {
(void) yesno; (void) yesno;
// TODO: // TODO:

View file

@ -289,6 +289,35 @@ void lcd_write_data(const fb_data *p_words, int count)
CS_HI; CS_HI;
} }
static void lcd_mono_data(const unsigned char *p_words, int count)
{
unsigned data;
const unsigned char *p_bytes = p_words;
const unsigned char *p_end = p_words + count;
RS_HI;
CS_LO;
if (cpu_frequency < 50000000)
{
while (p_bytes < p_end)
{
data = *p_bytes++;
_write_fast(data);
_write_fast(data);
}
}
else
{
while (p_bytes < p_end)
{
data = *p_bytes++;
_write_byte(data);
_write_byte(data);
}
}
CS_HI;
}
int lcd_default_contrast(void) int lcd_default_contrast(void)
{ {
return DEFAULT_CONTRAST_SETTING; return DEFAULT_CONTRAST_SETTING;
@ -341,7 +370,7 @@ void lcd_on(void)
lcd_write_command_e(LCD_SET_GRAY | 6, 0xcc); lcd_write_command_e(LCD_SET_GRAY | 6, 0xcc);
lcd_write_command_e(LCD_SET_GRAY | 7, 0x0c); lcd_write_command_e(LCD_SET_GRAY | 7, 0x0c);
lcd_write_command(LCD_SET_PWM_FRC | 6); /* 4FRC + 12PWM */ lcd_write_command(LCD_SET_PWM_FRC | 6); /* 3FRC + 12PWM */
lcd_write_command(LCD_DISPLAY_ON | 1); /* display on */ lcd_write_command(LCD_DISPLAY_ON | 1); /* display on */
@ -428,24 +457,31 @@ void lcd_init_device(void)
#endif #endif
} }
/* TODO: implement blit functions */
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const fb_data *data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
(void)data; if (initialized)
(void)x; {
(void)by; /* COM48-COM63 are not connected, so we need to skip those */
(void)width; while (bheight--)
(void)bheight; {
(void)stride; lcd_write_command(LCD_SET_PAGE | ((by > 5 ? by + 2 : by) & 0xf));
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
lcd_mono_data(data, width);
data += stride;
by++;
}
}
} }
/* TODO: implement grey blit function */
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
(void)values; (void)values;
@ -463,7 +499,8 @@ void lcd_update(void) ICODE_ATTR;
void lcd_update(void) void lcd_update(void)
{ {
int y; int y;
if(initialized) { if (initialized)
{
for(y = 0;y < LCD_FBHEIGHT;y++) { for(y = 0;y < LCD_FBHEIGHT;y++) {
/* Copy display bitmap to hardware. /* Copy display bitmap to hardware.
The COM48-COM63 lines are not connected so we have to skip The COM48-COM63 lines are not connected so we have to skip
@ -480,7 +517,8 @@ void lcd_update(void)
void lcd_update_rect(int, int, int, int) ICODE_ATTR; void lcd_update_rect(int, int, int, int) ICODE_ATTR;
void lcd_update_rect(int x, int y, int width, int height) void lcd_update_rect(int x, int y, int width, int height)
{ {
if(initialized) { if (initialized)
{
int ymax; int ymax;
/* The Y coordinates have to work on even 8 pixel rows */ /* The Y coordinates have to work on even 8 pixel rows */

View file

@ -131,8 +131,8 @@ void lcd_init_device(void)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
const unsigned char *src, *src_end; const unsigned char *src, *src_end;
unsigned char *dst_u, *dst_l; unsigned char *dst_u, *dst_l;
@ -176,7 +176,7 @@ void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */ note that by and bheight are in 4-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
stride <<= 2; /* 4 pixels per block */ stride <<= 2; /* 4 pixels per block */

View file

@ -407,21 +407,6 @@ void lcd_sleep(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
/*if(display_on)*/
}
/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. /* Line write helper function for lcd_yuv_blit. Write two lines of yuv420.
* y should have two lines of Y back to back, 2nd line first. * y should have two lines of Y back to back, 2nd line first.
* c should contain the Cb and Cr data for the two lines of Y back to back. * c should contain the Cb and Cr data for the two lines of Y back to back.
@ -434,7 +419,7 @@ extern void lcd_write_yuv420_lines(const unsigned char *y,
* src_x, src_y, width and height should be even and within the LCD's * src_x, src_y, width and height should be even and within the LCD's
* boundaries. * boundaries.
*/ */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -140,8 +140,8 @@ void lcd_init_device(void)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
const unsigned char *src, *src_end; const unsigned char *src, *src_end;
unsigned char *dst_u, *dst_l; unsigned char *dst_u, *dst_l;
@ -185,7 +185,7 @@ void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 4-pixel units! */ note that by and bheight are in 4-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
stride <<= 2; /* 4 pixels per block */ stride <<= 2; /* 4 pixels per block */

View file

@ -294,21 +294,6 @@ bool lcd_enabled(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */
void lcd_blit(const fb_data* data, int x, int by, int width,
int bheight, int stride)
{
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
/*if(display_on)*/
}
/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. /* Line write helper function for lcd_yuv_blit. Write two lines of yuv420.
* y should have two lines of Y back to back, 2nd line first. * y should have two lines of Y back to back, 2nd line first.
* c should contain the Cb and Cr data for the two lines of Y back to back. * c should contain the Cb and Cr data for the two lines of Y back to back.
@ -321,7 +306,7 @@ extern void lcd_write_yuv420_lines(const unsigned char *y,
* src_x, src_y, width and height should be even * src_x, src_y, width and height should be even
* x, y, width and height have to be within LCD bounds * x, y, width and height have to be within LCD bounds
*/ */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {

View file

@ -140,8 +140,8 @@ void lcd_init_device(void)
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
while (bheight--) while (bheight--)
@ -160,7 +160,7 @@ void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
stride <<= 3; /* 8 pixels per block */ stride <<= 3; /* 8 pixels per block */

View file

@ -24,8 +24,8 @@
#include "lcd.h" #include "lcd.h"
#include "lcd-sdl.h" #include "lcd-sdl.h"
void lcd_blit(const fb_data* p_data, int x, int y, int width, int height, void lcd_blit_mono(const unsigned char *data, int x, int y, int width, int height,
int stride) int stride)
{ {
(void)p_data; (void)p_data;
(void)x; (void)x;

View file

@ -193,9 +193,9 @@ void lcd_yuv_set_options(unsigned options)
(void)options; (void)options;
} }
/* Draw a partial YUV colour bitmap - similiar behavior to lcd_yuv_blit /* Draw a partial YUV colour bitmap - similiar behavior to lcd_blit_yuv
in the core */ in the core */
void lcd_yuv_blit(unsigned char * const src[3], void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride, int src_x, int src_y, int stride,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {