Adding a deactivator to gw code Start Button

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by dahacker2017, Jul 23, 2016.

  1. dahacker2017
    OP

    dahacker2017 GBAtemp Regular

    Member
    166
    26
    Jun 1, 2016
    United States
    Plz Help Me i Need a deactivator and acivator for this code both Start Button
    Code
     
    Last edited by dahacker2017, Jul 23, 2016
  2. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    I think there is no such function on gw to enable and disable cheat with the same button
     
  3. dahacker2017
    OP

    dahacker2017 GBAtemp Regular

    Member
    166
    26
    Jun 1, 2016
    United States
    damn ok :(
     
  4. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    I think of two ways for doing it:
    - Create your code in asm like @ymyn does his codes (really impressive and fun by the way ;))
    - Find a unused byte in the memory and do the following:
    1. Check the value, if it's not 1 or 0 set it to 0
    2. From now, 0 = disabled, 1 enabled
    3. On the press of start check that byte, if it's 0 set it to 1, if it's 1 set it to 0
    4. Do a conditional block on that byte, if it's 1 you're executing the code else you're exiting the code
     
  5. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    gw doesn't has if 0=1 else =0
     
  6. ymyn

    ymyn GBAtemp Regular

    Member
    232
    503
    Oct 5, 2010
    Last edited by ymyn, Jul 24, 2016
    Nanquitas likes this.
  7. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    You can easily do it yourself, all you need is a if and the read command.

    @ymyn: Great work as always, I did a plugin with all of your codes (credited of course). ;)
     
  8. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    he wants to use the same button
    unlike ntr, gw will run all lines, so the last line will be the one it will run because there is no if else command on gw
     
  9. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    No there's not a if else, but you can do a conditional block. ;)
    With that you can create your own if else.
     
  10. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    give an example
     
  11. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,288
    718
    Jun 14, 2011
    Gambia, The
    Bavaria
    Is there any tutorial about making ASM codes for the 3DS?
     
  12. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    Theory validated with the converter:
    Code:
    void    exemple_2d5e(void)
    {
        u32    data;
        u32    offset;
    
        data = 0;
        offset = 0;
        if ( 0x00000000 != READU32(0x08123456 + offset))
        {
            if ( 0x00000001 != READU32(0x08123456 + offset))
            {
                WRITEU32(0x08123456 + offset, 0x00000000);
            }
        }
        if (is_pressed( BUTTON_ST ))
        {
            if ( 0x00000000 == READU32(0x08123456 + offset))
            {
                WRITEU32(0x08123456 + offset, 0x00000001);
            }
            if ( 0x00000001 == READU32(0x08123456 + offset))
            {
                WRITEU32(0x08123456 + offset, 0x00000000);
            }
        }
        if ( 0x00000001 == READU32(0x08123456 + offset))
        {
            WRITEU32(0x0FFFFFFF + offset, 0xFFFFFFFF);
        }
        data = 0;
        offset = 0;
    }
    The code above is generated by my converter when I'll give him the code.

    — Posts automatically merged - Please don't double post! —

    You can read those for NDS, it's working the same way. ;)
     
    Last edited by Nanquitas, Jul 24, 2016
  13. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    it might work on ntr but it won't work on gw because
    DD000000 00000008 //if start is pressed{
    58123456 00000000
    08123456 00000001 //this will set addr = 1
    D0000000 00000000
    58123456 00000001 //then if addr == 1
    08123456 00000000 // addr will become 0 , it will always run this line when addr = 1
     
  14. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    Oh yeah... what a dummy...

    — Posts automatically merged - Please don't double post! —

    But using another variable as a boolean it might work:
    Generated code:
    We mark the address to signal a current change of state, with that it won't fill the second condition ;)
     
  15. MichiS97

    MichiS97 "Leftist snowflake milennial"

    Member
    GBAtemp Patron
    MichiS97 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    1,288
    718
    Jun 14, 2011
    Gambia, The
    Bavaria
    @Nanquitas but is there a debugger for the 3DS with breakpoints and all?
     
  16. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    With NTR you might be able to do it, but never really got into it.

    Another solution is to dump the process and open the dump into IDA.
     
    MichiS97 likes this.
  17. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    problem with gw is that it always runs the last condition regardless what you set above
     
  18. Nanquitas

    Nanquitas GBAtemp Addict

    Member
    2,046
    1,666
    Sep 29, 2015
    France
    South of France :)
    Yes, but the next condition is not fulfilled so it won't execute it. ;)
     
  19. dsrules

    dsrules GBAtemp Psycho!

    Member
    3,611
    499
    Sep 20, 2005
    it will be based on the last conditon of the code, so it still can't do two things with one button