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

ES: Make it fail on unsupported installed IOSes #6374

Merged
merged 2 commits into from
Feb 12, 2018

Conversation

sepalani
Copy link
Contributor

This PR is a response to: #5225

Rather than handling IOSes that Dolphin doesn't emulate, let's pretend that they don't exist. Otherwise, it creates a weird behaviour where libogc believes that the context is acceptable for running functions like ES_GetNumTicketViews and ES_GetTicketViews.

This PR fixes homebrew not booting while relying on IOS reloading of an (custom) IOS that isn't emulated by Dolphin but present in the NAND. These homebrew were blocked into an infinite loop during the IOS_ReloadIOS call.

I did some hardware tests too. If the app files are made empty or deleted, ditto for the TMD or the data/content is deleted, calling IOS_ReloadIOS will result in a black screen (no trace, no stack dump message or whatsoever). I assume, the console didn't like that at all. It was tested on a 3.2E Wii with a simple homebrew which calls IOS_ReloadIOS.

Ready to be reviewed.

Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

Sounds fine to me. Even though technically homebrew should be able to handle ES_Launch failure properly (which can fail), it looks like some of them assume that if ES_GetTicketViews works then the launch will also succeed.

There are some minor changes to make, though.

@@ -41,6 +42,15 @@ static bool ShouldReturnFakeViewsForIOSes(u64 title_id, const TitleContext& cont
(ios && SConfig::GetInstance().m_disc_booted_from_game_list && disc_title);
}

// Prevent to load installed IOSes that are not emulated.

This comment was marked as off-topic.

if (IsUnsupportedIOS(TitleID))
{
ERROR_LOG(IOS_ES, "GetViews: Dolphin doesn't emulate IOS title %016" PRIx64, TitleID);
return GetDefaultReply(ES_EINVAL);

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@sepalani
Copy link
Contributor Author

@leoetlino
As explained in the previous PR, a timing issue was making Dolphin's reply overwritten. Otherwise, it does check ES_Launch return value. Regardless, I addressed your comment and added another check in ESLaunch since it does succeed (GetNoReply()) for unsupported installed IOSes.

You'll find in attachment the result of my hardware tests and the source code (based on libogc) + ELF.
hardware_ios_reload.zip

ios_reload_36
ios_reload_121
ios_reload_249

@leoetlino leoetlino merged commit 8e06257 into dolphin-emu:master Feb 12, 2018
@sepalani sepalani deleted the ios-reload branch February 12, 2018 11:29
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.

None yet

4 participants