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

IOS: Leverage Kernel/EmulationKernel difference for passing System to most IOS devices. #11787

Merged
merged 1 commit into from Apr 27, 2023

Conversation

AdmiralCurtiss
Copy link
Contributor

@leoetlino I assume you had something along these lines in mind over in #11743?

I've added a EmulationDevice interface that slots between the Device interface and the actual device classes that doesn't do anything but enforces that the IOS instance is an EmulationKernel instead of a plain Kernel. This allows all subclasses to know that they will only be constructed on an EmulationKernel, which allows them to safely access the m_ios reference as an EmulationKernel&. I think this looks quite nice and should have no runtime overhead.

@leoetlino
Copy link
Member

I've only skimmed through the diff, but that looks like exactly what I had in mind - thanks for implementing this! Will give this a better look later this evening

@AdmiralCurtiss AdmiralCurtiss force-pushed the ios-emulationkernel branch 3 times, most recently from e3050f7 to 9e63b6e Compare April 24, 2023 00:14
@leoetlino leoetlino self-requested a review April 24, 2023 01:06
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.

lgtm

What's the plan for the core devices that always exist (e.g. ES and FS)? Add a Kernel::TryGetSystem() that returns a pointer instead of a reference?

Source/Core/Core/IOS/Device.h Show resolved Hide resolved
@AdmiralCurtiss
Copy link
Contributor Author

What's the plan for the core devices that always exist (e.g. ES and FS)? Add a Kernel::TryGetSystem() that returns a pointer instead of a reference?

I'm not entirely sure about this one yet. My initial idea was to split them into an ESDevice and an EmulationESDevice like Kernel/EmulationKernel but I'm not sure if that actually works well in practice. A TryGetSystem() or similar would work, yeah, but ideally it would be obvious at compiletime whether any given function is only for emulation or can also be called for NAND maintainance.

@leoetlino leoetlino merged commit 89154c8 into dolphin-emu:master Apr 27, 2023
14 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the ios-emulationkernel branch April 27, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants