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

Cue files might reference bin files incorrectly #20

Closed
SeaLiteral opened this issue Oct 21, 2021 · 6 comments
Closed

Cue files might reference bin files incorrectly #20

SeaLiteral opened this issue Oct 21, 2021 · 6 comments

Comments

@SeaLiteral
Copy link

SeaLiteral commented Oct 21, 2021

When I tried running a simple font demo in PCSX-Redux, it couldn't find the bin file. Turns out the culprit was here:

<iso_project
	image_name="build/langs.bin"
	cue_sheet="build/langs.cue"
>

I'm keeping source files in a directory/folder and the built files in a subdirectory/subfolder. And the xml file isn't built/generated, so it's in the same directory as the source code, the directory that I'm calling mkpsxiso from (through make).

The langs.bin file in the build directory ends up like this:

FILE "build/langs.bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00

I think if the cue and bin files are in the same directory, it would make sense for the cue file to just reference the filename of the bin file, like this:

FILE "langs.bin" BINARY
  TRACK 01 MODE2/2352
    INDEX 01 00:00:00

I haven't rebuilt mkpsxiso after the CMake updates to this project and PSn00bSDK, so it's possible that games built with CMake avoid this issue. But I thought I should concentrate on the demo rather than adapting it to using CMake, so I thought I'd at least write somewhere that this can happen, in case others make some game and wonder why it works in some emulators but not others.

Edit: I had posted the same cue file contents twice in the above post. I've fixed that now. I've also looked into what happens if I call mkpsxiso from the target directory, and it works with some tweaks, which I'll put in a comment.

@ABelliqueux
Copy link

ABelliqueux commented Oct 21, 2021

I've come up with a fix but it means switching to c++17 in order to have access to <filesystem> :

FWIW, the relevant code was here :

https://github.com/Lameguy64/mkpsxiso/blob/master/src/main.cpp#L306-L307

fprintf( cuefp, "FILE \"%s\" BINARY\n",
global::ImageName.c_str() );

ABelliqueux@869091d
ABelliqueux@1232e9d

Should I PR those changes ?

EDIT: PR links are dead

@SeaLiteral
Copy link
Author

SeaLiteral commented Oct 21, 2021

Building from the target directory seems possible but took me a couple of tries:

  1. If I go into the build directory and run mkpsxiso -y -q ../iso.xml, it exits with the error ERROR: Unable to create cue sheet.
  2. If I then replace the paths to the generated files, it says it can't find system.cnf (probably because it's looking for it in the build directory).
  3. Finally, I removed all references to build/ in the XML file and added ../ to all paths that referred to source files. Then it seems to work as intended.

@Lameguy64
Copy link
Owner

Lameguy64 commented Oct 25, 2021

I've just committed a quick fix that strips the path of the .bin file in the cue sheet that doesn't need that stupid filesystem library. I haven't been able to test it properly because msys64 seems to be broken as mkpsxiso throws a segfault when it starts to build the disc image (not related to my changes, crashes during the directory tree building process) and was unable to debug it with gdb as it fails to open source files and locks up on breakpoints, but the changes should work.

@64ghost
Copy link

64ghost commented Oct 25, 2021

This problem fixed in the fork https://github.com/brill2k/mkpsxiso

@ABelliqueux
Copy link

@Lameguy64 I can confirm it works after building the last commit on Linux. Cheers!

@SeaLiteral
Copy link
Author

SeaLiteral commented Oct 26, 2021

I can confirm it works after building the last commit on Linux. Cheers!

So can I. So I guess I could close this issue now, since the only issue from this that remains would be if you try to put the bin and cue files in different directories, which I don't see why people would want to do (other than to make it work differently in different emulators). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants