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

RiivolutionPatcher: Use capitalization of file that exists in the host file system if possible. #11444

Merged

Conversation

AdmiralCurtiss
Copy link
Contributor

Fixes https://bugs.dolphin-emu.org/issues/13138

Searching the file system for a file every time the given path does not exist is not particularly efficient, but I don't think it matters much. Most XML files seem to be well-behaved anyway.

@@ -716,4 +716,12 @@ void ToUpper(std::string* str)
{
std::transform(str->begin(), str->end(), str->begin(), [](char c) { return Common::ToUpper(c); });
}

bool CaseInsensitiveEquals(std::string_view a, std::string_view b)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works for utf8.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess most/everything in the file doesn't actually work for utf8, so whatever.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for UTF-8 as long as you don't need case insensitivity for codepoints U+0080 and up, which I think is good enough unless we have evidence Riivolution does something different on a real Wii.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I have no idea how case-insensitivity for the SD card filesystem on a Wii behaves. Would need to test that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally dolphin should handle host paths and emulated paths differently. For now it doesn't seem to matter as the existing code in the file ignores differences (if IOS code is calling them, idk), and doesn't properly handle utf8 anyway, so it can be improved in the future. just pointing it out...

@AdmiralCurtiss AdmiralCurtiss force-pushed the riivolution-linux-host-fs branch 3 times, most recently from bdb6822 to 293587a Compare January 30, 2023 09:42
@AdmiralCurtiss
Copy link
Contributor Author

I just saw someone running into this on Discord again... I'll just merge this for now, I'll be around for issues and improvements anyway.

@AdmiralCurtiss AdmiralCurtiss merged commit 73aaa01 into dolphin-emu:master Feb 28, 2023
14 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the riivolution-linux-host-fs branch February 28, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants