Follow change of lcd_lyout to globalconfig.lcdstate in simulat0r

This commit is contained in:
bernd 2011-07-28 02:20:00 +02:00
parent 1643d90e0a
commit 001974153a
2 changed files with 7 additions and 8 deletions

View File

@ -96,10 +96,10 @@ public:
for (int x = 0; x < dimx; ++x) {
for(int y=0; y<dimy; ++y) {
int color;
if(lcd_layout & LCD_INVERTED) {
color=lcdGetPixel((lcd_layout & LCD_MIRRORX)?(RESX-x-1):x,(lcd_layout & LCD_MIRRORY)?(RESY-y-1):y)?colorInvertedPixelOn:colorInvertedPixelOff;
if(globalconfig.lcdstate & LCD_INVERTED) {
color=lcdGetPixel((globalconfig.lcdstate & LCD_MIRRORX)?(RESX-x-1):x,(globalconfig.lcdstate & LCD_MIRRORY)?(RESY-y-1):y)?colorInvertedPixelOn:colorInvertedPixelOff;
} else {
color=lcdGetPixel((lcd_layout & LCD_MIRRORX)?(RESX-x-1):x,(lcd_layout & LCD_MIRRORY)?(RESY-y-1):y)?colorPixelOn:colorPixelOff;
color=lcdGetPixel((globalconfig.lcdstate & LCD_MIRRORX)?(RESX-x-1):x,(globalconfig.lcdstate & LCD_MIRRORY)?(RESY-y-1):y)?colorPixelOn:colorPixelOff;
}
for(int minix=0; minix<pixw; ++minix) {
for(int miniy=0; miniy<pixh; ++miniy) {

View File

@ -1,18 +1,17 @@
#include "simulator.h"
#include "../firmware/basic/basic.h"
#include "../firmware/lcd/display.h"
#include <unistd.h>
extern int lcd_layout;
void simlcdDisplayUpdate() {
write(1,"\033[H",3);
for(int y=0; y<RESY; ++y) {
for(int x=0; x<RESX; ++x) {
if(lcd_layout & LCD_INVERTED) {
write(1,(lcdGetPixel((lcd_layout & LCD_MIRRORX)?(RESX-x-1):x,(lcd_layout & LCD_MIRRORY)?(RESY-y-1):y)?"#":"_"),1);
if(globalconfig.lcdstate & LCD_INVERTED) {
write(1,(lcdGetPixel((globalconfig.lcdstate & LCD_MIRRORX)?(RESX-x-1):x,(globalconfig.lcdstate & LCD_MIRRORY)?(RESY-y-1):y)?"#":"_"),1);
} else {
write(1,(lcdGetPixel((lcd_layout & LCD_MIRRORX)?(RESX-x-1):x,(lcd_layout & LCD_MIRRORY)?(RESY-y-1):y)?".":"@"),1);
write(1,(lcdGetPixel((globalconfig.lcdstate & LCD_MIRRORX)?(RESX-x-1):x,(globalconfig.lcdstate & LCD_MIRRORY)?(RESY-y-1):y)?".":"@"),1);
}
}
write(1,("\n"),1);