Automate and improve rgblink test

Check all sections when testing BANK().

Add scripts to verify the tests and update the reference if needed.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
AntonioND
2017-04-02 22:27:32 +01:00
parent 25be5c6561
commit e16af28676
6 changed files with 76 additions and 36 deletions

View File

@@ -0,0 +1,53 @@
section "x",rom0[$0000]
db bank(r0),bank(r1),bank(r2),bank(r3) ; Should be enough
db bank(v0),bank(v1)
db bank(w0),bank(w1),bank(w2),bank(w3),bank(w4),bank(w5),bank(w6),bank(w7)
db bank(s0),bank(s1),bank(s2),bank(s3) ; Should be enough
db bank(o0)
db bank(h0)
section "r0",rom0
r0:
section "r1",romx,bank[1]
r1:
section "r2",romx,bank[2]
r2:
section "r3",romx,bank[3]
r3:
section "v0",vram,bank[0]
v0:
section "v1",vram,bank[1]
v1:
section "s0",sram,bank[0]
s0:
section "s1",sram,bank[1]
s1:
section "s2",sram,bank[2]
s2:
section "s3",sram,bank[3]
s3:
section "w0",wram0
w0:
section "w1",wramx,bank[1]
w1:
section "w2",wramx,bank[2]
w2:
section "w3",wramx,bank[3]
w3:
section "w4",wramx,bank[4]
w4:
section "w5",wramx,bank[5]
w5:
section "w6",wramx,bank[6]
w6:
section "w7",wramx,bank[7]
w7:
section "o0",oam
o0:
section "h0",hram
h0:

View File

@@ -0,0 +1,2 @@
rgblink:warning:Trying to calculate BANK() of label in HRAM.
rgblink:warning:Trying to calculate BANK() of label in OAM.

Binary file not shown.

View File

@@ -1,36 +0,0 @@
; this should generate a rom consisting of the following bytes:
; 01 02 03 04 05 06 07 00 01 02 03 00 01
section "x",rom0
db bank(w1),bank(w2),bank(w3),bank(w4),bank(w5),bank(w6),bank(w7)
db bank(s0),bank(s1),bank(s2),bank(s3)
db bank(v0),bank(v1)
section "wa",wramx,bank[1]
w1:
section "wb",wramx,bank[2]
w2:
section "wc",wramx,bank[3]
w3:
section "wd",wramx,bank[4]
w4:
section "we",wramx,bank[5]
w5:
section "wf",wramx,bank[6]
w6:
section "wg",wramx,bank[7]
w7:
section "sa",sram,bank[0]
s0:
section "sb",sram,bank[1]
s1:
section "sc",sram,bank[2]
s2:
section "sd",sram,bank[3]
s3:
section "v00",vram,bank[0]
v0:
section "v01",vram,bank[1]
v1:

12
test/link/test.sh Normal file
View File

@@ -0,0 +1,12 @@
otemp=$(mktemp)
gbtemp=$(mktemp)
outtemp=$(mktemp)
RGBASM=../../rgbasm
RGBLINK=../../rgblink
$RGBASM -o $otemp bank-numbers.asm
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
diff bank-numbers.out $outtemp
head -c 20 $gbtemp > $otemp 2>&1
diff bank-numbers.out.bin $otemp

9
test/link/update-refs.sh Normal file
View File

@@ -0,0 +1,9 @@
otemp=$(mktemp)
gbtemp=$(mktemp)
RGBASM=../../rgbasm
RGBLINK=../../rgblink
$RGBASM -o $otemp bank-numbers.asm
$RGBLINK -o $gbtemp $otemp > bank-numbers.out 2>&1
head -c 20 $gbtemp > bank-numbers.out.bin 2>&1