einsteinx2 / wiiflow-lite-einstein-mod

My customizations to WiiFlow Lite, at first focusing on polishing the UI and UX. Attempting to keep as much source compatibility as possible. Original repo here: https://sourceforge.net/projects/wiiflow-lite/
4 stars 1 forks source link

Remove 20 second wait before Wiiflow boots from SD #7

Closed kaisersozeh closed 6 years ago

kaisersozeh commented 6 years ago

Where the is no USB drive present Short - Allow SD users to explicitly disable USB mounting Long - Improve USB drive check speeds.

einsteinx2 commented 6 years ago

So this is the reason for the wait, on launch it calls DeviceHandle.MountAll(). If the USB drive isn't plugged in, this method hangs waiting for a device. So I'll need to check out USB Loader GX to see how it gets around this. If there's some quick check to see if anything is plugged in at all, that would solve the problem.

However, either way I do have it showing the loading screen during that wait now.

kaisersozeh commented 6 years ago

See issue #1 - closed with that issue

kaisersozeh commented 6 years ago

Sorry, Issue still open - Wait animation now invoked

einsteinx2 commented 6 years ago

So looking into this a bit, it's actually a 20 second timeout, which is the same as USB Loader GX. The difference seems to be that USB Loader GX does it in a background thread after the app launches (so you see an empty interface while it waits for the HDD to load), while WiiFlow does it during launch before displaying anything.

So the core problem here is that it's not possible to tell the difference between no HDD and a slow HDD.

I think the only actual way to fix this will be to defer USB loading if WiiFlow settings are set to use SD only (i.e. the wiiflow folder is on SD and the game folders are set to SD as well) and then only try to mount the HDD if they enable HDD in settings.

Leaving this for now to work on other stuff as I personally use a USB HDD and I think most people likely do.

einsteinx2 commented 6 years ago

Also a possible quick fix I thought of for the subset of people using SD only would be to add a setting to explicitly disable USB mounting. That would simplify things greatly and still allow SD only users to get fast booting. But if I can fix it properly, I'd rather do that.

einsteinx2 commented 6 years ago

BOOM! Did it the right way. So first it checks if the app folder is on SD, then it checks if the config file exists, then it checks if data_on_usb is true, then it checks each section to see if it's enabled and if it's partition is 1 or higher (i.e. on USB). If any of those are true, then it assumes we're using USB and mounts USB. If they're all false, we can safely assume we're using SD only and it skips trying to mount USB and waiting 20 seconds for a drive that doesn't exist.

So now, if you have an all SD card setup properly configured, it will automatically know to skip USB mounting and will launch as quickly as someone with a USB drive. Actually a bit faster since it can skip the mounting step.

kaisersozeh commented 6 years ago

nice