Adding a small capability to UNEEK+DI

Discussion in 'Wii - Hacking' started by conanac, Aug 28, 2011.

Aug 28, 2011
  1. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    As we all know, you could run cheat codes with GeckoOS or with the USBGecko+WiiRD (with debugger
    option set to On in S/UNEEK). However, given that there is already the debugger feature in S/UNEEK,
    we only need a few number of lines of codes to add the capability of inserting the content of codes
    in the cheat file (gct file) to the memory, after that you could just run the game directly from the disc channel
    along with the cheat codes that you want to use.

    I have recently been experimenting with this and just want to share in case anyone is interested.
    Feel free to modify or to enhance this as you wish. If you could share your improvement back
    then it would be great for the S/UNEEK users community. Future improvements (if anyone wants
    to continue this type of work) perhaps would include the debugger feature for channel-based games/contents
    or if DML codes become available, it would be great if we could have the Gamecube games debugger.

    For this testing purpose, my set-up was UNEEK+DI r154 running SM4.3U with the choices of
    "Game debugging" On, "Debugger wait" Off, and "Hook type" OSSleepThread. And if you want to try
    here are the steps:

    1. Patch the dip.c file (in folder DI of S/UNEEK package), and recompile the dimodule.elf
    2. Put your cheat file (named "codes.gct") into the associated game folder of interest
    3. Set those choices (you could try a different hook if you want)
    4. Run the game from the disc channel
    5. Profit

    Here is the video (and the link of the patch file is in the video description) to show the result of the
    experiment. Enjoy.

    [youtube]0rnpOAHreg4[/youtube]
     


  2. XFlak

    Member XFlak Wiitired but still kicking

    Joined:
    Sep 12, 2009
    Messages:
    9,122
    Location:
    Ontario
    Country:
    Canada
    cool, nice work!
     
  3. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    This is excellent! Did you also test your code on more recent revisions? Right now I'm using the latest one (r168).

    BTW, is the kenobiwii.bin file needed in order to use this?
     
  4. DeadlyFoez

    Member DeadlyFoez Banned

    Joined:
    Apr 12, 2009
    Messages:
    5,223
    Country:
    United States
    With what code? What are the addition/changes that you have done?
     
  5. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    He made changes to the DVDLowRead(); function on dip.c.
     
  6. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    Thanks for the comments XFlak and PabloACZ.

    Yes, you need the kenobiwii.bin. I use the one from the freedom-wii project by crediar:

    http://code.google.com/p/freedom-wii/sourc...a/kenobiwii.bin

    This file is needed for running the debugger feature in S/UNEEK (it is basically the code handler).

    The change is very minimal (adding a section of few lines of codes to read the gct file to the memory). Here is that section
    of code that should be inserted in the dip.c file.

    CODE
    //Begin section to add codes file
    sprintf( Path, "%scodes.gct", GamePath );
    s32 fc = IOS_Open( Path, 1);
    if ( fc < 0)
    {
    return DI_SUCCESS;
    }

    u32 Sizefc = IOS_Seek( fc, 0, 2 );
    IOS_Seek( fc, 0, 0 );
    s32 retfc = IOS_Read( fc, (void*)0x27D0, Sizefc );
    if( retfc != Sizefc )
    {
    return DI_SUCCESS;
    }
    *(vu8*)0x1807 = 0x01;
    //End section to add codes file


    I have not tested with the latest revision (I currently use r168 only for playing/testing DML for Gamecube games). Nevertheless, I would assume if the debugger feature is still working with the latest revision (along with the ability of running Wii games from the disc channel) then this method should work as well.
     
  7. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    Thanks. I'll recompile the SNEEK+DI r168 binaries with your modifications and test it right away. [​IMG]
     
  8. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    Great, thanks for testing it.

    If you have USB Gecko and WiiRD application, you may want to test the debugger feature first in SNEEK+DI (without
    adding this section of code) to see if that works for you or not. This method will not work if the debugger feature by itself cannot run.

    Cheers.
     
  9. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    Well, it didn't work for me with r168 + NSMBWii. I used the same config you provided:

    • kenobiwii.bin file in SD:\sneek.
    • Game debugging: on.
    • Hook Type: OSSleepThread (I also tried with the other VI hook).
    • codes.gct file in USB:\games\SMNE01. It only contains the Moonjump and Infinite Fireballs codes.

    Sadly, I don't have an USB Gecko. I guess I'll have to try with r154.
     
  10. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    Try r169 now and let me know if you still find any problems.

    Thanks for testing it again.
     
  11. zizer

    Member zizer GBAtemp Addict

    Joined:
    Aug 23, 2010
    Messages:
    2,035
    Country:
    wow r169

    not bad
     
  12. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    Sure! Didn't know you were a committer in the SNEEK SVN.

    EDIT: no luck so far. I still don't know what am I doing wrong. I compiled the latest r169 without doing any modifications to the source, using the latest DevKitPPC and libogc, but keeping the DevKitARM r32.

    The configuration/paths are basically the same from before, but this time around I got a black screen when trying to boot up the game (with both Hook Types).
     
  13. zizer

    Member zizer GBAtemp Addict

    Joined:
    Aug 23, 2010
    Messages:
    2,035
    Country:
    What about di?

    for me di=0 kb (r169)
     
  14. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    Using devkitARM r32, devkitPPC r23, and libogc r1.8.7, the dimodule.elf size should be 52,674 bytes.
     
  15. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    I told you in the other SNEEK thread that I have no problems compiling any of the binaries with my setup: DevKitPPC r24, libogc v1.8.7 and DevKitARM r32 (and Python 2.7, for compiling the armboot.bin). I don't really know what's wrong with your DevKitPro environment. [​IMG]

    Have you tried uninstalling the entire libraries (DevKitPro), and then doing a clean install + replacing the existing DevKitARM for the r32?
     
  16. sk0ld

    Member sk0ld GBAtemp Regular

    Joined:
    Nov 22, 2005
    Messages:
    114
    Country:
    United States
    PabloACZ, your setup is failing because your USB is formatted 64K cluster, which should only be used for the SD.
    Right now your sneekdi is only reading and writing diconfig (USB) , and since you've mentioned you've only been using it for DML, (SD) it would only ever crash doing anything else USB.
    Just trust me on this.. and sorry, I really should have said something earlier. =\
     
  17. DarkMatterCore

    Member DarkMatterCore I like turtles.

    Joined:
    May 30, 2009
    Messages:
    886
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    If I disable the debug functions the game loads properly (I verified this some minutes ago. Hope this helps conanac). And as I stated before, I've running games through SNEEK since a loooong time ago, when my Wii drive died (r74 or so). DML is just something new I added to my setup.

    My Lacie Rikiki Go, the USB drive I'm using, was completely formatted to FAT32 using guiformat.exe, with 32K clusters, even before DML was released. So, it must really be something else...
     
  18. sk0ld

    Member sk0ld GBAtemp Regular

    Joined:
    Nov 22, 2005
    Messages:
    114
    Country:
    United States
    you should edit this then.
     
  19. nintendowii

    Member nintendowii GBAtemp Regular

    Joined:
    Feb 28, 2011
    Messages:
    105
    Country:
    Germany
    with r169 we must do the settings "Game debugging" On, "Debugger wait" Off, and "Hook type" OSSleepThread to enable the cheats?
     
  20. conanac
    OP

    Member conanac Be an Angel

    Joined:
    Sep 13, 2009
    Messages:
    252
    Country:
    United States
    Yes for the first two options, but you could choose other hook type if it is needed.
     

Share This Page