summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-09-30 10:25:28 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-09-30 10:42:49 +0100
commitf373c97c90e816404c00ab48b2e36b18fd5e6c49 (patch)
treeb268985996c496f9149e4508f9fea950711e1a6c
parent9ed36ec22f7ea880b64fa11d2c0d49485287ad03 (diff)
downloadrockbox-f373c97c90e816404c00ab48b2e36b18fd5e6c49.tar.gz
rockbox-f373c97c90e816404c00ab48b2e36b18fd5e6c49.zip
Define LCD_STRIDEFORMAT unconditionally
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the macro it's simpler to have config.h define LCD_STRIDEFORMAT to the default of horizontal stride when the target leaves it unspecified. Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
-rw-r--r--apps/plugins/SOURCES3
-rw-r--r--apps/plugins/SUBDIRS3
-rw-r--r--apps/plugins/bitmaps/native/SOURCES3
-rw-r--r--apps/plugins/imageviewer/jpeg/yuv2rgb.c2
-rw-r--r--apps/plugins/imageviewer/ppm/ppm_decoder.c2
-rw-r--r--apps/plugins/invadrox.c2
-rw-r--r--apps/plugins/lib/bmp_smooth_scale.c2
-rw-r--r--apps/plugins/lib/osd.c8
-rw-r--r--apps/plugins/lib/pluginlib_bmp.c2
-rw-r--r--apps/plugins/lib/xlcd_scroll.c4
-rw-r--r--apps/plugins/lua/rocklib_img.c2
-rw-r--r--apps/plugins/pictureflow/pictureflow.c2
-rw-r--r--apps/plugins/puzzles/rockbox.c2
-rw-r--r--apps/plugins/test_viewports.c2
-rw-r--r--apps/plugins/xworld/sys.c12
-rw-r--r--apps/recorder/resize.c2
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/drivers/lcd-1bit-vert.c2
-rw-r--r--firmware/drivers/lcd-2bit-horz.c2
-rw-r--r--firmware/drivers/lcd-2bit-vert.c2
-rw-r--r--firmware/drivers/lcd-2bit-vi.c2
-rw-r--r--firmware/drivers/lcd-color-common.c2
-rw-r--r--firmware/export/config.h8
-rw-r--r--firmware/export/lcd.h4
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c4
-rw-r--r--firmware/target/hosted/sdl/lcd-sdl.c6
26 files changed, 44 insertions, 43 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 942f9a5b20..85227d80d7 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -82,8 +82,7 @@ crypt_firmware.c
82 82
83/* Overlays loaders */ 83/* Overlays loaders */
84 84
85#if defined(HAVE_LCD_COLOR) && \ 85#if defined(HAVE_LCD_COLOR) && (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE)
86 (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
87#if (PLUGIN_BUFFER_SIZE > 0x14000) && (CONFIG_PLATFORM & (PLATFORM_NATIVE |PLATFORM_HOSTED)) && (defined(CPU_ARM) || defined(CPU_MIPS)) 86#if (PLUGIN_BUFFER_SIZE > 0x14000) && (CONFIG_PLATFORM & (PLATFORM_NATIVE |PLATFORM_HOSTED)) && (defined(CPU_ARM) || defined(CPU_MIPS))
88duke3d.c 87duke3d.c
89quake.c 88quake.c
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index 8479e4b3dd..4cb57edb1b 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -9,8 +9,7 @@ clock
9#endif 9#endif
10 10
11/* color horizontal-stride LCDs */ 11/* color horizontal-stride LCDs */
12#if defined(HAVE_LCD_COLOR) && \ 12#if defined(HAVE_LCD_COLOR) && (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE)
13 (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
14xworld 13xworld
15 14
16/* for duke3d, wolf3d and quake */ 15/* for duke3d, wolf3d and quake */
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index f207f358b2..d0cc853f5b 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -548,8 +548,7 @@ pegbox_pieces.9x7x1.bmp
548#endif 548#endif
549 549
550/* Puzzles */ 550/* Puzzles */
551#if defined(HAVE_LCD_COLOR) && \ 551#if defined(HAVE_LCD_COLOR) && (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE)
552 (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE))
553puzzles_cursor.11x16x24.bmp 552puzzles_cursor.11x16x24.bmp
554#endif 553#endif
555 554
diff --git a/apps/plugins/imageviewer/jpeg/yuv2rgb.c b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
index 61d7fd6487..3e7f08d8bc 100644
--- a/apps/plugins/imageviewer/jpeg/yuv2rgb.c
+++ b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
@@ -238,7 +238,7 @@ static fb_data (* const pixel_funcs[COLOUR_NUM_MODES][DITHER_NUM_MODES])(void) =
238}; 238};
239 239
240/* These defines are used fornormal horizontal strides and vertical strides. */ 240/* These defines are used fornormal horizontal strides and vertical strides. */
241#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 241#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
242#define LCDADDR(x, y) (lcd_fb + LCD_HEIGHT*(x) + (y)) 242#define LCDADDR(x, y) (lcd_fb + LCD_HEIGHT*(x) + (y))
243#define ROWENDOFFSET (width*LCD_HEIGHT) 243#define ROWENDOFFSET (width*LCD_HEIGHT)
244#define ROWOFFSET (1) 244#define ROWOFFSET (1)
diff --git a/apps/plugins/imageviewer/ppm/ppm_decoder.c b/apps/plugins/imageviewer/ppm/ppm_decoder.c
index 4a86be1a3a..ccb208b80b 100644
--- a/apps/plugins/imageviewer/ppm/ppm_decoder.c
+++ b/apps/plugins/imageviewer/ppm/ppm_decoder.c
@@ -177,7 +177,7 @@ static int read_ppm_row(int fd, struct ppm_info *ppm, int row)
177 int col; 177 int col;
178 int r, g, b; 178 int r, g, b;
179#ifdef HAVE_LCD_COLOR 179#ifdef HAVE_LCD_COLOR
180#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 180#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
181 fb_data *dst = (fb_data *) ppm->buf + row; 181 fb_data *dst = (fb_data *) ppm->buf + row;
182 const int stride = ppm->x; 182 const int stride = ppm->x;
183#else 183#else
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index a164b95cf0..d130ab6108 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -785,7 +785,7 @@ static fb_data *lcd_fb;
785/* No standard get_pixel function yet, use this hack instead */ 785/* No standard get_pixel function yet, use this hack instead */
786#if (LCD_DEPTH >= 8) 786#if (LCD_DEPTH >= 8)
787 787
788#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 788#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
789static inline fb_data get_pixel(int x, int y) 789static inline fb_data get_pixel(int x, int y)
790{ 790{
791 return lcd_fb[x*LCD_HEIGHT+y]; 791 return lcd_fb[x*LCD_HEIGHT+y];
diff --git a/apps/plugins/lib/bmp_smooth_scale.c b/apps/plugins/lib/bmp_smooth_scale.c
index c5f258cdbf..378ff96448 100644
--- a/apps/plugins/lib/bmp_smooth_scale.c
+++ b/apps/plugins/lib/bmp_smooth_scale.c
@@ -78,7 +78,7 @@ void smooth_resize_bitmap(struct bitmap *src_bmp, struct bitmap *dest_bmp)
78 fb_data *sptr, *dptr; 78 fb_data *sptr, *dptr;
79 int x, y, end; 79 int x, y, end;
80 int val_y = 0, val_x; 80 int val_y = 0, val_x;
81#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 81#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
82 const int sw = src_bmp->height; 82 const int sw = src_bmp->height;
83 const int sh = src_bmp->width; 83 const int sh = src_bmp->width;
84 const int dw = dest_bmp->height; 84 const int dw = dest_bmp->height;
diff --git a/apps/plugins/lib/osd.c b/apps/plugins/lib/osd.c
index 7d6e10a410..99f77da7dc 100644
--- a/apps/plugins/lib/osd.c
+++ b/apps/plugins/lib/osd.c
@@ -106,10 +106,10 @@ static struct osd grey_osd;
106# error Unknown 2-bit format; please define macros 106# error Unknown 2-bit format; please define macros
107# endif /* LCD_PIXELFORMAT */ 107# endif /* LCD_PIXELFORMAT */
108#elif LCD_DEPTH == 16 108#elif LCD_DEPTH == 16
109# if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 109# if LCD_STRIDEFORMAT == VERTICAL_STRIDE
110# define _OSD_HEIGHT2BYTES(h) ((h)*2) 110# define _OSD_HEIGHT2BYTES(h) ((h)*2)
111# define _OSD_BYTES2HEIGHT(b) ((b)/2) 111# define _OSD_BYTES2HEIGHT(b) ((b)/2)
112# else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */ 112# else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */
113# define _OSD_WIDTH2BYTES(w) ((w)*2) 113# define _OSD_WIDTH2BYTES(w) ((w)*2)
114# define _OSD_BYTES2WIDTH(b) ((b)/2) 114# define _OSD_BYTES2WIDTH(b) ((b)/2)
115# endif /* end stride type selection */ 115# endif /* end stride type selection */
@@ -160,7 +160,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags,
160 160
161 rb->viewport_set_fullscreen(&osd->vp, SCREEN_MAIN); 161 rb->viewport_set_fullscreen(&osd->vp, SCREEN_MAIN);
162 162
163#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 163#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
164 int colbytes = _OSD_HEIGHT2BYTES(LCD_HEIGHT); 164 int colbytes = _OSD_HEIGHT2BYTES(LCD_HEIGHT);
165 int bytecols = *bufsize / colbytes; 165 int bytecols = *bufsize / colbytes;
166 int w = _OSD_BYTES2WIDTH(bytecols); 166 int w = _OSD_BYTES2WIDTH(bytecols);
@@ -193,7 +193,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags,
193 w = _OSD_BYTES2WIDTH(_OSD_WIDTH2BYTES(w)); 193 w = _OSD_BYTES2WIDTH(_OSD_WIDTH2BYTES(w));
194 osd->lcd_bitmap_stride = _OSD_BYTES2HEIGHT(_OSD_HEIGHT2BYTES(LCD_HEIGHT)); 194 osd->lcd_bitmap_stride = _OSD_BYTES2HEIGHT(_OSD_HEIGHT2BYTES(LCD_HEIGHT));
195 osd->back_bitmap_stride = h; 195 osd->back_bitmap_stride = h;
196#else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */ 196#else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */
197 int rowbytes = _OSD_WIDTH2BYTES(LCD_WIDTH); 197 int rowbytes = _OSD_WIDTH2BYTES(LCD_WIDTH);
198 int byterows = *bufsize / rowbytes; 198 int byterows = *bufsize / rowbytes;
199 int w = _OSD_BYTES2WIDTH(rowbytes); 199 int w = _OSD_BYTES2WIDTH(rowbytes);
diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c
index f3edfbf425..82f84b05af 100644
--- a/apps/plugins/lib/pluginlib_bmp.c
+++ b/apps/plugins/lib/pluginlib_bmp.c
@@ -94,7 +94,7 @@ int save_bmp_file( char* filename, struct bitmap *bm )
94*/ 94*/
95void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) 95void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst)
96{ 96{
97#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 97#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
98 const int srcw = src->height; 98 const int srcw = src->height;
99 const int srch = src->width; 99 const int srch = src->width;
100 const int dstw = dst->height; 100 const int dstw = dst->height;
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c
index 5ac4a366e8..906f4eaae1 100644
--- a/apps/plugins/lib/xlcd_scroll.c
+++ b/apps/plugins/lib/xlcd_scroll.c
@@ -30,7 +30,7 @@
30static const unsigned short patterns[4] = {0xFFFF, 0xFF00, 0x00FF, 0x0000}; 30static const unsigned short patterns[4] = {0xFFFF, 0xFF00, 0x00FF, 0x0000};
31#endif 31#endif
32 32
33#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 33#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
34void xlcd_scroll_left(int count) 34void xlcd_scroll_left(int count)
35{ 35{
36 /*size_t dst_stride;*/ 36 /*size_t dst_stride;*/
@@ -668,4 +668,4 @@ void xlcd_scroll_down(int count)
668} 668}
669 669
670#endif /* LCD_PIXELFORMAT, LCD_DEPTH */ 670#endif /* LCD_PIXELFORMAT, LCD_DEPTH */
671#endif /* defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE */ 671#endif /* LCD_STRIDEFORMAT == VERTICAL_STRIDE */
diff --git a/apps/plugins/lua/rocklib_img.c b/apps/plugins/lua/rocklib_img.c
index b0ca769ca4..68e5325ce0 100644
--- a/apps/plugins/lua/rocklib_img.c
+++ b/apps/plugins/lua/rocklib_img.c
@@ -380,7 +380,7 @@ static inline fb_data* rli_get_element(struct rocklua_image* img, int x, int y)
380 380
381 pixel_to_native(x, y, &x, &y); 381 pixel_to_native(x, y, &x, &y);
382 382
383#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 383#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
384 /* column major address */ 384 /* column major address */
385 size_t data_address = (stride * (x - 1)) + (y - 1); 385 size_t data_address = (stride * (x - 1)) + (y - 1);
386 386
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 0e5585681d..eec8313485 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -3101,7 +3101,7 @@ static void render_slide(struct slide_data *slide, const int alpha)
3101 3101
3102 const pix_t *ptr = &src[column * bmp->height]; 3102 const pix_t *ptr = &src[column * bmp->height];
3103 3103
3104#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 3104#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
3105#define PIXELSTEP_Y 1 3105#define PIXELSTEP_Y 1
3106#define LCDADDR(x, y) (&buffer[BUFFER_HEIGHT*(x) + (y)]) 3106#define LCDADDR(x, y) (&buffer[BUFFER_HEIGHT*(x) + (y)])
3107#else 3107#else
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index 6e34adb1db..9a82cdde10 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -1465,7 +1465,7 @@ static void rb_blitter_free(void *handle, blitter *bl)
1465static void rb_blitter_save(void *handle, blitter *bl, int x, int y) 1465static void rb_blitter_save(void *handle, blitter *bl, int x, int y)
1466{ 1466{
1467 /* no viewport offset */ 1467 /* no viewport offset */
1468#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 1468#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
1469#error no vertical stride 1469#error no vertical stride
1470#else 1470#else
1471 if(bl && bl->bmp.data) 1471 if(bl && bl->bmp.data)
diff --git a/apps/plugins/test_viewports.c b/apps/plugins/test_viewports.c
index 2bada01f79..76f1a9da9b 100644
--- a/apps/plugins/test_viewports.c
+++ b/apps/plugins/test_viewports.c
@@ -130,7 +130,7 @@ static void *test_address_fn(int x, int y)
130 130
131 struct frame_buffer_t *fb = vp0.buffer; 131 struct frame_buffer_t *fb = vp0.buffer;
132/* LCD_STRIDEFORMAT & LCD_NATIVE_STRIDE macros allow Horiz screens to work with RB */ 132/* LCD_STRIDEFORMAT & LCD_NATIVE_STRIDE macros allow Horiz screens to work with RB */
133#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 133#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
134 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y; 134 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y;
135#else 135#else
136 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x; 136 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x;
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c
index c57da9456b..a806de5297 100644
--- a/apps/plugins/xworld/sys.c
+++ b/apps/plugins/xworld/sys.c
@@ -496,7 +496,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
496 for (int i = 0; i < w / 2; ++i) { 496 for (int i = 0; i < w / 2; ++i) {
497 uint8_t pix1 = *(buf + i) >> 4; 497 uint8_t pix1 = *(buf + i) >> 4;
498 uint8_t pix2 = *(buf + i) & 0xF; 498 uint8_t pix2 = *(buf + i) & 0xF;
499#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 499#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
500 framebuffer[( (h * 2) ) * 320 + i] = sys->palette[pix1]; 500 framebuffer[( (h * 2) ) * 320 + i] = sys->palette[pix1];
501 framebuffer[( (h * 2) + 1) * 320 + i] = sys->palette[pix2]; 501 framebuffer[( (h * 2) + 1) * 320 + i] = sys->palette[pix2];
502#else 502#else
@@ -515,7 +515,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
515 for (int i = 0; i < w / 2; ++i) { 515 for (int i = 0; i < w / 2; ++i) {
516 uint8_t pix1 = *(buf + i) >> 4; 516 uint8_t pix1 = *(buf + i) >> 4;
517 uint8_t pix2 = *(buf + i) & 0xF; 517 uint8_t pix2 = *(buf + i) & 0xF;
518#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 518#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
519 framebuffer[(200 - h * 2 ) * 320 + ( 320 - i )] = sys->palette[pix1]; 519 framebuffer[(200 - h * 2 ) * 320 + ( 320 - i )] = sys->palette[pix1];
520 framebuffer[(200 - h * 2 - 1) * 320 + ( 320 - i )] = sys->palette[pix2]; 520 framebuffer[(200 - h * 2 - 1) * 320 + ( 320 - i )] = sys->palette[pix2];
521#else 521#else
@@ -531,7 +531,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
531 else 531 else
532 { 532 {
533 int next = 0; 533 int next = 0;
534#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 534#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
535 for(int x = 0; x < w / 2; ++x) 535 for(int x = 0; x < w / 2; ++x)
536 { 536 {
537 for(int y = 0; y < h; ++y) 537 for(int y = 0; y < h; ++y)
@@ -565,7 +565,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
565 struct bitmap in_bmp; 565 struct bitmap in_bmp;
566 if(sys->settings.rotation_option) 566 if(sys->settings.rotation_option)
567 { 567 {
568#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 568#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
569 in_bmp.width = 320; 569 in_bmp.width = 320;
570 in_bmp.height = 200; 570 in_bmp.height = 200;
571#else 571#else
@@ -575,7 +575,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
575 } 575 }
576 else 576 else
577 { 577 {
578#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 578#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
579 in_bmp.width = 200; 579 in_bmp.width = 200;
580 in_bmp.height = 320; 580 in_bmp.height = 320;
581#else 581#else
@@ -600,7 +600,7 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16
600 } 600 }
601 else 601 else
602 { 602 {
603#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) 603#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
604 for(int x = 0; x < 320; ++x) 604 for(int x = 0; x < 320; ++x)
605 { 605 {
606 for(int y = 0; y < 200; ++y) 606 for(int y = 0; y < 200; ++y)
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c
index 6f561039c3..c16cec9dc9 100644
--- a/apps/recorder/resize.c
+++ b/apps/recorder/resize.c
@@ -593,7 +593,7 @@ static inline bool scale_v_linear(struct rowset *rset,
593static void output_row_32_native_fromyuv(uint32_t row, void * row_in, 593static void output_row_32_native_fromyuv(uint32_t row, void * row_in,
594 struct scaler_context *ctx) 594 struct scaler_context *ctx)
595{ 595{
596#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 596#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
597#define DEST_STEP (ctx->bm->height) 597#define DEST_STEP (ctx->bm->height)
598#define Y_STEP (1) 598#define Y_STEP (1)
599#else 599#else
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 49d1d9ac95..abce59fe04 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -300,7 +300,7 @@ drivers/lcd-2bit-vert.c
300drivers/lcd-2bit-vi.c 300drivers/lcd-2bit-vi.c
301#endif /* LCD_PIXELFORMAT */ 301#endif /* LCD_PIXELFORMAT */
302#elif LCD_DEPTH == 16 302#elif LCD_DEPTH == 16
303#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 303#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
304drivers/lcd-16bit-vert.c 304drivers/lcd-16bit-vert.c
305#else 305#else
306drivers/lcd-16bit.c 306drivers/lcd-16bit.c
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index ff95eacdbc..e574d4c191 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -83,7 +83,7 @@ static void *LCDFN(frameaddress_default)(int x, int y)
83{ 83{
84 /* the default expects a buffer the same size as the screen */ 84 /* the default expects a buffer the same size as the screen */
85 struct frame_buffer_t *fb = CURRENT_VP->buffer; 85 struct frame_buffer_t *fb = CURRENT_VP->buffer;
86#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 86#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
87 size_t element = (x * LCDM(NATIVE_STRIDE)(fb->stride)) + y; 87 size_t element = (x * LCDM(NATIVE_STRIDE)(fb->stride)) + y;
88#else 88#else
89 size_t element = (y * LCDM(NATIVE_STRIDE)(fb->stride)) + x; 89 size_t element = (y * LCDM(NATIVE_STRIDE)(fb->stride)) + x;
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c
index 66313d624b..1bc489247c 100644
--- a/firmware/drivers/lcd-2bit-horz.c
+++ b/firmware/drivers/lcd-2bit-horz.c
@@ -81,7 +81,7 @@ static void *lcd_frameaddress_default(int x, int y)
81 /* the default expects a buffer the same size as the screen */ 81 /* the default expects a buffer the same size as the screen */
82 struct frame_buffer_t *fb = lcd_current_viewport->buffer; 82 struct frame_buffer_t *fb = lcd_current_viewport->buffer;
83 83
84#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 84#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
85 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y; 85 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y;
86#else 86#else
87 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x; 87 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x;
diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c
index 4ce9960419..b206a2d816 100644
--- a/firmware/drivers/lcd-2bit-vert.c
+++ b/firmware/drivers/lcd-2bit-vert.c
@@ -83,7 +83,7 @@ static void *lcd_frameaddress_default(int x, int y)
83 /* the default expects a buffer the same size as the screen */ 83 /* the default expects a buffer the same size as the screen */
84 struct frame_buffer_t *fb = lcd_current_viewport->buffer; 84 struct frame_buffer_t *fb = lcd_current_viewport->buffer;
85 85
86#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 86#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
87 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y; 87 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y;
88#else 88#else
89 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x; 89 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x;
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index b969c93216..0bcf60767e 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -95,7 +95,7 @@ static void *LCDFN(frameaddress_default)(int x, int y)
95{ 95{
96 /* the default expects a buffer the same size as the screen */ 96 /* the default expects a buffer the same size as the screen */
97 struct frame_buffer_t *fb = CURRENT_VP->buffer; 97 struct frame_buffer_t *fb = CURRENT_VP->buffer;
98#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 98#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
99 size_t element = (x * LCDM(NATIVE_STRIDE)(fb->stride)) + y; 99 size_t element = (x * LCDM(NATIVE_STRIDE)(fb->stride)) + y;
100#else 100#else
101 size_t element = (y * LCDM(NATIVE_STRIDE)(fb->stride)) + x; 101 size_t element = (y * LCDM(NATIVE_STRIDE)(fb->stride)) + x;
diff --git a/firmware/drivers/lcd-color-common.c b/firmware/drivers/lcd-color-common.c
index 36144b574c..9feba9f894 100644
--- a/firmware/drivers/lcd-color-common.c
+++ b/firmware/drivers/lcd-color-common.c
@@ -76,7 +76,7 @@ static void *lcd_frameaddress_default(int x, int y)
76 /* the default expects a buffer the same size as the screen */ 76 /* the default expects a buffer the same size as the screen */
77 struct frame_buffer_t *fb = lcd_current_viewport->buffer; 77 struct frame_buffer_t *fb = lcd_current_viewport->buffer;
78 78
79#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 79#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
80 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y; 80 size_t element = (x * LCD_NATIVE_STRIDE(fb->stride)) + y;
81#else 81#else
82 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x; 82 size_t element = (y * LCD_NATIVE_STRIDE(fb->stride)) + x;
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 2519b87f0d..e83194e0f4 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -772,6 +772,11 @@ Lyre prototype 1 */
772#define LCD_SPLIT_LINES 0 772#define LCD_SPLIT_LINES 0
773#endif 773#endif
774 774
775/* Most displays have a horizontal stride */
776#ifndef LCD_STRIDEFORMAT
777# define LCD_STRIDEFORMAT HORIZONTAL_STRIDE
778#endif
779
775/* Simulator LCD dimensions. Set to standard dimensions if undefined */ 780/* Simulator LCD dimensions. Set to standard dimensions if undefined */
776#ifndef SIM_LCD_WIDTH 781#ifndef SIM_LCD_WIDTH
777#define SIM_LCD_WIDTH LCD_WIDTH 782#define SIM_LCD_WIDTH LCD_WIDTH
@@ -978,8 +983,7 @@ Lyre prototype 1 */
978 || defined(CPU_S5L870X) || (CONFIG_CPU == S3C2440) \ 983 || defined(CPU_S5L870X) || (CONFIG_CPU == S3C2440) \
979 || defined(APPLICATION) || (CONFIG_CPU == PP5002) \ 984 || defined(APPLICATION) || (CONFIG_CPU == PP5002) \
980 || (CONFIG_CPU == RK27XX) || (CONFIG_CPU == IMX233) || \ 985 || (CONFIG_CPU == RK27XX) || (CONFIG_CPU == IMX233) || \
981 (defined(HAVE_LCD_COLOR) && \ 986 (defined(HAVE_LCD_COLOR) && (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE))
982 (!defined(LCD_STRIDEFORMAT) || (LCD_STRIDEFORMAT != VERTICAL_STRIDE)))
983#define HAVE_SEMAPHORE_OBJECTS 987#define HAVE_SEMAPHORE_OBJECTS
984#endif 988#endif
985 989
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 0edef7b866..67b22190ad 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -82,7 +82,7 @@ enum screen_type {
82 82
83struct scrollinfo; 83struct scrollinfo;
84 84
85#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 85#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
86#define STRIDE_MAIN(w, h) (h) 86#define STRIDE_MAIN(w, h) (h)
87#else 87#else
88#define STRIDE_MAIN(w, h) (w) 88#define STRIDE_MAIN(w, h) (w)
@@ -496,7 +496,7 @@ typedef void lcd_blockfunc_type(fb_data *address, unsigned mask, unsigned bits);
496#endif 496#endif
497 497
498#ifndef LCD_NBELEMS 498#ifndef LCD_NBELEMS
499#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 499#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
500#define LCD_NBELEMS(w, h) (((w-1)*STRIDE_MAIN(w, h)) + h) 500#define LCD_NBELEMS(w, h) (((w-1)*STRIDE_MAIN(w, h)) + h)
501#else 501#else
502#define LCD_NBELEMS(w, h) (((h-1)*STRIDE_MAIN(w, h)) + w) 502#define LCD_NBELEMS(w, h) (((h-1)*STRIDE_MAIN(w, h)) + w)
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index d952d3d40d..8620c672e1 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -38,7 +38,7 @@
38 38
39#if CONFIG_ORIENTATION == SCREEN_PORTRAIT 39#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
40#define LCD_USE_DMA 40#define LCD_USE_DMA
41#elif defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 41#elif LCD_STRIDEFORMAT == VERTICAL_STRIDE
42#define LCD_USE_DMA 42#define LCD_USE_DMA
43#endif 43#endif
44 44
@@ -511,7 +511,7 @@ void lcd_update_rect(int x, int y, int width, int height)
511 511
512#else 512#else
513 513
514#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 514#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
515 515
516#if defined(LCD_USE_DMA) 516#if defined(LCD_USE_DMA)
517 dma_start_transfer16( (char *)FBADDR(0,0), x, y, LCD_HEIGHT, 517 dma_start_transfer16( (char *)FBADDR(0,0), x, y, LCD_HEIGHT,
diff --git a/firmware/target/hosted/sdl/lcd-sdl.c b/firmware/target/hosted/sdl/lcd-sdl.c
index de19de365a..8cbb6c5651 100644
--- a/firmware/target/hosted/sdl/lcd-sdl.c
+++ b/firmware/target/hosted/sdl/lcd-sdl.c
@@ -31,9 +31,9 @@ void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
31 unsigned long (*getpixel)(int, int)) 31 unsigned long (*getpixel)(int, int))
32{ 32{
33 SDL_Rect dest; 33 SDL_Rect dest;
34#if LCD_DEPTH >= 8 && (LCD_PIXELFORMAT == RGB565) \ 34#if LCD_DEPTH >= 8 && (LCD_PIXELFORMAT == RGB565) && \
35 && !defined(LCD_STRIDEFORMAT) && !defined(HAVE_LCD_SPLIT) \ 35 (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE) && \
36 && !defined(HAVE_REMOTE_LCD) 36 !defined(HAVE_LCD_SPLIT) && !defined(HAVE_REMOTE_LCD)
37 SDL_Rect src; 37 SDL_Rect src;
38 (void)max_x; 38 (void)max_x;
39 (void)max_y; 39 (void)max_y;