Help compiling Wii homebrew apps

Discussion in 'Wii - Emulation and Homebrew' started by DarkDengar, Dec 10, 2016.

  1. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    Hello,

    I'm new to compiling anything for the Wii, but I wanted to give it a shot so I could use homebrew emulators on vWii with Ustealth support and learn something new. I have run the installer which installed devkitPro PPC r28, libogc 1.8.15. I also installed the most recently released portlibs from https://sourceforge.net/projects/devkitpro/files/portlibs/ppc/, as well as libwupc.

    Please refer to the attached screenshot. I cloned this repository so as to re-compile VBA GX 2.3.2 with Ustealth support (modified libfat.a). In the process of re-compiling, the make process got stuck here at "preferences.o" and I have no idea what I need to do to fix it. It continually throws this mysterious (to me) "Error 1" and stops compiling. Could someone who knows what they are doing with this compiling stuff please give me a nudge in the right direction? (I see the errors above "Error 1" but are they related to compile failure? There were plenty of similar-looking ones before but the .o files compiled alright.)

    [​IMG]


    UPDATE: I've read up on C programming and changed the code myself so as to resolve errors (which prevent compilation, apparently :P). The result: a successful compile. However, after loading up the .dol output from compilation on my vWii, the app freezes before fully loading. But downloading a ready-made binary from the same repository works just fine, though it lacks Ustealth support. So the changes libertyernie made do not seem to be the problem.
    In other words, I haven't really made any progress in this... But I've learned something!

    No one else seems to have this much trouble with compiling Wii homebrew apps :blink: I must be doing something incorrectly. Can someone tell me how they would go about compiling a Wii homebrew app in general? I followed this guide on Wiibrew to setup the devkitPro environment and have had success compiling the examples. It's only when I try cloning a repository and building from a makefile that errors prevent the program from finishing compilation. Are there any special steps or tricks I need to do? Do most people override the errors somehow? Or is there some patch I failed to download that fixes the errors?

    Again, thank you for taking the time to read this and in advance for any guidance you might offer me. :)
     
    Last edited by DarkDengar, Dec 11, 2016
  2. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    All the compile errors I am getting seem to be related to unsigned int and unsigned long int invalid conversions. But when I fix them, the app freezes when loaded up. Surely someone must have seen these invalid conversion errors before; what's the answer to this? Both preferences.cpp and video.cpp in the source have these errors. How should they be resolved? What do I need to do differently in order to compile working apps?

    I thought maybe it would help to see the output of the make. Or at least couldn't hurt?
     

    Attached Files:

    Last edited by DarkDengar, Dec 13, 2016
  3. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    3,849
    736
    Mar 2, 2015
    United States
    You'll either need to go back to devkitPPC r27 or manually fix all of the casting issues.

    If you want to update the code look for callback definitions that don't match their implementations and incorrect printf formatting codes. (i.e.: a callback might be defined as returning int* but the implementation is s32*. For printf errors most can be fixed by changing the %* statement. If the compiler warns of a conversion from long unsigned int to %i the %i should be changed to %lu)
     
    DarkDengar likes this.
  4. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    Thanks for your advice GreyWolf. I first attempted to fix the casting issues and compile with devkitPPC r28, but after numerous failures I opted to return to devkitPPC r27. I got some .dol's to compile without any errors, and without me modifying any code. However, it seems I'm not finished yet. I'm getting the same crash that I got from the .dol obtained from the VBA GX compiled for Ustealth in @OriginalHamster 's signature. Just to check, I also compiled an identical version with the original libfat.a. All 3 (Hamster's, mine w/ libfatmod, mine w/o libfatmod) of these .dols crashed at the same 1 of 2 points: After loading up okay, 1. when attempting to load a ROM or 2. when entering the Settings screen. I also tried running them in the Dolphin emulator. This is the error that came up when traveling to the settings screen:

    [​IMG]

    Interesting to note: the .dol that was downloaded directly from the VBA GX 2.3.2 github does NOT throw this error... Shouldn't the version I compiled with regular libfat and the one downloaded from github be identical? Assuming it was compiled with the same libraries...

    Anyone have any ideas of what might be causing this?
    I can get a picture of the stack dump screen on the vWii later if that would help illuminate the problem. I could also get a list of warnings from compiling. Whatever helps! I'm very confused as to why this still isn't working for me.
     
  5. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    3,849
    736
    Mar 2, 2015
    United States
    That's a Windows dialog. Do you have Hyper-V installed by any chance? It can make devkitPro not work.
     
  6. OriginalHamster

    OriginalHamster UStealthy

    Member
    3,381
    641
    Nov 2, 2008
    Cote d'Ivoire
    @DarkDengar I remember updated my vbagx sig, I used to boot it without problems, now I only use RetroArch, I delete my builds some time ago.
    Also make sure you have installed the libraries for PPC no ARM.
     
  7. niuus

    niuus GBAtemp Fan

    Member
    469
    212
    Mar 4, 2016
    Venezuela
    I would suggest you to use devkitpro r26, there seems to be some performance regressions from 27 and upwards.

    I have been trying to compile Snes9x GX with libogc 1.8.11, but it always gives me the same error:
    [​IMG]

    The funny thing is, it compiles successfully with libogc 1.8.12/1.8.14/1.8.15, but then some games get fatal errors that crash the emulator: for example, you cannot enter any battle in Chrono Trigger or Final Fantasy III.
     
    DarkDengar likes this.
  8. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    @niuus Your suggestion worked perfectly!! I downgraded to devkitPro r26 and libogc 8.1.12, then added the libfatmod, compiled, and ran it on vWii! Runs just fine and the Ustealth drive is visible to it.
    Thanks again @GreyWolf for putting me on the right path with downgrading... I'm sure it could be fixed by updating the code too, but though I wanted to learn from this, I didn't want to re-invent the wheel (unless I had to ;)). I did check, Hyper-V wasn't involved here so I won't say any more on that.
    Thanks for the input @OriginalHamster , for some reason the VBA GX build in your sig wasn't working for me... But if I understand what you said, those Ustealth builds you made are obsolete now? Anyways the other ones worked fine for me, just the VBA GX one wasn't. Thanks very much for making the other Ustealth builds :D.
    :gba: Now to have some fun!
     
    niuus likes this.
  9. OriginalHamster

    OriginalHamster UStealthy

    Member
    3,381
    641
    Nov 2, 2008
    Cote d'Ivoire
    @DarkDengar I haven't kept with latest releases, they couldn't be up to date versions. I'm now using RetroArch on Wii U side, it's being actively developed and can run games than weren't possible on Wii/vWii.
     
  10. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    3,849
    736
    Mar 2, 2015
    United States
    I can't see exactly what the error is but it looks like it happened during linking and might be an alignment error. Stuff like that should be fixed as it could be causing bugs in the current revision of the software. :)
     
  11. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    Oh! I understand now. RetroArch Wii U seems to be coming along, and other cool stuff on Wii U side too. I'm excited! But for now I prefer the stability/reliability of the vWii side. ^_^
    Would you want the 2.3.2 Ustealth VBA GX build I made to update the one in your sig? I understand you don't need it anymore but maybe others would?

    @niuus Could you post a link to the place where you got the SNES 9x GX source code from? If I learned anything from this experience, it's that dates are important. I downgraded all of the devkitPro libraries to be the release before the last successful compile date listed on the source code's github (which included r26, as you suggested). That might not be the problem here but it's probably worth checking.
     
  12. OriginalHamster

    OriginalHamster UStealthy

    Member
    3,381
    641
    Nov 2, 2008
    Cote d'Ivoire
    Sure, post the link and will update my sig.
     
  13. niuus

    niuus GBAtemp Fan

    Member
    469
    212
    Mar 4, 2016
    Venezuela
    Yeah, the source i use right now is:
    https://github.com/dborth/snes9xgx
    https://github.com/dborth/fceugx
    https://github.com/dborth/vbagx

    Did you by any chance compiled VBAGX? Do you get a DSI crash when entering Settings?

    EDIT: it turns out you can avoid the DSI crash if you enter a game (say, Tetris) first, and after that, you can go into Settings. If you exit the emulator, you'll have to repeat the cycle. Weird.
     
    Last edited by niuus, Dec 18, 2016
  14. DarkDengar
    OP

    DarkDengar Member

    Newcomer
    11
    4
    Dec 5, 2015
    United States
    That's interesting, VBA GX wouldn't even load games without crashing. I did successfully compile it now, but it is different source from the one you were using.

    I took a peek at the source pages and on the wiki found this:
    Instructions
    1. Ensure that you have devkitPPC r24 and libogc 1.8.7 or higher installed. If you have an older version, completely uninstall it first.
    2. Download and copy the ported libraries to your PPC portlibs folder (on Windows this is c:\devkitPro\portlibs\ppc)
    3. Download the source.
    4. Run Programmer's Notepad (installed with devkitPro)
    5. Find the Makefile from the source you downloaded. Click Tools > Make.
    6. You're done!

    Try this: grab devkitPPC r24, libogc 1.8.7, libfat-ogc 1.1.10, portlibs, and after installing them, try compiling. It seems like the closer to the original version used to compile the app, the more likely it will work. Maybe. It's worth a shot anyways!

    @OriginalHamster here's the link: https://www.dropbox.com/s/6bdiwo334c6d959/vbagx_2.3.2_ustealth.zip?dl=0
     
  15. icw35

    icw35 GBAtemp Fan

    Member
    480
    112
    Sep 22, 2010
    Guys, where do I find r26 to download and install or how do i go back to a previous version? The .exe I run always installs latest version and I get all those compile errors that DarkDengar was getting.

    Thanks!
     
  16. Wiimpathy

    Wiimpathy GBAtemp Fan

    Member
    416
    306
    Mar 3, 2010
    France
  17. icw35

    icw35 GBAtemp Fan

    Member
    480
    112
    Sep 22, 2010
  18. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    3,849
    736
    Mar 2, 2015
    United States
    If you want to compile anything recent with the older devkitPPC you need three things:
    devkitPPC r27 (should work as well as r26),
    the latest libogc for that version (1.8.12)
    and the libfat for that version of libogc (1.0.13)