Homebrew Making a Genesis Plus GX 1.4.0 (r535) forwarder.

niishou

Member
OP
Newcomer
Joined
Aug 24, 2010
Messages
8
Trophies
0
XP
13
Country
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).

QUOTE said:
From: Issue 125
EkeEke: Actually I was wrong, there WAS a difference in rev 502: the emulator would automatically try to reload into IOS58 if AHBPROT was not detected (i.e was not set by the loader channel) AND if IOS58 was not already loaded (i.e was not reloaded or used by the loader channel already).

However, that still means your forwarder is not loading the application properly, probably because it is not shutting and/or reloading down IOS stuff, I guess this is not so trivial to do and only "serious" loaders to this properly, hence why unofficial forwarders are not supported.

Let's hope that can help fixing the code in your forwarder
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.
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
28
Location
???
XP
11,224
Country
Germany
niishou said:
turbotronic said:
try the cfg usbloader wad from fix94 (supports meta.xml settings) und add to your genplus meta.xml

I tried it, but I'm still getting a black screen.
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
 

niishou

Member
OP
Newcomer
Joined
Aug 24, 2010
Messages
8
Trophies
0
XP
13
Country
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.
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
28
Location
???
XP
11,224
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.
 

Skater4599

Well-Known Member
Member
Joined
May 29, 2008
Messages
965
Trophies
1
Location
United States
XP
1,504
Country
United States
FIX94 said:
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.


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

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
28
Location
???
XP
11,224
Country
Germany
Skater4599 said:
Does yours load the app from USB drive? I've only gotten it working from SD card, but have not tried recently
It works, yes. I tested my compiled version only now.
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
386
Country
Cuba
QUOTE said:
Your version is heavier (2.341 KB) than the other one (1.547 KB) that's the only difference I can see xD.

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
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
28
Location
???
XP
11,224
Country
Germany
Jacobeian said:
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
yaywii.gif
Amazing find! That's a very helpful information, I never heard from dollz before.
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
386
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
 

niishou

Member
OP
Newcomer
Joined
Aug 24, 2010
Messages
8
Trophies
0
XP
13
Country
Jacobeian said:
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
You're right, re-compiling the forwarder with that change fixed the compressed .dol problem.
yay.gif
 

Skater4599

Well-Known Member
Member
Joined
May 29, 2008
Messages
965
Trophies
1
Location
United States
XP
1,504
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
grog.gif
 

Bladexdsl

My posts is over 9000!!!
Member
Joined
Nov 17, 2008
Messages
20,086
Trophies
2
Location
Queensland
XP
9,944
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.
 

You may also like...

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Veho @ Veho:
    But it doesn't have a speaker or battery.
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Guess you could fit one in there.
  • Veho @ Veho:
    The contacts are there, and the device already has charge control circuitry, but you have to buy and solder the battery yourself.
    +1
  • Veho @ Veho:
    And that's too fiddly for ole' butterfingers over here.
    +1
  • Veho @ Veho:
    Gimme a finished product please.
    +1
  • Veho @ Veho:
    No rough edges either, I might hurt myself.
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Nah, I can do it within a few mins.
  • Veho @ Veho:
    Well yes, I suppose you can, but I can't.
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    If it has a USB port, then you could perhaps try connecting a power bank.
  • Veho @ Veho:
    It has USB-C.
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    That should be alright.
  • K3N1 @ K3N1:
    Well that was an owie hit my hand on the oven
  • M4x1mumReZ @ M4x1mumReZ:
    Hope you're alright there
  • K3N1 @ K3N1:
    I enjoy the pain
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Not weird at all
  • K3N1 @ K3N1:
    Who said I was normal
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    I didn't ask
  • M4x1mumReZ @ M4x1mumReZ:
    It's okay to not be normal, act natural
  • K3N1 @ K3N1:
    Ok just because you told me to
  • M4x1mumReZ @ M4x1mumReZ:
    That's fair
  • M4x1mumReZ @ M4x1mumReZ:
    I'm still bloody waiting for my eBay item to arrive, still haven't because of the *fuck you middle finger* pay strikes.
  • M4x1mumReZ @ M4x1mumReZ:
    Can imagine other people waiting for their Xmas gifts.
  • M4x1mumReZ @ M4x1mumReZ:
    Timestamp to the conclusion https://youtu.be/tAtaIZD0Ebs?t=624
    M4x1mumReZ @ M4x1mumReZ: Timestamp to the conclusion https://youtu.be/tAtaIZD0Ebs?t=624