optimzed checkerboard animation - saving 76 bytes - yeah

This commit is contained in:
Christian Kroll 2010-12-22 23:18:11 +00:00
parent 9fba9405ce
commit 3708a3accc
2 changed files with 6 additions and 12 deletions

View File

@ -350,17 +350,11 @@ unsigned char i, j, x;
#ifdef ANIMATION_SCHACHBRETT
void schachbrett(unsigned char times){
clear_screen(0);
unsigned char j;
for(j=0;j<times;j++){
unsigned char i, x;
for(i = 0; i<NUM_ROWS; i++){
for(x=0;x<LINEBYTES;x++)
pixmap[2][i][x] = 0x55<<(i&0x01);
}
wait(200);
for(i = 0; i<NUM_ROWS; i++){
for(x=0;x<LINEBYTES;x++)
pixmap[2][i][x] = 0xAA>>(i&0x01);
for (unsigned char i = 0; i < times; ++i) {
for (unsigned char row = 0; row < NUM_ROWS; ++row) {
for (unsigned char col = 0; col < LINEBYTES; ++col) {
pixmap[2][row][col] = ((i ^ row) & 0x01) ? 0x55 : 0xAA;
}
}
wait(200);
}

View File

@ -82,7 +82,7 @@ void display_loop(){
#ifdef ANIMATION_SCHACHBRETT
case 5:
schachbrett(10);
schachbrett(20);
break;
#endif