Help with some coding (code inside!) error

Discussion in 'Wii - Emulation and Homebrew' started by Dan_Aykroyd, Jul 10, 2009.

Jul 10, 2009
  1. Dan_Aykroyd
    OP

    Member Dan_Aykroyd GBAtemp Fan

    Joined:
    Oct 30, 2008
    Messages:
    318
    Country:
    United States
    Hi!

    I'm trying to modify WAD Manager source code for the device selection screen, but I can't get past an issue. Here the code now:

    CODEu32 buttons = Wpad_WaitButtons();

    ÂÂÂÂ/* Select source device */
    ÂÂÂÂfor (;;) {
    ÂÂÂÂÂÂÂÂ/* Clear console */
    ÂÂÂÂÂÂÂÂCon_Clear();

    ÂÂÂÂÂÂÂÂ/* Selected device */
    ÂÂÂÂÂÂÂÂdev = &deviceList[device];

    ÂÂÂÂÂÂÂÂprintf("\n[+] Selected IOS version: < IOS%d >\n\n\n\n", iosVersion[iosSelected]);

    ÂÂÂÂÂÂÂÂfor(i=0;i
     
  2. emupaul

    Member emupaul GBAtemp Fan

    Joined:
    Jun 26, 2009
    Messages:
    416
    Location:
    space
    Country:
    United States
    is the first piece of code the body of Menu_Device();?
     
  3. Dan_Aykroyd
    OP

    Member Dan_Aykroyd GBAtemp Fan

    Joined:
    Oct 30, 2008
    Messages:
    318
    Country:
    United States
    Yes, it is. This is the upper part which I didn't post:

     
  4. emupaul

    Member emupaul GBAtemp Fan

    Joined:
    Jun 26, 2009
    Messages:
    416
    Location:
    space
    Country:
    United States
    I suggest changing how the loop works make a condition like

    Code:
    do{
    buttons = PAD_ButtonsDown(0);
    //fill in the rest. 
    }while(!done );
     
  5. emupaul

    Member emupaul GBAtemp Fan

    Joined:
    Jun 26, 2009
    Messages:
    416
    Location:
    space
    Country:
    United States
    make sure buttons doesnt return NULL check for it.


    if(buttons==NULL)
    printf("failed");
    else
    //I dont know im guessing you want to init pad
    // then try to poll buttons again.
     
  6. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    comment whole code (device selection part) and set the dev variable manually...

    for example....
    dev = &deviceList[0];
     
  7. Dan_Aykroyd
    OP

    Member Dan_Aykroyd GBAtemp Fan

    Joined:
    Oct 30, 2008
    Messages:
    318
    Country:
    United States
    I've tried that before even posting the first post, and it still didn't work. [​IMG] And I used exactly that line you posted to replace the whole selection device "for"!

    But now I'm sure what the problem is: the IOS_Reload. If I coment that, it works OK (if I skip the device selection). But if I let that line to exectue, it crashes. I can't figure out what that has to do with anything, even because I'm manually assigning the same values that the variables get when running through the "for", and it still doesn't work!

    Damn it
     
  8. WiiCrazy

    Member WiiCrazy Be water my friend!

    Joined:
    May 8, 2008
    Messages:
    2,391
    Location:
    Istanbul
    Country:
    Turkey
    Ok, now see there is also ios selection in the same codepiece... if you only want to filter out device selection then you need to comment only device selection related code... if you want to filter out both then filter out ios related stuff and call the IOS reload with the ios number you want...
     
  9. Dan_Aykroyd
    OP

    Member Dan_Aykroyd GBAtemp Fan

    Joined:
    Oct 30, 2008
    Messages:
    318
    Country:
    United States
    That's what I did. I commented the whole section out and set the selected device to &[0] and the selected IOS to 20 (the IOS249 array index for me), and it still didn't work!

    And the funny thing is that, when printing to the screen the value of those variables the first time it enters the for, it's exactly those values! So if I press "A", without moving the arrows, it works fine! But somehow, when I skip the "for" it crashes.

    I'm really clueless now as what to do. I spent some good couple of hours yesterday on something quite stupid as this. [​IMG]
     

Share This Page