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 HLE: Deduplicate the request parsing code #4661

Merged
merged 16 commits into from Jan 17, 2017

Commits on Jan 16, 2017

  1. 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.
    leoetlino committed Jan 16, 2017
    Copy the full SHA
    d8b9b38 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    e2d0722 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    d7b4e6e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    d536082 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    d4de87a View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    f9e806f View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    84c8d0b View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    a049020 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    469a31d View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    5a5985f View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    0e979ec View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    6bf0b48 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    4af67ab View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    8629a1f View commit details
    Browse the repository at this point in the history
  15. 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.
    leoetlino committed Jan 16, 2017
    Copy the full SHA
    c6b1cfb View commit details
    Browse the repository at this point in the history
  16. 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)
    leoetlino committed Jan 16, 2017
    Copy the full SHA
    25f89cc View commit details
    Browse the repository at this point in the history