2024-01-07 17:36:59 +01:00
|
|
|
#ifndef _H_INCLUDE_ASSET
|
|
|
|
|
|
|
|
#define ASTRINGIFY_(x) #x
|
|
|
|
#define ASTRINGIFY(x) ASTRINGIFY_(x)
|
|
|
|
|
2024-01-09 06:20:24 +01:00
|
|
|
#ifdef MODERN_COMPILER
|
|
|
|
# define PUSHSECTION(SECTION) ".pushsection " SECTION "\n"
|
|
|
|
# define POPSECTION ".popsection\n"
|
|
|
|
#else
|
|
|
|
# define PUSHSECTION(SECTION) SECTION "\n"
|
|
|
|
# define POPSECTION
|
|
|
|
#endif
|
|
|
|
|
2024-01-07 17:36:59 +01:00
|
|
|
#define _INCLUDE_IMG(FILENAME, SYMBOLNAME) \
|
|
|
|
extern unsigned char SYMBOLNAME[]; \
|
|
|
|
__asm__( \
|
|
|
|
".globl " #SYMBOLNAME"\n" \
|
2024-01-09 06:20:24 +01:00
|
|
|
PUSHSECTION(".data") \
|
2024-01-07 17:36:59 +01:00
|
|
|
".align 2\n" \
|
|
|
|
".type " #SYMBOLNAME", @object\n" \
|
|
|
|
#SYMBOLNAME":\n" \
|
|
|
|
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
2024-01-09 06:20:24 +01:00
|
|
|
POPSECTION \
|
2024-01-07 17:36:59 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// two macros are needed for N() usage
|
|
|
|
#define INCLUDE_IMG(FILENAME, SYMBOLNAME) \
|
|
|
|
_INCLUDE_IMG(FILENAME, SYMBOLNAME)
|
|
|
|
|
|
|
|
#define INCLUDE_PAL(FILENAME, SYMBOLNAME) \
|
|
|
|
extern unsigned short SYMBOLNAME[]; \
|
|
|
|
__asm__( \
|
|
|
|
".globl " #SYMBOLNAME"\n" \
|
2024-01-09 06:20:24 +01:00
|
|
|
PUSHSECTION(".data") \
|
2024-01-07 17:36:59 +01:00
|
|
|
".align 2\n" \
|
|
|
|
".type " #SYMBOLNAME", @object\n" \
|
|
|
|
#SYMBOLNAME":\n" \
|
|
|
|
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
2024-01-09 06:20:24 +01:00
|
|
|
POPSECTION \
|
2024-01-07 17:36:59 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
#endif // _H_INCLUDE_ASSET
|