mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 03:22:08 +00:00
Implement unionized sections in RGBLINK
This commit is contained in:
21
test/link/section-union/a.asm
Normal file
21
test/link/section-union/a.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
SECTION UNION "a", WRAM0
|
||||
ds 10
|
||||
a1:
|
||||
|
||||
SECTION UNION "b", WRAMX,ALIGN[4]
|
||||
banked::
|
||||
ds 10
|
||||
b1:
|
||||
|
||||
SECTION UNION "c", HRAM[$FFC0]
|
||||
ds 5
|
||||
c1::
|
||||
|
||||
|
||||
SECTION "output 1", ROM0
|
||||
dw a1,a2 ; $C00A, $C02A
|
||||
dw b1,b2 ; $DABA, $DAB2
|
||||
dw c1,c2 ; $FFC5, $FFC5
|
||||
|
||||
SECTION "output 3", ROM0
|
||||
db BANK(banked)
|
||||
18
test/link/section-union/b.asm
Normal file
18
test/link/section-union/b.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
SECTION UNION "a", WRAM0
|
||||
a1: ; This is here to check that the two `a1` don't conflict
|
||||
ds 42
|
||||
a2::
|
||||
|
||||
SECTION UNION "b", WRAMX[$DAB0]
|
||||
ds 2
|
||||
b2::
|
||||
|
||||
SECTION UNION "c", HRAM[$FFC0]
|
||||
b1: ; Same but in different sections now
|
||||
ds 5
|
||||
c2::
|
||||
|
||||
SECTION "output 2", ROM0
|
||||
dw a1,a2
|
||||
dw b1,b2
|
||||
dw c1,c2
|
||||
BIN
test/link/section-union/ref.out.bin
Normal file
BIN
test/link/section-union/ref.out.bin
Normal file
Binary file not shown.
9
test/link/section-union/script.link
Normal file
9
test/link/section-union/script.link
Normal file
@@ -0,0 +1,9 @@
|
||||
ROM0
|
||||
"output 1"
|
||||
"output 2"
|
||||
"output 3"
|
||||
WRAM0
|
||||
"a" ; $C000
|
||||
WRAMX 1
|
||||
ORG $DAB0
|
||||
"b"
|
||||
@@ -71,12 +71,20 @@ for i in *.asm; do
|
||||
fi
|
||||
done
|
||||
|
||||
# This test does its own thing
|
||||
# These tests do their own thing
|
||||
|
||||
$RGBASM -o $otemp high-low/a.asm
|
||||
$RGBLINK -o $gbtemp $otemp
|
||||
$RGBASM -o $otemp high-low/b.asm
|
||||
$RGBLINK -o $gbtemp2 $otemp
|
||||
i="high-low.asm" tryDiff $gbtemp $gbtemp2
|
||||
i="high-low.asm" tryCmp $gbtemp $gbtemp2
|
||||
rc=$(($? || $rc))
|
||||
|
||||
$RGBASM -o $otemp section-union/a.asm
|
||||
$RGBASM -o $gbtemp2 section-union/b.asm
|
||||
$RGBLINK -o $gbtemp -l section-union/script.link $otemp $gbtemp2
|
||||
dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < section-union/ref.out.bin)) > $otemp 2>/dev/null
|
||||
i="section-union.asm" tryCmp section-union/ref.out.bin $otemp
|
||||
rc=$(($? || $rc))
|
||||
|
||||
rm -f $otemp $gbtemp $gbtemp2 $outtemp
|
||||
|
||||
Reference in New Issue
Block a user