File: pixel.c

package info (click to toggle)
gravitywars 1.102-34
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,468 kB
  • ctags: 553
  • sloc: ansic: 3,938; makefile: 52; sh: 52
file content (25 lines) | stat: -rw-r--r-- 504 bytes parent folder | download | duplicates (10)
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
/* GravityWars 1.1,  (C) Sami Niemi -95 */

#include "memory.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));
}