Fix a bug in handling WRAMX sections with/without hardcoded addresses.

From Antonio Niño Díaz.
This commit is contained in:
Anthony J. Bentley
2015-02-22 03:48:00 -07:00
parent bc60b85785
commit 2ab10a95e4

View File

@@ -324,6 +324,7 @@ AssignSRAMSections(void)
if ((org = area_AllocSRAMAnyBank(pSection->nByteSize)) != -1) { if ((org = area_AllocSRAMAnyBank(pSection->nByteSize)) != -1) {
pSection->nOrg = org & 0xFFFF; pSection->nOrg = org & 0xFFFF;
pSection->nBank = org >> 16; pSection->nBank = org >> 16;
pSection->nBank += BANK_SRAM;
pSection->oAssigned = 1; pSection->oAssigned = 1;
DOMAXSBANK(pSection->nBank); DOMAXSBANK(pSection->nBank);
} else { } else {
@@ -343,6 +344,7 @@ AssignWRAMSections(void)
if ((org = area_AllocWRAMAnyBank(pSection->nByteSize)) != -1) { if ((org = area_AllocWRAMAnyBank(pSection->nByteSize)) != -1) {
pSection->nOrg = org & 0xFFFF; pSection->nOrg = org & 0xFFFF;
pSection->nBank = org >> 16; pSection->nBank = org >> 16;
pSection->nBank += BANK_WRAMX - 1;
pSection->oAssigned = 1; pSection->oAssigned = 1;
DOMAXWBANK(pSection->nBank); DOMAXWBANK(pSection->nBank);
} else { } else {
@@ -557,8 +559,8 @@ AssignSections(void)
* bank are hardcoded. * bank are hardcoded.
*/ */
if (pSection->nBank >= 1 if (pSection->nBank >= 0
&& pSection->nBank <= 7) { && pSection->nBank <= 6) {
pSection->nBank += pSection->nBank +=
BANK_WRAMX; BANK_WRAMX;
if (area_AllocAbs if (area_AllocAbs