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 for alignment of zero-length files within directory based virtual disk #2271

Merged
merged 1 commit into from Sep 27, 2015

Conversation

revel8n
Copy link
Contributor

@revel8n revel8n commented Apr 4, 2015

When a game is executed from a directory on disk, any zero-length files will not cause an alignment shift for the file that follows it causing them to overlap in the virtual file table.

@@ -459,7 +459,7 @@ void CVolumeDirectory::WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u
m_virtualDisk.insert(make_pair(dataOffset, entry.physicalName));

// 4 byte aligned
dataOffset = ROUND_UP(dataOffset + entry.size, 0x8000ull);
dataOffset = ROUND_UP(dataOffset + std::max(entry.size, (u64)1), 0x8000ull);

This comment was marked as off-topic.

This comment was marked as off-topic.

@JosJuice
Copy link
Member

JosJuice commented Apr 4, 2015

The two commits should be squashed into one commit. Other than that, this looks good to me.

@revel8n
Copy link
Contributor Author

revel8n commented Apr 12, 2015

git noob. took me longer to figure out the rebasing than it should have.

@JosJuice
Copy link
Member

@dolphin-emu-bot rebuild

@Sonicadvance1
Copy link
Contributor

Buildbot failures need to be fixed before this can be merged.

@JosJuice
Copy link
Member

@lioncash Is it possible to fix the buildbot failures without changing 1ull back to (u64)1?

@lioncash
Copy link
Member

@JosJuice Making the type specifier explicit. e.g. std::max(entry.size, 1) should work

…d from directory on disk

Updating constant value representation

Explicitly state data type in std:max usage
@revel8n
Copy link
Contributor Author

revel8n commented Sep 27, 2015

Ok, updated. Was not receiving notifications for this for some reason.

@JosJuice
Copy link
Member

LGTM. Thanks for making this PR.

@revel8n
Copy link
Contributor Author

revel8n commented Sep 27, 2015

No problem. Sorry it took me so long to get the PR sorted out.

phire added a commit that referenced this pull request Sep 27, 2015
Fix for alignment of zero-length files within directory based virtual disk
@phire phire merged commit ce493b8 into dolphin-emu:master Sep 27, 2015
@revel8n revel8n deleted the fixes branch September 27, 2015 16:30
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

automated-fifoci-reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants