All pastes #805872 Raw Edit

Something

public text v1 · immutable
·published 2007-12-04 19:12 UTC
rendered paste body
kaiser graphics info

qvga screen 320x240, 16 bits per pixel

bits per pixel are as follows:

Red Green Blue
 5  -   6   -  5


So in order to convert lets say a color from 8 bits per pixel a macro whould
be as follows:
#define pixelcolor(r,g,b)    (((r>>3) << 11) | ( (g>>2) << 5) | (b>>3))

PURE COLORS:
       RED     - 0xf800
       GREEN   - 0x07e0
       BLUE    - 0x001f

the vram address or framebuffer

starts from 0x1000.0000 to 0x1002.57ff

It is read as:
with the device in vertical mode, from top left to top right, then a line
down and then left to right.
So it is sequencial memory of 320 lines of 240 pixels.
this memory is read in little endian mode

RED Green
0xf80007e0

You will see on the screen green first and then red
and if you try

0x007e0f80, you will see first red and then green.