Welcome to the PokéCommunity!

Hi there! Thanks for visiting PokéCommunity. We’re a group of Pokémon fans dedicated to providing the best place on the Internet for discussing ideas and sharing fan-made content. Welcome! We’re glad you’re here.

In order to join our community we need you to create an account with us. Doing so will allow you to make posts, submit and view fan art and fan fiction, download fan-made games, and much more. It’s quick and easy; just click here and follow the instructions.

Pokémon Sun and Moon are now available! Read our extensive Sun and Moon review at Daily!

The finale of the fourth annual Favorite Pokémon Tournament is underway in Pokémon General!View the poll and vote for as many Pokémon as you'd like. Voting is only open until the 5th of December though, so don't wait to make your picks!

Assemble this routine and insert it into your ROM in an aligned location. That is, the address ends with a 0, 4, 8 or a C. Then navigate to 0x6E5D6 and change the code there to:

Code:

01 48 00 47 00 00 XX XX XX 08

Where the XX's stand for the location of your routine + 1 in little endian format (aka reverse hex).

And that's that. Once this routine is inserted, you can use any of the flags between 0x900 and 0x18FF (inclusive) safely without any problems!NOTE: This routine CUTS OFF ACCESS to flags outside the usable range of 0x0 - 0x18FF. That is to say, they simply stop working. I designed it like this to try to ensure that bad memory accessed would be less likely to happen.

Assemble this routine and insert it into your ROM in an aligned location. That is, the address ends with a 0, 4, 8 or a C. Then navigate to 0x6E45C and change the code there to:

Code:

00 48 00 47 XX XX XX 08

Where the XX's stand for the location of your routine + 1 in little endian format (aka reverse hex).

And that's that. Once this routine is inserted, you can use any of the variables between 0x5000 and 0x51FF (inclusive) safely without any problems!NOTE: This routine CUTS OFF ACCESS to variables outside the usable ranges. That is to say, they simply stop working. I designed it like this to try to ensure that bad memory accessed would be less likely to happen.

It should be noted that these routines are not mutually exclusive. You can have both or you can have one or the other. You do NOT need both for only the flag hack, or both for the var hack. Obviously, if you want both the flags and vars hack, you need both.

Since people seem to not understand how to assemble and insert ASM (understandable, it is awkward compared to scripting et al), I'm gonna quote this very useful mini-guide from further down this page.

Wow, you're an ASM King! Anyway, congrats, I may use this but using many variables is quite useless since a single variable can hold a value of 0-65,535 so using like three variables in a hack is possible. However, flags are limited so I may use that.

That's why I put significantly less extra variables into it than extra flags XD. However, don't underestimate the potential uses of combining the safe var hack and JPAN's hacked engine, for example, since that uses a significant number of variables to operate.

__________________

Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Nice work! Though you should also add proper documentation of what ram areas the codings use. That way, it would be clear where the users could store all kinds of other data as well and not just bit values/sets describing flags and vars.

Nice work! Though you should also add proper documentation of what ram areas the codings use. That way, it would be clear where the users could store all kinds of other data as well and not just bit values/sets describing flags and vars.

It's pretty clear if you understand the ASM, but that's obviously a bit of a rarity. It repoints the flags into 0x0203C000 - 0x0203C1FF (0x200 bytes in total, giving 8 * 0x200 = 0x1000 flags).

This memory is not normally saved, hence the requirement for JPAN's save block hack (which I link to a patch version of in the first post).

If you use both of these routines, you are left with 0x0203C600 - 0x0203CEC4 in the save block, meaning you can place other useful things in it, for example, you could store roaming Pokémon data in it (hint hint, wink wink ).

__________________

Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

Very much appreciated Jambo51 you are a Hall of Famer in my book... I'm going to try this right now and see what happens. I have never done ASM before but I will take it step by step and use some common sense, even though it seems fairly complex.
When this is installed correctly how could I test it and know? ( sorry for the noob question >_< )
And would it be ok to use XSE's rom expander?

