mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
hh2: provide metadata macros and a non-metadata marker by default
If none of the HH2_*() macros are used, the binary will show up as its own filename instead of random garbage. If HH2_NAME() is used the metadata will be read, and the binary format requires that all fields by specified. Using only a subset of the macros is invalid, but not reported.
This commit is contained in:
parent
979873288a
commit
aba6c280b6
3 changed files with 34 additions and 1 deletions
|
@ -43,7 +43,10 @@ SECTIONS
|
||||||
- All text from .text and .text.* (including user code) */
|
- All text from .text and .text.* (including user code) */
|
||||||
.hh2 : {
|
.hh2 : {
|
||||||
KEEP(*(.hh2.header))
|
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))
|
KEEP(*(.hh2.stage2))
|
||||||
. = ALIGN(16);
|
. = ALIGN(16);
|
||||||
} > eram AT> bin
|
} > eram AT> bin
|
||||||
|
|
|
@ -80,4 +80,26 @@
|
||||||
#define GINT_RENDER_MONO (GINT_HW_FX || GINT_FX9860G_G3A)
|
#define GINT_RENDER_MONO (GINT_HW_FX || GINT_FX9860G_G3A)
|
||||||
#define GINT_RENDER_RGB ((GINT_HW_CG || GINT_HW_CP) && !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 */
|
#endif /* GINT_CONFIG */
|
||||||
|
|
|
@ -122,4 +122,12 @@ _stage2:
|
||||||
it's overriding the correct location. */
|
it's overriding the correct location. */
|
||||||
.long 1, 2, 3, 4, 5, 6, 7, 8
|
.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 */
|
#endif /* GINT_OS_CP */
|
||||||
|
|
Loading…
Reference in a new issue