File: pixel.c

package info (click to toggle)
gravitywars 1.102-36
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,660 kB
  • sloc: ansic: 4,074; makefile: 53; sh: 52
file content (26 lines) | stat: -rw-r--r-- 526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* GravityWars 1.1,  (C) Sami Niemi -95 */

#include "memory.h"
#include "vgastubs.h"
 
/*-----------------------------------------------------------------setpixel */
void setpixel(int x, int y, uchar c) {

  static long adr;
 
  adr=(y<<9)+(y<<7)+x;
  vga_setpage(adr >> 16);
  *(vga_ptr+(adr&65535))=c;
}


/*-----------------------------------------------------------------setpixel */
uchar getpixel(int x, int y) {

  static long adr;

  adr=(y<<9)+(y<<7)+x;
  vga_setpage(adr >> 16);
  return *(vga_ptr+(adr&65535));
}