Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
disk_image_compression [2023/08/11 13:42] – clean up maionidisk_image_compression [2026/03/27 10:24] (current) – ↷ Links adapted because of a move operation 40.77.167.44
Line 30: Line 30:
   * [[systems:3do]]   * [[systems:3do]]
   * [[systems:dreamcast]]   * [[systems:dreamcast]]
-  * [[systems:segacd]]+  * [[systems:megacd]]
   * [[systems:neogeocd]]   * [[systems:neogeocd]]
   * [[systems:pcenginecd]]   * [[systems:pcenginecd]]
Line 63: Line 63:
 ==== Creating CHDs ==== ==== Creating CHDs ====
  
-''chdman'' is a commmand line application. It can create a ''.chd'' file by targeting ''*.cue'', ''*.iso'' or ''*.gdi'' files.+''chdman'' is a commmand line application. It can create a ''.chd'' file by targeting ''*.cue'', ''*.iso'', ''.nrg'' or ''*.gdi'' files.
  
 If there is a ''*.cue'' file available, use this for creating the ''.chd''. Otherwise choose the ''*.iso'' (Sony PlayStation 2 DVDs) or ''*.gdi'' (Dreamcast GD-ROM) file. Note that GameCube/Wii have their [[#rvz|own compressed format]]. If there is a ''*.cue'' file available, use this for creating the ''.chd''. Otherwise choose the ''*.iso'' (Sony PlayStation 2 DVDs) or ''*.gdi'' (Dreamcast GD-ROM) file. Note that GameCube/Wii have their [[#rvz|own compressed format]].
Line 88: Line 88:
 </code> </code>
  
-Then make yourself a cup of tea. This can take a while. After that you'll have ''<game.chd>'' and you can delete the ''*.cue''/''*.bin'', ''*.iso'' or ''*.gdi''/''*.bin'' file(s).+Then make yourself a cup of tea. This can take a while. After that you'll have ''<game.chd>'' and you can delete the ''*.cue''/''*.bin'', ''*.iso'', ''.nrg'' or ''*.gdi''/''*.bin'' file(s).
  
 The compression is fully lossless so it is possible to redo the compression and get the original files back: The compression is fully lossless so it is possible to redo the compression and get the original files back:
Line 95: Line 95:
 chdman extractcd -i <game.chd> -o <game.cue> chdman extractcd -i <game.chd> -o <game.cue>
 </code> </code>
 +
 +For DVD-based systems, you can use the ''createdvd'' command rather than ''createcd'' in the examples above. It is usually a little more efficient in term of compression (7-10% gain on the resulting ''.chd'' file) but it also provides better performance in-game. 
  
 === CHD batch converting === === CHD batch converting ===
Line 102: Line 104:
 **Linux/macOS:** **Linux/macOS:**
  
-Navigate to the folder that has all your game ROMs and run the following ''for'' loop to convert all the files in one go:+Place the script into your folder that holds your ROMs and execute the script. This will take it's time. So relax....
  
-<code+<file bash allimg-to-chd.sh
-for i in *.cue; do chdman createcd -i "${i}" -o "${i%.*}.chd"; done +#!/usr/bin/env -S bash #PROTECTED 
-</code>+grep -rlq $'\r' "$0" && { dos2unix -k -q "$0"; echo "Script repaired ... please try again"; exit 0; } # Selfrepair for called script 
 +pushd "$(dirname "$0")" 
 +readarray -t array < <(find -maxdepth 1 -type f \( -iname "*.cue" -o -iname "*.iso" -o -iname "*.toc" -o -iname "*.gdi" -o -iname "*.nrg" \) -printf "%p\n"
 +[ -z "${array[@]}" ] && { echo "No disc images found.... Exit now"; exit; } 
 +[ -f "/usr/bin/mame/chdman" ] || { echo "chdman not found! ... Exit now"; exit; } 
 +for i in "${array[@]}"; do 
 +    /usr/bin/mame/chdman createcd -i "${i}" -o "${i%.*}.chd"; 
 +    echo; echo "You can remove file: $i and additionals if you want!" 
 +done 
 +popd 
 +</file>
  
-replacing ''*.cue'' as needed. If you're converting a lot of files, practice some yoga poses. This may take a while.+replacing ''*.cue'' and other images as needed. If you're converting a lot of files, practice some yoga poses. This may take a while.
  
 Here's a command to convert all the games in the current folder and recursive folders to CHD:  Here's a command to convert all the games in the current folder and recursive folders to CHD: 
Line 167: Line 179:
 ==== CDI / NRG / IMG TO CHD ==== ==== CDI / NRG / IMG TO CHD ====
  
-You gonna need chdman version 0138 (extract from mame0138b_64bits.exe https://master.dl.sourceforge.net/project/mame/mame/0.138/mame0138b_64bit.exe) and cdifile 0.5.1 (https://www.cdiemu.org/download/cdifile-0.5.1.zip) [Newer versions of chdman (0139+) are no more compatible with cdifile]+[[https://master.dl.sourceforge.net/project/mame/mame/0.138/mame0138b_64bit.exe|chdman 0.138b]] and below support converting ''.cdi'' files to CHD as well. It requires the additional [[https://www.cdiemu.org/download/cdifile-0.5.1.zip|cdifile]] executable to be in the same directory as it.
  
-Put both file ''chdman.exe'' and ''cdifile.exe''in the same directory+<WRAP center round important> 
 +Newer versions of chdman (0139+) are not compatible with cdifile. 
 +</WRAP>
  
-<code> +Put the files ''chdman.exe'' and ''cdifile.exe''in the same directory
-cdifile.exe +
-chdman.exe +
-</code>+
  
 And run the code line command: And run the code line command:
  
-For Windows+**For Windows:**
 <code> <code>
 cdifile.exe game.cdi -createcd cdifile.exe game.cdi -createcd
Line 186: Line 197:
 </code> </code>
  
-- For Linux (with wine): +These commands can also be run from WINE in any Linux distro.
-<code> +
-wine cdifile.exe game.cdi -createcd +
-wine cdifile.exe game.nrg -createcd +
-wine cdifile.exe game.cue -createcd +
-wine cdifile.exe game.img -createcd +
-</code>+
  
-Note: Test if your game.chd file is working due to chdman used been a older version before delete the original file!+<WRAP center round tip> 
 +It's a good idea to test the game is still working after the conversion before deleting anything. 
 +</WRAP>
  
 ===== CSO ===== ===== CSO =====
Line 244: Line 251:
 **Linux/macOS:** **Linux/macOS:**
  
-<code+<file bash iso-to-cso.sh> 
-for i in *.iso; do maxcso "${i}"; done +#!/bin/bash 
-</code>+for i in *.iso; 
 +do maxcso "${i}"; 
 +done 
 +</file>
  
 **Windows:** **Windows:**
  
-<code>+<file - iso-to-cso.bat>
 for %i in (*.iso) do maxcso.exe "%i" for %i in (*.iso) do maxcso.exe "%i"
-</code>+</file>
  
 === With ciso === === With ciso ===
Line 290: Line 300:
 **Linux/MacOS:** **Linux/MacOS:**
  
-<code+Create a file with these contents... 
-for i in *.iso; do ciso 9 "${i}" "${i}".ciso; done + 
-</code>+<file bash iso-to-ciso.sh> 
 +#!/bin/bash 
 +for i in "$@"; do  
 +    ciso 9 "${i}" "${i%*.iso}".cso; 
 +done 
 +</file> 
 + 
 +...mark it executable with this... 
 + 
 +<code>chmod +x iso-to-ciso.sh</code> 
 + 
 +...and then run it like this: 
 + 
 +<code>./iso-to-ciso.sh *.iso</code>
  
 **Windows:** **Windows:**
  
-<code>+<file - iso-to-ciso.sh>
 for %i in (*.iso) do ciso.exe 9 "%i" "%i".ciso for %i in (*.iso) do ciso.exe 9 "%i" "%i".ciso
-</code>+</file>
  
 ===== PBP ===== ===== PBP =====
Line 419: Line 442:
 **Linux/MacOS:** **Linux/MacOS:**
  
-<code+<file bash iso-to-pbp> 
-for i in *.iso; do psxpackager -l 9 -i "${i}" -o "${i}".pbp; done +#!/bin/bash 
-</code>+for i in *.iso; 
 +do psxpackager -l 9 -i "${i}" -o "${i}".pbp; 
 +done 
 +</file>
  
 Here's a command to convert all the games in the current folder and recursive folders to PBP:  Here's a command to convert all the games in the current folder and recursive folders to PBP: 
-<code>+<file bash all-to-pbp.sh> 
 +find . -name "*iso" -exec psxpackager -l 9 -i {} -o {}.pbp \;
 find . -name "*cue" -exec psxpackager -l 9 -i {} -o {}.pbp \; find . -name "*cue" -exec psxpackager -l 9 -i {} -o {}.pbp \;
-</code>+find . -name "*m3u" -exec psxpackager -l 9 -i {} -o {}.pbp \; 
 +</file>
  
 **Windows:** **Windows:**
  
-<code>+<file - all-to-pbp.bat>
 for %i in (*.iso) do psxpackager.exe -l 9 -i "%i" -o "%i".pbp for %i in (*.iso) do psxpackager.exe -l 9 -i "%i" -o "%i".pbp
-</code>+for %i in (*.cue) do psxpackager.exe -l 9 -i "%i" -o "%i".pbp 
 +for %i in (*.m3u) do psxpackager.exe -l 9 -i "%i" -o "%i".pbp 
 +</file>
  
 OR OR
Line 521: Line 551:
   cd /userdata/roms/dos   cd /userdata/roms/dos
   mksquashfs skweek.pc skweek.pc.squashfs   mksquashfs skweek.pc skweek.pc.squashfs
 +  
 +  cd /userdata/roms/scummvm
 +  mksquashfs "astro chicken" "astro chicken.squashfs" -comp xz
  
 Or to compress a single file : Or to compress a single file :
  • disk_image_compression.1691761366.txt.gz
  • Last modified: 3 years ago
  • by maioni