Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/gui/list.c b/apps/gui/list.c
- index 425cab9a0f..d97981c1ab 100644
- --- a/apps/gui/list.c
- +++ b/apps/gui/list.c
- @@ -99,8 +99,8 @@ static struct viewport parent[NB_SCREENS] =
- {
- .x = 0,
- .y = 0,
- - .width = LCD_WIDTH,
- - .height = LCD_HEIGHT
- + .width = lcd_width,
- + .height = lcd_hight
- },
- };
- diff --git a/apps/logfdisp.c b/apps/logfdisp.c
- index 54c345faae..1aea9da163 100644
- --- a/apps/logfdisp.c
- +++ b/apps/logfdisp.c
- @@ -99,8 +99,8 @@ bool logfdisplay(void)
- font_getstringsize("A", NULL, &delta_y, fontnr);
- buf[1] = '\0';
- - w = LCD_WIDTH;
- - h = LCD_HEIGHT;
- + w = lcd_width;
- + h = lcd_height;
- /* start at the end of the log */
- user_index = compute_nb_lines(w, font) - h/delta_y -1; /* if negative, will be set 0 to zero later */
- diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
- index 5d53cbfe16..5ea75698b3 100644
- --- a/apps/menus/display_menu.c
- +++ b/apps/menus/display_menu.c
- @@ -126,6 +126,8 @@ static int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
- case ACTION_EXIT_MENUITEM:
- button_set_flip(global_settings.flip_display);
- lcd_set_flip(global_settings.flip_display);
- +// viewportmanager_theme_undo(SCREEN_MAIN, true);
- +// viewportmanager_init();
- lcd_update();
- #ifdef HAVE_REMOTE_LCD
- lcd_remote_set_flip(global_settings.remote_flip_display);
- diff --git a/apps/misc.c b/apps/misc.c
- index b9d6bfb1d9..6c2be10e1d 100644
- --- a/apps/misc.c
- +++ b/apps/misc.c
- @@ -766,8 +766,8 @@ int show_logo( void )
- lcd_bmp(&bm_rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 10);
- lcd_setfont(FONT_SYSFIXED);
- lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
- - lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
- - LCD_HEIGHT-font_h, (unsigned char *)version);
- + lcd_putsxy((lcd_width/2) - ((strlen(version)*font_w)/2),
- + lcd_height-font_h, (unsigned char *)version);
- #endif
- lcd_setfont(FONT_UI);
- diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
- index ad99f3959f..5dfb40c52c 100644
- --- a/apps/plugins/CATEGORIES
- +++ b/apps/plugins/CATEGORIES
- @@ -154,6 +154,7 @@ splitedit,apps
- speedread,viewers
- star,games
- starfield,demos
- +starwars,demos
- stats,apps
- stopwatch,apps
- sudoku,games
- diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
- index c3e56af254..31dc235fc4 100644
- --- a/apps/plugins/SOURCES
- +++ b/apps/plugins/SOURCES
- @@ -2,272 +2,273 @@
- #if !defined(SIMULATOR) && (CONFIG_BATTERY_MEASURE != 0)
- battery_bench.c
- #endif
- -chessclock.c
- -credits.c
- -cube.c
- -dict.c
- -jackpot.c
- -keybox.c
- -logo.c
- -lrcplayer.c
- -mosaique.c
- -main_menu_config.c
- -properties.c
- -random_folder_advance_config.c
- -rockblox.c
- -search.c
- -settings_dumper.c
- -snow.c
- -sort.c
- -stats.c
- +/*chessclock.c*/
- +/*credits.c*/
- +/*cube.c*/
- +/*dict.c*/
- +/*jackpot.c*/
- +/*keybox.c*/
- +/*logo.c*/
- +/*lrcplayer.c*/
- +/*mosaique.c*/
- +/*main_menu_config.c*/
- +/*properties.c*/
- +/*random_folder_advance_config.c*/
- +/*rockblox.c*/
- +/*search.c*/
- +/*settings_dumper.c*/
- +/*snow.c*/
- +/*sort.c*/
- +/*stats.c*/
- #ifdef HAVE_TOUCHSCREEN
- stopwatch.lua
- #else
- stopwatch.c
- #endif
- -theme_remove.c
- -vbrfix.c
- -md5sum.c
- -dice.c
- -disktidy.c
- -flipit.c
- -shopper.c
- -resistor.c
- -otp.c
- -
- -#ifdef USB_ENABLE_HID
- -remote_control.c
- -#endif
- +/*theme_remove.c*/
- +/*vbrfix.c*/
- +/*md5sum.c*/
- +/*dice.c*/
- +/*disktidy.c*/
- +/*flipit.c*/
- +/*shopper.c*/
- +/*resistor.c*/
- +/*otp.c*/
- +starwars.c
- +/*#ifdef USB_ENABLE_HID*/
- +/*remote_control.c*/
- +/*#endif*/
- -#ifdef HAVE_BACKLIGHT
- -lamp.c
- -#endif /* HAVE_BACKLIGHT */
- +/*#ifdef HAVE_BACKLIGHT*/
- +/*lamp.c*/
- +/*#endif HAVE_BACKLIGHT */
- -#if CONFIG_CODEC == SWCODEC
- -#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
- -pitch_detector.c
- -#endif
- -mp3_encoder.c
- -wav2wv.c
- -#endif /* CONFIG_CODEC */
- +/*#if CONFIG_CODEC == SWCODEC*/
- +/*#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))*/
- +/*pitch_detector.c*/
- +/*#endif*/
- +
- +/*mp3_encoder.c*/
- +/*wav2wv.c*/
- +/*#endif CONFIG_CODEC */
- -#if CONFIG_RTC
- -alarmclock.c
- -#endif /* CONFIG_RTC */
- +/*#if CONFIG_RTC*/
- +/*alarmclock.c*/
- +/*#endif CONFIG_RTC */
- /* Platform-specific */
- -#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
- -iriverify.c
- -#endif
- +/*#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)*/
- +/*iriverify.c*/
- +/*#endif*/
- -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* those plugins only run on hardware */
- +/*#if (CONFIG_PLATFORM & PLATFORM_NATIVE) those plugins only run on hardware */
- /* Overlays loaders */
- #if defined(HAVE_LCD_COLOR) && \
- (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
- #if (PLUGIN_BUFFER_SIZE > 0x14000) && defined(CPU_ARM)
- -duke3d.c
- +/*duke3d.c
- quake.c
- -wolf3d.c
- +wolf3d.c*/
- #endif
- #endif
- -#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
- +/*#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)*/
- -#if CONFIG_KEYPAD != ONDIO_PAD && CONFIG_KEYPAD != SANSA_M200_PAD \
- - && CONFIG_KEYPAD != HM60X_PAD
- +/*#if CONFIG_KEYPAD != ONDIO_PAD && CONFIG_KEYPAD != SANSA_M200_PAD \*/
- +/* && CONFIG_KEYPAD != HM60X_PAD*/
- /* not enough buttons for rockboy */
- -rockboy.c
- -#endif
- +/*rockboy.c*/
- +/*#endif*/
- -zxbox.c
- -chessbox.c
- -goban.c
- -pictureflow.c
- +/*zxbox.c*/
- +/*chessbox.c*/
- +/*goban.c*/
- +/*pictureflow.c*/
- -#endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
- +/*#endif PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
- -#if CONFIG_CODEC != SWCODEC
- +/*#if CONFIG_CODEC != SWCODEC*/
- -#if defined(HAVE_LCD_BITMAP)
- -splitedit.c
- -#endif
- +/*#if defined(HAVE_LCD_BITMAP)*/
- +/*splitedit.c*/
- +/*#endif*/
- -#if CONFIG_LCD == LCD_SSD1815
- -video.c
- -#endif
- +/*#if CONFIG_LCD == LCD_SSD1815*/
- +/*video.c*/
- +/*#endif*/
- -#endif /* HWCODEC */
- +/*#endif HWCODEC */
- -#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
- - defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
- -alpine_cdc.c
- -#endif
- +/*#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \*/
- +/* defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)*/
- +/*alpine_cdc.c*/
- +/*#endif*/
- -#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
- - defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) || \
- - defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)
- -firmware_flash.c
- -#endif
- +/*#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \*/
- +/* defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) || \*/
- +/* defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)*/
- +/*firmware_flash.c*/
- +/*#endif*/
- -#if defined(IRIVER_H100_SERIES)
- -iriver_flash.c
- -#endif
- +/*#if defined(IRIVER_H100_SERIES)*/
- +/*iriver_flash.c*/
- +/*#endif*/
- -#if (CONFIG_CPU == SH7034)
- -rockbox_flash.c
- -#endif /* CONFIG_CPU */
- +/*#if (CONFIG_CPU == SH7034)*/
- +/*rockbox_flash.c*/
- +/*#endif CONFIG_CPU */
- -#if defined(IPOD_NANO2G)
- -crypt_firmware.c
- -#endif
- +/*#if defined(IPOD_NANO2G)*/
- +/*crypt_firmware.c*/
- +/*#endif*/
- -#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
- -wavplay.c
- -#endif
- +/*#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))*/
- +/*wavplay.c*/
- +/*#endif*/
- -#if (CONFIG_CODEC == MAS3587F)
- -wavrecord.c
- -#endif
- +/*#if (CONFIG_CODEC == MAS3587F)*/
- +/*wavrecord.c*/
- +/*#endif*/
- -#endif /* PLATFORM_NATIVE */
- +/*#endif PLATFORM_NATIVE */
- -metronome.c
- +/*metronome.c*/
- -#ifdef HAVE_LCD_BITMAP /* Not for the Archos Player */
- +/*#ifdef HAVE_LCD_BITMAP Not for the Archos Player */
- -2048.c
- +/*2048.c*/
- /* Lua needs at least 160 KB to work in */
- -#if PLUGIN_BUFFER_SIZE >= 0x80000
- -boomshine.lua
- -#ifdef HAVE_LCD_COLOR
- -pixel-painter.lua
- -#endif /* HAVE_LCD_COLOR */
- -#endif /* PLUGIN_BUFFER_SIZE >= 0x80000 */
- -
- -rockblox1d.c
- -brickmania.c
- -calendar.c
- +/*#if PLUGIN_BUFFER_SIZE >= 0x80000*/
- +/*boomshine.lua*/
- +/*#ifdef HAVE_LCD_COLOR*/
- +/*pixel-painter.lua*/
- +/*#endif HAVE_LCD_COLOR */
- +/*#endif PLUGIN_BUFFER_SIZE >= 0x80000 */
- +
- +/*rockblox1d.c*/
- +/*brickmania.c*/
- +/*calendar.c*/
- maze.c
- -mazezam.c
- -text_editor.c
- -wavview.c
- -robotfindskitten.c
- -xobox.c
- -spacerocks.c
- -
- -blackjack.c
- -bounce.c
- -bubbles.c
- -calculator.c
- -chip8.c
- -chopper.c
- -demystify.c
- -jewels.c
- -minesweeper.c
- -oscilloscope.c
- -pegbox.c
- -periodic_table.c
- -pong.c
- -sliding_puzzle.c
- -snake.c
- -snake2.c
- -solitaire.c
- -sokoban.c
- -star.c
- -starfield.c
- -vu_meter.c
- -wormlet.c
- +/*mazezam.c*/
- +/*text_editor.c*/
- +/*wavview.c*/
- +/*robotfindskitten.c*/
- +/*xobox.c*/
- +/*spacerocks.c*/
- +
- +/*blackjack.c*/
- +/*bounce.c*/
- +/*bubbles.c*/
- +/*calculator.c*/
- +/*chip8.c*/
- +/*chopper.c*/
- +/*demystify.c*/
- +/*jewels.c*/
- +/*minesweeper.c*/
- +/*oscilloscope.c*/
- +/*pegbox.c*/
- +/*periodic_table.c*/
- +/*pong.c*/
- +/*sliding_puzzle.c*/
- +/*snake.c*/
- +/*snake2.c*/
- +/*solitaire.c*/
- +/*sokoban.c*/
- +/*star.c*/
- +/*starfield.c*/
- +/*vu_meter.c*/
- +/*wormlet.c*/
- /* Plugins needing the grayscale lib on low-depth LCDs */
- -fire.c
- -plasma.c
- +/*fire.c*/
- +/*plasma.c*/
- -#ifdef HAVE_LCD_COLOR
- -clix.c
- -codebuster.c
- -#endif
- +/*#ifdef HAVE_LCD_COLOR*/
- +/*clix.c*/
- +/*codebuster.c*/
- +/*#endif*/
- -#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)
- -fireworks.c
- -#endif
- +/*#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)*/
- +/*fireworks.c*/
- +/*#endif*/
- -#if LCD_DEPTH == 16
- +/*#if LCD_DEPTH == 16*/
- /* FIXME: make it work with 24bit (needs lot of memory) */
- -rockpaint.c
- -#endif
- -
- -rocklife.c
- -
- -#endif /* HAVE_LCD_BITMAP */
- -
- -#ifdef HAVE_LCD_CHARCELLS /* Archos Player model only */
- -euroconverter.c
- -nim.c
- -#endif /* HAVE_LCD_CHARCELLS */
- -
- -#if LCD_DEPTH > 1 /* non-mono bitmap targets */
- -
- -matrix.c
- -speedread.c
- -
- -#if (LCD_WIDTH > 138)
- -invadrox.c
- -superdom.c
- -#endif
- -
- -#endif /* LCD_DEPTH > 1 */
- -
- -
- -
- -#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */
- -#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- -test_boost.c
- -#endif
- -#if CONFIG_CODEC == SWCODEC
- -test_codec.c
- -#endif
- -#ifdef HAVE_JPEG
- -test_core_jpeg.c
- -#endif
- -test_disk.c
- -#ifdef HAVE_LCD_BITMAP
- -test_fps.c
- -test_gfx.c
- -#if LCD_DEPTH < 4 && !defined(SIMULATOR)
- -test_scanrate.c
- -#endif
- -#ifndef HAVE_LCD_COLOR
- -test_grey.c
- -test_greylib_bitmap_scale.c
- -#endif
- -#endif
- -test_mem.c
- -#ifdef HAVE_LCD_BITMAP
- -test_mem_jpeg.c
- -#endif
- -#ifdef HAVE_LCD_COLOR
- -test_resize.c
- -#endif
- -#if CONFIG_CODEC == SWCODEC
- -test_sampr.c
- -#endif
- -#ifdef HAVE_TOUCHSCREEN
- -test_touchscreen.c
- -#endif
- -test_viewports.c
- -#endif /* HAVE_TEST_PLUGINS */
- +/*rockpaint.c*/
- +/*#endif*/
- +
- +/*rocklife.c*/
- +
- +/*#endif HAVE_LCD_BITMAP */
- +
- +/*#ifdef HAVE_LCD_CHARCELLS Archos Player model only */
- +/*euroconverter.c*/
- +/*nim.c*/
- +/*#endif HAVE_LCD_CHARCELLS */
- +
- +/*#if LCD_DEPTH > 1 non-mono bitmap targets */
- +
- +/*matrix.c*/
- +/*speedread.c*/
- +
- +/*#if (LCD_WIDTH > 138)*/
- +/*invadrox.c*/
- +/*superdom.c*/
- +/*#endif*/
- +
- +/*#endif LCD_DEPTH > 1 */
- +
- +
- +
- +/*#ifdef HAVE_TEST_PLUGINS enable in advanced build options */
- +/*#ifdef HAVE_ADJUSTABLE_CPU_FREQ*/
- +/*test_boost.c*/
- +/*#endif*/
- +/*#if CONFIG_CODEC == SWCODEC*/
- +/*test_codec.c*/
- +/*#endif*/
- +/*#ifdef HAVE_JPEG*/
- +/*test_core_jpeg.c*/
- +/*#endif*/
- +/*test_disk.c*/
- +/*#ifdef HAVE_LCD_BITMAP*/
- +/*test_fps.c*/
- +/*test_gfx.c*/
- +/*#if LCD_DEPTH < 4 && !defined(SIMULATOR)*/
- +/*test_scanrate.c*/
- +/*#endif*/
- +/*#ifndef HAVE_LCD_COLOR*/
- +/*test_grey.c*/
- +/*test_greylib_bitmap_scale.c*/
- +/*#endif*/
- +/*#endif*/
- +/*test_mem.c*/
- +/*#ifdef HAVE_LCD_BITMAP*/
- +/*test_mem_jpeg.c*/
- +/*#endif*/
- +/*#ifdef HAVE_LCD_COLOR*/
- +/*test_resize.c*/
- +/*#endif*/
- +/*#if CONFIG_CODEC == SWCODEC*/
- +/*test_sampr.c*/
- +/*#endif*/
- +/*#ifdef HAVE_TOUCHSCREEN*/
- +/*test_touchscreen.c*/
- +/*#endif*/
- +/*test_viewports.c*/
- +/*#endif HAVE_TEST_PLUGINS */
- diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
- index 93cf8297b5..88eebd1502 100644
- --- a/apps/plugins/SUBDIRS
- +++ b/apps/plugins/SUBDIRS
- @@ -1,28 +1,28 @@
- /* For all targets */
- -shortcuts
- -text_viewer
- +/*shortcuts*/
- +/*text_viewer*/
- /* For various targets... */
- -#if CONFIG_RTC
- -clock
- -#endif
- +/*#if CONFIG_RTC*/
- +/*clock*/
- +/*#endif*/
- /* For all targets with a bitmap display */
- -#ifdef HAVE_LCD_BITMAP
- +/*#ifdef HAVE_LCD_BITMAP*/
- /* color horizontal-stride LCDs */
- -#if defined(HAVE_LCD_COLOR) && \
- - (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
- -xworld
- +/*#if defined(HAVE_LCD_COLOR) && \*/
- +/* (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))*/
- +/*xworld*/
- /* for duke3d, wolf3d and quake */
- #if (PLUGIN_BUFFER_SIZE > 0x14000) && (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(CPU_ARM)
- -sdl
- +/*sdl*/
- #endif
- puzzles
- -#endif
- +/*#endif*/
- #if (CONFIG_KEYPAD != ONDIO_PAD) /* not enough buttons */ \
- && (CONFIG_KEYPAD != SANSA_M200_PAD) /* not enough buttons */ \
- @@ -31,9 +31,9 @@ puzzles
- && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \
- && (defined(HAVE_LCD_COLOR) || (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) || \
- (LCD_HEIGHT == 128) && (LCD_DEPTH == 2))
- -rockboy
- +/*rockboy*/
- #endif
- -
- +/*
- #if defined(HAVE_TAGCACHE)
- pictureflow
- #endif
- @@ -47,58 +47,58 @@ fractals
- imageviewer
- sudoku
- reversi
- -goban
- +goban*/
- /* setjmp/longjmp are not implemented on sh */
- -#if (CONFIG_CPU != SH7034)
- -frotz
- -#endif
- +/*#if (CONFIG_CPU != SH7034)*/
- +/*frotz*/
- +/*#endif*/
- -#ifndef OLYMPUS_MROBE_500
- -#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000 /* overlay */
- -zxbox
- -#endif
- -#endif
- +/*#ifndef OLYMPUS_MROBE_500*/
- +/*#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000 overlay */
- +/*zxbox*/
- +/*#endif*/
- +/*#endif*/
- -#endif /* HAVE_LCD_BITMAP */
- +/*#endif HAVE_LCD_BITMAP */
- /* For all big enough colour screens, iriver H1x0 and iAudio M5 */
- -#if defined(HAVE_LCD_COLOR) && ( (LCD_HEIGHT >= 90 && LCD_WIDTH >=116) \
- - || (LCD_HEIGHT >= 96 && LCD_WIDTH >=75) ) \
- - || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5)
- -pacbox
- -#endif
- -
- -#if (defined(HAVE_LCD_COLOR) || defined(MROBE_100) || defined(SANSA_CLIPPLUS) \
- - || defined(SANSA_CLIPV2) || (LCD_DEPTH == 2)) \
- - && (MEMORYSIZE > 2 && !defined(RB_PROFILE))
- -doom
- -#endif
- +/*#if defined(HAVE_LCD_COLOR) && ( (LCD_HEIGHT >= 90 && LCD_WIDTH >=116) \*/
- +/* || (LCD_HEIGHT >= 96 && LCD_WIDTH >=75) ) \*/
- +/* || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5)*/
- +/*pacbox*/
- +/*#endif*/
- +
- +/*#if (defined(HAVE_LCD_COLOR) || defined(MROBE_100) || defined(SANSA_CLIPPLUS) \*/
- +/* || defined(SANSA_CLIPV2) || (LCD_DEPTH == 2)) \*/
- +/* && (MEMORYSIZE > 2 && !defined(RB_PROFILE))*/
- +/*doom*/
- +/*#endif*/
- /* For all the swcodec targets */
- -#if CONFIG_CODEC == SWCODEC
- +/*#if CONFIG_CODEC == SWCODEC*/
- -#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
- -midi
- -mikmod
- -#endif
- +/*#if MEMORYSIZE > 2 we need a lot of RAM for instruments */
- +/*midi*/
- +/*mikmod*/
- +/*#endif*/
- /* beatbox */
- -#if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) || \
- - (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_E200_PAD) || \
- - (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
- - (CONFIG_KEYPAD == IPOD_1G2G_PAD || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
- +/*#if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) || \*/
- +/* (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_E200_PAD) || \*/
- +/* (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \*/
- +/* (CONFIG_KEYPAD == IPOD_1G2G_PAD || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)*/
- /* PDBox is confirmed to run on these player models. */
- -pdbox
- -#endif
- +/*pdbox*/
- +/*#endif*/
- -#if !defined(RB_PROFILE) && MEMORYSIZE > 2 /* mpegplayer allocates at least 2MB of RAM */
- -mpegplayer
- -#endif
- +/*#if !defined(RB_PROFILE) && MEMORYSIZE > 2 mpegplayer allocates at least 2MB of RAM */
- +/*mpegplayer*/
- +/*#endif*/
- -#endif /* CONFIG_CODEC == SWCODEC */
- +/*#endif CONFIG_CODEC == SWCODEC */
- /* Lua needs at least 160 KB to work in */
- -#if PLUGIN_BUFFER_SIZE >= 0x80000
- -lua
- -#endif
- +/*#if PLUGIN_BUFFER_SIZE >= 0x80000*/
- +/*lua*/
- +/*#endif*/
- diff --git a/apps/plugins/lib/display_text.c b/apps/plugins/lib/display_text.c
- index 5d13fc678d..1de2527bc2 100644
- --- a/apps/plugins/lib/display_text.c
- +++ b/apps/plugins/lib/display_text.c
- @@ -51,8 +51,8 @@ bool display_text(unsigned short words, char** text, struct style_text* style,
- #endif
- int space_w, width, height;
- unsigned short x , y;
- - unsigned short vp_width = LCD_WIDTH;
- - unsigned short vp_height = LCD_HEIGHT;
- + unsigned short vp_width = lcd_width;
- + unsigned short vp_height = lcd_height;
- unsigned short i = 0, style_index = 0;
- if (vp_text != NULL) {
- vp_width = vp_text->width;
- diff --git a/apps/plugins/lib/xlcd_draw.c b/apps/plugins/lib/xlcd_draw.c
- index 311782c21f..89adf4384c 100644
- --- a/apps/plugins/lib/xlcd_draw.c
- +++ b/apps/plugins/lib/xlcd_draw.c
- @@ -354,7 +354,7 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
- fb_data *dst;
- /* nothing to draw? */
- - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((width <= 0) || (height <= 0) || (x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- return;
- @@ -371,14 +371,14 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
- src_y -= y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- src += stride * src_y + src_x; /* move starting point */
- src_end = src + stride * height;
- - dst = rb->lcd_framebuffer + LCD_WIDTH * y + x;
- + dst = rb->lcd_framebuffer + lcd_width * y + x;
- do
- {
- @@ -399,7 +399,7 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
- #endif
- src += stride;
- - dst += LCD_WIDTH;
- + dst += lcd_width;
- }
- while (src < src_end);
- }
- @@ -421,7 +421,7 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
- fb_data *dst;
- /* nothing to draw? */
- - if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((width <= 0) || (height <= 0) || (x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- return;
- @@ -438,14 +438,14 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
- src_y -= y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- src += 3 * (stride * src_y + src_x); /* move starting point */
- src_end = src + 3 * stride * height;
- - dst = rb->lcd_framebuffer + LCD_WIDTH * y + x;
- + dst = rb->lcd_framebuffer + lcd_width * y + x;
- do
- {
- @@ -472,7 +472,7 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
- while (src_row < row_end);
- src += 3 * stride;
- - dst += LCD_WIDTH;
- + dst += lcd_width;
- }
- while (src < src_end);
- }
- diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c
- index f2fc71ea47..138b87ad6f 100644
- --- a/apps/plugins/lib/xlcd_scroll.c
- +++ b/apps/plugins/lib/xlcd_scroll.c
- @@ -35,20 +35,20 @@ void xlcd_scroll_left(int count)
- {
- int length, oldmode;
- - if ((unsigned)count >= LCD_WIDTH)
- + if ((unsigned)count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
- + length = (lcd_width-count)*LCD_FBHEIGHT;
- - rb->memmove(rb->lcd_framebuffer, rb->lcd_framebuffer + LCD_HEIGHT*count,
- + rb->memmove(rb->lcd_framebuffer, rb->lcd_framebuffer + lcd_height*count,
- length * sizeof(fb_data));
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(LCD_WIDTH-count, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(lcd_width-count, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -57,20 +57,20 @@ void xlcd_scroll_right(int count)
- {
- int length, oldmode;
- - if ((unsigned)count >= LCD_WIDTH)
- + if ((unsigned)count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
- + length = (lcd_width-count)*LCD_FBHEIGHT;
- - rb->memmove(rb->lcd_framebuffer + LCD_HEIGHT*count,
- + rb->memmove(rb->lcd_framebuffer + lcd_height*count,
- rb->lcd_framebuffer, length * sizeof(fb_data));
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(0, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -81,25 +81,25 @@ void xlcd_scroll_up(int count)
- fb_data *data;
- - if ((unsigned)count >= LCD_HEIGHT)
- + if ((unsigned)count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = LCD_HEIGHT - count;
- + length = lcd_height - count;
- - width = LCD_WIDTH-1;
- + width = lcd_width-1;
- data = rb->lcd_framebuffer;
- do {
- rb->memmove(data,data + count,length * sizeof(fb_data));
- - data += LCD_HEIGHT;
- + data += lcd_height;
- } while(width--);
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, length, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, length, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -110,25 +110,25 @@ void xlcd_scroll_down(int count)
- fb_data *data;
- - if ((unsigned)count >= LCD_HEIGHT)
- + if ((unsigned)count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = LCD_HEIGHT - count;
- + length = lcd_height - count;
- - width = LCD_WIDTH-1;
- + width = lcd_width-1;
- data = rb->lcd_framebuffer;
- do {
- rb->memmove(data + count, data, length * sizeof(fb_data));
- - data += LCD_HEIGHT;
- + data += lcd_height;
- } while(width--);
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, 0, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- #else
- @@ -141,7 +141,7 @@ void xlcd_scroll_left(int count)
- int bitcount=0, oldmode;
- int blockcount=0, blocklen;
- - if ((unsigned) count >= LCD_WIDTH)
- + if ((unsigned) count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- @@ -156,7 +156,7 @@ void xlcd_scroll_left(int count)
- if (blockcount)
- {
- unsigned char *data = rb->lcd_framebuffer;
- - unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
- + unsigned char *data_end = data + LCD_FBWIDTH*lcd_height;
- do
- {
- @@ -173,7 +173,7 @@ void xlcd_scroll_left(int count)
- unsigned fill = (0x55 * (~rb->lcd_get_background() & 3)) << bitcount;
- #endif
- - for (y = 0; y < LCD_HEIGHT; y++)
- + for (y = 0; y < lcd_height; y++)
- {
- unsigned char *row_addr = addr;
- unsigned data = fill;
- @@ -189,7 +189,7 @@ void xlcd_scroll_left(int count)
- }
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(LCD_WIDTH - count, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(lcd_width - count, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -199,7 +199,7 @@ void xlcd_scroll_right(int count)
- int bitcount=0, oldmode;
- int blockcount=0, blocklen;
- - if ((unsigned) count >= LCD_WIDTH)
- + if ((unsigned) count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- @@ -214,7 +214,7 @@ void xlcd_scroll_right(int count)
- if (blockcount)
- {
- unsigned char *data = rb->lcd_framebuffer;
- - unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
- + unsigned char *data_end = data + LCD_FBWIDTH*lcd_height;
- do
- {
- @@ -231,7 +231,7 @@ void xlcd_scroll_right(int count)
- unsigned fill = 0x55 * (~rb->lcd_get_background() & 3);
- #endif
- - for (y = 0; y < LCD_HEIGHT; y++)
- + for (y = 0; y < lcd_height; y++)
- {
- unsigned char *row_addr = addr;
- unsigned data = fill;
- @@ -247,7 +247,7 @@ void xlcd_scroll_right(int count)
- }
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(0, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -259,26 +259,26 @@ void xlcd_scroll_left(int count)
- fb_data *data, *data_end;
- int length, oldmode;
- - if ((unsigned)count >= LCD_WIDTH)
- + if ((unsigned)count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- }
- data = rb->lcd_framebuffer;
- - data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
- - length = LCD_WIDTH - count;
- + data_end = data + lcd_width*LCD_FBHEIGHT;
- + length = lcd_width - count;
- do
- {
- rb->memmove(data, data + count, length * sizeof(fb_data));
- - data += LCD_WIDTH;
- + data += lcd_width;
- }
- while (data < data_end);
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(length, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(length, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -288,26 +288,26 @@ void xlcd_scroll_right(int count)
- fb_data *data, *data_end;
- int length, oldmode;
- - if ((unsigned)count >= LCD_WIDTH)
- + if ((unsigned)count >= lcd_width)
- {
- rb->lcd_clear_display();
- return;
- }
- data = rb->lcd_framebuffer;
- - data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
- - length = LCD_WIDTH - count;
- + data_end = data + lcd_width*LCD_FBHEIGHT;
- + length = lcd_width - count;
- do
- {
- rb->memmove(data + count, data, length * sizeof(fb_data));
- - data += LCD_WIDTH;
- + data += lcd_width;
- }
- while (data < data_end);
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
- + rb->lcd_fillrect(0, 0, count, lcd_height);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -320,13 +320,13 @@ void xlcd_scroll_up(int count)
- {
- int length, oldmode;
- - if ((unsigned)count >= LCD_HEIGHT)
- + if ((unsigned)count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = LCD_HEIGHT - count;
- + length = lcd_height - count;
- rb->memmove(rb->lcd_framebuffer,
- rb->lcd_framebuffer + count * LCD_FBWIDTH,
- @@ -334,7 +334,7 @@ void xlcd_scroll_up(int count)
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, length, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, length, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -343,13 +343,13 @@ void xlcd_scroll_down(int count)
- {
- int length, oldmode;
- - if ((unsigned)count >= LCD_HEIGHT)
- + if ((unsigned)count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- }
- - length = LCD_HEIGHT - count;
- + length = lcd_height - count;
- rb->memmove(rb->lcd_framebuffer + count * LCD_FBWIDTH,
- rb->lcd_framebuffer,
- @@ -357,7 +357,7 @@ void xlcd_scroll_down(int count)
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, 0, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -370,7 +370,7 @@ void xlcd_scroll_up(int count)
- int bitcount=0, oldmode;
- int blockcount=0, blocklen;
- - if ((unsigned) count >= LCD_HEIGHT)
- + if ((unsigned) count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- @@ -509,7 +509,7 @@ void xlcd_scroll_up(int count)
- const unsigned fill = 0;
- #endif
- - for (x = 0; x < LCD_WIDTH; x++)
- + for (x = 0; x < lcd_width; x++)
- {
- unsigned char *col_addr = addr++;
- unsigned data = fill;
- @@ -534,7 +534,7 @@ void xlcd_scroll_up(int count)
- mask = (0xFFu >> bitcount) << bitcount;
- mask |= mask << 8;
- - for (x = 0; x < LCD_WIDTH; x++)
- + for (x = 0; x < lcd_width; x++)
- {
- fb_data *col_addr = addr++;
- unsigned olddata = fill;
- @@ -554,7 +554,7 @@ void xlcd_scroll_up(int count)
- }
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, LCD_HEIGHT - count, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, lcd_height - count, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- @@ -564,7 +564,7 @@ void xlcd_scroll_down(int count)
- int bitcount=0, oldmode;
- int blockcount=0, blocklen;
- - if ((unsigned) count >= LCD_HEIGHT)
- + if ((unsigned) count >= lcd_height)
- {
- rb->lcd_clear_display();
- return;
- @@ -653,7 +653,7 @@ void xlcd_scroll_down(int count)
- : /* outputs */
- : /* inputs */
- [addr]"r"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
- - [wide]"r"(LCD_WIDTH),
- + [wide]"r"(lcd_width),
- [rows]"r"(blocklen),
- [cnt] "r"(bitcount)
- : /* clobbers */
- @@ -685,7 +685,7 @@ void xlcd_scroll_down(int count)
- "bne.b .sd_cloop \n"
- : /* outputs */
- : /* inputs */
- - [wide]"r"(LCD_WIDTH),
- + [wide]"r"(lcd_width),
- [rows]"r"(blocklen),
- [addr]"a"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
- [cnt] "d"(bitcount),
- @@ -702,7 +702,7 @@ void xlcd_scroll_down(int count)
- const unsigned fill = 0;
- #endif
- - for (x = 0; x < LCD_WIDTH; x++)
- + for (x = 0; x < lcd_width; x++)
- {
- unsigned char *col_addr = addr++;
- unsigned data = fill;
- @@ -727,7 +727,7 @@ void xlcd_scroll_down(int count)
- mask = (0xFFu >> bitcount) << bitcount;
- mask |= mask << 8;
- - for (x = 0; x < LCD_WIDTH; x++)
- + for (x = 0; x < lcd_width; x++)
- {
- fb_data *col_addr = addr++;
- unsigned olddata = fill;
- @@ -747,7 +747,7 @@ void xlcd_scroll_down(int count)
- }
- oldmode = rb->lcd_get_drawmode();
- rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- - rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
- + rb->lcd_fillrect(0, 0, lcd_width, count);
- rb->lcd_set_drawmode(oldmode);
- }
- diff --git a/apps/plugins/puzzles/puzzles.make b/apps/plugins/puzzles/puzzles.make
- index 604208cbdd..7f53517cc5 100644
- --- a/apps/plugins/puzzles/puzzles.make
- +++ b/apps/plugins/puzzles/puzzles.make
- @@ -37,7 +37,7 @@ endif
- PUZZLESFLAGS = -I$(PUZZLES_SRCDIR)/dummy $(filter-out \
- -O%,$(PLUGINFLAGS)) $(PUZZLES_OPTIMIZE) \
- -Wno-unused-parameter -Wno-sign-compare \
- - -Wno-strict-aliasing -DFOR_REAL \
- + -Wno-strict-aliasing -DFOR_REAL -DDEBUG_MENU \
- -I$(PUZZLES_SRCDIR)/src -I$(PUZZLES_SRCDIR) -include \
- $(PUZZLES_SRCDIR)/rbcompat.h -ffunction-sections \
- -fdata-sections -w -Wl,--gc-sections
- diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
- index ddcad4fa59..7e945efed5 100644
- --- a/apps/plugins/puzzles/rockbox.c
- +++ b/apps/plugins/puzzles/rockbox.c
- @@ -48,6 +48,8 @@
- /* how many ticks between timer callbacks */
- #define TIMER_INTERVAL (HZ / 50)
- +#define LCD_WIDTH 320
- +#define LCD_HEIGHT 240
- /* no c200v2 */
- #if PLUGIN_BUFFER_SIZE > 0x14000
- diff --git a/apps/plugins/starwars.c b/apps/plugins/starwars.c
- new file mode 100644
- index 0000000000..f23bf41549
- --- /dev/null
- +++ b/apps/plugins/starwars.c
- @@ -0,0 +1,66 @@
- +#include "plugin.h"
- +#include "lib/pluginlib_actions.h"
- +#include "lib/pluginlib_exit.h"
- +#include "lib/helper.h"
- +
- +static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
- +
- +void myread_line(int fd, char *buf, size_t sz)
- +{
- + if(rb->read_line(fd, buf, sz) < 0)
- + {
- + rb->close(fd);
- + backlight_use_settings();
- + exit(PLUGIN_OK);
- + }
- +}
- +
- +enum plugin_status plugin_start(const void* param)
- +{
- + (void) param;
- +
- + int frametime;
- + char delaybuf[8] = { 0 };
- + char linebuf[80];
- +
- +
- + int fd = rb->open("/data", O_RDONLY);
- +
- + rb->lcd_setfont(rb->font_load("/.rockbox/fonts/07-Fixed.fnt"));
- +
- + backlight_ignore_timeout();
- +
- + while(1)
- + {
- + rb->lcd_clear_display();
- +
- + myread_line(fd, delaybuf, sizeof(delaybuf));
- + frametime = rb->atoi(delaybuf);
- +
- + for(int i = 0; i < 13; ++i)
- + {
- + myread_line(fd, linebuf, sizeof(linebuf));
- + rb->lcd_puts(0, i, linebuf);
- + }
- +
- + rb->lcd_update_rect(0, 0, 320,240);
- + for(int i = 0; i < frametime; ++i)
- + {
- + /* one timeslice = 1/15 second */
- + const int slice_ticks = 1/15.0 * HZ;
- + rb->sleep(slice_ticks);
- + }
- + int button = pluginlib_getaction(0, plugin_contexts, ARRAYLEN(plugin_contexts));
- + switch(button)
- + {
- + case PLA_EXIT:
- + rb->close(fd);
- + backlight_use_settings();
- + return PLUGIN_OK;
- + default:
- + exit_on_usb(button);
- + }
- +
- + rb->yield();
- + }
- +}
- diff --git a/apps/screens.c b/apps/screens.c
- index 9cb5ebe258..0e9899a5dd 100644
- --- a/apps/screens.c
- +++ b/apps/screens.c
- @@ -91,7 +91,7 @@ int mmc_remove_request(void)
- static void charging_display_info(bool animate)
- {
- unsigned char charging_logo[36];
- - const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
- + const int pox_x = (lcd_width - sizeof(charging_logo)) / 2;
- const int pox_y = 32;
- static unsigned phase = 3;
- unsigned i;
- @@ -1097,9 +1097,9 @@ static int get_sample(struct touchscreen_calibration *cal, int x, int y, int i,
- int calibrate(void)
- {
- short points[3][2] = {
- - {LCD_WIDTH/10, LCD_HEIGHT/10},
- - {7*LCD_WIDTH/8, LCD_HEIGHT/2},
- - {LCD_WIDTH/2, 7*LCD_HEIGHT/8}
- + {lcd_width/10, lcd_height/10},
- + {7*lcd_width/8, lcd_height/2},
- + {lcd_width/2, 7*lcd_height/8}
- };
- struct screen* screen = &screens[SCREEN_MAIN];
- enum touchscreen_mode old_mode = touchscreen_get_mode();
- diff --git a/apps/settings.h b/apps/settings.h
- index b72eec6f8b..afe89192bb 100644
- --- a/apps/settings.h
- +++ b/apps/settings.h
- @@ -651,7 +651,7 @@ struct user_settings
- bool invert; /* invert display */
- #endif
- #ifdef HAVE_LCD_FLIP
- - bool flip_display; /* turn display (and button layout) by 180 degrees */
- + int flip_display; /* turn display (and button layout) by 180 degrees */
- #endif
- int cursor_style; /* style of the selection cursor */
- int screen_scroll_step;
- diff --git a/apps/settings_list.c b/apps/settings_list.c
- index bc03672aeb..d8e5f6c441 100644
- --- a/apps/settings_list.c
- +++ b/apps/settings_list.c
- @@ -944,8 +944,16 @@ const struct settings_list settings[] = {
- LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display),
- #endif
- #ifdef HAVE_LCD_FLIP
- +#if HAVE_LCD_FLIP==4
- + CHOICE_SETTING(1, flip_display, LANG_FLIP_DISPLAY,
- + 0,"flip display",
- + "none,upside down,landscape,flipped landscape",
- + NULL, 4,
- + "None","Upside down","Landscape","Flipped landscape"),
- +#else
- OFFON_SETTING(0, flip_display, LANG_FLIP_DISPLAY, false, "flip display",
- NULL),
- +#endif
- #endif
- /* display */
- CHOICE_SETTING(F_TEMPVAR|F_THEMESETTING, cursor_style, LANG_INVERT_CURSOR,
- diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
- index a7e80c7244..075bc734da 100644
- --- a/firmware/drivers/lcd-16bit-common.c
- +++ b/firmware/drivers/lcd-16bit-common.c
- @@ -43,7 +43,7 @@ void lcd_clear_viewport(void)
- #if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- - if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- return;
- @@ -58,10 +58,10 @@ void lcd_clear_viewport(void)
- height += y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- #endif
- len = STRIDE_MAIN(width, height);
- @@ -183,7 +183,7 @@ void lcd_fillrect(int x, int y, int width, int height)
- #if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- - if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- return;
- @@ -198,10 +198,10 @@ void lcd_fillrect(int x, int y, int width, int height)
- height += y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- #endif
- /* drawmode and optimisation */
- @@ -317,7 +317,7 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
- #if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- - if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- return;
- @@ -334,10 +334,10 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
- src_y -= y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- #endif
- src += stride * (src_y >> 3) + src_x; /* move starting point */
- @@ -582,7 +582,7 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
- #if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- - if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- + if ((x >= lcd_width) || (y >= lcd_height)
- || (x + width <= 0) || (y + height <= 0))
- {
- BLEND_FINISH;
- @@ -602,10 +602,10 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
- src_y -= y;
- y = 0;
- }
- - if (x + width > LCD_WIDTH)
- - width = LCD_WIDTH - x;
- - if (y + height > LCD_HEIGHT)
- - height = LCD_HEIGHT - y;
- + if (x + width > lcd_width)
- + width = lcd_width - x;
- + if (y + height > lcd_height)
- + height = lcd_height - y;
- #endif
- /* the following drawmode combinations are possible:
- diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
- index b792be4e02..829e69d66c 100644
- --- a/firmware/drivers/lcd-16bit.c
- +++ b/firmware/drivers/lcd-16bit.c
- @@ -92,15 +92,15 @@ void lcd_hline(int x1, int x2, int y)
- #if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- - if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
- + if (((unsigned)y >= (unsigned) lcd_height) || (x1 >= lcd_width)
- || (x2 < 0))
- return;
- /* clipping */
- if (x1 < 0)
- x1 = 0;
- - if (x2 >= LCD_WIDTH)
- - x2 = LCD_WIDTH-1;
- + if (x2 >= lcd_width)
- + x2 = lcd_width-1;
- #endif
- width = x2 - x1 + 1;
- diff --git a/firmware/drivers/lcd-color-common.c b/firmware/drivers/lcd-color-common.c
- index c8bfd2d6b3..24f936babd 100644
- --- a/firmware/drivers/lcd-color-common.c
- +++ b/firmware/drivers/lcd-color-common.c
- @@ -36,7 +36,7 @@ enum fill_opt {
- };
- /*** globals ***/
- -fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH]
- +fb_data lcd_static_framebuffer[LCD_FBWIDTH][LCD_FBHEIGHT]
- IRAM_LCDFRAMEBUFFER CACHEALIGN_AT_LEAST_ATTR(16);
- fb_data *lcd_framebuffer = &lcd_static_framebuffer[0][0];
- diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
- index 2a57619b06..cf8698b6ef 100644
- --- a/firmware/export/config/sansafuzeplus.h
- +++ b/firmware/export/config/sansafuzeplus.h
- @@ -33,7 +33,7 @@
- #define HAVE_LCD_BITMAP
- /* define this if you have a colour LCD */
- #define HAVE_LCD_COLOR
- -#define HAVE_LCD_FLIP
- +#define HAVE_LCD_FLIP 4
- #define HAVE_LCD_INVERT
- #ifndef BOOTLOADER
- diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
- index 80ef45a573..3f9cca343d 100644
- --- a/firmware/export/lcd.h
- +++ b/firmware/export/lcd.h
- @@ -34,6 +34,8 @@
- (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER)
- #define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
- +short lcd_height;
- +short lcd_width;
- struct viewport {
- int x;
- @@ -483,7 +485,7 @@ static inline unsigned fb_to_scalar(fb_data p)
- #endif
- /* The actual framebuffer */
- extern fb_data *lcd_framebuffer;
- -extern fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
- +extern fb_data lcd_static_framebuffer[LCD_FBWIDTH][LCD_FBHEIGHT];
- #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
- #define FBADDR(x, y) (lcd_framebuffer + ((x) * LCD_FBHEIGHT) + (y))
- #else
- @@ -551,7 +553,7 @@ extern void lcd_set_invert_display(bool yesno);
- #ifdef HAVE_BACKLIGHT_INVERSION
- extern void lcd_set_backlight_inversion(bool yesno);
- #endif /* HAVE_BACKLIGHT_INVERSION */
- -extern void lcd_set_flip(bool yesno);
- +extern void lcd_set_flip(int direction);
- extern void lcd_set_drawmode(int mode);
- extern int lcd_get_drawmode(void);
- diff --git a/firmware/screendump.c b/firmware/screendump.c
- index 1acaaafba6..5915815a35 100644
- --- a/firmware/screendump.c
- +++ b/firmware/screendump.c
- @@ -62,8 +62,8 @@ static const unsigned char bmpheader[] =
- LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
- 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */
- - LE32_CONST(LCD_WIDTH), /* Width in pixels */
- LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */
- + LE32_CONST(LCD_WIDTH), /* Width in pixels */
- 0x01, 0x00, /* Number of planes (always 1) */
- LE16_CONST(DUMP_BMP_BPP), /* Bits per pixel 1/4/8/16/24 */
- LE32_CONST(BMP_COMPRESSION),/* Compression mode */
- diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
- index 224ff3d0fc..35cf2b8746 100644
- --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
- +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
- @@ -48,6 +48,9 @@ static int lcd_reg_0x61_val = 1; /* used to invert display */
- #ifdef HAVE_LCD_FLIP
- static int lcd_reg_3_val = 0x1030; /* controls to flip display */
- #endif
- +short lcd_height = LCD_HEIGHT;
- +short lcd_width = LCD_WIDTH;
- +
- static enum lcd_kind_t
- {
- @@ -543,32 +546,57 @@ void lcd_set_invert_display(bool yesno)
- #endif
- #ifdef HAVE_LCD_FLIP
- -void lcd_set_flip(bool yesno)
- +void lcd_set_flip(int direction)
- {
- - lcd_reg_3_val = yesno ? 0x1000 : 0x1030;
- + switch(direction)
- + {
- + case 1:
- + lcd_reg_3_val = 0x1000;
- + lcd_height = LCD_HEIGHT;
- + lcd_width = LCD_WIDTH;
- + break;
- + case 2:
- + lcd_reg_3_val = 0x1028;
- + lcd_height = LCD_WIDTH;
- + lcd_width = LCD_HEIGHT;
- + break;
- + case 3:
- + lcd_reg_3_val = 0x1018;
- + lcd_height = LCD_WIDTH;
- + lcd_width = LCD_HEIGHT;
- + screens[0].lcdheight=lcd_height;
- + screens[0].lcdwidth=lcd_width;
- + break;
- + case 0:
- + default:
- + lcd_reg_3_val = 0x1030;
- + lcd_height = LCD_HEIGHT;
- + lcd_width = LCD_WIDTH;
- + break;
- + }
- #ifdef HAVE_LCD_ENABLE
- if(!lcd_on)
- return;
- #endif
- - /* same for both kinds */
- + /* same for all kinds */
- lcd_write_reg(3, lcd_reg_3_val);
- }
- #endif
- void lcd_update(void)
- {
- - lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
- + lcd_update_rect(0, 0, lcd_width, lcd_height);
- }
- void lcd_update_rect(int x, int y, int w, int h)
- {
- - #ifdef HAVE_LCD_ENABLE
- +#ifdef HAVE_LCD_ENABLE
- if(!lcd_on)
- return;
- - #endif
- +#endif
- /* make sure the rectangle is bounded in the screen */
- - if (w > LCD_WIDTH - x)/* Clip right */
- - w = LCD_WIDTH - x;
- + if (w > lcd_width - x)/* Clip right */
- + w = lcd_width - x;
- if (x < 0)/* Clip left */
- {
- w += x;
- @@ -577,8 +605,8 @@ void lcd_update_rect(int x, int y, int w, int h)
- if (w <= 0)
- return; /* nothing left to do */
- - if (h > LCD_HEIGHT - y) /* Clip bottom */
- - h = LCD_HEIGHT - y;
- + if (h > lcd_height - y) /* Clip bottom */
- + h = lcd_height - y;
- if (y < 0) /* Clip top */
- {
- h += y;
- @@ -588,12 +616,24 @@ void lcd_update_rect(int x, int y, int w, int h)
- return; /* nothing left to do */
- imx233_lcdif_wait_ready();
- - lcd_write_reg(0x50, x);
- - lcd_write_reg(0x51, x + w - 1);
- - lcd_write_reg(0x52, y);
- - lcd_write_reg(0x53, y + h - 1);
- - lcd_write_reg(0x20, x);
- - lcd_write_reg(0x21, y);
- + if( lcd_reg_3_val & 8)
- +// if( lcd_read_reg(3) == 0x1018)
- + {
- + lcd_write_reg(0x50, lcd_height - y - h);
- + lcd_write_reg(0x51, lcd_height - y - 1);
- + lcd_write_reg(0x52, x);
- + lcd_write_reg(0x53, x + w - 1);
- + lcd_write_reg(0x20, y);
- + lcd_write_reg(0x21, x);
- + }else
- + {
- + lcd_write_reg(0x50, x);
- + lcd_write_reg(0x51, x + w - 1);
- + lcd_write_reg(0x52, y);
- + lcd_write_reg(0x53, y + h - 1);
- + lcd_write_reg(0x20, x);
- + lcd_write_reg(0x21, y);
- + }
- lcd_write_reg(0x22, 0);
- imx233_lcdif_wait_ready();
- imx233_lcdif_set_word_length(16);
- @@ -608,11 +648,13 @@ void lcd_update_rect(int x, int y, int w, int h)
- * the clock runs at 24MHz which provides barely 10MB/s bandwidth compared to >100MB/s
- * for memcopy operations
- */
- - if(w == LCD_WIDTH)
- +#if 0
- + if(w == lcd_width)
- {
- memcpy((void *)FRAME, FBADDR(x,y), w * h * sizeof(fb_data));
- }
- else
- +#endif
- {
- for(int i = 0; i < h; i++)
- memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data));
- diff --git a/uisimulator/common/lcd-common.c b/uisimulator/common/lcd-common.c
- index 0c8e0dcad5..222a5c0aaf 100644
- --- a/uisimulator/common/lcd-common.c
- +++ b/uisimulator/common/lcd-common.c
- @@ -38,10 +38,17 @@ static bool lcd_enabled = false;
- static bool lcd_sleeping = true;
- #endif
- +#if HAVE_LCD_FLIP==4
- +void lcd_set_flip(int direction)
- +{
- + (void)direction;
- +}
- +#else
- void lcd_set_flip(bool yesno)
- {
- (void)yesno;
- }
- +#endif
- void lcd_set_invert_display(bool invert)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement