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);
unsigned char GetColor(unsigned int x, unsigned int y);
void SetColor(unsigned int x, unsigned int y, 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 *matrix);
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 PrintHeader(const 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);

// 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
#define GetJoy(i) (PEEK(56321-(i)))
void InitJoy34(void);
unsigned char GetJoy3(void);
unsigned char GetJoy4(void);

// 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
unsigned char ip65_init(void);
unsigned char ip65_process(void);
unsigned char dhcp_init(void);
unsigned long __fastcall__ parse_dotted_quad(char* quad);
unsigned char __fastcall__ udp_send(const unsigned char* buf, unsigned int len, unsigned long dest, unsigned int dest_port, unsigned int src_port);
unsigned char __fastcall__ udp_add_listener(unsigned int port, void (*callback)(void));
unsigned char __fastcall__ udp_remove_listener(unsigned int port);
extern unsigned char udp_recv_buf[192]; // Buffer with data received

// Music functions
// Apple: Electric Duet player
// Atari: RMT/SFX player
// C64: SID music player
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 *uniqueColors, unsigned char *sharedColors);
void EnableSprite(signed char index);
void DisableSprite(signed char index);
void LocateSprite(unsigned int x, unsigned int y);
void UpdateSprite(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];