-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Change companion util stub to return NO_EVENT #3233
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging @Fire-Cube for their opinion on this, since their code is what's bugged in the first place.
sceCompanionUtilContext* ctx = nullptr; | ||
u32 ret = getEvent(ctx, outEvent, 1); | ||
u32 ret = ORBIS_COMPANION_UTIL_NO_EVENT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the actual issue is that getEvent will always return ORBIS_COMPANION_UTIL_INVALID_POINTER
since ctx is initialized as a nullptr.
I think it would be preferable to fix that bug instead of getting rid of the getEvent code entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check whether the game calls sceCompanionUtilInitialize, because my test game, Star Wars: Battlefront, doesn’t.
That’s why I built the full check logic for but without Initialize, it just returns an error.
I think we simply need to handle the initialization properly in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change and epolls SW:B seems to reach menus #3476 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed before, the core issue with libSceCompanionUtil comes from initializing that ctx
variable to a nullptr.
This triggers an error return in getEvent
which causes the issues seen in games.
This PR hasn't seen any updates since my review here, but I'd still rather see this bug properly fixed over adding in a hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The game does not seem to call any other CompanionUtil functions, so where should it be initialized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't decompiled this library, so I don't know.
All I know is that, if games are unhappy with this current behavior, then it probably needs fixing.
Some games, like Battlefield 1, really don't like getting an unexpected error here. Simply returning no event allows them to go further.