Previous Thread
Next Thread
Print Thread
Joined: Sep 2000
Posts: 462
M
Senior Member
OP Offline
Senior Member
M
Joined: Sep 2000
Posts: 462
I've put together a quick step by step guide for updating CHD Files to v5 in OS X using chdman and the Terminal.

Please note that this is not a batch process. If someone wants to create a batch processing utility/script (or better still, a quick and dirty GUI for chdman), please post it here.

In the meantime, for anyone who might feel a bit intimidated by the use of the Terminal... Here you go -

Code:
1) Make a new empty folder (i.e. "CHD Updates")

2) Copy the chdman utility from MAME 0.145u1 or later to the CHD Updates folder (If you don't have chdman available, follow the procedure for compiling MAME, and use the command 'make tools')

3) Open the Terminal Application

4) In Terminal, type 'cd ' (That's the letters c, d, and a space), drag the CHD Updates folder to the terminal window, and press return

5) Move a CHD file (in it's folder) to the CHD Updates folder (Setting the CHD Updates folder view to list makes the following easier)

6) Alter the name of the CHD file you wish to update (I usually place a '-' at the beginning of the file name)

7) Drag chdman to the terminal window, and type 'copy -i ' (copy[space]-i[space])

8) Drag the CHD file (Not the folder) to the Terminal window

9) Type '-o ' (-o[space]  - NOTE that's the letter 'o' NOT the number '0')

10) Drag the CHD file (Not the folder) to the terminal window again

11) Use the left arrow key to move the cursor to the letter before the alteration you made in step 6, and use the delete key to alter the filename to it's original form

12) Press 'Return'

13) Observe the Terminal window. If all went well, chdman will indicate the progress of the operation, and a new CHD file will appear in the CHD file's folder with the proper name

14) When complete, move the original file (The one with the altered name) to the trash

15) (Optional) Color code the folder to indicate the CHD file has been updated

16) Move the folder containing the updated CHD file back into your ROMs directory

17) Repeat steps 5-16 as needed


The following statement is true...
The preceding statement is false.
Joined: May 2008
Posts: 4,899
Q
Very Senior Member
Offline
Very Senior Member
Q
Joined: May 2008
Posts: 4,899
Well, the ROMAlyzer in QMC2's recent SVN revisions supports CHD v5, including automatic updates through 'chdman copy'... but a scripted approach is probably easier for some.


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!
Joined: May 1999
Posts: 576
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 576
I wrote a simple script to automate the process.

Assuming you have all your CHDs in a folder, put the script and chdman 0.145u1 in the same folder. For some reason I have to invoke the script by typing "bash convert.sh" (instead of simply "./convert.sh") on my iMac running Lion 10.7.3.

It will convert a chd to the new v5 format using the original name and adding "_new" add the end. It then deletes the old file and removes the "_new" suffix from the newly created file.

If you don't have a backup of the CHDs, I'd suggest you keep your old format CHDs by removing the appropriate lines in the script.

NB: It seems impossible to add a file to a post, adding the script using code tags:

Code:
#! /bin/bash

