-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Handle async IO more correctly (testing/review) #939
Conversation
It is good to hear that Last Ranker can start new game now as it previously stuck at loading :) Just wondering any other games benefit from this amazing aync IO changes ? |
Basically all games use sceIo and this makes some major changes to how it schedules, so the only way to answer that question is testing. So far all known games improved are logged within this issue. -[Unknown] |
Excellent . BTW , previously mentioned will prepare to release 0.8 soon ? or 0.7 ? |
Sorry, 0.8 was a typo - meant 0.7. I think the plan is soon, yes. -[Unknown] |
I see |
Black Rock Shooter now go ingame. Load thread no longer blocked :) |
@@ -65,7 +65,7 @@ void hleDelayResultFinish(u64 userdata, int cycleslate) | |||
u32 error; | |||
SceUID threadID = (SceUID) userdata; | |||
SceUID verify = __KernelGetWaitID(threadID, WAITTYPE_DELAY, error); | |||
SceUID result = __KernelGetWaitValue(threadID, error); | |||
u64 result = (userdata ^ threadID) | __KernelGetWaitValue(threadID, error); | |||
|
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 think xoring the threadID here needs a comment, it's a bit hard to tell what's going on.
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.
Ah, heh, I see how it looks a bit odd now, it made sense when I wrote it.
Should I just replace it with userdata & 0xFFFFFFFF00000000
, rather than a comment? Should be the same deal, and that's probably a clearer way to do it.
-[Unknown]
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.
Yeah, that looks clearer. To make the compiler happy you should write it as 0xFFFFFFFF00000000ULL I think.
Setting v1 always should be ABI safe but I don't know of a way to be 100% sure of that... Seems very unlikely to be a problem though. |
Well, I guess I could just create two timers one for each, that would be the simplest way to not overwrite v1 if we're worried. -[Unknown] |
I'm not sure we are worried though :) |
Now it actually fires the callback as necessary. Some games care.
Errors become fffffff80010002, etc.
And remove defAction, it was the wrong way.
< 0 means error, and 0x0000000080000000 is not < 0.
Tried to estimate some rough timing. Fixes Unchained Blades.
No need to have this logic duplicated.
Also make it so we can return u64s easily in places...
A low estimate based on tests.
Based on tests.
With help from jpcsp and testing.
Final Fantasy 4 seemed to want this.
Actual delays for these seem much higher, but not sure.
Only the first time though.
How can i test an issue that wasn't yet merged in a build?Anyway silent hill shaterred memories will also benefit from this because it shows sceio async unimpl |
Okay, 0.7 was released. Ready to merge or want to add something more? |
Yeah, let's merge. -[Unknown] |
Handle async IO more correctly (testing/review)
This doesn't seem to reschedule, must've measured wrong in hrydgard#939. Fixes hrydgard#8749.
This is a larger change and probably could use more testing. I recommend merging only after 0.7, but it'd be great to know if this helps or hurts any games I don't have / haven't tested yet.
It's still not entirely accurate, but it's much better. This is sorta a first step, not wanting to make it too huge. I still need to finish writing better tests also, and there's always more to do, but I'm quite optimistic so far.
Practical affects:
Changes:
There's still more - for example errors when you try to do an async twice, or wait on no async, etc. But I wanted to create this so others can see my code and report any games it breaks.
-[Unknown]