fix missing include. Also make lcdScroll nicer to read.

This commit is contained in:
Stefan `Sec` Zehl 2011-07-21 20:01:49 +02:00
parent a5b227b60e
commit f81e2b8283
1 changed files with 22 additions and 34 deletions

View File

@ -1,3 +1,5 @@
#include <string.h>
#include <display.h> #include <display.h>
#include <sysdefs.h> #include <sysdefs.h>
#include "lpc134x.h" #include "lpc134x.h"
@ -213,42 +215,28 @@ void lcdShiftV(bool up, bool wrap) {
} }
void lcdShift(int x, int y, bool wrap) { void lcdShift(int x, int y, bool wrap) {
int yb, yr, ya; bool dir=true;
bool dir;
if (x>0) { if(x<0){
for (int cx = 0; cx < x; cx++) {
lcdShiftH(true, wrap);
}
} else if (x<0) {
for (int cx = x; cx < 0; cx++) {
lcdShiftH(false, wrap);
}
}
if (y != 0) {
if (y>0) {
ya = y;
yb = y/8;
yr = y%8;
dir = true;
} else if (y<0) {
ya = -y;
yb = (-y)/8;
yr = (-y)%8;
dir=false; dir=false;
} x=-x;
};
//for (int cyb = 0; cyb < yb; cyb++) { while(x-->0)
// lcdShiftV8(dir, wrap); lcdShiftH(dir, wrap);
//}
//for (int cyr = 0; cyr < yr; cyr++) { if(y<0){
// lcdShiftV(dir, wrap); dir=false;
//} y=-y;
for (int cya = 0; cya < ya; cya++) { }else{
dir=true;
};
while(y>=8){
y-=8;
lcdShiftV8(dir, wrap);
};
while(y-->0)
lcdShiftV(dir, wrap); lcdShiftV(dir, wrap);
} }
}
}