mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Merge pull request #135 from Ben10do/improve-assign-error-messages
Improve assignment error messages
This commit is contained in:
@@ -243,8 +243,13 @@ AssignFixedBankSections(enum eSectionType type)
|
|||||||
pSection->oAssigned = 1;
|
pSection->oAssigned = 1;
|
||||||
DOMAXBANK(pSection->Type, pSection->nBank);
|
DOMAXBANK(pSection->Type, pSection->nBank);
|
||||||
} else {
|
} else {
|
||||||
errx(1, "Unable to load fixed %s section into bank $%02lX",
|
if (pSection->nAlign <= 1) {
|
||||||
SECT_ATTRIBUTES[pSection->Type].name, pSection->nBank);
|
errx(1, "Unable to place '%s' (%s section) in bank $%02lX",
|
||||||
|
pSection->pzName, SECT_ATTRIBUTES[pSection->Type].name, pSection->nBank);
|
||||||
|
} else {
|
||||||
|
errx(1, "Unable to place '%s' (%s section) in bank $%02lX (with $%lX-byte alignment)",
|
||||||
|
pSection->pzName, SECT_ATTRIBUTES[pSection->Type].name, pSection->nBank, pSection->nAlign);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,8 +270,18 @@ AssignFloatingBankSections(enum eSectionType type)
|
|||||||
pSection->oAssigned = 1;
|
pSection->oAssigned = 1;
|
||||||
DOMAXBANK(pSection->Type, pSection->nBank);
|
DOMAXBANK(pSection->Type, pSection->nBank);
|
||||||
} else {
|
} else {
|
||||||
errx(1, "Unable to place %s section anywhere",
|
const char *locality = "anywhere";
|
||||||
SECT_ATTRIBUTES[type].name);
|
if (SECT_ATTRIBUTES[pSection->Type].bankCount > 1) {
|
||||||
|
locality = "in any bank";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pSection->nAlign <= 1) {
|
||||||
|
errx(1, "Unable to place '%s' (%s section) %s",
|
||||||
|
pSection->pzName, SECT_ATTRIBUTES[type].name, locality);
|
||||||
|
} else {
|
||||||
|
errx(1, "Unable to place '%s' (%s section) %s (with $%lX-byte alignment)",
|
||||||
|
pSection->pzName, SECT_ATTRIBUTES[type].name, locality, pSection->nAlign);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -363,9 +378,8 @@ AssignSections(void)
|
|||||||
pSection->nBank = SECT_ATTRIBUTES[pSection->Type].bank;
|
pSection->nBank = SECT_ATTRIBUTES[pSection->Type].bank;
|
||||||
if (area_AllocAbs(&BankFree[pSection->nBank], pSection->nOrg,
|
if (area_AllocAbs(&BankFree[pSection->nBank], pSection->nOrg,
|
||||||
pSection->nByteSize) == -1) {
|
pSection->nByteSize) == -1) {
|
||||||
errx(1, "Unable to load fixed %s section at $%lX",
|
errx(1, "Unable to place '%s' (%s section) at $%lX",
|
||||||
SECT_ATTRIBUTES[pSection->Type].name,
|
pSection->pzName, SECT_ATTRIBUTES[pSection->Type].name, pSection->nOrg);
|
||||||
pSection->nOrg);
|
|
||||||
}
|
}
|
||||||
pSection->oAssigned = 1;
|
pSection->oAssigned = 1;
|
||||||
break;
|
break;
|
||||||
@@ -380,8 +394,8 @@ AssignSections(void)
|
|||||||
DOMAXBANK(pSection->Type, pSection->nBank);
|
DOMAXBANK(pSection->Type, pSection->nBank);
|
||||||
pSection->oAssigned = 1;
|
pSection->oAssigned = 1;
|
||||||
} else {
|
} else {
|
||||||
errx(1,
|
errx(1, "Unable to place '%s' (%s section) at $%lX in bank $%02lX",
|
||||||
"Unable to load fixed %s section at $%lX in bank $%02lX", SECT_ATTRIBUTES[pSection->Type].name, pSection->nOrg, pSection->nBank);
|
pSection->pzName, SECT_ATTRIBUTES[pSection->Type].name, pSection->nOrg, pSection->nBank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -415,8 +429,8 @@ AssignSections(void)
|
|||||||
if ((pSection->nBank =
|
if ((pSection->nBank =
|
||||||
area_AllocAbsAnyBank(pSection->nOrg, pSection->nByteSize,
|
area_AllocAbsAnyBank(pSection->nOrg, pSection->nByteSize,
|
||||||
pSection->Type)) == -1) {
|
pSection->Type)) == -1) {
|
||||||
errx(1, "Unable to load fixed %s section at $%lX into any bank",
|
errx(1, "Unable to place '%s' (%s section) at $%lX in any bank",
|
||||||
SECT_ATTRIBUTES[pSection->Type].name, pSection->nOrg);
|
pSection->pzName, SECT_ATTRIBUTES[pSection->Type].name, pSection->nOrg);
|
||||||
}
|
}
|
||||||
pSection->oAssigned = 1;
|
pSection->oAssigned = 1;
|
||||||
DOMAXBANK(pSection->Type, pSection->nBank);
|
DOMAXBANK(pSection->Type, pSection->nBank);
|
||||||
|
|||||||
Reference in New Issue
Block a user