Well I seem to be stuck =( I can't for the life of me find a ASM to hex assembler as I am not good with command promt. and do not wanna mess up my system. Is there any software that can take asm and turn it into Hex?

Well I seem to be stuck =( I can't for the life of me find a ASM to hex assembler as I am not good with command promt. and do not wanna mess up my system. Is there any software that can take asm and turn it into Hex?

You can find a set of files here which assemble ASM files into raw hex code. You're after the THUMB.bat file (and all the files it calls). You may want to read how to assemble the ASM in that short tutorial as well.

__________________

Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!

You can find a set of files here which assemble ASM files into raw hex code. You're after the THUMB.bat file (and all the files it calls). You may want to read how to assemble the ASM in that short tutorial as well.

Ok well I have sat here and read Hackmews ASM tut about 4 times now and still I can't seem to understand how to assemble ASM to HEX... His tut seems to speak to people who already know the basics of programming and as for me I am a complete noob to programming... I can't find any video tutorials on GBA ASM hacking nor can I seem to find any IDE or Software that simply converts ASM to HEX. So I am starting to feel at a lose here, like I will never understand how this works (to the point I'm ripping my hair out)... There is no way that you could make a patch for this so us that see ASM as a whole other world of hacking =( ( I will be buying some books for sure)

Ok well I have sat here and read Hackmews ASM tut about 4 times now and still I can't seem to understand how to assemble ASM to HEX... His tut seems to speak to people who already know the basics of programming and as for me I am a complete noob to programming... I can't find any video tutorials on GBA ASM hacking nor can I seem to find any IDE or Software that simply converts ASM to HEX. So I am starting to feel at a lose here, like I will never understand how this works (to the point I'm ripping my hair out)... There is no way that you could make a patch for this so us that see ASM as a whole other world of hacking =( ( I will be buying some books for sure)

Don't waste your money on books, those will just make everything more confusing. It's not as hard as you're making it out to be. Here's how I did it, which made it work fine.

Step 2: MAKE SURE you apply the patch in the first post to your ROM (this should be a clean, unmodified ROM) before doing this.

Step 3: Open Notepad and paste down whichever ASM code you're using (aka if you're expanding flags, using the flag-expanding ASM code)

Step 4: Click File -> Save As. On the Box labelled "File Name" type "[whatevernameyouwant].asm". Under "Save as type", change to All Files. Navigate to the Desktop and save it there.

Step 5: Open Command Prompt. Type "cd Desktop". You're now on your desktop. Type the following into Command Prompt:

Code:

thumb [whatevernameyouchose].asm [samename].bin

You should see "Assembled Successfully" right below it in the Command Prompt. You can close it now.

Step 6: Open the .bin file in a hex editor and copy ALL the data.

Step 7: Open Free Space Finder and find an offset that ends in a 0, 4, 8, or C (as stated above).

Step 8: Open a new sheet in Notepad. Write down your offset, and then write it in little endian + 1. Ex: If my offset was 0x800000, the correct format for this would be 01 00 80.

Step 9: Open your ROM in a hex editor and go to the offset that you chose. Click Edit -> Paste write.

Step 10: Open your ROM in the hex editor and go to the offset 0x6E5D6. Change it to:

Code:

01 48 00 47 00 00 XX XX XX 08

Where the XX's = the endian version of your offset that you were supposed to write down earlier. Hit save, and you're done.

It would be helpful to have a tutorial on how to do this, Jambo, since most people don't have the knowledge of how to do this stuff.

Well thank you very much for this. I am understanding now... I have both flag.bin and var.bin now and have already added the flag one to my rom as you made it easy by tossing in the 01 00 80 but my final question is when you revers hex and add one does that mean 800044 becomes 45 00 80 and so on???

PS. Again I thank bolt of you for answering my questions so fast as that is rare on here.. Thanks to you, Jambo51 and karatekid I am at more of an understanding to this ASM. And you where more than right, I was making it harder than it was for sure

After very serious testing, I've come across the knowledge that the Variable hack is broken. After applying it, numerous game-crashing glitches occured. The first is what I call the qAF glitch, in which a textbox comes up that delivers endless streams of the word qAF that never stops. Other times my character will simply freeze on a random spot (usually one of the blocks next to a warp). On one occasion, the game wouldn't go past the bootscreen and looped back to it every single time it was supposed to go into the opening animation. On another, the game froze on a black screen when it tried to load the name-entering screen. Every single one of these requires a restart, and the worst part is, the first two are random and will appear at different intervals of time. I have no clue if it's the save patch, the ASM code, or my own incompitence causing this, but every time I applied the variable code, it broke the game. Are you positive that it's safe to use those variables even with the code? I feel like they're way too important to overwrite or that they contain something super important in them. Hopefully this little bug report can fix the code (although honestly, there's enough variables since one can hold enormous values and work for numerous scripts, but it'd still be nice)

/end wall

__________________

at some point I must have liked that you look like a taco addict who's had one too many back alley liposuctions

Question: Does the Save Block patch work when applied to a hack that is already in progress? I tested it and it doesn't seem to cause any problems, but you never know.

Regardless, I'm still having problems getting the Variable hack to work even on a clean FR rom. I've tried in numerous times and the results are always the same:

1). The givepokemon command ceases to work. Well, it works but it will always give me a ??? Pokemon.
2). It messes up the unaltered scripts in Palette town. Warping to the town out of your house for the first time activates one of the level scripts and displays some text that Oak says at one time or another.

I'm 99% sure that I followed all the instructions correctly (and the Flag hack gives me no such problems, BTW), so what could be going wrong here?

Help

The PokéCommunity

Meta

Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, or The Pokémon Company International. We just love Pokémon.