File: bullet.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 (71 lines) | stat: -rw-r--r-- 1,178 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* GravityWars 1.1,  (C) Sami Niemi -95 */

#include "memory.h"
 
/*-----------------------------------------------------------------setbullet */
void setbullet(int x, int y,int num) {

  static long adr;
  static short page,xx,yy,n;
  static char *adr2;
  static char *bullet;

  bullet=bulletback[num];

  adr=(y<<9)+(y<<7)+x;
  page=adr >> 16;
  vga_setpage(page);


  n=0;
  for(yy=0; yy<=2; yy++) {
    for(xx=0; xx<=2; xx++) {

      if ( (adr >> 16) != page) {
	page++;
	vga_setpage(page);
      }
      adr2=vga_ptr+(adr&65535);
      bullet[n]=*(adr2);
      *(adr2)=bulletgfx[n];
      n++;
      adr++;
    }
    adr+=637;
  }
}

/*----------------------------------------------------------------killbullet */
void killbullet(int x, int y,int num) {

  static long adr;
  static short page,xx,yy,n;
  static uchar *adr2;

  static char *bullet;

  bullet=bulletback[num];
 
  adr=(y<<9)+(y<<7)+x;
  page=adr >> 16;
  vga_setpage(page);


  n=0;
  for(yy=0; yy<=2; yy++) {
    for(xx=0; xx<=2; xx++) {

      if ( (adr >> 16) != page) {
	page++;
	vga_setpage(page);
      }
      *(vga_ptr+(adr&65535))=bullet[n];
      n++;
      adr++;
    }
    adr+=637;
  }
}