j68k / verifydump

A tool for verifying that .chd/.rvz disc images match Redump Datfiles
MIT License
55 stars 8 forks source link

Add Convert Option to Redump bin/cue format #10

Open Immersion95 opened 2 years ago

Immersion95 commented 2 years ago

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.

j68k commented 2 years ago

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).

Immersion95 commented 2 years ago

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.

j68k commented 2 years ago

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:

Immersion95 commented 2 years ago

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

j68k commented 2 years ago

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

Immersion95 commented 2 years ago

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_x64qbz5n2kfra8p0\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

j68k commented 2 years ago

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.

Immersion95 commented 2 years ago

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

j68k commented 2 years ago

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?

Immersion95 commented 2 years ago

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

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

It may be a problem with my setup though.

j68k commented 2 years ago

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!

Immersion95 commented 2 years ago

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 :).

ldolse commented 1 year ago

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.