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
cd_image_formats [2021/08/22 02:32] – formatting, added subfolder info to multi-disc ataricd_image_formats [2022/10/01 04:15] (current) atari
Line 3: Line 3:
 Disc images/ROMs come in a variety of formats, and over the years many formats have risen and fallen in popularity. This article focuses on the more common ones you may come across. Disc images/ROMs come in a variety of formats, and over the years many formats have risen and fallen in popularity. This article focuses on the more common ones you may come across.
  
-<WRAP center round info 60%>+<WRAP center round info>
 For information on compressed disk images take a look at [[disk_image_compression|Disc image compression]]. For information on compressed disk images take a look at [[disk_image_compression|Disc image compression]].
 </WRAP> </WRAP>
Line 9: Line 9:
 ===== What are disc images? ===== ===== What are disc images? =====
  
-Disc images are a handy way of storing backup copies of your disks. For instance, you might have some Audio CDs which you play on a regular basis. You probably don't want them to wear out fast because you use them often. In that case, a good way to listen to them but also keep them in a pristine condition - because you will actually not use them - is to create disc images for them. The disk images can be stored on your computer and you can simply mount them when you want to listen to your music. Obviously, you can rip their contents into another format such as ''.mp3'', but that's another story.+Disc images are a handy way of storing backup copies of your disks. For instance, you might have some Audio CDs which you play on a regular basis. You probably don't want them to wear out fast because you use them often. In that case, a good way to listen to them but also keep them in a pristine condition - because you will actually not use them - is to create disc images for them. The disk images can be stored on your computer and you can virtually mount them when you want to listen to your music. Obviously, you can rip their contents into another format such as ''.mp3'', but that's another story.
  
-The usefulness of creating disk images for your Audio CDs is just an example, but there are more situations in which disk images prove their worth. For instance, some software vendors choose to deliver their programs as disk images, which you can download from the Internet. A very good example of that are operating systems, which are often delivered online under the form of disk images. That's because disk images are exact replicas of physical DVD disks, and because installing an operating system usually means you have to have it on a bootable diskIf you get the operating system as a disk image, which is a single file that you can download from the Internet, you can then burn it on CD or DVD and, finally, you can use it to boot and install the operating system.+Batocera can these disc images to load the contents of a game ROM into an emulator as it would have done so on the actual hardwareThis is considered the most accurate way of loading the content. Fun fact: Batocera itself comes as a disc imageyou're just using Etcher to burn that image onto drive!
  
 To sum it a bit up, here are some of the most prominent benefits of using disk images: To sum it a bit up, here are some of the most prominent benefits of using disk images:
-    * Disk images are exact replicas of disk drives or disk volumes, so they faithfully preserve all details related not only to content but also to the original files and folders structure; +    * Disk images are exact replicas of disk drives or disk volumes, so they faithfully preserve all details related not only to content but also to the original files and folders structure. 
-    * A disk image of an optical disk can be very useful when you need to create multiple copies of that disk; +    * A disk image of an optical disk can be very useful for backing up purposes.
-    * A disk image of a hard drive that contains a Windows operating system can be used to reinstall Windows very fast; +
-    * A disk image of a hard disk or of an optical disk has the big advantage of portability. Being a single file it is very easy to send it online to others or store it on an external hard disk drive, for instance.+
  
 ===== Common file formats for disk images ===== ===== Common file formats for disk images =====
Line 27: Line 25:
   * ''.mdf'' and ''.mds'' (Media disk Image File and Media Descriptor File) - the CD or DVD data is stored inside the ''.mdf'' file, while the header and track information are stored in the ''.mds'' file.   * ''.mdf'' and ''.mds'' (Media disk Image File and Media Descriptor File) - the CD or DVD data is stored inside the ''.mdf'' file, while the header and track information are stored in the ''.mds'' file.
  
-<WRAP center round info 40%>+<WRAP center round info>
 This information has been surmised from https://www.digitalcitizen.life/simple-questions-what-disc-image-file-iso-nrg-bin and https://en.wikipedia.org/wiki/ISO_image This information has been surmised from https://www.digitalcitizen.life/simple-questions-what-disc-image-file-iso-nrg-bin and https://en.wikipedia.org/wiki/ISO_image
 </WRAP> </WRAP>
Line 77: Line 75:
 To automatically load the next disc of a game, you can use a ''.m3u'' playlist file. To automatically load the next disc of a game, you can use a ''.m3u'' playlist file.
  
-<WRAP center round important 60%+<WRAP center round important> 
-Please note that even if ''_info.txt'' says ''.m3u'' is a supported format, not all standalone emulators support loading discs in this way. All libretro cores should support it, though.+Please note that even if ''_info.txt'' says ''.m3u'' is a supported format, not all standalone emulators/Libretro cores support loading discs in this way.
 </WRAP> </WRAP>
  
-To make one, simply create a text file with the same filename as your intended game name (this is what will appear in your game list. It could be anything, really). Within that text file, write the names of the ''.cue''/''.gdi''/''.mdf'' sheets or ''.chd'' files for your game discs. For instance, if your game's .cue sheets were structured like:+To make one, simply create a text file with the same filename as your intended game name (this is what will appear in your game list. It could be anything, really). Within that text file, write the names of the ''.cue''/''.gdi''/''.mdf'' sheets or ''.chd'' files for your game discs
 + 
 +<WRAP center round important> 
 +If creating the playlist file with Windows, be aware of the [[https://wiki.batocera.org/github-desktop#note_for_windows_users|line ending limitations]]For most systems, this does not matter, but some will only read playlist files if they use Linux-style line terminators. 
 +</WRAP> 
 + 
 +<WRAP center round info> 
 +Batocera will automatically hide duplicated entries showing in the gamelist when using playlists to define which discs are a part of a single game. However, this will only work when the playlists are referencing just the filenames; relative pathing will override this behaviour and show all discs. To put it simply: 
 + 
 +  * ''filename.cue'' -> hide this disc 
 +  * ''./filename.cue'' -> don't hide this disc 
 +</WRAP> 
 + 
 +==== All the files inside of the applicable ROM folder ==== 
 + 
 +For instance, if your game's .cue sheets were structured like:
  
 <code> <code>
 roms/ roms/
-─ psx/ +─ psx/
-   ├─ Final Fantasy VII (Disc 1).cue+
    ├─ Final Fantasy VII (Disc 1).bin    ├─ Final Fantasy VII (Disc 1).bin
-   ├─ Final Fantasy VII (Disc 2).cue+   ├─ Final Fantasy VII (Disc 1).cue
    ├─ Final Fantasy VII (Disc 2).bin    ├─ Final Fantasy VII (Disc 2).bin
-   ├─ Final Fantasy VII (Disc 3).cue+   ├─ Final Fantasy VII (Disc 2).cue
    ├─ Final Fantasy VII (Disc 3).bin    ├─ Final Fantasy VII (Disc 3).bin
 +   └─ Final Fantasy VII (Disc 3).cue
 </code> </code>
  
 you would put the following as text into the ''Final Fantasy VII.m3u'' text file: you would put the following as text into the ''Final Fantasy VII.m3u'' text file:
  
-<file>+<file text| Final Fantasy VII.m3u>
 Final Fantasy VII (Disc 1).cue Final Fantasy VII (Disc 1).cue
 Final Fantasy VII (Disc 2).cue Final Fantasy VII (Disc 2).cue
Line 102: Line 115:
 </file> </file>
  
-Save the text file with the file extension .m3u and place it in the ''psx'' folder along with the game's discs. Your final folder structure should look like this:+Save the text file with the file extension ''.m3u'' and place it in the same folder as the game's discs. Your final folder structure should look like this:
  
 <code> <code>
 roms/ roms/
-─ psx/+─ psx/
    ├─ Final Fantasy VII.m3u    ├─ Final Fantasy VII.m3u
-   ├─ Final Fantasy VII (Disc 1).cue 
    ├─ Final Fantasy VII (Disc 1).bin    ├─ Final Fantasy VII (Disc 1).bin
-   ├─ Final Fantasy VII (Disc 2).cue+   ├─ Final Fantasy VII (Disc 1).cue
    ├─ Final Fantasy VII (Disc 2).bin    ├─ Final Fantasy VII (Disc 2).bin
-   ├─ Final Fantasy VII (Disc 3).cue+   ├─ Final Fantasy VII (Disc 2).cue
    ├─ Final Fantasy VII (Disc 3).bin    ├─ Final Fantasy VII (Disc 3).bin
 +   └─ Final Fantasy VII (Disc 3).cue
 </code> </code>
  
-In case you have your disc images inside of subfolders, and you'd like your ''.m3u'' to be one level above, you can append a period (.) followed by the folder directory relative to the ''.m3u'''s location. For instance if you wanted your folder structure to look like this:+==== A subfolder for each multi-disc game ==== 
 + 
 +You can opt to put all of your multi-disc games in their own subfolders instead for organization purposes. Like so: 
 + 
 +<code> 
 +roms/ 
 +└─ psx/ 
 +   └─ Final Fantasty VII/ 
 +      ├─ Final Fantasy VII (Disc 1).bin 
 +      ├─ Final Fantasy VII (Disc 1).cue 
 +      ├─ Final Fantasy VII (Disc 2).bin 
 +      ├─ Final Fantasy VII (Disc 2).cue 
 +      ├─ Final Fantasy VII (Disc 3).bin 
 +      └─ Final Fantasy VII (Disc 3).cue 
 +</code> 
 + 
 +<WRAP center round tip> 
 +In the case that you've organized your ROMs like this, you can use the following scripts/SSH commands to automatically generate the M3U playlists and put them into the appropriate subfolders: 
 +--> Click to expand# 
 +  * **[[:access_the_batocera_via_ssh|via SSH]]** <wrap em>TENTATIVE (needs some more testing, run at your own risk!)</wrap>First, change the current directory to the system's ROM folder with ''cd <path/to/folder>''. For example: <code> 
 +cd /userdata/roms/psx 
 +</code> 
 +    * For ''.cue'' files: 
 +      * Run the following: <code bash> 
 +for DIR in *; do echo "$(for file in "$DIR"/*.cue; do echo "$(basename "$file")"; done)" > "$DIR"/"$DIR".m3u; done 
 +</code> 
 +    * For ''.chd'' files: 
 +      * Just run the following: <code bash> 
 +for DIR in *; do echo "$(for file in "$DIR"/*.chd; do echo "$(basename "$file")"; done)" > "$DIR"/"$DIR".m3u; done 
 +</code> 
 + 
 +  * **Accessible the drive directly on Windows** Place the script in the ''roms/<system>'' folder and double-click/execute it. If you want to apply this to //all// CUE and/or CHD multi-disc games in all systems, run it from ''roms/'' instead. 
 +    * For NTFS userdata filesystems: 
 +      * For ''.cue'' files: <file - ntfs-generate-m3u-for-cue-in-subfolders.bat> 
 +@echo off 
 +for /R "%~dp0" %%I in (*.cue) do for %%J in ("%%~dpI.") do echo %%~nxI>>"%%~dpI%%~nxJ.m3u" 
 +</file> 
 +      * For ''.chd'' files: <file - ntfs-generate-m3u-for-chd-in-subfolders.bat> 
 +@echo off 
 +for /R "%~dp0" %%I in (*.chd) do for %%J in ("%%~dpI.") do echo %%~nxI>>"%%~dpI%%~nxJ.m3u" 
 +</file> 
 +    * For FAT userdata filesystems: 
 +      * For ''.cue'' files: <file - fat-generate-m3u-for-cue-in-subfolders.bat> 
 +@echo off 
 +for /F "eol=| delims=" %%I in ('dir "%~dp0*.cue" /A-D-H /B /ON /S 2^>nul') do for %%J in ("%%~dpI.") do echo %%~nxI>>"%%~dpI%%~nxJ.m3u" 
 +</file> 
 +      * For ''.chd'' files: <file - fat-generate-m3u-for-chd-in-subfolders.bat> 
 +@echo off 
 +for /F "eol=| delims=" %%I in ('dir "%~dp0*.chd" /A-D-H /B /ON /S 2^>nul') do for %%J in ("%%~dpI.") do echo %%~nxI>>"%%~dpI%%~nxJ.m3u" 
 +</file> 
 + 
 +From: https://forums.launchbox-app.com/topic/53467-batch-file-to-auto-generate-m3us/ 
 + 
 +<-- 
 +</WRAP> 
 + 
 +The M3U ''Final Fantasy VII.m3u'' playlist should contain the following: 
 + 
 +<file text| Final Fantasy VII.m3u> 
 +Final Fantasy VII (Disc 1).cue 
 +Final Fantasy VII (Disc 2).cue 
 +Final Fantasy VII (Disc 3).cue 
 +</file> 
 + 
 +If doing this by hand, save the text with the file extension ''.m3u'' and **place it in that multi-disc game's specific subfolder**. If using the automated BAT script, the files are automatically placed in the correct subfolders. Your final folder structure should look like this: 
 + 
 +<code> 
 +roms/ 
 +└─ psx/ 
 +   └─ Final Fantasty VII/ 
 +      ├─ Final Fantasy VII.m3u 
 +      ├─ Final Fantasy VII (Disc 1).bin 
 +      ├─ Final Fantasy VII (Disc 1).cue 
 +      ├─ Final Fantasy VII (Disc 2).bin 
 +      ├─ Final Fantasy VII (Disc 2).cue 
 +      ├─ Final Fantasy VII (Disc 3).bin 
 +      └─ Final Fantasy VII (Disc 3).cue 
 +</code> 
 + 
 +==== A subfolder for each disc ==== 
 + 
 +In case you want to have your disc images inside of separate subfolders, and you'd like your ''.m3u'' to be one level above, you can append a period (.) followed by the folder directory relative to the ''.m3u'''s location for each line in the ''.m3u'' file. For instance if you wanted your folder structure to look like this:
  
 <code> <code>
 roms/ roms/
-─ psx/+─ psx/
    ├─ Final Fantasy VII (Disc 1)/    ├─ Final Fantasy VII (Disc 1)/
-      ├─ sheet.cue +   │  ├─ disc.bin 
-      ├─ disc.bin+   │  └─ sheet.cue
    ├─ Final Fantasy VII (Disc 2)/    ├─ Final Fantasy VII (Disc 2)/
-      ├─ sheet.cue +   │  ├─ disc.bin 
-      ├─ disc.bin+   │  └─ sheet.cue
    ├─ Final Fantasy VII (Disc 3)/    ├─ Final Fantasy VII (Disc 3)/
-      ├─ sheet.cue +   │  ├─ disc.bin 
-      ├─ disc.bin +   │  └─ sheet.cue 
-   ─ Final Fantasy VII.m3u+   ─ Final Fantasy VII.m3u
 </code> </code>
  
 you would put the following as text into the ''Final Fantasy VII.m3u'' file: you would put the following as text into the ''Final Fantasy VII.m3u'' file:
  
-<file>+<file text| Final Fantasy VII.m3u>
 ./Final Fantasy VII (Disc 1)/sheet.cue ./Final Fantasy VII (Disc 1)/sheet.cue
 ./Final Fantasy VII (Disc 2)/sheet.cue ./Final Fantasy VII (Disc 2)/sheet.cue
Line 141: Line 235:
 </file> </file>
  
-Batocera should show you the ''.m3u'' as a single game entry (in v31 and up) which will contain all discs. When you get to the end of the disc you are playing, the next disc will be automatically loaded. In case this fails (for libretro cores), you can utilize Retroarch''Disc Controlmenu in the Quick Menu (Hotkey+{{:wiki:south.png?nolink&20|South button (B SNES)}} button in-game) to eject a disc and insert another (Swap Disc is for legacy purposes and should not be used).+<WRAP center round tip> 
 +If you set it up with separate subfolders for each disc, Batocera will display duplicate entries! It can only recognize and remove extra discs for a single game if they are in the same folder. Alternatively, you can [[#a_subfolder_for_each_multi-disc_game|just have a single folder for all that game's discs]] along with the ''.m3u'' file and only the ''.m3u'' file will appear. 
 +</WRAP> 
 + 
 +==== After setting up your M3U playlists correctly ==== 
 + 
 +Batocera should show you the ''.m3u'' as a single game entry (in **v31** and up) which will contain all discs. When you get to the end of the disc you are playing, the next disc will be automatically loaded. 
 + 
 +M3U playlist automatic disc control is confirmed to be working with the following emulators: 
 +  * PSX 
 +    * Libretro/PCSX-ReARMed 
 +    * DuckStation 
 +    * Libretro/DuckStation 
 +  * SegaCD 
 +  * SEGA Saturn 
 +  * SEGA Dreamcast 
 + 
 +==== Manual disc swapping ==== 
 + 
 +In case the automatic disc swapping fails, refer to these manual disc swapping instructions below. 
 + 
 +=== RetroArch (most libretro cores) === 
 + 
 +You can utilize RetroArch'**Disc Control** menu in the Quick Menu (''[HOTKEY]'' + {{:wiki:south.png?nolink&20|South button (B SNES)}} button in-game). Select **Eject Disc**, then go to **Current Disc Index** and change your disc to the next one. Then, **Insert Disc** to continue the game. 
 + 
 +<WRAP center round alert 60%> 
 +**Swap Disc** is for legacy purposes and should not be used
 +</WRAP> 
 + 
 +The following cores are confirmed to not be working with the disc control menu: 
 +  * SEGA Saturn 
 +    * Libretro/Yabause 
 + 
 +=== DuckStation (standalone=== 
 + 
 +You'll need a keyboard for this method. While playing the game, press ''[Alt]''+''[Tab]'' to switch focus to the standalone emulator config. Then, using your mouse, click on "Change Disc" or navigate to **System** > **Change Disc** > **From Playlist...** and choose the next disc. 
 + 
 +{{:duckstation-swap-disc.png|Screenshot showing the DuckStation UI.}} 
 + 
 +=== libretro: Opera (3DO) === 
 + 
 +From Batocera **v34**, enable the **NVRAM STORAGE** option from the advanced system settings (''[SELECT]'' in the game list) for the multi-disc game's discs to allow them to automatically use the same save file. Then load the second disc from ES after completing the first one. Do note that this shared storage has the real-world limitations of the 3DO's drive space. 
  • cd_image_formats.1629599541.txt.gz
  • Last modified: 5 years ago
  • by atari