-
Notifications
You must be signed in to change notification settings - Fork 69
/
chkbitperfect.lua
executable file
·42 lines (32 loc) · 1.18 KB
/
chkbitperfect.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env lua
local clownmd5 = require "build_tools.lua.clownmd5"
-- Prevent build.lua's calls to os.exit from terminating the program.
local os_exit = os.exit
os.exit = coroutine.yield
-- Build the ROMs.
local co
-- Sonic 3
co = coroutine.create(function() dofile("buildS3.lua") end)
local _, _, abort_s3 = assert(coroutine.resume(co))
-- Sonic & Knuckles
co = coroutine.create(function() dofile("buildSK.lua") end)
local _, _, abort_sk = assert(coroutine.resume(co))
-- Restore os.exit back to normal.
os.exit = os_exit
if not abort_s3 and not abort_sk then
-- Hash the ROMs.
local s3_hash = clownmd5.HashFile("s3built.bin")
local sk_hash = clownmd5.HashFile("skbuilt.bin")
-- Verify the hashes.
print "-------------------------------------------------------------"
if s3_hash == "\xD7\x24\xEA\x4D\xD4\x17\xFE\x33\x0C\x9D\xCF\xD9\x55\xC5\x96\xB2" then
print "Sonic 3 ROM is bit-perfect (with USA version)."
else
print "Sonic 3 ROM is NOT bit-perfect (with USA version)!"
end
if sk_hash == "\x4E\xA4\x93\xEA\x4E\x9F\x6C\x9E\xBF\xCC\xBD\xB1\x51\x10\x36\x7E" then
print "Sonic & Knuckles ROM is bit-perfect."
else
print "Sonic & Knuckles ROM is NOT bit-perfect!"
end
end