https://gbdev.gg8.se/wiki/index.php?title=GBDK_libraries&feed=atom&action=historyGBDK libraries - Revision history2024-03-29T15:14:50ZRevision history for this page on the wikiMediaWiki 1.25.1https://gbdev.gg8.se/wiki/index.php?title=GBDK_libraries&diff=625&oldid=prevCaseyweederman: Initializing a library exploration page2016-06-03T12:00:23Z<p>Initializing a library exploration page</p>
<p><b>New page</b></p><div>The [[GBDK|Game Boy Development Kit]] comes bundled with a set of libraries targeting the Game Boy Z80 microprocessor and the Game Boy's unique hardware, as well as some modified C libraries.<br />
<br />
The libraries most immediately useful to the game developer are found in <code>gbdk/include/gb</code>.<br />
<br />
How do I use these? At the top of your script, type <code>#include <libraryname.h></code> to be able to call any of the included functions.<br />
<br />
<br />
=== <code>/include</code> ===<br />
Broader C header files exist in the root of <code>include</code>.<br />
<br />
<code>[[ctype.h]]</code> contains functions to check characters and swap them between upper and lower case.<br />
<br />
<code>[[gbdk-lib.h]]</code> includes different libraries based on the implementation of the Small Device C Compiler.<br />
<br />
<code>[[rand.h]]</code> contains randomization functions.<br />
<br />
<code>[[stdarg.h]]</code> <br />
<br />
<code>[[stdio.h]]</code> contains basic input and output functions, like writing and receiving lines of text.<br />
<br />
<code>[[stdlib.h]]</code> <br />
<br />
<code>[[string.h]]</code> contains generic string functions.<br />
<br />
<code>[[time.h]]</code> contains clock functions.<br />
<br />
<code>[[types.h]]</code> defines basic types used by various other libraries.<br />
<br />
<br />
=== <code>/include/gb</code> ===<br />
Libraries specific to the Game Boy exist within the <code>gb</code> subdirectory.<br />
<br />
<code>[[cgb.h]]</code> contains functions specifically targeting the Color Game Boy.<br />
<br />
<code>[[console.h]]</code> contains functions handling a draw cursor's position and drawing specified letters.<br />
<br />
<code>[[drawing.h]]</code> contains a set of functions used to draw lines and shapes.<br />
<br />
<code>[[font.h]]</code> contains functions for changing fonts.<br />
<br />
<code>[[gb.h]]</code> contains the base definitions and functions, from reading inputs to manipulating sprites.<br />
<br />
<code>[[hardware.h]]</code> contains definitions for communicating directly with the hardware.<br />
<br />
<code>[[malloc.h]]</code> contains a simple implementation of the memory allocation function.<br />
<br />
<code>[[sample.h]]</code> contains a function for playing sound samples.<br />
<br />
<code>[[sgb.h]]</code> contains a function to check if the rom is running on the Super Game Boy.<br />
<br />
=== <code>/include/asm ===<br />
<br />
<br />
=== <code>/include/consolez80</code> ===<br />
<br />
<br />
<br />
[[Category:GBDK]]</div>Caseyweederman