WiiRd forum

Wii & Gamecube Hacking => WiiRD Remote Debugger => Topic started by: biolizard89 on November 25, 2009, 01:42:32 AM

Title: Debugging before launching game?
Post by: biolizard89 on November 25, 2009, 01:42:32 AM
Is it possible to debug before the game launches?  I'd like to peek/poke a few of the GC/Wii registers so that the game's apploader sees the new values.  I tried this with WiiRd 0.9.3 (Windows) and GeckoOS 1.06d for GameCube, and I just get the following:

> peek 80000028
Return value 2 while asking for status!
Resetting USB Gecko device driver!
Connection resetted!

Is anyone able to help me?

Thanks!

Edit: Alterrnatively, if there's another way to control the values of the GC/Wii registers that get passed to the game's apploader (gameconfig.txt file, maybe?), I'd be interested in that.  I see the following in the GeckoOS source code:
        u32 arealow = *(u32*)0x80000034;
        u32 areahigh = *(u32*)0x80000038;
        u32 maxfst = *(u32*)0x8000003c;
        u32 bi2 = *(u32*)0x800000f4;

        *(u32*)0x80000020 = 0xD15EA5E;          // Boot from DVD
        *(u32*)0x80000024 = 1;                          // Version
        *(u32*)0x80000030 = 0;                          // Arena Low
        *(u32*)0x80000034 = arealow;            // Arena High - get from DVD
        *(u32*)0x80000038 = areahigh;           // FST Start - get from DVD
        *(u32*)0x8000003C = maxfst;                     // Max FST size - get from DVD

        *(u32*)0x800000EC = 0x81800000;         // Dev Debugger Monitor Address
        *(u32*)0x800000F0 = 0x01800000;         // Dev Debugger Monitor Address
        *(u32*)0x800000F4 = bi2;                        // BI2
        *(u32*)0x800000F8 = 0x0E7BE2C0;         // Console Bus Speed
        *(u32*)0x800000FC = 0x2B73A840;         // Console CPU Speed


Here, it appears that the value at 0x800000F0 is hardcoded; this concerns me as that is one register which I wish to change.

Any help would be appreciated.
Title: Re: Debugging before launching game?
Post by: ichfly on November 29, 2009, 09:47:05 PM
I don`t know if this work at 1.06b but at 1.9.2 you can enable the gecko pause option at gecko os and edit the gui ini  look  at the gui ini for auto boot or something  like  this  and replace the 1 with a 0 then start the game and start the wiird  the game hasn`t stated and you can edit the ram

sorry for bad english
Title: Re: Debugging before launching game?
Post by: biolizard89 on December 04, 2009, 01:29:35 AM
Quote from: ichichfly on November 29, 2009, 09:47:05 PM
I don`t know if this work at 1.06b but at 1.9.2 you can enable the gecko pause option at gecko os and edit the gui ini  look  at the gui ini for auto boot or something  like  this  and replace the 1 with a 0 then start the game and start the wiird  the game hasn`t stated and you can edit the ram

sorry for bad english
I just tried using the "hook pause" command, which I think is equivalent to what you're talking about (telling GeckoOS to boot the game but not proceed), and the problem is that this command executes the apploader before I can run debug commands.  For example, by the time I open WiiRd and look at the memory, even though the game is still on the green screen, the FST is already loaded, and the apploader has already run.  This means that I cannot change registers so that the apploader sees them, since the apploader has already finished.

Any ideas on how to run a few peeks and/or pokes before the apploader executes?

Thanks!
Title: Re: Debugging before launching game?
Post by: ichfly on December 05, 2009, 10:47:48 PM
This may could set your ram bevor the apploader it is out of the gecko os sorce

        app_loadgameconfig(gameidbuffer);
       
        // Need to load codes to high mem but not apply

but I don`t know what Need to load codes to high mem but not apply means even some of them will be overridden bay the code you postet the other way was to write modifired gocko os easyly add some extra comands in the sorce code

This wiibrewarticle is may interesting too http://www.wiibrew.org/wiki/Memory_Map

sorry for bad english