// text output
void cursor(int x, int y);
void print(char[]);
void printc(char);
void printn(int);
void printf(char[], ...);
// math
int rnd(int max);
int sqrt(int number);
int abs(int number);
int cos(int angle);
int sin(int angle);
int atan2(int y, int x);
int dist(int x1, int y1, int x2, int y2);
// fixed point
int i2f(int i);
int f2i(int f);
int flr(int f);
int ceil(int f);
int frac(int f);
int frac10k(int f);
int fmf(int f1, int f2);
int fdf(int dividend, int divisor);
// input
int cget();
int kget();
int btn(int button);
int btnp(int button);
// drawstate
void palrst();
void pal(char n, char c);
void palt(int m);
void fcol(char c);
void bcol(char c);
void camera(int x, int y);
void clip(int x, int y, int w, int h);
void zoom(int z);
void fset(int sprite);
char fget(int sprite);
void mset(int mx, int my);
char mget(int mx, int my);
void intcoords();
void fixpcoords();
void coordshift(int rshift);
// drawing
void line(int x1, int y1, int x2, int y2);
void rect(int x1, int y1, int x2, int y2);
void rectfill(int x1, int y1, int x2, int y2);
void circ(int x, int y, int r);
void circfill(int x, int y, int r);
void spr(int sprite, int x, int y, int w, int h);
void img(int adr, int x, int y, int w, int h);
void img1bit(int adr, int x, int y, int w, int h);
void map(int celx, int cely, int x, int y, int celw, int celh, int layer);
// screen
void pset(int x, int y);
char pget(int x, int y);
void cls();
void flip();
// actors
void a2a(int a1, int a2);
void aget(int a, int aval);
void aset(int a, int aval, int value);
void aspd(int a, int speed, int angle);
char axy(int x, int y);
void amove(int actor);
void adraw(int actor);
void arst(int actor);
void atstcoll();
void atstmap(int celx, int cely, int x, int y, int celw, int celh, int layer);
// particles
int partcolor(int startcolor, int endcolor, int steps, int particletype);
void parttime(int time, int timediff);
void partdir(int gravity, int dirangle1, int dirangle2, int speed);
void partset(int x, int y, int partcolor, int radius, int count);
void partdraw();
// timers
int tmrget(int timer);
void tmrset(int timer, int time);
// memory
void memset(char *to, char val, int num);
void memcpy(char *to, char *from, int num);
char peek(char *adr);
int peek2(int *adr);
void poke(char *adr, char val);
void poke2(int *adr, int val);
void setstack(char *adr);
*int malloc(int);
void free(*int);
// game loop functions
void init();
void update();
void draw();
/* the game loop runs like this:
init() // initialise game data
loop:
update() // update game state
flip() // wait for last screen redraw to finish
draw() // draw to screen while redraw is prohibited
*/