Fix install destination detection for CXI-based game files - #953
Conversation
|
@ZeroSkill1 - this pull request won't make the anniversary release, I'll just need some more time to properly understand and review the changes. Will get bakc about that, and thank you! |
d0k3
left a comment
There was a problem hiding this comment.
Alright, I finally got around to do a proper review. @ZeroSkill1 - thank you for that, it's highly appreciated. Bear with us for a bit, it seems we're a bit slower in reviewing than you are in doing pull requests.
| if (is_twl) | ||
| drv[0] = from_emunand ? '5' : '2'; | ||
| else | ||
| drv[0] = GetMountPath()[0]; |
There was a problem hiding this comment.
Unsure if I understand what this is supposed to do. The whole fucntion is meant only for tie, so what cases is that block meant for?
There was a problem hiding this comment.
That's what I thought too, but it turns out this function is the main one used for uninstalling anything, really. As for the drive selection, I've used this "shortcut" of sorts by looking at all possible uninstall locations:
| . | SysNAND CTRNAND | SysNAND TWLNAND | SysNAND SD | EmuNAND CTRNAND | EmuNAND TWLNAND | EmuNAND SD |
|---|---|---|---|---|---|---|
| Title path | T:/... | T:/00048... | T:/... | T:/... | T:/00048... | T:/... |
| Mount path | 1:/dbs/title.db | 1:/dbs/title.db | A:/dbs/title.db | 4:/dbs/title.db | 4:/dbs/title.db | B:/dbs/title.db |
| Uninstall drive | 1:/ | 2:/ | A:/ | 4:/ | 5:/ | B:/ |
For all uninstall locations other than for TWL titles, the mountpath of the mounted .db file is the same as the uninstall drive, and for TWL titles, the uninstall drive is the equivalent TWLNAND drive depending on SysNAND/EmuNAND.
I can add a comment explaining this briefly.
There was a problem hiding this comment.
Thanks, that explains it, I've got one last round of nitpicking, though. I'm currently wondering if it is ever possible for GetMountPath()[0] to be zero here, and to be blunt, I don't know. NULL for GetMountPath() should be impossible here, but maybe it makes sense to guard an empty string here (because that's a plausible return value here). Other than that, this one is good to be merged 👍
There was a problem hiding this comment.
That NULL check is already performed earlier in the function. I guess I could just use the existing mntpath instead of using GetMountPath() again, and use a simple empty string check in the earlier check.
23f2a7d to
a27a492
Compare
2032d0b to
2420e86
Compare
|
All good, thank you @ZeroSkill1 ! |
Should fix #952. GodMode9 currently does not properly detect the install destination drive for certain (CXI-based) titles. For instance, it is possible for a NAND title to have an SD-looking title ID, e.g.
000400000ff40002(DevMenu).Under HOS, this does not matter because the destination is determined by the "is SD app" flag in the ExHeader.
I have reworked the game file installation & title uninstallation process to honor this bit (when applicable). That is:
I have tested this to be working with all major types of content.