From 2c523649785a4ee9bb21f16148affafcfc3a8a94 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 16 Jan 2020 18:12:42 +0100 Subject: [PATCH] Add test for fixed section addresses --- test/link/fixed-oob.asm | 15 +++++++++++++++ test/link/fixed-oob.out | 14 ++++++++++++++ test/link/test.sh | 5 +++++ 3 files changed, 34 insertions(+) create mode 100644 test/link/fixed-oob.asm create mode 100644 test/link/fixed-oob.out diff --git a/test/link/fixed-oob.asm b/test/link/fixed-oob.asm new file mode 100644 index 00000000..1c2f9cc9 --- /dev/null +++ b/test/link/fixed-oob.asm @@ -0,0 +1,15 @@ +SECTION "ROM0", ROM0[$BABE] + +SECTION "ROMX", ROMX[$BEEF] + +SECTION "VRAM", VRAM[$C0DE] + +SECTION "SRAM", SRAM[$CAFE] + +SECTION "WRAM0", WRAM0[$DEAD] + +SECTION "WRAMX", WRAMX[$DAD] + +SECTION "OAM", OAM[$CAB] + +SECTION "HRAM", HRAM[$BAD] diff --git a/test/link/fixed-oob.out b/test/link/fixed-oob.out new file mode 100644 index 00000000..3270d159 --- /dev/null +++ b/test/link/fixed-oob.out @@ -0,0 +1,14 @@ +warning: Section "VRAM"'s fixed address 0xc0de is outside of range [0x8000; 0x9fff] +warning: Section "VRAM"'s end address 0xc0de is greater than last address 0xa000 +warning: Section "OAM"'s fixed address 0xcab is outside of range [0xfe00; 0xfe9f] +warning: Section "WRAM0"'s fixed address 0xdead is outside of range [0xc000; 0xcfff] +warning: Section "WRAM0"'s end address 0xdead is greater than last address 0xd000 +warning: Section "HRAM"'s fixed address 0xbad is outside of range [0xff80; 0xfffe] +warning: Section "SRAM"'s fixed address 0xcafe is outside of range [0xa000; 0xbfff] +warning: Section "SRAM"'s end address 0xcafe is greater than last address 0xc000 +warning: Section "WRAMX"'s fixed address 0xdad is outside of range [0xd000; 0xdfff] +warning: Section "ROMX"'s fixed address 0xbeef is outside of range [0x4000; 0x7fff] +warning: Section "ROMX"'s end address 0xbeef is greater than last address 0x8000 +warning: Section "ROM0"'s fixed address 0xbabe is outside of range [0; 0x3fff] +warning: Section "ROM0"'s end address 0xbabe is greater than last address 0x4000 +error: Sanity checks failed diff --git a/test/link/test.sh b/test/link/test.sh index 26e8d8a2..def8b51a 100755 --- a/test/link/test.sh +++ b/test/link/test.sh @@ -18,6 +18,11 @@ dd if=$gbtemp count=1 bs=20 > $otemp 2>/dev/null diff --strip-trailing-cr bank-numbers.out.bin $otemp rc=$(($? || $rc)) +$RGBASM -o $otemp fixed-oob.asm +$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1 +diff --strip-trailing-cr fixed-oob.out $outtemp +rc=$(($? || $rc)) + $RGBASM -o $otemp section-attributes.asm $RGBLINK -l section-attributes.link -o $gbtemp $otemp > $outtemp 2>&1 diff --strip-trailing-cr section-attributes.out $outtemp