Add RGBFIX tests for MBC names (#1477)

RGBFIX tests are now based on .flags files
The .bin and .err files are optional
This commit is contained in:
Sylvie
2024-08-20 15:15:37 -04:00
committed by GitHub
parent 8f47fb494b
commit 7d98b9a900
102 changed files with 153 additions and 125 deletions
+1 -1
View File
@@ -1 +1 @@
-f l -L custom-logo.1bpp
-f l -L ./custom-logo.1bpp
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
error: Features incompatible with MBC ("mbc1+multirumble")
Accepted combinations:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD) [aka TAMA5]
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
+1
View File
@@ -0,0 +1 @@
-m mbc1+multirumble
+22
View File
@@ -0,0 +1,22 @@
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD) [aka TAMA5]
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
+1
View File
@@ -0,0 +1 @@
-m Help
+1
View File
@@ -0,0 +1 @@
-m BANDAI_TAMA5
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m HUC1+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m HUC3
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC1+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC1+RAM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC1
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC2+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC2
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC3+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC3+RAM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC3+TIMER+BATTERY
Binary file not shown.
@@ -0,0 +1 @@
-m MBC3+TIMER+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC3
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC5+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC5+RAM
Binary file not shown.
@@ -0,0 +1 @@
-m MBC5+RUMBLE+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC5+RUMBLE+RAM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC5+RUMBLE
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC5
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MBC6
Binary file not shown.
@@ -0,0 +1 @@
-m MBC7+SENSOR+RUMBLE+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MMM01+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MMM01+RAM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m MMM01
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m POCKET_CAMERA
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m ROM_ONLY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
warning: MBC "ROM+RAM+BATTERY" is under-specified and poorly supported
+1
View File
@@ -0,0 +1 @@
-m ROM+RAM+BATTERY
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
warning: MBC "ROM+RAM" is under-specified and poorly supported
+1
View File
@@ -0,0 +1 @@
-m ROM+RAM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m ROM
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
-m TAMA5
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
-m ROM -r 2
-m rom_only -r 2
View File
View File
View File
View File
View File
View File
View File
View File
View File
Binary file not shown.
View File
View File
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
-m MBC3+RAM -r 0
-m mbc3+ram -r 0
+1 -1
View File
@@ -1 +1 @@
-m MBC3+RAM -r 2
-m mbc3+ram -r 2
+1 -1
View File
@@ -1 +1 @@
-m MBC3 -r 0
-m mbc3 -r 0
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
warning: ROM+RAM / ROM+RAM+BATTERY are under-specified and poorly supported
warning: Overwrote a non-zero byte in the cartridge type
-1
View File
@@ -1 +0,0 @@
-m8
Binary file not shown.
+20 -11
View File
@@ -42,7 +42,7 @@ tryCmp () {
runTest () {
flags=$(
head -n 1 "$2/$1.flags" | # Allow other lines to serve as comments
sed "s#-L #-L ${src//#/\\#}/#g" # Prepend src directory to logo file
sed "s# ./# ${src//#/\\#}/#g" # Prepend src directory to path arguments
)
for variant in '' ' piped'; do
@@ -51,26 +51,37 @@ runTest () {
if [[ $progress -ne 0 ]]; then
echo "${bold}${green}$1${variant}...${rescolors}${resbold}"
fi
if [[ -r "$2/$1.bin" ]]; then
desired_input="$2/$1.bin"
else
desired_input="$src/default-input.bin"
fi
if [[ -z "$variant" ]]; then
cp "$2/$1.bin" out.gb
cp "$desired_input" out.gb
if [[ -n "$(eval "$RGBFIX" $flags out.gb '2>out.err')" ]]; then
echo "${bold}${red}Fixing $1 in-place shouldn't output anything on stdout!${rescolors}${resbold}"
our_rc=1
fi
subst='out.gb'
subst=out.gb
else
# Stop! This is not a Useless Use Of Cat. Using cat instead of
# stdin redirection makes the input an unseekable pipe - a scenario
# that's harder to deal with.
# shellcheck disable=SC2002
cat "$2/$1.bin" | eval $RGBFIX "$flags" - '>out.gb' '2>out.err'
cat "$desired_input" | eval $RGBFIX "$flags" - '>out.gb' '2>out.err'
subst='<stdin>'
fi
sed "s/$subst/<filename>/g" "out.err" | tryDiff "$2/$1.err" - "$1.err${variant}"
if [[ -r "$2/$1.err" ]]; then
desired_errname="$2/$1.err"
else
desired_errname=/dev/null
fi
sed "s/$subst/<filename>/g" out.err | tryDiff "$desired_errname" - "$1.err${variant}"
(( our_rc = our_rc || $? ))
if [[ -r "$2/$1.gb" ]]; then
tryCmp "$2/$1.gb" "out.gb" "$1.gb${variant}"
tryCmp "$2/$1.gb" out.gb "$1.gb${variant}"
(( our_rc = our_rc || $? ))
fi
@@ -85,8 +96,8 @@ runTest () {
rm -f padding*_* # Delete padding test cases generated but not deleted (e.g. interrupted)
progress=1
for i in "$src"/*.bin; do
runTest "$(basename "$i" .bin)" "$src"
for i in "$src"/*.flags; do
runTest "$(basename "$i" .flags)" "$src"
done
# Check the result with all different padding bytes
@@ -103,9 +114,7 @@ for (( i=0; i < 10; ++i )); do
runTest padding${suffix} .
done
done
echo "Done!"
# TODO: check MBC names
echo "${bold}Done checking padding!${resbold}"
# Check that RGBFIX errors out when inputting a non-existent file...
$RGBFIX noexist 2>out.err
-23
View File
@@ -1,24 +1 @@
error: Failed to parse TPP1 major revision number
error: Unknown MBC "TPP1_lol"
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD)
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
-23
View File
@@ -1,24 +1 @@
error: Failed to parse TPP1 minor revision number
error: Unknown MBC "TPP1_1.lol"
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD)
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
warning: Overwrote a non-zero byte in the cartridge type
warning: Overwrote a non-zero byte in the TPP1 identification code
warning: Overwrote a non-zero byte in the TPP1 revision number
warning: Overwrote a non-zero byte in the RAM size
warning: Overwrote a non-zero byte in the TPP1 feature flags
+1
View File
@@ -0,0 +1 @@
-m TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE -r 8
Binary file not shown.
+1 -24
View File
@@ -1,24 +1 @@
error: RGBFIX only supports TPP1 versions 1.0
error: Unknown MBC "TPP1_2.0"
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD)
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
error: RGBFIX only supports TPP1 version 1.0
-23
View File
@@ -1,24 +1 @@
error: TPP1 minor revision number must be 8-bit
error: Unknown MBC "TPP1_1.256"
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD)
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
+23
View File
@@ -0,0 +1,23 @@
error: Unknown MBC "MBC1337"
Accepted MBC names:
ROM ($00) [aka ROM_ONLY]
MBC1 ($01), MBC1+RAM ($02), MBC1+RAM+BATTERY ($03)
MBC2 ($05), MBC2+BATTERY ($06)
ROM+RAM ($08) [deprecated], ROM+RAM+BATTERY ($09) [deprecated]
MMM01 ($0B), MMM01+RAM ($0C), MMM01+RAM+BATTERY ($0D)
MBC3+TIMER+BATTERY ($0F), MBC3+TIMER+RAM+BATTERY ($10)
MBC3 ($11), MBC3+RAM ($12), MBC3+RAM+BATTERY ($13)
MBC5 ($19), MBC5+RAM ($1A), MBC5+RAM+BATTERY ($1B)
MBC5+RUMBLE ($1C), MBC5+RUMBLE+RAM ($1D), MBC5+RUMBLE+RAM+BATTERY ($1E)
MBC6 ($20)
MBC7+SENSOR+RUMBLE+RAM+BATTERY ($22)
POCKET_CAMERA ($FC)
BANDAI_TAMA5 ($FD) [aka TAMA5]
HUC3 ($FE)
HUC1+RAM+BATTERY ($FF)
TPP1_1.0, TPP1_1.0+RUMBLE, TPP1_1.0+MULTIRUMBLE, TPP1_1.0+TIMER,
TPP1_1.0+TIMER+RUMBLE, TPP1_1.0+TIMER+MULTIRUMBLE, TPP1_1.0+BATTERY,
TPP1_1.0+BATTERY+RUMBLE, TPP1_1.0+BATTERY+MULTIRUMBLE,
TPP1_1.0+BATTERY+TIMER, TPP1_1.0+BATTERY+TIMER+RUMBLE,
TPP1_1.0+BATTERY+TIMER+MULTIRUMBLE
+2
View File
@@ -0,0 +1,2 @@
-m MBC1337