Jump to content


Photo
- - - - -

Comparing files


  • Please log in to reply
6 replies to this topic

#1 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,961 posts

Posted 01 April 2017 - 10:48 AM

Does anyone know any application which could compare ZX Spectrum files easily and efficiently? I mean a situation when I have two files (TAP, Z80 or whatever) of the same game, with minor differences, like one is the original and the other is patched. Most of the code is the same, there are just snippets of code here and there which are different, and I want to identify exactly what changes the patch has introduced.

 

What I'm looking for is a program which would either list all the different addresses, e.g. something like:

 

Address       File A                               File B

 

8500             C3                                   CA 

8501             40                                    40

8502             86                                    87

 

or show two columns of code side by side with the differences e.g. highlighted in red?

 

The perfect program I am looking for would run under Windows, would have a GUI, would be able to show the code in Hex and would be free to use or at least to try  :) .

 

Any ideas?



#2 Spider

Spider

    DEC (HL)

  • Administrator
  • 3,565 posts

Posted 01 April 2017 - 03:08 PM

I did have a very basic checker in Basic but it simply added values up (sort of) and gave a total sum but you can use ZXEditor to see the CRC of the block to 'compare' which is quicker, however it does not show the differences.

 

I'm struggling to think of a way to do this easily to be honest. You could fire up two assemblers (ZX Assembler) but you'd have to manually compare them.

 

An alternative I have used (warning: messy) is to use HXED to do a file compare but ideally you just need to copy the .tap / .tzx and only have that present not the loader (to just save time) and then it will show each difference. You can then see how "far" into the block of data it is and roughly work out where it is in the code block. It works but its quite messy and not easy to do this.

 

I do know exactly what you're looking for though... Tapir can compare tapes but does not appear to show the difference, it will simply say its identical or not.


Changing order to chaos since 1984

#3 IRF

IRF

    Advanced Member

  • Contributor
  • 3,980 posts

Posted 01 April 2017 - 03:23 PM

Doesn't Andrew Broad use something called SPECSAEIE or something, for this purpose?



#4 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,961 posts

Posted 01 April 2017 - 05:58 PM

Thanks for your replies, guys!

 

What is HXED exactly? Where can I download it from?

 

Andrew Broad's SPECSAISIE indeed has a compare function:

 

Compare: Compare two SNA files byte-by-byte, reporting addresses for which the two memories have different values, and what the value is for the second memory.

 

So it could be a solution.

 

I did try to install and run SPECSAISIE in the past a couple of times, and always failed, IIRC. However, I was never desperate enough to really get it going - I should have tried harder, probably...

 

I'll think about it.



#5 Spider

Spider

    DEC (HL)

  • Administrator
  • 3,565 posts

Posted 01 April 2017 - 08:02 PM

HxEd > https://www.mh-nexus.de/en/ , Its actually called HxD but I've always mistakenly called it that. I use a portable version, saves installing it as you can simply run it from its folder. :) , here > https://mh-nexus.de/...php?product=HxD , scroll down a bit to find the portable versions.

 

It will be slightly easier if you only use the 'raw' bit of the tape file if you're going to do it this way. If it for instance finds a difference at 20 bytes in, you know then that if your tape loads at say 32768, you need to look/compare at 32788. It won't be exactly 20 bytes in because the tape contains other bits, but there is a way around this.

 

I've thought about this a bit more.

 

Grab ZXBlock Editor (awesome tool) if you do not have it. Fire it up and open the tape file, then export the tape file (just the code block) as a binary file. Now do the same for the other file too.

 

At this stage you have two .bin files, with these you only have the data not the tape information, so the "20 bytes in" thing should be about right.

 

I can try to do a DIY pic session on this if its confusing.


Changing order to chaos since 1984

#6 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,961 posts

Posted 02 April 2017 - 09:54 AM

Thanks a lot for this info, Andy, I appreciate it!  :)

 

I need the comparison for one particular purpose at the moment (to be revealed in the near future, hopefully), and since I do have some additional data, I might be able to achieve it in various ways. However, for the future it would be good to be able to compare any two files efficiently. My first choice will be trying to get SPECSAISIE to work (which also has many other useful functions). Should that fail, I would try HxEd and the method you've described.

 

And yes, I do have ZX-Blockeditor and I concur that it's a great tool. I used it last year when creating the final files of the Special Edition of "Willy's New Mansion" and of "Willy Games: The First 30 Years Quiz"  :) .



#7 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,961 posts

Posted 02 April 2017 - 01:04 PM

I am thrilled to report that I have managed to run Andrew Broad's SPECSAISIE for the first time ever, and I've managed to compare two SNA files using it!  :D 

 

It happened after quite a long struggle with getting it to run, going through the installation of Java JDK, setting the correct PATH variable, creating a Compare.class file from the Compare.java file, and consulting various internet tutorials along the way. All this on a Windows 10 system. I used SPECSAISIE 1.2.

 

The tool is not perfectly user-friendly as far as I'm concerned - the results are displayed in decimal (only) in the Command window (and so have to be copied manually, I believe) - but IT WORKS! It's done its job and delivered exactly what I needed :D .

 

A big thanks to Andrew Broad for it :) , and it's a shame SPECSAISIE - which has many other useful functions in addition to Compare - hasn't been developed further as per plans for it which once existed...


Edited by jetsetdanny, 02 April 2017 - 01:19 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users