summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2015-11-03 22:54:19 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2015-11-03 22:54:19 -0500
commitf58756cafc0d9e4b7d8d454e98143fa38fbf4c24 (patch)
tree9f603e15d4ebe691557f6454101265826a3fe8e7
parent91ea4a2f9b3d169a8e06aed62f19466c643eff83 (diff)
A more verbose compare.sh
-rwxr-xr-xcompare.sh30
1 files changed, 26 insertions, 4 deletions
diff --git a/compare.sh b/compare.sh
index 142de2079..1dc7bcd04 100755
--- a/compare.sh
+++ b/compare.sh
@@ -2,10 +2,32 @@
# Compares baserom.gbc and pokecrystal.gbc
# create baserom.txt if necessary
-if [ ! -f baserom.txt ]; then
- hexdump -C baserom.gbc > baserom.txt
+crystal_md5=9f2922b235a5eeb78d65594e82ef5dde
+if [ ! -f baserom.gbc ]; then
+ echo "FATAL: Baserom not found"
+ exit 1
fi
-hexdump -C pokecrystal.gbc > pokecrystal.txt
+base_md5=`md5sum baserom.gbc | cut -d' ' -f1`
+echo "baserom.gbc: $base_md5"
+if [ $base_md5 != $crystal_md5 ]; then
+ echo "FATAL: Baserom is incorrect"
+ exit 1
+fi
+
+built_md5=`md5sum pokecrystal.gbc | cut -d' ' -f1`
+echo "pokecrystal.gbc: $built_md5"
+if [ $built_md5 != $crystal_md5 ]
+then
+ echo "Checksums do not match, here's where the ROMs differ..."
+ if [ ! -f baserom.txt ]; then
+ hexdump -C baserom.gbc > baserom.txt
+ fi
+
+ hexdump -C pokecrystal.gbc > pokecrystal.txt
+
+ diff -u baserom.txt pokecrystal.txt | less
+else
+ echo "Checksums match! :D"
+fi
-diff -u baserom.txt pokecrystal.txt | less