aboutsummaryrefslogtreecommitdiff
path: root/scripts/test-e2e.sh
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-07-15 22:11:50 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-07-15 22:11:50 +0200
commit9d790bb4acddae689c5dda667f9d160041bdd4b8 (patch)
tree2d719d596a21e63bfe465e2c72f9caababec70c7 /scripts/test-e2e.sh
parent61b9ce33d54bc643b0ece227101d8bf571fd86e5 (diff)
downloadtools.nes-9d790bb4acddae689c5dda667f9d160041bdd4b8.tar.gz
tools.nes-9d790bb4acddae689c5dda667f9d160041bdd4b8.zip
readrom: implement the -d/--disassemble option
This option can also be coupled with -n/--nasm-directory, and you can then get a human-readable disassembling of any proc or label you might be thinking on. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'scripts/test-e2e.sh')
-rwxr-xr-xscripts/test-e2e.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh
index 2a72d38..c32d427 100755
--- a/scripts/test-e2e.sh
+++ b/scripts/test-e2e.sh
@@ -236,13 +236,37 @@ echo "LEVEL = 0" >> tests/jetpac.nes/config/generated.s
# NOTE: we use '--stats' as otherwise the 'segments.txt' file would be removed
# from the jetpac.nes repository, and the submodule would then be marked with
# "-dirty".
-$AS65 --no-errors --allow-unused --strict --stats -b ./target/debug/nasm -C tests/jetpac.nes/config/nrom.cfg -o /dev/null tests/jetpac.nes/src/jetpac.s 1>/dev/null
+$AS65 --no-errors --allow-unused --strict --stats -b ./target/debug/nasm -C tests/jetpac.nes/config/nrom.cfg -o tests/out/jetpac.NTSC.nes tests/jetpac.nes/src/jetpac.s 1>/dev/null
# Remove the generated.s file to avoid git from thinking we have modified the
# project in any meaningful way.
rm -f tests/jetpac.nes/config/generated.s
##
+# readrom
+
+echo "test: readrom: header (jetpac.nes)"
+./target/debug/readrom tests/out/jetpac.NTSC.nes > tests/out/jetpac.header.txt
+diff tests/out/jetpac.header.txt tests/expected/readrom/header.txt
+exit_code=$((exit_code + $?))
+
+echo "test: readrom: hexadecimal address (jetpac.nes)"
+./target/debug/readrom -d '$a3b2' -n tests/jetpac.nes/.nasm/ tests/out/jetpac.NTSC.nes > tests/out/jetpac-a3b2-address.txt
+diff tests/out/jetpac-a3b2-address.txt tests/expected/readrom/a3b2-address.txt
+exit_code=$((exit_code + $?))
+
+echo "test: readrom: full NMI disassembling (jetpac.nes)"
+./target/debug/readrom -d nmi -n tests/jetpac.nes/.nasm/ tests/out/jetpac.NTSC.nes > tests/out/jetpac-full-nmi.txt
+diff tests/out/jetpac-full-nmi.txt tests/expected/readrom/jetpac-full-nmi.txt
+exit_code=$((exit_code + $?))
+
+# Remove the dangling jetpac.nes ROM file.
+rm tests/out/jetpac.NTSC.nes
+
+# This file wasn't available originally on jetpac.nes
+rm -f tests/jetpac.nes/.nasm/addresses.txt
+
+##
# Done!
exit $exit_code