Wiimm / wiimms-iso-tools

»Wiimms ISO Tools« is a set of command line tools to extract, modify and create Wii and GameCube ISO images and WBFS containers.
https://wit.wiimm.de
106 stars 13 forks source link

Support disc number and version for output name #6

Open rapperskull opened 3 years ago

rapperskull commented 3 years ago

Batch renaming of a collection of ISOs doesn't work very well, since there are some games that span multiple discs and some games that come in multiple versions. I suggest to support new escape sequences to handle these cases. I understand that both the version and the disc number are not always wanted in the filename, so I propose the following:

To explain a little bit better, let's suppose there are the following files in the current directory:

The command wit MOVE -r . '%T%V%D.%E' will rename them to

while wit MOVE --discnum-seq ' ver. %V' --discver-seq ' disc %D' -r . '%T%d%v.%E' will lead to

Ideally also the first disc of game 2 should have the disc number, but that would mean changing the behaviour of wit to check for other discs every time it finds a "disc 1", since disc 1 of a multi-disc game is indistinguishable from a single-disc game.

By specs the disc number is the 7th byte of the header, while the disc version is the following byte. The disc number starts at 0 for disc 1, while the version is usually indicated as 1.## where ## is the version byte (in decimal). For example a value of 0x01 corresponds to 1.01, while 0x0A to 1.10. I suggest to handle values greater than 99 by changing the first digit (for example 0x6B becomes 2.07).

I don't know if these two values are stored in other formats other than ISO, but I think so.

Thank you for your consideration and for this awesome tool.