API Reference

Game API functions and variables (see unity.h)

// Bitmap functions
void InitBitmap(void);
void EnterBitmapMode(void);
void ExitBitmapMode(void);
void ClearBitmap(void);
void LoadBitmap(char *filename);
void LocatePixel(unsigned int x, unsigned int y);
unsigned char GetPixel(void);
void SetPixel(unsigned char color);
void DrawPanel(unsigned char colBeg, unsigned char rowBeg, unsigned char colEnd, unsigned char rowEnd);
void PrintChr(unsigned char col, unsigned char row, const char *chr);
void PrintNum(unsigned char col, unsigned char row, unsigned char num);
void PrintStr(unsigned char col, unsigned char row, const char *buffer);
void PrintLogo(unsigned char col, unsigned char row, unsigned char index);
void PrintBuffer(char *buffer);
void InputStr(unsigned char col, unsigned char row, char *buffer, unsigned char len);
unsigned char InputUpdate(unsigned char col, unsigned char row, char *buffer, unsigned char len, unsigned char key);
const char *GetChr(unsigned char chr);

// Character data
extern const char charBlank[3];
extern const char charDigit[30];
extern const char charLetter[78];
extern const char charBracket[6];
extern const char charColon[3];
extern const char charComma[3];
extern const char charDot[3];
extern const char charExclaim[3];
extern const char charHyphen[3];
extern const char charQuestion[3];
extern const char charQuote[3];
extern const char charSlash[3];
extern const char charUnderbar[3];

// Colors for printing
extern unsigned char colorFG, colorBG, headerBG;

// Joystick definitions
#define JOY_UP 1
#define JOY_DOWN 2
#define JOY_LEFT 4
#define JOY_RIGHT 8
#define JOY_FIRE 16

// Joystick functions
void InitJoy(void);
unsigned char GetJoy(unsigned char);

// Math functions
#define DOT(a,b) (a[0]*b[0]+a[1]*b[1])
unsigned char atan2(unsigned char y, unsigned char x);

// Network functions
#define NETWORK_OK 0
#define ADAPTOR_ERR 1
#define DHCP_ERR 2
extern unsigned int udp_packet;
unsigned char InitNetwork(void);
void InitUDP(unsigned char ip1, unsigned char ip2, unsigned char ip3, unsigned char ip4, unsigned int svPort, unsigned int clPort);
void SendUDP(unsigned char* buffer, unsigned char length);
unsigned char RecvUDP(unsigned int timeOut);

// Music functions
// Apple: Electric Duet player
// Atari: RMT/SFX player
// C64: SID music player
void LoadMusic(const char* filename, unsigned int address);
void PlayMusic(unsigned int address);
void StopMusic(void);

// SFX functions
void InitSFX(void);
void EngineSFX(int channel, int vel);
void BleepSFX(unsigned char tone);
void BumpSFX(void);

// Sprite functions
void InitSprites(unsigned char rows, unsigned char frames);
void EnableSprite(signed char index);
void DisableSprite(signed char index);
void LocateSprite(unsigned int x, unsigned int y);
void SetSprite(unsigned char index, unsigned char frame)

// Sprite collision functions
#define COLLISIONS(i) (0)
#define COLLIDING(collisions,i) (sprCOL[i])
extern unsigned char sprCOL[SPRITE_NUM];