tochd converter

Convert game ISO and archives to CD CHD for emulation. tochd is a commandline application for the terminal that makes use of the programs 7z and chdman to convert your .iso, .cue and other CD like formats into .chd files. This is a Python 3.10 script written for Linux and won’t probably work on Windows.

tochd --help

Requirements

  • Python 3.10 or newer
  • 7z (available in p7zip package in Archlinux)
  • chdman (available in mame-tools package in Archlinux)

So why do I need this program?

You don’t. Imagine this program as a script (Batch or shell script) that automates some stuff like extraction of files, using correct arguments on the programs it is calling and renames files if necessary. You can perfectly live without it and can use any program to manually extract files from archives such as .zip or .7z files and use the chdman program to convert any file you need. On Windows in example are a few simple .bat files that will do simple automation for you, but they are not as “sophisticated” like my script.

What are .chd files and the CHD format?

CHD was initially developed by the MAME team to represent hard disks (CHD stands for Compressed Hard Disk) from arcade games like Killer Instinct. Since then it got support for other type of media, such as Laser Disc and CD. More and more emulators are adopting this file format.

Some benefits are:

  • one format to care about, instead working with .cue, .gdi, .bin, .wav or .iso files
  • good compression, sometimes as good as .7z files are

Some disadvantages are:

  • Romhacks often require the .cue and .bin files and won’t work with .chd files

How does the program work?

It is just a frontend to automate 7z to extract from archives and chdman to convert to CHD. After installation, just type the command

tochd -q .

to search current directory for known file types and convert each of them to CHD format. New files are created in the same folder as the source files are. The -q option will suppress messages from the other programs and print the current job messages only. With “Ctrl+c” on the keyboard will cancel the current job and start the next one. Check all available options with tochd --help.

Example output

$ cd ~/Downloads/cue
$ tochd -q .
Job 1     Started:	/home/tuncay/Downloads/cue/Vampire Savior (English v1.0).7z
Job 1   Completed:	/home/tuncay/Downloads/cue/Vampire Savior (English v1.0).chd
Job 2     Started:	/home/tuncay/Downloads/cue/3 x 3 Eyes - Sanjiyan Hensei (ACD, SCD)(JPN).zip
Job 2      Failed:	/home/tuncay/Downloads/cue/3 x 3 Eyes - Sanjiyan Hensei (ACD, SCD)(JPN).chd
Job 3     Started:	/home/tuncay/Downloads/cue/Simpsons Wrestling, The (USA).7z
Job 3   Completed:	/home/tuncay/Downloads/cue/Simpsons Wrestling, The (USA).chd
Job 4     Started:	/home/tuncay/Downloads/cue/Shining Wisdom (USA) (DW0355).rar
Job 4   Completed:	/home/tuncay/Downloads/cue/Shining Wisdom (USA) (DW0355).chd

Where can I get the program?

It is a single Python 3.10 script and requires you to have at least that version of Python. There are several ways to install:

  1. From Source: Just download the Source code (.zip or .tar.gz) from Releases page and run the “tochd.py” script after making it executable. The “install.sh” script is for convenience and not required: https://github.com/thingsiplay/tochd/releases . Alternatively get the current state from the repository with git clone https://github.com/thingsiplay/tochd.
  1. From Binary: If you do not have the required minimum Python version, then you can also head over to the Releases page and download a pseudo compiled version which bundles the Python interpreter and script to a single executable file. Those are the archives with the filename part “-bin.7z”: https://github.com/thingsiplay/tochd/releases
  1. From AUR: If you are on an Arch based Linux system, then you can also instead install from the AUR: yay -S tochd or pamac install tochd in example. Alternatively you can also build from the PKGBUILD yourself and install with pacman: https://aur.archlinux.org/packages/tochd