diff --git a/src/link/layout.cpp b/src/link/layout.cpp index 750e22fe..5cee068c 100644 --- a/src/link/layout.cpp +++ b/src/link/layout.cpp @@ -72,6 +72,7 @@ void layout_SetSectionType(SectionType type, uint32_t bank) { bank, typeInfo.lastBank ); + bank = typeInfo.lastBank; } setActiveTypeAndIdx(type, bank - typeInfo.firstBank); diff --git a/test/link/script-oob-bank-num.link b/test/link/script-oob-bank-num.link index 0fcc81a3..4f408fac 100644 --- a/test/link/script-oob-bank-num.link +++ b/test/link/script-oob-bank-num.link @@ -1,5 +1,6 @@ rom0 1 romx 0 +romx 0xffff_ffff vram 2 wram0 1 wramx 0 diff --git a/test/link/script-oob-bank-num.out b/test/link/script-oob-bank-num.out index 2f4a6e58..f67643f1 100644 --- a/test/link/script-oob-bank-num.out +++ b/test/link/script-oob-bank-num.out @@ -2,16 +2,18 @@ error: ROM0 bank 1 does not exist (the maximum is 0) at script-oob-bank-num.link(1) error: ROMX bank 0 does not exist (the minimum is 1) at script-oob-bank-num.link(2) -error: VRAM bank 2 does not exist (the maximum is 1) +error: ROMX bank 4294967295 does not exist (the maximum is 65535) at script-oob-bank-num.link(3) -error: WRAM0 bank 1 does not exist (the maximum is 0) +error: VRAM bank 2 does not exist (the maximum is 1) at script-oob-bank-num.link(4) -error: WRAMX bank 0 does not exist (the minimum is 1) +error: WRAM0 bank 1 does not exist (the maximum is 0) at script-oob-bank-num.link(5) -error: WRAMX bank 8 does not exist (the maximum is 7) +error: WRAMX bank 0 does not exist (the minimum is 1) at script-oob-bank-num.link(6) -error: OAM bank 1 does not exist (the maximum is 0) +error: WRAMX bank 8 does not exist (the maximum is 7) at script-oob-bank-num.link(7) -error: HRAM bank 1 does not exist (the maximum is 0) +error: OAM bank 1 does not exist (the maximum is 0) at script-oob-bank-num.link(8) -Linking failed with 8 errors +error: HRAM bank 1 does not exist (the maximum is 0) + at script-oob-bank-num.link(9) +Linking failed with 9 errors