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);
unsigned char GetPixel(void);
void SetPixel(unsigned char color);
void LocatePixel(unsigned int x, unsigned int y);
extern unsigned char pixelX, pixelY; // (see LocatePixel())
// Bitmap chunks functions (see notes on coordinate restrictions)
void GetChunk(unsigned char** chunk, unsigned char x, unsigned char y, unsigned char w, unsigned char h);
void SetChunk(unsigned char* chunk, unsigned char x, unsigned char y);
void LoadChunk(unsigned char** chunk, char *filename);
// Colors used for printing
extern unsigned char inkColor, paperColor;
// Printing functions
void PrintBlanks(unsigned char col, unsigned char row, unsigned char width, unsigned char height);
void PrintChr(unsigned char col, unsigned char row, const char *chr);
void PrintNum(unsigned char col, unsigned char row, unsigned int 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);
// 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);
// 2D geometry functions
unsigned char IntersectSegments(signed int seg1X1, signed int seg1Y1, signed int seg1X2, signed int seg1Y2,
signed int seg2X1, signed int seg2Y1, signed int seg2X2, signed int seg2Y2,
signed int *intX, signed int *intY);
unsigned char IntersectSegmentPolygon(signed int segX1, signed int segY1, signed int segX2, signed int segY2,
unsigned char vN, signed int *vX, signed int *vY, signed int *intX, signed int *intY);
unsigned char PointInsidePolygon(signed int pX, signed int pY, unsigned char vN, signed int *vX, signed int *vY);
// Math functions
#define MIN(a,b) (a>b ? b : a)
#define MAX(a,b) (a>b ? a : b)
#define ABS(a) (a<0 ? -a : a)
#define SIGN(a) (a<0 ? -1 : 1)
#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
void LoadMusic(const char* filename, unsigned int address);
void PlayMusic(unsigned int address);
void StopMusic(void);
// SFX functions
void InitSFX(void);
void StopSFX(void);
void EngineSFX(int channel, int vel);
void BleepSFX(unsigned char tone);
void BumpSFX(void);
// Sprite functions
void InitSprites(unsigned char frames, unsigned char cols, unsigned char rows, unsigned char *spriteColors);
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);
void RecolorSprite(unsigned char index, unsigned char number, unsigned char color);
// Sprite collision functions
#define COLLISIONS(i)
#define COLLIDING(collisions,i)
// Widget handling functions
#define CALLTYPE_ICON 1
#define CALLTYPE_BUTTON 2
#define CALLTYPE_LISTBOX 3
void Button(unsigned char col, unsigned char row, unsigned char width, unsigned char height, unsigned char* label);
void ListBox(unsigned char col, unsigned char row, unsigned char width, unsigned char height, unsigned char* title, unsigned char* labels[], unsigned char len);
void Panel(unsigned char col, unsigned char row, unsigned char width, unsigned char height, unsigned char* title);
callback* CheckCallbacks(unsigned int x, unsigned int y);
callback* PushCallback(unsigned int col, unsigned int row, unsigned int width, unsigned int height, unsigned char type, unsigned char* label);
void PopCallback(callback* call);
void ClearCallbacks(void);