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: Deduplicate the request parsing code #4661
Merged
Merged
Commits on Jan 16, 2017
-
IOS HLE: Add resource request structs
This adds well-defined structs that are responsible for parsing resource requests, instead of duplicating the logic and offsets all over IOS HLE. Command handler functions are now passed parsed requests instead of a command address. This may not seem like a very important change, but it removes the need to remember all of the struct offsets or copy/paste existing struct request variables. It also prevents nasty bugs which have occurred in the past, such as parsing an ioctl as if it were an ioctlv (that's way too easy to do if you pass command addresses directly); or writing something to 0x0, which can easily happen by mistake with a close handler that can be called with invalid command addresses. Bonus changes: - The return code is not an obscure Memory::Write_U32 anymore, but an explicit, more obvious SetReturnValue() call. (Which correctly takes a s32 instead of a u32, since return codes are signed.) - Open handlers are now only responsible for returning an IOS ret code, and Close handlers don't return anything and don't have to worry about checking whether the request is a real one anymore. - DumpAsync was moved to the ioctlv request struct, because it did not really make sense to make it part of the IOS device and it only works for ioctlvs. All current usages have been removed; they will be readded in a later commit. As of this commit, nothing uses the structs yet. Usages will be migrated progressively.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
IOS HLE: Remove old structs and methods
Now that everything has been changed to use the new structs, the old methods and structs can be removed. And while I was changing the base device class, I also moved the "unsupported command" code to a separate function. It was pretty silly to copy the same 3 lines for ~5 commands.
-
IOS HLE: Specify the return code when replying
This makes more sense than setting the return code on the request struct first before replying. Ref: dolphin-emu#4661 (comment)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.