|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | star |
Macros | |
| #define | PLAYFIELD_Y_END 236 /* #playfield_y_start + _height */ |
| #define | PLAYFIELD_HEIGHT 204 |
| #define | INVADER_HEIGHT 8 |
| #define | INVADER_Y_DISP 14 /* #invader_height + _y_gap */ |
| #define | WORDAT(p) |
Functions | |
| void | _KillInvader (void) |
| void | _DrawStarField (void) |
| void | _DrawBullet (void) |
| void | _EraseBullet (void) |
| static void | killinvader_c (UBYTE *sprad, UWORD x, UWORD y, UWORD offset) |
| KillInvader sprad,x,y,offset: clear an invader in four sprite images. | |
| static void | drawstarfield_c (struct star *s, UBYTE *plane) |
| DrawStarField table,bitplane: move the stars of the table one step. | |
| static void | bullet (struct BitMap *bitm, UWORD x, UWORD y, int set) |
| static void | drawbullet_c (struct BitMap *bitm, UWORD x, UWORD y) |
| DrawBullet bitm,x,y: draw a 1x3 pixel bullet in colour 4. | |
| static void | erasebullet_c (struct BitMap *bitm, UWORD x, UWORD y) |
| EraseBullet bitm,x,y: erase a bullet (colour 0 in planes 0-3). | |
| #define INVADER_HEIGHT 8 |
| #define INVADER_Y_DISP 14 /* #invader_height + _y_gap */ |
| #define PLAYFIELD_HEIGHT 204 |
| #define PLAYFIELD_Y_END 236 /* #playfield_y_start + _height */ |
| #define WORDAT | ( | p | ) |
| void _DrawBullet | ( | void | ) |
| void _DrawStarField | ( | void | ) |
| void _EraseBullet | ( | void | ) |
| void _KillInvader | ( | void | ) |
|
static |
|
static |
|
static |
DrawStarField table,bitplane: move the stars of the table one step.
Per star: the bit is cleared at the old offset, the speed added (an offset from 236*40 on wraps back by 204*40), the new offset stored and the bit set there. The bit numbers are taken modulo 8 (BCLR/BSET on memory address a byte; not a defect).
| s | d0: the table (struct star, ended by a negative speed) |
| plane | d1: the bitplane (40 bytes per row) |
|
static |
|
static |
KillInvader sprad,x,y,offset: clear an invader in four sprite images.
The images are the longs at sprad + (x>>2)*16 and 48 bytes further; in each, the 8 rows of 16 bytes from (x&3)*2 + y*224, and the same offset bytes behind, get the words at +0 and +8 cleared. Word arithmetic and word offsets as in the original; nothing is checked.