diff options
author | yenatch <yenatch@gmail.com> | 2017-12-23 13:17:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 13:17:46 -0500 |
commit | 878092004956418bfd77bfdb9fc9dd7f640f80d2 (patch) | |
tree | 3a97e3eb15d5c545977038e67589f92158e5bf23 /tools/compare2.sh | |
parent | a6656a986bf9dde51561cab090648e0117b173ad (diff) | |
parent | 3c37bfc6fa2570a0a77c1230673910257ecf32df (diff) |
Merge pull request #419 from roukaour/master
More reorganization and documentation
Diffstat (limited to 'tools/compare2.sh')
-rwxr-xr-x | tools/compare2.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tools/compare2.sh b/tools/compare2.sh new file mode 100755 index 000000000..64695229e --- /dev/null +++ b/tools/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 + |