@@ -279,24 +279,42 @@ static void sdl_display_write_mono(uint8_t *disp_buf,
279
279
one_color = 0x00FFFFFF ;
280
280
}
281
281
282
- for (tile_idx = 0U ; tile_idx < desc -> height /8U ; ++ tile_idx ) {
283
- for (w_idx = 0U ; w_idx < desc -> width ; ++ w_idx ) {
284
- byte_ptr = (const uint8_t * )buf +
285
- ((tile_idx * desc -> pitch ) + w_idx );
286
- disp_buf_start = disp_buf ;
287
- for (h_idx = 0U ; h_idx < 8 ; ++ h_idx ) {
288
- if ((* byte_ptr & mono_pixel_order (h_idx )) != 0U ) {
289
- pixel = one_color ;
290
- } else {
291
- pixel = ~one_color ;
282
+ if (IS_ENABLED (CONFIG_SDL_DISPLAY_MONO_VTILED )) {
283
+ for (tile_idx = 0U ; tile_idx < desc -> height / 8U ; ++ tile_idx ) {
284
+ for (w_idx = 0U ; w_idx < desc -> width ; ++ w_idx ) {
285
+ byte_ptr =
286
+ (const uint8_t * )buf + ((tile_idx * desc -> pitch ) + w_idx );
287
+ disp_buf_start = disp_buf ;
288
+ for (h_idx = 0U ; h_idx < 8 ; ++ h_idx ) {
289
+ if ((* byte_ptr & mono_pixel_order (h_idx )) != 0U ) {
290
+ pixel = one_color ;
291
+ } else {
292
+ pixel = ~one_color ;
293
+ }
294
+ * ((uint32_t * )disp_buf ) = pixel | 0xFF000000 ;
295
+ disp_buf += (desc -> width * 4U );
292
296
}
293
- * ((uint32_t * )disp_buf ) = pixel | 0xFF000000 ;
294
- disp_buf += (desc -> width * 4U );
297
+ disp_buf = disp_buf_start ;
298
+ disp_buf += 4 ;
299
+ }
300
+ disp_buf += 7 * (desc -> width * 4U );
301
+ }
302
+ } else {
303
+ for (h_idx = 0 ; h_idx < desc -> height ; h_idx ++ ) {
304
+ for (tile_idx = 0 ; tile_idx < desc -> width / 8 ; tile_idx ++ ) {
305
+ byte_ptr = (const uint8_t * )buf +
306
+ ((h_idx * desc -> width / 8 ) + tile_idx );
307
+ for (w_idx = 0 ; w_idx < 8 ; w_idx ++ ) {
308
+ if ((* byte_ptr & mono_pixel_order (w_idx )) != 0U ) {
309
+ pixel = one_color ;
310
+ } else {
311
+ pixel = ~one_color ;
312
+ }
313
+ * ((uint32_t * )disp_buf + w_idx ) = pixel | 0xFF000000 ;
314
+ }
315
+ disp_buf += 8 * sizeof (uint32_t );
295
316
}
296
- disp_buf = disp_buf_start ;
297
- disp_buf += 4 ;
298
317
}
299
- disp_buf += 7 * (desc -> width * 4U );
300
318
}
301
319
}
302
320
@@ -669,7 +687,8 @@ static void sdl_display_get_capabilities(
669
687
PIXEL_FORMAT_BGR_565 |
670
688
PIXEL_FORMAT_L_8 ;
671
689
capabilities -> current_pixel_format = disp_data -> current_pixel_format ;
672
- capabilities -> screen_info = SCREEN_INFO_MONO_VTILED |
690
+ capabilities -> screen_info =
691
+ (IS_ENABLED (CONFIG_SDL_DISPLAY_MONO_VTILED ) ? SCREEN_INFO_MONO_VTILED : 0 ) |
673
692
(IS_ENABLED (CONFIG_SDL_DISPLAY_MONO_MSB_FIRST ) ? SCREEN_INFO_MONO_MSB_FIRST : 0 );
674
693
}
675
694
0 commit comments