array[1]="a51site4/a51site4.chd"
array[2]="alien/alien.chd"
array[3]="arctthnd/arctthnd.chd"
array[4]="arctthndult/uarctict.chd"
array[5]="area51/area51.chd"
array[6]="area51mx/area51mx.chd"
array[7]="area51t/area51t.chd"
array[8]="atronic/atronic.chd"
array[9]="avalon13/gdt-0010c.chd" 
array[10]="avalon20/gdt-0017b.chd"
array[11]="avalons/gdt-0005c.chd" 
array[12]="azumanga/gdl-0018.chd"
array[13]="bam2/bam2.chd" 
array[14]="bassang2/865jaa02.chd"
array[15]="bassangl/765jaa02.chd" 
array[16]="batlgear/batlgear.chd" 
array[17]="batlgr2/bg2_204j.chd" 
array[17]="bdrdown/gdl-0023a.chd" 
array[19]="beachspi/gds-0014.chd" 
array[20]="bikiniko/bikiniko.chd" 
array[21]="biofreak/biofreak.chd" 
array[22]="blitz/blitz.chd" 
array[23]="blitz2k/blitz2k.chd" 
array[24]="blitz99/blitz99.chd" 
array[25]="bm1stmix/753jaa11.chd" 
array[26]="bm2ndmix/853jaa11.chd" 
array[27]="bm3rdmix/825jaa11.chd" 
array[28]="bm4thmix/847jaa11.chd" 
array[29]="bm5thmix/981jaa11.chd" 
array[30]="bm6thmix/a21jaa11.chd" 
array[31]="bm7thmix/b07jaa11.chd" 
array[32]="bmclubmx/993hdda01.chd" 
array[33]="bmcompm2/988jaa11.chd" 
array[34]="bmcompmx/858jaa11.chd" 
array[35]="bmcorerm/a05jaa11.chd" 
array[36]="bmdct/995jaa11.chd" 
array[37]="bmfinal/c01jaa11.chd" 
array[38]="bmiidx/863jaa01.chd" 
array[39]="bmiidx/863jaa04.chd" 
array[40]="bmiidx/c44jaa03.chd" 
array[41]="bmiidx3/992jaa01.chd" 
array[42]="bmiidx4/a03jaa01.chd" 
array[43]="bmiidx6/b4ujaa01.chd" 
array[44]="bmiidx7/b44jaa01.chd" 
array[45]="bmiidx8/c44jaa01.chd"
array[46]="bmiidxc/896jaabm.chd" 
array[47]="bmiidxc2/984a01bm.chd" 
array[48]="bmiidxca/896jabbm.chd" 
array[49]="bntyhunt/bntyhunt.chd" 
array[50]="boxingm/a45a02.chd" 
array[51]="btchamp/btchamp.chd" 
array[52]="btltryst/btltryst.chd" 
array[53]="bujutsu/645c04.chd" 
array[54]="c3_rtime/rtimes.chd" 
array[55]="c3_telly/telly.chd" 
array[56]="calchase/calchase.chd" 
array[57]="calspeed/calspeed.chd" 
array[58]="calspeeda/calspeda.chd" 
array[59]="carnevil/carnevil.chd" 
array[60]="carnevil1/carnevi1.chd" 
array[61]="cartfury/cartfury.chd" 
array[62]="cfield/gdl-0025.chd" 
array[63]="chaoshea/chaosheat.chd" 
array[64]="chaosheaj/chaosheatj.chd" 
array[65]="chocomk/gdl-0014a.chd" 
array[66]="cleoftp/gdl-0012.chd" 
array[67]="cndypuzl/cndypuzl.chd" 
array[68]="code1d/922d02.chd" 
array[69]="code1db/922b02.chd" 
array[70]="comebaby/comebaby.chd" 
array[71]="confmiss/gds-0001.chd" 
array[72]="cr589fw/700b04.chd" 
array[73]="cr589fwa/700a04.chd" 
array[74]="crtaxihr/gdx-0002b.chd" 
array[75]="cryptklr/420uaa04.chd" 
array[76]="csplayh5/csplayh5.chd" 
array[77]="csplayh7/csplayh7.chd" 
array[78]="cvs2gd/gdl-0007a.chd" 
array[79]="cvsgd/gdl-0004.chd" 
array[80]="darkhleg/706jaa02.chd" 
array[81]="ddr2m/895jaa02.chd" 
array[82]="ddr2mc/896jaa01.chd" 
array[83]="ddr2mc2/984jaa01.chd" 
array[84]="ddr2ml/885jaa02.chd" 
array[85]="ddr2ml/885jab01.chd" 
array[86]="ddr2mla/885jaa02.chd" 
array[87]="ddr3ma/887aaa02.chd" 
array[88]="ddr3mj/887jaa02.chd" 
array[89]="ddr3mk/887kba02.chd" 
array[90]="ddr3mka/887kaa02.chd" 
array[91]="ddr3mp/a22jaa02.chd" 
array[92]="ddr4m/a33aaa02.chd" 
array[93]="ddr4mj/a33jaa02.chd" 
array[94]="ddr4mp/a34jaa02.chd" 
array[95]="ddr4mps/a34jba02.chd" 
array[96]="ddr4ms/a33aba02.chd" 
array[97]="ddr4msj/a33jba02.chd" 
array[98]="ddr5m/a27jaa02.chd" 
array[99]="ddra/845aaa02.chd" 
array[100]="ddrbocd/892jaa01.chd" 
array[101]="ddrextrm/c36jaa02.chd" 
array[102]="ddrj/845jba02.chd" 
array[103]="ddrja/845jaa02.chd" 
array[104]="ddrjb/845jab02.chd" 
array[105]="ddrmax/b19jaa02.chd" 
array[106]="ddrmax2/b20jaa02.chd" 
array[107]="ddrs2k/905aaa02.chd" 
array[108]="ddrs2kj/905jaa02.chd" 
array[109]="ddrsbm/894jaa02.chd" 
array[110]="ddrusa/a44uaa02.chd" 
array[111]="dmx/874jaa.chd" 
array[112]="dmx2m/a39jaa02.chd" 
array[113]="dmx2majp/a38jaa02.chd" 
array[114]="dncfrks/874kaa.chd" 
array[115]="drmn/881jad01.chd" 
array[116]="drmn2m/912jab02.chd" 
array[117]="drmn2mpu/912za01.chd" 
array[118]="drmn3m/a23jaa02.chd" 
array[119]="drmn4m/a25jaa02.chd" 
array[120]="drmn4m/a25jba02.chd" 
array[121]="drmn5m/b05jaa02.chd" 
array[122]="drmn5m/b05jba02.chd" 
array[123]="drmn6m/b16jaa02.chd" 
array[124]="drmn6m/b16jba02.chd" 
array[125]="drmn7m/c07jca02.chd" 
array[126]="drmn7m/c07jda02.chd" 
array[127]="drmn7ma/c07jaa02.chd" 
array[128]="drmn7ma/c07jba02.chd" 
array[129]="drmn8m/c38jaa02.chd" 
array[130]="drmn8m/c38jba02.chd" 
array[131]="drmn9m/d09jaa02.chd" 
array[132]="drmn10m/d40jaa02.chd" 
array[133]="drmn10m/d40jba02.chd" 
array[134]="dsem/936eaa.chd" 
array[135]="dsem2/c23eaa02.chd" 
array[136]="dsfdct/910jca02.chd" 
array[137]="dsfdcta/910jaa02.chd" 
array[138]="dsfdr/a37jaa02.chd" 
array[139]="dsftkd/884jaa02.chd" 
array[140]="dstage/845ea.chd" 
array[141]="dygolf/gds-0009a.chd" 
array[142]="ep_pharo/ep_pharo.chd" 
array[143]="evilngt/810uba02.chd" 
array[144]="eztouch/szz_cf.chd" 
array[145]="fbait2bc/865uab02.chd" 
array[146]="fbaitbc/765uab02.chd" 
array[147]="fbaitmc/889ea.chd" 
array[148]="fghtmn/918xxb02.chd" 
array[149]="flipmaze/flipmaze.chd" 
array[150]="fuudol/fuudol.chd" 
array[151]="gamecst2/gamecst2.chd" 
array[152]="gamecstl/gamecstl.chd" 
array[153]="gauntdl/gauntdl.chd" 
array[154]="gauntdl24/gauntd24.chd" 
array[155]="gauntleg/gauntleg.chd" 
array[156]="gauntleg12/gauntl12.chd" 
array[157]="gekpurya/gdt-0008c.chd" 
array[158]="ggxx/gdl-0011.chd" 
array[159]="ggxxac/gdl-0041.chd" 
array[160]="ggxxrl/gdl-0019a.chd" 
array[161]="ggxxsla/gdl-0033a.chd" 
array[162]="ghostsqu/gdx-0012a.chd" 
array[163]="gobyrc/gobyrc.chd" 
array[164]="gtfrk3mb/949jaz02.chd" 
array[165]="gtfrk10m/d10jaa02.chd" 
array[166]="gtfrk10m/d10jab01.chd" 
array[167]="gtfrk10mb/d10jba02.chd" 
array[168]="gtfrk11m/d39jaa02.chd" 
array[169]="gticlub2/941b02.chd" 
array[170]="gtrfrk2m/929jbb02.chd" 
array[171]="gtrfrk3m/949jab02.chd" 
array[172]="gtrfrk3m/949jac01.chd" 
array[173]="gtrfrk4m/a24jaa02.chd" 
array[174]="gtrfrk5m/a26jaa02.chd" 
array[175]="gtrfrk6m/b06jaa02.chd" 
array[176]="gtrfrk7m/b17jaa02.chd" 
array[177]="gtrfrk8m/c08jba02.chd" 
array[178]="gtrfrk8ma/c08jaa02.chd" 
array[179]="gtrfrk9m/c39jaa02.chd" 
array[180]="gtrfrks/886__c02.chd" 
array[181]="gundamos/gdx-0013.chd" 
array[182]="gundmgd/gdl-0001.chd" 
array[183]="gundmxgd/gdl-0006.chd" 
array[184]="gundzaft/sed1dvd0.chd" 
array[185]="haremchl/haremchl.chd" 
array[186]="heatof11/heatof11.chd" 
array[187]="hellngt/810eaa02.chd" 
array[188]="hotd3/gdx-0001.chd" 
array[189]="hydrthnd/hydro.chd" 
array[190]="hyperath/hyperath.chd" 
array[191]="hyperbbc/908a02.chd" 
array[192]="hyprdriv/hyprdriv.chd" 
array[193]="ikaruga/gdl-0010.chd" 
array[194]="initd/gds-0020b.chd" 
array[195]="initdexp/gds-0025.chd" 
array[196]="initdv2e/gds-0027.chd" 
array[197]="initdv2j/gds-0026b.chd" 
array[198]="initdv2jo/gds-0026.chd" 
array[199]="initdv3j/gds-0032c.chd" 
array[200]="initdv3jb/gds-0032b.chd" 
array[201]="jdredd/jdreddc.chd" 
array[202]="jdreddb/jdreddb.chd" 
array[203]="jingystm/gdl-0037.chd" 
array[204]="jnero/jn010108.chd" 
array[205]="jojo/cap-jjk-2.chd" 
array[206]="jojoa/cap-jjk000.chd" 
array[207]="jojoaj/cap-jjk000.chd" 
array[208]="jojoba/cap-jjm-0.chd" 
array[209]="jpark3/b41c02.chd" 
array[210]="junai/junai.chd" 
array[211]="junai2/junai2.chd" 
array[211]="karous/gdl-0040.chd" 
array[212]="kbm/974jaa02.chd" 
array[213]="kbm/974jac01.chd" 
array[214]="kbm2nd/a01jaa01.chd" 
array[216]="kbm2nd/a01jaa02.chd" 
array[217]="kbm3rd/a12jaa01.chd" 
array[218]="kbm3rd/a12jaa02.chd" 
array[219]="kdeadeye/kdeadeye.chd" 
array[220]="keyboard/gds-0017.chd" 
array[221]="kinniku/kn1-b.chd" 
array[222]="kinst/kinst.chd" 
array[223]="kinst2/kinst2.chd" 
array[224]="kollon/kollon.chd" 
array[225]="kollonc/kollonc.chd" 
array[226]="konam80s/826eaa01.chd" 
array[227]="kurucham/gdl-0034.chd" 
array[228]="landhigh/landhigh.chd" 
array[229]="lasstixx/lasstixx.chd" 
array[230]="lsrquiz/lsrquiz.chd" 
array[231]="lsrquiz2/lsrquiz2.chd" 
array[232]="lupinsho/gds-0018.chd" 
array[233]="luptype/gds-0021a.chd" 
array[234]="mace/mace.chd" 
array[235]="macea/macea.chd" 
array[236]="mahjngoh/mahjngoh.chd" 
array[237]="mamboagg/a40jab02.chd" 
array[238]="maxforce/maxforce.chd" 
array[239]="meltyb/gdl-0039.chd" 
array[240]="meltyba/gdl-0039a.chd" 
array[241]="meltybld/gdl-0028c.chd" 
array[242]="mfightc/c09d04.chd" 
array[243]="mfightcc/c09c04.chd" 
array[244]="mgnumber/magicnumber.chd" 
array[245]="mgprem11/mgprem11.chd" 
array[246]="mj2/gdx-0006c.chd" 
array[247]="mj3/gdx-0017d.chd" 
array[248]="mjmania/mjmania.chd" 
array[249]="mocapb/a29b02.chd" 
array[250]="mocapbj/a29a02.chd" 
array[251]="mocapglf/b33a02.chd" 
array[252]="moeru/gdl-0013.chd" 
array[253]="mok/gds-0022.chd" 
array[254]="monkeyba/gds-0008.chd" 
array[255]="mrtlbeat/b47jxb02.chd" 
array[256]="nagano98/nagano98.chd" 
array[257]="nbanfl/nbanfl.chd" 
array[258]="nbashowt/nbashowt.chd" 
array[259]="netchu02/npy1cd0b.chd" 
array[260]="ngdup23a/gds-0023a.chd" 
array[261]="ngdup23c/gds-0023c.chd" 
array[262]="nightrai/nightrai.chd" 
array[263]="odeontw2/odeontw2.chd" 
array[264]="offrthnd/offrthnd.chd" 
array[265]="ollie/gdx-0007.chd" 
array[266]="orbatak/orbatak.chd" 
array[267]="otenamhf/otenamhf.chd" 
array[268]="otenamih/otenamih.chd" 
array[269]="otenki/otenki.chd" 
array[270]="outr2/gdx-0004a.chd" 
array[271]="outr2st/gdx-0014a.chd" 
array[272]="p911/a00uad02.chd" 
array[273]="p911e/a00eaa02.chd" 
array[274]="p911j/a00jac02.chd" 
array[275]="p911kc/a00kac02.chd" 
array[276]="p911uc/a00uac02.chd" 
array[277]="p9112/b11a02.chd" 
array[278]="pbball96/pbball96.chd" 
array[279]="pbballex/802jab02.chd" 
array[280]="pcnfrk3m/a23kaa02.chd" 
array[281]="photoply/pp201.chd" 
array[282]="pnchmn2/a09jaa02.chd" 
array[283]="pnchmna/918jab02.chd" 
array[284]="polystar/623jaa02.chd" 
array[285]="popn2/831jhdda01.chd" 
array[286]="popn5/a04jaa01.chd" 
array[287]="popn5/a04jaa02.chd" 
array[288]="popn7/b00jaa02.chd" 
array[289]="popn7/b00jab01.chd" 
array[290]="popn9/c00jab.chd" 
array[291]="ppd/977kaa01.chd" 
array[292]="ppd/977kaa02.chd" 
array[293]="ppp/977jaa01.chd" 
array[294]="ppp2nd/ppp2nd.chd" 
array[295]="ppp11/gc977jaa01.chd" 
array[296]="ppp11/gc977jaa02.chd" 
array[297]="primrag2/primrag2.chd" 
array[298]="psattack/psattack.chd" 
array[299]="psyvar2/gdl-0024.chd" 
array[300]="psyvaria/psyvaria.chd" 
array[301]="psyvarrv/psyvarrv.chd" 
array[302]="puyofev/gds-0031.chd" 
array[303]="qdrmfgp/gq460a08.chd" 
array[304]="qdrmfgp2/ge557a09.chd" 
array[305]="quake/quakeat.chd" 
array[306]="queen/pqiidediskonmodule.chd" 
array[307]="quizard/quizrd32.chd" 
array[308]="quizqgd/gdl-0017.chd" 
array[309]="quizrd12/quizrd12.chd" 
array[310]="quizrd17/quizrd17.chd" 
array[311]="quizrd18/quizrd18.chd" 
array[312]="quizrd22/quizrd22.chd" 
array[313]="quizrd23/quizrd23.chd" 
array[314]="quizrd34/quizrd34.chd" 
array[315]="quizrr40/quizrr40.chd" 
array[316]="quizrr41/quizrr41.chd" 
array[317]="quizrr42/quizrr42.chd" 
array[318]="racjamdx/676a04.chd" 
array[319]="radirgy/gdl-0032.chd" 
array[320]="raycris/raycris.chd" 
array[321]="rcdego/rcdego.chd" 
array[322]="redearth/cap-wzd-5.chd" 
array[323]="redeartha/cap-wzd-3.chd" 
array[324]="roadburn/roadburn.chd" 
array[325]="rrvac/rrv1-a.chd" 
array[326]="salarymc/gca18jaa.chd" 
array[327]="savquest/savquest.chd" 
array[328]="scg06nt/gdx-0018a.chd" 
array[329]="scptour/scp1cd0.chd" 
array[330]="senko/gdl-0030a.chd" 
array[331]="senkoo/gdl-0030.chd" 
array[332]="senkosp/gdl-0038.chd" 
array[333]="sf2049/sf2049.chd" 
array[334]="sf2049se/sf2049se.chd" 
array[335]="sf2049te/sf2049te.chd" 
array[336]="sfiii/cap-sf3-3.chd" 
array[337]="sfiii2/cap-3ga000.chd" 
array[338]="sfiii3/cap-33s-2.chd" 
array[339]="sfiii3a/cap-33s-1.chd" 
array[340]="sfiii3au/cap-33s-1.chd" 
array[341]="sfish2/sfish2.chd" 
array[342]="sfrush/sfrush.chd" 
array[343]="sfrushrk/sfrushrk.chd" 
array[344]="sfz3ugd/gdl-0002.chd" 
array[345]="shaktamb/gds-0016.chd" 
array[346]="shanghss/shanghss.chd" 
array[347]="shangtou/shanghaito.chd" 
array[348]="shikgam2/gdl-0021.chd" 
array[349]="shikigam/shikigam.chd" 
array[350]="sianniv/sianniv.chd" 
array[351]="simpbowl/simpbowl.chd" 
array[352]="slashout/gds-0004.chd" 
array[353]="sogeki/a13b02.chd" 
array[354]="soulclb2/sc21-dvd0d.chd" 
array[355]="soulclb3/sc31001-na-dvd0-b.chd" 
array[356]="soutenry/soutenry.chd" 
array[357]="specfrce/sf010101.chd" 
array[358]="speeddrv/speeddrv.chd" 
array[359]="spkrbtl/gds-0005.chd" 
array[360]="sprtjam/gds-0003.chd" 
array[361]="spuzbobl/spuzbobl.chd" 
array[362]="spuzboblj/spuzbobj.chd" 
array[363]="ss2005/gdl-0031.chd" 
array[364]="ss2005a/gdl-0031a.chd" 
array[365]="sscopex/a13c02.chd" 
array[366]="starseek/gdl-0005.chd" 
array[367]="sukuinuf/hm-in2.chd" 
array[368]="susume/gv027j1.chd" 
array[369]="taiko9/tk9100-1-na-dvd0-a.chd" 
array[370]="taiko10/tk10100-1-na-dvd0-a.chd" 
array[371]="takoron/gdl-0042.chd" 
array[372]="tekken4/tef1dvd0.chd" 
array[373]="tekken51/te51-dvd0.chd" 
array[374]="tenthdeg/tenthdeg.chd" 
array[375]="tetkiwam/gdl-0020.chd" 
array[376]="tfupdate/gdt-0011.chd" 
array[377]="thenanpa/thenanpa.chd" 
array[378]="thrild2/a41b02.chd" 
array[379]="thrild2a/a41a02.chd" 
array[380]="thrild2c/a41c02.chd" 
array[381]="timecrs3/tst1dvd0.chd" 
array[382]="tokimosh/755jaa01.chd" 
array[383]="tokimosp/756jab01.chd" 
array[384]="tokyocop/tokyocop.chd" 
array[385]="totlvice/639uac01.chd" 
array[386]="totlvicj/639jad01.chd" 
array[387]="trgheart/gdl-0036a.chd" 
array[388]="trizeal/gdl-0026.chd" 
array[389]="truckk/tkk2-a.chd" 
array[390]="tsurugi/a30b02.chd" 
array[391]="tsurugij/a30c02.chd" 
array[392]="turrett/turrett.chd" 
array[393]="undefeat/gdl-0035.chd" 
array[394]="usagi/usagi.chd" 
array[395]="usagiym/gdl-0022.chd" 
array[396]="vaportrx/vaportrx.chd" 
array[397]="vaportrxp/vaportrp.chd" 
array[398]="vathlete/gds-0019.chd" 
array[399]="vcircle/vcircle.chd" 
array[400]="vcop3/gdx-0003a.chd" 
array[401]="vf4/gds-0012.chd" 
array[402]="vf4b/gds-0012b.chd" 
array[403]="vf4c/gds-0012c.chd" 
array[404]="vf4evo/gds-0024b.chd" 
array[405]="vf4evoa/gds-0024a.chd" 
array[406]="vf4tuned/gds-0036f.chd" 
array[407]="vf4tuneda/gds-0036a.chd" 
array[408]="vf4tunedd/gds-0036d.chd" 
array[409]="vs4/gdt-0015.chd" 
array[410]="vs4j/gdt-0013e.chd" 
array[411]="vs2002ex/gdt-0002.chd" 
array[412]="vs2002j/gdt-0001.chd" 
array[413]="vs42006/gdt-0020d.chd" 
array[414]="vstrik3/gds-0006.chd" 
array[415]="vtennis2/gds-0015a.chd" 
array[416]="vtennisg/gds-0011.chd" 
array[417]="wangmd2b/gdx-0016a.chd" 
array[418]="wangmid/gdx-0009b.chd" 
array[419]="wangmid2/gdx-0015.chd" 
array[420]="warfa/warfa.chd" 
array[421]="wargods/wargods.chd" 
array[422]="warzarda/cap-wzd-3.chd" 
array[423]="wcombat/c22d02.chd" 
array[424]="wcombatj/c22a02.chd" 
array[425]="wcombatk/c22c02.chd" 
array[426]="weddingr/weddingr.chd" 
array[427]="wg3dh/wg3dh.chd" 
array[428]="wsbbgd/gds-0010.chd" 
array[429]="xiistag/xiistag.chd" 
array[430]="xtrial/b4xb02.chd" 
array[431]="zgundm/zga1dvd0.chd" 
array[432]="zgundmdx/zdx1dvd0.chd" 
array[433]="zokuoten/zokuoten.chd" 
array[434]="zooo/zooo.chd" 

