[Guide] How to create Gateway Cheat Codes

Discussion in '3DS - Tutorials' started by Localhorst86, Jan 18, 2016.

  1. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    Oh, that's clever.. I like smart people..

    On a side note, I have never made a guide on here before (and I don't even really post very often), but I was thinking about making a guide of how to do cheat code math (and maybe other ways of solving cheat code problems).. I was thinking maybe you could link to it if you want to (if I ever get off of my lazy bum and make it).. We obviously know how to do addition and subtraction already, and I am fairly sure I can do multiplication (but still need to make some test code to make sure), and I think if I can figure out how to do division also then I will probably be ready to make the guide, and probably will keep adding some stuff to it every once in a while if I need to.. I will try to figure that stuff out and do some tests in the next few days..
     
  2. Localhorst86
    OP

    Localhorst86 GBAtemp Advanced Fan

    Member
    950
    486
    Jul 17, 2014
    Germany
    My Nintendo works for Dad
    Multiplication should be easily implemented with a loop, right now my brain doesn't want to think about whether dividing would work, too, though

    Sure, if you create a guide that relates to gateway cheats, I'll link it gladly in the original post.
     
  3. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    Okay so as far as I can tell, any meaningful way to multiply or divide is impossible with the cheat system's very limited functions..
    This whole time I was thinking that the "D4000000 XXXXXXXX" instruction looked up the address at XXXXXXXX and added its value to the current data-register value..
    If that is the way that it worked, we could have multiplication and division and all sorts of higher-level functions..
    But unfortunately what that instruction actually does is just take XXXXXXXX as a value (not as an address) and just plainly adds that arbitrary number to the current data-register..

    What this means is that, although you can set/copy a value from an address using DB/DA/D9 instructions, after you copy that value to the data-register, you can only do 2 very basic functions after that:
    1: You can copy the data-register value to an address some where (D8/D7/D6)
    2: You can add an arbitrary value to the data-register (D5)..

    This means that if you use the D5 instruction, it is kind of "hard-coded" and can't dynamicly change based on any varying value in the game..
    So yeah, you can make a loop like this:
    C0000000 00000003 (Start loop 3 times)
    D4000000 00000004 (Add 4 to the data-register)
    D1000000 00000000 (End of loop)
    D3000000 32CA56F8 (Set offset)
    D8000000 00000000 (Write the data-register to 32CA56F8)

    That will multiply 4 x 3, which will set your rupees to 12, so yes we can technically multiply....but we can only multiply hard-coded numbers that we typed in.. Both the value of 4 and the 3 loops are hard-coded in to our codes and never change..
    This makes the fact that we can do multiplication completely pointless.. Because if the values are going to be hard-coded any way, we might as well just skip multiplication and just hard-code the value of 12 in to the codes..

    So this means that things like copying one value to an other is possible; like we can make a code that makes your rupees always reflect how many hearts you have, so if you have 4 hearts then you will also have 4 rupees; if you get a 5th heart, then your rupees automatically go up to 5 also..

    But things like multiplying a varying value and writing it to an address are (as far as I can tell) impossible.. Like even doing some thing simple like making your rupees twice as much as your hearts, so that if you have 5 hearts then you automatically have 10 rupees.. This is impossible to do with the limited functionality of this cheat system..

    I have even tried to figure out some weird convoluted way to do it, even if it used a ridiculous amount of code lines or nested loops.. But as far as I can tell, it is literally impossible..

    Like I said in the first paragraph, if we just had a simple code instruction that could look at a certain address's value and then add it to the current data-register, magic could happen and we could do much more.. But until then, unless some one else can point out some thing that I missed, I think we will have to live with very basic cheat functionality..

    EDIT: The ONLY way to possibly emulate such a thing would involve an ungodly number of conditional statements, like "if hearts = 1 then rupees = 2" and "if hearts = 2 then rupees = 4".. Basically hard-coding every possible value pair that you might need in to the cheat code.. This would obviously make your cheat-code really huge really quickly so you would never want to use it in most cases..
    But if some one desperately needs one value multiplied (or divided etc) by an other value, and the range of possible numbers is small (maybe the game only let's you have 9 hearts total or some thing) then some one could make a code for them selves to solve their problem I guess.. But it isn't true multiplication, it is just a ridiculously crude work-around until there is some thing better..
     
    Last edited by FF777, Jan 27, 2016
  4. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,058
    917
    Mar 8, 2009
    United States
    Japan
    I'm very interested in knowing how you found this code. I haven't tried your code yet, but I spent a good bit of time making my own Infinite heart code and it is much larger:

    D3000000 32000000
    00C824F4 01002424
    00D8D9E0 42FC0000
    00D8DB34 41100000
    00D8F854 00000009
    00D8F92C 41100000
    00D8F944 41100000
    00D8F990 41100000
    00D8FBB4 00000009

    This is on a 10.5 emunand, USA N3DS, running TFH 1.3.0. It's weird that I had to use all of these addresses (and none of them match yours), and it still isn't quite right. You know how the last heart (on the far right) you have is supposed to sort of pulsate? Once I am hit, the second one pulsates even though all are filled. Also this code freezes the game if you forget to turn it off before you grab whatever is in a large chest and exit the stage back to the castle...
     
    Last edited by urherenow, Jan 29, 2016
  5. Localhorst86
    OP

    Localhorst86 GBAtemp Advanced Fan

    Member
    950
    486
    Jul 17, 2014
    Germany
    My Nintendo works for Dad
    You'd have to ask FF777, its his code. I only changed his existing code slightly to show him how he could make his code more "stable"

    From what youre describing, though, it seems you're only modifying the addresses that are responsible for displaying the hearts, not the hearts themselves.
     
  6. json

    json MUSCLEMAN

    Member
    693
    781
    Aug 9, 2013
    Burkina Faso
    Can you make a list of types of codes you would want added? We can mail it to gateway and see if they can add it
     
  7. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    I emailed them the other day (their "sales" email since that is the only one I could find) telling them that they should add that "I forgot" option to the cheat menu..

    I have no idea what types of cheat codes they should add, but off the top of my head:

    1: They definitely need one that reads from an address and adds it to the data-register (and also one that reads from an address and subtracts the value)..
    Kind of like: ZZ000000 XXXXXXXX where ZZ is the code-type and XXXXXXXX is the address(+offset) it reads from..
    I believe adding these two code-types alone (address addition and subtraction) would really enable lots of higher-level functions like multiplication and division and stuff.. Like I said in a previous post, with the very limited code types we have now, you can't do any thing like [Make Luigi's lives twice the amount of Mario's] or like [Your HP is always half of the maximum].. You just can't do those things with our current cheat system..
    Here is an other neat code you could do with like if you were playing some RPG with 4 people like a final-fantasyish game; Maybe you don't want to use the plain old "Infinite HP for Every one" code because that makes the game way too easy and boring and feels like you are cheating too much.. So instead you create a code that doesn't necessarily give you any more HP, but allows you to redistribute all of the party-members' HP evenly among them selves when you push an activator button; Here is some pseudo-code:
    [L+R+D-Up to Share HP]
    > Detect if L+R+D-Up is being pressed; if so then:
    > Set data-register/DR to 0
    > Add 1st player's HP to DR
    > Add 2nd player's HP to DR
    > Add 3rd player's HP to DR
    > Add 4th player's HP to DR
    > Divide DR by 4
    > Set each of the 4 players' HP to the value in DR
    > Profit
    (See how great communism can be?)

    2: It would be nice to have a 2nd data-register so that you can hold more than merely a single value in memory.. Although it is probably not absolutely necessary because you can actually do quite a bit just with 1 data-register (as long as you have good code-types for manipulating it!)..

    3: Gateway needs to get around to adding the new-3ds-exclusive buttons to the possible button-activator values, because:
    > Lots of people have new-3DSs and this trend will only increase as time goes on..
    > It seems incomplete to not have them..
    > If some one with an old-3DS wants to use codes that use new-3ds-exclusive buttons, all they have to do is change the activator value to whatever they want..
    > new-3DS users should not have to suffer just for the sake of old-3DS users..

    4: Add a damn code-type that subtracts.. It isn't that difficult.. And if some one subtracts from 0x00000000 then just make it loop back to 0xFFFFFFFF.. Simple as that.. It is the same way the addition operation works; If you add 1 to 0xFFFFFFFF it loops back to 0x00000000 (right?).. As it stands now, we have to use some convoluted method to subtract a number.. We don't necessarily need a multiplication or division code-type because you can build both of those functions on top of the addition and subtraction operations.. But it would be nice to have them for convenience and for code efficiency (makes the codes shorter)..

    So, that is all I can think of off the top of my head.. I wish I could be in charge of the cheat-code team so I could whip them and command them of what to do.. I would have a very robust cheat-system implemented.. If nothing else, have some other CFW like NTR or some thing create a better cheat-system with tons of features to try to force gateway to have to improve their cheat-system functionality to stay competitive and relevant..

    If I could choose just 1 code-type to be implemented, it would be #1 from my list above: The ability to read from an address and add the value to the data-register; however it would really need a subtraction equivalent also! Because, although we can use a convoluted way to subtract a hard-coded arbitrary number that we decide our selves (the cheat-code makers), in a code-type like #1 there is no way (not even a convoluted one) to subtract a number that was read from an address by only using addition.. It is literally impossible.. So if #1 were to be implemented, it would really need the subtraction counter-part too or else the code would be half-baked.. You could always add more stuff like rupees, hearts, etc, but there are lots of situations where you have to subtract too (enemies' health, player X and Y coordinates, etc)..
     
    Last edited by FF777, Jan 29, 2016
  8. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    I'm not sure what you did to try to make such a code as yours, but I will go through the steps of what I did on mine I guess..
    First of all, I am not sure why you are setting large swaths of 32-bit values every where.. That might have some thing to do with the freezing at the end of a dungeon..

    When I started searching for the heart code, I knew that zelda games usually sub-divide each heart in to smaller sub-units, because usually in zelda games it is possible to suffer half-heart damage and end up with, for example, 4.5 hearts..
    Because of this presumption I didn't start with an exact-value search like "I have 5 hearts so I will search for the value '5'"......I didn't think that would lead me any where..
    Instead I did the relative-value search, but the 8-bit version of it because I guessed that the game probably didn't sub-divide the hearts finely enough to push the total possible heart value over that of 255.. And of course I chose the "unsigned" version of the search because the game doesn't really deal in negative heart values (hopefully we can use the signed version when nintendo comes out with a zombie version of zelda)..

    Then you just do the rinse-&-repeat cycle of:
    1: Change your current hearts (take damage from an enemy, or pick up hearts etc)
    2: Do the next code search (greater than, lesser than, etc)
    3: Some times I will just walk around for a while with out changing my hearts and just do an "Equal" search to filter out any other unwanted values that might be changing..

    Eventually I found out that the heart value is at 32CA6404 (although I am playing the jap version, so not sure if it is different for other versions of the game or not) and I found out that the game sub-divides each heart in to 4 pieces; So if you have 2 entire hearts in the game, the current-heart value will be "8".. And also, I don't have any of the DLC for the game either (although that shouldn't make a difference, but can't be sure)..

    While you are in the "View hits" list, you can push A to go to the hexadecimal map of the game's memory.. While I was in there looking at the current-hearts value (32CA6404), I noticed that the value immediately adjacent to this (32CA6405) was the same value as the current-hearts value (I had full life at the time).. I speculated that this adjacent value might possibly be the value that stores the maximum hearts possible (and turns out I guessed correctly)..

    As I stated in one of my previous posts (I think), if I just crudely made a code that constantly sets the address 32CA6404 to a certain value, I will some times lose the ability to have the sword-beam when wearing the sword-suit; this is because the game apparently only enables the sword-beam if your current hearts are exactly equal to your maximum hearts.. So if your current amount of hearts has a higher value than the maximum number of hearts that are supposed to be possible, you won't have sword-beam functionality.. That is why I created a code that reads from the maximum heart value and copies it to the current heart value.. Although for some reason it doesn't fill up the extra heart containers that you have while wearing the heart suits (for some reason I guess they put the heart-suit hearts in a different address some where).. But this doesn't matter any way because you obviously can't wear the sword-suit if you are wearing a heart-suit, right?.. So even if you had full hearts while wearing a heart-suit, you still don't have the sword-beam because you aren't wearing the sword-suit..
     
  9. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,058
    917
    Mar 8, 2009
    United States
    Japan
    @FF777 You described exactly what I did. Except I am using the USA version with the latest update. I am well aware of losing pieces of heart in Zelda games, so I searched for 32bit unsigned (If you find what you're looking for, it's much faster than comparing every 8 bits. In badge arcade, it only takes 2 searches to be able to view the hit list if you do a 32 bit search, but 3 or 4 on an 8bit search). I swear every address in my code changes on my system when I gain/lose hearts, and always the same exact values, relative to the number of hearts I have. I have 1 code for regular, and another for 4 hearts.

    @Localhorst86 Nah... can't be just graphics. The boss I fought last night was this dude(s) throwing bombs at me in a rail cart thingy. I would have been dead many times over...

    I guess I'll have to go through the painful process of trying again with 8bit searches to see what comes up differently. Different region games usually do have different offsets though.
     
  10. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    That is probably the reason you aren't finding the value.. Yeah 32-bit search will be faster, but if the value you are seeking is actually only 8-bit, then you run in to some problems with a 32-bit search..

    When doing a 32-bit search, the system is reading 4 bytes at a time and then comparing that to your search to see if it matches or not.. The 8-bit value you are looking for is actually only 1 byte.. So the only way you would find it with a 32-bit search is if the 3 neighboring bytes next to the one you are looking for are all zeros, such as: 08 00 00 00 (small endian)..

    However, if any of the 3 neighboring bytes are not 00, then the 32-bit value would appear much bigger than what you are searching for.. So for example, if the byte you are looking for, plus the 3 neighboring bytes look like this: 08 36 00 00, then you are not going to find the 8-bit value you are searching for.. (And this is the case in zelda, because the byte right next to the current-heart value is where the maximum-heart value is stored)..

    An other problem with your code is that, even if you did some how find the correct value using a 32-bit search, you don't want to use the 32-bit-write code-type to write an 8-bit value, because it will over-write the 3 neighboring bytes next to it (probably to 00 00 00).. If you look at your code lines that you made, you will see that it is writing lots of zeros every where, maybe even including to the maximum number of hearts that you are supposed to have..
    Instead of the 0XXXXXXX code-type (32-bit), you should use the 2XXXXXXX code-type (which only writes 8 bits)..
     
  11. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,058
    917
    Mar 8, 2009
    United States
    Japan
    Shouldn't be a problem because EVERYTHING I am writing happens to be the current state of those addresses when I start a level and have full hearts. If I have full hearts (same is true for the code I'm using for 4 hearts), and manually change any one of those addresses to something different using the hex editor, then exit... nothing will change. In fact, I can go back and look at the address again, and it will have been changed back to what it was in my code.

    For 4 hearts, the values are:

    D3000000 32000000
    00C824F4 01001010
    00D8D9E0 42600000
    00D8DB34 40800000
    00D8F854 00000004
    00D8F92C 40800000
    00D8F944 40800000
    00D8F990 40800000
    00D8FBB4 00000004

    8 hearts:
    01002420
    42E00000
    41000000
    00000008
    41000000
    41000000
    00000008

    Perhaps you just happen to find the pointer, while I found actual code, to include verification, or something?
     
    Last edited by urherenow, Jan 30, 2016
  12. FF777

    FF777 人を呪わば穴二つ

    Member
    133
    44
    Nov 22, 2006
    United States
    Well, your game is freezing at some point though, right?..
    Just because those values might all be like that most of the time when you start a level, it doesn't necessarily mean they all stay at those exact values at other points in time (like exiting the level or some thing)..

    I don't know what purpose every individual value serves in this particular game, but I try to stick to the coding principle of "Change only what you need to."
    None of us know the game as well as the programmers that created it, so if one goes around freezing various values in to place so that they can not possibly change, and they have no idea if/when the game uses them (I would imagine those values are there for some reason), then it might lead to glitches at some point in the game when the game tries to change those values..

    Kind of like if some one used a bazooka to kill a fly, and then wonders "Why is part of my house gone?".. A fly-swatter will do the job fine, you don't need any thing bigger, and your house will still be intact after you swat him..

    P.S.: The address I am changing in my code is not a pointer.. I would have to use the pointer code-type to do that (the BXXXXXXX code-type)..
     
    Last edited by FF777, Jan 30, 2016
  13. urherenow

    urherenow GBAtemp Psycho!

    Member
    3,058
    917
    Mar 8, 2009
    United States
    Japan
    Well, AFAIK there is no way to lose hearts outside of a level, so I guess I need to see what happens to those addresses when I'm in the town... Exiting the level with the code active is the only thing that causes the freeze (but thankfully, the fact that I have completed the level and whatever item I got from the chest is saved when I force a reboot and go back to the game :P )

    Really, I'm just going to do the 8bit search thing to try to get the offsets for your code on the USA version. It will be satisfying, but the fact I found 8 addresses that have a direct relation to what you did with a single address is still going to bug me until I figure out why :wacko:

    Edit: and wouldnt you know it? The address is the same on my US version. Dont know what I was thinking before...
     
    Last edited by urherenow, Jan 30, 2016
  14. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,765
    2,619
    Dec 8, 2014
    United States
    Ohio
    Your tutorial is much more in depth than mine.
     
  15. cooroxd

    cooroxd Dirty Pirate

    Banned
    1,192
    522
    Aug 30, 2014
    Canada
    B.C.
    Hi,

    I'm trying to get the acnl text to item gateway cheat code to work on acnl. Here's the link: http://www.fort42.com/gateshark/game485/

    Whenever I press "R" after typing the item code, the game freezes. Any ideas why? I assume you enable all 3 parts of cheats same time? I'm using the latest gateway launcher on latest firmware and i'm using a USA .3dz rom.

    Also, i've tried other cheats like the unlimited coconut fruit, it works.
     
    Last edited by cooroxd, May 4, 2016
  16. Localhorst86
    OP

    Localhorst86 GBAtemp Advanced Fan

    Member
    950
    486
    Jul 17, 2014
    Germany
    My Nintendo works for Dad
    Usually when a code freezes the system it is manipulating the wrong addresses. Double check your code, if it still freezes the system it's simply not compatible.

    Gesendet von meinem Elephone P6000 mit Tapatalk
     
  17. BobNoton

    BobNoton Member

    Newcomer
    30
    8
    Jun 19, 2016
    France
    Your tutorial is very helpfull, thank you for it.

    I was asking myself if there is another one to know how to search very specific values, not like clear number like lifepoints or money, like in this sample for MHX game, made by @ymyn who I tried to join with no succes, with my comments afters "//" :


    [(SELECT+L)Player speed multiplier(SELECT+R)Speed x1 Ver1.2]
    DD000000 00000204 // On L + Select, like Localhorst86 explain
    D3000000 00000000
    00C027B0 XXXXXXXX -> x1.5:3FC00000, x2:40000000, x2.5:40200000, x3:40400000 // clearly the new value, obvious
    00C027B4 E51F000C // maybe specific body parts' speed, really don't know
    00C027B8 E5860040 // Same
    00C027BC ED960A10 // Same
    00C027C0 E12FFF1E // Same
    0030A4C8 EB23E0B9 // Same
    00C027C4 E51F001C // Same
    00C027C8 E5860040 // Same
    00C027CC E3A00000 // Same
    00C027D0 E12FFF1E // Same
    002F7DB4 EB242A82 // Same
    D0000000 00000000
    DD000000 00000104 //on R + Select
    00C027B0 3F800000 // put the player speed at the initial value, no idea how it have been found
    D0000000 00000000

    it's simply a "writting address on value when triggered" code, but how does he found adress ? that's not the only one whitch contains magic adresses on gameshark, specially on this game
    ---
    [EDIT]
    That's because his code is not on GW code but in ARM-ASM code, my bad
    ----
    I think my question has already been asked but clearly here :
    How the fuck did he found the player's speed adress ? 0x803F make 32 831, he can't had search this kind of value...

    ---
    [EDIT]
    3F8 is a float of 1.0 value
    But i still don't know the method to found it
    ---
     
    Last edited by BobNoton, Jul 5, 2016
  18. Haider Raza

    Haider Raza Alhumdulillah

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

    Our Patreon
    1,378
    254
    Jan 30, 2016
    Pakistan
    Can someone explain whole of this thread in simple words. Do I have to read all of it?
     
  19. BobNoton

    BobNoton Member

    Newcomer
    30
    8
    Jun 19, 2016
    France
    There is only 2 pages, you can read it quickly x)
    But the main post is the most important in fact
    After there is some sample of codes which can be helpful
     
  20. EliteGamer105

    EliteGamer105 GBAtemp Regular

    Member
    272
    65
    Jun 15, 2014
    United States
    boot.firm, New Jersey
    Hello. I have this weird problem with one of my pointers found in Mario Kart 7. Whenever I activate the code outside of a race, my game crashes with a white screen when trying to load a course. It's supposed to enable you to have infinite mushrooms in Time Trials. Note that I have added conditionals and it still doesn't work.

    If anyone can help me, it would be very much appreciated.

    Here are the codes I am showing you:

    Code Without Conditionals

    6FFFE71C 00000000
    BFFFE71C 00000000
    B0000558 00000000
    20000BA0 00000000
    D2000000 00000000

    Code With Conditionals

    4FFFE71C 16000000
    3FFFE71C 18000000
    BFFFE71C 00000000
    B0000558 00000000
    20000BA0 00000000
    D2000000 00000000

    NOTE: the 20000BA0 00000000 line enables you to use an item an unlimited number of times, even though it says 0 uses of the item, it still gives you an infinite amount for some odd reason.