OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [actel_m1a3pl_dev_kit/] [software/] [spacewar/] [explode.c] - Blame information for rev 80

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 80 olivier.gi
//************************************************************
2
// externals
3
//
4
extern volatile int xdisp1, ydisp1;
5
 
6
extern void set_xy(int, int);
7
 
8
//************************************************************
9
//
10
// explode
11
//
12
//    make explosion at exp_x, exp_y
13
//
14
/* Description:
15
Generate a visible explosion at position exp_x, exp_y.  This function reads
16
ints from code space as random numbers to draw points around the exp_x, exp_y
17
position.  The ints are scaled to 8 bits and added to exp_x, and exp_y to
18
generate a random position centered on exp_x, exp_y.  A point is displayed at
19
each position.
20
*/
21
void explode(int exp_x, int exp_y)
22
{
23
  int i, j, xfin, yfin;
24
  int *rp;
25
 
26
  rp = (int *)0xF880;             // use code space as randon number
27
 
28
  for(i = 0; i < 32; i++) {
29
    xfin = exp_x + (*rp++ >> 8);
30
    yfin = exp_y + (*rp++ >> 8);
31
    set_xy(xfin, yfin);
32
    for(j = 0; j < 16384; j++) {
33
    }
34
  }
35
 
36
 
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.