#43655 - Dude? - Wed May 25, 2005 2:02 pm
Hello!
I wrote this little code
int x, y;
//switch to video mode 3 (240x160 16-bit)
REG_DISPCNT = (MODE_3 | BG2_ENABLE);
//fill the screen
for (x = 0; x < 239; x++)
{
for (y = 0; y < 159; y++)
{
DrawPixel3(x, y, RGB(x*2,0,(x+1)));
}
}
to fill the screen with a violet/pink shading, but I noticed it does not cover the entire screen, it misses the last row and the last column of the sceen which is black. Why? Is not the screen 240*160?
If I change obviously the code with 240 and 160 instead of 239 and 159 it works, but this mean I am supposing the scren is 241*161...
Could you help me please?
I wrote this little code
int x, y;
//switch to video mode 3 (240x160 16-bit)
REG_DISPCNT = (MODE_3 | BG2_ENABLE);
//fill the screen
for (x = 0; x < 239; x++)
{
for (y = 0; y < 159; y++)
{
DrawPixel3(x, y, RGB(x*2,0,(x+1)));
}
}
to fill the screen with a violet/pink shading, but I noticed it does not cover the entire screen, it misses the last row and the last column of the sceen which is black. Why? Is not the screen 240*160?
If I change obviously the code with 240 and 160 instead of 239 and 159 it works, but this mean I am supposing the scren is 241*161...
Could you help me please?