mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix WRAMX BANK offset in the right place
ROMX and WRAMX bank numers are stored in an object file as their number minus one. This means that this offset has to be applied somewhere. The old code applied the fix for ROMX and WRAMX in two different places. It looks like the patch that added support for WRAMX didn't set the offset correctly in 'src/link/assign.c'. When this was fixed, it was done in the wrong place, in 'src/asm/asm.y'. This patch moves the fix to 'src/link/assign.c'. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -59,9 +59,6 @@ static void bankrangecheck(char *name, uint32_t secttype, int32_t org,
|
||||
stype, bank, minbank, maxbank);
|
||||
}
|
||||
|
||||
if (secttype == SECT_WRAMX)
|
||||
bank -= minbank;
|
||||
|
||||
out_NewAbsSection(name, secttype, org, bank);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ const enum eSectionType SECT_MAX = SECT_OAM;
|
||||
const struct sSectionAttributes SECT_ATTRIBUTES[] = {
|
||||
{"WRAM0", BANK_INDEX_WRAM0, 0, 0, BANK_COUNT_WRAM0},
|
||||
{"VRAM", BANK_INDEX_VRAM, 0, 0, BANK_COUNT_VRAM},
|
||||
{"ROMX", BANK_INDEX_ROMX, -1, 1, BANK_COUNT_ROMX},
|
||||
{"ROMX", BANK_INDEX_ROMX, -BANK_MIN_ROMX, BANK_MIN_ROMX, BANK_COUNT_ROMX},
|
||||
{"ROM0", BANK_INDEX_ROM0, 0, 0, BANK_COUNT_ROM0},
|
||||
{"HRAM", BANK_INDEX_HRAM, 0, 0, BANK_COUNT_HRAM},
|
||||
{"WRAMX", BANK_INDEX_WRAMX, 0, 0, BANK_COUNT_WRAMX},
|
||||
{"WRAMX", BANK_INDEX_WRAMX, -BANK_MIN_WRAMX, BANK_MIN_WRAMX, BANK_COUNT_WRAMX},
|
||||
{"SRAM", BANK_INDEX_SRAM, 0, 0, BANK_COUNT_SRAM},
|
||||
{"OAM", BANK_INDEX_OAM, 0, 0, BANK_COUNT_OAM}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user