From 69a41d8ef9671437a73a3dd73efe5f11922a836c Mon Sep 17 00:00:00 2001 From: James Larrowe Date: Mon, 15 Jun 2020 22:45:29 -0400 Subject: [PATCH] Fix indexing of banks array When ROMX bank 1 is given, the banks array is indexed with an index of 1 rather than an index of zero. --- src/link/output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/link/output.c b/src/link/output.c index ee1c3e53..d9a1dbd1 100644 --- a/src/link/output.c +++ b/src/link/output.c @@ -88,8 +88,9 @@ void out_AddSection(struct Section const *section) struct Section const *out_OverlappingSection(struct Section const *section) { + struct SortedSections *banks = sections[section->type].banks; struct SortedSection *ptr = - sections[section->type].banks[section->bank].sections; + banks[section->bank - bankranges[section->type][0]].sections; while (ptr) { if (ptr->section->org < section->org + section->size