BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
blitzbomberslibtwo.c File Reference
#include "blitzlib.h"
#include <graphics/gfx.h>

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).

Macro Definition Documentation

◆ INVADER_HEIGHT

#define INVADER_HEIGHT   8

◆ INVADER_Y_DISP

#define INVADER_Y_DISP   14 /* #invader_height + _y_gap */

◆ PLAYFIELD_HEIGHT

#define PLAYFIELD_HEIGHT   204

◆ PLAYFIELD_Y_END

#define PLAYFIELD_Y_END   236 /* #playfield_y_start + _height */

◆ WORDAT

#define WORDAT ( p)
Value:
(*(UWORD *)(p))

Function Documentation

◆ _DrawBullet()

void _DrawBullet ( void )

◆ _DrawStarField()

void _DrawStarField ( void )

◆ _EraseBullet()

void _EraseBullet ( void )

◆ _KillInvader()

void _KillInvader ( void )

◆ bullet()

void bullet ( struct BitMap * bitm,
UWORD x,
UWORD y,
int set )
static

◆ drawbullet_c()

void drawbullet_c ( struct BitMap * bitm,
UWORD x,
UWORD y )
static

DrawBullet bitm,x,y: draw a 1x3 pixel bullet in colour 4.

Planes 0, 1 and 3 cleared, plane 2 set, at x,y and the two rows below, in a bitmap 320 pixels (40 bytes) wide; nothing is checked.

Parameters
bitmd0: the bitmap (struct BitMap)
xd1.w: the column
yd2.w: the top row

◆ drawstarfield_c()

void drawstarfield_c ( struct star * s,
UBYTE * plane )
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).

Parameters
sd0: the table (struct star, ended by a negative speed)
planed1: the bitplane (40 bytes per row)

◆ erasebullet_c()

void erasebullet_c ( struct BitMap * bitm,
UWORD x,
UWORD y )
static

EraseBullet bitm,x,y: erase a bullet (colour 0 in planes 0-3).

As DrawBullet, with plane 2 cleared too.

Parameters
bitmd0: the bitmap (struct BitMap)
xd1.w: the column
yd2.w: the top row

◆ killinvader_c()

void killinvader_c ( UBYTE * sprad,
UWORD x,
UWORD y,
UWORD offset )
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.

Parameters
spradd0: the table of image pointers
xd1.w: the invader's column
yd2.w: the invader's row
offsetd3.w: the offset of the second pair of images