incbin.h
Go to the documentation of this file.
#ifndef _INCBIN_H
#define _INCBIN_H
#include <stdint.h>
#define INCBIN_EXTERN(VARNAME) extern const uint8_t VARNAME[]; \
extern const void __size_ ## VARNAME; \
extern const void __bank_ ## VARNAME;
#define INCBIN_SIZE(VARNAME) ( (uint16_t) & __size_ ## VARNAME )
#ifndef BANK
#define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
#endif
#define INCBIN(VARNAME, FILEPATH) void __func_ ## VARNAME(void) __banked __naked { \
__asm \
_ ## VARNAME:: \
1$: \
.incbin FILEPATH \
2$: \
___size_ ## VARNAME = (2$-1$) \
.globl ___size_ ## VARNAME \
.local b___func_ ## VARNAME \
___bank_ ## VARNAME = b___func_ ## VARNAME \
.globl ___bank_ ## VARNAME \
__endasm; \
}
#endif // _INCBIN_H
stdint.h