mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 12:32:07 +00:00
Make RGBLINK able to link SDCC object files
This requires a LOT of tricky code, mostly due to the format itself being, er, not the most straightforward. Everything is converted to existing RGBLINK concepts (sections, patches, etc.), so the core code is essentially unchanged. (A couple of genuine RGBLINK bugs were uncovered along the way, so some of the core code *is* changed, notably regarding `SECTION FRAGMENT`s.) All of this code was clean-roomed, so SDCC's GPLv2 license does not apply.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#ifndef RGBDS_LINKDEFS_H
|
||||
#define RGBDS_LINKDEFS_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -74,6 +75,8 @@ enum SectionType {
|
||||
SECTTYPE_SRAM,
|
||||
SECTTYPE_OAM,
|
||||
|
||||
// In RGBLINK, this is used for "indeterminate" sections; this is primarily for SDCC
|
||||
// areas, which do not carry any section type info and must be told from the linker script
|
||||
SECTTYPE_INVALID
|
||||
};
|
||||
|
||||
@@ -93,6 +96,7 @@ extern char const * const sectionModNames[];
|
||||
*/
|
||||
static inline bool sect_HasData(enum SectionType type)
|
||||
{
|
||||
assert(type != SECTTYPE_INVALID);
|
||||
return type == SECTTYPE_ROM0 || type == SECTTYPE_ROMX;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user