summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-12-23 23:41:45 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-12-23 23:41:45 +0000
commit5040cc53ec0e0281b2824b3a82d360adc60eff4c (patch)
tree80abb5a51247bb69aa69b1f98b922aa20a875779 /uisimulator
parent2d720b2a7968666bfc315026c8a69b8a762aa058 (diff)
downloadrockbox-5040cc53ec0e0281b2824b3a82d360adc60eff4c.tar.gz
rockbox-5040cc53ec0e0281b2824b3a82d360adc60eff4c.tar.bz2
rockbox-5040cc53ec0e0281b2824b3a82d360adc60eff4c.zip
Screen buffer transposed, such that bytes in X-direction are consecutive. This enables my turbocharged lcd_write_data() for regular screen updates. Please check the X11 sim, Win32 works.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4177 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/lcd-win32.c6
-rw-r--r--uisimulator/x11/lcd-x11.c18
2 files changed, 12 insertions, 12 deletions
diff --git a/uisimulator/win32/lcd-win32.c b/uisimulator/win32/lcd-win32.c
index dcdb16f1f1..243e83dd2e 100644
--- a/uisimulator/win32/lcd-win32.c
+++ b/uisimulator/win32/lcd-win32.c
@@ -23,7 +23,7 @@
#include "lcd.h"
#include "lcd-playersim.h"
-unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; /* the display */
+unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; /* the display */
char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */
BITMAPINFO2 bmi =
@@ -80,7 +80,7 @@ void lcd_update()
for (x = 0; x < LCD_WIDTH; x++)
for (y = 0; y < LCD_HEIGHT; y++)
- bitmap[y][x] = ((lcd_framebuffer[x][y/8] >> (y & 7)) & 1);
+ bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
InvalidateRect (hGUIWnd, NULL, FALSE);
@@ -107,7 +107,7 @@ void lcd_update_rect(int x_start, int y_start,
for (x = x_start; x < xmax; x++)
for (y = y_start; y < ymax; y++)
- bitmap[y][x] = ((lcd_framebuffer[x][y/8] >> (y & 7)) & 1);
+ bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
/* Bagder: If I only knew how, I would make this call only invalidate
the actual rectangle we want updated here, this NULL thing here will
diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c
index 023f06240c..c02b3e383f 100644
--- a/uisimulator/x11/lcd-x11.c
+++ b/uisimulator/x11/lcd-x11.c
@@ -39,12 +39,12 @@
#include "lcd-x11.h"
#include "lcd-playersim.h"
-extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8];
+extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
extern void screen_resized(int width, int height);
extern Display *dpy;
#ifdef HAVE_LCD_BITMAP
-unsigned char lcd_framebuffer_copy[LCD_WIDTH][LCD_HEIGHT/8];
+unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH];
static int counter;
@@ -66,13 +66,13 @@ void lcd_update (void)
for(y=0; y<LCD_HEIGHT; y+=8) {
for(x=0; x<LCD_WIDTH; x++) {
- if(lcd_framebuffer[x][y/8] || lcd_framebuffer_copy[x][y/8]) {
+ if(lcd_framebuffer[y/8][x] || lcd_framebuffer_copy[y/8][x]) {
/* one or more bits/pixels are changed */
unsigned char diff =
- lcd_framebuffer[x][y/8] ^ lcd_framebuffer_copy[x][y/8];
+ lcd_framebuffer[y/8][x] ^ lcd_framebuffer_copy[y/8][x];
for(bit=0; bit<8; bit++) {
- if(lcd_framebuffer[x][y/8]&(1<<bit)) {
+ if(lcd_framebuffer[y/8][x]&(1<<bit)) {
/* set a dot */
points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y;
@@ -131,13 +131,13 @@ void lcd_update_rect(int x_start, int y_start,
for(; yline<=ymax; yline++) {
y = yline * 8;
for(x=x_start; x<xmax; x++) {
- if(lcd_framebuffer[x][yline] || lcd_framebuffer_copy[x][yline]) {
+ if(lcd_framebuffer[yline][x] || lcd_framebuffer_copy[yline][x]) {
/* one or more bits/pixels are changed */
unsigned char diff =
- lcd_framebuffer[x][yline] ^ lcd_framebuffer_copy[x][yline];
+ lcd_framebuffer[yline][x] ^ lcd_framebuffer_copy[yline][x];
for(bit=0; bit<8; bit++) {
- if(lcd_framebuffer[x][yline]&(1<<bit)) {
+ if(lcd_framebuffer[yline][x]&(1<<bit)) {
/* set a dot */
points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y;
@@ -152,7 +152,7 @@ void lcd_update_rect(int x_start, int y_start,
}
/* update the copy */
- lcd_framebuffer_copy[x][yline] = lcd_framebuffer[x][yline];
+ lcd_framebuffer_copy[yline][x] = lcd_framebuffer[yline][x];
}
}
}