diff options
Diffstat (limited to 'firmware/target/hosted/sdl/lcd-bitmap.c')
-rw-r--r-- | firmware/target/hosted/sdl/lcd-bitmap.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/firmware/target/hosted/sdl/lcd-bitmap.c b/firmware/target/hosted/sdl/lcd-bitmap.c index 4ee0bbef5c..7e9bc297ef 100644 --- a/firmware/target/hosted/sdl/lcd-bitmap.c +++ b/firmware/target/hosted/sdl/lcd-bitmap.c | |||
@@ -92,29 +92,25 @@ static unsigned long get_lcd_pixel(int x, int y) | |||
92 | { | 92 | { |
93 | #if LCD_DEPTH == 1 | 93 | #if LCD_DEPTH == 1 |
94 | #ifdef HAVE_NEGATIVE_LCD | 94 | #ifdef HAVE_NEGATIVE_LCD |
95 | return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? (NUM_SHADES-1) : 0; | 95 | return (*FBADDR(x, y/8) & (1 << (y & 7))) ? (NUM_SHADES-1) : 0; |
96 | #else | 96 | #else |
97 | return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : (NUM_SHADES-1); | 97 | return (*FBADDR(x, y/8) & (1 << (y & 7))) ? 0 : (NUM_SHADES-1); |
98 | #endif | 98 | #endif |
99 | #elif LCD_DEPTH == 2 | 99 | #elif LCD_DEPTH == 2 |
100 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 100 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
101 | return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3]; | 101 | return colorindex[(*FBADDR(x/4, y) >> (2 * (~x & 3))) & 3]; |
102 | #elif LCD_PIXELFORMAT == VERTICAL_PACKING | 102 | #elif LCD_PIXELFORMAT == VERTICAL_PACKING |
103 | return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3]; | 103 | return colorindex[(*FBADDR(x, y/4) >> (2 * (y & 3))) & 3]; |
104 | #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED | 104 | #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED |
105 | unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101; | 105 | unsigned bits = (*FBADDR(x, y/8) >> (y & 7)) & 0x0101; |
106 | return colorindex[(bits | (bits >> 7)) & 3]; | 106 | return colorindex[(bits | (bits >> 7)) & 3]; |
107 | #endif | 107 | #endif |
108 | #elif LCD_DEPTH == 16 | 108 | #elif LCD_DEPTH == 16 |
109 | #if LCD_PIXELFORMAT == RGB565SWAPPED | 109 | #if LCD_PIXELFORMAT == RGB565SWAPPED |
110 | unsigned bits = lcd_framebuffer[y][x]; | 110 | unsigned bits = *FBADDR(x, y); |
111 | return (bits >> 8) | (bits << 8); | 111 | return (bits >> 8) | (bits << 8); |
112 | #else | 112 | #else |
113 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 113 | return *FBADDR(x, y); |
114 | return *(&lcd_framebuffer[0][0]+LCD_HEIGHT*x+y); | ||
115 | #else | ||
116 | return lcd_framebuffer[y][x]; | ||
117 | #endif | ||
118 | #endif | 114 | #endif |
119 | #endif | 115 | #endif |
120 | } | 116 | } |