Use C++ iterator for fragment/union "pieces" of RGBLINK sections

This commit is contained in:
Rangi
2025-10-05 15:06:17 -04:00
parent 7733ccdeb6
commit 0c9920d4a6
6 changed files with 56 additions and 24 deletions

View File

@@ -53,9 +53,9 @@ static void initFreeSpace() {
static void assignSection(Section &section, MemoryLocation const &location) {
// Propagate the assigned location to all UNIONs/FRAGMENTs
// so `jr` patches in them will have the correct offset
for (Section *piece = &section; piece != nullptr; piece = piece->nextPiece.get()) {
piece->org = location.address;
piece->bank = location.bank;
for (Section &piece : section.pieces()) {
piece.org = location.address;
piece.bank = location.bank;
}
out_AddSection(section);
}