Gecko Codes Logical AND if Statement

Discussion in 'Wii - Hacking' started by HackingNewbie, Mar 8, 2017.

  1. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    Is there a way to do logical AND IF statements similar to the Cafe 09 codetype? And is there an equivalent to the Cafe D0000000 DEADCAFE line to end IF statements?
    @CosmoCortney
    @BullyWiiPlaza
     
  2. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,750
    1,423
    Aug 2, 2014
    Germany
    Doesn't it do exactly that?
     
  3. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    Well there isn't a logical AND IF statement that I can find in the documentation or an equivalent to D0000000 DEADCAFE to end if statements. Sorry if I'm asking a stupid question :S
     
  4. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,750
    1,423
    Aug 2, 2014
    Germany
    Code:
    32bit:
    09020000 LLLLLLLL
    VVVVVVVV 00000000
          . . .
    D0000000 DEADCAFE
    
    This checks if the 32bit value at LLLLLLLL has the same true bits as VVVVVVVV. If the condition is true the next code/s (represented by . . . ) is/are executed.
     
    HackingNewbie likes this.
  5. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    I mean with gecko codes for the wii
     
  6. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,717
    2,572
    Dec 8, 2014
    United States
    Ohio
    You could use assembly
     
  7. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,750
    1,423
    Aug 2, 2014
    Germany
    Ohhh, okay.
    Code:
    16 bits (endif, then) If equal
    28______ MMMMXXXX
    
    Adding 1 to ______ will make this code first apply an Endif.
    (It will still use ______ for address calculation; without the added 1)
    
    If 16 bits at ([ba+______] & not(MMMM))==XXXX,
    then codes are executed (else code execution set to false)
    
    
    To use po instead of ba, change the codetype from 28 to 38.
    For values of ______ >= 0x01000000, add one to the codetype.
    You use a mask for MMMM which will do an AND.
     
    Last edited by BullyWiiPlaza, Mar 8, 2017
    HackingNewbie likes this.
  8. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    What would the mask be?
    EDIT: all the values of all the buttons not wanted added together?
     
  9. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,750
    1,423
    Aug 2, 2014
    Germany
    Yes. But you should do
    Code:
    0x10000 - the value you want
     
    HackingNewbie likes this.
  10. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    Thank you so much for putting up with my silly questions I really appreciate it. Just one more question:
    can
    Code:
    E0000000 00000000
    
    Be used to end IF statements so the next piece of code isn't in the IF statement?
     
  11. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,750
    1,423
    Aug 2, 2014
    Germany
    Yes, I always used:
    Code:
    E0000000 80008000
     
    Last edited by BullyWiiPlaza, Mar 8, 2017
    HackingNewbie likes this.
  12. HackingNewbie
    OP

    HackingNewbie GBAtemp Fan

    Member
    476
    96
    Dec 29, 2016
    United Kingdom
    Somewhere in 2008
    Okay, that'll be all for my nooby questions :)
     
    BullyWiiPlaza likes this.