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
IOS::HLE::Kernel::InitIPC: Replace s_ios check with Core::IsRunning #11186
IOS::HLE::Kernel::InitIPC: Replace s_ios check with Core::IsRunning #11186
Conversation
|
What problem does this solve? ES.cpp calls InitIPC by using its member variable On the other hand, changing initialisation into a two-step process makes it possible to accidentally forget to call Init(). |
|
With the current way Edit: |
|
dolphin/Source/Core/Core/IOS/ES/ES.cpp Lines 104 to 112 in 9222956
If emulation is running, then InitIPC() doesn't get called while the ESDevice is being constructed (from the FinishInit() in the else branch). Instead, it's invoked from a CoreTiming event callback. When that happens, both (It would be very obvious if InitIPC() never did anything, as people would have noticed ES launches being broken and emulated software hanging forever.) One corner case: InitIPC is a no-op on the very first IOS launch (during boot / right before emulation is running). This is not a problem in practice because nothing is running on the PPC at that point and hence nothing will be expecting or even acknowledging the IPC ack. But it might be worthwhile to fix this anyway.
To fix that particular case, we would probably want to use |
|
My bad, I should've properly explained the issue I was having.
That does fix it as well. Should I change the PR to replace the |
|
Ah, that's a very interesting edge case :-) yeah I think we should avoid two-step initialisation and just fix the check in InitIPC. Just curious, what launches the vWii system menu and Wii IOS on Wii U? I'm surprised the vWii system menu checks for the ack -- does it relaunch IOS? |
This is actually a somewhat complicated process, since the Wii U doesn't go through boot0 - boot2 when entering vWii.
I'm not exactly sure what happens on the IOS side, as I haven't spent much time REing that yet. |
08fb6d4
to
2fb4566
Compare
This avoids issues with devices relying on
s_ios, which would be anullptrwhile still in the constructor.For example the ES device will call
InitIPCwhich makes sures_iosis notnullptr, which it always is while still in the constructor.