Hacking WiiFlow Lite

AdamCatalyst

Well-Known Member
Member
Joined
May 26, 2020
Messages
179
Trophies
0
XP
1,128
Country
Canada
Good idea!
Had a 32GB SDHC card and tried it: With it it works. Wiiflow, the game forwarder and cfg USB Loader (even with WiiU SSD attached). Could start games without problems.

Will check the difference between the sdxc and sdhc card (clustersize etc.) tomorrow (here in germany it's almost 3am) and will give information if I find something worth mentioning.

Interesting! FWIW, I have used WiiFlow with a SanDisk Ultra 128 GB SDXC without issues, but only after I got it re-formatted in a way that the Wii liked. Not all on-spec formatters worked for my Wii. In the end I found that simply formatting with Apple's Disk Utility on a Mac (which shockingly defaults to formatting FAT32 on perfect spec for a Wii or WiiU) was the most reliable. Furthermore I don't believe I had any issues with the card when formatted with the official SD Card Formatter tool that you can download for Mac or Windows. I did have issues with my SDXC card when formatted on-spec with some other recommended formatting tools in Windows.
 

M tha MaN

Well-Known Member
Member
Joined
Apr 19, 2009
Messages
234
Trophies
1
Age
37
Website
www.psxtools.de
XP
1,720
Country
Germany
Interesting.

I use Mini Partition Tool Wizard and never encountered problems with it.

My SDXC card had 64kB cluster size. I reformatted it to FAT32 with 32kB cluster sizer but still it doesn't work with it. Seems that I need another program to format but that doesn't explain why launching games works with cfg USB Loader perfectly (and much faster) than with wiiflow (the 32GB SDHC card is also FAT32 formatted with 32 kB Cluster size).
 
Last edited by M tha MaN,
  • Like
Reactions: AdamCatalyst

AdamCatalyst

Well-Known Member
Member
Joined
May 26, 2020
Messages
179
Trophies
0
XP
1,128
Country
Canada
My SDXC card had 64kB cluster size. I reformatted it to FAT32 with 32kB cluster sizer but still it doesn't work with it. Seems that I need another program to format but that doesn't explain why launching games works with cfg USB Loader perfectly (and much faster) than with wiiflow (the 32GB SDHC card is also FAT32 formatted with 32 kB Cluster size).
If you are using a fresh format, I doubt there are any file system issues, but nonetheless, you might want to try running fsck or something similar to check for any corruption. I say this because for some stupid reason, my FAT32 SD and USB on my Wii get file system corruption way too often (usually caused by USB Loader GX) and when a drive has file system corruption I have noticed different apps on my Wii will read (or won't read) to and from the drive with different results. Since you have freshly formatted, I doubt that is the problem, just trying to leave no stone unturned…
 

M tha MaN

Well-Known Member
Member
Joined
Apr 19, 2009
Messages
234
Trophies
1
Age
37
Website
www.psxtools.de
XP
1,720
Country
Germany
That's one of the first things I did. No errors found (did it again, see screenshot).

Is it perhaps the implementation of the SD card driver in Wiiflow? Cause technically I can't imagine another reason (because it seems not to be an issue with the hardware, since cfg usb loader works just fine).

Edit: It's not the fault of SDHC vs. SDXC. After one Start (via forwarder) of Wii Sports and then back to Wii menu it doesn't work with the 32 GB SDHC card. chkdsk says no problems found.
 

Attachments

  • 2020-05-31 21_11_45-Administrator_ Eingabeaufforderung.png
    2020-05-31 21_11_45-Administrator_ Eingabeaufforderung.png
    61.2 KB · Views: 164
Last edited by M tha MaN,
  • Like
Reactions: AdamCatalyst

protivakid

Well-Known Member
Member
Joined
May 6, 2014
Messages
197
Trophies
0
Age
38
XP
629
Country
United States
so we know that wiiflow is laucnhing devolution. but apparently the args are not being sent to it or they are disappearing because devo just flashes the light as if it can't find the game. possibly a memory issue because wiiflow has gotten bigger in size (bytes) and the args are not being written to mem. i really don't know.

thank you for the kind words.

Edit: since you now have an sd card you could try the debugging write to sd. it might tell us whats going on with devolution.
you need to open wiiflow_lite.ini in a text editor and look under [DEBUG] and set sd_write_log=yes

run wiiflow and try to launch a devolution game. then check the sd card root for a file named wiiflow.log. copy and paste it here.

Hey fledge68 - First off glad it looks like you are feeling better after getting sick last month.

I've been slammed with work but finally found time to play around some more to debug my devolution issue. I have found a way to reproduce the behavior both working and not working.

To re-cap, I have both WiiFlow and my Games on a USB drive plugged into a correct port. When I select devolution as the loader and launch my Wii blinks 4 times (Which is Devo saying it can't find the games directory) and then boots me back to the home screen. Just for the heck of it, still keeping everything on my USB drive, I formatted an SD card. I then booted into WiiFlow on my USB stick and selected Devolution as the loader. I then placed the BLANK SD card into my Wii and booted the game. Well what do you know it Worked! I then re-booted my Wii with the SD card ejected, tried WiiFlow with Devolution again and it no longer worked.

I can consistently get it to work and not work based on if I have a blank SD card in my Wii. Given that Devolution can't find the games directory, my assumption is that the WiiFlow code that handles Devolution assumes there is an SD card in the Wii. It perhaps tells Devo to check the SD first and then check the USB drive after. With no SD in the Wii it somehow trips up and doesn't go to the next ELSE statement to check the USB drive.

I took a look at the WiiFlow 4.2.1 source code and the WiiFlow Lite 5.4.6 source code. Nothing jumped out at me except for in the gc.cpp file you commented out the following line.
Code:
// re-mount device we need
//DeviceHandle.MountDevolution();
It looks like in 4.2.1 they were doing a re-mount of the directory before booting. Not sure if this would make any difference.

Is there any way I can write debug logs to my USB drive? I could then see what the log looks like without the SD card in the Wii.
 
  • Like
Reactions: Tetsuo Shima

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
// DeviceHandle.MountDevolution(); is followed later by //DeviceHandle.UnMountDevolution();

mount and unmount devolution were there because originally shutdownbeforeexit() (which unmounts SD and USB) was called before DEVO_SetOptions() which needs to read the from the device the game.iso is on. so Fix94 added those ldevo mount and unmount so that devo setoptions could read from the device.

I just moved shutdownbeforeexit after DEVO_SetOptions() so those devo mount and unmount are not needed.
usbloader gx does not have or use those devo mount and unmount.

as for you needing a blank sd card in ... really odd.
my logical guess is the device the game is on is not being sent to devo for some reason. so devo starts looking on sd but if sd is not mounted it quits. if it is mounted and game is not found it moves on to usb where it finds the game.
but I'm just guessing because i really have no idea how devo works.

wiiflow uses stat and DEVO_CONFIG->device_signature = st.st_dev; to send devo the device the game is on. I'm wondering if that is not working for some strange reason.
 

Morricorne

Well-Known Member
Member
Joined
Jun 14, 2019
Messages
295
Trophies
0
Age
32
Location
Łódź
XP
846
Country
Poland
Any chance to add hid usb pad support on this lite version? Then will be Perfect. And i can replace my normal wiiflow with this.
Now i only play gamecube games on nintendont with usb PC pad.
 

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
@protivakid try this - https://www.mediafire.com/file/m7wu278cgjn5ir4/wf5.4.7devo_test1.zip/file
see if it fixes devo without sd inserted.

@Morricorne any usb gamepad you use will have to have a joystick to move the pointer on the main screen and select the icons at the bottom for favorites, categories, settings, etc...

unless i heavily modify wiiflow code so that if you press a gamepad button to make those icons appear and then you use the gamepad to move to the icon and choose it.
 
  • Like
Reactions: Hakaisha

protivakid

Well-Known Member
Member
Joined
May 6, 2014
Messages
197
Trophies
0
Age
38
XP
629
Country
United States
// DeviceHandle.MountDevolution(); is followed later by //DeviceHandle.UnMountDevolution();

mount and unmount devolution were there because originally shutdownbeforeexit() (which unmounts SD and USB) was called before DEVO_SetOptions() which needs to read the from the device the game.iso is on. so Fix94 added those ldevo mount and unmount so that devo setoptions could read from the device.

I just moved shutdownbeforeexit after DEVO_SetOptions() so those devo mount and unmount are not needed.
usbloader gx does not have or use those devo mount and unmount.

as for you needing a blank sd card in ... really odd.
my logical guess is the device the game is on is not being sent to devo for some reason. so devo starts looking on sd but if sd is not mounted it quits. if it is mounted and game is not found it moves on to usb where it finds the game.
but I'm just guessing because i really have no idea how devo works.

wiiflow uses stat and DEVO_CONFIG->device_signature = st.st_dev; to send devo the device the game is on. I'm wondering if that is not working for some strange reason.

Your theoretical root cause sounds like my initial assumption as well, check SD then check USB but for some reason with no SD a null pointer or something is happening where is exits back to the Wii menu.

I've said previously that the same devolution loader.bin works with the original WiiFlow with no SD card present. It's something specific to WiiFlowLite where this issue is happening unfortunately.

Any way I can log to usb or are debug logs only supported on SD?
 
Last edited by protivakid,

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
Your theoretical root cause sounds like my initial assumption as well, check SD then check USB but for some reason with no SD a null pointer or something is happening where is exits back to the Wii menu.

I've said previously that the same devolution loader.bin works with the original WiiFlow with no SD card present. It's something specific to WiiFlowLite where this issue is happening unfortunately.

Any way I can log to usb or are debug logs only supported on SD?
no just try the download i provided. it contains a bit of code usbloader gx has that i missed.
 
  • Like
Reactions: Hakaisha

Demetris

Well-Known Member
Newcomer
Joined
May 15, 2019
Messages
84
Trophies
0
Age
47
XP
588
Country
Cyprus
@Morricorne you can make one with Arduino Atmega 32u4 or stm32duino.
It works wonderfully
P.s it emulates a GameCube or wii classic controller, you decide! And then you can use any controller your heart desires

Sent from the Island of Venus
 
Last edited by Demetris,

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
@protivakid based on what you told me about inserting the SD card, I then knew that

DEVO_CONFIG->device_signature = st.st_dev;

has to be the problem. then I saw in usbloader gx code that cyan (way back in 2012) changed that line to

// st.st_dev doesn't work with our current device type. It returns Wii_UMS 'WUMS' instead of Wii_USB 'WUSB'.
// Only last two letters are returned by DevkitPro, so we set them manually to Devolution config.
DEVO_CONFIG->device_signature = st.st_dev == 'SD' ? 'SD' : 'SB';

at some point in time st.st_dev became broken maybe by a change in libogc or devkitppc. I can't seem to track it down or find where @Cyan got his info from. anyway I'm assuming that older version of wiiflow that it worked was compiled before st.st_dev was broken and afterward nobody caught it because they switched to nintendont or they always had a sd card inserted like me.

I added that change in wiiflow lite and would love for you to try this download - https://www.mediafire.com/file/m7wu278cgjn5ir4/wf5.4.7devo_test1.zip/file

It works for me but I have an SD card and sorry don't feel like trying to move everything to USB to test it.

edit: i just found where cyan and tueidj talked about it here - https://gbatemp.net/threads/devolution-public-release.330554/page-54#post-4339227
it appears because wiiflow and usbloader gx use custom usb2 interface with a non-standard device id.
The proper device ID for the SD slot is defined here - https://github.com/devkitPro/libogc/blob/master/gc/sdcard/wiisd_io.h
and for USB here - https://github.com/devkitPro/libogc/blob/master/gc/ogc/usbstorage.h

edit#2: so I think i now know why Fix94 added devo mount and unmount. wiiflow has 2 sd interfaces and 2 usb storage interfaces. for each - one is a custom and the other is modified code taken from libogc. when nount devo is called it uses the modified libogc code which will actually provide st_dev with the proper device ID as tueidj stated.
but at the same time so does cyan's fix.
so by me removing mount devo I probably broke it for USB users without a SD card. but this new fix by cyan should restore it.
 
Last edited by fledge68,
  • Like
Reactions: Cyan and Hakaisha

xLAKITUx

Well-Known Member
Member
Joined
Aug 19, 2011
Messages
117
Trophies
0
XP
344
Country
United States
So - end of an era. My 500GB external HDD (an older Buffalo MiniStation) that I've been using since I first installed homebrew apps on my Wii is nearly full. Looking for an upgrade. I've looked at the USB Devices Compatibility List

However, I was just curious - What external HDD are you all using? Mine is going to need to be at least 1 TB, and I'd prefer it to be portable (not needing an external power source).

Particularly curious as to what @fledge68 @Tetsuo Shima @RunningSnakes are using!
 

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
So - end of an era. My 500GB external HDD (an older Buffalo MiniStation) that I've been using since I first installed homebrew apps on my Wii is nearly full. Looking for an upgrade. I've looked at the USB Devices Compatibility List

However, I was just curious - What external HDD are you all using? Mine is going to need to be at least 1 TB, and I'd prefer it to be portable (not needing an external power source).

Particularly curious as to what @fledge68 @Tetsuo Shima @RunningSnakes are using!
i have a toshiba for my wii, seagate for my wiiu, and just bought a western digital. all 1TB. The only one i experienced any trouble with is the new WD. had trouble with wiiflow mounting it on wii u vwii.
 
  • Like
Reactions: xLAKITUx

xLAKITUx

Well-Known Member
Member
Joined
Aug 19, 2011
Messages
117
Trophies
0
XP
344
Country
United States
i have a toshiba for my wii, seagate for my wiiu, and just bought a western digital. all 1TB. The only one i experienced any trouble with is the new WD. had trouble with wiiflow mounting it on wii u vwii.

I only have the original LU-model Wii. Do you happen to know the model of the Toshiba you use?
 

AdamCatalyst

Well-Known Member
Member
Joined
May 26, 2020
Messages
179
Trophies
0
XP
1,128
Country
Canada
So - end of an era. My 500GB external HDD (an older Buffalo MiniStation) that I've been using since I first installed homebrew apps on my Wii is nearly full. Looking for an upgrade. I've looked at the USB Devices Compatibility List

However, I was just curious - What external HDD are you all using? Mine is going to need to be at least 1 TB, and I'd prefer it to be portable (not needing an external power source).

Particularly curious as to what @fledge68 @Tetsuo Shima @RunningSnakes are using!

The most stable unit I've used has been a Vantec NST-271C31-BK coupled with just about any 2.5" mechanical drive. Even drives I used to have issues with now just work in the Vantec enclosure. I haver never had it crash or freeze on load when the Vantec is using external power.
 

xLAKITUx

Well-Known Member
Member
Joined
Aug 19, 2011
Messages
117
Trophies
0
XP
344
Country
United States
The most stable unit I've used has been a Vantec NST-271C31-BK coupled with just about any 2.5" mechanical drive. Even drives I used to have issues with now just work in the Vantec enclosure. I haver never had it crash or freeze on load when the Vantec is using external power.

So wait a second... this is just a drive enclosure? You then just stick any internal HDD in there (like you would mount it in internal hardware) essentially converting an internal HDD into an external HDD?

I would be concerned with compatibility of drives at that point though. What's your hardware setup? (i.e. - what model Wii, what drive are you sticking in the enclosure?)
 

Tetsuo Shima

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
1,874
Trophies
2
Age
45
XP
4,889
Country
Italy
For my Wii I have :
Toshiba HDTB310EK3AA Canvio Basic HDD 2.5 ", 1Tb, USB 3.0.
Very happy with it. Everything works including emunand and neek2o (which requires 32k cluster size).
No external power source.
Formatted like this:
1st partition - FAT32 32k cluster size (dedicated to the Wii)
2nd partition - NTFS
 
  • Like
Reactions: Alexander1970

protivakid

Well-Known Member
Member
Joined
May 6, 2014
Messages
197
Trophies
0
Age
38
XP
629
Country
United States
@protivakid based on what you told me about inserting the SD card, I then knew that

DEVO_CONFIG->device_signature = st.st_dev;

has to be the problem. then I saw in usbloader gx code that cyan (way back in 2012) changed that line to

// st.st_dev doesn't work with our current device type. It returns Wii_UMS 'WUMS' instead of Wii_USB 'WUSB'.
// Only last two letters are returned by DevkitPro, so we set them manually to Devolution config.
DEVO_CONFIG->device_signature = st.st_dev == 'SD' ? 'SD' : 'SB';

at some point in time st.st_dev became broken maybe by a change in libogc or devkitppc. I can't seem to track it down or find where @Cyan got his info from. anyway I'm assuming that older version of wiiflow that it worked was compiled before st.st_dev was broken and afterward nobody caught it because they switched to nintendont or they always had a sd card inserted like me.

I added that change in wiiflow lite and would love for you to try this download - https://www.mediafire.com/file/m7wu278cgjn5ir4/wf5.4.7devo_test1.zip/file

It works for me but I have an SD card and sorry don't feel like trying to move everything to USB to test it.

edit: i just found where cyan and tueidj talked about it here - https://gbatemp.net/threads/devolution-public-release.330554/page-54#post-4339227
it appears because wiiflow and usbloader gx use custom usb2 interface with a non-standard device id.
The proper device ID for the SD slot is defined here - https://github.com/devkitPro/libogc/blob/master/gc/sdcard/wiisd_io.h
and for USB here - https://github.com/devkitPro/libogc/blob/master/gc/ogc/usbstorage.h

edit#2: so I think i now know why Fix94 added devo mount and unmount. wiiflow has 2 sd interfaces and 2 usb storage interfaces. for each - one is a custom and the other is modified code taken from libogc. when nount devo is called it uses the modified libogc code which will actually provide st_dev with the proper device ID as tueidj stated.
but at the same time so does cyan's fix.
so by me removing mount devo I probably broke it for USB users without a SD card. but this new fix by cyan should restore it.

A special version of WiiFlowLite just for me! haha, I just tested and yes this FIXED the problem! I had Phantasy Star Online booting and connecting to the private server. I really appreciate all of the hard work and hope this version eventually helps someone besides just me.

I did notice covers & game database field were still freezing mid-way through downloading / building but a reset of the Wii and a re-try seems to fix that so I'll live, again I appreciate all the work!
 
Last edited by protivakid,

fledge68

Well-Known Member
OP
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,962
Country
United States
A special version of WiiFlowLite just for me! haha, I just tested and yes this FIXED the problem! I had Phantasy Star Online booting and connecting to the private server. I really appreciate all of the hard work and hope this version eventually helps someone besides just me.
great! I can officially commit it. thanks to you inserting that blank sd card otherwise I had no idea. but it was interesting to figure what the problem was and how to fix it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Thank you. Hope you're in good spirits today like I am. :)