summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
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 @@
23#include "lcd.h" 23#include "lcd.h"
24#include "lcd-playersim.h" 24#include "lcd-playersim.h"
25 25
26unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; /* the display */ 26unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; /* the display */
27char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */ 27char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */
28 28
29BITMAPINFO2 bmi = 29BITMAPINFO2 bmi =
@@ -80,7 +80,7 @@ void lcd_update()
80 80
81 for (x = 0; x < LCD_WIDTH; x++) 81 for (x = 0; x < LCD_WIDTH; x++)
82 for (y = 0; y < LCD_HEIGHT; y++) 82 for (y = 0; y < LCD_HEIGHT; y++)
83 bitmap[y][x] = ((lcd_framebuffer[x][y/8] >> (y & 7)) & 1); 83 bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
84 84
85 InvalidateRect (hGUIWnd, NULL, FALSE); 85 InvalidateRect (hGUIWnd, NULL, FALSE);
86 86
@@ -107,7 +107,7 @@ void lcd_update_rect(int x_start, int y_start,
107 107
108 for (x = x_start; x < xmax; x++) 108 for (x = x_start; x < xmax; x++)
109 for (y = y_start; y < ymax; y++) 109 for (y = y_start; y < ymax; y++)
110 bitmap[y][x] = ((lcd_framebuffer[x][y/8] >> (y & 7)) & 1); 110 bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
111 111
112 /* Bagder: If I only knew how, I would make this call only invalidate 112 /* Bagder: If I only knew how, I would make this call only invalidate
113 the actual rectangle we want updated here, this NULL thing here will 113 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 @@
39#include "lcd-x11.h" 39#include "lcd-x11.h"
40#include "lcd-playersim.h" 40#include "lcd-playersim.h"
41 41
42extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; 42extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
43extern void screen_resized(int width, int height); 43extern void screen_resized(int width, int height);
44extern Display *dpy; 44extern Display *dpy;
45 45
46#ifdef HAVE_LCD_BITMAP 46#ifdef HAVE_LCD_BITMAP
47unsigned char lcd_framebuffer_copy[LCD_WIDTH][LCD_HEIGHT/8]; 47unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH];
48 48
49static int counter; 49static int counter;
50 50
@@ -66,13 +66,13 @@ void lcd_update (void)
66 66
67 for(y=0; y<LCD_HEIGHT; y+=8) { 67 for(y=0; y<LCD_HEIGHT; y+=8) {
68 for(x=0; x<LCD_WIDTH; x++) { 68 for(x=0; x<LCD_WIDTH; x++) {
69 if(lcd_framebuffer[x][y/8] || lcd_framebuffer_copy[x][y/8]) { 69 if(lcd_framebuffer[y/8][x] || lcd_framebuffer_copy[y/8][x]) {
70 /* one or more bits/pixels are changed */ 70 /* one or more bits/pixels are changed */
71 unsigned char diff = 71 unsigned char diff =
72 lcd_framebuffer[x][y/8] ^ lcd_framebuffer_copy[x][y/8]; 72 lcd_framebuffer[y/8][x] ^ lcd_framebuffer_copy[y/8][x];
73 73
74 for(bit=0; bit<8; bit++) { 74 for(bit=0; bit<8; bit++) {
75 if(lcd_framebuffer[x][y/8]&(1<<bit)) { 75 if(lcd_framebuffer[y/8][x]&(1<<bit)) {
76 /* set a dot */ 76 /* set a dot */
77 points[p].x = x + MARGIN_X; 77 points[p].x = x + MARGIN_X;
78 points[p].y = y+bit + MARGIN_Y; 78 points[p].y = y+bit + MARGIN_Y;
@@ -131,13 +131,13 @@ void lcd_update_rect(int x_start, int y_start,
131 for(; yline<=ymax; yline++) { 131 for(; yline<=ymax; yline++) {
132 y = yline * 8; 132 y = yline * 8;
133 for(x=x_start; x<xmax; x++) { 133 for(x=x_start; x<xmax; x++) {
134 if(lcd_framebuffer[x][yline] || lcd_framebuffer_copy[x][yline]) { 134 if(lcd_framebuffer[yline][x] || lcd_framebuffer_copy[yline][x]) {
135 /* one or more bits/pixels are changed */ 135 /* one or more bits/pixels are changed */
136 unsigned char diff = 136 unsigned char diff =
137 lcd_framebuffer[x][yline] ^ lcd_framebuffer_copy[x][yline]; 137 lcd_framebuffer[yline][x] ^ lcd_framebuffer_copy[yline][x];
138 138
139 for(bit=0; bit<8; bit++) { 139 for(bit=0; bit<8; bit++) {
140 if(lcd_framebuffer[x][yline]&(1<<bit)) { 140 if(lcd_framebuffer[yline][x]&(1<<bit)) {
141 /* set a dot */ 141 /* set a dot */
142 points[p].x = x + MARGIN_X; 142 points[p].x = x + MARGIN_X;
143 points[p].y = y+bit + MARGIN_Y; 143 points[p].y = y+bit + MARGIN_Y;
@@ -152,7 +152,7 @@ void lcd_update_rect(int x_start, int y_start,
152 } 152 }
153 153
154 /* update the copy */ 154 /* update the copy */
155 lcd_framebuffer_copy[x][yline] = lcd_framebuffer[x][yline]; 155 lcd_framebuffer_copy[yline][x] = lcd_framebuffer[yline][x];
156 } 156 }
157 } 157 }
158 } 158 }