Advertisement
Guest User

Untitled

a guest
Aug 1st, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 48.40 KB | None | 0 0
  1. diff --git a/apps/gui/list.c b/apps/gui/list.c
  2. index 425cab9a0f..d97981c1ab 100644
  3. --- a/apps/gui/list.c
  4. +++ b/apps/gui/list.c
  5. @@ -99,8 +99,8 @@ static struct viewport parent[NB_SCREENS] =
  6.      {
  7.          .x        = 0,
  8.          .y        = 0,
  9. -        .width    = LCD_WIDTH,
  10. -        .height   = LCD_HEIGHT
  11. +        .width    = lcd_width,
  12. +        .height   = lcd_hight
  13.      },
  14.  };
  15.  
  16. diff --git a/apps/logfdisp.c b/apps/logfdisp.c
  17. index 54c345faae..1aea9da163 100644
  18. --- a/apps/logfdisp.c
  19. +++ b/apps/logfdisp.c
  20. @@ -99,8 +99,8 @@ bool logfdisplay(void)
  21.      font_getstringsize("A", NULL, &delta_y, fontnr);
  22.      
  23.      buf[1] = '\0';
  24. -    w = LCD_WIDTH;
  25. -    h = LCD_HEIGHT;
  26. +    w = lcd_width;
  27. +    h = lcd_height;
  28.      /* start at the end of the log */
  29.      user_index = compute_nb_lines(w, font) - h/delta_y -1; /* if negative, will be set 0 to zero later */
  30.  
  31. diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
  32. index 5d53cbfe16..5ea75698b3 100644
  33. --- a/apps/menus/display_menu.c
  34. +++ b/apps/menus/display_menu.c
  35. @@ -126,6 +126,8 @@ static int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
  36.          case ACTION_EXIT_MENUITEM:
  37.              button_set_flip(global_settings.flip_display);
  38.              lcd_set_flip(global_settings.flip_display);
  39. +//            viewportmanager_theme_undo(SCREEN_MAIN, true);
  40. +//            viewportmanager_init();
  41.              lcd_update();
  42.  #ifdef HAVE_REMOTE_LCD
  43.              lcd_remote_set_flip(global_settings.remote_flip_display);
  44. diff --git a/apps/misc.c b/apps/misc.c
  45. index b9d6bfb1d9..6c2be10e1d 100644
  46. --- a/apps/misc.c
  47. +++ b/apps/misc.c
  48. @@ -766,8 +766,8 @@ int show_logo( void )
  49.      lcd_bmp(&bm_rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 10);
  50.      lcd_setfont(FONT_SYSFIXED);
  51.      lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
  52. -    lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
  53. -               LCD_HEIGHT-font_h, (unsigned char *)version);
  54. +    lcd_putsxy((lcd_width/2) - ((strlen(version)*font_w)/2),
  55. +               lcd_height-font_h, (unsigned char *)version);
  56.  #endif
  57.      lcd_setfont(FONT_UI);
  58.  
  59. diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
  60. index ad99f3959f..5dfb40c52c 100644
  61. --- a/apps/plugins/CATEGORIES
  62. +++ b/apps/plugins/CATEGORIES
  63. @@ -154,6 +154,7 @@ splitedit,apps
  64.  speedread,viewers
  65.  star,games
  66.  starfield,demos
  67. +starwars,demos
  68.  stats,apps
  69.  stopwatch,apps
  70.  sudoku,games
  71. diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
  72. index c3e56af254..31dc235fc4 100644
  73. --- a/apps/plugins/SOURCES
  74. +++ b/apps/plugins/SOURCES
  75. @@ -2,272 +2,273 @@
  76.  #if !defined(SIMULATOR) && (CONFIG_BATTERY_MEASURE != 0)
  77.  battery_bench.c
  78.  #endif
  79. -chessclock.c
  80. -credits.c
  81. -cube.c
  82. -dict.c
  83. -jackpot.c
  84. -keybox.c
  85. -logo.c
  86. -lrcplayer.c
  87. -mosaique.c
  88. -main_menu_config.c
  89. -properties.c
  90. -random_folder_advance_config.c
  91. -rockblox.c
  92. -search.c
  93. -settings_dumper.c
  94. -snow.c
  95. -sort.c
  96. -stats.c
  97. +/*chessclock.c*/
  98. +/*credits.c*/
  99. +/*cube.c*/
  100. +/*dict.c*/
  101. +/*jackpot.c*/
  102. +/*keybox.c*/
  103. +/*logo.c*/
  104. +/*lrcplayer.c*/
  105. +/*mosaique.c*/
  106. +/*main_menu_config.c*/
  107. +/*properties.c*/
  108. +/*random_folder_advance_config.c*/
  109. +/*rockblox.c*/
  110. +/*search.c*/
  111. +/*settings_dumper.c*/
  112. +/*snow.c*/
  113. +/*sort.c*/
  114. +/*stats.c*/
  115.  #ifdef HAVE_TOUCHSCREEN
  116.  stopwatch.lua
  117.  #else
  118.  stopwatch.c
  119.  #endif
  120. -theme_remove.c
  121. -vbrfix.c
  122. -md5sum.c
  123. -dice.c
  124. -disktidy.c
  125. -flipit.c
  126. -shopper.c
  127. -resistor.c
  128. -otp.c
  129. -
  130. -#ifdef USB_ENABLE_HID
  131. -remote_control.c
  132. -#endif
  133. +/*theme_remove.c*/
  134. +/*vbrfix.c*/
  135. +/*md5sum.c*/
  136. +/*dice.c*/
  137. +/*disktidy.c*/
  138. +/*flipit.c*/
  139. +/*shopper.c*/
  140. +/*resistor.c*/
  141. +/*otp.c*/
  142. +starwars.c
  143.  
  144. +/*#ifdef USB_ENABLE_HID*/
  145. +/*remote_control.c*/
  146. +/*#endif*/
  147.  
  148.  
  149. -#ifdef HAVE_BACKLIGHT
  150. -lamp.c
  151. -#endif /* HAVE_BACKLIGHT */
  152.  
  153. +/*#ifdef HAVE_BACKLIGHT*/
  154. +/*lamp.c*/
  155. +/*#endif  HAVE_BACKLIGHT */
  156.  
  157.  
  158. -#if CONFIG_CODEC == SWCODEC
  159. -#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))
  160. -pitch_detector.c
  161. -#endif
  162.  
  163. -mp3_encoder.c
  164. -wav2wv.c
  165. -#endif /* CONFIG_CODEC */
  166. +/*#if CONFIG_CODEC == SWCODEC*/
  167. +/*#if defined(HAVE_RECORDING) && (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN))*/
  168. +/*pitch_detector.c*/
  169. +/*#endif*/
  170. +
  171. +/*mp3_encoder.c*/
  172. +/*wav2wv.c*/
  173. +/*#endif  CONFIG_CODEC */
  174.  
  175.  
  176. -#if CONFIG_RTC
  177. -alarmclock.c
  178. -#endif /* CONFIG_RTC */
  179. +/*#if CONFIG_RTC*/
  180. +/*alarmclock.c*/
  181. +/*#endif  CONFIG_RTC */
  182.  
  183.  
  184.  
  185.  /* Platform-specific */
  186. -#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
  187. -iriverify.c
  188. -#endif
  189. +/*#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)*/
  190. +/*iriverify.c*/
  191. +/*#endif*/
  192.  
  193.  
  194.  
  195. -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* those plugins only run on hardware */
  196. +/*#if (CONFIG_PLATFORM & PLATFORM_NATIVE)  those plugins only run on hardware */
  197.  
  198.  /* Overlays loaders */
  199.  
  200.  #if defined(HAVE_LCD_COLOR) && \
  201.      (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
  202.  #if (PLUGIN_BUFFER_SIZE > 0x14000) && defined(CPU_ARM)
  203. -duke3d.c
  204. +/*duke3d.c
  205.  quake.c
  206. -wolf3d.c
  207. +wolf3d.c*/
  208.  #endif
  209.  #endif
  210.  
  211. -#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
  212. +/*#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)*/
  213.  
  214. -#if CONFIG_KEYPAD != ONDIO_PAD && CONFIG_KEYPAD != SANSA_M200_PAD \
  215. -    && CONFIG_KEYPAD != HM60X_PAD
  216. +/*#if CONFIG_KEYPAD != ONDIO_PAD && CONFIG_KEYPAD != SANSA_M200_PAD \*/
  217. +/*    && CONFIG_KEYPAD != HM60X_PAD*/
  218.  /* not enough buttons for rockboy */
  219. -rockboy.c
  220. -#endif
  221. +/*rockboy.c*/
  222. +/*#endif*/
  223.  
  224. -zxbox.c
  225. -chessbox.c
  226. -goban.c
  227. -pictureflow.c
  228. +/*zxbox.c*/
  229. +/*chessbox.c*/
  230. +/*goban.c*/
  231. +/*pictureflow.c*/
  232.  
  233. -#endif /* PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
  234. +/*#endif  PLUGIN_BUFFER_SIZE <= 0x20000 && HAVE_LCD_BITMAP */
  235.  
  236.  
  237. -#if CONFIG_CODEC != SWCODEC
  238. +/*#if CONFIG_CODEC != SWCODEC*/
  239.  
  240. -#if defined(HAVE_LCD_BITMAP)
  241. -splitedit.c
  242. -#endif
  243. +/*#if defined(HAVE_LCD_BITMAP)*/
  244. +/*splitedit.c*/
  245. +/*#endif*/
  246.  
  247. -#if CONFIG_LCD == LCD_SSD1815
  248. -video.c
  249. -#endif
  250. +/*#if CONFIG_LCD == LCD_SSD1815*/
  251. +/*video.c*/
  252. +/*#endif*/
  253.  
  254. -#endif /* HWCODEC */
  255. +/*#endif  HWCODEC */
  256.  
  257.  
  258. -#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
  259. -    defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
  260. -alpine_cdc.c
  261. -#endif
  262. +/*#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \*/
  263. +/*    defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)*/
  264. +/*alpine_cdc.c*/
  265. +/*#endif*/
  266.  
  267. -#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
  268. -    defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) || \
  269. -    defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)
  270. -firmware_flash.c
  271. -#endif
  272. +/*#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \*/
  273. +/*    defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) || \*/
  274. +/*    defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)*/
  275. +/*firmware_flash.c*/
  276. +/*#endif*/
  277.  
  278. -#if defined(IRIVER_H100_SERIES)
  279. -iriver_flash.c
  280. -#endif
  281. +/*#if defined(IRIVER_H100_SERIES)*/
  282. +/*iriver_flash.c*/
  283. +/*#endif*/
  284.  
  285. -#if (CONFIG_CPU == SH7034)
  286. -rockbox_flash.c
  287. -#endif /* CONFIG_CPU */
  288. +/*#if (CONFIG_CPU == SH7034)*/
  289. +/*rockbox_flash.c*/
  290. +/*#endif  CONFIG_CPU */
  291.  
  292. -#if defined(IPOD_NANO2G)
  293. -crypt_firmware.c
  294. -#endif
  295. +/*#if defined(IPOD_NANO2G)*/
  296. +/*crypt_firmware.c*/
  297. +/*#endif*/
  298.  
  299. -#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
  300. -wavplay.c
  301. -#endif
  302. +/*#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))*/
  303. +/*wavplay.c*/
  304. +/*#endif*/
  305.  
  306. -#if (CONFIG_CODEC == MAS3587F)
  307. -wavrecord.c
  308. -#endif
  309. +/*#if (CONFIG_CODEC == MAS3587F)*/
  310. +/*wavrecord.c*/
  311. +/*#endif*/
  312.  
  313. -#endif /* PLATFORM_NATIVE */
  314. +/*#endif  PLATFORM_NATIVE */
  315.  
  316. -metronome.c
  317. +/*metronome.c*/
  318.  
  319. -#ifdef HAVE_LCD_BITMAP             /* Not for the Archos Player */
  320. +/*#ifdef HAVE_LCD_BITMAP              Not for the Archos Player */
  321.  
  322. -2048.c
  323. +/*2048.c*/
  324.  
  325.  /* Lua needs at least 160 KB to work in */
  326. -#if PLUGIN_BUFFER_SIZE >= 0x80000
  327. -boomshine.lua
  328. -#ifdef HAVE_LCD_COLOR
  329. -pixel-painter.lua
  330. -#endif /* HAVE_LCD_COLOR */
  331. -#endif /* PLUGIN_BUFFER_SIZE >= 0x80000 */
  332. -
  333. -rockblox1d.c
  334. -brickmania.c
  335. -calendar.c
  336. +/*#if PLUGIN_BUFFER_SIZE >= 0x80000*/
  337. +/*boomshine.lua*/
  338. +/*#ifdef HAVE_LCD_COLOR*/
  339. +/*pixel-painter.lua*/
  340. +/*#endif  HAVE_LCD_COLOR */
  341. +/*#endif  PLUGIN_BUFFER_SIZE >= 0x80000 */
  342. +
  343. +/*rockblox1d.c*/
  344. +/*brickmania.c*/
  345. +/*calendar.c*/
  346.  maze.c
  347. -mazezam.c
  348. -text_editor.c
  349. -wavview.c
  350. -robotfindskitten.c
  351. -xobox.c
  352. -spacerocks.c
  353. -
  354. -blackjack.c
  355. -bounce.c
  356. -bubbles.c
  357. -calculator.c
  358. -chip8.c
  359. -chopper.c
  360. -demystify.c
  361. -jewels.c
  362. -minesweeper.c
  363. -oscilloscope.c
  364. -pegbox.c
  365. -periodic_table.c
  366. -pong.c
  367. -sliding_puzzle.c
  368. -snake.c
  369. -snake2.c
  370. -solitaire.c
  371. -sokoban.c
  372. -star.c
  373. -starfield.c
  374. -vu_meter.c
  375. -wormlet.c
  376. +/*mazezam.c*/
  377. +/*text_editor.c*/
  378. +/*wavview.c*/
  379. +/*robotfindskitten.c*/
  380. +/*xobox.c*/
  381. +/*spacerocks.c*/
  382. +
  383. +/*blackjack.c*/
  384. +/*bounce.c*/
  385. +/*bubbles.c*/
  386. +/*calculator.c*/
  387. +/*chip8.c*/
  388. +/*chopper.c*/
  389. +/*demystify.c*/
  390. +/*jewels.c*/
  391. +/*minesweeper.c*/
  392. +/*oscilloscope.c*/
  393. +/*pegbox.c*/
  394. +/*periodic_table.c*/
  395. +/*pong.c*/
  396. +/*sliding_puzzle.c*/
  397. +/*snake.c*/
  398. +/*snake2.c*/
  399. +/*solitaire.c*/
  400. +/*sokoban.c*/
  401. +/*star.c*/
  402. +/*starfield.c*/
  403. +/*vu_meter.c*/
  404. +/*wormlet.c*/
  405.  
  406.  /* Plugins needing the grayscale lib on low-depth LCDs */
  407. -fire.c
  408. -plasma.c
  409. +/*fire.c*/
  410. +/*plasma.c*/
  411.  
  412. -#ifdef HAVE_LCD_COLOR
  413. -clix.c
  414. -codebuster.c
  415. -#endif
  416. +/*#ifdef HAVE_LCD_COLOR*/
  417. +/*clix.c*/
  418. +/*codebuster.c*/
  419. +/*#endif*/
  420.  
  421. -#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)
  422. -fireworks.c
  423. -#endif
  424. +/*#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)*/
  425. +/*fireworks.c*/
  426. +/*#endif*/
  427.  
  428. -#if LCD_DEPTH == 16
  429. +/*#if LCD_DEPTH == 16*/
  430.  /* FIXME: make it work with 24bit (needs lot of memory) */
  431. -rockpaint.c
  432. -#endif
  433. -
  434. -rocklife.c
  435. -
  436. -#endif /* HAVE_LCD_BITMAP */
  437. -
  438. -#ifdef HAVE_LCD_CHARCELLS          /* Archos Player model only */
  439. -euroconverter.c
  440. -nim.c
  441. -#endif /* HAVE_LCD_CHARCELLS */
  442. -
  443. -#if LCD_DEPTH > 1                  /* non-mono bitmap targets */
  444. -
  445. -matrix.c
  446. -speedread.c
  447. -
  448. -#if (LCD_WIDTH > 138)
  449. -invadrox.c
  450. -superdom.c
  451. -#endif
  452. -
  453. -#endif /* LCD_DEPTH > 1 */
  454. -
  455. -
  456. -
  457. -#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */
  458. -#ifdef HAVE_ADJUSTABLE_CPU_FREQ
  459. -test_boost.c
  460. -#endif
  461. -#if CONFIG_CODEC == SWCODEC
  462. -test_codec.c
  463. -#endif
  464. -#ifdef HAVE_JPEG
  465. -test_core_jpeg.c
  466. -#endif
  467. -test_disk.c
  468. -#ifdef HAVE_LCD_BITMAP
  469. -test_fps.c
  470. -test_gfx.c
  471. -#if LCD_DEPTH < 4 && !defined(SIMULATOR)
  472. -test_scanrate.c
  473. -#endif
  474. -#ifndef HAVE_LCD_COLOR
  475. -test_grey.c
  476. -test_greylib_bitmap_scale.c
  477. -#endif
  478. -#endif
  479. -test_mem.c
  480. -#ifdef HAVE_LCD_BITMAP
  481. -test_mem_jpeg.c
  482. -#endif
  483. -#ifdef HAVE_LCD_COLOR
  484. -test_resize.c
  485. -#endif
  486. -#if CONFIG_CODEC == SWCODEC
  487. -test_sampr.c
  488. -#endif
  489. -#ifdef HAVE_TOUCHSCREEN
  490. -test_touchscreen.c
  491. -#endif
  492. -test_viewports.c
  493. -#endif /* HAVE_TEST_PLUGINS */
  494. +/*rockpaint.c*/
  495. +/*#endif*/
  496. +
  497. +/*rocklife.c*/
  498. +
  499. +/*#endif  HAVE_LCD_BITMAP */
  500. +
  501. +/*#ifdef HAVE_LCD_CHARCELLS           Archos Player model only */
  502. +/*euroconverter.c*/
  503. +/*nim.c*/
  504. +/*#endif  HAVE_LCD_CHARCELLS */
  505. +
  506. +/*#if LCD_DEPTH > 1                   non-mono bitmap targets */
  507. +
  508. +/*matrix.c*/
  509. +/*speedread.c*/
  510. +
  511. +/*#if (LCD_WIDTH > 138)*/
  512. +/*invadrox.c*/
  513. +/*superdom.c*/
  514. +/*#endif*/
  515. +
  516. +/*#endif  LCD_DEPTH > 1 */
  517. +
  518. +
  519. +
  520. +/*#ifdef HAVE_TEST_PLUGINS  enable in advanced build options */
  521. +/*#ifdef HAVE_ADJUSTABLE_CPU_FREQ*/
  522. +/*test_boost.c*/
  523. +/*#endif*/
  524. +/*#if CONFIG_CODEC == SWCODEC*/
  525. +/*test_codec.c*/
  526. +/*#endif*/
  527. +/*#ifdef HAVE_JPEG*/
  528. +/*test_core_jpeg.c*/
  529. +/*#endif*/
  530. +/*test_disk.c*/
  531. +/*#ifdef HAVE_LCD_BITMAP*/
  532. +/*test_fps.c*/
  533. +/*test_gfx.c*/
  534. +/*#if LCD_DEPTH < 4 && !defined(SIMULATOR)*/
  535. +/*test_scanrate.c*/
  536. +/*#endif*/
  537. +/*#ifndef HAVE_LCD_COLOR*/
  538. +/*test_grey.c*/
  539. +/*test_greylib_bitmap_scale.c*/
  540. +/*#endif*/
  541. +/*#endif*/
  542. +/*test_mem.c*/
  543. +/*#ifdef HAVE_LCD_BITMAP*/
  544. +/*test_mem_jpeg.c*/
  545. +/*#endif*/
  546. +/*#ifdef HAVE_LCD_COLOR*/
  547. +/*test_resize.c*/
  548. +/*#endif*/
  549. +/*#if CONFIG_CODEC == SWCODEC*/
  550. +/*test_sampr.c*/
  551. +/*#endif*/
  552. +/*#ifdef HAVE_TOUCHSCREEN*/
  553. +/*test_touchscreen.c*/
  554. +/*#endif*/
  555. +/*test_viewports.c*/
  556. +/*#endif  HAVE_TEST_PLUGINS */
  557. diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
  558. index 93cf8297b5..88eebd1502 100644
  559. --- a/apps/plugins/SUBDIRS
  560. +++ b/apps/plugins/SUBDIRS
  561. @@ -1,28 +1,28 @@
  562.  /* For all targets */
  563. -shortcuts
  564. -text_viewer
  565. +/*shortcuts*/
  566. +/*text_viewer*/
  567.  
  568.  /* For various targets... */
  569.  
  570. -#if CONFIG_RTC
  571. -clock
  572. -#endif
  573. +/*#if CONFIG_RTC*/
  574. +/*clock*/
  575. +/*#endif*/
  576.  
  577.  /* For all targets with a bitmap display */
  578. -#ifdef HAVE_LCD_BITMAP
  579. +/*#ifdef HAVE_LCD_BITMAP*/
  580.  
  581.  /* color horizontal-stride LCDs */
  582. -#if defined(HAVE_LCD_COLOR) && \
  583. -    (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
  584. -xworld
  585. +/*#if defined(HAVE_LCD_COLOR) && \*/
  586. +/*    (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))*/
  587. +/*xworld*/
  588.  
  589.  /* for duke3d, wolf3d and quake */
  590.  #if (PLUGIN_BUFFER_SIZE > 0x14000) && (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(CPU_ARM)
  591. -sdl
  592. +/*sdl*/
  593.  #endif
  594.  
  595.  puzzles
  596. -#endif
  597. +/*#endif*/
  598.  
  599.  #if    (CONFIG_KEYPAD != ONDIO_PAD) /* not enough buttons */ \
  600.      && (CONFIG_KEYPAD != SANSA_M200_PAD) /* not enough buttons */ \
  601. @@ -31,9 +31,9 @@ puzzles
  602.      && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \
  603.      && (defined(HAVE_LCD_COLOR) || (LCD_HEIGHT == 64) && (LCD_DEPTH == 1) || \
  604.                                     (LCD_HEIGHT == 128) && (LCD_DEPTH == 2))
  605. -rockboy
  606. +/*rockboy*/
  607.  #endif
  608. -
  609. +/*
  610.  #if defined(HAVE_TAGCACHE)
  611.  pictureflow
  612.  #endif
  613. @@ -47,58 +47,58 @@ fractals
  614.  imageviewer
  615.  sudoku
  616.  reversi
  617. -goban
  618. +goban*/
  619.  
  620.  /* setjmp/longjmp are not implemented on sh */
  621. -#if (CONFIG_CPU != SH7034)
  622. -frotz
  623. -#endif
  624. +/*#if (CONFIG_CPU != SH7034)*/
  625. +/*frotz*/
  626. +/*#endif*/
  627.  
  628. -#ifndef OLYMPUS_MROBE_500
  629. -#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000 /* overlay */
  630. -zxbox
  631. -#endif
  632. -#endif
  633. +/*#ifndef OLYMPUS_MROBE_500*/
  634. +/*#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000  overlay */
  635. +/*zxbox*/
  636. +/*#endif*/
  637. +/*#endif*/
  638.  
  639. -#endif /* HAVE_LCD_BITMAP */
  640. +/*#endif  HAVE_LCD_BITMAP */
  641.  
  642.  /* For all big enough colour screens, iriver H1x0 and iAudio M5 */
  643. -#if defined(HAVE_LCD_COLOR) && ( (LCD_HEIGHT >= 90 && LCD_WIDTH >=116) \
  644. -                              || (LCD_HEIGHT >= 96 && LCD_WIDTH >=75) ) \
  645. - || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5)
  646. -pacbox
  647. -#endif
  648. -
  649. -#if (defined(HAVE_LCD_COLOR) || defined(MROBE_100) || defined(SANSA_CLIPPLUS) \
  650. -    || defined(SANSA_CLIPV2) || (LCD_DEPTH == 2)) \
  651. -    && (MEMORYSIZE > 2 && !defined(RB_PROFILE))
  652. -doom
  653. -#endif
  654. +/*#if defined(HAVE_LCD_COLOR) && ( (LCD_HEIGHT >= 90 && LCD_WIDTH >=116) \*/
  655. +/*                              || (LCD_HEIGHT >= 96 && LCD_WIDTH >=75) ) \*/
  656. +/* || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5)*/
  657. +/*pacbox*/
  658. +/*#endif*/
  659. +
  660. +/*#if (defined(HAVE_LCD_COLOR) || defined(MROBE_100) || defined(SANSA_CLIPPLUS) \*/
  661. +/*    || defined(SANSA_CLIPV2) || (LCD_DEPTH == 2)) \*/
  662. +/*    && (MEMORYSIZE > 2 && !defined(RB_PROFILE))*/
  663. +/*doom*/
  664. +/*#endif*/
  665.  
  666.  /* For all the swcodec targets */
  667. -#if CONFIG_CODEC == SWCODEC
  668. +/*#if CONFIG_CODEC == SWCODEC*/
  669.  
  670. -#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
  671. -midi
  672. -mikmod
  673. -#endif
  674. +/*#if MEMORYSIZE > 2  we need a lot of RAM for instruments */
  675. +/*midi*/
  676. +/*mikmod*/
  677. +/*#endif*/
  678.  
  679.  /* beatbox */
  680. -#if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) || \
  681. -    (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_E200_PAD) || \
  682. -    (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
  683. -    (CONFIG_KEYPAD == IPOD_1G2G_PAD || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
  684. +/*#if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) || \*/
  685. +/*    (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_E200_PAD) || \*/
  686. +/*    (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \*/
  687. +/*    (CONFIG_KEYPAD == IPOD_1G2G_PAD || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)*/
  688.  /* PDBox is confirmed to run on these player models. */
  689. -pdbox
  690. -#endif
  691. +/*pdbox*/
  692. +/*#endif*/
  693.  
  694. -#if !defined(RB_PROFILE) && MEMORYSIZE > 2  /* mpegplayer allocates at least 2MB of RAM */
  695. -mpegplayer
  696. -#endif
  697. +/*#if !defined(RB_PROFILE) && MEMORYSIZE > 2   mpegplayer allocates at least 2MB of RAM */
  698. +/*mpegplayer*/
  699. +/*#endif*/
  700.  
  701. -#endif /* CONFIG_CODEC == SWCODEC */
  702. +/*#endif  CONFIG_CODEC == SWCODEC */
  703.  
  704.  /* Lua needs at least 160 KB to work in */
  705. -#if PLUGIN_BUFFER_SIZE >= 0x80000
  706. -lua
  707. -#endif
  708. +/*#if PLUGIN_BUFFER_SIZE >= 0x80000*/
  709. +/*lua*/
  710. +/*#endif*/
  711. diff --git a/apps/plugins/lib/display_text.c b/apps/plugins/lib/display_text.c
  712. index 5d13fc678d..1de2527bc2 100644
  713. --- a/apps/plugins/lib/display_text.c
  714. +++ b/apps/plugins/lib/display_text.c
  715. @@ -51,8 +51,8 @@ bool display_text(unsigned short words, char** text, struct style_text* style,
  716.  #endif
  717.      int space_w, width, height;
  718.      unsigned short x , y;
  719. -    unsigned short vp_width = LCD_WIDTH;
  720. -    unsigned short vp_height = LCD_HEIGHT;
  721. +    unsigned short vp_width = lcd_width;
  722. +    unsigned short vp_height = lcd_height;
  723.      unsigned short i = 0, style_index = 0;
  724.      if (vp_text != NULL) {
  725.          vp_width = vp_text->width;
  726. diff --git a/apps/plugins/lib/xlcd_draw.c b/apps/plugins/lib/xlcd_draw.c
  727. index 311782c21f..89adf4384c 100644
  728. --- a/apps/plugins/lib/xlcd_draw.c
  729. +++ b/apps/plugins/lib/xlcd_draw.c
  730. @@ -354,7 +354,7 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
  731.      fb_data *dst;
  732.  
  733.      /* nothing to draw? */
  734. -    if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  735. +    if ((width <= 0) || (height <= 0) || (x >= lcd_width) || (y >= lcd_height)
  736.          || (x + width <= 0) || (y + height <= 0))
  737.          return;
  738.          
  739. @@ -371,14 +371,14 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
  740.          src_y -= y;
  741.          y = 0;
  742.      }
  743. -    if (x + width > LCD_WIDTH)
  744. -        width = LCD_WIDTH - x;
  745. -    if (y + height > LCD_HEIGHT)
  746. -        height = LCD_HEIGHT - y;
  747. +    if (x + width > lcd_width)
  748. +        width = lcd_width - x;
  749. +    if (y + height > lcd_height)
  750. +        height = lcd_height - y;
  751.  
  752.      src    += stride * src_y + src_x; /* move starting point */
  753.      src_end = src + stride * height;
  754. -    dst     = rb->lcd_framebuffer + LCD_WIDTH * y + x;
  755. +    dst     = rb->lcd_framebuffer + lcd_width * y + x;
  756.  
  757.      do
  758.      {
  759. @@ -399,7 +399,7 @@ void xlcd_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
  760.  #endif
  761.  
  762.          src +=  stride;
  763. -        dst += LCD_WIDTH;
  764. +        dst += lcd_width;
  765.      }
  766.      while (src < src_end);
  767.  }
  768. @@ -421,7 +421,7 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
  769.      fb_data *dst;
  770.  
  771.      /* nothing to draw? */
  772. -    if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  773. +    if ((width <= 0) || (height <= 0) || (x >= lcd_width) || (y >= lcd_height)
  774.          || (x + width <= 0) || (y + height <= 0))
  775.          return;
  776.          
  777. @@ -438,14 +438,14 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
  778.          src_y -= y;
  779.          y = 0;
  780.      }
  781. -    if (x + width > LCD_WIDTH)
  782. -        width = LCD_WIDTH - x;
  783. -    if (y + height > LCD_HEIGHT)
  784. -        height = LCD_HEIGHT - y;
  785. +    if (x + width > lcd_width)
  786. +        width = lcd_width - x;
  787. +    if (y + height > lcd_height)
  788. +        height = lcd_height - y;
  789.  
  790.      src    += 3 * (stride * src_y + src_x); /* move starting point */
  791.      src_end = src + 3 * stride * height;
  792. -    dst     = rb->lcd_framebuffer + LCD_WIDTH * y + x;
  793. +    dst     = rb->lcd_framebuffer + lcd_width * y + x;
  794.  
  795.      do
  796.      {
  797. @@ -472,7 +472,7 @@ void xlcd_color_bitmap_part(const unsigned char *src, int src_x, int src_y,
  798.          while (src_row < row_end);
  799.  
  800.          src +=  3 * stride;
  801. -        dst += LCD_WIDTH;
  802. +        dst += lcd_width;
  803.      }
  804.      while (src < src_end);
  805.  }
  806. diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c
  807. index f2fc71ea47..138b87ad6f 100644
  808. --- a/apps/plugins/lib/xlcd_scroll.c
  809. +++ b/apps/plugins/lib/xlcd_scroll.c
  810. @@ -35,20 +35,20 @@ void xlcd_scroll_left(int count)
  811.  {
  812.      int length, oldmode;
  813.  
  814. -    if ((unsigned)count >= LCD_WIDTH)
  815. +    if ((unsigned)count >= lcd_width)
  816.      {
  817.          rb->lcd_clear_display();
  818.          return;
  819.      }
  820.  
  821. -    length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
  822. +    length = (lcd_width-count)*LCD_FBHEIGHT;
  823.  
  824. -    rb->memmove(rb->lcd_framebuffer, rb->lcd_framebuffer + LCD_HEIGHT*count,
  825. +    rb->memmove(rb->lcd_framebuffer, rb->lcd_framebuffer + lcd_height*count,
  826.                  length * sizeof(fb_data));
  827.  
  828.      oldmode = rb->lcd_get_drawmode();
  829.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  830. -    rb->lcd_fillrect(LCD_WIDTH-count, 0, count, LCD_HEIGHT);
  831. +    rb->lcd_fillrect(lcd_width-count, 0, count, lcd_height);
  832.      rb->lcd_set_drawmode(oldmode);
  833.  }
  834.  
  835. @@ -57,20 +57,20 @@ void xlcd_scroll_right(int count)
  836.  {
  837.      int length, oldmode;
  838.  
  839. -    if ((unsigned)count >= LCD_WIDTH)
  840. +    if ((unsigned)count >= lcd_width)
  841.      {
  842.          rb->lcd_clear_display();
  843.          return;
  844.      }
  845.  
  846. -    length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
  847. +    length = (lcd_width-count)*LCD_FBHEIGHT;
  848.  
  849. -    rb->memmove(rb->lcd_framebuffer + LCD_HEIGHT*count,
  850. +    rb->memmove(rb->lcd_framebuffer + lcd_height*count,
  851.                  rb->lcd_framebuffer, length * sizeof(fb_data));
  852.  
  853.      oldmode = rb->lcd_get_drawmode();
  854.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  855. -    rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
  856. +    rb->lcd_fillrect(0, 0, count, lcd_height);
  857.      rb->lcd_set_drawmode(oldmode);
  858.  }
  859.  
  860. @@ -81,25 +81,25 @@ void xlcd_scroll_up(int count)
  861.      
  862.      fb_data *data;
  863.  
  864. -    if ((unsigned)count >= LCD_HEIGHT)
  865. +    if ((unsigned)count >= lcd_height)
  866.      {
  867.          rb->lcd_clear_display();
  868.          return;
  869.      }
  870.  
  871. -    length = LCD_HEIGHT - count;
  872. +    length = lcd_height - count;
  873.      
  874. -    width = LCD_WIDTH-1;
  875. +    width = lcd_width-1;
  876.      data = rb->lcd_framebuffer;
  877.      
  878.      do {
  879.          rb->memmove(data,data + count,length * sizeof(fb_data));
  880. -        data += LCD_HEIGHT;
  881. +        data += lcd_height;
  882.      } while(width--);
  883.  
  884.      oldmode = rb->lcd_get_drawmode();
  885.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  886. -    rb->lcd_fillrect(0, length, LCD_WIDTH, count);
  887. +    rb->lcd_fillrect(0, length, lcd_width, count);
  888.      rb->lcd_set_drawmode(oldmode);
  889.  }
  890.  
  891. @@ -110,25 +110,25 @@ void xlcd_scroll_down(int count)
  892.      
  893.      fb_data *data;
  894.  
  895. -    if ((unsigned)count >= LCD_HEIGHT)
  896. +    if ((unsigned)count >= lcd_height)
  897.      {
  898.          rb->lcd_clear_display();
  899.          return;
  900.      }
  901.  
  902. -    length = LCD_HEIGHT - count;
  903. +    length = lcd_height - count;
  904.  
  905. -    width = LCD_WIDTH-1;
  906. +    width = lcd_width-1;
  907.      data = rb->lcd_framebuffer;
  908.      
  909.      do {
  910.          rb->memmove(data + count, data, length * sizeof(fb_data));
  911. -        data += LCD_HEIGHT;
  912. +        data += lcd_height;
  913.      } while(width--);
  914.  
  915.      oldmode = rb->lcd_get_drawmode();
  916.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  917. -    rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
  918. +    rb->lcd_fillrect(0, 0, lcd_width, count);
  919.      rb->lcd_set_drawmode(oldmode);
  920.  }
  921.  #else
  922. @@ -141,7 +141,7 @@ void xlcd_scroll_left(int count)
  923.      int bitcount=0, oldmode;
  924.      int blockcount=0, blocklen;
  925.  
  926. -    if ((unsigned) count >= LCD_WIDTH)
  927. +    if ((unsigned) count >= lcd_width)
  928.      {
  929.          rb->lcd_clear_display();
  930.          return;
  931. @@ -156,7 +156,7 @@ void xlcd_scroll_left(int count)
  932.      if (blockcount)
  933.      {
  934.          unsigned char *data = rb->lcd_framebuffer;
  935. -        unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
  936. +        unsigned char *data_end = data + LCD_FBWIDTH*lcd_height;
  937.  
  938.          do
  939.          {
  940. @@ -173,7 +173,7 @@ void xlcd_scroll_left(int count)
  941.          unsigned fill = (0x55 * (~rb->lcd_get_background() & 3)) << bitcount;
  942.  #endif
  943.  
  944. -        for (y = 0; y < LCD_HEIGHT; y++)
  945. +        for (y = 0; y < lcd_height; y++)
  946.          {
  947.              unsigned char *row_addr = addr;
  948.              unsigned data = fill;
  949. @@ -189,7 +189,7 @@ void xlcd_scroll_left(int count)
  950.      }
  951.      oldmode = rb->lcd_get_drawmode();
  952.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  953. -    rb->lcd_fillrect(LCD_WIDTH - count, 0, count, LCD_HEIGHT);
  954. +    rb->lcd_fillrect(lcd_width - count, 0, count, lcd_height);
  955.      rb->lcd_set_drawmode(oldmode);
  956.  }
  957.  
  958. @@ -199,7 +199,7 @@ void xlcd_scroll_right(int count)
  959.      int bitcount=0, oldmode;
  960.      int blockcount=0, blocklen;
  961.  
  962. -    if ((unsigned) count >= LCD_WIDTH)
  963. +    if ((unsigned) count >= lcd_width)
  964.      {
  965.          rb->lcd_clear_display();
  966.          return;
  967. @@ -214,7 +214,7 @@ void xlcd_scroll_right(int count)
  968.      if (blockcount)
  969.      {
  970.          unsigned char *data = rb->lcd_framebuffer;
  971. -        unsigned char *data_end = data + LCD_FBWIDTH*LCD_HEIGHT;
  972. +        unsigned char *data_end = data + LCD_FBWIDTH*lcd_height;
  973.  
  974.          do
  975.          {
  976. @@ -231,7 +231,7 @@ void xlcd_scroll_right(int count)
  977.          unsigned fill = 0x55 * (~rb->lcd_get_background() & 3);
  978.  #endif
  979.  
  980. -        for (y = 0; y < LCD_HEIGHT; y++)
  981. +        for (y = 0; y < lcd_height; y++)
  982.          {
  983.              unsigned char *row_addr = addr;
  984.              unsigned data = fill;
  985. @@ -247,7 +247,7 @@ void xlcd_scroll_right(int count)
  986.      }
  987.      oldmode = rb->lcd_get_drawmode();
  988.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  989. -    rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
  990. +    rb->lcd_fillrect(0, 0, count, lcd_height);
  991.      rb->lcd_set_drawmode(oldmode);
  992.  }
  993.  
  994. @@ -259,26 +259,26 @@ void xlcd_scroll_left(int count)
  995.      fb_data *data, *data_end;
  996.      int length, oldmode;
  997.  
  998. -    if ((unsigned)count >= LCD_WIDTH)
  999. +    if ((unsigned)count >= lcd_width)
  1000.      {
  1001.          rb->lcd_clear_display();
  1002.          return;
  1003.      }
  1004.  
  1005.      data = rb->lcd_framebuffer;
  1006. -    data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
  1007. -    length = LCD_WIDTH - count;
  1008. +    data_end = data + lcd_width*LCD_FBHEIGHT;
  1009. +    length = lcd_width - count;
  1010.  
  1011.      do
  1012.      {
  1013.          rb->memmove(data, data + count, length * sizeof(fb_data));
  1014. -        data += LCD_WIDTH;
  1015. +        data += lcd_width;
  1016.      }
  1017.      while (data < data_end);
  1018.  
  1019.      oldmode = rb->lcd_get_drawmode();
  1020.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1021. -    rb->lcd_fillrect(length, 0, count, LCD_HEIGHT);
  1022. +    rb->lcd_fillrect(length, 0, count, lcd_height);
  1023.      rb->lcd_set_drawmode(oldmode);
  1024.  }
  1025.  
  1026. @@ -288,26 +288,26 @@ void xlcd_scroll_right(int count)
  1027.      fb_data *data, *data_end;
  1028.      int length, oldmode;
  1029.  
  1030. -    if ((unsigned)count >= LCD_WIDTH)
  1031. +    if ((unsigned)count >= lcd_width)
  1032.      {
  1033.          rb->lcd_clear_display();
  1034.          return;
  1035.      }
  1036.  
  1037.      data = rb->lcd_framebuffer;
  1038. -    data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
  1039. -    length = LCD_WIDTH - count;
  1040. +    data_end = data + lcd_width*LCD_FBHEIGHT;
  1041. +    length = lcd_width - count;
  1042.  
  1043.      do
  1044.      {
  1045.          rb->memmove(data + count, data, length * sizeof(fb_data));
  1046. -        data += LCD_WIDTH;
  1047. +        data += lcd_width;
  1048.      }
  1049.      while (data < data_end);
  1050.  
  1051.      oldmode = rb->lcd_get_drawmode();
  1052.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1053. -    rb->lcd_fillrect(0, 0, count, LCD_HEIGHT);
  1054. +    rb->lcd_fillrect(0, 0, count, lcd_height);
  1055.      rb->lcd_set_drawmode(oldmode);
  1056.  }
  1057.  
  1058. @@ -320,13 +320,13 @@ void xlcd_scroll_up(int count)
  1059.  {
  1060.      int length, oldmode;
  1061.  
  1062. -    if ((unsigned)count >= LCD_HEIGHT)
  1063. +    if ((unsigned)count >= lcd_height)
  1064.      {
  1065.          rb->lcd_clear_display();
  1066.          return;
  1067.      }
  1068.  
  1069. -    length = LCD_HEIGHT - count;
  1070. +    length = lcd_height - count;
  1071.  
  1072.      rb->memmove(rb->lcd_framebuffer,
  1073.                        rb->lcd_framebuffer + count * LCD_FBWIDTH,
  1074. @@ -334,7 +334,7 @@ void xlcd_scroll_up(int count)
  1075.  
  1076.      oldmode = rb->lcd_get_drawmode();
  1077.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1078. -    rb->lcd_fillrect(0, length, LCD_WIDTH, count);
  1079. +    rb->lcd_fillrect(0, length, lcd_width, count);
  1080.      rb->lcd_set_drawmode(oldmode);
  1081.  }
  1082.  
  1083. @@ -343,13 +343,13 @@ void xlcd_scroll_down(int count)
  1084.  {
  1085.      int length, oldmode;
  1086.  
  1087. -    if ((unsigned)count >= LCD_HEIGHT)
  1088. +    if ((unsigned)count >= lcd_height)
  1089.      {
  1090.          rb->lcd_clear_display();
  1091.          return;
  1092.      }
  1093.  
  1094. -    length = LCD_HEIGHT - count;
  1095. +    length = lcd_height - count;
  1096.  
  1097.      rb->memmove(rb->lcd_framebuffer + count * LCD_FBWIDTH,
  1098.                        rb->lcd_framebuffer,
  1099. @@ -357,7 +357,7 @@ void xlcd_scroll_down(int count)
  1100.  
  1101.      oldmode = rb->lcd_get_drawmode();
  1102.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1103. -    rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
  1104. +    rb->lcd_fillrect(0, 0, lcd_width, count);
  1105.      rb->lcd_set_drawmode(oldmode);
  1106.  }
  1107.  
  1108. @@ -370,7 +370,7 @@ void xlcd_scroll_up(int count)
  1109.      int bitcount=0, oldmode;
  1110.      int blockcount=0, blocklen;
  1111.  
  1112. -    if ((unsigned) count >= LCD_HEIGHT)
  1113. +    if ((unsigned) count >= lcd_height)
  1114.      {
  1115.          rb->lcd_clear_display();
  1116.          return;
  1117. @@ -509,7 +509,7 @@ void xlcd_scroll_up(int count)
  1118.          const unsigned fill = 0;
  1119.  #endif
  1120.  
  1121. -        for (x = 0; x < LCD_WIDTH; x++)
  1122. +        for (x = 0; x < lcd_width; x++)
  1123.          {
  1124.              unsigned char *col_addr = addr++;
  1125.              unsigned data = fill;
  1126. @@ -534,7 +534,7 @@ void xlcd_scroll_up(int count)
  1127.          mask = (0xFFu >> bitcount) << bitcount;
  1128.          mask |= mask << 8;
  1129.  
  1130. -        for (x = 0; x < LCD_WIDTH; x++)
  1131. +        for (x = 0; x < lcd_width; x++)
  1132.          {
  1133.              fb_data *col_addr = addr++;
  1134.              unsigned olddata = fill;
  1135. @@ -554,7 +554,7 @@ void xlcd_scroll_up(int count)
  1136.      }
  1137.      oldmode = rb->lcd_get_drawmode();
  1138.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1139. -    rb->lcd_fillrect(0, LCD_HEIGHT - count, LCD_WIDTH, count);
  1140. +    rb->lcd_fillrect(0, lcd_height - count, lcd_width, count);
  1141.      rb->lcd_set_drawmode(oldmode);
  1142.  }
  1143.  
  1144. @@ -564,7 +564,7 @@ void xlcd_scroll_down(int count)
  1145.      int bitcount=0, oldmode;
  1146.      int blockcount=0, blocklen;
  1147.  
  1148. -    if ((unsigned) count >= LCD_HEIGHT)
  1149. +    if ((unsigned) count >= lcd_height)
  1150.      {
  1151.          rb->lcd_clear_display();
  1152.          return;
  1153. @@ -653,7 +653,7 @@ void xlcd_scroll_down(int count)
  1154.              : /* outputs */
  1155.              : /* inputs */
  1156.              [addr]"r"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
  1157. -            [wide]"r"(LCD_WIDTH),
  1158. +            [wide]"r"(lcd_width),
  1159.              [rows]"r"(blocklen),
  1160.              [cnt] "r"(bitcount)
  1161.              : /* clobbers */
  1162. @@ -685,7 +685,7 @@ void xlcd_scroll_down(int count)
  1163.              "bne.b   .sd_cloop   \n"
  1164.              : /* outputs */
  1165.              : /* inputs */
  1166. -            [wide]"r"(LCD_WIDTH),
  1167. +            [wide]"r"(lcd_width),
  1168.              [rows]"r"(blocklen),
  1169.              [addr]"a"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
  1170.              [cnt] "d"(bitcount),
  1171. @@ -702,7 +702,7 @@ void xlcd_scroll_down(int count)
  1172.          const unsigned fill = 0;
  1173.  #endif
  1174.  
  1175. -        for (x = 0; x < LCD_WIDTH; x++)
  1176. +        for (x = 0; x < lcd_width; x++)
  1177.          {
  1178.              unsigned char *col_addr = addr++;
  1179.              unsigned data = fill;
  1180. @@ -727,7 +727,7 @@ void xlcd_scroll_down(int count)
  1181.          mask = (0xFFu >> bitcount) << bitcount;
  1182.          mask |= mask << 8;
  1183.  
  1184. -        for (x = 0; x < LCD_WIDTH; x++)
  1185. +        for (x = 0; x < lcd_width; x++)
  1186.          {
  1187.              fb_data *col_addr = addr++;
  1188.              unsigned olddata = fill;
  1189. @@ -747,7 +747,7 @@ void xlcd_scroll_down(int count)
  1190.      }
  1191.      oldmode = rb->lcd_get_drawmode();
  1192.      rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  1193. -    rb->lcd_fillrect(0, 0, LCD_WIDTH, count);
  1194. +    rb->lcd_fillrect(0, 0, lcd_width, count);
  1195.      rb->lcd_set_drawmode(oldmode);
  1196.  }
  1197.  
  1198. diff --git a/apps/plugins/puzzles/puzzles.make b/apps/plugins/puzzles/puzzles.make
  1199. index 604208cbdd..7f53517cc5 100644
  1200. --- a/apps/plugins/puzzles/puzzles.make
  1201. +++ b/apps/plugins/puzzles/puzzles.make
  1202. @@ -37,7 +37,7 @@ endif
  1203.  PUZZLESFLAGS = -I$(PUZZLES_SRCDIR)/dummy $(filter-out          \
  1204.         -O%,$(PLUGINFLAGS)) $(PUZZLES_OPTIMIZE)         \
  1205.         -Wno-unused-parameter -Wno-sign-compare         \
  1206. -       -Wno-strict-aliasing -DFOR_REAL             \
  1207. +       -Wno-strict-aliasing -DFOR_REAL -DDEBUG_MENU        \
  1208.         -I$(PUZZLES_SRCDIR)/src -I$(PUZZLES_SRCDIR) -include    \
  1209.         $(PUZZLES_SRCDIR)/rbcompat.h -ffunction-sections    \
  1210.         -fdata-sections -w -Wl,--gc-sections
  1211. diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
  1212. index ddcad4fa59..7e945efed5 100644
  1213. --- a/apps/plugins/puzzles/rockbox.c
  1214. +++ b/apps/plugins/puzzles/rockbox.c
  1215. @@ -48,6 +48,8 @@
  1216.  
  1217.  /* how many ticks between timer callbacks */
  1218.  #define TIMER_INTERVAL (HZ / 50)
  1219. +#define LCD_WIDTH 320
  1220. +#define LCD_HEIGHT 240
  1221.  
  1222.  /* no c200v2 */
  1223.  #if PLUGIN_BUFFER_SIZE > 0x14000
  1224. diff --git a/apps/plugins/starwars.c b/apps/plugins/starwars.c
  1225. new file mode 100644
  1226. index 0000000000..f23bf41549
  1227. --- /dev/null
  1228. +++ b/apps/plugins/starwars.c
  1229. @@ -0,0 +1,66 @@
  1230. +#include "plugin.h"
  1231. +#include "lib/pluginlib_actions.h"
  1232. +#include "lib/pluginlib_exit.h"
  1233. +#include "lib/helper.h"
  1234. +
  1235. +static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
  1236. +
  1237. +void myread_line(int fd, char *buf, size_t sz)
  1238. +{
  1239. +    if(rb->read_line(fd, buf, sz) < 0)
  1240. +    {
  1241. +        rb->close(fd);
  1242. +        backlight_use_settings();
  1243. +        exit(PLUGIN_OK);
  1244. +    }
  1245. +}
  1246. +
  1247. +enum plugin_status plugin_start(const void* param)
  1248. +{
  1249. +    (void) param;
  1250. +
  1251. +        int frametime;
  1252. +        char delaybuf[8] = { 0 };
  1253. +        char linebuf[80];
  1254. +
  1255. +
  1256. +    int fd = rb->open("/data", O_RDONLY);
  1257. +
  1258. +    rb->lcd_setfont(rb->font_load("/.rockbox/fonts/07-Fixed.fnt"));
  1259. +
  1260. +    backlight_ignore_timeout();
  1261. +
  1262. +    while(1)
  1263. +    {
  1264. +        rb->lcd_clear_display();
  1265. +
  1266. +        myread_line(fd, delaybuf, sizeof(delaybuf));
  1267. +        frametime = rb->atoi(delaybuf);
  1268. +
  1269. +        for(int i = 0; i < 13; ++i)
  1270. +        {
  1271. +            myread_line(fd, linebuf, sizeof(linebuf));
  1272. +            rb->lcd_puts(0, i, linebuf);
  1273. +        }
  1274. +
  1275. +        rb->lcd_update_rect(0, 0, 320,240);
  1276. +        for(int i = 0; i < frametime; ++i)
  1277. +        {
  1278. +            /* one timeslice = 1/15 second */
  1279. +            const int slice_ticks = 1/15.0 * HZ;
  1280. +            rb->sleep(slice_ticks);
  1281. +        }
  1282. +        int button = pluginlib_getaction(0, plugin_contexts, ARRAYLEN(plugin_contexts));
  1283. +        switch(button)
  1284. +        {
  1285. +        case PLA_EXIT:
  1286. +            rb->close(fd);
  1287. +            backlight_use_settings();
  1288. +            return PLUGIN_OK;
  1289. +        default:
  1290. +            exit_on_usb(button);
  1291. +        }
  1292. +
  1293. +        rb->yield();
  1294. +    }
  1295. +}
  1296. diff --git a/apps/screens.c b/apps/screens.c
  1297. index 9cb5ebe258..0e9899a5dd 100644
  1298. --- a/apps/screens.c
  1299. +++ b/apps/screens.c
  1300. @@ -91,7 +91,7 @@ int mmc_remove_request(void)
  1301.  static void charging_display_info(bool animate)
  1302.  {
  1303.      unsigned char charging_logo[36];
  1304. -    const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
  1305. +    const int pox_x = (lcd_width - sizeof(charging_logo)) / 2;
  1306.      const int pox_y = 32;
  1307.      static unsigned phase = 3;
  1308.      unsigned i;
  1309. @@ -1097,9 +1097,9 @@ static int get_sample(struct touchscreen_calibration *cal, int x, int y, int i,
  1310.  int calibrate(void)
  1311.  {
  1312.      short points[3][2] = {
  1313. -        {LCD_WIDTH/10, LCD_HEIGHT/10},
  1314. -        {7*LCD_WIDTH/8, LCD_HEIGHT/2},
  1315. -        {LCD_WIDTH/2, 7*LCD_HEIGHT/8}
  1316. +        {lcd_width/10, lcd_height/10},
  1317. +        {7*lcd_width/8, lcd_height/2},
  1318. +        {lcd_width/2, 7*lcd_height/8}
  1319.      };
  1320.      struct screen* screen = &screens[SCREEN_MAIN];
  1321.      enum touchscreen_mode old_mode = touchscreen_get_mode();
  1322. diff --git a/apps/settings.h b/apps/settings.h
  1323. index b72eec6f8b..afe89192bb 100644
  1324. --- a/apps/settings.h
  1325. +++ b/apps/settings.h
  1326. @@ -651,7 +651,7 @@ struct user_settings
  1327.      bool invert;    /* invert display */
  1328.  #endif
  1329.  #ifdef HAVE_LCD_FLIP
  1330. -    bool flip_display; /* turn display (and button layout) by 180 degrees */
  1331. +    int flip_display; /* turn display (and button layout) by 180 degrees */
  1332.  #endif
  1333.      int  cursor_style; /* style of the selection cursor */
  1334.      int  screen_scroll_step;
  1335. diff --git a/apps/settings_list.c b/apps/settings_list.c
  1336. index bc03672aeb..d8e5f6c441 100644
  1337. --- a/apps/settings_list.c
  1338. +++ b/apps/settings_list.c
  1339. @@ -944,8 +944,16 @@ const struct settings_list settings[] = {
  1340.                   LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display),
  1341.  #endif
  1342.  #ifdef HAVE_LCD_FLIP
  1343. +#if HAVE_LCD_FLIP==4
  1344. +    CHOICE_SETTING(1, flip_display, LANG_FLIP_DISPLAY,
  1345. +                   0,"flip display",
  1346. +                   "none,upside down,landscape,flipped landscape",
  1347. +                   NULL, 4,
  1348. +                   "None","Upside down","Landscape","Flipped landscape"),
  1349. +#else
  1350.      OFFON_SETTING(0, flip_display, LANG_FLIP_DISPLAY, false, "flip display",
  1351.                    NULL),
  1352. +#endif
  1353.  #endif
  1354.      /* display */
  1355.       CHOICE_SETTING(F_TEMPVAR|F_THEMESETTING, cursor_style, LANG_INVERT_CURSOR,
  1356. diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
  1357. index a7e80c7244..075bc734da 100644
  1358. --- a/firmware/drivers/lcd-16bit-common.c
  1359. +++ b/firmware/drivers/lcd-16bit-common.c
  1360. @@ -43,7 +43,7 @@ void lcd_clear_viewport(void)
  1361.  #if defined(HAVE_VIEWPORT_CLIP)
  1362.      /********************* Viewport on screen clipping ********************/
  1363.      /* nothing to draw? */
  1364. -    if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  1365. +    if ((x >= lcd_width) || (y >= lcd_height)
  1366.          || (x + width <= 0) || (y + height <= 0))
  1367.          return;
  1368.  
  1369. @@ -58,10 +58,10 @@ void lcd_clear_viewport(void)
  1370.          height += y;
  1371.          y = 0;
  1372.      }
  1373. -    if (x + width > LCD_WIDTH)
  1374. -        width = LCD_WIDTH - x;
  1375. -    if (y + height > LCD_HEIGHT)
  1376. -        height = LCD_HEIGHT - y;
  1377. +    if (x + width > lcd_width)
  1378. +        width = lcd_width - x;
  1379. +    if (y + height > lcd_height)
  1380. +        height = lcd_height - y;
  1381.  #endif
  1382.  
  1383.      len  = STRIDE_MAIN(width, height);
  1384. @@ -183,7 +183,7 @@ void lcd_fillrect(int x, int y, int width, int height)
  1385.  #if defined(HAVE_VIEWPORT_CLIP)
  1386.      /********************* Viewport on screen clipping ********************/
  1387.      /* nothing to draw? */
  1388. -    if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  1389. +    if ((x >= lcd_width) || (y >= lcd_height)
  1390.          || (x + width <= 0) || (y + height <= 0))
  1391.          return;
  1392.  
  1393. @@ -198,10 +198,10 @@ void lcd_fillrect(int x, int y, int width, int height)
  1394.          height += y;
  1395.          y = 0;
  1396.      }
  1397. -    if (x + width > LCD_WIDTH)
  1398. -        width = LCD_WIDTH - x;
  1399. -    if (y + height > LCD_HEIGHT)
  1400. -        height = LCD_HEIGHT - y;
  1401. +    if (x + width > lcd_width)
  1402. +        width = lcd_width - x;
  1403. +    if (y + height > lcd_height)
  1404. +        height = lcd_height - y;
  1405.  #endif
  1406.  
  1407.      /* drawmode and optimisation */
  1408. @@ -317,7 +317,7 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
  1409.  #if defined(HAVE_VIEWPORT_CLIP)
  1410.      /********************* Viewport on screen clipping ********************/
  1411.      /* nothing to draw? */
  1412. -    if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  1413. +    if ((x >= lcd_width) || (y >= lcd_height)
  1414.          || (x + width <= 0) || (y + height <= 0))
  1415.          return;
  1416.  
  1417. @@ -334,10 +334,10 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
  1418.          src_y -= y;
  1419.          y = 0;
  1420.      }
  1421. -    if (x + width > LCD_WIDTH)
  1422. -        width = LCD_WIDTH - x;
  1423. -    if (y + height > LCD_HEIGHT)
  1424. -        height = LCD_HEIGHT - y;
  1425. +    if (x + width > lcd_width)
  1426. +        width = lcd_width - x;
  1427. +    if (y + height > lcd_height)
  1428. +        height = lcd_height - y;
  1429.  #endif
  1430.  
  1431.      src += stride * (src_y >> 3) + src_x; /* move starting point */
  1432. @@ -582,7 +582,7 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
  1433.  #if defined(HAVE_VIEWPORT_CLIP)
  1434.      /********************* Viewport on screen clipping ********************/
  1435.      /* nothing to draw? */
  1436. -    if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
  1437. +    if ((x >= lcd_width) || (y >= lcd_height)
  1438.          || (x + width <= 0) || (y + height <= 0))
  1439.      {
  1440.          BLEND_FINISH;
  1441. @@ -602,10 +602,10 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
  1442.          src_y -= y;
  1443.          y = 0;
  1444.      }
  1445. -    if (x + width > LCD_WIDTH)
  1446. -        width = LCD_WIDTH - x;
  1447. -    if (y + height > LCD_HEIGHT)
  1448. -        height = LCD_HEIGHT - y;
  1449. +    if (x + width > lcd_width)
  1450. +        width = lcd_width - x;
  1451. +    if (y + height > lcd_height)
  1452. +        height = lcd_height - y;
  1453.  #endif
  1454.  
  1455.      /* the following drawmode combinations are possible:
  1456. diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
  1457. index b792be4e02..829e69d66c 100644
  1458. --- a/firmware/drivers/lcd-16bit.c
  1459. +++ b/firmware/drivers/lcd-16bit.c
  1460. @@ -92,15 +92,15 @@ void lcd_hline(int x1, int x2, int y)
  1461.  #if defined(HAVE_VIEWPORT_CLIP)
  1462.      /********************* Viewport on screen clipping ********************/
  1463.      /* nothing to draw? */
  1464. -    if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
  1465. +    if (((unsigned)y >= (unsigned) lcd_height) || (x1 >= lcd_width)
  1466.          || (x2 < 0))
  1467.          return;  
  1468.      
  1469.      /* clipping */
  1470.      if (x1 < 0)
  1471.          x1 = 0;
  1472. -    if (x2 >= LCD_WIDTH)
  1473. -        x2 = LCD_WIDTH-1;
  1474. +    if (x2 >= lcd_width)
  1475. +        x2 = lcd_width-1;
  1476.  #endif
  1477.  
  1478.      width = x2 - x1 + 1;
  1479. diff --git a/firmware/drivers/lcd-color-common.c b/firmware/drivers/lcd-color-common.c
  1480. index c8bfd2d6b3..24f936babd 100644
  1481. --- a/firmware/drivers/lcd-color-common.c
  1482. +++ b/firmware/drivers/lcd-color-common.c
  1483. @@ -36,7 +36,7 @@ enum fill_opt {
  1484.  };
  1485.  
  1486.  /*** globals ***/
  1487. -fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH]
  1488. +fb_data lcd_static_framebuffer[LCD_FBWIDTH][LCD_FBHEIGHT]
  1489.      IRAM_LCDFRAMEBUFFER CACHEALIGN_AT_LEAST_ATTR(16);
  1490.  fb_data *lcd_framebuffer = &lcd_static_framebuffer[0][0];
  1491.  
  1492. diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
  1493. index 2a57619b06..cf8698b6ef 100644
  1494. --- a/firmware/export/config/sansafuzeplus.h
  1495. +++ b/firmware/export/config/sansafuzeplus.h
  1496. @@ -33,7 +33,7 @@
  1497.  #define HAVE_LCD_BITMAP
  1498.  /* define this if you have a colour LCD */
  1499.  #define HAVE_LCD_COLOR
  1500. -#define HAVE_LCD_FLIP
  1501. +#define HAVE_LCD_FLIP 4
  1502.  #define HAVE_LCD_INVERT
  1503.  
  1504.  #ifndef BOOTLOADER
  1505. diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
  1506. index 80ef45a573..3f9cca343d 100644
  1507. --- a/firmware/export/lcd.h
  1508. +++ b/firmware/export/lcd.h
  1509. @@ -34,6 +34,8 @@
  1510.          (VP_FLAG_ALIGN_RIGHT|VP_FLAG_ALIGN_CENTER)
  1511.  
  1512.  #define VP_IS_RTL(vp) (((vp)->flags & VP_FLAG_ALIGNMENT_MASK) == VP_FLAG_ALIGN_RIGHT)
  1513. +short lcd_height;
  1514. +short lcd_width;
  1515.  
  1516.  struct viewport {
  1517.      int x;
  1518. @@ -483,7 +485,7 @@ static inline unsigned fb_to_scalar(fb_data p)
  1519.  #endif
  1520.  /* The actual framebuffer */
  1521.  extern fb_data *lcd_framebuffer;
  1522. -extern fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
  1523. +extern fb_data lcd_static_framebuffer[LCD_FBWIDTH][LCD_FBHEIGHT];
  1524.  #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
  1525.  #define FBADDR(x, y) (lcd_framebuffer + ((x) * LCD_FBHEIGHT) + (y))
  1526.  #else
  1527. @@ -551,7 +553,7 @@ extern void lcd_set_invert_display(bool yesno);
  1528.  #ifdef HAVE_BACKLIGHT_INVERSION
  1529.  extern void lcd_set_backlight_inversion(bool yesno);
  1530.  #endif /* HAVE_BACKLIGHT_INVERSION */
  1531. -extern void lcd_set_flip(bool yesno);
  1532. +extern void lcd_set_flip(int direction);
  1533.  
  1534.  extern void lcd_set_drawmode(int mode);
  1535.  extern int  lcd_get_drawmode(void);
  1536. diff --git a/firmware/screendump.c b/firmware/screendump.c
  1537. index 1acaaafba6..5915815a35 100644
  1538. --- a/firmware/screendump.c
  1539. +++ b/firmware/screendump.c
  1540. @@ -62,8 +62,8 @@ static const unsigned char bmpheader[] =
  1541.      LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
  1542.  
  1543.      0x28, 0x00, 0x00, 0x00,     /* Size of (2nd) header */
  1544. -    LE32_CONST(LCD_WIDTH),      /* Width in pixels */
  1545.      LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES),  /* Height in pixels */
  1546. +    LE32_CONST(LCD_WIDTH),      /* Width in pixels */
  1547.      0x01, 0x00,                 /* Number of planes (always 1) */
  1548.      LE16_CONST(DUMP_BMP_BPP),   /* Bits per pixel 1/4/8/16/24 */
  1549.      LE32_CONST(BMP_COMPRESSION),/* Compression mode */
  1550. diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
  1551. index 224ff3d0fc..35cf2b8746 100644
  1552. --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
  1553. +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
  1554. @@ -48,6 +48,9 @@ static int lcd_reg_0x61_val = 1; /* used to invert display */
  1555.  #ifdef HAVE_LCD_FLIP
  1556.  static int lcd_reg_3_val = 0x1030; /* controls to flip display */
  1557.  #endif
  1558. +short lcd_height = LCD_HEIGHT;
  1559. +short lcd_width  = LCD_WIDTH;
  1560. +
  1561.  
  1562.  static enum lcd_kind_t
  1563.  {
  1564. @@ -543,32 +546,57 @@ void lcd_set_invert_display(bool yesno)
  1565.  #endif
  1566.  
  1567.  #ifdef HAVE_LCD_FLIP
  1568. -void lcd_set_flip(bool yesno)
  1569. +void lcd_set_flip(int direction)
  1570.  {
  1571. -    lcd_reg_3_val = yesno ? 0x1000 : 0x1030;
  1572. +    switch(direction)
  1573. +    {
  1574. +    case 1:
  1575. +        lcd_reg_3_val = 0x1000;
  1576. +        lcd_height = LCD_HEIGHT;
  1577. +        lcd_width  = LCD_WIDTH;
  1578. +        break;
  1579. +    case 2:
  1580. +        lcd_reg_3_val = 0x1028;
  1581. +        lcd_height = LCD_WIDTH;
  1582. +        lcd_width  = LCD_HEIGHT;
  1583. +        break;
  1584. +    case 3:
  1585. +        lcd_reg_3_val = 0x1018;
  1586. +        lcd_height = LCD_WIDTH;
  1587. +        lcd_width  = LCD_HEIGHT;
  1588. +        screens[0].lcdheight=lcd_height;
  1589. +        screens[0].lcdwidth=lcd_width;
  1590. +        break;
  1591. +    case 0:
  1592. +    default:
  1593. +        lcd_reg_3_val = 0x1030;
  1594. +        lcd_height = LCD_HEIGHT;
  1595. +        lcd_width  = LCD_WIDTH;
  1596. +        break;
  1597. +    }
  1598.      #ifdef HAVE_LCD_ENABLE
  1599.      if(!lcd_on)
  1600.          return;
  1601.      #endif
  1602. -    /* same for both kinds */
  1603. +    /* same for all kinds */
  1604.      lcd_write_reg(3, lcd_reg_3_val);
  1605.  }
  1606.  #endif
  1607.  
  1608.  void lcd_update(void)
  1609.  {
  1610. -    lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
  1611. +    lcd_update_rect(0, 0, lcd_width, lcd_height);
  1612.  }
  1613.  
  1614.  void lcd_update_rect(int x, int y, int w, int h)
  1615.  {
  1616. -    #ifdef HAVE_LCD_ENABLE
  1617. +#ifdef HAVE_LCD_ENABLE
  1618.      if(!lcd_on)
  1619.          return;
  1620. -    #endif
  1621. +#endif
  1622.      /* make sure the rectangle is bounded in the screen */
  1623. -    if (w > LCD_WIDTH - x)/* Clip right */
  1624. -        w = LCD_WIDTH - x;
  1625. +    if (w > lcd_width - x)/* Clip right */
  1626. +        w = lcd_width - x;
  1627.      if (x < 0)/* Clip left */
  1628.      {
  1629.          w += x;
  1630. @@ -577,8 +605,8 @@ void lcd_update_rect(int x, int y, int w, int h)
  1631.      if (w <= 0)
  1632.          return; /* nothing left to do */
  1633.  
  1634. -    if (h > LCD_HEIGHT - y) /* Clip bottom */
  1635. -        h = LCD_HEIGHT - y;
  1636. +    if (h > lcd_height - y) /* Clip bottom */
  1637. +        h = lcd_height - y;
  1638.      if (y < 0) /* Clip top */
  1639.      {
  1640.          h += y;
  1641. @@ -588,12 +616,24 @@ void lcd_update_rect(int x, int y, int w, int h)
  1642.          return; /* nothing left to do */
  1643.  
  1644.      imx233_lcdif_wait_ready();
  1645. -    lcd_write_reg(0x50, x);
  1646. -    lcd_write_reg(0x51, x + w - 1);
  1647. -    lcd_write_reg(0x52, y);
  1648. -    lcd_write_reg(0x53, y + h - 1);
  1649. -    lcd_write_reg(0x20, x);
  1650. -    lcd_write_reg(0x21, y);
  1651. +    if( lcd_reg_3_val & 8)
  1652. +//    if( lcd_read_reg(3) == 0x1018)
  1653. +    {
  1654. +        lcd_write_reg(0x50, lcd_height - y - h);
  1655. +        lcd_write_reg(0x51, lcd_height - y - 1);
  1656. +        lcd_write_reg(0x52, x);
  1657. +        lcd_write_reg(0x53, x + w - 1);
  1658. +        lcd_write_reg(0x20, y);
  1659. +        lcd_write_reg(0x21, x);
  1660. +    }else
  1661. +    {
  1662. +        lcd_write_reg(0x50, x);
  1663. +        lcd_write_reg(0x51, x + w - 1);
  1664. +        lcd_write_reg(0x52, y);
  1665. +        lcd_write_reg(0x53, y + h - 1);
  1666. +        lcd_write_reg(0x20, x);
  1667. +        lcd_write_reg(0x21, y);
  1668. +    }
  1669.      lcd_write_reg(0x22, 0);
  1670.      imx233_lcdif_wait_ready();
  1671.      imx233_lcdif_set_word_length(16);
  1672. @@ -608,11 +648,13 @@ void lcd_update_rect(int x, int y, int w, int h)
  1673.       * the clock runs at 24MHz which provides barely 10MB/s bandwidth compared to >100MB/s
  1674.       * for memcopy operations
  1675.       */
  1676. -    if(w == LCD_WIDTH)
  1677. +#if 0
  1678. +    if(w == lcd_width)
  1679.      {
  1680.          memcpy((void *)FRAME, FBADDR(x,y), w * h * sizeof(fb_data));
  1681.      }
  1682.      else
  1683. +#endif
  1684.      {
  1685.          for(int i = 0; i < h; i++)
  1686.              memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data));
  1687. diff --git a/uisimulator/common/lcd-common.c b/uisimulator/common/lcd-common.c
  1688. index 0c8e0dcad5..222a5c0aaf 100644
  1689. --- a/uisimulator/common/lcd-common.c
  1690. +++ b/uisimulator/common/lcd-common.c
  1691. @@ -38,10 +38,17 @@ static bool lcd_enabled = false;
  1692.  static bool lcd_sleeping = true;
  1693.  #endif
  1694.  
  1695. +#if HAVE_LCD_FLIP==4
  1696. +void lcd_set_flip(int direction)
  1697. +{
  1698. +    (void)direction;
  1699. +}
  1700. +#else
  1701.  void lcd_set_flip(bool yesno)
  1702.  {
  1703.      (void)yesno;
  1704.  }
  1705. +#endif
  1706.  
  1707.  void lcd_set_invert_display(bool invert)
  1708.  {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement