## Rebuilder Dialog

The Rebuilder is a crc32 based scanner & file creator. It is file-based (even files in archives) not set-based. The rebuilder scans all files from its source folder and tries to match the file's crc32 with one in the datfile. If the crc32 matches it will create the file in the destination folder with correct set and filename. So you can see that the rebuilder only rebuild valid files. It is a fine utility to create clean sets or add files to your sets. The current rebuilder is filebased not setbased. That means that it doesn't rebuild set by set but file by file. So when a file is shared by e.g. 8 sets, the rebuilder creates/adds this file to all 8 sets.

Rebuilding can last from seconds to hours. That depends on the amount of files, the filesizes, your CPU, your HD the compressionlevel and the thread priority. It's possible to stop the process at any time. Disabling the 'recompress' option will speed up the rebuild operation.

### The options:

The title bar shows the currently selected profile and the number of selected sets. This behaviour was changed to a tool tip appearing when hovering over the title. For further information check out the settings dialog. Always be careful if the number doesn't match your selected number. You will also see a warning message when scanner and rebuilder mergemodes differ. The lower part of this window is the warningswindow which will list possible minor problems. By right-clicking you'll see a popup menu which is described in the Scanner documentation.

#### Merge Options

You can set your mergemode with the first three options.

- Non-Merged Sets

> Disables merging. That means that you'll get unmerged sets in the destination folder.

- Split Sets

> Enables split (merging). All files which belong to the parentset will be placed in the parent set. The rest will be placed in the clone set.

- Merge Sets

> Enables (full) merging. All files will be placed in the parent set.

####

#### Start Options

- Rebuild

> Press this button to start the rebuilding process.

####

#### Directories to work on

- Source

> Here you can enter the name of the source path. This is the folder which will be scanned for possible files. Click the right button to open a folder-browser-dialog. clrmamepro automatically adds a '\' at the end of the name. You don't have to use quotation marks while entering a name which contains spaces. By clicking on the button USE BACKUPPATH you can set the current source to the clrmamepro backupfolder.

- Use Add-Paths
  If you enable this option clrmamepro will use the Add-Paths (see Settings Dialog for details) as source folders. So you're able to use multiple rebuilder-sources.

- Scan Subfolders

  If you check this checkbox clrmamepro walks recursively through your sourcefolder. So it will try to rebuild any file in any subfolder of your sourcefolder, too.

- Destination

  That's the folder where the 'rebuilt' files will be stored. It has to differ from the source folder and - if 'subfolders' is checked - it can't be a subfolder of it (if it's a subfolder, that folder gets skipped). Click the right button to open a folder-browser-dialog. clrmamepro automatically adds a '\' at the end of the name. You don't have to use quotation marks while entering a name which contains spaces. If the destinationfolder doesn't exist, clrmamepro can try to create it. Warning: It can only create one subfolder...So e.g.: If c:\temp\ doesn't exist, clrmamepro can't create c:\temp\test\. By clicking on the button USE 1ST ROMPATH you can set the current destination to the 1st rompath.

- Use Systemdefault Paths
  If you have specified systemdefault paths (-to specify them you should go to the System... dialog), clrmamepro will rebuild the files in them. E.g. NeoGeo files will be rebuilt in 'c:\neogeo'. So...a file of a system will be put in the set systemdefault path. This is a similar option to the Use Add-Paths option. Now you have multiple destination paths.

#### Options

- Compress Files

> Enable this option if the destination files should be compressed. The files will be compressed with the compression level which is set in the settings dialog.

- Recompress Files

> If this option is enabled, the rebuilder will recompress any file with the currently selected compression level. Disabling this option will speed up the rebuilding process dramatically. It will then only copy the compressed data from one archive to another. Of course that means that you may get an archivefile with a different compressionlevel. Use other tools (e.g. Zipmax) then to optimize the files.

- Remove Matched Sourcefiles

  All matched files will be deleted from the sourcefolder. Warning: BACKUP WON'T SAVE THESE FILES ! THEY'LL BE GONE FOREVER ! This option will slow down the rebuilding process ! This option is disabled when using a fixdatfile !

- Show Statistics

  If this option is enabled clrmamepro will show a rebuild summary after the rebuild.

- Rebuild 'nodump' ROMs (0-CRCs)

  If this option is enabled clrmamepro will also rebuild files with a 0 checksum and files which are marked as 'nodump'. Because a valid checksum doesn't exist, clrmamepro will match these files by name and size.

####

#### Systems...

You can select which Systems... you want to (un-)merge. Only active systems will be used.

####

#### Advanced...

Here you can find some advanced Rebuilder options:

- Ignore Filesize

  Normally clrmamepro's rebuilder does a CRC32 + size match to rebuild files. By enabling this option you will ignore the size. Better keep it disabled :O)

- Ignore 'RebuildTo'

> clrmamepro ignores any 'rebuildto' tags in the datfile. All files will only be rebuilt to the destinationfolder. This option isn't available if no 'rebuildto' tags exist.

- Beep When Done

  When the rebuild job is done you hear a little beep...

- Backup Replaced Files

  When this option is enabled, all replaced destination files are moved to the backupfolder.

- Separate BIOS sets

> clrmamepro puts found BIOS-files in the belonging BIOS-sets, if enabled. Otherwise it will rebuilt biosfiles to each single set (not recommended).

- Remove Empty Source Sourcefolders

> Only useful in combination with Rebuilder->remove rebuilt sourcefiles. If you disable this option, empty subfolders (or subfolders which get empty while rebuilding) won't be removed when Rebuilder->remove rebuilt sourcefiles is used.

- Remove Sourcefiles without rebuilding

  This will do a fake rebuild. Nothing is created in the destination folder but all matched files will be deleted from the source. Be careful: The files will be gone!

- Additionally test SHA1/MD5 for matches

  As soon as a file is matched by crc32 + size match, this option will do a further sha1/md5 check (if these hashvalues are available) for verification. Since crc32 + size is easy to fake these days, you should enable this option as well to be really sure. Of course this option slows down the process.

- Skip Creation When File Exists In ROM-Path

> If this option is enabled a found sourcefile won't be created/added in the destination when it already exists in a rompath. Image the following situation: You have a filecollection for a given datfile. Now a new datfile is out and you want to put the new files to a different folder. Some of the old files are needed. If this option is disabled and you will rebuild your old collection you will get doubles because all matched files will be rebuilt. If this option is enabled, only the needed new ones (from the old collection) will be taken....and the really new ones of course. Sounds complicated?...nah..it's useful ;)

- Create Logfile

> If you enable this option you can enter (or browse for...) the name of a logfile. clrmamepro will log which files can be rebuilt and which stay untouched. This option will slow down the rebuilding process !

- Skip complete folder after XXX skipped files:

  This option will skip the currently scanned rebuilder source folder (or any folder when scanning recursively) when a given number of files were skipped during the rebuild.

- Memory used for no "recompress": (auto)

  Here you can specify the amount of RAM (8 to 128MB) which is used for no-recompress rebuilds. If AUTO is enabled, clrmame decides what's the best setting for the currently loaded datfile.

- Dest. Prestring

> If you enable this option you can enter a string in the editbox on the right. If the rebuilder creates a set in the destination, it will use this string as a prestring. So the final path/filename of a rebuilt file is: <rebuilderdestination>\<prestring><setname>(.zip or folder). You can also use some variables inside this string. You can combine them and you can also use "\" if you want to create folders. The variables are:

> - %m - the manufacturer name of the rebuilt set
> - %y - the year of the rebuilt set
> - %b - the biosname of the rebuilt set
> - %s - the sourcefile name" of the rebuilt set
> - %a - the first character of the setname
> - %A - the first character of the setdescription
> - %z and %Z - like %a/%A, but numbers are put in "0-9"
> - %d - the set description
> - %f - the setname
> - %c - the cloneOf tag
> - %C - the sampleOf Tag

> Examples:

> - "%y - " will for example lead to "1980 - pacman.zip
> - %m\" (note the backslash) will rebuild files to a subfolder named after the manufacturer of the rebuilt set. For example "namco\pacman.zip"

#### Drag & Drop Support:

You can drop files and folders to the rebuilder window. clrmamepro will ignore the 'Source' settings and will only rebuild the dropped files to the destination folder. clrmamepro will use the current rebuilder settings (except 'Source') to rebuild the files. If you drop a folder, clrmamepro will rebuild all files from this folder. If you activate 'Recursively Rebuild' and drop a folder it will recursively rebuild this folder (and its subfolders). Illegal folders will be skipped.