FIND-DUP 1.9, by Tic Tac and Talon_S

Well, here's our contribution to the emulation scene: a program
that finds duplicate files in a directory.  There's waaay too
many copies of some ROM images with different filenames, out
there, especially NES images, and this program will help you
fix some of that.  But it is not limited to just ROMS...without
any ROM options, FIND-DUP will scan ANY directory for duplicates!
Perfect for MODS, MIDI, GIF, JPG, MP3, DLLs...anything!

Authors: Tic Tac (emooney@attila.stevens-tech.edu) and
         Talon_S (fpiringe@attila.stevens-tech.edu).

What's New? (7/7/97)

-Added three new options!
  -Gameboy Mode
  -Genesis Mode
  -Lynx Mode

-Numerous bug fixes
 -CRT mode is FIXED 
 -fixed that old "-x assignment" error in SMS mode

-Added a few more optimizations
 -FIND-DUP is now 15% smaller! And faster, too!

Quick docs:

Usage: FIND-DUP filespec [-options] [/outputfilename] [/?]

filespec is the files you want to scan (such as *.TXT or *.*)
Only works on files in the current directory: *.GB is valid,
but C:\EMULATOR\GB\*.NES is invalid and the program may crash.
Recognizes ? and * wildcards

outputfilename is the file you want FIND-DUP to send its
results to.  Default is DUPESFND.TXT .

Options:

-n enables .NES mode.  In this mode, the program skips the
16-byte NES file header, and only compares the ROM and VROM of
the NES image.

-s enables .SMS mode.  In this mode, the program will check
for and skip the 512 byte header that's attached to some
roms.  Also, it will check for a "double-dump" rom, where the
actual game data is dumped twice into one file.

-x enables Fix mode.  This mode is used in conjunction with
SMS mode, and will correct any doubly-dumped roms.  The fixed
roms will be in a file with the extension .fix

-p enables .PCE mode.  This mode enables FIND-DUP to check for
and skip the headers that are sometimes attached to PCE roms.

-m enables .SMC mode.  Like PCE mode, this will cause FIND-DUP
to scan for and skip the SMC header.

-b enables .GB mode.  Like the other modes, this checks for and
skips any added header on a Gameboy rom.

-l enables Lynx mode.  Ditto.

-g enables Genesis mode.  FINALLY!

-f enables fast mode, which only scans the first 4k of each
file (or in NES mode, the first 4k of ROM)
*NOTE: Fast mode does not work with SMS mode

-c enables CRT mode.  There have been several requests for
output to be directed to the screen, so this option has been
added.  If enough interest is expressed, this might be made a
default.  

/? or -? displays a quick-help screen.

Extended docs:

FIND-DUP gets a list of files matching the filespec, and
generates a checksum for all the files.  If the checksums
for two files match, they are considered duplicates.

This process is not foolproof - two different files can
generate the same checksum.  Except in obvious cases such
as CHINAWAR.PCE and CHINWARR.PCE, we recommend always testing
two files reported as duplicates before deleting either.

.NES mode is designed to operate on .NES files in Marat
Fayzullin's format, containing the ROM of a NES game.  It
checks the .NES header for validity, and only compares the
ROM and VROM instead of the entire file.  So, files with
different headers and comments at the end but identical
ROM code are reported as duplicates.

We can add support for more specialized file formats in
the future - send us some ideas!

Fast mode generates a checksum on only the first 4k of each
file.  This is much faster than scanning the entire file,
especially when the files are large, but it will sometimes
report incorrect duplicates.  This happens when the first
4k of two files is identical, but the rest is not.

One example is when FIND-DUP is run in fast mode on a
directory containing the 100-in-1 NES cart and the Duck Hunt
image (100IN1.NES and DUCKHUNT.NES)... Duck Hunt is apparently
the first game in the image of the 100-in-1 cart, so the
100-in-1 and Duck Hunt are flagged as duplicates.

Also, since the first 4k of NES roms are code and the graphics
data occurs later in the file, any "sprite-hack" games can be
listed as a duplicate of the original game.  This may occur
with Japanese and English versions of a game if the first 4k
(all code) of two files is identical but some later (graphics)
data is not.

Fast mode works very well on .MODs, .GIFs, and other data
where the first 4k of two files will very rarely be identical.

The program was written in Turbo C++ 3.0 for DOS, if anyone
cares.

LEGAL STUFF:
This program and documentation are copyright (C) 1997 by
Tic Tac and Talon_S.  We assume no responsibility for any
physical, logical, emotional, brain, or any other damage
this program may cause.  FIND-DUP.EXE is freeware, but it
must be distributed with its documentation file (FIND-DUP.TXT).
This program may be included on websites and shareware/
freeware compilations, but please attempt to contact the
authors first.  Source code may be available if we are in
a good mood and you have a good reason for wanting it (want
to make a Linux version?)

And of course, this program is not to be used for any illegal
activity whatsoever.  Remember, possessing ROM images of carts
you do not own is illegal software piracy.  ;)

-Tic Tac and Talon_S 06/06/97
