verifydump icon indicating copy to clipboard operation
verifydump copied to clipboard

Add Convert Option to Redump bin/cue format

Open Immersion95 opened this issue 3 years ago • 13 comments

This tool is a godsend (apart from problems I have verifying some NGCD games).

Would it be possible to have an option to convert from chd to Redump multiple bin/cue ? There isn't any tool doing that.

Immersion95 avatar May 28 '22 08:05 Immersion95

Thanks very much for the suggestion. There is actually some code in the project for doing that conversion for testing purposes, but it's disabled because it needs tidying up and documenting. If you're comfortable with Python you can test it out by uncommenting this line in pyproject.toml: https://github.com/j68k/verifydump/blob/6d3c21fe6e4985ce01a2a47935dd25a459d2c936/pyproject.toml#L33 Then when you reinstall the package (with pip or Poetry or whatever) you'll have a 'convertdump' command that you can run.

Thanks for the heads up on the NGCD issue. I've added an issue #11 for looking into that. Please add any details there if you can (e.g. which games are failing to verify if it's game-specific).

j68k avatar May 28 '22 16:05 j68k

Thanks very much for the suggestion. There is actually some code in the project for doing that conversion for testing purposes, but it's disabled because it needs tidying up and documenting. If you're comfortable with Python you can test it out by uncommenting this line in pyproject.toml:

https://github.com/j68k/verifydump/blob/6d3c21fe6e4985ce01a2a47935dd25a459d2c936/pyproject.toml#L33

Then when you reinstall the package (with pip or Poetry or whatever) you'll have a 'convertdump' command that you can run. Thanks for the heads up on the NGCD issue. I've added an issue #11 for looking into that. Please add any details there if you can (e.g. which games are failing to verify if it's game-specific).

Thanks, I got the convertdump command but I can't make it work correctly.

Here is the error :

convertdump "Street Fighter Zero (Japan).chd" --extra-cue-source "c.zip" --output-folder "C:\Users\XXX\Downloads" --system PSX

Traceback (most recent call last): File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "c:\users\XXX.local\bin\convertdump.exe_main.py", line 7, in File "C:\Users\XXX.local\pipx\venvs\verifydump\lib\site-packages\verifydump\console.py", line 80, in convertdump_main convert_chd_to_normalized_redump_dump_folder( TypeError: convert_chd_to_normalized_redump_dump_folder() got an unexpected keyword argument 'extra_cue_source' PS C:\Users\XXX\Downloads>

It would be great if convertdump was using the same commands as verifydump with the only difference is that it keeps the temp files and moves it to a desired folder.

Immersion95 avatar May 30 '22 14:05 Immersion95

Ah dang, I should've checked that the convertdump command still works before suggesting you try it. Sorry about that. The problem was that the program used to handle the extra .cue source in the conversion code, but now it handles it in the verification code and I forgot to change convertdump to account for that.

I've fixed the issue now so if you can install the current Git main branch version it should work. The --help output will still say that convertdump accepts the --extra-cue-source option, but it won't actually do anything at the moment. I'll need to find a little time to make that work properly (probably in a few weeks). You also don't need the --system option for PS1, because at the moment the only systems that need that are Dreamcast and arcade GD-ROM systems.

Thanks very much for letting me know. I'll make a list here of what I need to do.

Task list:

  • [ ] Use the extra .cue source if provided (just copy the provided .cue into the destination folder)
  • [ ] Document --output-folder option (including that it's optional and defaults to current working folder)
  • [ ] Document that --system is optional and say which systems it actually makes a difference for (currently just Dreamcast and the other GD-ROM systems)
  • [ ] Add ability to process whole folder
  • [ ] Check that the output folder exists, and refuse to run with a clear error message if it doesn't

j68k avatar May 30 '22 15:05 j68k

Perfect, it works flawlessly. Would it be possible to make it process folder instead of file ?

Immersion95 avatar May 31 '22 09:05 Immersion95

Yeah, that shouldn't be too difficult. I've added it to the task list.

j68k avatar May 31 '22 17:05 j68k

Are you sure that the "--system DC" or "--system "DC"" command works ?

Here is my error :

Unable to open file (Ikaruga (Japan)02.raw): Permission denied Fatal error occurred: 1 Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "c:\users\sonic.local\bin\convertdump.exe_main.py", line 7, in File "C:\Users\Sonic.local\pipx\venvs\verifydump\lib\site-packages\verifydump\console.py", line 80, in convertdump_main convert_chd_to_normalized_redump_dump_folder( File "C:\Users\Sonic.local\pipx\venvs\verifydump\lib\site-packages\verifydump\convert.py", line 26, in convert_chd_to_normalized_redump_dump_folder convert_chd_to_bin_gdi(chd_path, cue_file_path.parent, show_command_output) File "C:\Users\Sonic.local\pipx\venvs\verifydump\lib\site-packages\verifydump\convert.py", line 87, in convert_chd_to_bin_gdi raise ConversionException("Failed to convert .chd to .bin/.gdi using chdman", chd_file_path, None) verifydump.convert.ConversionException: Failed to convert .chd to .bin/.gdi using chdman

Immersion95 avatar Jun 05 '22 08:06 Immersion95

I just gave it a test and it's working fine for me. I'm not sure what would cause that error. Do you have low disk space, maybe? The version of chdman I have is 0.240, so it might be worth trying upgrading if you have an older version than that.

j68k avatar Jun 05 '22 16:06 j68k

It also works for me when I don't set the "--output-folder" command.

  • --output-folder alone works
  • --system alone works
  • --output-folder & --system together don't work

Immersion95 avatar Jun 05 '22 16:06 Immersion95

Oh that's interesting. Good job diagnosing that. It still works for me even when I use both options together, though. Is there anything unusual about the output folder you're using? Is it on a network drive or something?

j68k avatar Jun 05 '22 16:06 j68k

Here is my command for example : convertdump "a.chd" --system "dc" --output-folder "Output"

  • It does work if the "Output" folder already exists but fails when it doesn't

If my command is : convertdump "a.chd" --output-folder "Output"

  • It does create the folder even if it doesn't exist

It may be a problem with my setup though.

Immersion95 avatar Jun 05 '22 17:06 Immersion95

Ahhh, no that makes sense. I think what's happening is that for other systems we use binmerge and I guess that creates the folder if it doesn't exist, whereas for Dreamcast we just use chdman and it doesn't create the folder and fails.

I think that convertdump should check that the output folder exists and refuse to run if it doesn't, to prevent accidentally making a folder that wasn't intended. I'll add it to the task list. Thanks again!

j68k avatar Jun 05 '22 17:06 j68k

Ahhh, no that makes sense. I think what's happening is that for other systems we use binmerge and I guess that creates the folder if it doesn't exist, whereas for Dreamcast we just use chdman and it doesn't create the folder and fails.

I think that convertdump should check that the output folder exists and refuse to run if it doesn't, to prevent accidentally making a folder that wasn't intended. I'll add it to the task list. Thanks again!

Let me thank you instead for your wonderful tool, I use it a lot :).

Immersion95 avatar Jun 06 '22 08:06 Immersion95

Just wanted to say thanks for this, I made the mistake of converting a bunch of stuff to CHD before I understood that it's not really a reversible compression format, it's good to have a tool coming together that can recover data from it.

Also wanted to let you know of a minor issue - the current logic deletes the GDI file created by chdman after converting to cue, this GDI is needed for TOSEC dumps - that line was easy enough to comment out, but unfortunately the GDI that chdman creates isn't compatible with the original TOSEC GDI hash. One user mentions in this bug how to edit the file to make it hash compatible, I haven't played around with that yet to verify but seems like it would make sense for verifydump to try and fix TOSEC gdi files too if it's that straightforward.

ldolse avatar Feb 03 '23 16:02 ldolse