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

Reduce usage of ppcState global. #11429

Merged
merged 48 commits into from Jan 27, 2023
Merged

Conversation

AdmiralCurtiss
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss commented Jan 10, 2023

I stopped before I got to the JIT because that was looking like it needed a bit more refactoring and this was already getting gigantic...

Right now system.GetPPCState() is just a reference to the ppcState global, but I'm aiming to completely eliminate that and to have it actually just have a PowerPCState instance in System instead.

Every commit should compile as-is, which may be useful for bisecting in case I made an error somewhere.

@delroth
Copy link
Member

delroth commented Jan 11, 2023

Why the intermediate PowerPCManager class? Couldn't we just have system.GetPPCState() returning a PowerPCState instance instead?

@AdmiralCurtiss
Copy link
Contributor Author

Yes, I suppose so, I was just following the way I have refactored the other global state files so far where at the end everything of a given file ended up in a single class. But given the way ppcState is used maybe this is indeed not ideal here and it would be better to just have the PowerPCState struct returned directly from System.

@AdmiralCurtiss
Copy link
Contributor Author

Like this, I assume?

Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

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

Just two small nits

Source/Core/Core/CoreTiming.h Outdated Show resolved Hide resolved
Source/Core/Core/Debugger/PPCDebugInterface.h Outdated Show resolved Hide resolved
@delroth delroth merged commit 41272dc into dolphin-emu:master Jan 27, 2023
14 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the globals-ppc branch January 27, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants