Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Converting MAME CHD's from version 0.29 to 0.32 - Help required please  (Read 4577 times)

0 Members and 1 Guest are viewing this topic.

Dariusz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:November 23, 2018, 02:41:36 pm
  • I want to Build My Own Arcade Controls!!
Hi There,

I read somewhere that the format of the CHD's have changes recently, and I would like to convert the CHD's I have from 0.29 to 0.32.

With so many CHD's in 0.29 what is the best method of converting the CHD's to the new format?

All of my CHD's are in one  directory, with each CHD in its own sub directory. Is there a DOS command or tool I can use to convert all of the CHD's in one go to a new directory location without modifing the existing CHD's/directories so that I have a backup just in case anything goes wrong.

Thank you in advance for any assistance provided.

Kiind Regards,

Dariusz

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 15, 2025, 09:27:36 pm
not sure but i had to download the whole thing back again.... good luck

9innail

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 49
  • Last login:September 22, 2011, 11:18:53 am
Here is the script.
Note:You must have chdman and everything in the proper directories to work. I had to edit the script slightly to match my installation.And of course save the script to a .bat file.

@echo off
set old_dir=C:\MameUI64\roms
set new_dir=C:\MameUI64\roms
set chdman=chdman.exe
for /F %%a in ('dir /b /a:d %old_dir%^|find /v "_ReadMe_.txt"') DO (
for /F %%b in ('dir /b "%old_dir%\%%a"') do (
echo Converting: %%b
chdman -update "%old_dir%\%%a\%%b" "%new_dir%\%%a\%%b"n
del "%old_dir%\%%a\%%b"
ren "%new_dir%\%%a\%%b"n "%%b"
)
)

 :afro:


abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 15, 2025, 09:27:36 pm
do   :banghead:

Dariusz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:November 23, 2018, 02:41:36 pm
  • I want to Build My Own Arcade Controls!!
Hi 9innail,

Thank you for the script.

I've tried it today, and I seam I cannot get it working as I get errors when I run the scrip in cmd. I hope you or anyone else can identify what the problem is I have:

The modified script is:

@echo off
set old_dir=H:\mamechdsold
set new_dir=H:\mamechdsnew
set chdman=chdman.exe
for /F %%a in ('dir /b /a:d %old_dir%^|find /v "_ReadMe_.txt"') DO (
for /F %%b in ('dir /b "%old_dir%\%%a"') do (
echo Converting: %%b
chdman -update "%old_dir%\%%a\%%b" "%new_dir%\%%a\%%b"n
del "%old_dir%\%%a\%%b"
ren "%new_dir%\%%a\%%b"n "%%b"
)
)

The script has been saved as chdconvert.bat

The chdman.exe I placed in the root directory of H\, ie. h:\chdman.exe

When I run the chdconvert.bat script in cmd under h:\ I get the following output:

Converting: c22c02.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\wcombak\c22c02.chd
Output file:  H:\mamechdsnew\wcombak\c22c02.chdn
Error creating CHD file: file not found
The system cannot find the file specified.
Converting: c22d02.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\wcombat\c22d02.chd
Output file:  H:\mamechdsnew\wcombat\c22d02.chdn
Error creating CHD file: file not found
The system cannot find the file specified.
Converting: weddingr.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\weddingr\weddingr.chd
Output file:  H:\mamechdsnew\weddingr\weddingr.chdn
Error creating CHD file: file not found
The system cannot find the file specified.
Converting: wg3dh.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\wg3dh\wg3dh.chd
Output file:  H:\mamechdsnew\wg3dh\wg3dh.chdn
Error creating CHD file: file not found
The system cannot find the file specified.
Converting: gds-0010.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\wsbbgd\gds-0010.chd
Output file:  H:\mamechdsnew\wsbbgd\gds-0010.chdn
Error creating CHD file: file not found
The system cannot find the file specified.
Converting: b4xb02.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\xtrial\b4xb02.chd
Output file:  H:\mamechdsnew\xtrial\b4xb02.chdn
Error creating CHD file: file not found
The system cannot find the file specified.

H:\>

Any help to identify the problem is kindly appreciated.

Thank you again in advance for any help,

Kind Regards,

Dariusz

9innail

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 49
  • Last login:September 22, 2011, 11:18:53 am
It seems to me that the problem is the directories.
Is the location of the original chd's H:\mamechdsold?
and the chdman.exe would need to be in  H:\mamechdsold If I remember correctly.
If you want to keep a copy of the originals I would copy the chd directory then set the script to that directory for old and new and put the chdman.exe in the root of that directory then everything should work out.
 :dunno

Dariusz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:November 23, 2018, 02:41:36 pm
  • I want to Build My Own Arcade Controls!!
9innail,

After having posted my post earlier, I just noticed that the scrip had deleted all of the CHDs in the sub directories of the directory H:\mamechdsold (source directory).....

I do not know what has happen or WHY?  The script does'nt delete file does it???

Lucky I had backed up my CDD's befor progressing.

My last attempt which the error I posted earlier I had chdman.exe located in H:\chdman.exe as well as my script H:\chdconvert.bat.

I atempt now to re-run the script, but this time I have chdman.exe and the script (chdconvert.bat) located in the CHD source directory being H:\mamechdsold ie:

H:\mamechdsold\chdman.exe
H:\mamechdsold\chdconvert.bat

If any one know why my original CHD were deleted after running my realier script, It would be of great help. Hopfully the problem will not occure if I modify to the above item as indicated.

I'll post again once I have re run the script.

Thanks,

Kind Regards,

Dariusz
 

Dariusz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:November 23, 2018, 02:41:36 pm
  • I want to Build My Own Arcade Controls!!
OK,

I've just  re attempted again to convert the CHDs with the same result being I get the following message being displayed for all CHDs being:

"
Converting: b4xb02.chd
chdman - MAME Compressed Hunks of Data (CHD) manager 0.132 (Jun  8 2009)
Input file:   H:\mamechdsold\xtrial\b4xb02.chd
Output file:  H:\mamechdsnew\xtrial\b4xb02.chdn
Error creating CHD file: file not found
The system cannot find the file specified.

H:\mamechdsold>
"
I get the above message once I've placed the following files into the CHD source directory, being:

"
H:\mamechdsold\chdman.exe
H:\mamechdsold\chdconvert.bat
"

I do not understand why I get the following error mesage when attempting to convert all CHDs beiing:

"
Error creating CHD file: file not found
The system cannot find the file specified.
"

If any one can be of assistance, to determine my problem, its appreciated.

I have also realised why on my first atempt running the script, my all of me CHDs in the source directory got deleted. It was because the the following line was in the script:

del "%old_dir%\%%a\%%b"

I have since remove the line from the script, and hope the only purpose was to delete the sourse CHD and no other....

Again any help is appreciated,

Dariusz

soup

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 40
  • Last login:March 29, 2025, 08:29:16 am
Re: Converting MAME CHD's from version 0.29 to 0.32 - Help required please
« Reply #8 on: September 22, 2009, 09:05:40 am »
....If any one can be of assistance, to determine my problem, its appreciated.....


Sorry bout digging up an old thread, but stumbled on this post in trying to achieve the same thing (mass chd conversion) and thought I may be able to answer the above issue in case anybody else discovers this post and wants to use the script.

Anyhoo, from the OP's error they are receiving I am guessing that they have created a new directory for the "new_dir" variable yet have left it empty (ie - doesnt contain folders named the same as the CHD folders in the old directory).

I had the same issue whereby I wanted to output the converted CHD's to a brand new location but didn't want to manually created 30 odd empty folders manually. One way to overcome this is to populate the new folder directory with empty folders named identically to those CHD folders in the old folder location ("old_dir") by using the command "MKDIR "%new_dir%\%%a" in the script before it executes the chdman command.

BTW - I don't think the following is required in the script, but have left them in for the time being,:
1. "|find /v "_ReadMe_.txt" - this ignores the "_ReadMe_.text" file, but it wouldn't look in it anyway as its not a folder
2. You won't need the 'n' at the end of "chdman -update "%old_dir%\%%a\%%b" "%new_dir%\%%a\%%b"n" as you are copying to a new location.
3. Same reason as above, you won't need the line "ren "%new_dir%\%%a\%%b"n "%%b""
i.e:

Code: [Select]
@echo off
set old_dir=H:\mamechdsold
set new_dir=H:\mamechdsnew
set chdman=chdman.exe
for /F %%a in ('dir /b /a:d %old_dir%^|find /v "_ReadMe_.txt"') DO (
for /F %%b in ('dir /b "%old_dir%\%%a"') do (
echo Converting: %%b
MKDIR "%new_dir%\%%a"
chdman -update "%old_dir%\%%a\%%b" "%new_dir%\%%a\%%b"n
del "%old_dir%\%%a\%%b"
ren "%new_dir%\%%a\%%b"n "%%b"
)
)



Hope this helps :) (and works lol)