Does anyone know the start address of the screen buffer for the Cobra? I asume I can directly write to it and see the update in real time on the LCD screen.
It will be smart to just read it from the LCD registers. This way if we move it in future then your code wouldn’t need to changer.
If anyone is interested, the starting address is set in the LCD_UPBASE register.
Cast it to a WORD table f.e.:
WORD * screenBuffer = (WORD *)LCD_UPBASE;
You write pixels like this:
screenBuffer[x + y * SCREEN_WIDTH] = color;
Color is a WORD (16 bit) defined as: upper 5 bits as RED, next 6 bits as GREEN, lower 5 bits as BLUE.
+1k internets to Wouter.
I will definitely be using that in projects to come.