From 0c4f89370d05056faa789aa9cabcccc4e509fb9f Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 19 Jul 2020 19:38:45 -0400 Subject: [2/4] get rid of HAVE_LCD_CHARCELLS HAVE_LCD_BITMAP is now redundant. lcd_bitmap is always-on in features.txt so manual and lang strings don't have to change Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794 --- apps/SOURCES | 6 - apps/features.txt | 4 - apps/filetypes.c | 7 - apps/gui/charcell/list.c | 112 ------ apps/gui/icon.h | 15 +- apps/gui/line.c | 4 - apps/gui/list.c | 5 - apps/gui/skin_engine/skin_display.c | 1 - apps/gui/skin_engine/skin_parser.c | 8 - apps/gui/skin_engine/skin_render.c | 12 - apps/gui/skin_engine/skin_tokens.c | 173 --------- apps/gui/skin_engine/wps_internals.h | 3 - apps/gui/splash.c | 17 - apps/gui/statusbar.c | 38 -- apps/gui/usb_screen.c | 9 - apps/gui/viewport.h | 4 - apps/gui/wps.c | 22 -- apps/gui/yesno.c | 5 - apps/logfdisp.c | 7 - apps/menus/main_menu.c | 28 +- apps/onplay.c | 8 - apps/player/icons.c | 110 ------ apps/plugin.c | 11 - apps/plugin.h | 11 - apps/plugins/credits.c | 68 ---- apps/plugins/cube.c | 10 - apps/plugins/flipit.c | 75 ---- apps/plugins/invadrox.c | 4 - apps/plugins/jackpot.c | 70 +--- apps/plugins/lib/SOURCES | 4 - apps/plugins/lib/display_text.c | 4 - apps/plugins/lib/mylcd.h | 9 +- apps/plugins/lib/osd.h | 4 - apps/plugins/lib/playergfx.c | 526 ---------------------------- apps/plugins/lib/playergfx.h | 55 --- apps/plugins/lib/simple_viewer.c | 5 - apps/plugins/logo.c | 17 - apps/plugins/lrcplayer.c | 53 --- apps/plugins/metronome.c | 5 - apps/plugins/mosaique.c | 15 - apps/plugins/random_folder_advance_config.c | 2 - apps/plugins/rockblox.c | 38 +- apps/plugins/snow.c | 19 - apps/plugins/text_viewer/tv_display.c | 5 - apps/screen_access.c | 16 - apps/screen_access.h | 13 - apps/screens.c | 4 - apps/status.c | 28 -- apps/status.h | 13 - apps/tree.c | 8 +- 50 files changed, 9 insertions(+), 1681 deletions(-) delete mode 100644 apps/gui/charcell/list.c delete mode 100644 apps/player/icons.c delete mode 100644 apps/plugins/lib/playergfx.c delete mode 100644 apps/plugins/lib/playergfx.h (limited to 'apps') diff --git a/apps/SOURCES b/apps/SOURCES index bf01dbcac4..6a0b817834 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -83,8 +83,6 @@ gui/line.c #ifdef HAVE_LCD_BITMAP gui/bitmap/list.c gui/bitmap/list-skinned.c -#else -gui/charcell/list.c #endif gui/option_select.c #ifdef HAVE_PITCHCONTROL @@ -127,10 +125,6 @@ gui/skin_engine/skin_touchsupport.c gui/backdrop.c #endif -#ifdef HAVE_LCD_CHARCELLS -player/icons.c -player/keyboard.c -#endif #ifdef HAVE_LCD_BITMAP recorder/bmp.c recorder/icons.c diff --git a/apps/features.txt b/apps/features.txt index 7b50b4026c..1c942a7fe2 100644 --- a/apps/features.txt +++ b/apps/features.txt @@ -231,10 +231,6 @@ disk_storage remote_button_hold #endif -#if defined(HAVE_LCD_CHARCELLS) -lcd_charcell -#endif - #if defined(HAVE_LCD_FLIP) lcd_flip #endif diff --git a/apps/filetypes.c b/apps/filetypes.c index 16a00a423f..a30f012e53 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -605,13 +605,6 @@ int filetype_list_viewers(const char* current_file) { struct simplelist_info info; struct cb_data data = { current_file }; -#ifndef HAVE_LCD_BITMAP - if (viewer_count == 0) - { - splash(HZ*2, ID2P(LANG_NO_VIEWERS)); - return PLUGIN_OK; - } -#endif simplelist_info_init(&info, str(LANG_ONPLAY_OPEN_WITH), viewer_count, &data); info.action_callback = openwith_action_callback; info.get_name = openwith_get_name; diff --git a/apps/gui/charcell/list.c b/apps/gui/charcell/list.c deleted file mode 100644 index cbee8b0d9d..0000000000 --- a/apps/gui/charcell/list.c +++ /dev/null @@ -1,112 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Jonathan Gordon - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -/* This file contains the code to draw the list widget on BITMAP LCDs. */ - -#include "config.h" -#include "lcd.h" -#include "font.h" -#include "button.h" -#include "string.h" -#include "settings.h" -#include "kernel.h" -#include "system.h" -#include "file.h" - -#include "list.h" -#include "screen_access.h" -#include "scrollbar.h" -#include "lang.h" -#include "sound.h" -#include "misc.h" - -void gui_synclist_scroll_stop(struct gui_synclist *lists) -{ - (void)lists; - FOR_NB_SCREENS(i) - { - screens[i].scroll_stop(); - } -} - -void list_draw(struct screen *display, struct gui_synclist *gui_list) -{ - bool draw_icons = (gui_list->callback_get_item_icon != NULL); - bool selected; - int i; - int start, end; - - display->set_viewport(NULL); - - display->clear_display(); - start = 0; - end = display->getnblines(); - - struct line_desc desc = { - .height = -1, - .text_color = 1, - .line_color = 1, - .line_end_color = 1, - .style = STYLE_DEFAULT - }; - - for (i = start; i < end; i++) - { - unsigned const char *s; - char entry_buffer[MAX_PATH]; - unsigned char *entry_name; - int current_item = gui_list->start_item[display->screen_type] + i; - - /* When there are less items to display than the - * current available space on the screen, we stop*/ - if(current_item >= gui_list->nb_items) - break; - s = gui_list->callback_get_item_name(current_item, - gui_list->data, - entry_buffer, - sizeof(entry_buffer)); - entry_name = P2STR(s); - - if (gui_list->show_selection_marker && - current_item >= gui_list->selected_item && - current_item < gui_list->selected_item + gui_list->selected_size) - selected = true; /* The selected item must be displayed scrolling */ - else - selected = false; - - desc.nlines = gui_list->selected_size, - desc.line = gui_list->selected_size > 1 ? i : 0, - desc.scroll = selected ? true : gui_list->scroll_all; - - if (draw_icons) - put_line(display, 0, i, &desc, "$i$i$t", - selected ? Icon_Cursor : Icon_NOICON, - gui_list->callback_get_item_icon(current_item, gui_list->data), - entry_name); - else - put_line(display, 0, i, &desc, "$i$t", - selected ? Icon_Cursor : Icon_NOICON, - entry_name); - } - - display->update_viewport(); - display->update(); -} diff --git a/apps/gui/icon.h b/apps/gui/icon.h index e095ccfc4c..88449c61ca 100644 --- a/apps/gui/icon.h +++ b/apps/gui/icon.h @@ -89,10 +89,6 @@ extern void screen_put_cursorxy(struct screen * screen, int x, int y, bool on); */ extern void screen_put_iconxy(struct screen * screen, int x, int y, enum themable_icons icon); -#ifdef HAVE_LCD_CHARCELLS -# define screen_put_icon(s, x, y, i) screen_put_iconxy(s, x, y, i) -# define screen_put_icon_with_offset(s, x, y, w, h, i) screen_put_icon(s, x, y, i) -#else /* For both of these, the icon will be placed in the center of the rectangle */ /* as above, but x,y are letter position, NOT PIXEL */ extern void screen_put_icon(struct screen * screen, @@ -101,23 +97,14 @@ extern void screen_put_icon(struct screen * screen, extern void screen_put_icon_with_offset(struct screen * display, int x, int y, int off_x, int off_y, enum themable_icons icon); -#endif - void icons_init(void); -#ifdef HAVE_LCD_CHARCELLS -# define CURSOR_CHAR 0xe10c -# define get_icon_width(a) 1 -# define get_icon_height(a) 1 /* needs to be verified */ -#else int get_icon_width(enum screen_type screen_type); int get_icon_height(enum screen_type screen_type); int get_icon_format(enum screen_type screen_type); -#endif -#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) \ - && !defined(HAVE_LCD_CHARCELLS) +#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) int get_icon_format(enum screen_type screen_type); #else # define get_icon_format(a) FORMAT_MONO diff --git a/apps/gui/line.c b/apps/gui/line.c index 2b1bec2c6b..ea6bcea93b 100644 --- a/apps/gui/line.c +++ b/apps/gui/line.c @@ -41,11 +41,7 @@ #endif -#ifdef HAVE_LCD_CHARCELLS -#define style_line(d, x, y, l) -#else static void style_line(struct screen *display, int x, int y, struct line_desc *line); -#endif static void put_text(struct screen *display, int x, int y, struct line_desc *line, const char *text, bool prevent_scroll, int text_skip_pixels); diff --git a/apps/gui/list.c b/apps/gui/list.c index 8533f93275..ce444cc9c2 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -279,13 +279,8 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list, int bottom = MAX(0, gui_list->nb_items - nb_lines); int new_start_item = gui_list->start_item[screen]; int difference = gui_list->selected_item - gui_list->start_item[screen]; -#ifdef HAVE_LCD_CHARCELLS - const int scroll_limit_up = 0; - const int scroll_limit_down = 1; -#else const int scroll_limit_up = (nb_lines < gui_list->selected_size+2 ? 0:1); const int scroll_limit_down = (scroll_limit_up+gui_list->selected_size); -#endif if (gui_list->show_selection_marker == false) { diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 501d3a305a..7ee349b346 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -662,7 +662,6 @@ bool skin_has_sbs(enum screen_type screen, struct wps_data *data) */ int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) { - (void)skin; /* silence charcell warning */ int button = ACTION_NONE; #ifdef HAVE_LCD_BITMAP /* when the peak meter is enabled we want to have a diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index dce88e9c58..de7c1db372 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -1815,14 +1815,6 @@ static void skin_data_reset(struct wps_data *wps_data) wps_data->peak_meter_enabled = false; wps_data->wps_sb_tag = false; wps_data->show_sb_on_wps = false; -#else /* HAVE_LCD_CHARCELLS */ - /* progress bars */ - int i; - for (i = 0; i < 8; i++) - { - wps_data->wps_progress_pat[i] = 0; - } - wps_data->full_line_progressbar = false; #endif wps_data->wps_loaded = false; } diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c index 4415619b7e..e14c882dd9 100644 --- a/apps/gui/skin_engine/skin_render.c +++ b/apps/gui/skin_engine/skin_render.c @@ -97,10 +97,6 @@ get_child(OFFSETTYPE(struct skin_element**) children, int child) static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, struct skin_element *element, struct skin_viewport* skin_vp) { -#ifndef HAVE_LCD_BITMAP - (void)skin_vp; /* silence warnings */ - (void)info; -#endif struct wps_token *token = (struct wps_token *)SKINOFFSETTOPTR(skin_buffer, element->data); #ifdef HAVE_LCD_BITMAP @@ -832,14 +828,6 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) int old_refresh_mode = refresh_mode; skin_buffer = get_skin_buffer(gwps->data); -#ifdef HAVE_LCD_CHARCELLS - int i; - for (i = 0; i < 8; i++) - { - if (data->wps_progress_pat[i] == 0) - data->wps_progress_pat[i] = display->get_locked_pattern(); - } -#endif viewport = SKINOFFSETTOPTR(skin_buffer, data->tree); skin_viewport = SKINOFFSETTOPTR(skin_buffer, viewport->data); diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 75c3203066..50704fd66e 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -37,9 +37,6 @@ #include "cuesheet.h" #include "replaygain.h" #include "core_alloc.h" -#ifdef HAVE_LCD_CHARCELLS -#include "hwcompat.h" -#endif #include "abrepeat.h" #include "lang.h" #include "misc.h" @@ -577,148 +574,6 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename) return pid3; } -#ifdef HAVE_LCD_CHARCELLS -static void format_player_progress(struct gui_wps *gwps) -{ - struct wps_state *state = skin_get_global_state(); - struct screen *display = gwps->display; - unsigned char progress_pattern[7]; - int pos = 0; - int i; - - int elapsed, length; - if (LIKELY(state->id3)) - { - elapsed = state->id3->elapsed; - length = state->id3->length; - } - else - { - elapsed = 0; - length = 0; - } - - if (length) - pos = 36 * (elapsed + state->ff_rewind_count) / length; - - for (i = 0; i < 7; i++, pos -= 5) - { - if (pos <= 0) - progress_pattern[i] = 0x1fu; - else if (pos >= 5) - progress_pattern[i] = 0x00u; - else - progress_pattern[i] = 0x1fu >> pos; - } - - display->define_pattern(gwps->data->wps_progress_pat[0], progress_pattern); -} - -static void format_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size) -{ - static const unsigned char numbers[10][4] = { - {0x0e, 0x0a, 0x0a, 0x0e}, /* 0 */ - {0x04, 0x0c, 0x04, 0x04}, /* 1 */ - {0x0e, 0x02, 0x04, 0x0e}, /* 2 */ - {0x0e, 0x02, 0x06, 0x0e}, /* 3 */ - {0x08, 0x0c, 0x0e, 0x04}, /* 4 */ - {0x0e, 0x0c, 0x02, 0x0c}, /* 5 */ - {0x0e, 0x08, 0x0e, 0x0e}, /* 6 */ - {0x0e, 0x02, 0x04, 0x08}, /* 7 */ - {0x0e, 0x0e, 0x0a, 0x0e}, /* 8 */ - {0x0e, 0x0e, 0x02, 0x0e} /* 9 */ - }; - - struct wps_state *state = skin_get_global_state(); - struct screen *display = gwps->display; - struct wps_data *data = gwps->data; - unsigned char progress_pattern[7]; - char timestr[10]; - int time; - int time_idx = 0; - int pos = 0; - int pat_idx = 1; - int digit, i, j; - bool softchar; - - int elapsed, length; - if (LIKELY(state->id3)) - { - elapsed = state->id3->elapsed; - length = state->id3->length; - } - else - { - elapsed = 0; - length = 0; - } - - if (buf_size < 34) /* worst case: 11x UTF-8 char + \0 */ - return; - - time = elapsed + state->ff_rewind_count; - if (length) - pos = 55 * time / length; - - memset(timestr, 0, sizeof(timestr)); - format_time(timestr, sizeof(timestr)-2, time); - timestr[strlen(timestr)] = ':'; /* always safe */ - - for (i = 0; i < 11; i++, pos -= 5) - { - softchar = false; - memset(progress_pattern, 0, sizeof(progress_pattern)); - - if ((digit = timestr[time_idx])) - { - softchar = true; - digit -= '0'; - - if (timestr[time_idx + 1] == ':') /* ones, left aligned */ - { - memcpy(progress_pattern, numbers[digit], 4); - time_idx += 2; - } - else /* tens, shifted right */ - { - for (j = 0; j < 4; j++) - progress_pattern[j] = numbers[digit][j] >> 1; - - if (time_idx > 0) /* not the first group, add colon in front */ - { - progress_pattern[1] |= 0x10u; - progress_pattern[3] |= 0x10u; - } - time_idx++; - } - - if (pos >= 5) - progress_pattern[5] = progress_pattern[6] = 0x1fu; - } - - if (pos > 0 && pos < 5) - { - softchar = true; - progress_pattern[5] = progress_pattern[6] = (~0x1fu >> pos) & 0x1fu; - } - - if (softchar && pat_idx < 8) - { - display->define_pattern(data->wps_progress_pat[pat_idx], - progress_pattern); - buf = utf8encode(data->wps_progress_pat[pat_idx], buf); - pat_idx++; - } - else if (pos <= 0) - buf = utf8encode(' ', buf); - else - buf = utf8encode(0xe115, buf); /* 2/7 _ */ - } - *buf = '\0'; -} - -#endif /* HAVE_LCD_CHARCELLS */ - /* Don't inline this; it was broken out of get_token_value to reduce stack * usage. */ @@ -1351,34 +1206,6 @@ const char *get_token_value(struct gui_wps *gwps, return "-"; #endif -#ifdef HAVE_LCD_CHARCELLS - case SKIN_TOKEN_PROGRESSBAR: - { - char *end; - format_player_progress(gwps); - end = utf8encode(data->wps_progress_pat[0], buf); - *end = '\0'; - return buf; - } - - case SKIN_TOKEN_PLAYER_PROGRESSBAR: - if(is_new_player()) - { - /* we need 11 characters (full line) for - progress-bar */ - strlcpy(buf, " ", buf_size); - format_player_fullbar(gwps,buf,buf_size); - DEBUGF("bar='%s'\n",buf); - } - else - { - /* Tell the user if we have an OldPlayer */ - strlcpy(buf, " ", buf_size); - } - return buf; -#endif - - #ifdef HAVE_LCD_BITMAP /* peakmeter */ case SKIN_TOKEN_PEAKMETER_LEFT: diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index e7996b0530..caf43b21cb 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h @@ -374,9 +374,6 @@ struct wps_data bool peak_meter_enabled; bool wps_sb_tag; bool show_sb_on_wps; -#else /*HAVE_LCD_CHARCELLS */ - unsigned short wps_progress_pat[8]; - bool full_line_progressbar; #endif bool wps_loaded; }; diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 2608a2e02e..56df77d57a 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -38,12 +38,6 @@ #define RECT_SPACING 2 #define SPLASH_MEMORY_INTERVAL (HZ) -#else /* HAVE_LCD_CHARCELLS */ - -#define MAXLINES 2 -#define MAXBUFFER 64 -#define RECT_SPACING 0 - #endif @@ -68,12 +62,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) screen->set_viewport(&vp); screen->getstringsize(" ", &space_w, &h); -#else /* HAVE_LCD_CHARCELLS */ - vp.width = screen->lcdwidth; - vp.height = screen->lcdheight; - - space_w = h = 1; - screen->double_height (false); #endif y = h; @@ -178,9 +166,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) /* prepare putting the text */ y = RECT_SPACING; -#else /* HAVE_LCD_CHARCELLS */ - y = 0; /* vertical centering on 2 lines would be silly */ - screen->clear_display(); #endif /* print the message to screen */ @@ -188,8 +173,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) { #ifdef HAVE_LCD_BITMAP screen->putsxy(0, y, lines[i]); -#else - screen->puts(0, y, lines[i]); #endif } screen->update_viewport(); diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 30dad95509..90d04a7930 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -191,12 +191,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi if (!display) return; -#ifdef HAVE_LCD_CHARCELLS - int val; - (void)force_redraw; /* The Player always has "redraw" */ - (void)vp; -#endif /* HAVE_LCD_CHARCELLS */ - bar->info.battlevel = battery_level(); #ifdef HAVE_USB_POWER bar->info.usb_inserted = usb_inserted(); @@ -359,38 +353,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi } #endif /* HAVE_LCD_BITMAP */ - -#ifdef HAVE_LCD_CHARCELLS - display->icon(ICON_BATTERY, bar->info.battery_state); - - if (bar->info.batt_charge_step > -1) - val = bar->info.batt_charge_step; - else - val = (bar->info.battlevel * 3 + 50) / 100; - display->icon(ICON_BATTERY_1, val >= 1); - display->icon(ICON_BATTERY_2, val >= 2); - display->icon(ICON_BATTERY_3, val >= 3); - - val = 10 * (bar->info.volume - sound_min(SOUND_VOLUME)) - / (sound_max(SOUND_VOLUME) - sound_min(SOUND_VOLUME)); - display->icon(ICON_VOLUME, true); - display->icon(ICON_VOLUME_1, val >= 1); - display->icon(ICON_VOLUME_2, val >= 3); - display->icon(ICON_VOLUME_3, val >= 5); - display->icon(ICON_VOLUME_4, val >= 7); - display->icon(ICON_VOLUME_5, val >= 9); - - display->icon(ICON_PLAY, current_playmode() == STATUS_PLAY); - display->icon(ICON_PAUSE, current_playmode() == STATUS_PAUSE); - - display->icon(ICON_REPEAT, global_settings.repeat_mode != REPEAT_OFF); - display->icon(ICON_1, global_settings.repeat_mode == REPEAT_ONE); - - display->icon(ICON_RECORD, record); - display->icon(ICON_AUDIO, audio); - display->icon(ICON_PARAM, param); - display->icon(ICON_USB, usb); -#endif /* HAVE_LCD_CHARCELLS */ } #ifdef HAVE_LCD_BITMAP diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c index 1b6f9c3b2a..dd1d97df3c 100644 --- a/apps/gui/usb_screen.c +++ b/apps/gui/usb_screen.c @@ -269,12 +269,7 @@ void gui_usb_screen_run(bool early_usb) * generic cleanup here */ screen->set_viewport(NULL); screen->scroll_stop(); -#ifdef HAVE_LCD_CHARCELLS - /* Quick fix. Viewports should really be enabled proper for charcell */ - viewport_set_defaults(&usb_screen_vps_ar[i].parent, i); -#else usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]); -#endif } /* update the UI before disabling fonts, this maximizes the propability @@ -327,10 +322,6 @@ void gui_usb_screen_run(bool early_usb) touchscreen_set_mode(old_mode); #endif -#ifdef HAVE_LCD_CHARCELLS - status_set_usb(false); -#endif /* HAVE_LCD_CHARCELLS */ - #ifdef HAVE_LCD_BITMAP if(!early_usb) { diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h index ecbd325946..c4b90aa64c 100644 --- a/apps/gui/viewport.h +++ b/apps/gui/viewport.h @@ -69,10 +69,6 @@ bool viewport_point_within_vp(const struct viewport *vp, const int x, const int y); #endif -#else /* HAVE_LCD_CHARCELL */ -#define viewportmanager_theme_changed(a) -#define viewportmanager_theme_enable(...) -#define viewportmanager_theme_undo(...) #endif #endif /* __PCTOOL__ */ diff --git a/apps/gui/wps.c b/apps/gui/wps.c index a930edaded..b417f82922 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -232,11 +232,6 @@ static bool update_onvol_change(enum screen_type screen) { skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC); -#ifdef HAVE_LCD_CHARCELLS - splashf(0, "Vol: %3d dB", - sound_val2phys(SOUND_VOLUME, global_settings.volume)); - return true; -#endif return false; } @@ -401,10 +396,6 @@ bool ffwd_rew(int button) #if (CONFIG_CODEC != SWCODEC) if (!skin_get_global_state()->paused) audio_resume(); -#endif -#ifdef HAVE_LCD_CHARCELLS - FOR_NB_SCREENS(i) - skin_update(WPS, i, SKIN_REFRESH_ALL); #endif exit = true; break; @@ -741,11 +732,6 @@ long gui_wps_show(void) long last_left = 0, last_right = 0; struct wps_state *state = skin_get_global_state(); -#ifdef HAVE_LCD_CHARCELLS - status_set_audio(true); - status_set_param(false); -#endif - #ifdef AB_REPEAT_ENABLE ab_repeat_init(); ab_reset_markers(); @@ -833,10 +819,6 @@ long gui_wps_show(void) break; case ACTION_WPS_BROWSE: -#ifdef HAVE_LCD_CHARCELLS - status_set_record(false); - status_set_audio(false); -#endif gwps_leave_wps(); return GO_TO_PREVIOUS_BROWSER; break; @@ -1146,10 +1128,6 @@ long gui_wps_show(void) } if (exit) { -#ifdef HAVE_LCD_CHARCELLS - status_set_record(false); - status_set_audio(false); -#endif #if CONFIG_CODEC != SWCODEC if (global_settings.fade_on_stop) fade(false, true); diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index b754d5e477..45638b7076 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -160,12 +160,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, yn[i].result_message[YESNO_NO]=no_message; yn[i].display=&screens[i]; yn[i].vp = &vp[i]; -#ifdef HAVE_LCD_CHARCELLS - /* Quick fix. Viewports should really be enabled proper for charcell */ - viewport_set_defaults(yn[i].vp, i); -#else viewportmanager_theme_enable(i, true, yn[i].vp); -#endif screens[i].scroll_stop(); gui_yesno_draw(&(yn[i])); } diff --git a/apps/logfdisp.c b/apps/logfdisp.c index 20d737e924..0c5f63e8dc 100644 --- a/apps/logfdisp.c +++ b/apps/logfdisp.c @@ -209,13 +209,6 @@ bool logfdisplay(void) return false; } -#else /* HAVE_LCD_BITMAP */ -bool logfdisplay(void) - -{ - /* TODO: implement a browser for charcell bitmaps */ - return false; -} #endif /* HAVE_LCD_BITMAP */ bool logfdump(void) diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 7f94571226..5e9b935937 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -125,11 +125,7 @@ static int show_credits(void) return 0; } -#ifdef HAVE_LCD_CHARCELLS -#define SIZE_FMT "%s%s" -#else #define SIZE_FMT "%s %s" -#endif struct info_data { @@ -500,29 +496,7 @@ MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_System_menu, /***********************************/ /* MAIN MENU */ - -#ifdef HAVE_LCD_CHARCELLS -static int mainmenu_callback(int action, - const struct menu_item_ex *this_item, - struct gui_synclist *lists) -{ - (void)this_item; - (void)lists; - switch (action) - { - case ACTION_ENTER_MENUITEM: - status_set_param(true); - break; - case ACTION_EXIT_MENUITEM: - status_set_param(false); - break; - } - return action; -} -#else -#define mainmenu_callback NULL -#endif -MAKE_MENU(main_menu_, ID2P(LANG_SETTINGS), mainmenu_callback, +MAKE_MENU(main_menu_, ID2P(LANG_SETTINGS), NULL, Icon_Submenu_Entered, &sound_settings, &playback_settings, diff --git a/apps/onplay.c b/apps/onplay.c index f88953ce62..9226f32f4c 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -180,15 +180,7 @@ static int bookmark_menu_callback(int action, else if (!bookmark_is_bookmarkable_state() && !bookmark_exists()) return ACTION_EXIT_MENUITEM; break; -#ifdef HAVE_LCD_CHARCELLS - case ACTION_ENTER_MENUITEM: - status_set_param(true); - break; -#endif case ACTION_EXIT_MENUITEM: -#ifdef HAVE_LCD_CHARCELLS - status_set_param(false); -#endif settings_save(); break; } diff --git a/apps/player/icons.c b/apps/player/icons.c deleted file mode 100644 index dc804560f2..0000000000 --- a/apps/player/icons.c +++ /dev/null @@ -1,110 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 Jonathan Gordon - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "lcd.h" -#include "icon.h" - -#ifdef HAVE_LCD_CHARCELLS -/* For the moment, charcell cant load custom maps... */ - -enum old_values{ - old_Icon_Queued = 'Q', - old_Icon_Moving = 'M', - old_Icon_Unknown = 0xe100, - old_Icon_Bookmark, - old_Icon_Plugin, - old_Icon_Folder, - old_Icon_Firmware, - old_Icon_Language, - old_Icon_Audio, - old_Icon_Wps, - old_Icon_Playlist, - old_Icon_Text, - old_Icon_Config, -}; - -static const unsigned short icons[Icon_Last_Themeable] = { - [0 ... Icon_Last_Themeable-1] = ' ', - - [Icon_Audio] = old_Icon_Audio, - [Icon_Folder] = old_Icon_Folder, - [Icon_Playlist] = old_Icon_Playlist, - [Icon_Cursor] = CURSOR_CHAR, - [Icon_Wps] = old_Icon_Wps, - [Icon_Firmware] = old_Icon_Firmware, - [Icon_Language] = old_Icon_Language, - [Icon_Config] = old_Icon_Config, - [Icon_Plugin] = old_Icon_Plugin, - [Icon_Bookmark] = old_Icon_Bookmark, - [Icon_Queued] = old_Icon_Queued, - [Icon_Moving] = old_Icon_Moving, - - /* - [Icon_Keyboard] = , - [Icon_Font] = , - [Icon_Preset] = , - [Icon_Reverse_Cursor] = , - [Icon_Questionmark] = , - [Icon_Menu_setting] = , - [Icon_Menu_functioncall] = , - [Icon_Submenu] = , - [Icon_Submenu_Entered] = , - [Icon_Recording] = , - [Icon_Voice] = , - [Icon_General_settings_menu] = , - [Icon_System_menu] = , - [Icon_Playback_menu] = , - [Icon_Display_menu] = , - [Icon_Remote_Display_menu] = , - [Icon_Radio_screen] = , - [Icon_file_view_menu] = , - [Icon_EQ] = , - [Icon_Rockbox] = , - */ -}; - -/* as above, but x,y are letter position, NOT PIXEL */ -extern void screen_put_iconxy(struct screen * screen, - int x, int y, enum themable_icons icon) -{ - if (icon <= Icon_NOICON) - screen->putchar(x, y, ' '); - else if (icon >= Icon_Last_Themeable) - screen->putchar(x, y, old_Icon_Unknown); - else - screen->putchar(x, y, icons[icon]); -} - -void screen_put_cursorxy(struct screen * display, int x, int y, bool on) -{ - screen_put_iconxy(display, x, y, on?Icon_Cursor:-1); - -} - -void icons_init(void) -{ -} - - - - - - -#endif diff --git a/apps/plugin.c b/apps/plugin.c index 959232ddb7..0ab73281ee 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -195,16 +195,6 @@ static const struct plugin_api rockbox_api = { lcd_putsf, lcd_puts_scroll, lcd_scroll_stop, -#ifdef HAVE_LCD_CHARCELLS - lcd_define_pattern, - lcd_get_locked_pattern, - lcd_unlock_pattern, - lcd_putc, - lcd_put_cursor, - lcd_remove_cursor, - lcd_icon, - lcd_double_height, -#else /* HAVE_LCD_BITMAP */ &lcd_static_framebuffer[0][0], lcd_set_viewport, lcd_set_framebuffer, @@ -270,7 +260,6 @@ static const struct plugin_api rockbox_api = { font_get_width, screen_clear_area, gui_scrollbar_draw, -#endif /* HAVE_LCD_BITMAP */ get_codepage_name, #ifdef HAVE_REMOTE_LCD diff --git a/apps/plugin.h b/apps/plugin.h index ecc662cb7f..8584d45fa7 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -205,16 +205,6 @@ struct plugin_api { void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); bool (*lcd_puts_scroll)(int x, int y, const unsigned char* string); void (*lcd_scroll_stop)(void); -#ifdef HAVE_LCD_CHARCELLS - void (*lcd_define_pattern)(unsigned long ucs, const char *pattern); - unsigned long (*lcd_get_locked_pattern)(void); - void (*lcd_unlock_pattern)(unsigned long ucs); - void (*lcd_putc)(int x, int y, unsigned long ucs); - void (*lcd_put_cursor)(int x, int y, unsigned long ucs); - void (*lcd_remove_cursor)(void); - void (*lcd_icon)(int icon, bool enable); - void (*lcd_double_height)(bool on); -#else /* HAVE_LCD_BITMAP */ fb_data* lcd_framebuffer; void (*lcd_set_viewport)(struct viewport* vp); void (*lcd_set_framebuffer)(fb_data *fb); @@ -300,7 +290,6 @@ struct plugin_api { int width, int height, int items, int min_shown, int max_shown, unsigned flags); -#endif /* HAVE_LCD_BITMAP */ const char* (*get_codepage_name)(int cp); #ifdef HAVE_REMOTE_LCD diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c index 6e993b5468..593b54277e 100644 --- a/apps/plugins/credits.c +++ b/apps/plugins/credits.c @@ -27,69 +27,6 @@ static const char* const credits[] = { #include "credits.raw" /* generated list of names from docs/CREDITS */ }; -#ifdef HAVE_LCD_CHARCELLS - -static void roll_credits(void) -{ - int numnames = sizeof(credits)/sizeof(char*); - int curr_name = 0; - int curr_len = rb->utf8length(credits[0]); - int curr_index = 0; - int curr_line = 0; - int name, len, new_len, line, x; - - while (1) - { - rb->lcd_clear_display(); - - name = curr_name; - x = -curr_index; - len = curr_len; - line = curr_line; - - while (x < 11) - { - int x2; - - if (x < 0) - rb->lcd_puts(0, line, - credits[name] + rb->utf8seek(credits[name], -x)); - else - rb->lcd_puts(x, line, credits[name]); - - if (++name >= numnames) - break; - - line ^= 1; - - x2 = x + len/2; - if ((unsigned)x2 < 11) - rb->lcd_putc(x2, line, '*'); - - new_len = rb->utf8length(credits[name]); - x += MAX(len/2 + 2, len - new_len/2 + 1); - len = new_len; - } - rb->lcd_update(); - - /* abort on keypress */ - if(rb->action_userabort(HZ/8)) - return; - - if (++curr_index >= curr_len) - { - if (++curr_name >= numnames) - break; - new_len = rb->utf8length(credits[curr_name]); - curr_index -= MAX(curr_len/2 + 2, curr_len - new_len/2 + 1); - curr_len = new_len; - curr_line ^= 1; - } - } -} - -#else - static bool stop_autoscroll(int action) { switch (action) @@ -362,8 +299,6 @@ static void roll_credits(void) } } -#endif - enum plugin_status plugin_start(const void* parameter) { (void)parameter; @@ -372,9 +307,6 @@ enum plugin_status plugin_start(const void* parameter) backlight_ignore_timeout(); rb->show_logo(); -#ifdef HAVE_LCD_CHARCELLS - rb->lcd_double_height(false); -#endif /* Show the logo for about 3 secs allowing the user to stop */ if(!rb->action_userabort(3*HZ)) diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 4cd314a035..29d2ba2fc1 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -22,7 +22,6 @@ ***************************************************************************/ #include "plugin.h" #include "fixedpoint.h" -#include "lib/playergfx.h" #include "lib/pluginlib_exit.h" #if LCD_DEPTH > 1 #include "lib/mylcd.h" /* MYLCD_CFG_RB_XLCD or MYLCD_CFG_PGFX */ @@ -746,8 +745,6 @@ static void cleanup(void) { #ifdef USEGSLIB grey_release(); -#elif defined HAVE_LCD_CHARCELLS - pgfx_release(); #endif } @@ -797,13 +794,6 @@ enum plugin_status plugin_start(const void* parameter) grey_setfont(FONT_SYSFIXED); #endif rb->lcd_setfont(FONT_SYSFIXED); -#else /* LCD_CHARCELLS */ - if (!pgfx_init(4, 2)) - { - rb->splash(HZ*2, "Old LCD :("); - return PLUGIN_OK; - } - pgfx_display(0, 0); #endif atexit(cleanup); diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index fab409cc14..294bee8f5b 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -595,75 +595,6 @@ static void draw_info_panel(void) GRID_TOP + 4*(TK_HEIGHT+TK_SPACE) + 2, s ); } -#else /* HAVE_LCD_CHARCELLS */ - -static const unsigned char tk_pat[4][7] = { - { 0x0e, 0x11, 0x0e, 0x00, 0x0e, 0x11, 0x0e }, /* white - white */ - { 0x0e, 0x11, 0x0e, 0x00, 0x0e, 0x1f, 0x0e }, /* white - black */ - { 0x0e, 0x1f, 0x0e, 0x00, 0x0e, 0x11, 0x0e }, /* black - white */ - { 0x0e, 0x1f, 0x0e, 0x00, 0x0e, 0x1f, 0x0e } /* black - black */ -}; - -static unsigned char cur_pat[7]; -static unsigned long gfx_chars[5]; - -static void release_gfx(void) -{ - int i; - - for (i = 0; i < 5; i++) - if (gfx_chars[i]) - rb->lcd_unlock_pattern(gfx_chars[i]); -} - -static bool init_gfx(void) -{ - int i; - - for (i = 0; i < 5; i++) { - if ((gfx_chars[i] = rb->lcd_get_locked_pattern()) == 0) { - release_gfx(); - return false; - } - } - for (i = 0; i < 4; i++) - rb->lcd_define_pattern(gfx_chars[i], tk_pat[i]); - return true; -} - -/* draw a spot at the coordinates (x,y), range of p is 0-19 */ -static void draw_spot(int p) -{ - if ((p/5) & 1) - p -= 5; - - rb->lcd_putc (p%5, p/10, gfx_chars[2*spots[p]+spots[p+5]]); -} - -/* draw the cursor at the current cursor position */ -static void draw_cursor(void) -{ - if ((cursor_pos/5) & 1) { - rb->memcpy( cur_pat, tk_pat[2*spots[cursor_pos-5]+spots[cursor_pos]], 7 ); - cur_pat[4] ^= 0x15; - cur_pat[6] ^= 0x11; - } - else { - rb->memcpy( cur_pat, tk_pat[2*spots[cursor_pos]+spots[cursor_pos+5]], 7 ); - cur_pat[0] ^= 0x15; - cur_pat[2] ^= 0x11; - } - rb->lcd_define_pattern(gfx_chars[4], cur_pat); - rb->lcd_putc( cursor_pos%5, cursor_pos/10, gfx_chars[4] ); -} - -/* draw the info panel ... duh */ -static void draw_info_panel(void) -{ - rb->lcd_puts( 6, 0, "Flips" ); - rb->lcd_putsf( 6, 1, "%d", moves ); -} - #endif /* LCD */ /* clear the cursor where it is */ @@ -978,9 +909,6 @@ enum plugin_status plugin_start(const void* parameter) #endif rb->lcd_update(); -#else /* HAVE_LCD_CHARCELLS */ - if (!init_gfx()) - return PLUGIN_ERROR; #endif rb->button_get_w_tmo(HZ*3); @@ -995,8 +923,5 @@ enum plugin_status plugin_start(const void* parameter) rb->srand(*rb->current_tick); rc = flipit_loop(); -#ifdef HAVE_LCD_CHARCELLS - release_gfx(); -#endif return rc; } diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 8cf4d67f3e..e7529895ac 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -66,10 +66,6 @@ /* Original graphics is only 1bpp so it should be portable * to most targets. But for now, only support the simple ones. */ -#ifndef HAVE_LCD_BITMAP - #error INVADROX: Unsupported LCD -#endif - #if (LCD_DEPTH < 2) #error INVADROX: Unsupported LCD #endif diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index b380e85180..26f8f47e8f 100644 --- a/apps/plugins/jackpot.c +++ b/apps/plugins/jackpot.c @@ -30,24 +30,7 @@ const struct button_mapping* plugin_contexts[]={pla_main_ctx}; #define NB_PICTURES 9 #define NB_SLOTS 3 -#ifdef HAVE_LCD_CHARCELLS -#define PICTURE_ROTATION_STEPS 7 -static unsigned char jackpot_slots_patterns[]={ - 0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0e, 0x04, /* (+00)Heart */ - 0x00, 0x04, 0x0E, 0x1F, 0x1F, 0x04, 0x0E, /* (+07)Spade */ - 0x00, 0x04, 0x0E, 0x1F, 0x0E, 0x04, 0x00, /* (+14)Diamond */ - 0x00, 0x15, 0x0E, 0x1F, 0x0E, 0x15, 0x00, /* (+21)Club */ - 0x03, 0x04, 0x0e, 0x1F, 0x1F, 0x1F, 0x0e, /* (+28)Cherry */ - 0x00, 0x04, 0x04, 0x1F, 0x04, 0x0E, 0x1F, /* (+35)Cross */ - 0x04, 0x0E, 0x15, 0x04, 0x0A, 0x0A, 0x11, /* (+42)Man */ - 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, /* (+49)Square */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* (+56)Empty */ - 0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0e, 0x04 /* (+63)Heart */ -}; -static unsigned long char_patterns[NB_SLOTS]; -#define SLEEP_TIME (HZ/24) -#else /* bitmaps LCDs */ - +#ifdef HAVE_LCD_BITMAP #define PICTURE_HEIGHT (BMPHEIGHT_jackpot_slots/(NB_PICTURES+1)) #if NB_SCREENS==1 #define PICTURE_ROTATION_STEPS PICTURE_HEIGHT @@ -72,7 +55,7 @@ const struct picture jackpot_pictures[]={ }; #define SLEEP_TIME (HZ/200) -#endif /* HAVE_LCD_CHARCELLS */ +#endif /* HAVE_LCD_BITMAP */ struct jackpot { @@ -92,29 +75,9 @@ struct jackpot int money; }; -#ifdef HAVE_LCD_CHARCELLS -static void patterns_init(struct screen* display) -{ - int i; - for(i=0;iget_locked_pattern(); -} - -static void patterns_deinit(struct screen* display) -{ - /* Restore the old pattern */ - int i; - for(i=0;iunlock_pattern(char_patterns[i]); -} -#endif /* HAVE_LCD_CHARCELLS */ - /*Call when the program exit*/ static void jackpot_exit(void) { -#ifdef HAVE_LCD_CHARCELLS - patterns_deinit(rb->screens[SCREEN_MAIN]); -#endif /* HAVE_LCD_CHARCELLS */ } static void jackpot_init(struct jackpot* game) @@ -168,47 +131,25 @@ static void jackpot_display_slot_machine(struct jackpot* game, struct screen* di char str[20]; int i; bool changes=false; -#ifdef HAVE_LCD_CHARCELLS - display->putchar(0, 0, '['); -#else const struct picture* picture= &(jackpot_pictures[display->screen_type]); int pos_x=(display->getwidth()-NB_SLOTS*(picture->width+1))/2; int pos_y=(display->getheight()-(picture->slide_height))/2; -#endif /* HAVE_LCD_CHARCELLS */ for(i=0;islot_state[i]*7)/PICTURE_ROTATION_STEPS; -#else int state_y= (picture->slide_height*game->slot_state[i])/PICTURE_ROTATION_STEPS; -#endif /* HAVE_LCD_CHARCELLS */ int previous_state_y=game->state_y[display->screen_type][i]; if(state_y==previous_state_y) continue;/*no need to update the picture as it's the same as previous displayed one*/ changes=true; game->state_y[display->screen_type][i]=state_y; -#ifdef HAVE_LCD_CHARCELLS - char* current_pattern=&(jackpot_slots_patterns[state_y]); - display->define_pattern(char_patterns[i], - current_pattern); - display->putchar(i+1, 0, char_patterns[i]); -#else vertical_picture_draw_part(display, picture, state_y, pos_x, pos_y); pos_x+=(picture->width+1); -#endif } if(changes){ -#ifdef HAVE_LCD_CHARCELLS - rb->snprintf(str,sizeof(str),"$%d", game->money); - display->putchar(++i, 0, ']'); - display->puts(++i, 0, str); -#else rb->snprintf(str,sizeof(str),"money : $%d", game->money); display->puts(0, 0, str); -#endif display->update(); } } @@ -216,9 +157,6 @@ static void jackpot_display_slot_machine(struct jackpot* game, struct screen* di static void jackpot_info_message(struct screen* display, char* message) { -#ifdef HAVE_LCD_CHARCELLS - display->puts_scroll(0,1,message); -#else int xpos, ypos; int message_height, message_width; display->getstringsize(message, &message_width, &message_height); @@ -228,7 +166,6 @@ static void jackpot_info_message(struct screen* display, char* message) message_height); display->putsxy(xpos,ypos,message); display->update(); -#endif /* HAVE_LCD_CHARCELLS */ } static void jackpot_print_turn_result(struct jackpot* game, @@ -299,9 +236,6 @@ enum plugin_status plugin_start(const void* parameter) (void)parameter; atexit(jackpot_exit); rb->srand(*rb->current_tick); -#ifdef HAVE_LCD_CHARCELLS - patterns_init(rb->screens[SCREEN_MAIN]); -#endif /* HAVE_LCD_CHARCELLS */ jackpot_init(&game); FOR_NB_SCREENS(i){ diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index 82b9fba4a5..effc076eb7 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -33,10 +33,6 @@ overlay.c profile_plugin.c #endif -#ifdef HAVE_LCD_CHARCELLS -playergfx.c -#endif - #ifdef HAVE_LCD_BITMAP #ifdef CPU_ARM diff --git a/apps/plugins/lib/display_text.c b/apps/plugins/lib/display_text.c index 5d13fc678d..90712a649f 100644 --- a/apps/plugins/lib/display_text.c +++ b/apps/plugins/lib/display_text.c @@ -22,11 +22,7 @@ #include "plugin.h" #include "display_text.h" -#ifdef HAVE_LCD_CHARCELLS -#define MARGIN 0 -#else #define MARGIN 5 -#endif static bool wait_key_press(void) { diff --git a/apps/plugins/lib/mylcd.h b/apps/plugins/lib/mylcd.h index e363111c71..a543d60890 100644 --- a/apps/plugins/lib/mylcd.h +++ b/apps/plugins/lib/mylcd.h @@ -32,15 +32,10 @@ * targets. On color, mylcd_ub_update_XXXX refer to the proper update * functions, otherwise they are no-ops. * - * lib/playergfx.h or lib/grey.h should be included before including this + * lib/grey.h should be included before including this * header. For bitmap LCD's, defaults to rb->lcd_XXXX otherwise. */ -#if defined (HAVE_LCD_CHARCELLS) && defined(__PGFX_H__) -#define MYLCD_CFG_PGFX /* using PGFX */ -#define mylcd_(fn) pgfx_##fn -#define mylcd_ub_(fn) pgfx_##fn - -#elif defined (HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && defined(__GREY_H__) +#if defined (HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && defined(__GREY_H__) #define MYLCD_CFG_GREYLIB /* using greylib */ #define mylcd_(fn) grey_##fn #define myxlcd_(fn) grey_##fn diff --git a/apps/plugins/lib/osd.h b/apps/plugins/lib/osd.h index b5bf63d9fe..1c2752139a 100644 --- a/apps/plugins/lib/osd.h +++ b/apps/plugins/lib/osd.h @@ -23,10 +23,6 @@ #ifndef OSD_H #define OSD_H -#ifndef HAVE_LCD_BITMAP -#error OSD requires bitmapped LCD -#endif - /* At this time: assumes use of the default viewport for normal drawing */ /* Callback implemented by user. Paramters are OSD vp-relative coordinates */ diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c deleted file mode 100644 index b2ba71351f..0000000000 --- a/apps/plugins/lib/playergfx.c +++ /dev/null @@ -1,526 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* Bitmap graphics on player LCD! -* -* Copyright (C) 2005 Jens Arnold -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -* KIND, either express or implied. -* -****************************************************************************/ - -#include "plugin.h" - -#include "playergfx.h" - -/*** globals ***/ - -static int char_width; -static int char_height; -static int pixel_height; -static int pixel_width; -static unsigned long gfx_chars[8]; -static unsigned char gfx_buffer[56]; -static int drawmode = DRMODE_SOLID; - -/*** Special functions ***/ - -/* library init */ -bool pgfx_init(int cwidth, int cheight) -{ - int i; - - if (((unsigned) cwidth * (unsigned) cheight) > 8 || (unsigned) cheight > 2) - return false; - - char_width = cwidth; - char_height = cheight; - pixel_height = 7 * char_height; - pixel_width = 5 * char_width; - - for (i = 0; i < cwidth * cheight; i++) - { - if ((gfx_chars[i] = rb->lcd_get_locked_pattern()) == 0) - { - pgfx_release(); - return false; - } - } - - return true; -} - -/* library deinit */ -void pgfx_release(void) -{ - int i; - - for (i = 0; i < 8; i++) - if (gfx_chars[i]) - rb->lcd_unlock_pattern(gfx_chars[i]); -} - -/* place the display */ -void pgfx_display(int cx, int cy) -{ - int i, j; - int width = MIN(char_width, 11 - cx); - int height = MIN(char_height, 2 - cy); - - for (i = 0; i < width; i++) - for (j = 0; j < height; j++) - rb->lcd_putc(cx + i, cy + j, gfx_chars[char_height * i + j]); -} - -void pgfx_display_block(int cx, int cy, int x, int y) -{ - rb->lcd_putc(cx, cy, gfx_chars[char_height * x + y]); -} - - -/*** Update functions ***/ - -void pgfx_update(void) -{ - int i; - - for (i = 0; i < char_width * char_height; i++) - rb->lcd_define_pattern(gfx_chars[i], gfx_buffer + 7 * i); - - rb->lcd_update(); -} - -/*** Parameter handling ***/ - -void pgfx_set_drawmode(int mode) -{ - drawmode = mode & (DRMODE_SOLID|DRMODE_INVERSEVID); -} - -int pgfx_get_drawmode(void) -{ - return drawmode; -} - -/*** Low-level drawing functions ***/ - -static void setpixel(int x, int y) -{ - gfx_buffer[pixel_height * (x/5) + y] |= 0x10 >> (x%5); -} - -static void clearpixel(int x, int y) -{ - gfx_buffer[pixel_height * (x/5) + y] &= ~(0x10 >> (x%5)); -} - -static void flippixel(int x, int y) -{ - gfx_buffer[pixel_height * (x/5) + y] ^= 0x10 >> (x%5); -} - -static void nopixel(int x, int y) -{ - (void)x; - (void)y; -} - -lcd_pixelfunc_type* pgfx_pixelfuncs[8] = { - flippixel, nopixel, setpixel, setpixel, - nopixel, clearpixel, nopixel, clearpixel -}; - -static void flipblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address ^= (bits & mask); -} - -static void bgblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address &= (bits | ~mask); -} - -static void fgblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address |= (bits & mask); -} - -static void solidblock(unsigned char *address, unsigned mask, unsigned bits) -{ - unsigned data = *(char *)address; - - bits ^= data; - *address = data ^ (bits & mask); -} - -static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address ^= (~bits & mask); -} - -static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address &= ~(bits & mask); -} - -static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) -{ - *address |= (~bits & mask); -} - -static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) -{ - unsigned data = *(char *)address; - - bits = ~bits ^ data; - *address = data ^ (bits & mask); -} - -lcd_blockfunc_type* pgfx_blockfuncs[8] = { - flipblock, bgblock, fgblock, solidblock, - flipinvblock, bginvblock, fginvblock, solidinvblock -}; - -/*** Drawing functions ***/ - -/* Clear the whole display */ -void pgfx_clear_display(void) -{ - unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0x1F : 0; - - rb->memset(gfx_buffer, bits, char_width * pixel_height); -} - -/* Set a single pixel */ -void pgfx_drawpixel(int x, int y) -{ - if (((unsigned)x < (unsigned)pixel_width) - && ((unsigned)y < (unsigned)pixel_height)) - pgfx_pixelfuncs[drawmode](x, y); -} - -/* Draw a line */ -void pgfx_drawline(int x1, int y1, int x2, int y2) -{ - int numpixels; - int i; - int deltax, deltay; - int d, dinc1, dinc2; - int x, xinc1, xinc2; - int y, yinc1, yinc2; - lcd_pixelfunc_type *pfunc = pgfx_pixelfuncs[drawmode]; - - deltax = abs(x2 - x1); - deltay = abs(y2 - y1); - xinc2 = 1; - yinc2 = 1; - - if (deltax >= deltay) - { - numpixels = deltax; - d = 2 * deltay - deltax; - dinc1 = deltay * 2; - dinc2 = (deltay - deltax) * 2; - xinc1 = 1; - yinc1 = 0; - } - else - { - numpixels = deltay; - d = 2 * deltax - deltay; - dinc1 = deltax * 2; - dinc2 = (deltax - deltay) * 2; - xinc1 = 0; - yinc1 = 1; - } - numpixels++; /* include endpoints */ - - if (x1 > x2) - { - xinc1 = -xinc1; - xinc2 = -xinc2; - } - - if (y1 > y2) - { - yinc1 = -yinc1; - yinc2 = -yinc2; - } - - x = x1; - y = y1; - - for (i = 0; i < numpixels; i++) - { - if (((unsigned)x < (unsigned)pixel_width) - && ((unsigned)y < (unsigned)pixel_height)) - pfunc(x, y); - - if (d < 0) - { - d += dinc1; - x += xinc1; - y += yinc1; - } - else - { - d += dinc2; - x += xinc2; - y += yinc2; - } - } -} - -/* Draw a horizontal line (optimised) */ -void pgfx_hline(int x1, int x2, int y) -{ - int nx; - unsigned char *dst; - unsigned mask, mask_right; - lcd_blockfunc_type *bfunc; - - /* direction flip */ - if (x2 < x1) - { - nx = x1; - x1 = x2; - x2 = nx; - } - - /* nothing to draw? */ - if (((unsigned)y >= (unsigned)pixel_height) || (x1 >= pixel_width) - || (x2 < 0)) - return; - - /* clipping */ - if (x1 < 0) - x1 = 0; - if (x2 >= pixel_width) - x2 = pixel_width - 1; - - bfunc = pgfx_blockfuncs[drawmode]; - dst = &gfx_buffer[pixel_height * (x1/5) + y]; - nx = x2 - (x1 - (x1 % 5)); - mask = 0x1F >> (x1 % 5); - mask_right = 0x1F0 >> (nx % 5); - - for (; nx >= 5; nx -= 5) - { - bfunc(dst, mask, 0xFFu); - dst += pixel_height; - mask = 0x1F; - } - mask &= mask_right; - bfunc(dst, mask, 0x1F); -} - -/* Draw a vertical line (optimised) */ -void pgfx_vline(int x, int y1, int y2) -{ - int y; - unsigned char *dst, *dst_end; - unsigned mask; - lcd_blockfunc_type *bfunc; - - /* direction flip */ - if (y2 < y1) - { - y = y1; - y1 = y2; - y2 = y; - } - - /* nothing to draw? */ - if (((unsigned)x >= (unsigned)pixel_width) || (y1 >= pixel_height) - || (y2 < 0)) - return; - - /* clipping */ - if (y1 < 0) - y1 = 0; - if (y2 >= pixel_height) - y2 = pixel_height - 1; - - bfunc = pgfx_blockfuncs[drawmode]; - dst = &gfx_buffer[pixel_height * (x/5) + y1]; - mask = 0x10 >> (x % 5); - - dst_end = dst + y2 - y1; - do - bfunc(dst++, mask, 0x1F); - while (dst <= dst_end); -} - -/* Draw a rectangular box */ -void pgfx_drawrect(int x, int y, int width, int height) -{ - if ((width <= 0) || (height <= 0)) - return; - - int x2 = x + width - 1; - int y2 = y + height - 1; - - pgfx_vline(x, y, y2); - pgfx_vline(x2, y, y2); - pgfx_hline(x, x2, y); - pgfx_hline(x, x2, y2); -} - -/* Fill a rectangular area */ -void pgfx_fillrect(int x, int y, int width, int height) -{ - int nx; - unsigned char *dst, *dst_end; - unsigned mask, mask_right; - lcd_blockfunc_type *bfunc; - - /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= pixel_width) - || (y >= pixel_height) || (x + width <= 0) || (y + height <= 0)) - return; - - /* clipping */ - if (x < 0) - { - width += x; - x = 0; - } - if (y < 0) - { - height += y; - y = 0; - } - if (x + width > pixel_width) - width = pixel_width - x; - if (y + height > pixel_height) - height = pixel_height - y; - - bfunc = pgfx_blockfuncs[drawmode]; - dst = &gfx_buffer[pixel_height * (x/5) + y]; - nx = width - 1 + (x % 5); - mask = 0x1F >> (x % 5); - mask_right = 0x1F0 >> (nx % 5); - - for (; nx >= 5; nx -= 5) - { - unsigned char *dst_col = dst; - - dst_end = dst_col + height; - do - bfunc(dst_col++, mask, 0x1F); - while (dst_col < dst_end); - - dst += pixel_height; - mask = 0x1F; - } - mask &= mask_right; - - dst_end = dst + height; - do - bfunc(dst++, mask, 0x1F); - while (dst < dst_end); -} - -/* About PlayerGFX internal bitmap format: - * - * A bitmap contains one bit for every pixel that defines if that pixel is - * black (1) or white (0). Bits within a byte are arranged horizontally, - * MSB at the left. - * The bytes are stored in row-major order, with byte 0 being top left, - * byte 1 2nd from left etc. Each row of bytes defines one pixel row. - * - * This approximates the (even more strange) internal hardware format. */ - -/* Draw a partial bitmap. stride is given in pixels */ -void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, - int stride, int x, int y, int width, int height) -{ - int nx, shift; - unsigned char *dst, *dst_end; - unsigned mask, mask_right; - lcd_blockfunc_type *bfunc; - - /* nothing to draw? */ - if ((width <= 0) || (height <= 0) || (x >= pixel_width) - || (y >= pixel_height) || (x + width <= 0) || (y + height <= 0)) - return; - - /* clipping */ - if (x < 0) - { - width += x; - src_x -= x; - x = 0; - } - if (y < 0) - { - height += y; - src_y -= y; - y = 0; - } - if (x + width > pixel_width) - width = pixel_width - x; - if (y + height > pixel_height) - height = pixel_height - y; - - stride = (stride + 7) >> 3; /* convert to no. of bytes */ - - src += stride * src_y + (src_x >> 3); /* move starting point */ - dst = &gfx_buffer[pixel_height * (x/5) + y]; - shift = 3 + (x % 5) - (src_x & 7); - nx = width - 1 + (x % 5); - - bfunc = pgfx_blockfuncs[drawmode]; - mask = 0x1F >> (x % 5); - mask_right = 0x1F0 >> (nx % 5); - - dst_end = dst + height; - do - { - const unsigned char *src_row = src; - unsigned char *dst_row = dst++; - unsigned mask_row = mask; - unsigned data = *src_row++; - int extrabits = shift; - - for (x = nx; x >= 5; x -= 5) - { - if (extrabits < 0) - { - data = (data << 8) | *src_row++; - extrabits += 8; - } - bfunc(dst_row, mask_row, data >> extrabits); - extrabits -= 5; - dst_row += pixel_height; - mask_row = 0x1F; - } - if (extrabits < 0) - { - data = (data << 8) | *src_row; - extrabits += 8; - } - bfunc(dst_row, mask_row & mask_right, data >> extrabits); - - src += stride; - } - while (dst < dst_end); -} - -/* Draw a full bitmap */ -void pgfx_bitmap(const unsigned char *src, int x, int y, int width, int height) -{ - pgfx_bitmap_part(src, 0, 0, width, x, y, width, height); -} diff --git a/apps/plugins/lib/playergfx.h b/apps/plugins/lib/playergfx.h deleted file mode 100644 index 9f1305af12..0000000000 --- a/apps/plugins/lib/playergfx.h +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* Bitmap graphics on player LCD! -* -* Copyright (C) 2005 Jens Arnold -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -* KIND, either express or implied. -* -****************************************************************************/ - -#ifndef __PGFX_H__ -#define __PGFX_H__ - -#include "plugin.h" - -#ifdef HAVE_LCD_CHARCELLS /* Player only :) */ - -bool pgfx_init(int cwidth, int cheight); -void pgfx_release(void); -void pgfx_display(int cx, int cy); -void pgfx_display_block(int cx, int cy, int x, int y); -void pgfx_update(void); - -void pgfx_set_drawmode(int mode); -int pgfx_get_drawmode(void); - -void pgfx_clear_display(void); -void pgfx_drawpixel(int x, int y); -void pgfx_drawline(int x1, int y1, int x2, int y2); -void pgfx_hline(int x1, int x2, int y); -void pgfx_vline(int x, int y1, int y2); -void pgfx_drawrect(int x, int y, int width, int height); -void pgfx_fillrect(int x, int y, int width, int height); -void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, - int stride, int x, int y, int width, int height); -void pgfx_bitmap(const unsigned char *src, int x, int y, int width, int height); - -#define pgfx_mono_bitmap_part pgfx_bitmap_part -#define pgfx_mono_bitmap pgfx_bitmap - -#endif /* HAVE_LCD_CHARCELLS */ -#endif /* __PGFX_H__ */ diff --git a/apps/plugins/lib/simple_viewer.c b/apps/plugins/lib/simple_viewer.c index 6927d84a96..4c05ee68c5 100644 --- a/apps/plugins/lib/simple_viewer.c +++ b/apps/plugins/lib/simple_viewer.c @@ -64,17 +64,12 @@ static const char* get_next_line(const char *text, struct view_info *info) total = 0; while(*ptr) { -#ifdef HAVE_LCD_CHARCELLS - n = rb->utf8seek(ptr, 1); - w = 1; -#else unsigned short ch; n = ((intptr_t)rb->utf8decode(ptr, &ch) - (intptr_t)ptr); if (rb->is_diacritic(ch, NULL)) w = 0; else w = rb->font_get_width(info->pf, ch); -#endif if (isbrchr(ptr, n)) space = ptr+(isspace(*ptr) || total + w <= info->vp.width? n: 0); if (*ptr == '\n') diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c index e1c570b6a5..60bed3b826 100644 --- a/apps/plugins/logo.c +++ b/apps/plugins/logo.c @@ -19,7 +19,6 @@ * **************************************************************************/ #include "plugin.h" -#include "lib/playergfx.h" #include "lib/pluginlib_actions.h" /* this set the context to use with PLA */ @@ -81,19 +80,9 @@ enum plugin_status plugin_start(const void* parameter) { int y = (DISPLAY_HEIGHT / 2) - (LOGO_HEIGHT / 2); int dx; int dy; -#ifdef HAVE_LCD_CHARCELLS - int cpos = -1; - int old_cpos = -1; -#endif (void)parameter; -#ifdef HAVE_LCD_CHARCELLS - if (!pgfx_init(4, 2)) { - rb->splash(HZ*2, "Old LCD :("); - return PLUGIN_OK; - } -#endif rb->srand(*rb->current_tick); dx = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE; dy = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE; @@ -159,9 +148,6 @@ enum plugin_status plugin_start(const void* parameter) { switch (button) { case LP_QUIT: case LP_QUIT2: -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_OK; case LP_DEC_X: case LP_DEC_X_REPEAT: @@ -184,9 +170,6 @@ enum plugin_status plugin_start(const void* parameter) { default: if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_USB_CONNECTED; } break; diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index eb441eab8d..1b017942a9 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c @@ -144,11 +144,7 @@ static struct viewport vp_lyrics[NB_SCREENS]; #include "lib/pluginlib_actions.h" #define LST_SET_TIME (LST_SET_MSEC|LST_SET_SEC|LST_SET_MIN|LST_SET_HOUR) -#ifdef HAVE_LCD_CHARCELLS -#define LST_OFF_Y 0 -#else /* HAVE_LCD_BITMAP */ #define LST_OFF_Y 1 -#endif static int lrc_set_time(const char *title, const char *unit, long *pval, int step, int min, int max, int flags) { @@ -229,17 +225,11 @@ static int lrc_set_time(const char *title, const char *unit, long *pval, rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_putsxy(x, y*(1+LST_OFF_Y), &buffer[p_start]); rb->lcd_set_drawmode(DRMODE_SOLID); -#else - rb->lcd_put_cursor(x+rb->utf8length(&buffer[p_start])-1, y, 0x7F); #endif } rb->lcd_update(); int button = pluginlib_getaction(TIMEOUT_BLOCK, lst_contexts, ARRAYLEN(lst_contexts)); int mult = 1; -#ifdef HAVE_LCD_CHARCELLS - if (pos_min != pos_max) - rb->lcd_remove_cursor(); -#endif switch (button) { case PLA_UP_REPEAT: @@ -452,9 +442,7 @@ static struct lrc_brpos *calc_brpos(struct lrc_line *lrc_line, int i) int word_count, word_width; const unsigned char *str; } -#ifndef HAVE_LCD_CHARCELLS sp, -#endif cr; lrc_buffer_used = (lrc_buffer_used+3)&~3; /* 4 bytes aligned */ @@ -514,19 +502,15 @@ static struct lrc_brpos *calc_brpos(struct lrc_line *lrc_line, int i) cr.nword = lrc_line->nword; lrc_word = lrc_line->words+cr.nword; cr.str = (lrc_word-1)->word; -#ifndef HAVE_LCD_CHARCELLS sp.word_count = 0; sp.word_width = 0; sp.nword = 0; sp.count = 0; sp.width = 0; -#endif do { cr.count = 0; cr.width = 0; -#ifndef HAVE_LCD_CHARCELLS sp.str = NULL; -#endif while (1) { @@ -541,10 +525,6 @@ static struct lrc_brpos *calc_brpos(struct lrc_line *lrc_line, int i) break; int c, w; -#ifdef HAVE_LCD_CHARCELLS - c = rb->utf8seek(cr.str, 1); - w = 1; -#else c = ((intptr_t)rb->utf8decode(cr.str, &ch) - (intptr_t)cr.str); if (rb->is_diacritic(ch, NULL)) w = 0; @@ -576,7 +556,6 @@ static struct lrc_brpos *calc_brpos(struct lrc_line *lrc_line, int i) } break; } -#endif cr.count += c; cr.width += w; lrc_word->count += c; @@ -1916,38 +1895,6 @@ static void display_lrcs(void) } if (!lrc_line && ypos < vp_lyrics[i].height) display->putsxy(0, ypos, "[end]"); -#else /* HAVE_LCD_CHARCELLS */ - struct lrc_line *lrc_line = lrc_center; - struct lrc_brpos *lrc_brpos = calc_brpos(lrc_line, i); - long elapsed = 0; - const char *str = get_lrc_str(lrc_line); - int x = vp_lyrics[i].width/2, y = 0; - - if (rin >= 0 && len > 0) - { - elapsed = rin * lrc_center->width / len; - while (elapsed > lrc_brpos->width) - { - elapsed -= lrc_brpos->width; - str = lrc_skip_space(str+lrc_brpos->count); - lrc_brpos++; - } - } - rb->strlcpy(temp_buf, str, lrc_brpos->count+1); - - x -= elapsed; - if (x < 0) - display->puts(0, y, temp_buf + rb->utf8seek(temp_buf, -x)); - else - display->puts(x, y, temp_buf); - x += rb->utf8length(temp_buf)+1; - lrc_line = lrc_line->next; - if (!lrc_line && x < vp_lyrics[i].width) - { - if (x < vp_lyrics[i].width/2) - x = vp_lyrics[i].width/2; - display->puts(x, y, "[end]"); - } #endif /* HAVE_LCD_BITMAP */ display->update_viewport(); display->set_viewport(NULL); diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c index 02217390cd..75947df618 100644 --- a/apps/plugins/metronome.c +++ b/apps/plugins/metronome.c @@ -1022,12 +1022,7 @@ static void play_tock(void) static void metronome_draw(struct screen* display, int state) { struct part *ps; -#ifndef HAVE_LCD_BITMAP - char beat1 = ' '; - char beat2 = ' '; -#else int textlen = display->lcdwidth / display->getcharwidth(); -#endif ps = part; display->clear_display(); #ifdef HAVE_LCD_BITMAP diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c index 68938a1f13..28ea9efd93 100644 --- a/apps/plugins/mosaique.c +++ b/apps/plugins/mosaique.c @@ -19,7 +19,6 @@ * **************************************************************************/ #include "plugin.h" -#include "lib/playergfx.h" #include "lib/mylcd.h" #include "lib/pluginlib_actions.h" @@ -59,14 +58,6 @@ enum plugin_status plugin_start(const void* parameter) int sy = 3; (void)parameter; -#ifdef HAVE_LCD_CHARCELLS - if (!pgfx_init(4, 2)) - { - rb->splash(HZ*2, "Old LCD :("); - return PLUGIN_OK; - } - pgfx_display(3, 0); -#endif mylcd_clear_display(); mylcd_set_drawmode(DRMODE_COMPLEMENT); while (1) { @@ -117,9 +108,6 @@ enum plugin_status plugin_start(const void* parameter) case MOSAIQUE_QUIT: case MOSAIQUE_QUIT2: mylcd_set_drawmode(DRMODE_SOLID); -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_OK; case MOSAIQUE_SPEED: @@ -142,9 +130,6 @@ enum plugin_status plugin_start(const void* parameter) if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { mylcd_set_drawmode(DRMODE_SOLID); -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_USB_CONNECTED; } break; diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index add1fc5724..68440e4602 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c @@ -229,9 +229,7 @@ static void generate(void) rb->splashf(HZ, "Couldnt open %s", RFA_FILE); return; } -#ifndef HAVE_LCD_CHARCELLS update_screen(true); -#endif lasttick = *rb->current_tick; if(!custom_dir()) diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 1732d61277..c7968c3e20 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -25,7 +25,6 @@ #include "lib/helper.h" #include "lib/highscore.h" #include "lib/playback_control.h" -#include "lib/playergfx.h" #include "lib/mylcd.h" @@ -770,17 +769,8 @@ extern const fb_data rockblox_background[]; -#else /* HAVE_LCD_CHARCELLS */ - -#define BOARD_HEIGHT 14 - -#define BLOCK_WIDTH 1 -#define BLOCK_HEIGHT 1 -#define BOARD_X 5 -#define BOARD_Y 0 -#define PREVIEW_X 15 -#define PREVIEW_Y 1 - +#else +#error "lcd screen size not defined!" #endif #ifndef HIGHSCORE_SPACE @@ -992,10 +982,6 @@ static void show_details (void) rb->lcd_putsxyf (LABEL_X, SCORE_Y, "%d", rockblox_status.score); rb->lcd_putsxyf (LEVEL_X, LEVEL_Y, "%d", rockblox_status.level); rb->lcd_putsxyf (LINES_X, LINES_Y, "%d", rockblox_status.lines); -#else /* HAVE_LCD_CHARCELLS */ - rb->lcd_putsf (5, 0, "L%d/%d", rockblox_status.level, - rockblox_status.lines); - rb->lcd_putsf (5, 1, "S%d", rockblox_status.score); #endif } @@ -1066,15 +1052,6 @@ static void init_rockblox (bool resume) #ifdef HAVE_LCD_BITMAP rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); -#else /* HAVE_LCD_CHARCELLS */ - pgfx_display (0, 0); - pgfx_display_block (3, 0, 3, 1); - pgfx_display_block (4, 0, 3, 0); - rb->lcd_puts(4, 1, " "); - pgfx_clear_display(); - pgfx_fillrect (3, 0, 2, 14); - pgfx_fillrect (15, 7, 2, 7); - pgfx_update(); #endif if (!resume) { @@ -1200,8 +1177,6 @@ static void refresh_board (void) rb->lcd_hline (BOARD_X + i * BLOCK_WIDTH + 1, BOARD_X + (i + 1) * BLOCK_WIDTH - 1, BOARD_Y + (j + 1) * BLOCK_HEIGHT - 1); -#else /* HAVE_LCD_CHARCELLS */ - pgfx_drawpixel (BOARD_X + i, BOARD_Y + j); #endif } } @@ -1246,8 +1221,6 @@ static void refresh_board (void) rb->lcd_hline (BOARD_X + x * BLOCK_WIDTH + 1, BOARD_X + (x + 1) * BLOCK_WIDTH - 1, BOARD_Y + (y + 1) * BLOCK_HEIGHT - 1); -#else /* HAVE_LCD_CHARCELLS */ - pgfx_drawpixel (BOARD_X + x, BOARD_Y + y); #endif } @@ -1285,8 +1258,6 @@ static void refresh_board (void) rb->lcd_hline (BOARD_X + x * BLOCK_WIDTH + 1, BOARD_X + (x + 1) * BLOCK_WIDTH - 1, BOARD_Y + (y + 1) * BLOCK_HEIGHT - 1); -#else /* HAVE_LCD_CHARCELLS */ - pgfx_drawpixel (BOARD_X + x, BOARD_Y + y); #endif } @@ -1355,8 +1326,6 @@ static void draw_next_block (void) rb->lcd_hline (PREVIEW_X + rx * BLOCK_WIDTH + 1, PREVIEW_X + (rx + 1) * BLOCK_WIDTH - 1, PREVIEW_Y + (ry + 1) * BLOCK_HEIGHT - 1); -#else /* HAVE_LCD_CHARCELLS */ - pgfx_drawpixel (PREVIEW_X + rx, PREVIEW_Y + ry); #endif } @@ -1787,9 +1756,6 @@ enum plugin_status plugin_start (const void *parameter) } } -#ifndef HAVE_LCD_BITMAP - pgfx_release(); -#endif /* Save user's HighScore */ highscore_save(SCORE_FILE, highscores, NUM_SCORES); backlight_use_settings(); diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index 74efb8ea00..f05d3c2a44 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c @@ -19,7 +19,6 @@ * **************************************************************************/ #include "plugin.h" -#include "lib/playergfx.h" #include "lib/mylcd.h" #include "lib/pluginlib_actions.h" @@ -143,11 +142,6 @@ static void snow_init(void) particles[i][0]=-1; particles[i][1]=-1; } -#ifdef HAVE_LCD_CHARCELLS - pgfx_display(0, 0); /* display three times */ - pgfx_display(4, 0); - pgfx_display(8, 0); -#endif mylcd_clear_display(); #ifdef HAVE_REMOTE_LCD rb->lcd_remote_clear_display(); @@ -159,13 +153,6 @@ enum plugin_status plugin_start(const void* parameter) int button; (void)(parameter); -#ifdef HAVE_LCD_CHARCELLS - if (!pgfx_init(4, 2)) - { - rb->splash(HZ*2, "Old LCD :("); - return PLUGIN_OK; - } -#endif #ifdef HAVE_LCD_COLOR rb->lcd_clear_display(); rb->lcd_set_foreground(LCD_WHITE); @@ -186,17 +173,11 @@ enum plugin_status plugin_start(const void* parameter) if ((button == SNOW_QUIT) || (button == SNOW_QUIT2)) { -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_OK; } else if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { -#ifdef HAVE_LCD_CHARCELLS - pgfx_release(); -#endif return PLUGIN_USB_CONNECTED; } } diff --git a/apps/plugins/text_viewer/tv_display.c b/apps/plugins/text_viewer/tv_display.c index 1f8499bed2..d6175b79cf 100644 --- a/apps/plugins/text_viewer/tv_display.c +++ b/apps/plugins/text_viewer/tv_display.c @@ -69,11 +69,6 @@ #define TV_SCROLLBAR_WIDTH rb->global_settings->scrollbar_width #define TV_SCROLLBAR_HEIGHT 4 - -#ifndef HAVE_LCD_BITMAP -#define TV_BOOKMARK_ICON 0xe101 -#endif - struct tv_rect { int x; int y; diff --git a/apps/screen_access.c b/apps/screen_access.c index a966d07876..cdb02a6546 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c @@ -237,15 +237,6 @@ struct screen screens[NB_SCREENS] = .scroll_step=&lcd_scroll_step, #endif /* HAVE_LCD_BITMAP */ -#ifdef HAVE_LCD_CHARCELLS - .double_height=&lcd_double_height, - .putchar=&lcd_putc, - .get_locked_pattern=&lcd_get_locked_pattern, - .define_pattern=&lcd_define_pattern, - .unlock_pattern=&lcd_unlock_pattern, - .icon=&lcd_icon, -#endif /* HAVE_LCD_CHARCELLS */ - .putsxy=&lcd_putsxy, .puts=&lcd_puts, .putsf=&lcd_putsf, @@ -333,13 +324,6 @@ struct screen screens[NB_SCREENS] = .scroll_step=&lcd_remote_scroll_step, #endif /* 1 */ -#if 0 /* no charcell remote LCDs so far */ - .double_height=&lcd_remote_double_height, - .putc=&lcd_remote_putc, - .get_locked_pattern=&lcd_remote_get_locked_pattern, - .define_pattern=&lcd_remote_define_pattern, - .icon=&lcd_remote_icon, -#endif /* 0 */ .putsxy=&lcd_remote_putsxy, .puts=&lcd_remote_puts, .putsf=&lcd_remote_putsf, diff --git a/apps/screen_access.h b/apps/screen_access.h index 6b90bc9313..eab84c9129 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h @@ -37,10 +37,6 @@ void screen_helper_setfont(int font); #define FOR_NB_SCREENS(i) for(int i = 0; i < NB_SCREENS; i++) -#ifdef HAVE_LCD_CHARCELLS -#define MAX_LINES_ON_SCREEN 2 -#endif - typedef void screen_bitmap_part_func(const void *src, int src_x, int src_y, int stride, int x, int y, int width, int height); typedef void screen_bitmap_func(const void *src, int x, int y, int width, @@ -110,15 +106,6 @@ struct screen void (*hline)(int x1, int x2, int y); #endif /* HAVE_LCD_BITMAP || HAVE_REMOTE_LCD */ -#ifdef HAVE_LCD_CHARCELLS /* no charcell remote LCDs so far */ - void (*double_height)(bool on); - /* name it putchar, not putc because putc is a c library function */ - void (*putchar)(int x, int y, unsigned long ucs); - void (*icon)(int icon, bool enable); - unsigned long (*get_locked_pattern)(void); - void (*define_pattern)(unsigned long ucs, const char *pattern); - void (*unlock_pattern)(unsigned long ucs); -#endif void (*putsxy)(int x, int y, const unsigned char *str); void (*puts)(int x, int y, const unsigned char *str); void (*putsf)(int x, int y, const unsigned char *str, ...); diff --git a/apps/screens.c b/apps/screens.c index 52e8cadc7e..ecd406037d 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -763,11 +763,7 @@ int view_runtime(void) struct gui_synclist lists; int action; gui_synclist_init(&lists, runtime_get_data, NULL, false, 2, NULL); -#if !defined(HAVE_LCD_CHARCELLS) gui_synclist_set_title(&lists, str(LANG_RUNNING_TIME), NOICON); -#else - gui_synclist_set_title(&lists, NULL, NOICON); -#endif if(global_settings.talk_menu) gui_synclist_set_voice_callback(&lists, runtime_speak_data); gui_synclist_set_icon_callback(&lists, NULL); diff --git a/apps/status.c b/apps/status.c index 485ca0aa34..57f2984402 100644 --- a/apps/status.c +++ b/apps/status.c @@ -79,31 +79,3 @@ int current_playmode(void) return STATUS_STOP; } - -#if defined(HAVE_LCD_CHARCELLS) -bool record = false; -bool audio = false; -bool param = false; -bool usb = false; - -void status_set_record(bool b) -{ - record = b; -} - -void status_set_audio(bool b) -{ - audio = b; -} - -void status_set_param(bool b) -{ - param = b; -} - -void status_set_usb(bool b) -{ - usb = b; -} - -#endif /* HAVE_LCD_CHARCELLS */ diff --git a/apps/status.h b/apps/status.h index c8ec7bb354..1add203a0c 100644 --- a/apps/status.h +++ b/apps/status.h @@ -21,13 +21,6 @@ #ifndef _STATUS_H #define _STATUS_H -#if defined(HAVE_LCD_CHARCELLS) -extern bool record; -extern bool audio; -extern bool param; -extern bool usb; -#endif - enum playmode { STATUS_PLAY, @@ -48,11 +41,5 @@ int current_playmode(void); #if (CONFIG_PLATFORM & PLATFORM_HOSTED) #include #endif -#ifdef HAVE_LCD_CHARCELLS -void status_set_record(bool b); -void status_set_audio(bool b); -void status_set_param(bool b); -void status_set_usb(bool b); -#endif /* HAVE_LCD_CHARCELLS */ #endif /* _STATUS_H */ diff --git a/apps/tree.c b/apps/tree.c index 9b6ce06af0..fb0d0a3ac5 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -299,10 +299,6 @@ void tree_gui_init(void) strcpy(tc.currdir, "/"); -#ifdef HAVE_LCD_CHARCELLS - FOR_NB_SCREENS(i) - screens[i].double_height(false); -#endif gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL); gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb); gui_synclist_set_icon_callback(&tree_lists, @@ -710,14 +706,12 @@ static int dirbrowse(void) if ((*tc.dirfilter == SHOW_ID3DB && tc.dirlevel == 0) || ((*tc.dirfilter != SHOW_ID3DB && !strcmp(currdir,"/")))) { -#ifdef HAVE_LCD_BITMAP /* charcell doesnt have ACTION_TREE_PGLEFT so this isnt needed */ if (oldbutton == ACTION_TREE_PGLEFT) break; else -#endif return GO_TO_ROOT; } - + #ifdef HAVE_TAGCACHE if (id3db) tagtree_exit(&tc); -- cgit v1.2.3