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

Eliminate SettingsHandler's SetBytes and Reset methods #12737

Merged
merged 1 commit into from
May 5, 2024

Conversation

nlebeck
Copy link
Contributor

@nlebeck nlebeck commented Apr 23, 2024

Also make the Decrypt method private.

As far as I can tell, the only motivation for exposing the SetBytes and Reset methods is to allow CBoot::SetupWiiMemory to use the same SettingsHandler instance to read settings data and then write it back. It seems cleaner to just use two separate instances, and require a given SettingsHandler instance to be used for either writing data to a buffer or reading data from a buffer, but not both.

A natural next step is to split the SettingsHandler class into two classes, one for writing data and one for reading data. I've deferred that change for a future PR.

@nlebeck
Copy link
Contributor Author

nlebeck commented Apr 23, 2024

I thought this change was worth making in isolation, but let me know if it would make more sense to bundle this change into a single PR that also splits SettingsHandler into two classes. (Or let me know if either/both changes don't make sense.)

Also make the `Decrypt` method private.

As far as I can tell, the only motivation for exposing the `SetBytes`
and `Reset` methods is to allow `CBoot::SetupWiiMemory` to use the same
`SettingsHandler` instance to read settings data and then write it back.
It seems cleaner to just use two separate instances, and require a given
`SettingsHandler` instance to be used for either writing data to a
buffer or reading data from a buffer, but not both.

A natural next step is to split the `SettingsHandler` class into two
classes, one for writing data and one for reading data. I've deferred
that change for a future PR.
@nlebeck
Copy link
Contributor Author

nlebeck commented Apr 24, 2024

Thanks! Also addressed the linter issue.

@nlebeck nlebeck requested a review from JosJuice April 24, 2024 00:21
@JosJuice JosJuice merged commit 2c91367 into dolphin-emu:master May 5, 2024
11 checks passed
@nlebeck nlebeck deleted the settingshandler-split branch June 2, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants