GBDK 2020 Docs
4.1.1
API Documentation for GBDK 2020
|
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | INCBIN_EXTERN(VARNAME) |
#define | INCBIN_SIZE(VARNAME) ( (uint16_t) & __size_ ## VARNAME ) |
#define | BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME ) |
#define | INCBIN(VARNAME, FILEPATH) |
Allows binary data from other files to be included into a C source file.
It is implemented using asm .incbin and macros.
See the incbin
example project for a demo of how to use it.
#define INCBIN_EXTERN | ( | VARNAME | ) |
Creates extern entries for accessing a INCBIN() generated variable and it's size in another source file.
VARNAME | Name of the variable used with INCBIN |
An entry is created for the variable and it's size variable.
#define INCBIN_SIZE | ( | VARNAME | ) | ( (uint16_t) & __size_ ## VARNAME ) |
Obtains the size in bytes of the INCBIN() generated data
VARNAME | Name of the variable used with INCBIN |
Requires INCBIN_EXTERN() to have been called earlier in the source file
#define BANK | ( | VARNAME | ) | ( (uint8_t) & __bank_ ## VARNAME ) |
Obtains the bank number of the INCBIN() generated data
VARNAME | Name of the variable used with INCBIN |
Requires INCBIN_EXTERN() to have been called earlier in the source file
#define INCBIN | ( | VARNAME, | |
FILEPATH | |||
) |
Includes binary data into a C source file
VARNAME | Variable name to use |
FILEPATH | Path to the file which will be binary included into the C source file |
filepath is relative to the working directory of the tool that is calling it (often a makefile's working directory), NOT to the file it's being included into.
The variable name is not modified and can be used as-is.
Use INCBIN_EXTERN() within another source file to make the variable and it's data accesible there.