Convert game ISO and archives to CD CHD for emulation on Linux.

Overview

tochd

Convert game ISO and archives to CD CHD for emulation.

What is this program for and what are CHD files?

Automation script written in Python as a frontend to 7z and chdman for converting CD formats into CD CHD.

When you are playing CD based games on RetroArch or possibly on any emulator which supports CHD files, then you might want to convert your ISO and CUE+BIN or GDI files into the CHD format. It has the advantage good compression and produces a single file for each CD. This saves a lot of space and makes organization easier.

To achieve this, the separate program chdman from the MAME tools is invoked, which introduced the CHD format in the first place. Often you need to extract those various CD formats from archives such as .7z or .zip files too. The program 7z is used to extract those files, before handing them over for conversion.

Requirements

The script is written in Python 3.10 for Linux. No other Python module is required. The following external applications are required to run the script:

7z
chdman

On my Manjaro system, they are available in the packages: p7zip mame-tools

Installation

No special installation setup is required, other than the above base requirements. Run the script from any directory you want. Give it the executable bit, rename the script to exclude file extension and put it into a folder that is in the systems $PATH . An installation script "install.sh" is provided, but not required.

If you have an older Python version, then you might want to check the binary release package, which bundles up the script and Python interpreter to create a standalone executable.

Optional: Makefile and PyInstaller (you can ignore this part)

The included "Makefile" is to build the package with the standalone binary. It will create a venv, update stuff in it and run PyInstaller from it. If the process fails, then maybe the system package mpdecimal could be required. At least this was required on my Manjaro system.

Usage

usage: tochd [OPTIONS] [FILE ...]

usage: tochd [-h] [--version] [--list-examples] [--list-formats]
             [--list-programs] [--7z CMD] [--chdman CMD] [-d DIR] [-R] [-p]
             [-t NUM] [-c NUM] [-f] [-q] [-E] [-X] [-]
             [file ...]

This is a commandline application without a graphical interface. The most basic operation is to give it a filename, a list of files or directories to work on. The default behaviour is to convert .iso and .cue+bin and .gdi files to .chd files with same basename in their original folders. Archives such as .7z and .zip are extracted and searched for files to convert. The progress information from 7z and chdman are printed to stdout.

How to use the commandline options

Options start with a dash and everything else is file or folder. In example tochd . will search current working directory for files to convert. Using the option -X like this tochd -X . will just list files without processing them. The option -d DIR specifies a directory to output the created .chd files into. In example tochd -q -d ~/chd ~/Downloads will process all files it can find in the "Downloads" directory and save the resulting .chd files in a folder named "chd" in the users home folder. The -q option means "quiet" and will hide progress information from 7z and chdman, but still print out the current job information from the script itself.

You can also specify filenames directly or use shell globbing * in example to give a list of files over. Usually that is not a problem, but if any filename starts with a dash -, then the filename would be interpreted as an option. But you can use the double dash -- to indicate that anything following the double dash is a filename, regardless what the first character is. In example tochd -- *.7z will process all .7z files in current directory.

Use tochd --help to list all options and their brief description.

Examples

$ tochd --help
$ tochd .
$ tochd -X .
$ tochd ~/Downloads
$ tochd -- *.7z
$ tochd -pfq ~/Downloads | grep 'Completed:' | grep -Eo '/.+$'
$ ls -1 | tochd -

Example output

The following is an output from some files I used to test the program. The failing jobs are supposed to fail, for one or another reason. "Completed" jobs are files that are successfully created. "Failed" jobs point to the path that would have been created.

$ tochd -fq cue iso gdi unsupported .
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
Job 5     Started:	/home/tuncay/Downloads/iso/Parodius_Portable_JPN_PSP-Caravan.iso
Job 5   Completed:	/home/tuncay/Downloads/iso/Parodius_Portable_JPN_PSP-Caravan.chd
Job 6     Started:	/home/tuncay/Downloads/iso/Bust_A_Move_Deluxe_USA_PSP-pSyPSP.iso
Job 6   Completed:	/home/tuncay/Downloads/iso/Bust_A_Move_Deluxe_USA_PSP-pSyPSP.chd
Job 7     Started:	/home/tuncay/Downloads/gdi/[GDI] Metal Slug 6.7z
Job 7   Completed:	/home/tuncay/Downloads/gdi/[GDI] Metal Slug 6.chd
Job 8     Started:	/home/tuncay/Downloads/gdi/[GDI] Virtua Striker 2 (US).7z
Job 8   Completed:	/home/tuncay/Downloads/gdi/[GDI] Virtua Striker 2 (US).chd
Job 9     Started:	/home/tuncay/Downloads/gdi/GigaWing 2.zip
Job 9   Completed:	/home/tuncay/Downloads/gdi/GigaWing 2.chd
Job 10    Started:	/home/tuncay/Downloads/unsupported/Dragon_Ball_Z_Shin_Budokai_USA_PSP-DMU.rar
Job 10     Failed:	/home/tuncay/Downloads/unsupported/Dragon_Ball_Z_Shin_Budokai_USA_PSP-DMU.chd
Job 11    Started:	/home/tuncay/Downloads/unsupported/ActRaiser 2 (USA) (MSU1) [Hack by Conn & Kurrono v4].7z
Job 11     Failed:	/home/tuncay/Downloads/unsupported/ActRaiser 2 (USA) (MSU1) [Hack by Conn & Kurrono v4].chd
Job 12    Started:	/home/tuncay/Downloads/missingfiles.gdi
Job 12     Failed:	/home/tuncay/Downloads/missingfiles.chd

Cancel jobs

At default Ctrl+c in the terminal will abort current job and start next one. Temporary folders and files are removed automatically, but it can't hurt to check manually for confirmation. Temporary folders are hidden starting with a dot in name.

Multiprocessing support

At default all files are processed sequential, only one at a time. Use option -p (short for --parallel) to activate multithreading with 2 threads. This enables the processing of multiple jobs at the same time. Set number of max threads with option -t (short for --threads).

Drawbacks with multiprocessing / parallel option

  • live progress bars and stderror messages of invoked processes from 7z and chdman cannot be provided anymore, as they would have been overlapping on the terminal, but stdout messages such as statistics are still output
  • user input won't be allowed and is automated as much as possible, because overlapping messages could lead to stuck on waiting for input and losing the context to what file it belongs to are potential problems

Additional notes, workarounds and quirks

If you forcefully terminate the script while working, then unfinished files and especially temporary folders cannot be removed anymore. These files and folders can take up huge amount of space! Temporary folders are hidden starting with a dot "." in the name, followed by the name of archive and some random characters added. Make sure these files are deleted, in case you forcefully terminate the script.

Some archives contain multiple folders, each with ISO files of same name. These are usually intended to copy and overwrite files in a main folder as a meaning of patching. However, the script has no understanding and knowledge about this and would try to convert each .iso file on it's own. As a workaround all .iso files in the archive are ignored when a sheet type such as CUE or GDI files are found.

You might also like...
Dcf-game-infrastructure-public - Contains all the components necessary to run a DC finals (attack-defense CTF) game from OOO

dcf-game-infrastructure All the components necessary to run a game of the OOO DC

Torchlight2 lan game server tool - A message forwarding tool for Torchlight 2 lan game

Torchlight 2 Lan Game Server Tool A message forwarding tool for Torchlight 2 lan

MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.

MMdnn MMdnn is a comprehensive and cross-framework tool to convert, visualize and diagnose deep learning (DL) models. The "MM" stands for model manage

A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!
A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

Facial detection, landmark tracking and expression transfer library for Windows, Linux and Mac

Welcome to the CSIRO Face Analysis SDK. Documentation for the SDK can be found in doc/documentation.html. All code in this SDK is provided according t

tf2onnx - Convert TensorFlow, Keras and Tflite models to ONNX.

tf2onnx converts TensorFlow (tf-1.x or tf-2.x), tf.keras and tflite models to ONNX via command line or python api.

Simple helper library to convert a collection of numpy data to tfrecord, and build a tensorflow dataset from the tfrecord.

numpy2tfrecord Simple helper library to convert a collection of numpy data to tfrecord, and build a tensorflow dataset from the tfrecord. Installation

Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron
Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

This is a repository for a No-Code object detection inference API using the OpenVINO. It's supported on both Windows and Linux Operating systems.
This is a repository for a No-Code object detection inference API using the OpenVINO. It's supported on both Windows and Linux Operating systems.

OpenVINO Inference API This is a repository for an object detection inference API using the OpenVINO. It's supported on both Windows and Linux Operati

Comments
  • Add GDI as supported file extension for conversion

    Add GDI as supported file extension for conversion

    chdman supports the conversion of GDI files, a format used by Sega Dreamcast emulators. Adding it to the list of supported ISO file extensions is enough to enable conversion of GDI files to CHD.

    opened by farmerbb 4
Releases(v0.9)
  • v0.9(Jul 6, 2022)

  • v0.8(Mar 30, 2022)

    • new: pseudo compiled bundle of the script with pyinstaller to build a standalone executable, available on Releases page
    • new: "Makefile" script for make to create the standalone bundle of Python script with the Python interpreter and package it into an archive
    • changed: runs with default options -X ., if no options provided
    • some little internal optimizations or additions, such as code comments
    Source code(tar.gz)
    Source code(zip)
    tochd-0.8-bin.7z(7.26 MB)
Owner
Tuncay
Tuncay
Codes for paper "KNAS: Green Neural Architecture Search"

KNAS Codes for paper "KNAS: Green Neural Architecture Search" KNAS is a green (energy-efficient) Neural Architecture Search (NAS) approach. It contain

