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
Implementation for our AAAI2021 paper (Entity Structure Within and Throughout: Modeling Mention Dependencies for Document-Level Relation Extraction).

SSAN Introduction This is the pytorch implementation of the SSAN model (see our AAAI2021 paper: Entity Structure Within and Throughout: Modeling Menti

benfeng 69 Nov 15, 2022
A new play-and-plug method of controlling an existing generative model with conditioning attributes and their compositions.

Viz-It Data Visualizer Web-Application If I ask you where most of the data wrangler looses their time ? It is Data Overview and EDA. Presenting "Viz-I

NVIDIA Research Projects 66 Jan 01, 2023
FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware.

FIRM-AFL FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware. FIRM-AFL addresses two fundamental problems in IoT fuzzing. First, it

356 Dec 23, 2022
Code for "Unsupervised Source Separation via Bayesian inference in the latent domain"

LQVAE-separation Code for "Unsupervised Source Separation via Bayesian inference in the latent domain" Paper Samples GT Compressed Separated Drums GT

Michele Mancusi 30 Oct 25, 2022
Marvis is Mastouri's Jarvis version of the AI-powered Python personal assistant.

Marvis v1.0 Marvis is Mastouri's Jarvis version of the AI-powered Python personal assistant. About M.A.R.V.I.S. J.A.R.V.I.S. is a fictional character

Reda Mastouri 1 Dec 29, 2021
Pun Detection and Location

Pun Detection and Location “The Boating Store Had Its Best Sail Ever”: Pronunciation-attentive Contextualized Pun Recognition Yichao Zhou, Jyun-yu Jia

lawson 3 May 13, 2022
code for paper -- "Seamless Satellite-image Synthesis"

Seamless Satellite-image Synthesis by Jialin Zhu and Tom Kelly. Project site. The code of our models borrows heavily from the BicycleGAN repository an

Light 14 Apr 05, 2022
SPT_LSA_ViT - Implementation for Visual Transformer for Small-size Datasets

Vision Transformer for Small-Size Datasets Seung Hoon Lee and Seunghyun Lee and Byung Cheol Song | Paper Inha University Abstract Recently, the Vision

Lee SeungHoon 87 Jan 01, 2023
Code used to generate the results appearing in "Train longer, generalize better: closing the generalization gap in large batch training of neural networks"

Train longer, generalize better - Big batch training This is a code repository used to generate the results appearing in "Train longer, generalize bet

Elad Hoffer 145 Sep 16, 2022
:fire: 2D and 3D Face alignment library build using pytorch

Face Recognition Detect facial landmarks from Python using the world's most accurate face alignment network, capable of detecting points in both 2D an

Adrian Bulat 6k Dec 31, 2022
A python package for generating, analyzing and visualizing building shadows

pybdshadow Introduction pybdshadow is a python package for generating, analyzing and visualizing building shadows from large scale building geographic

Qing Yu 13 Nov 30, 2022
[CVPR 2021] MetaSAug: Meta Semantic Augmentation for Long-Tailed Visual Recognition

MetaSAug: Meta Semantic Augmentation for Long-Tailed Visual Recognition (CVPR 2021) arXiv Prerequisite PyTorch = 1.2.0 Python3 torchvision PIL argpar

51 Nov 11, 2022
Colar: Effective and Efficient Online Action Detection by Consulting Exemplars, CVPR 2022.

Colar: Effective and Efficient Online Action Detection by Consulting Exemplars This repository is the official implementation of Colar. In this work,

LeYang 246 Dec 13, 2022
Frequency Spectrum Augmentation Consistency for Domain Adaptive Object Detection

Frequency Spectrum Augmentation Consistency for Domain Adaptive Object Detection Main requirements torch = 1.0 torchvision = 0.2.0 Python 3 Environm

15 Apr 04, 2022
Official implementation of CVPR2020 paper "Deep Generative Model for Robust Imbalance Classification"

Deep Generative Model for Robust Imbalance Classification Deep Generative Model for Robust Imbalance Classification Xinyue Wang, Yilin Lyu, Liping Jin

9 Nov 01, 2022
Collection of common code that's shared among different research projects in FAIR computer vision team.

fvcore fvcore is a light-weight core library that provides the most common and essential functionality shared in various computer vision frameworks de

Meta Research 1.5k Jan 07, 2023
A pure PyTorch implementation of the loss described in "Online Segment to Segment Neural Transduction"

ssnt-loss ℹ️ This is a WIP project. the implementation is still being tested. A pure PyTorch implementation of the loss described in "Online Segment t

張致強 1 Feb 09, 2022
Pathdreamer: A World Model for Indoor Navigation

Pathdreamer: A World Model for Indoor Navigation This repository hosts the open source code for Pathdreamer, to be presented at ICCV 2021. Paper | Pro

Google Research 122 Jan 04, 2023
The open source code of SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation.

SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation(ICPR 2020) Overview This code is for the paper: Spatial Attention U-Net for Retinal V

Changlu Guo 151 Dec 28, 2022
VisualGPT: Data-efficient Adaptation of Pretrained Language Models for Image Captioning

VisualGPT Our Paper VisualGPT: Data-efficient Adaptation of Pretrained Language Models for Image Captioning Main Architecture of Our VisualGPT Downloa

Vision CAIR Research Group, KAUST 140 Dec 28, 2022