summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2015-11-04 20:29:11 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2015-11-04 20:29:11 -0500
commit893b3a217eefd354d8b0023aa91d9b6a7d03604a (patch)
tree4735d2ca45b8b82350185c8f657790a68802c557
parent3cadc7b012c3d11f227d71814f729952d0f56c21 (diff)
Restore compare.sh with new version as compare2.sh
-rwxr-xr-xcompare.sh30
-rwxr-xr-xcompare2.sh51
2 files changed, 55 insertions, 26 deletions
diff --git a/compare.sh b/compare.sh
index 1dc7bcd04..d013a88ab 100755
--- a/compare.sh
+++ b/compare.sh
@@ -2,32 +2,10 @@
# Compares baserom.gbc and pokecrystal.gbc
# create baserom.txt if necessary
-crystal_md5=9f2922b235a5eeb78d65594e82ef5dde
-if [ ! -f baserom.gbc ]; then
- echo "FATAL: Baserom not found"
- exit 1
+if [ ! -f baserom.txt ]; then
+ hexdump -C baserom.gbc > baserom.txt
fi
-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
+hexdump -C pokecrystal.gbc > pokecrystal.txt
+diff -u baserom.txt pokecrystal.txt | less
diff --git a/compare2.sh b/compare2.sh
new file mode 100755
index 000000000..64695229e
--- /dev/null
+++ b/compare2.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Compares baserom.gbc and pokecrystal.gbc
+
+# create baserom.txt if necessary
+crystal_md5=9f2922b235a5eeb78d65594e82ef5dde
+if [ ! -f baserom.gbc ]; then
+ echo "FATAL: Baserom not found"
+ exit 1
+fi
+
+if [ $1 ]; then
+ if [ $1 == "-v" ]; then
+ verbose=1
+ else
+ verbose = 0
+ fi
+else
+ verbose=0
+fi
+
+base_md5=`md5sum baserom.gbc | cut -d' ' -f1`
+if [ $verbose == 1 ]; then
+ echo "baserom.gbc: $base_md5"
+fi
+if [ $base_md5 != $crystal_md5 ]; then
+ echo "FATAL: Baserom is incorrect"
+ exit 1
+fi
+
+built_md5=`md5sum pokecrystal.gbc | cut -d' ' -f1`
+if [ $verbose == 1 ]; then
+ echo "pokecrystal.gbc: $built_md5"
+fi
+if [ $built_md5 != $crystal_md5 ]
+then
+ if [ $verbose == 1 ]; then
+ echo "Checksums do not match, here's where the ROMs differ..."
+ fi
+ 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
+ if [ $verbose == 1 ]; then
+ echo "Checksums match! :D"
+ fi
+fi
+