90 Dec 22, 2022
Code for the paper "Spatio-temporal Self-Supervised Representation Learning for 3D Point Clouds" (ICCV 2021)

Spatio-temporal Self-Supervised Representation Learning for 3D Point Clouds This is the official code implementation for the paper "Spatio-temporal Se

Hesper 63 Jan 05, 2023
SoGCN: Second-Order Graph Convolutional Networks

SoGCN: Second-Order Graph Convolutional Networks This is the authors' implementation of paper "SoGCN: Second-Order Graph Convolutional Networks" in Py

Yuehao 7 Aug 16, 2022
Calibrated Hyperspectral Image Reconstruction via Graph-based Self-Tuning Network.

mask-uncertainty-in-HSI This repository contains the testing code and pre-trained models for the paper Calibrated Hyperspectral Image Reconstruction v

JIAMIAN WANG 9 Dec 29, 2022
Single Image Super-Resolution (SISR) with SRResNet, EDSR and SRGAN

Single Image Super-Resolution (SISR) with SRResNet, EDSR and SRGAN Introduction Image super-resolution (SR) is the process of recovering high-resoluti

8 Apr 15, 2022
Self-supervised Label Augmentation via Input Transformations (ICML 2020)

Self-supervised Label Augmentation via Input Transformations Authors: Hankook Lee, Sung Ju Hwang, Jinwoo Shin (KAIST) Accepted to ICML 2020 Install de

hankook 96 Dec 29, 2022
Securetar - A streaming wrapper around python tarfile and allow secure handling files and support encryption

Secure Tar Secure Tarfile library It's a streaming wrapper around python tarfile

Pascal Vizeli 2 Dec 09, 2022
Composing methods for ML training efficiency

MosaicML Composer contains a library of methods, and ways to compose them together for more efficient ML training.

MosaicML 2.8k Jan 08, 2023
An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax

Simple Transformer An implementation of the "Attention is all you need" paper without extra bells and whistles, or difficult syntax. Note: The only ex

29 Jun 16, 2022
Official implementation for paper: A Latent Transformer for Disentangled Face Editing in Images and Videos.

A Latent Transformer for Disentangled Face Editing in Images and Videos Official implementation for paper: A Latent Transformer for Disentangled Face

InterDigital 108 Dec 09, 2022
Tensorflow AffordanceNet and AffContext implementations

AffordanceNet and AffContext This is tensorflow AffordanceNet and AffContext implementations. Both are implemented and tested with tensorflow 2.3. The

Beatriz PĂ©rez 6 Dec 01, 2022
A script depending on VASP output for calculating Fermi-Softness.

Fermi softness calculation for Vienna Ab initio Simulation Package (VASP) Update 1.1.0: Big update: Rewrote the code. Use Bader atomic division instea

qslin 11 Nov 08, 2022
Clustering with variational Bayes and population Monte Carlo

pypmc pypmc is a python package focusing on adaptive importance sampling. It can be used for integration and sampling from a user-defined target densi

45 Feb 06, 2022
Code for ICCV 2021 paper Graph-to-3D: End-to-End Generation and Manipulation of 3D Scenes using Scene Graphs

Graph-to-3D This is the official implementation of the paper Graph-to-3d: End-to-End Generation and Manipulation of 3D Scenes Using Scene Graphs | arx

Helisa Dhamo 33 Jan 06, 2023
Repository features UNet inspired architecture used for segmenting lungs on chest X-Ray images

Lung Segmentation (2D) Repository features UNet inspired architecture used for segmenting lungs on chest X-Ray images. Demo See the application of the

163 Sep 21, 2022
code and data for paper "GIANT: Scalable Creation of a Web-scale Ontology"

GIANT Code and data for paper "GIANT: Scalable Creation of a Web-scale Ontology" https://arxiv.org/pdf/2004.02118.pdf Please cite our paper if this pr

Excalibur 39 Dec 29, 2022
This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).

The Neural Process Family This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CN

DeepMind 892 Dec 28, 2022
Official NumPy Implementation of Deep Networks from the Principle of Rate Reduction (2021)

Deep Networks from the Principle of Rate Reduction This repository is the official NumPy implementation of the paper Deep Networks from the Principle

Ryan Chan 49 Dec 16, 2022
This is the pytorch implementation for the paper: *Learning Accurate Performance Predictors for Ultrafast Automated Model Compression*, which is in submission to TPAMI

SeerNet This is the pytorch implementation for the paper: Learning Accurate Performance Predictors for Ultrafast Automated Model Compression, which is

3 May 01, 2022
PyMove is a Python library to simplify queries and visualization of trajectories and other spatial-temporal data

Use PyMove and go much further Information Package Status License Python Version Platforms Build Status PyPi version PyPi Downloads Conda version Cond

Insight Data Science Lab 64 Nov 15, 2022