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

Sizing alignment issues cause dvd read failures in some games #9

Open
dj0wns opened this issue Oct 4, 2022 · 10 comments
Open

Sizing alignment issues cause dvd read failures in some games #9

dj0wns opened this issue Oct 4, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@dj0wns
Copy link
Contributor

dj0wns commented Oct 4, 2022

Games like Metal Arms read the iso in 80 byte chunks and pysiotools creates an iso that is not divisible by 80 bytes. This causes the game to read past the end of the iso when accessing the last block of data and causes a DVD fatal error in dolphin.

Workaround: Append X nullbytes such that the dvd size is divisible by 80.

@JoshuaMKW JoshuaMKW added the bug Something isn't working label Oct 4, 2022
@JoshuaMKW JoshuaMKW self-assigned this Oct 4, 2022
@JoshuaMKW
Copy link
Owner

Thanks for telling me about this! Before we continue however, what is your current version of pyisotools (should be v2.X.Y)? I remember a bug very similar to this which I have fixed recently.

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

I pulled directly from the git to test. So 2.4.4, potentially + some commits

@JoshuaMKW
Copy link
Owner

Awesome. Next thing I need to know is what the non modified size of the vanilla Metal Arms ISO is, and what the size of the pyisotools modified ISO is.

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

Looking into it deeper - it looks like it is a case of adding additional files to the iso that breaks the alignment - which may be out of scope for your project.

Size of vanilla: 1459978240
Size of repacked: 1459978240
Size of repacked + 2 files: 1459978300 (+60 bytes)

The files added are large (23MB) so its likely due to additional entries in the file table? or something similar.

@JoshuaMKW
Copy link
Owner

Adding files itself isn't an issue, which I can verify because I use pyisotools for my own projects which add many files to the ISO. However, is it possible that with adding such large files you've managed to surpass the ISO capacity? Although I find that pretty unlikely since if that were the case, you'd probably have an ISO that is at least many kilobytes larger than usual.

Another idea, did you extract the ISO with or without positional information dumped? If you did it with positional info, it could cause problems with adding new files since the old ones are effectively "frozen" into place.

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

Although I find that pretty unlikely since if that were the case, you'd probably have an ISO that is at least many kilobytes larger than usual.

I agree this is unlikely. I replaced the files being added with smaller files (3 MB rather than 25MB) and the resulting iso was actually 32 bytes larger than before. (Also i am expanding files in the iso by more than this amount but that doesn't seem to affect anything.

Another idea, did you extract the ISO with or without positional information dumped? If you did it with positional info, it could cause problems with adding new files since the old ones are effectively "frozen" into place.

Unsure, I'm just calling "GamecubeISO.from_iso(src)" and "GamecubeISO.from_root(src)". If thats the default behavior then that may be why

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

Oh wait wrong functions, I am because extract defaults to that. Let me replace that and try.

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

Disabling dump positions resulted in no change - Still having the issue

@JoshuaMKW
Copy link
Owner

Alright, I'll see if I can replicate the bug and from there patch it out.

@dj0wns
Copy link
Contributor Author

dj0wns commented Oct 4, 2022

I can send you an example root folder if it would help - accept my discord FR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants