Hacking How to self-compile USB-Loader GX?

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
I would be happy if someone could give me a little help in compiling USB Loader GX.
what do i need and where do i get it? (i think DevKit Pro and all libraries are free so this should'nt be a Problem ^^)

And should i rather compile using make in a command shell (i don't care if i do it on Windows or Linux, have both systems running) or Compile it through Programmers Notepad?

thx
 

xmrnogatcox

Well-Known Member
Newcomer
Joined
Oct 25, 2008
Messages
53
Trophies
0
XP
134
Country
United States
I'm a little busy right now but I'll try to make a quick tutorial for you when I get home. The easiest way is through Linux.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
there's already a tutorial (though, there's nothing special to it) :
http://gbatemp.net/index.php?showtopic=169078

read the bottom part of the message, it's even easier with giantpune method.
just be sure to use the libogc version corresponding to the loader revision you want to compile. (look in the "download tab" on google code to know which lib_version/loader_revision matches).

I guess you want to compile a r940+, so you would want to use the "libogc pack for devkitPPC r21 needed for R940+".
remember, don't post issues on google code regarding the new revisions without official build, they will be closed right away.

Here is a quick recap guide for windows :
for all the files, check the link I posted.

A) compiler installation :
1. install sliksvn and tortoisesvn
2. Download Devkitpro and update to the latest revision.
3. Replace "include" and "lib" folder in your c:/devkitpro/libogc/ folder with the provided zip from usbloaderGX website.
Attention: this version of libogc will work only for compiling USBloaderGX. keep a copy of your original libogc folder if you want to compile other homebrew.
4. Reboot your computer to register the environment variables correctly.

B) Source code compiling :
1. create a new folder located on your HDD, and be sure to place it in a path NOT containing a space. (drive:/homebrew/wii/usbloaderGX/ is a very good place)
2. go inside the new created folder and rightclick, select SVN checkout and write this : http://usbloader-gui.googlecode.com/svn/trunk/
3. once downloaded, doubleclick the gui.pnproj file, it will open programmer's notepad. Hit Alt+1 to compile.
 

petspeed

Well-Known Member
Member
Joined
Nov 13, 2009
Messages
1,146
Trophies
1
Age
49
XP
1,775
Country
Denmark
When I try this I get the following error:

wbfs_ntfs.cpp
q:/Gemmes/Wii/Homebrew/Compiling/source/GX/source/usbloader/wbfs/wbfs_ntfs.cpp: In member function 'virtual int Wbfs_Ntfs::GetFragList(char*, int (*)(void*, u32, u32, u32), FragList*)':
q:/Gemmes/Wii/Homebrew/Compiling/source/GX/source/usbloader/wbfs/wbfs_ntfs.cpp:13: error: '_NTFS_get_fragments' was not declared in this scope
make[1]: *** [wbfs_ntfs.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2

Can someone tell me what I am doing wrong?

Thanks

Edit: Updated the code with SVN Update to rev. 959 and now it compiles without errors.

Edit2:

giantpune said:
Some stuff to add...
1 If you use the libogc required for compiling USB Loader GX, you won't be able to compile lots of other apps, as we use a different version and it has conflicting definitions for vector/guvector. you will have to just go through the source and change most (or all) or Vector to say guVector. I did it with cfg loader and it works fine.

I tried to compile Wiiflow and Dop-mii aswell. Both programs would only compile using libogc from USB Loader GX and NOT the standard libogc. Why is that?
 

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
As I have set up a Virtual Machine running Debian Linux a litte how to for linux were great.
BTW: I'm not using KDE, Gnome etc. Command Line only so i need the options for make too

But thanks a lot for your help so far
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
If it works for the other loader, then it's because they need a modified version too, or doesn't use the modified files
tongue.gif

but for example, it will not compile for WiiSX.


About the errors, sometime I have errors too (about "undeclared variable, first time using it"), which I don't have when I use the other compiling method (either typing "make" in a dos command window, or using programmer's notepad). But sometime after few clean/make, it works again. it's just weird
tongue.gif

Maybe my environment variables are not correctly set (as I use multiple ppc/arm versions environement and select them with a Set command).
And I have a batch.exe.stackdump log on each make or clean, I don't know if it's a bad thing.


@Kawaii : Sorry, I don't know how to compile homebrew under linux. (but you said windows would be ok too, so I helped about that)
Giantpune might know, he uses one.
 

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
Cyan said:
@Kawaii : Sorry, I don't know how to compile homebrew under linux. (but you said windows would be ok too, so I helped about that)
Giantpune might know, he uses one.

Yes I said so, but i decided to use 2 VMs for compiling homebrew, one for USB Loader GX and another for SNES9x GX, FCEU GX etc.... so I don't need to set environtment variables every time.
 

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
@giantpune: thx a lot, i knew how to install devkit pro on linux. I only wanted to know if i need any parameters for make, but just typing make did well.
BTW: could it be that compiling under Linux x64 is faster than under Windows?
 

giantpune

Well-Known Member
Member
Joined
Apr 10, 2009
Messages
2,860
Trophies
0
XP
213
Country
United States
compiling with make under linux is faster than windows. devkit uses a compatibility layer to get programs that were made for *nux to run in windows. it works in reverse also. programs written for windows can be run with wine, but dont run as fast as they would in their native environment.

if it is speed you care about, you can really get it to compile faster using multiple jobs. most makefiles for wii projects are based on a premade one from the devkit examples which has a little booboo in it. you can replace the instances of "make" with "$(MAKE)". this will let the parent process pass proper parameters to child processes. now you can use the -j option of make. on my quad-core i can build with "make -j4" and it will build the entire project in 51 seconds.
 

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
now everything is working fine so far. just one little thing is left. after putting the compiled binary (boot.dol) on my SD:\apps\usbloadergx and starting it via HBC it tells me "no WBFS Drive found" I have a 500GB USB Drive formatted as FAT32 and it works fine with cfg loader, SNES 9x GX, FCEU... etc just USB Loader GX rev. 960 won't work.

and i also took the libogc provided at usb loader gui googlecode page for devkit pro rev 21
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
yeah, the last revision (960) doesn't find real wbfs drive either (not fat32), and just return to HBC after the count down.
using a previous version, the WBFS is detected just fine.

I guess It will be back in few days. I'm just waiting patiently.
 

giantpune

Well-Known Member
Member
Joined
Apr 10, 2009
Messages
2,860
Trophies
0
XP
213
Country
United States
its not really that the loader doesnt find your drive, but there is a change in the settings. the way the IOS is stored got changed, so now old settings files will try to get it to reload IOS1 or something really low.

heres how i fixed it
you can take out your SD card and start the loader and it will use default settings and should show your gamelist. put your SD card in now and click the sd card button. it will now reload and use all your old settings except the IOS selection. go to the settings screen and adjust the IOS setting like you want it.

you still cant play games with these revisions, so there not much point trying. but you will be able to look at your list of games.
 

Kawaii-Tora

Well-Known Member
OP
Newcomer
Joined
Sep 14, 2009
Messages
96
Trophies
1
XP
802
Country
Germany
ok, thanks.
just one another question; is it possible to choose a specific version via "svn checkout"?

PS.: I've tried compiling using make -j, compiling speed is incredible compared to the use of a single core out of 4. thx for that =)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: To ensure Florida is the freest state in the country, we will ban colors.