mirror of
https://github.com/gbdev/rgbds.git
synced 2026-01-21 07:51:51 +00:00
Fix SECTION UNION alignment depending on piece order
This commit is contained in:
@@ -96,6 +96,7 @@ static void checkSectUnionCompat(Section &target, Section &other) {
|
||||
if (checkAgainstFixedAlign(target, other, other.alignOfs)) {
|
||||
target.isAlignFixed = true;
|
||||
target.alignMask = other.alignMask;
|
||||
target.alignOfs = other.alignOfs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
test/link/section-union/compat/a.asm
Normal file
4
test/link/section-union/compat/a.asm
Normal file
@@ -0,0 +1,4 @@
|
||||
SECTION "ROM", ROM0
|
||||
LOAD UNION "U", WRAM0
|
||||
ds 1
|
||||
ENDL
|
||||
17
test/link/section-union/compat/b.asm
Normal file
17
test/link/section-union/compat/b.asm
Normal file
@@ -0,0 +1,17 @@
|
||||
SECTION "R1", WRAM0
|
||||
ds $77
|
||||
|
||||
SECTION "R2", WRAM0
|
||||
ds $ef
|
||||
|
||||
SECTION UNION "U", WRAM0
|
||||
ds $52e
|
||||
|
||||
SECTION UNION "U", WRAM0
|
||||
wStart::
|
||||
ds $89
|
||||
assert @ & $FF == 0, "wContent must be 8-bit aligned"
|
||||
align 8
|
||||
wContent::
|
||||
ds $111
|
||||
wEnd::
|
||||
BIN
test/link/section-union/compat/ref.out.bin
Normal file
BIN
test/link/section-union/compat/ref.out.bin
Normal file
Binary file not shown.
5
test/link/section-union/compat/script.link
Normal file
5
test/link/section-union/compat/script.link
Normal file
@@ -0,0 +1,5 @@
|
||||
WRAM0
|
||||
align 8
|
||||
"R1"
|
||||
"U"
|
||||
"R2"
|
||||
@@ -390,6 +390,15 @@ rgblinkQuiet "$otemp" "$gbtemp" 2>"$outtemp"
|
||||
tryDiff "$test"/out.err "$outtemp"
|
||||
evaluateTest
|
||||
|
||||
test="section-union/compat"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
"$RGBASM" -o "$gbtemp2" "$test"/b.asm
|
||||
continueTest
|
||||
rgblinkQuiet -o "$gbtemp" -l "$test"/script.link "$otemp" "$gbtemp2"
|
||||
tryCmpRom "$test"/ref.out.bin
|
||||
evaluateTest
|
||||
|
||||
test="section-union/good"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
|
||||
Reference in New Issue
Block a user