Skip to content

Add full devoptab functionality and add extended libiosuhax functionality#6

Closed
Crementif wants to merge 5 commits intowiiu-env:masterfrom
Crementif:extend
Closed

Add full devoptab functionality and add extended libiosuhax functionality#6
Crementif wants to merge 5 commits intowiiu-env:masterfrom
Crementif:extend

Conversation

@Crementif
Copy link
Copy Markdown

@Crementif Crementif commented Apr 29, 2022

See wiiu-env/MochaPayload#4 for MochaPayload changes.

This PR is split into two parts:

  • Add missing devoptab iosuhax functionality (except being able to create links):
    • rmdir_r, rename_r, fchmod_r, fsync_r, ftruncate_r.
  • Add "extended" libiosuhax functions. Read below for the full details:

Extended iosuhax functionality
This PR is a part of another attempt at adding a lot of nice-to-have functions to libiosuhax and the major iosuhax implementation(s), something which was originally made by @koolkdev in PRs dimok789#3 and FIX94/haxchi#13. I'm guessing that since both were kinda stagnant they never came to fruition, but now that Tiramisu is a thing these backwards-compatible additions* (see bottom) would be good timing.

These extended functions were required for the devoptab functionality, but I decided to implement the rest of the functions that koolkdev found. I've iterated upon that PR and corrected some things, but other then that it's pretty similar.

Breaking changes in this PR for other developers:

  • IOSUHAX_FSA_SetFilePos is changed to IOSUHAX_FSA_SetPosFile to reflect the name of the Wii U's original function name.
  • IOSUHAX_FSA_GetDeviceInfo has been changed to IOSUHAX_FSA_GetInfo, but you can now also use various functions that'll get the various structs you would get previously. BUT, IOSUHAX_FSA_GetDeviceInfo is now the name of one of these functions since that's the DeviceInfo struct it'll get. I hope that made sense.

Not Fully Finished
On the libiosuhax side:

  • Should a function be added to detect the iosuhax implementation details or whether supports a function, or should developers try a function and see if it returns without an invalid argument?
  • What the best option to rename IOSUHAX_FSA_GetDeviceInfo without a lot of confusion.

On the Tiramisu side:

  • It enables LTO, which I think might be pretty difficult to avoid without either drastically reworking it (you could do a lot more on the libiosuhax side), removing bloaty functions or find some other way to save space.
  • Improve macros or the dispatch system to be cleaner, if that's necessary. Tried to do as much compilation time magic while still abstracting it, but it can probably be improved.
  • Add CHECK_IF_IOSUHAX command back since it prevents IOSUHAX_Open("/dev/iosuhax") from working and only makes it work when you supply NULL. I also don't see a reason to remove it, especially since it could be extended to also return the version of the iosuhax implementation.

Crementif and others added 3 commits May 15, 2022 12:05
Some breaking/noteworthy changes for users that don't use the new functions:
 - IOSUHAX_FSA_SetFilePos is changed to IOSUHAX_FSA_SetPosFile to reflect the name of the Wii U's original function name.
 - IOSUHAX_FSA_GetDeviceInfo has been changed to IOSUHAX_FSA_GetInfo, but you can now also use various functions that'll get the various structs you would get previously. BUT, IOSUHAX_FSA_GetDeviceInfo is now the name of one of these functions since that's the DeviceInfo struct it'll get.

Based on original PR from dimok789#3.

Co-authored-by: koolkdev <koolkdev@gmail.com>
@Maschell
Copy link
Copy Markdown

Will be obsolete if #7 works as expected. On hold for now

@Maschell
Copy link
Copy Markdown

Maschell commented Jul 2, 2022

Closed in favor of [libmocha](https://github.com/wiiu-env/libmocha9

@Maschell Maschell closed this Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants