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
Wii SD Card Folder Syncing #10590
Wii SD Card Folder Syncing #10590
Conversation
Doesn't have to be this PR but it'd be nice if the user clicks that sync checkbox and Dolphin notices there's a Outside of that, this sounds good. Haven't tested or looked at any code yet. |
1fa4be3
to
a6ae6bd
Compare
a6ae6bd
to
3cea7e8
Compare
3cea7e8
to
5219778
Compare
Tested on macOS 12 and it works! And it's very convenient, super nice. |
Tested on Windows 10 and works as expected. A little slow for larger "SD cards", as expected really, but on second load there must have been some caching that occurred because it was dramatically faster. |
Does this create deterministic SD cards - would it work for netplay? |
Not right now, but that should be simple to add, just sort the files in some deterministic way before packing. |
We probably should also use dummy timestamps and such in the deterministic case, now that I think about it. |
Yeah, that was the issue on old netplay - even if you put together the same exact SD card, unless you shared it directly with the other person, the timestamps wouldn't line up. |
c00bcc4
to
6347542
Compare
@JMC47 I've added a deterministic packing mode that will be used when I've also fixed up some minor things and added some utility features to the UI. IMO this is pretty much ready now, except maybe some tooltips or warnings so users don't accidentally destroy their existing cards with this. Oh, and I've also changed the default path for the SD card image to be at |
@AdmiralCurtiss Does this sync the whole sd card image, or just whatever is different between the raw file and the folder? |
The entire thing. Trying to detect and process differences only could be added but for a first version this seems plenty already. |
Moving the SD card outside of the Wii NAND is correct. I don't think anyone will argue with that. |
Yeah, I agree with moving it outside of the Wii directory. I don't know about putting it in Load, since that's normally for stuff that Dolphin doesn't write to... But I'm not sure what a better place would be. |
Maybe a new directory in the User folder? |
Remember how I said this PR seemed a little crashy? Testing further, I found a way to reproduce it reliably. It's pretty simple. Just start the Wii Menu through the menu bar, and click A to get past the health screen and into the Wii Menu itself (which is necessary, it doesn't crash otherwise). Once the Wii Menu is up, stop emulation, wait for it to finish stopping, then open the Wii Menu the exact same way. This should be the crash. This does not occur on master. |
Cannot reproduce. Stack trace please, ideally from a debug build? |
I tested this briefly (I wanted to use some homebrew, and setting up an SD card is a pain otherwise). "Convert Folder to File now" seems to work fine. I was a bit confused initially because I had assumed that "Automatically sync with Folder on emulation start and end" would default to checked, but it doesn't (which is probably for the better, as otherwise it'd default to replacing the SD card with an empty folder) - the relevant options are in Config → Wii. For my purposes, "Convert Folder to File now" was what I wanted though. |
Everything works as expected on my standard SD card. But the one I converted from my actual Wii doesn't work. It loads in Dolphin fine, but it doesn't convert to folder properly. I was unable to reproduce any crashing following the provided steps. The loadtimes are pretty excessive when not using an m2 drive, which can be a bit annoying on 2GB cards. at 128MB default card isn't that bad. |
04f5a54
to
c7f466c
Compare
@dolphin-emu-bot rebuild |
c7f466c
to
8686183
Compare
8686183
to
b1bbe10
Compare
Co-authored-by: Pablo Stebler <pablo@stebler.xyz>
…n the image file, not the folder.
…ion start and end. Co-authored-by: Pablo Stebler <pablo@stebler.xyz>
…e order and dummy timestamps.
b1bbe10
to
2d8d335
Compare
Rebased and modified #10525. This now behaves like the melonDS variant (I think) where it will, if enabled, sync a folder into an SD Card image on emulation start, and then sync it back from the image to the folder on emulation end.
The default folder that syncs with the image is at
[userdir]/Load/WiiSDSync
. Be careful as this will overwrite the contents of yoursd.raw
if you already have one!As-is, this is pretty barebones but works. Additional features that could be nice and can be part of either this PR or a follow up include manual pack/unpack buttons, only syncing files that have changed (right now it just packs or unpacks the entire thing every time), some safety checks, and probably more. Maybe we should also take this opportunity to change the default path of the
sd.raw
to not be inside the Wii NAND...I have not extensively tested this -- in fact most of the code is just taken as-is from #10525 -- so it's entirely possible this has issues, but from a little test it worked as expected.