#3658 - jammin.won - Tue Mar 04, 2003 9:18 am
/* i was trying to filling all(maybe part) the color as fast as possible under MODE_3... but yet it is the best algorithm i can figure out in my knowledge ,and i guess that must not be the best ,so plz help me ,bros =)*/
void PlotPixel(u16 x,u16 y,u16 color){
u16* vram=REG_VRAM;
vram[(y)*240+(x)]=(color);
}
int main(void){
SET_DISP_MODE(DISP_MODE_3 | DISP_BG2_ON);
u16 x,y,r,g,b,count;
for(y=0;y<160;y++){
r=(int)(y*0.199);
b=31-r;
count=4;
g=0;
for(x=0;x<240;x++,count++){
if(count>7){ g++;
count=0;
}
PlotPixel(x,y,SET_RGB(r,g,b));
}
}
}
//thx thx thx =)
void PlotPixel(u16 x,u16 y,u16 color){
u16* vram=REG_VRAM;
vram[(y)*240+(x)]=(color);
}
int main(void){
SET_DISP_MODE(DISP_MODE_3 | DISP_BG2_ON);
u16 x,y,r,g,b,count;
for(y=0;y<160;y++){
r=(int)(y*0.199);
b=31-r;
count=4;
g=0;
for(x=0;x<240;x++,count++){
if(count>7){ g++;
count=0;
}
PlotPixel(x,y,SET_RGB(r,g,b));
}
}
}
//thx thx thx =)