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

Replace the compress/uncompress actions with a convert dialog #8738

Merged
merged 9 commits into from Apr 28, 2020

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Apr 11, 2020

The reason why I decided to make these changes is because I need them for adding WIA writing support in PR #8538, but I'm opening this as a separate PR since it does have some benefits on its own:

  • You can now convert from not only ISO and GCZ but also from TGC and extracted disc images (but you can still only convert to ISO and GCZ)
  • You can configure the block size when converting to GCZ (tradeoff between size and performance)
  • You can choose whether to scrub

I understand if this dialog with its additional options might be considered excessive for as long as we only support converting to ISO and GCZ. If we want to wait with merging this until the WIA PR is close to done, I'm fine with that.

Don't merge this PR before #8591, #8644, and #8740, because those PRs improve the results when converting from extracted discs, TGC, and all formats other than ISO, respectively.

image

@JosJuice JosJuice force-pushed the convert-dialog branch 2 times, most recently from 5be7fa4 to 916e07a Compare April 11, 2020 15:52
@JosJuice
Copy link
Member Author

I've made this PR try to filter out GCZ block sizes that trigger the bugs fixed by #8740. The reason is because someone might create a GCZ file on one version of Dolphin and then convert it back to ISO using an older one (even though that's uncommon...)

The constant DESIRED_BUFFER_SIZE was determined by multiplying the
old hardcoded value 32 with the default GCZ block size 16 KiB.
Not sure if it actually is the best value, but it seems fine.
There is no longer anything GCZ specific about it.
If we start 31 KiB into a 32 KiB block and want to mark 2 KiB
of data as used, we need to mark 2 blocks as used, not just 1.

This problem is avoided when calling MarkAsUsed from
MarkAsUsedE, since MarkAsUsedE aligns to 32 KiB on its own.
Most calls to MarkAsUsed are from MarkAsUsedE, which is why
this hasn't been a noticeable problem in the past.
The code was actually already rather well adapted for this.
We more or less just have to skip ParseDisc and run
ParsePartitionData directly. This required the PartitionHeader
struct to be removed (which wasn't that useful anyway).
This way, scrubbing can also be performed when converting
to other formats.
@JMC47 JMC47 merged commit 116cef5 into dolphin-emu:master Apr 28, 2020
JosJuice added a commit to JosJuice/dolphin that referenced this pull request Apr 28, 2020
This should not be exposed to users before the merge of PR dolphin-emu#8644.
(PR dolphin-emu#8738 was unintentionally merged before PR dolphin-emu#8644.)
dreamsyntax pushed a commit to dreamsyntax/dolphin that referenced this pull request May 11, 2020
This should not be exposed to users before the merge of PR dolphin-emu#8644.
(PR dolphin-emu#8738 was unintentionally merged before PR dolphin-emu#8644.)
@JosJuice JosJuice deleted the convert-dialog branch June 15, 2020 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants