Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for cue sheets and other changes/fixes #56

Open
wants to merge 94 commits into
base: master
Choose a base branch
from

Conversation

N4gtan
Copy link
Contributor

@N4gtan N4gtan commented Aug 23, 2024

Fully support for cue files in single and multi binary format

Also:

  • Added support for calculating the real address instead of a zeroed one for the last postgap sector of some CD-DA games DATA tracks via the xml ecc_addr string.
  • Added support for regenerating correct submode for PS2 CD-ROM games via the xml ps2 string.
  • Added --warns argument to suppress all warnings. Fixes (Not an issue, but a request) Make it so you can suppress certain warnings #57
  • Changed the sort logic for 2003 games directory records to a custom one via the xml order string.
  • Fixed 0 byte files not having a whole sector allocated for them.
  • Fixed a regression introduced in previous version with timestamps prior to 1970 on Linux.
  • Renamed xml string h_flag to hidden for better understanding and added obfusctation flags to it.
  • Refactored date handling functions to use Windows APIs.
  • Prettier formatted help message and added me in the credits. 😋
  • Updated readme compile instructions and added info about filesystem issues.
  • Updated all submodules and changed the threadpool one to a better fork.
  • Cleaned up redundant #includes.
  • Added macOS CI build.
  • And some minor changes.
  • cmake: Updated build presets and changed the install path for Windows.
  • dumpsxiso: Restructured the logic on how DA files are processed.
  • dumpsxiso: Changed the way on how DATA track postgap sector is calculated.
  • dumpsxiso: Fixed some games STR/XA files being extracted as DATA when they are not.
  • dumpsxiso: Changed SeekToSector function to bool.
  • dumpsxiso: Stripped --lba argument from --path-table.
  • dumpsxiso: Added a hack to detect problematic isos with attributes in little endian.
  • dumpsxiso: Improved logic of --path-table command.
  • dumpsxiso: Fix crash on images with corrupted directory records or with SUSP.
  • dumpsxiso: Added --force argument to dump very obfuscated games like Chrono Cross, Xenogears.
  • dumpsxiso: Added --quiet argument to suppress all but warnings and errors.
  • dumpsxiso: Added --noxml argument which prevents creation of an xml and license file.
  • dumpsxiso: Added a descriptive error if a directory can't be created.
  • dumpsxiso: Added a descriptive error if a xml file can't be created. Fixes dumpsxiso: Specifying a path to the directory via -s instead of path to XML doesn't throw a descriptive error #29
  • dumpsxiso: Changed print statements to match mkpsxiso layout and updated some error messages.
  • dumpsxiso: Fixed reading of pathtable in cases where its size was exactly 2048.
  • dumpsxiso: Use 64KiB buffer size for better I/O.
  • mkpsxiso: Updated miniaudio related functions to match their new format.
  • mkpsxiso: Fixed file name sorting, so as to not take in account the ;1 chars.
  • mkpsxiso: Fixed a regression introduced in previous version with MSVC debugging.
  • mkpsxiso: Changed hidden flag operations to bitwise.
  • mkpsxiso: Unreferenced tracks are now listed in -lba's args.
  • mkpsxiso: Better formated -lba log, refactor and sort it by lba instead of name.
  • mkpsxiso: Increased character limit from 12 to 31 for homebrew development. Fixes Why are file names limited to 12 characters long? #35
  • mkpsxiso: Allow lower case in iso descriptor for homebrew development.
  • mkpsxiso: Allow non-standard root attributes.
  • mkpsxiso: Limited length and depth of paths to follow ISO 9660 standards.

@bismurphy
Copy link

Hello! I am interested in using this tool to dump the file contents of PS1 games, but have been sad that it does not support CUE/BIN format. I am very glad to see this PR come in, so that this might be used in the future!

I believe I may have identified an issue in how the tool behaves, though I don't understand the code well enough to point at where the problem is coming from.

I cloned your fork of the repo and checked out your branch, then built the tool. I didn't install it to my system since it's just a development version still, but I managed to build it. My project now has the following structure:

MyProject
    - GAME
        - gamename.cue
        - gamename (Track 1).bin
        - gamename (Track 2).bin
        - etc...
    - mkpsxiso
        - build
            -dumppsxiso  

From the root MyProject folder, I attempted to use dumppsxiso (your version, with Cue support) to dump the game, which is within the GAME directory. Thus, I ran:

mkpsxiso/build/dumpsxiso GAME/gamename.cue

This gave an error saying "Error: Failed to get the file size for "gamename (Track 1).bin".

If I cd into GAME, and then run:

../mkpsxiso/build/dumpsxiso gamename.cue

Then I get a successful dump. It appears that the program is reading the Cue file, and then searching the current working directory for the Bin files, rather than searching the Cue file's directory for the Bin files. It would be great if this behavior could be adjusted so that the Bin files will be searched alongside the Cue file, and not alongside the user's working directory.

Thank you for developing this functionality! I am very happy to see it work and I look forward to it being merged.

@N4gtan
Copy link
Contributor Author

N4gtan commented Sep 9, 2024

@bismurphy are you under linux? Currently I only tested it on windows and it worked fine, even at drag & drop.

Maybe the issue you are facing is releated on how linux parses paths and I would need to recheck it.

Out of curiosity, did you try quoting "GAME/gamename.cue" or adding ./ before GAME? It has the same behaviour?

@bismurphy
Copy link

@bismurphy are you under linux? Currently I only tested it on windows and it worked fine, even at drag & drop.

Maybe the issue you are facing is releated on how linux parses paths and I would need to recheck it.

Out of curiosity, did you try quoting "GAME/gamename.cue" or adding ./ before GAME? It has the same behaviour?

Yes, this is on Linux. I have tried quoting and adding ./, no change.

Additionally, there should probably be a newline at the end of the "Failed to get the file size" message, so that the user's terminal prompt will appear on a new line rather than at the end of the error message, but that's a minor cosmetic thing.

N4gtan added 5 commits October 1, 2024 12:20
Added support for single-bin cue files
Restructured the logic on how DA files are processed
Fixed file sorting at build time, so as to not take in account the ";1" chars
And some minor fixes
@N4gtan N4gtan marked this pull request as ready for review October 1, 2024 15:53
@marco-calautti
Copy link
Contributor

marco-calautti commented Oct 3, 2024

The error is likely due to the fact that dumpsxiso uses the directory from which the command is issued in the terminal as the base path. The .cue file contains only the relative path of the bin, and thus dumpsxiso is not able to find it. Probably, dumpsxiso should be fixed to search for the .bin file using the same directory as the .cue file as the base directory.

@N4gtan
Copy link
Contributor Author

N4gtan commented Oct 3, 2024

I alredy fixed that but idk why it worked on windows.
Previosly I was using just a simple string with the bin name instead of a path and, when I tested on windows drag & drop files to dumpsxiso from other directory, they got correctly dumped. So I thought the issue was on relative paths because at drag & drop it parses the full file path, so I tried on linux parsing the full path to the cue but it also didn't work. It's like windows automatically searched for the files in the the same directory as the input file and idk why.

N4gtan and others added 30 commits December 23, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment