diff --git a/fxcp_hh2.ld.c b/fxcp_hh2.ld.c index 46b0713..5036a1b 100644 --- a/fxcp_hh2.ld.c +++ b/fxcp_hh2.ld.c @@ -43,7 +43,10 @@ SECTIONS - All text from .text and .text.* (including user code) */ .hh2 : { KEEP(*(.hh2.header)) - KEEP(*(.hh2.info)) + KEEP(*(.hh2.info.name)) + KEEP(*(.hh2.info.description)) + KEEP(*(.hh2.info.author)) + KEEP(*(.hh2.info.version)) KEEP(*(.hh2.stage2)) . = ALIGN(16); } > eram AT> bin diff --git a/include/gint/config.h.in b/include/gint/config.h.in index 0f5af29..55845be 100644 --- a/include/gint/config.h.in +++ b/include/gint/config.h.in @@ -80,4 +80,26 @@ #define GINT_RENDER_MONO (GINT_HW_FX || GINT_FX9860G_G3A) #define GINT_RENDER_RGB ((GINT_HW_CG || GINT_HW_CP) && !GINT_FX9860G_G3A) +/* Macros for specifying HH2 binary metadata fields. Here because this header + is guaranteed to be included with every gint header. */ +#if GINT_HW_CP +#define HH2_NAME(STR) \ + GSECTION(".hh2.info.name") GVISIBLE \ + char _hh2info_name[] = (STR); +#define HH2_DESCRIPTION(STR) \ + GSECTION(".hh2.info.description") GVISIBLE \ + char _hh2info_description[] = (STR); +#define HH2_AUTHOR(STR) \ + GSECTION(".hh2.info.author") GVISIBLE \ + char _hh2info_author[] = (STR); +#define HH2_VERSION(STR) \ + GSECTION(".hh2.info.version") GVISIBLE \ + char _hh2info_version[] = (STR); +#else +#define HH2_NAME(STR) +#define HH2_DESCRIPTION(STR) +#define HH2_AUTHOR(STR) +#define HH2_VERSION(STR) +#endif + #endif /* GINT_CONFIG */ diff --git a/src/kernel/start.S b/src/kernel/start.S index 7a5e4d3..2da9385 100644 --- a/src/kernel/start.S +++ b/src/kernel/start.S @@ -122,4 +122,12 @@ _stage2: it's overriding the correct location. */ .long 1, 2, 3, 4, 5, 6, 7, 8 +/* Also provide default values for metadata fields. */ + +.section .hh2.info.name +.global __hh2info_name +.weak __hh2info_name +/* Zero byte will skip specifiying any of the data */ +__hh2info_name: .byte 0x00 + #endif /* GINT_OS_CP */