num_elements=${#array[@]}							# get number of elements in the array

for ((index=1; index<=$num_elements; index++))					# iterate over all the files
do
	echo "Converting ${array[${index}]} (${index} of ${num_elements})"	# display status
	./chdman copy -i ${array[${index}]} -o ${array[${index}]}_new		# convert old format chd to new format and append _new
	rm ${array[${index}]}							# delete old format chd file
	mv ${array[${index}]}_new ${array[${index}]}				# rename newly output chd by removing "_new" suffix
done

Last edited by Carbon; 02/23/12 09:42 AM.
Joined: May 1999
Posts: 576
Senior Member
Offline
Senior Member
Joined: May 1999
Posts: 576
PS: I'm not a command prompt guru, there are probably simpler, shorter and eleganter ways to accomplish the task, but the script worked for me.

Joined: Sep 2006
Posts: 89
M
Member
Offline
Member
M
Joined: Sep 2006
Posts: 89
I'm no guru either, but I am very lazy. smile

I haven't used this yet (.145u1 tools aren't compiling for me), but I did use a variation for the last chd update:

Code:
find . -name '*\.chd' -type f -execdir bash -c 'echo "Working on $1" && mv $1 old_$1 && chdman copy -i old_$1 -o $1 && rm old_$1' {} {} \;


I have chdman in my path, so depending on your setup you may have to change chdman to ./chdman, etc. The old_filename.chd file is only deleted if the conversion succeeds. As Carbon says above, to keep your old chds remove the && rm code. Run it from any directory above your chds.


Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
1 members (Dorando), 53 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,837
Posts116,231
Members4,921
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.5