Hacking Getting USB Loader with cover (libfat) function to work in channel?

  • Thread starter Thread starter twofive
  • Start date Start date
  • Views Views 2,233
  • Replies Replies 13

twofive

Well-Known Member
Member
Joined
Nov 20, 2008
Messages
148
Reaction score
0
Trophies
1
XP
118
Country
Poland
Currently I am throwing the profits of all the loaders together into my "own" loader.
I try to make a channel out of it, but it always throws a code dump when I load the channel or channel forwarder. From HBC or WiiLoad it works perfectly.
It stopped working as channel when I added cover support

Here is my code:
http://www.wii-free.de/usbl-rev3-bf2-mf2.zip

May someone take a look, please?
I already tried removing libfat functions but it still throws me a code dump.

Thanks!
 
well as I understand it, this is how it goes:
when launched from hbc, the hbc will pass the name of the folder containing the dol as an argument to the application.
That app can then use that to load its own stuff (such as covers)
But when launched directly from a channel or forwarder, no such argument is passed and the loader will crash when trying to use that argument.
The dol in the forwarder i posted (not my own creation, i just made the channel), will pass a hardcoded path as argument.
 
kedest said:
well as I understand it, this is how it goes:
when launched from hbc, the hbc will pass the name of the folder containing the dol as an argument to the application.
That app can then use that to load its own stuff (such as covers)
But when launched directly from a channel or forwarder, no such argument is passed and the loader will crash when trying to use that argument.
The dol in the forwarder i posted (not my own creation, i just made the channel), will pass a hardcoded path as argument.


Aahhh, thank you!
I think I know how to fix it now!

Thank you !
grog.gif
 
If I'm right, I have to modify this code:

Code:
ÂÂÂÂ/* Set current working directory as app path */
ÂÂÂÂchar buffer[0x100];
ÂÂÂÂchar *pos = strrchr(argv[0], '/');
ÂÂÂÂpos++;
ÂÂÂÂstrncpy(buffer, argv[0], pos - argv[0]);
ÂÂÂÂbuffer[pos - argv[0]] = '';
ÂÂÂÂchdir(buffer);
ÂÂÂÂ/* Show background */
ÂÂÂÂBackground_Show();
ÂÂÂÂ
ÂÂÂÂif(devmode) {
ÂÂÂÂsleep(1);
ÂÂÂÂ}

I don't really understand the code; I just want to be able to read from SD from a defined folder (SD:/boxart/xxxx.png)
May someone please tell me how to do that?

I have never used libfat before.

Thanks in advance
- twofive
 
If you have the source of a forwarder try to init the sd card with these commands:
__io_wiisd.startup();
fatMountSimple("sd", &__io_wiisd);

and deinit with these after you loaded the .dol:
fatUnmount("sd");
__io_wiisd.shutdown();

And remove all other fat init or deinit commands, especially the fatinitdefault as it kills usb in combination with ios reloads(and the usb launcher does an ios reload).

PS: I don't remember which includes you need for this exactly, but
#include
is one of them
 
WiiPower said:
If you have the source of a forwarder try to init the sd card with these commands:
__io_wiisd.startup();
fatMountSimple("sd", &__io_wiisd);

and deinit with these after you loaded the .dol:
fatUnmount("sd");
__io_wiisd.shutdown();

And remove all other fat init or deinit commands, especially the fatinitdefault as it kills usb in combination with ios reloads(and the usb launcher does an ios reload).

PS: I don't remember which includes you need for this exactly, but
#include
is one of them

I got it working using a forwarder, but I think I need to hardcode the SD path to make it work as a normal channel (without forwarder). Have you got any tips at this?
wink2.gif


-- two
 
chdir() is all you need to be on a certain path...as the code you posted says.

So chdir ("/") to be at root dir...
 
suloku said:
chdir() is all you need to be on a certain path...as the code you posted says.

So chdir ("/") to be at root dir...


Still throws me a code dump with my forwarder which doesn't pass the name of the folder containing the dol.
This thingy drives me crazy
biggrin.gif


Anyone please got some tips?
 
You used the wrong base loader for ocarina. Fatinitdefault is VERY bad for everything related to usb. I already corrected this in fishears loader, search for that.

And:
You initalize the fat twice, very bad also. I posted what you should use to init the fat, use it ONCE in the whole code.
 
WiiPower said:
You used the wrong base loader for ocarina. Fatinitdefault is VERY bad for everything related to usb. I already corrected this in fishears loader, search for that.

And:
You initalize the fat twice, very bad also. I posted what you should use to init the fat, use it ONCE in the whole code.


Where can i find codes “what you posted what you should use to init the fat”

plze tell me ?i can't find it ?thank u

hope your answer?
 

Site & Scene News