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

Fix handling of Wii NAND's /tmp directory during savestate loads. #3798

Merged
merged 2 commits into from
Apr 30, 2016

Conversation

phire
Copy link
Member

@phire phire commented Apr 25, 2016

Fixes issue 9496 and potentially other issues with savestates and wii games.


This change is Reviewable

if (p.GetMode() == PointerWrap::MODE_READ)
{
// We need to make sure all file handles are closed so WII_IPC_Devices_fs::DoState can successfully re-create /tmp
for (u32 i = 0; i<IPC_MAX_FDS; i++)

This comment was marked as off-topic.

Fixes Metroid prime crashing the second boot after loading
a save state (issue 9496)
Because the file handles were open, the recursive delete was
failing. The previous commit stopped the crash but this should
make the restore actually happen has expected.
@Parlane
Copy link
Member

Parlane commented Apr 30, 2016

Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@Parlane
Copy link
Member

Parlane commented Apr 30, 2016

Review status: all files reviewed at latest revision, 1 unresolved discussion.


Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp, line 276 [r1] (raw file):
This has been fixed.


Comments from Reviewable

@Parlane Parlane merged commit 3d37559 into dolphin-emu:master Apr 30, 2016
@phire phire deleted the goto_dino branch May 1, 2016 00:53
@lioncash lioncash added this to the Dolphin Release 5.0 milestone May 1, 2016
@ghost
Copy link

ghost commented May 3, 2016

This PR added four extra DLLs to the Windows download that weren't there before. Was that intentional?

@Parlane
Copy link
Member

Parlane commented May 3, 2016

This PR added no DLLs. That'd be correlation not causation for ya.

@ghost
Copy link

ghost commented May 3, 2016

I mean 4.0-9257 compared to 4.0-9254.

phire added a commit to phire/dolphin that referenced this pull request May 29, 2016
Donkey Kong Country Returns is writing new data to some files in /tmp
when loading each level. But the savestate code was opening the files
a second time and reading some old and stale data out.

As of dolphin-emu#3798, dolphin now correctly restores that stale data to /tmp,
which broke DKCR (and probally countless other games).

This PR closes all file handles before saving and loading savestates,
which flushes the data out and pervents this issue. (old savestates
are corrupted and will still cause crashes if loaded)
phire added a commit to phire/dolphin that referenced this pull request May 29, 2016
Donkey Kong Country Returns is writing new data to some files in /tmp
when loading each level. But the savestate code was opening the files
a second time and reading some old and stale data out.

As of dolphin-emu#3798, dolphin now correctly restores that stale data to /tmp,
which broke DKCR (and probally countless other games).

This PR closes all file handles before saving and loading savestates,
which flushes the data out and pervents this issue. (old savestates
are corrupted and will still cause crashes if loaded)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants