Thanks for the answer. Just looked through the source code again and I think I understand now! :)
It's very strange to look at C code and understand it after working with Java and C# for so many years.
Sorry, I didn't explain enough, I did read devKitPPC.txt but I'm very noob at wii...