-
Notifications
You must be signed in to change notification settings - Fork 603
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
add support for WUHB file format #1190
Conversation
Oh, this is awesome to have. Nice work! |
On console for the "homebrew_on_menu" plugin I'm using a hash of the relative path to the .wuhb (e.g. "wiiu/apps/test.wuhb") with this hash function to get the lower title id and 0005000F for the first 4bytes : https://github.com/wiiu-env/homebrew_on_menu_plugin/blob/d0581407d69575d5205ba40ee188867e6c0dcdc1/src/utils/utils.cpp#L7 e.g. 0005000F-[HASH] I think CEMU could/should come up with it's own implementation for the "lower tid", but they should also start with0005000F for consistency? |
Not sure to whiche extend Cemu is even handling the cos.xml, but .wuhb under Aroma are running with these cos.xml values: |
src/util/helpers/helpers.cpp
Outdated
|
||
do | ||
{ | ||
decompressed.resize(decompressed.size() + 1024); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing by a fixed 1024 bytes at a time seems rather inefficient? For a 1MB file thats a thousand vector resize operations.
I recommend starting out with a smallish size like 32KB (maybe even as a size hint parameter?) and then just doubling the size each loop iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See latest commit. I know defining a variable and assigning the argument is redundant but I think it helps readability and it should be trivial for a compiler to optimize. I set the hint in the game list for the icons to 70KiB since one extracted game icon TGA I looked at is slightly more than 64KiB.
Looks good. Thanks! |
Closes: #962
This work is heavily inspired by the existing code to support WUA.
Some parts are copied and modified from WUT's wuhbtool (structures and hash calculation function)
Questions left to be answered:
Cemu/src/Cafe/Filesystem/WUHB/WUHBReader.cpp
Line 130 in 37cd32d
Should fil/dir table entries be cached?A: It's probably fine.How to assign a title ID to homebrew apps? Some kind of hash function?A: CRC32(author+longName+shortName)