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

Make WiiSave::Import() behave closer to the Wii System Menu's SD Card save copying. #9409

Merged
merged 5 commits into from
Jan 5, 2021

Conversation

AdmiralCurtiss
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss commented Dec 31, 2020

In practice, this means:

  • Saves are now only allowed to be imported if the game was previously 'seen' by ES. This includes launching it or even just inserting the game into the disc drive while the Wii Menu is running. Turns out this was previously the case too, but in a rather implicit fashion. This is now more explicit and works like the Wii Menu where it reinstalls a TMD if it's in the tmds.sys backup file. (which can happen if you had a save once and then delete it)
  • Saves are now deleted before a new one is imported. This prevents a few potential oddities like ending up with mixed old and new files, or completely failing the import on saves with subdirectories.

Please scrutinize this, I'm not entirely sure if everything here is correct and makes sense.

Source/Core/Core/WiiUtils.cpp Outdated Show resolved Hide resolved
Source/Core/Core/WiiUtils.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiiSaveStructs.h Outdated Show resolved Hide resolved
@iwubcode

This comment has been minimized.

@AdmiralCurtiss
Copy link
Contributor Author

AdmiralCurtiss commented Dec 31, 2020

If it was already enforced then it either wasn't explicitly or it was somewhere other than the importing logic itself. I'll see if I can find it.

I agree that our UX of Wii NAND handling is very poor -- I would personally like to have a GCI folder-like approach where a temp NAND is build from scratch with the correct data when launching games from the game list, mostly to get rid of years of built-up cruft in many users' NANDs ranging from older Dolphin versions not handling stuff correctly to just plain user error that leads to very hard to diagnose (for users) issues. However, that is far outside the scope of this issue with how the Wii handles its saves.

@AdmiralCurtiss
Copy link
Contributor Author

AdmiralCurtiss commented Dec 31, 2020

re: already-seen requirement, I checked and what happens in the old version is that this query here fails:

void InitTitleUidAndGid()
{
const auto metadata = m_fs->GetMetadata(IOS::PID_KERNEL, IOS::PID_KERNEL, m_data_dir);
if (!metadata)
return;
m_uid = metadata->uid;
m_gid = metadata->gid;
}

Which then leads to the rest of the functions returning immediately cause they have no UID/GID. Yes, I suppose that is an enforcement, if not a very obvious one.

Source/Core/Core/WiiUtils.h Outdated Show resolved Hide resolved
Source/Core/Core/WiiUtils.h Outdated Show resolved Hide resolved
Source/Core/Core/WiiUtils.h Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiiSave.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiiSave.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiiSave.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiiSave.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/MenuBar.cpp Outdated Show resolved Hide resolved
@AdmiralCurtiss AdmiralCurtiss force-pushed the wii-save-import-tmd branch 4 times, most recently from 99687c6 to 668a425 Compare January 1, 2021 06:30
Source/Core/Core/WiiUtils.cpp Outdated Show resolved Hide resolved
@leoetlino leoetlino merged commit 840ecfb into dolphin-emu:master Jan 5, 2021
@AdmiralCurtiss AdmiralCurtiss deleted the wii-save-import-tmd branch January 5, 2021 15:42
@Adamillo
Copy link

Adamillo commented Jan 6, 2021

I don't know if this update caused this to happen or not but here's my theory: After I downloaded this update yesterday all the save data for my Wii games got WIPED! Maybe it's because of this update, or maybe not, but the fact is: Wii save data gone after I updated! Edit: Maybe the latest dev build of Dolphin doesn't know where my saves are stored or not lemme test that with beta.

@JMC47
Copy link
Contributor

JMC47 commented Jan 6, 2021

This just changes the save import function. If your saves somehow got wiped, it would have to be something else.

@Adamillo
Copy link

Adamillo commented Jan 6, 2021

Still sad that my save data is gone :(

@JMC47
Copy link
Contributor

JMC47 commented Jan 6, 2021

Do you have any idea what happened to it? Obviously any time savedata gets removed is a problem. Do you know what builds you jumped between? Do you have the NANDs to see what's left in them?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants