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:
ISSOtm
2022-04-30 13:17:45 +02:00
committed by Eldred Habert
parent 972d06bb41
commit 59e73e64ca

View File

@@ -39,7 +39,7 @@ struct SortedSymbol {
};
static struct {
uint32_t nbBanks;
uint32_t nbBanks; // Size of the array below (which may be NULL if this is 0)
struct SortedSections {
struct SortedSection *sections;
struct SortedSection *zeroLenSections;
@@ -243,8 +243,8 @@ static void writeROM(void)
coverOverlayBanks(nbOverlayBanks);
if (outputFile) {
if (sections[SECTTYPE_ROM0].nbBanks > 0)
writeBank(sections[SECTTYPE_ROM0].banks[0].sections,
writeBank(sections[SECTTYPE_ROM0].banks ? sections[SECTTYPE_ROM0].banks[0].sections
: NULL,
startaddr[SECTTYPE_ROM0], maxsize[SECTTYPE_ROM0]);
for (uint32_t i = 0 ; i < sections[SECTTYPE_ROMX].nbBanks; i++)