Video Graphics Array — Änderungen 9658 → 9659

Zeile 39: Zeile 39:
 
<c>
 
<c>
 
void setpixel(int x, int y, unsigned char color) {
 
void setpixel(int x, int y, unsigned char color) {
−
   offset = 320*y + x;
+
   int offset;
−
   if(x <= 320) {
+
   if(0 <= x && x < 320) {
−
     if(y <= 200) {
+
     if(0 <= y && y < 200) {
 +
      offset = 320*y + x;
 
       VGA[offset] = color;
 
       VGA[offset] = color;
 
     }
 
     }
Zeile 47: Zeile 48:
 
}
 
}
 
</c>
 
</c>
 +
 
==== Farben ====
 
==== Farben ====
 
{| {{prettytable}}
 
{| {{prettytable}}