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++) { dir=false;
lcdShiftH(true, wrap); x=-x;
} };
} else if (x<0) {
for (int cx = x; cx < 0; cx++) {
lcdShiftH(false, wrap);
}
}
while(x-->0)
lcdShiftH(dir, wrap);
if (y != 0) { if(y<0){
if (y>0) { dir=false;
ya = y; y=-y;
yb = y/8; }else{
yr = y%8; dir=true;
dir = true; };
} else if (y<0) { while(y>=8){
ya = -y; y-=8;
yb = (-y)/8; lcdShiftV8(dir, wrap);
yr = (-y)%8; };
dir = false;
}
//for (int cyb = 0; cyb < yb; cyb++) { while(y-->0)
// lcdShiftV8(dir, wrap);
//}
//for (int cyr = 0; cyr < yr; cyr++) {
// lcdShiftV(dir, wrap);
//}
for (int cya = 0; cya < ya; cya++) {
lcdShiftV(dir, wrap); lcdShiftV(dir, wrap);
}
}
} }