Deleting free space at end of chd image to fit on a compact flash - 8GB hd to 2GB CF

retrogamez

Member
Joined
Dec 26, 2012
Messages
370
Reaction score
3
Location
Texas
Deleting free space at end of chd image to fit on a compact flash - 8GB hd to 2GB CF

OK so I couldn't find an answer to this online so after figuring it out after trial and error. I figured I would post my findings. I purchased a San Francisco Rush the Rock arcade. Looking at the hard drive and seeing how old it is that I would convert it to a CF. Here is the problem the hardrive that came in the machine is a 8GB and I have plenty of 2GB CF cards laying around. So i hooked the drive up to my computer and did a:

chdman createhd -i \\.\physicaldrive2 -o sfrushrk.chd -chs 913,255,63
(this chs was written on my hard drive)
To create a chd of my hard drive and after looking at the compression of the sfrushrk.chd file after dumping it with chdman. I estimate the actual size of the game is 650mb. Even though the logical drive is like 7.5GB that is seen when doing a chdman info -i sfrushrk.chd So instead of wasting a 8gb cf or larger drive on it. I decided to look at the the image with a hex editor. Using the latest version of chdman I did a:

chdman extracthd -i sfrushrk.chd -o sfrushrk.raw

to uncompress the chd file. Looking at it in a hex editor you can see at the end of the file is filled with all 0's. Other users suggest to write the chd to a cf and when it fails to pull the CF out and it will still work. Maybe so but I wanted a cleaner way. So I figured that when you create a chd from a physical drive it usually ask you for the chs info so it knows how big the drive is if it can't automatically detect it. Which is what mine did. So I decided to take the decompress raw file i had made and create a new chd file where the logical drive is smaller.
So here is what I did:

chdman createhd -i sfrushrk.raw -o sfrushrkcustom.chd -chs 3128,16,63

the default chs was 913,255,63 which equals a drive of 7,509,680,640 bytes roughly(7.5GB)
my new chs of 3128,16,63 creates a drive of 1,614,348,288 bytes roughly(1.6GB)

Did a quick chdman extracthd -i sfrushrkcustom.chd -o \\.\physicaldrive2 -f

physical drive 2 being my Sandisk ultra 2gb CF card
All went well, popped it into my rush arcade and it booted right up.

So there you go all your have to do is recreate the chd file using new chs values and you can change the logical size of the image. I know an 8GB CF is not that expensive but I figured that someone may have a 20GB, 40GB, or even 80GB ide drive in there arcade as replacement drive come in all different sizes. Since the is the only Hard drive game I own right now, I can't say if it will work with other games such as Area 51 but maybe someon who has another harddrive game can test it out. Hopefully this will help someone else.
 
Last edited:
Lol its funny becuase if you try to find a brand new 2GB CF. Its cost as much as an 8GB CF but I figure like me alot of people would have 2GB laying around doing nothing now and this will save them from the trash bin. As far as speed I see no difference between the CF and the Hard drive but I do feel better knowing that I'm not only dependent on IDE drives only which one day soon will be none existant.
 
I have probably 40 SD cards and 10 smart media cards, only one cf card and that was in my wife's book reader so I had to buy one. :)
 
Back
Top Bottom