GBDK libraries documentation

by Michael Hope and Pascal Felber

GBDK-2.0b13

This document is a first try at documenting the Gameboy Developers Kit (GBDK) by Pascal Felber which consists of a C compiler, assembler, linker and libraries. Included are methods of writing efficent eight bit code in C, ways of accessing the GBs hardware, interfacing assembler and C and a list of the functions provided by the libraries.

Table of Contents
Preface
1. Using GBDK and maccer
Compiling programs
Using Makefiles
2. The Gameboy as a Target
8 bits + 6 registers + C = tricky
Size of variables
Avoiding Promotion
Using global variables
Other
3. Accessing hardware
Memory
Interrupts
Multiple banks
Functions in RAM
4. Assembly language
When C isn't fast enough
Calling convention
Variables and registers
Segments
5. Libraries
Text IO - console.h and output.s
Floating point support - fp_long.s
Number format
Notes
Functions
Full screen graphics - drawing.h
Graphics/Tile functions
Functions
Joypad - gb.h
Functions
Hardware registers - hardware.h
Types - types.h
malloc, free and related functions - stdlib.h
Functions
Data types
Implementation
Support for multiple fonts - font.h
Functions
Data types
Backwards compatibilty

  Next
  Preface