View Full Version : How to Compare ROMs
Thomas Jentzsch
08-25-2004, 03:54 AM
Maybe someone is interested how Targ compares to Universal Chaos. CloneSpy (http://www.atariage.com/forums/viewtopic.php?t=34495) says:
0 1 2
0 Universal Chaos (Telegames) (PAL) [!] · 98 34
1 Universal Chaos (Telegames)·········· = · 35
2 Targ································· 28 29 ·
So, the games are sharing the same code base, but still are quite different. Universal Chaos looks like a later, a bit more developed version of Targ, e.g. the additional enemy is still missing in Targ.
Anyway, thanks for sharing!
rbudrick
08-25-2004, 12:41 PM
It only differs from Universal Chaos by a few hundred bytes, so it's definitely the same code, only slightly different (as I suspected 2 years ago, judging by the CBS catalog photo )
SUperstonic, I've always wondered, how does one compare two roms and find out how much they differ by like that? I've heard of people doing that on many occasions...
-Rob
Thomas Jentzsch
08-25-2004, 02:16 PM
...I've always wondered, how does one compare two roms and find out how much they differ by like that? I've heard of people doing that on many occasions...
I can't tell you how others are doing it, but I am using a statistical approach (before I look at the disassembled code for details). I wrote a little program called CloneSpy (http://www.atariage.com/forums/viewtopic.php?t=34495) for that purpose, that looks for identical byte sequences in both programs. The more and the longer identical sequences it finds, the more identical the ROMs are. It works quite well, especially for identyfing hacks and pirates.
If you follow the link, you can get some more information about CloneSpy (http://www.atariage.com/forums/viewtopic.php?t=34495).
Thomas Jentzsch
08-25-2004, 03:39 PM
Simple - go to a DOS prompt and type fc (for 'file compare') filename1.bin filename2.bin (such as fc targ.bin uc.bin). It will then list which byte(s) are different. If you want to know what the percentage of how different they are, just divide the number of different bytes by the total # of bytes (in this case, 4k, or 4,096 bytes) times 100. I forget the exact number of different bytes, but it was around 300. Using that number, they're roughly 7% different from each other (or 93% alike) :) There might be some hex editors out there that let you do comparisions as well.
Uhm, which fc (or UC ROM?) are you using here???
My fc (XP, Win95, DOS) show almost every byte different. Which is no surprise, because they all just compare files byte by byte. Since one single inserted byte moves the whole remaining bytes of that file out of sync with the other one, the byte compare fails from that point. In our case, this starts at byte #13, so the remaining 4085 bytes are out of sync. Since sometimes some bytes still match and some data is usually aligned to 256 bytes pages, fc sometimes still finds some matches, but most of them are just a coincidence.
When I fc Targ with Universal Chaos (NTSC), fc shows exactly 3361 different bytes, which would give a difference of ~82% and not just 7%. But since you cannot use fc for comparing binaries anyway (as I described above), both numbers are completely wrong.
That's why I wrote CloneSpy (http://www.atariage.com/forums/viewtopic.php?t=34495). ;)
ubersaurus
08-25-2004, 08:12 PM
Never let it be said that you'd pass up any opportunity to prove how much more knowledgeable than everyone else you are. My analyzing tools are certainly primitive compared to yours (playing both games, and drawing comparisions between them...) but I don't need a program to tell me that Targ and Universal Chaos are essentially the same program. Then again, what do I know? I'm just some stupid, childish, immature person who has no love for the hobby (your words, remember? Or do you need links to remind you?).
Wambulance?
Azazel
08-26-2004, 12:27 AM
Simple - go to a DOS prompt and type fc (for 'file compare') filename1.bin filename2.bin (such as fc targ.bin uc.bin). It will then list which byte(s) are different. If you want to know what the percentage of how different they are, just divide the number of different bytes by the total # of bytes (in this case, 4k, or 4,096 bytes) times 100. I forget the exact number of different bytes, but it was around 300. Using that number, they're roughly 7% different from each other (or 93% alike) :) There might be some hex editors out there that let you do comparisions as well.
Yea most good Hex Editiors out there have a compare feature in them.
ianoid
08-26-2004, 02:53 AM
Never let it be said that you'd pass up any
Yikes!
Ladies and Gentlemen. In this corner...
I must say that I appreciate both of your input to the thread! I've always wondered about comparing ROMs.
Now would one of you compare the Number Bumper CV ROM to Amazing Bumpman released by Telegames?
< Jay London style > Thank you.
Thomas Jentzsch
08-26-2004, 04:02 AM
Yea most good Hex Editiors out there have a compare feature in them.
Yes, but AFAIK(!) this is always only a simple binary compare (just like fc). It can just show you if binaries differ and where they differ.
Now imagine two identical binary files, where you insert one single additional byte at the start. From now on, all bytes on the same address will differ (with a few coincidal exceptions), and a simple compare will fail, thought the binaries are still ~99.9...% identical.
Exactly this happens when you not just hack a ROM (exchanging a few bytes, but not inserting them). If you have the source code, you add new functionality, reorganize your code, move some code into subroutines etc. The resulting new file will still have many identical byte sequences with the old one, but the binary compare will not find them, because their position is different.
CloneSpy (http://www.atariage.com/forums/viewtopic.php?t=34495), though being a really dirty hack, is able to find those identical byte sequences and therefore will still be able to tell you that both files share the same code base.
This is nothing new, actually all good file compressors follow the same principle. If you e.g. use (Win)RAR with the "Solid Archives" feature, compress both files alone, write down the resulting archive sizes, and then compress both files together and compare the file sizes you will get the same results (just with RAR's overhead, which is tampering the results, especially for small files).
If you know a hex editor that does the job too, please tell me. I have been long searching for it without success.
Thomas Jentzsch
08-26-2004, 04:14 AM
Now would one of you compare the Number Bumper CV ROM to Amazing Bumpman released by Telegames?
Depends on the filesize, CloneSpy may work if they are not too large (~32k), else use the WinRAR method I explained above. I don't have the ROMs, else I would do that for you.
Sniderman
08-26-2004, 09:25 AM
If you drive your car against either the left or right border and hold the fire button down, any Targs that run into you (from the side) will be destroyed! The 'sweet' spot that I use is the lower-left corner, as the Targs seem more willing to the far left and then come down, rather than trying to move behind you. Believe it or not, this trick also usually works on the stand-up arcade game too. I can't tell you if the arcade game has the other tricks you listed in the 2600 version, but I can confirm that you can pull this stunt off 75% of the time. The other times, "blammo" for you. :D
rbudrick
08-27-2004, 12:57 PM
So Thomas, Clonespy only works for less than 32k files? Just wanted to clarify. :-)
Oh, and of someone does indeed know a hex editor with a compare feature, that would be very cool to know. I have some protos I may be getting dumped soon, so I hope to do comparisons with any tools I can find. :-)
-Rob
Thomas Jentzsch
08-27-2004, 01:08 PM
So Thomas, Clonespy only works for less than 32k files? Just wanted to clarify. :-)
Yes, it is intended to work with small files only, but I got some mails from people who compared up to 256k successfully (though I never tested that myself).
But for those large files, you can also rely on the results you get from using the WinRAR method I desribed above. Or just send me the files and I compare them for you (but only a few please ;)).
Hex Workshop (http://www.bpsoft.com/) has a compare feature... both a simple compare, which does the same thing as fc, but then also a syncronizing compare, which shows blocks of data that are the same, different, etc. Hex Workshop is definately the best hex editor I've ever used.
DogP
Thomas Jentzsch
08-27-2004, 04:42 PM
Hex Workshop (http://www.bpsoft.com/) has a compare feature.
Yup, it's a good tool. Unfortunately its not for free, and the syncronized compare, while working very good, is a bit too complicated (=not perfectly suited) to handle to get an easy result on how identical two binaries are.
I am especially missing an overall rating. You have to add the identical blocks and create that number yourself.