I remember reading in a post recently that updating the screen horizontally rather than vertically resulted in some kind of issue. I can’t remember which thread I read it in, but I just did a test as an attempt to speed up Pokkitris a little.
//----------------------------------------------- in screen init sequence...
write_command(0x03); // Entry mode... lets try if this affects the direction
write_data(0x1038); // originally 0x1030 1000000110000 BGR,ID1,ID0
// test 1: 0x1038 1000000111000 BGR,ID1,ID0,AM=1 ->drawing DRAM horizontally
//-----------------------------------------------
void Pokitto::setWindow(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) {
write_command(0x37); write_data(x1);
write_command(0x36); write_data(x2);
write_command(0x39); write_data(y1);
write_command(0x38); write_data(y2);
write_command(0x20); write_data(x1);
write_command(0x21); write_data(y1);
}
void Pokitto::lcdRefreshMode1(uint8_t * scrbuf, uint16_t* paletteptr) {
setWindow(0, 0, 175, 219);
write_command(0x22);
uint8_t pix;
uint8_t quartWide=55; // 220/4;
uint8_t pic;
for(int y=0; y<176; y++){
for(int x=0; x<quartWide; x++){
pic = scrbuf[x+quartWide*y];
pix = (pic >> 6)&3; write_data(paletteptr[pix]);
pix = (pic >> 4)&3; write_data(paletteptr[pix]);
pix = (pic >> 2)&3; write_data(paletteptr[pix]);
pix = pic &3; write_data(paletteptr[pix]);
}
}
}
and it seem to update fine. What exactly was this issue?