Report overlapping sections whenever possible

This commit is contained in:
ISSOtm
2019-11-04 03:24:19 +01:00
parent 197f1e9b7b
commit 7233f568a7
3 changed files with 48 additions and 17 deletions

View File

@@ -78,6 +78,20 @@ void out_AddSection(struct Section const *section)
*ptr = newSection;
}
struct Section const *out_OverlappingSection(struct Section const *section)
{
struct SortedSection *ptr =
sections[section->type].banks[section->bank].sections;
while (ptr) {
if (ptr->section->org < section->org + section->size
&& section->org < ptr->section->org + ptr->section->size)
return ptr->section;
ptr = ptr->next;
}
return NULL;
}
/**
* Performs sanity checks on the overlay file.
*/