diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugin.c | 130 | ||||
-rw-r--r-- | apps/plugin.h | 170 | ||||
-rw-r--r-- | apps/plugins/chip8.c | 7 | ||||
-rw-r--r-- | apps/plugins/lib/grey_core.c | 6 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 2 | ||||
-rw-r--r-- | apps/plugins/test_fps.c | 8 | ||||
-rw-r--r-- | apps/plugins/video.c | 4 |
7 files changed, 151 insertions, 176 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 6862ddb08e..15a7e9127f 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -74,6 +74,7 @@ static const struct plugin_api rockbox_api = { | |||
74 | /* lcd */ | 74 | /* lcd */ |
75 | lcd_set_contrast, | 75 | lcd_set_contrast, |
76 | lcd_update, | 76 | lcd_update, |
77 | lcd_update_rect, | ||
77 | lcd_clear_display, | 78 | lcd_clear_display, |
78 | lcd_setmargins, | 79 | lcd_setmargins, |
79 | lcd_getstringsize, | 80 | lcd_getstringsize, |
@@ -91,6 +92,7 @@ static const struct plugin_api rockbox_api = { | |||
91 | lcd_icon, | 92 | lcd_icon, |
92 | lcd_double_height, | 93 | lcd_double_height, |
93 | #else | 94 | #else |
95 | &lcd_framebuffer[0][0], | ||
94 | lcd_set_drawmode, | 96 | lcd_set_drawmode, |
95 | lcd_get_drawmode, | 97 | lcd_get_drawmode, |
96 | lcd_setfont, | 98 | lcd_setfont, |
@@ -115,21 +117,27 @@ static const struct plugin_api rockbox_api = { | |||
115 | #if LCD_DEPTH == 16 | 117 | #if LCD_DEPTH == 16 |
116 | lcd_bitmap_transparent_part, | 118 | lcd_bitmap_transparent_part, |
117 | lcd_bitmap_transparent, | 119 | lcd_bitmap_transparent, |
120 | lcd_blit_yuv, | ||
121 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ | ||
122 | || defined (IRIVER_H10) | ||
123 | lcd_yuv_set_options, | ||
118 | #endif | 124 | #endif |
125 | #elif (LCD_DEPTH < 4) || !defined(SIMULATOR) | ||
126 | lcd_blit_mono, | ||
127 | lcd_blit_grey_phase, | ||
128 | #endif /* LCD_DEPTH */ | ||
129 | lcd_puts_style, | ||
130 | lcd_puts_scroll_style, | ||
119 | bidi_l2v, | 131 | bidi_l2v, |
120 | font_get_bits, | 132 | font_get_bits, |
121 | font_load, | 133 | font_load, |
122 | lcd_puts_style, | ||
123 | lcd_puts_scroll_style, | ||
124 | &lcd_framebuffer[0][0], | ||
125 | lcd_blit, | ||
126 | lcd_update_rect, | ||
127 | gui_scrollbar_draw, | ||
128 | font_get, | 134 | font_get, |
129 | font_getstringsize, | 135 | font_getstringsize, |
130 | font_get_width, | 136 | font_get_width, |
131 | screen_clear_area, | 137 | screen_clear_area, |
138 | gui_scrollbar_draw, | ||
132 | #endif | 139 | #endif |
140 | |||
133 | backlight_on, | 141 | backlight_on, |
134 | backlight_off, | 142 | backlight_off, |
135 | backlight_set_timeout, | 143 | backlight_set_timeout, |
@@ -137,6 +145,7 @@ static const struct plugin_api rockbox_api = { | |||
137 | backlight_set_timeout_plugged, | 145 | backlight_set_timeout_plugged, |
138 | #endif | 146 | #endif |
139 | gui_syncsplash, | 147 | gui_syncsplash, |
148 | |||
140 | #ifdef HAVE_REMOTE_LCD | 149 | #ifdef HAVE_REMOTE_LCD |
141 | /* remote lcd */ | 150 | /* remote lcd */ |
142 | lcd_remote_set_contrast, | 151 | lcd_remote_set_contrast, |
@@ -166,7 +175,11 @@ static const struct plugin_api rockbox_api = { | |||
166 | 175 | ||
167 | remote_backlight_on, | 176 | remote_backlight_on, |
168 | remote_backlight_off, | 177 | remote_backlight_off, |
178 | remote_backlight_set_timeout, | ||
179 | #if CONFIG_CHARGING | ||
180 | remote_backlight_set_timeout_plugged, | ||
169 | #endif | 181 | #endif |
182 | #endif /* HAVE_REMOTE_LCD */ | ||
170 | #if NB_SCREENS == 2 | 183 | #if NB_SCREENS == 2 |
171 | {&screens[SCREEN_MAIN], &screens[SCREEN_REMOTE]}, | 184 | {&screens[SCREEN_MAIN], &screens[SCREEN_REMOTE]}, |
172 | #else | 185 | #else |
@@ -181,16 +194,6 @@ static const struct plugin_api rockbox_api = { | |||
181 | lcd_remote_bitmap, | 194 | lcd_remote_bitmap, |
182 | #endif | 195 | #endif |
183 | 196 | ||
184 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && !defined(SIMULATOR) | ||
185 | lcd_grey_phase_blit, | ||
186 | #endif | ||
187 | #if defined(HAVE_LCD_COLOR) | ||
188 | lcd_yuv_blit, | ||
189 | #endif | ||
190 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ | ||
191 | || defined (IRIVER_H10) | ||
192 | lcd_yuv_set_options, | ||
193 | #endif | ||
194 | /* list */ | 197 | /* list */ |
195 | gui_synclist_init, | 198 | gui_synclist_init, |
196 | gui_synclist_set_nb_items, | 199 | gui_synclist_set_nb_items, |
@@ -233,9 +236,11 @@ static const struct plugin_api rockbox_api = { | |||
233 | ata_sleep, | 236 | ata_sleep, |
234 | ata_disk_is_active, | 237 | ata_disk_is_active, |
235 | #endif | 238 | #endif |
239 | ata_spin, | ||
236 | ata_spindown, | 240 | ata_spindown, |
237 | reload_directory, | 241 | reload_directory, |
238 | create_numbered_filename, | 242 | create_numbered_filename, |
243 | file_exists, | ||
239 | 244 | ||
240 | /* dir */ | 245 | /* dir */ |
241 | opendir, | 246 | opendir, |
@@ -243,6 +248,7 @@ static const struct plugin_api rockbox_api = { | |||
243 | readdir, | 248 | readdir, |
244 | mkdir, | 249 | mkdir, |
245 | rmdir, | 250 | rmdir, |
251 | dir_exists, | ||
246 | 252 | ||
247 | /* kernel/ system */ | 253 | /* kernel/ system */ |
248 | PREFIX(sleep), | 254 | PREFIX(sleep), |
@@ -256,6 +262,14 @@ static const struct plugin_api rockbox_api = { | |||
256 | threads, | 262 | threads, |
257 | create_thread, | 263 | create_thread, |
258 | remove_thread, | 264 | remove_thread, |
265 | thread_wait, | ||
266 | #if (CONFIG_CODEC == SWCODEC) | ||
267 | mutex_init, | ||
268 | mutex_lock, | ||
269 | mutex_unlock, | ||
270 | align_buffer, | ||
271 | #endif | ||
272 | |||
259 | reset_poweroff_timer, | 273 | reset_poweroff_timer, |
260 | #ifndef SIMULATOR | 274 | #ifndef SIMULATOR |
261 | system_memory_guard, | 275 | system_memory_guard, |
@@ -267,7 +281,15 @@ static const struct plugin_api rockbox_api = { | |||
267 | #else | 281 | #else |
268 | cpu_boost, | 282 | cpu_boost, |
269 | #endif | 283 | #endif |
284 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | ||
285 | #endif /* !SIMULATOR */ | ||
286 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | ||
287 | trigger_cpu_boost, | ||
288 | cancel_cpu_boost, | ||
270 | #endif | 289 | #endif |
290 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
291 | flush_icache, | ||
292 | invalidate_icache, | ||
271 | #endif | 293 | #endif |
272 | timer_register, | 294 | timer_register, |
273 | timer_unregister, | 295 | timer_unregister, |
@@ -277,6 +299,13 @@ static const struct plugin_api rockbox_api = { | |||
277 | queue_delete, | 299 | queue_delete, |
278 | queue_post, | 300 | queue_post, |
279 | queue_wait_w_tmo, | 301 | queue_wait_w_tmo, |
302 | #if CONFIG_CODEC == SWCODEC | ||
303 | queue_enable_queue_send, | ||
304 | queue_empty, | ||
305 | queue_wait, | ||
306 | queue_send, | ||
307 | queue_reply, | ||
308 | #endif | ||
280 | usb_acknowledge, | 309 | usb_acknowledge, |
281 | #ifdef RB_PROFILE | 310 | #ifdef RB_PROFILE |
282 | profile_thread, | 311 | profile_thread, |
@@ -325,13 +354,12 @@ static const struct plugin_api rockbox_api = { | |||
325 | utf8seek, | 354 | utf8seek, |
326 | 355 | ||
327 | /* sound */ | 356 | /* sound */ |
328 | #if CONFIG_CODEC == SWCODEC | ||
329 | sound_default, | ||
330 | #endif | ||
331 | sound_set, | 357 | sound_set, |
332 | 358 | sound_default, | |
333 | sound_min, | 359 | sound_min, |
334 | sound_max, | 360 | sound_max, |
361 | sound_unit, | ||
362 | sound_val2phys, | ||
335 | #ifndef SIMULATOR | 363 | #ifndef SIMULATOR |
336 | mp3_play_data, | 364 | mp3_play_data, |
337 | mp3_play_pause, | 365 | mp3_play_pause, |
@@ -353,6 +381,8 @@ static const struct plugin_api rockbox_api = { | |||
353 | pcm_play_pause, | 381 | pcm_play_pause, |
354 | pcm_get_bytes_waiting, | 382 | pcm_get_bytes_waiting, |
355 | pcm_calculate_peaks, | 383 | pcm_calculate_peaks, |
384 | pcm_play_lock, | ||
385 | pcm_play_unlock, | ||
356 | #ifdef HAVE_RECORDING | 386 | #ifdef HAVE_RECORDING |
357 | &rec_freq_sampr[0], | 387 | &rec_freq_sampr[0], |
358 | pcm_init_recording, | 388 | pcm_init_recording, |
@@ -367,6 +397,11 @@ static const struct plugin_api rockbox_api = { | |||
367 | audio_set_output_source, | 397 | audio_set_output_source, |
368 | audio_set_input_source, | 398 | audio_set_input_source, |
369 | #endif | 399 | #endif |
400 | dsp_set_crossfeed, | ||
401 | dsp_set_eq, | ||
402 | dsp_dither_enable, | ||
403 | dsp_configure, | ||
404 | dsp_process, | ||
370 | #endif /* CONFIG_CODEC == SWCODEC */ | 405 | #endif /* CONFIG_CODEC == SWCODEC */ |
371 | 406 | ||
372 | /* playback control */ | 407 | /* playback control */ |
@@ -508,35 +543,6 @@ static const struct plugin_api rockbox_api = { | |||
508 | detect_flashed_romimage, | 543 | detect_flashed_romimage, |
509 | #endif | 544 | #endif |
510 | led, | 545 | led, |
511 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
512 | flush_icache, | ||
513 | invalidate_icache, | ||
514 | #endif | ||
515 | /* new stuff at the end, sort into place next time | ||
516 | the API gets incompatible */ | ||
517 | |||
518 | #if (CONFIG_CODEC == SWCODEC) | ||
519 | mutex_init, | ||
520 | mutex_lock, | ||
521 | mutex_unlock, | ||
522 | #endif | ||
523 | |||
524 | thread_wait, | ||
525 | |||
526 | #if (CONFIG_CODEC == SWCODEC) | ||
527 | align_buffer, | ||
528 | #endif | ||
529 | |||
530 | file_exists, | ||
531 | dir_exists, | ||
532 | |||
533 | #ifdef HAVE_REMOTE_LCD | ||
534 | remote_backlight_set_timeout, | ||
535 | #if CONFIG_CHARGING | ||
536 | remote_backlight_set_timeout_plugged, | ||
537 | #endif | ||
538 | #endif /* HAVE_REMOTE_LCD */ | ||
539 | |||
540 | #if (CONFIG_CODEC == SWCODEC) | 546 | #if (CONFIG_CODEC == SWCODEC) |
541 | bufopen, | 547 | bufopen, |
542 | bufalloc, | 548 | bufalloc, |
@@ -569,29 +575,9 @@ static const struct plugin_api rockbox_api = { | |||
569 | search_albumart_files, | 575 | search_albumart_files, |
570 | #endif | 576 | #endif |
571 | 577 | ||
572 | #if CONFIG_CODEC == SWCODEC | 578 | /* new stuff at the end, sort into place next time |
573 | pcm_play_lock, | 579 | the API gets incompatible */ |
574 | pcm_play_unlock, | 580 | |
575 | queue_enable_queue_send, | ||
576 | queue_empty, | ||
577 | queue_wait, | ||
578 | queue_send, | ||
579 | queue_reply, | ||
580 | #ifndef HAVE_FLASH_STORAGE | ||
581 | ata_spin, | ||
582 | #endif | ||
583 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | ||
584 | trigger_cpu_boost, | ||
585 | cancel_cpu_boost, | ||
586 | #endif | ||
587 | sound_unit, | ||
588 | sound_val2phys, | ||
589 | dsp_set_crossfeed, | ||
590 | dsp_set_eq, | ||
591 | dsp_dither_enable, | ||
592 | dsp_configure, | ||
593 | dsp_process, | ||
594 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
595 | }; | 581 | }; |
596 | 582 | ||
597 | int plugin_load(const char* plugin, void* parameter) | 583 | int plugin_load(const char* plugin, void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index 164a2c9847..30c04ce76c 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -119,12 +119,12 @@ | |||
119 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 119 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
120 | 120 | ||
121 | /* increase this every time the api struct changes */ | 121 | /* increase this every time the api struct changes */ |
122 | #define PLUGIN_API_VERSION 99 | 122 | #define PLUGIN_API_VERSION 100 |
123 | 123 | ||
124 | /* update this to latest version if a change to the api struct breaks | 124 | /* update this to latest version if a change to the api struct breaks |
125 | backwards compatibility (and please take the opportunity to sort in any | 125 | backwards compatibility (and please take the opportunity to sort in any |
126 | new function which are "waiting" at the end of the function table) */ | 126 | new function which are "waiting" at the end of the function table) */ |
127 | #define PLUGIN_MIN_API_VERSION 98 | 127 | #define PLUGIN_MIN_API_VERSION 100 |
128 | 128 | ||
129 | /* plugin return codes */ | 129 | /* plugin return codes */ |
130 | enum plugin_status { | 130 | enum plugin_status { |
@@ -144,6 +144,7 @@ struct plugin_api { | |||
144 | /* lcd */ | 144 | /* lcd */ |
145 | void (*lcd_set_contrast)(int x); | 145 | void (*lcd_set_contrast)(int x); |
146 | void (*lcd_update)(void); | 146 | void (*lcd_update)(void); |
147 | void (*lcd_update_rect)(int x, int y, int width, int height); | ||
147 | void (*lcd_clear_display)(void); | 148 | void (*lcd_clear_display)(void); |
148 | void (*lcd_setmargins)(int x, int y); | 149 | void (*lcd_setmargins)(int x, int y); |
149 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); | 150 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); |
@@ -160,7 +161,8 @@ struct plugin_api { | |||
160 | void (*lcd_remove_cursor)(void); | 161 | void (*lcd_remove_cursor)(void); |
161 | void (*lcd_icon)(int icon, bool enable); | 162 | void (*lcd_icon)(int icon, bool enable); |
162 | void (*lcd_double_height)(bool on); | 163 | void (*lcd_double_height)(bool on); |
163 | #else | 164 | #else /* HAVE_LCD_BITMAP */ |
165 | fb_data* lcd_framebuffer; | ||
164 | void (*lcd_set_drawmode)(int mode); | 166 | void (*lcd_set_drawmode)(int mode); |
165 | int (*lcd_get_drawmode)(void); | 167 | int (*lcd_get_drawmode)(void); |
166 | void (*lcd_setfont)(int font); | 168 | void (*lcd_setfont)(int font); |
@@ -192,28 +194,40 @@ struct plugin_api { | |||
192 | int x, int y, int width, int height); | 194 | int x, int y, int width, int height); |
193 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, | 195 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, |
194 | int width, int height); | 196 | int width, int height); |
197 | void (*lcd_blit_yuv)(unsigned char * const src[3], | ||
198 | int src_x, int src_y, int stride, | ||
199 | int x, int y, int width, int height); | ||
200 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ | ||
201 | || defined (IRIVER_H10) | ||
202 | void (*lcd_yuv_set_options)(unsigned options); | ||
195 | #endif | 203 | #endif |
196 | unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); | 204 | #elif (LCD_DEPTH < 4) || !defined(SIMULATOR) |
197 | const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); | 205 | void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, |
198 | struct font* (*font_load)(const char *path); | 206 | int bheight, int stride); |
207 | void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases, | ||
208 | int bx, int by, int bwidth, int bheight, | ||
209 | int stride); | ||
210 | #endif /* LCD_DEPTH */ | ||
199 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); | 211 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); |
200 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, | 212 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, |
201 | int style); | 213 | int style); |
202 | fb_data* lcd_framebuffer; | 214 | |
203 | void (*lcd_blit) (const fb_data* data, int x, int by, int width, | 215 | unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); |
204 | int bheight, int stride); | 216 | const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); |
205 | void (*lcd_update_rect)(int x, int y, int width, int height); | 217 | struct font* (*font_load)(const char *path); |
206 | void (*gui_scrollbar_draw)(struct screen * screen, int x, int y, | ||
207 | int width, int height, int items, | ||
208 | int min_shown, int max_shown, | ||
209 | unsigned flags); | ||
210 | struct font* (*font_get)(int font); | 218 | struct font* (*font_get)(int font); |
211 | int (*font_getstringsize)(const unsigned char *str, int *w, int *h, | 219 | int (*font_getstringsize)(const unsigned char *str, int *w, int *h, |
212 | int fontnumber); | 220 | int fontnumber); |
213 | int (*font_get_width)(struct font* pf, unsigned short char_code); | 221 | int (*font_get_width)(struct font* pf, unsigned short char_code); |
214 | void (*screen_clear_area)(struct screen * display, int xstart, int ystart, | 222 | void (*screen_clear_area)(struct screen * display, int xstart, int ystart, |
215 | int width, int height); | 223 | int width, int height); |
216 | #endif | 224 | void (*gui_scrollbar_draw)(struct screen * screen, int x, int y, |
225 | int width, int height, int items, | ||
226 | int min_shown, int max_shown, | ||
227 | unsigned flags); | ||
228 | #endif /* HAVE_LCD_BITMAP */ | ||
229 | |||
230 | /* backlight */ | ||
217 | void (*backlight_on)(void); | 231 | void (*backlight_on)(void); |
218 | void (*backlight_off)(void); | 232 | void (*backlight_off)(void); |
219 | void (*backlight_set_timeout)(int index); | 233 | void (*backlight_set_timeout)(int index); |
@@ -255,7 +269,11 @@ struct plugin_api { | |||
255 | 269 | ||
256 | void (*remote_backlight_on)(void); | 270 | void (*remote_backlight_on)(void); |
257 | void (*remote_backlight_off)(void); | 271 | void (*remote_backlight_off)(void); |
272 | void (*remote_backlight_set_timeout)(int index); | ||
273 | #if CONFIG_CHARGING | ||
274 | void (*remote_backlight_set_timeout_plugged)(int index); | ||
258 | #endif | 275 | #endif |
276 | #endif /* HAVE_REMOTE_LCD */ | ||
259 | struct screen* screens[NB_SCREENS]; | 277 | struct screen* screens[NB_SCREENS]; |
260 | #if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) | 278 | #if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) |
261 | void (*lcd_remote_set_foreground)(unsigned foreground); | 279 | void (*lcd_remote_set_foreground)(unsigned foreground); |
@@ -267,22 +285,6 @@ struct plugin_api { | |||
267 | void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, | 285 | void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, |
268 | int height); | 286 | int height); |
269 | #endif | 287 | #endif |
270 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && !defined(SIMULATOR) | ||
271 | void (*lcd_grey_phase_blit)(unsigned char *values, unsigned char *phases, | ||
272 | int bx, int by, int bwidth, int bheight, | ||
273 | int stride); | ||
274 | #endif | ||
275 | #if defined(HAVE_LCD_COLOR) | ||
276 | void (*lcd_yuv_blit)(unsigned char * const src[3], | ||
277 | int src_x, int src_y, int stride, | ||
278 | int x, int y, int width, int height); | ||
279 | #endif | ||
280 | |||
281 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ | ||
282 | || defined (IRIVER_H10) | ||
283 | void (*lcd_yuv_set_options)(unsigned options); | ||
284 | #endif | ||
285 | |||
286 | /* list */ | 288 | /* list */ |
287 | void (*gui_synclist_init)(struct gui_synclist * lists, | 289 | void (*gui_synclist_init)(struct gui_synclist * lists, |
288 | list_get_name callback_get_item_name,void * data, | 290 | list_get_name callback_get_item_name,void * data, |
@@ -329,11 +331,14 @@ struct plugin_api { | |||
329 | void (*ata_sleep)(void); | 331 | void (*ata_sleep)(void); |
330 | bool (*ata_disk_is_active)(void); | 332 | bool (*ata_disk_is_active)(void); |
331 | #endif | 333 | #endif |
334 | void (*ata_spin)(void); | ||
332 | void (*ata_spindown)(int seconds); | 335 | void (*ata_spindown)(int seconds); |
333 | void (*reload_directory)(void); | 336 | void (*reload_directory)(void); |
334 | char *(*create_numbered_filename)(char *buffer, const char *path, | 337 | char *(*create_numbered_filename)(char *buffer, const char *path, |
335 | const char *prefix, const char *suffix, | 338 | const char *prefix, const char *suffix, |
336 | int numberlen IF_CNFN_NUM_(, int *num)); | 339 | int numberlen IF_CNFN_NUM_(, int *num)); |
340 | bool (*file_exists)(const char *file); | ||
341 | |||
337 | 342 | ||
338 | /* dir */ | 343 | /* dir */ |
339 | DIR* (*opendir)(const char* name); | 344 | DIR* (*opendir)(const char* name); |
@@ -341,6 +346,7 @@ struct plugin_api { | |||
341 | struct dirent* (*readdir)(DIR* dir); | 346 | struct dirent* (*readdir)(DIR* dir); |
342 | int (*mkdir)(const char *name); | 347 | int (*mkdir)(const char *name); |
343 | int (*rmdir)(const char *name); | 348 | int (*rmdir)(const char *name); |
349 | bool (*dir_exists)(const char *path); | ||
344 | 350 | ||
345 | /* kernel/ system */ | 351 | /* kernel/ system */ |
346 | void (*PREFIX(sleep))(int ticks); | 352 | void (*PREFIX(sleep))(int ticks); |
@@ -358,6 +364,14 @@ struct plugin_api { | |||
358 | IF_PRIO(, int priority) | 364 | IF_PRIO(, int priority) |
359 | IF_COP(, unsigned int core)); | 365 | IF_COP(, unsigned int core)); |
360 | void (*remove_thread)(struct thread_entry *thread); | 366 | void (*remove_thread)(struct thread_entry *thread); |
367 | void (*thread_wait)(struct thread_entry *thread); | ||
368 | #if CONFIG_CODEC == SWCODEC | ||
369 | void (*mutex_init)(struct mutex *m); | ||
370 | void (*mutex_lock)(struct mutex *m); | ||
371 | void (*mutex_unlock)(struct mutex *m); | ||
372 | size_t (*align_buffer)(void **start, size_t size, size_t align); | ||
373 | #endif | ||
374 | |||
361 | void (*reset_poweroff_timer)(void); | 375 | void (*reset_poweroff_timer)(void); |
362 | #ifndef SIMULATOR | 376 | #ifndef SIMULATOR |
363 | int (*system_memory_guard)(int newmode); | 377 | int (*system_memory_guard)(int newmode); |
@@ -368,7 +382,15 @@ struct plugin_api { | |||
368 | #else | 382 | #else |
369 | void (*cpu_boost)(bool on_off); | 383 | void (*cpu_boost)(bool on_off); |
370 | #endif | 384 | #endif |
385 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | ||
386 | #endif /* !SIMULATOR */ | ||
387 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | ||
388 | void (*trigger_cpu_boost)(void); | ||
389 | void (*cancel_cpu_boost)(void); | ||
371 | #endif | 390 | #endif |
391 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
392 | void (*flush_icache)(void); | ||
393 | void (*invalidate_icache)(void); | ||
372 | #endif | 394 | #endif |
373 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), | 395 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), |
374 | long cycles, int int_prio, | 396 | long cycles, int int_prio, |
@@ -381,6 +403,16 @@ struct plugin_api { | |||
381 | void (*queue_post)(struct event_queue *q, long id, intptr_t data); | 403 | void (*queue_post)(struct event_queue *q, long id, intptr_t data); |
382 | void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, | 404 | void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, |
383 | int ticks); | 405 | int ticks); |
406 | #if CONFIG_CODEC == SWCODEC | ||
407 | void (*queue_enable_queue_send)(struct event_queue *q, | ||
408 | struct queue_sender_list *send); | ||
409 | bool (*queue_empty)(const struct event_queue *q); | ||
410 | void (*queue_wait)(struct event_queue *q, struct queue_event *ev); | ||
411 | intptr_t (*queue_send)(struct event_queue *q, long id, | ||
412 | intptr_t data); | ||
413 | void (*queue_reply)(struct event_queue *q, intptr_t retval); | ||
414 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
415 | |||
384 | void (*usb_acknowledge)(long id); | 416 | void (*usb_acknowledge)(long id); |
385 | #ifdef RB_PROFILE | 417 | #ifdef RB_PROFILE |
386 | void (*profile_thread)(void); | 418 | void (*profile_thread)(void); |
@@ -430,12 +462,12 @@ struct plugin_api { | |||
430 | int (*utf8seek)(const unsigned char* utf8, int offset); | 462 | int (*utf8seek)(const unsigned char* utf8, int offset); |
431 | 463 | ||
432 | /* sound */ | 464 | /* sound */ |
433 | #if CONFIG_CODEC == SWCODEC | ||
434 | int (*sound_default)(int setting); | ||
435 | #endif | ||
436 | void (*sound_set)(int setting, int value); | 465 | void (*sound_set)(int setting, int value); |
466 | int (*sound_default)(int setting); | ||
437 | int (*sound_min)(int setting); | 467 | int (*sound_min)(int setting); |
438 | int (*sound_max)(int setting); | 468 | int (*sound_max)(int setting); |
469 | const char * (*sound_unit)(int setting); | ||
470 | int (*sound_val2phys)(int setting, int value); | ||
439 | #ifndef SIMULATOR | 471 | #ifndef SIMULATOR |
440 | void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size)); | 472 | void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size)); |
441 | void (*mp3_play_pause)(bool play); | 473 | void (*mp3_play_pause)(bool play); |
@@ -458,6 +490,8 @@ struct plugin_api { | |||
458 | void (*pcm_play_pause)(bool play); | 490 | void (*pcm_play_pause)(bool play); |
459 | size_t (*pcm_get_bytes_waiting)(void); | 491 | size_t (*pcm_get_bytes_waiting)(void); |
460 | void (*pcm_calculate_peaks)(int *left, int *right); | 492 | void (*pcm_calculate_peaks)(int *left, int *right); |
493 | void (*pcm_play_lock)(void); | ||
494 | void (*pcm_play_unlock)(void); | ||
461 | #ifdef HAVE_RECORDING | 495 | #ifdef HAVE_RECORDING |
462 | const unsigned long *rec_freq_sampr; | 496 | const unsigned long *rec_freq_sampr; |
463 | void (*pcm_init_recording)(void); | 497 | void (*pcm_init_recording)(void); |
@@ -473,6 +507,13 @@ struct plugin_api { | |||
473 | void (*audio_set_output_source)(int monitor); | 507 | void (*audio_set_output_source)(int monitor); |
474 | void (*audio_set_input_source)(int source, unsigned flags); | 508 | void (*audio_set_input_source)(int source, unsigned flags); |
475 | #endif | 509 | #endif |
510 | void (*dsp_set_crossfeed)(bool enable); | ||
511 | void (*dsp_set_eq)(bool enable); | ||
512 | void (*dsp_dither_enable)(bool enable); | ||
513 | intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting, | ||
514 | intptr_t value); | ||
515 | int (*dsp_process)(struct dsp_config *dsp, char *dest, | ||
516 | const char *src[], int count); | ||
476 | #endif /* CONFIG_CODEC == SWCODC */ | 517 | #endif /* CONFIG_CODEC == SWCODC */ |
477 | 518 | ||
478 | /* playback control */ | 519 | /* playback control */ |
@@ -638,37 +679,8 @@ struct plugin_api { | |||
638 | 679 | ||
639 | void (*led)(bool on); | 680 | void (*led)(bool on); |
640 | 681 | ||
641 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
642 | void (*flush_icache)(void); | ||
643 | void (*invalidate_icache)(void); | ||
644 | #endif | ||
645 | |||
646 | /* new stuff at the end, sort into place next time | ||
647 | the API gets incompatible */ | ||
648 | |||
649 | #if (CONFIG_CODEC == SWCODEC) | ||
650 | void (*mutex_init)(struct mutex *m); | ||
651 | void (*mutex_lock)(struct mutex *m); | ||
652 | void (*mutex_unlock)(struct mutex *m); | ||
653 | #endif | ||
654 | |||
655 | void (*thread_wait)(struct thread_entry *thread); | ||
656 | |||
657 | #if (CONFIG_CODEC == SWCODEC) | ||
658 | size_t (*align_buffer)(void **start, size_t size, size_t align); | ||
659 | #endif | ||
660 | |||
661 | bool (*file_exists)(const char *file); | ||
662 | bool (*dir_exists)(const char *path); | ||
663 | |||
664 | #ifdef HAVE_REMOTE_LCD | ||
665 | void (*remote_backlight_set_timeout)(int index); | ||
666 | #if CONFIG_CHARGING | ||
667 | void (*remote_backlight_set_timeout_plugged)(int index); | ||
668 | #endif | ||
669 | #endif /* HAVE_REMOTE_LCD */ | ||
670 | |||
671 | #if (CONFIG_CODEC == SWCODEC) | 682 | #if (CONFIG_CODEC == SWCODEC) |
683 | /* buffering API */ | ||
672 | int (*bufopen)(const char *file, size_t offset, enum data_type type); | 684 | int (*bufopen)(const char *file, size_t offset, enum data_type type); |
673 | int (*bufalloc)(const void *src, size_t size, enum data_type type); | 685 | int (*bufalloc)(const void *src, size_t size, enum data_type type); |
674 | bool (*bufclose)(int handle_id); | 686 | bool (*bufclose)(int handle_id); |
@@ -704,33 +716,9 @@ struct plugin_api { | |||
704 | char *buf, int buflen); | 716 | char *buf, int buflen); |
705 | #endif | 717 | #endif |
706 | 718 | ||
707 | #if CONFIG_CODEC == SWCODEC | 719 | /* new stuff at the end, sort into place next time |
708 | void (*pcm_play_lock)(void); | 720 | the API gets incompatible */ |
709 | void (*pcm_play_unlock)(void); | 721 | |
710 | void (*queue_enable_queue_send)(struct event_queue *q, | ||
711 | struct queue_sender_list *send); | ||
712 | bool (*queue_empty)(const struct event_queue *q); | ||
713 | void (*queue_wait)(struct event_queue *q, struct queue_event *ev); | ||
714 | intptr_t (*queue_send)(struct event_queue *q, long id, | ||
715 | intptr_t data); | ||
716 | void (*queue_reply)(struct event_queue *q, intptr_t retval); | ||
717 | #ifndef HAVE_FLASH_STORAGE | ||
718 | void (*ata_spin)(void); | ||
719 | #endif | ||
720 | #ifdef HAVE_SCHEDULER_BOOSTCTRL | ||
721 | void (*trigger_cpu_boost)(void); | ||
722 | void (*cancel_cpu_boost)(void); | ||
723 | #endif | ||
724 | const char * (*sound_unit)(int setting); | ||
725 | int (*sound_val2phys)(int setting, int value); | ||
726 | void (*dsp_set_crossfeed)(bool enable); | ||
727 | void (*dsp_set_eq)(bool enable); | ||
728 | void (*dsp_dither_enable)(bool enable); | ||
729 | intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting, | ||
730 | intptr_t value); | ||
731 | int (*dsp_process)(struct dsp_config *dsp, char *dest, | ||
732 | const char *src[], int count); | ||
733 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
734 | }; | 722 | }; |
735 | 723 | ||
736 | /* plugin header */ | 724 | /* plugin header */ |
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index 7e6fda0bbc..0f7e24b551 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c | |||
@@ -1178,11 +1178,12 @@ static void chip8_update_display(void) | |||
1178 | } | 1178 | } |
1179 | #if defined(SIMULATOR) || (LCD_DEPTH > 1) | 1179 | #if defined(SIMULATOR) || (LCD_DEPTH > 1) |
1180 | rb->lcd_set_drawmode(DRMODE_SOLID); | 1180 | rb->lcd_set_drawmode(DRMODE_SOLID); |
1181 | rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, CHIP8_HEIGHT); | 1181 | rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, |
1182 | CHIP8_HEIGHT); | ||
1182 | rb->lcd_update(); | 1183 | rb->lcd_update(); |
1183 | #else | 1184 | #else |
1184 | rb->lcd_blit(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH, CHIP8_HEIGHT>>3 | 1185 | rb->lcd_blit_mono(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH, |
1185 | , CHIP8_LCDWIDTH); | 1186 | CHIP8_HEIGHT>>3, CHIP8_LCDWIDTH); |
1186 | #endif | 1187 | #endif |
1187 | } | 1188 | } |
1188 | 1189 | ||
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c index 80daf494a0..caa7af2f25 100644 --- a/apps/plugins/lib/grey_core.c +++ b/apps/plugins/lib/grey_core.c | |||
@@ -239,12 +239,12 @@ static unsigned long _grey_get_pixel(int x, int y) | |||
239 | static void _timer_isr(void) | 239 | static void _timer_isr(void) |
240 | { | 240 | { |
241 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 241 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
242 | _grey_info.rb->lcd_grey_phase_blit(_grey_info.values, _grey_info.phases, | 242 | _grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases, |
243 | _grey_info.bx, _grey_info.y, | 243 | _grey_info.bx, _grey_info.y, |
244 | _grey_info.bwidth, _grey_info.height, | 244 | _grey_info.bwidth, _grey_info.height, |
245 | _grey_info.width); | 245 | _grey_info.width); |
246 | #else | 246 | #else |
247 | _grey_info.rb->lcd_grey_phase_blit(_grey_info.values, _grey_info.phases, | 247 | _grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases, |
248 | _grey_info.x, _grey_info.by, | 248 | _grey_info.x, _grey_info.by, |
249 | _grey_info.width, _grey_info.bheight, | 249 | _grey_info.width, _grey_info.bheight, |
250 | _grey_info.width); | 250 | _grey_info.width); |
@@ -457,7 +457,7 @@ void grey_release(void) | |||
457 | grey_deferred_update() instead. | 457 | grey_deferred_update() instead. |
458 | 458 | ||
459 | Other functions to avoid are: | 459 | Other functions to avoid are: |
460 | lcd_blit() (obviously), lcd_update_rect(), lcd_set_contrast(), | 460 | lcd_blit_mono(), lcd_update_rect(), lcd_set_contrast(), |
461 | lcd_set_invert_display(), lcd_set_flip() */ | 461 | lcd_set_invert_display(), lcd_set_flip() */ |
462 | void grey_show(bool enable) | 462 | void grey_show(bool enable) |
463 | { | 463 | { |
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index 86a18cde2d..c8245cc1bf 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c | |||
@@ -104,7 +104,7 @@ static inline void yuv_blit(uint8_t * const * buf, int src_x, int src_y, | |||
104 | video_lock(); | 104 | video_lock(); |
105 | 105 | ||
106 | #ifdef HAVE_LCD_COLOR | 106 | #ifdef HAVE_LCD_COLOR |
107 | rb->lcd_yuv_blit(buf, src_x, src_y, stride, x, y , width, height); | 107 | rb->lcd_blit_yuv(buf, src_x, src_y, stride, x, y , width, height); |
108 | #else | 108 | #else |
109 | grey_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height); | 109 | grey_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height); |
110 | #endif | 110 | #endif |
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index e8ceaed7a1..7c86fabdc0 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -192,7 +192,7 @@ static void time_main_yuv(void) | |||
192 | time_start = *rb->current_tick; | 192 | time_start = *rb->current_tick; |
193 | while((time_end = *rb->current_tick) - time_start < DURATION) | 193 | while((time_end = *rb->current_tick) - time_start < DURATION) |
194 | { | 194 | { |
195 | rb->lcd_yuv_blit(yuvbuf, 0, 0, YUV_WIDTH, | 195 | rb->lcd_blit_yuv(yuvbuf, 0, 0, YUV_WIDTH, |
196 | 0, 0, YUV_WIDTH, YUV_HEIGHT); | 196 | 0, 0, YUV_WIDTH, YUV_HEIGHT); |
197 | frame_count++; | 197 | frame_count++; |
198 | } | 198 | } |
@@ -208,7 +208,7 @@ static void time_main_yuv(void) | |||
208 | time_start = *rb->current_tick; | 208 | time_start = *rb->current_tick; |
209 | while((time_end = *rb->current_tick) - time_start < DURATION) | 209 | while((time_end = *rb->current_tick) - time_start < DURATION) |
210 | { | 210 | { |
211 | rb->lcd_yuv_blit(yuvbuf, 0, 0, YUV_WIDTH, | 211 | rb->lcd_blit_yuv(yuvbuf, 0, 0, YUV_WIDTH, |
212 | part14_x, part14_y, part14_w, part14_h); | 212 | part14_x, part14_y, part14_w, part14_h); |
213 | frame_count++; | 213 | frame_count++; |
214 | } | 214 | } |
@@ -260,7 +260,7 @@ static void time_remote_update(void) | |||
260 | } | 260 | } |
261 | #endif | 261 | #endif |
262 | 262 | ||
263 | #if LCD_DEPTH < 4 | 263 | #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3) |
264 | 264 | ||
265 | GREY_INFO_STRUCT_IRAM | 265 | GREY_INFO_STRUCT_IRAM |
266 | static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH]; | 266 | static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH]; |
@@ -357,7 +357,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
357 | log_text("Main LCD YUV"); | 357 | log_text("Main LCD YUV"); |
358 | time_main_yuv(); | 358 | time_main_yuv(); |
359 | #endif | 359 | #endif |
360 | #if LCD_DEPTH < 4 | 360 | #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3) |
361 | log_text("Greyscale library"); | 361 | log_text("Greyscale library"); |
362 | time_greyscale(); | 362 | time_greyscale(); |
363 | #endif | 363 | #endif |
diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 2799e3d5d1..fa1646d112 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c | |||
@@ -361,13 +361,13 @@ void timer4_isr(void) | |||
361 | height = MIN(LCD_HEIGHT/8-1, height); /* reserve bottom line */ | 361 | height = MIN(LCD_HEIGHT/8-1, height); /* reserve bottom line */ |
362 | if (gPlay.bDirtyOSD) | 362 | if (gPlay.bDirtyOSD) |
363 | { /* OSD to bottom line */ | 363 | { /* OSD to bottom line */ |
364 | rb->lcd_blit(gBuf.pOSD, 0, LCD_HEIGHT/8-1, | 364 | rb->lcd_blit_mono(gBuf.pOSD, 0, LCD_HEIGHT/8-1, |
365 | LCD_WIDTH, 1, LCD_WIDTH); | 365 | LCD_WIDTH, 1, LCD_WIDTH); |
366 | gPlay.bDirtyOSD = false; | 366 | gPlay.bDirtyOSD = false; |
367 | } | 367 | } |
368 | } | 368 | } |
369 | 369 | ||
370 | rb->lcd_blit(gBuf.pReadVideo, 0, 0, | 370 | rb->lcd_blit_mono(gBuf.pReadVideo, 0, 0, |
371 | gFileHdr.video_width, height, gFileHdr.video_width); | 371 | gFileHdr.video_width, height, gFileHdr.video_width); |
372 | 372 | ||
373 | available = Available(gBuf.pReadVideo); | 373 | available = Available(gBuf.pReadVideo); |