mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Scramble banks from the end of the ROM (#1273)
This is more likely to test edge cases, such as having content in banks with their highest bit set.
This commit is contained in:
@@ -122,7 +122,7 @@ for i in *.asm; do
|
||||
desired_binname=${i%.asm}.out.bin
|
||||
if [ -f "$desired_binname" ]; then
|
||||
"$RGBLINK" -o "$gb" "$o"
|
||||
rom_size=$(wc -c < "$desired_binname")
|
||||
rom_size=$(printf %s $(wc -c <"$desired_binname"))
|
||||
dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null
|
||||
tryCmp "$desired_binname" "$output" gb
|
||||
(( our_rc = our_rc || $? ))
|
||||
|
||||
5
test/link/scramble-romx/a.asm
Normal file
5
test/link/scramble-romx/a.asm
Normal file
@@ -0,0 +1,5 @@
|
||||
SECTION "fixed", ROMX, BANK[3]
|
||||
ds $4000, 1
|
||||
|
||||
SECTION "floating", ROMX
|
||||
db 2
|
||||
0
test/link/scramble-romx/out.err
Normal file
0
test/link/scramble-romx/out.err
Normal file
@@ -41,7 +41,7 @@ tryCmp () {
|
||||
fi
|
||||
}
|
||||
tryCmpRom () {
|
||||
# `printf` lets us keep only the first returned word.
|
||||
# `printf` lets us keep only the first returned word from `wc`.
|
||||
rom_size=$(printf %s $(wc -c <"$1"))
|
||||
dd if="$gbtemp" count=1 bs="$rom_size" >"$otemp" 2>/dev/null
|
||||
tryCmp "$1" "$otemp"
|
||||
@@ -146,6 +146,17 @@ tryDiff overlay/out.err "$outtemp"
|
||||
tryCmp overlay/out.gb "$gbtemp"
|
||||
(( rc = rc || $? ))
|
||||
|
||||
i="scramble-romx.asm"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" scramble-romx/a.asm
|
||||
rgblinkQuiet -o "$gbtemp" -S romx=3 "$otemp" >"$outtemp" 2>&1
|
||||
tryDiff scramble-romx/out.err "$outtemp"
|
||||
(( rc = rc || $? ))
|
||||
# This test does not compare its exact output with 'tryCmpRom' because no scrambling order is guaranteed
|
||||
rom_size=$(printf %s $(wc -c <"$gbtemp"))
|
||||
test "$rom_size" = 65536 # Check for exactly 3 ROMX banks
|
||||
(( rc = rc || $? ))
|
||||
|
||||
i="section-fragment/jr-offset.asm"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" section-fragment/jr-offset/a.asm
|
||||
|
||||
Reference in New Issue
Block a user