Making a Genesis Plus GX 1.4.0 (r535) forwarder.

Discussion in 'Wii - Emulation and Homebrew' started by niishou, Nov 30, 2010.

Nov 30, 2010
  1. niishou
    OP

    Newcomer niishou Newbie

    Joined:
    Aug 24, 2010
    Messages:
    8
    Country:
    Bolivia
    Well, I made a forwarder .dol using WiiMC Forwarder Source, and using Static Base WAD, with AHBPROT set. It worked flawlessly with r502 of GenPlus GX, but, with this new update (r535) it stopped working (I just get a black screen). I searched a little and I found that GenPlus had changed something in it's way of loading (If I understood right).

    So, I would ask you: What I can do to make it work, keeping all features? I don't know nothing about programming, by the way.

    Do I need to change something in WiiMC Forwarder Source or there is no way to keep AHBPROT feature?

    OR... Am I forced to use Homebrew Channel now?

    Thanks in advantage.
     


  2. turbotronic

    Newcomer turbotronic Advanced Member

    Joined:
    Sep 13, 2009
    Messages:
    95
    Country:
    Germany
    try the cfg usbloader wad from fix94 (supports meta.xml settings) und add to your genplus meta.xml
     
  3. niishou
    OP

    Newcomer niishou Newbie

    Joined:
    Aug 24, 2010
    Messages:
    8
    Country:
    Bolivia
    I tried it, but I'm still getting a black screen.
     
  4. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,535
    Location:
    ???
    Country:
    Germany
    Hey niishou, I tried it now and it works fine! I don't tested the argument, but it works fine without! I would make you a new forwarder, but my PC is broken... You can test my compiled genplus-gx version, use the mediafire link in my signature and please make sure you are using my latest cfg-loader forwarder:
    http://forwarder.fo.funpic.de/USBLoaderCFG...0IOS58%20v5.wad
     
  5. niishou
    OP

    Newcomer niishou Newbie

    Joined:
    Aug 24, 2010
    Messages:
    8
    Country:
    Bolivia
    Thank you, FIX94.

    Looks like it's the .dol uploaded in Google Code, with your compiled version works everything, your channel and mine. Now, for curiosity, why it works with your .dol and doesn't work with the other one?

    Your version is heavier (2.341 KB) than the other one (1.547 KB) that's the only difference I can see xD.
     
  6. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,535
    Location:
    ???
    Country:
    Germany
    My version is compiled with the libogc and libfat svn and the other libs are also bigger, that's it. Everything else is the same, I don't know why the official one doesn't work with a forwarder.
     
  7. Skater4599

    Member Skater4599 GBAtemp Advanced Fan

    Joined:
    May 29, 2008
    Messages:
    939
    Location:
    United States
    Country:
    United States

    Does yours load the app from USB drive? I've only gotten it working from SD card, but have not tried recently
     
  8. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,535
    Location:
    ???
    Country:
    Germany
    It works, yes. I tested my compiled version only now.
     
  9. Jacobeian

    Member Jacobeian GBAtemp Advanced Maniac

    Joined:
    May 15, 2008
    Messages:
    1,879
    Country:
    Cuba
    I think I got it.

    I compile my own version as well and they also are bigger than the one in googlecode,I always wondered why but...
    After some researches, it seems the official versions of genplus are compressed with dollz, this is an utility to compress compiled dol.

    Anyway, it seems compressed dols are not compatible with forwarders, most likely, decompression use memory that is also used by the loader
     
  10. FIX94

    Global Moderator FIX94 Global Moderator

    Joined:
    Dec 3, 2009
    Messages:
    6,535
    Location:
    ???
    Country:
    Germany
    [​IMG] Amazing find! That's a very helpful information, I never heard from dollz before.
     
  11. Jacobeian

    Member Jacobeian GBAtemp Advanced Maniac

    Joined:
    May 15, 2008
    Messages:
    1,879
    Country:
    Cuba
    More on that, I runned doltool -i on the boot.dol that is on the download page.

    There are actually two .text sections (code portions):

    one at $80499BE0 which is 2016 bytes long
    another one at $8049A3C0 which is 1581152 bytes long

    entrypoint of the DOL is $80499BE0 so the first section is much likely the dollz decompression routine which runs first and the second section is the original DOL compressed, which is decompressed, relocated and finally booted.

    I think the entrypoint is calculated by Dollz so it runs just after the memory area reserved to the original DOL, and does not overwrite itself while decompressing/relocating it.

    Now, in the WiiMC forwarder source code I see this:

    Code:
    ÂÂÂÂ// load entry point
    ÂÂÂÂstruct __argv args;
    ÂÂÂÂbzero(&args, sizeof(args));
    ÂÂÂÂargs.argvMagic = ARGV_MAGIC;
    ÂÂÂÂargs.length = strlen(filepath) + 2;
    ÂÂÂÂargs.commandLine = (char*)malloc(args.length);
    ÂÂÂÂstrcpy(args.commandLine, filepath);
    ÂÂÂÂargs.commandLine[args.length - 1] = '';
    ÂÂÂÂargs.argc = 1;
    ÂÂÂÂargs.argv = &args.commandLine;
    ÂÂÂÂargs.endARGV = args.argv + 1;
    
    ÂÂÂÂentrypoint exeEntryPoint = (entrypoint)load_dol_image(buffer, &args);

    and in the function load_dol_image:

    Code:
    ÂÂÂÂif (argv && argv->argvMagic == ARGV_MAGIC)
    ÂÂÂÂ{
    ÂÂÂÂÂÂÂÂvoid *new_argv = (void *) (dolfile->entry_point + 8);
    ÂÂÂÂÂÂÂÂmemmove(new_argv, argv, sizeof(*argv));
    ÂÂÂÂÂÂÂÂDCFlushRange(new_argv, sizeof(*argv));
    ÂÂÂÂ}
    This is most likely used to pass parameters to the loaded DOL and it probably works with applications that were compiled with a recent devkitppc. Dollz entrypoint however, points to an embedded routine that has been compiled long time ago and probably got corrupted when you try to copy that argv structure over it.

    I bet that recompiling the forwarder with a call to
    Code:
    entrypoint exeEntryPoint = (entrypoint)load_dol_image(buffer, NULL);
    instead, will fix all your issues
     
  12. niishou
    OP

    Newcomer niishou Newbie

    Joined:
    Aug 24, 2010
    Messages:
    8
    Country:
    Bolivia
    You're right, re-compiling the forwarder with that change fixed the compressed .dol problem. [​IMG]
     
  13. NewFang

    Newcomer NewFang Advanced Member

    Joined:
    Feb 11, 2010
    Messages:
    76
    Country:
    United States
    Can you post a video of this forwader channel, I'm curious to see brfore I try it. Thanks.
     
  14. xasmir

    Newcomer xasmir Newbie

    Joined:
    Feb 11, 2009
    Messages:
    3
    Country:
    United States
    where can i get the forwarder?
     
  15. Skater4599

    Member Skater4599 GBAtemp Advanced Fan

    Joined:
    May 29, 2008
    Messages:
    939
    Location:
    United States
    Country:
    United States
    @ Jacobien and FIX94

    THANKS GUYS! Great info/find, helps me a lot. I have not compiled the args change yet but it seems logical and should work great. Thanks again [​IMG]
     
  16. xasmir

    Newcomer xasmir Newbie

    Joined:
    Feb 11, 2009
    Messages:
    3
    Country:
    United States
    i cant find a forwarder that loads the new genplus gx from usb or sd
     
  17. Bladexdsl

    Member Bladexdsl ZOMG my posts...it's over 9000!!!

    Joined:
    Nov 17, 2008
    Messages:
    14,347
    Location:
    Queensland
    Country:
    Australia
    the one i have works with 1.4.1 too dunno where i got it but it's got sonic and tails on the front sonic looks like his running on the spot.
     
  18. Skater4599

    Member Skater4599 GBAtemp Advanced Fan

    Joined:
    May 29, 2008
    Messages:
    939
    Location:
    United States
    Country:
    United States
    Here I've compiled one from that same wad file, using nforwarder58 source and i made a custom loading splash

    Sega Genesis

    This one works off both sd and usb, and at USB 2.0 speeds
     
  19. xasmir

    Newcomer xasmir Newbie

    Joined:
    Feb 11, 2009
    Messages:
    3
    Country:
    United States
    Thanks skater4599 for the forwarder , I'll try it when I get home THANKs! [​IMG]
     
  20. chazman14

    Newcomer chazman14 Member

    Joined:
    Aug 16, 2010
    Messages:
    29
    Country:
    United States
    Does this work with the new 1.4.1 release?
     

Share This Page