mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Unconditionally output ROM0 even without any sections
Required for example when "overlaying" over a ROM and only patching ROMX. Fixes #993
This commit is contained in:
@@ -39,7 +39,7 @@ struct SortedSymbol {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
uint32_t nbBanks;
|
uint32_t nbBanks; // Size of the array below (which may be NULL if this is 0)
|
||||||
struct SortedSections {
|
struct SortedSections {
|
||||||
struct SortedSection *sections;
|
struct SortedSection *sections;
|
||||||
struct SortedSection *zeroLenSections;
|
struct SortedSection *zeroLenSections;
|
||||||
@@ -243,9 +243,9 @@ static void writeROM(void)
|
|||||||
coverOverlayBanks(nbOverlayBanks);
|
coverOverlayBanks(nbOverlayBanks);
|
||||||
|
|
||||||
if (outputFile) {
|
if (outputFile) {
|
||||||
if (sections[SECTTYPE_ROM0].nbBanks > 0)
|
writeBank(sections[SECTTYPE_ROM0].banks ? sections[SECTTYPE_ROM0].banks[0].sections
|
||||||
writeBank(sections[SECTTYPE_ROM0].banks[0].sections,
|
: NULL,
|
||||||
startaddr[SECTTYPE_ROM0], maxsize[SECTTYPE_ROM0]);
|
startaddr[SECTTYPE_ROM0], maxsize[SECTTYPE_ROM0]);
|
||||||
|
|
||||||
for (uint32_t i = 0 ; i < sections[SECTTYPE_ROMX].nbBanks; i++)
|
for (uint32_t i = 0 ; i < sections[SECTTYPE_ROMX].nbBanks; i++)
|
||||||
writeBank(sections[SECTTYPE_ROMX].banks[i].sections,
|
writeBank(sections[SECTTYPE_ROMX].banks[i].sections,
|
||||||
|
|||||||
Reference in New Issue
Block a user