mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix address-fixed sections potentially incorrectly assigned
This happened if all space before their fixed location was taken
This commit is contained in:
@@ -166,11 +166,11 @@ static struct FreeSpace *getPlacement(struct Section const *section,
|
|||||||
* one candidate block per bank; if we already
|
* one candidate block per bank; if we already
|
||||||
* reached it, give up.
|
* reached it, give up.
|
||||||
*/
|
*/
|
||||||
if (location->address == section->org)
|
if (location->address < section->org)
|
||||||
|
location->address = section->org;
|
||||||
|
else
|
||||||
/* Try again in next bank */
|
/* Try again in next bank */
|
||||||
space = NULL;
|
space = NULL;
|
||||||
else
|
|
||||||
location->address = section->org;
|
|
||||||
} else if (section->isAlignFixed) {
|
} else if (section->isAlignFixed) {
|
||||||
/* Move to next aligned location */
|
/* Move to next aligned location */
|
||||||
location->address &= ~section->alignMask;
|
location->address &= ~section->alignMask;
|
||||||
|
|||||||
Reference in New Issue
Block a user