• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Help Thread: Step 3: You Think You're Ready?

3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024

The Path to Being an Elite Hacker

Step 3: You Think You're Ready?

Planning the Game | Home | Your First Map

Well guess again! Before we can move on to the actual hacking, I'm going to do a quick rundown of some basic knowledge you'll need before we can proceed. Don't worry, I won't be throwing tons of knowledge in your face (because you should hopefully learn as you go) but a bit of baseline knowledge never hurts.

Common Terms

First, I'd like to detail a couple of different terms that you'll see come up often whenever you're hacking.

General Terms

ROM - Stands for "Read Only Memory". On the GBA, this is the section of memory the game cartridge is loaded into. It is called read only because the device cannot modify that section of memory, only read from it. We call the game files ROMs because they are dumps of that data from the cartridge.

ROM Hacking - The process of modifying said data, in order to achieve any number of changes within the game. For us, this could include editing trainers, maps, events, etc.

Free Space - Sections of the ROM data that are empty of any meaningful data, and that can be overwritten safely. For example, a new image can be written over free space. In all the games, free space is denoted by the byte value 0xFF (if you don't understand that, don't worry! we'll get to that soon).

Bits - The basic unit of data encoding on the computer (and in lots of other places), a bit can only have two values, 0 or 1 (sometimes represented as false/true or no/yes). Bits can be grouped together to make larger values, as you'll see below.
Nybble (Nibble) - A grouping of four bits, it can represent any value from 0 to 15. It is not that commonly used in the hacking of GBA and games, but it is very common when hacking games for the GB and GBC.

Byte - A grouping of eight bits, it can represent any value from 0 to 255. This is an extremely common data representation used throughout hacking.

Word - A word is a larger grouping of bits, and it's exact value can vary from system to system. For the GBA, a word is 32 bits and can represent any value from 0 to 4,294,967,295. Because a word is 32 bits on the GBA, the term Half-Word is used to denote data that is 16 bits in length (representing any value from 0 to 65,535.​

Hexadecimal (Hex, Base 16) - A number system where the letters A through F are used to represent single digits beyond 0 through 9, counting like so: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, ... Numbers written in hexadecimal are often preceded by these symbols: "0x", "&h", or "$". It is used in not only ROM hacking but everywhere in computer science because of how conveniently it represents data. For example, a byte can be represented at most with two digits, with an value from 0x0 to 0xFF. This is one of the most important things you can learn as a beginning hacker. Fortunately, it is rather easy to convert between the two using the Calculator on Windows: put Calculator in Programmer Mode, and then you can toggle between the number modes.

Hex Editing - Hex editing is the process of using a tool, called a Hex Editor, to modify the data of a file directly. It is called hex editing because a hex editor will display the data of the file in groupings of bits (usually bytes) in hexadecimal, which you can then modify.

Specific Terms

Maps - These are the locations that you can explore within the game, like Pallet Town and Route 121. The process of modifying this is called map editing or mapping.

Scripts - These are sequences of data that tell the game how an event, like a gym leader battle, is supposed to be executed. The process of modifying this data is called scripting.
Flags - A part of the memory that holds a true/false value. These are used heavily by scripts, and can be used for a number of things, such as marking a gym badge obtained and marking an item found. A specialized use is making characters disappear in-game.

Variables - Slightly more complex, variables are half-words in the memory that can be used by scripts for storing values that cannot be represented by a simple true/false, like starter Pokémon choice. A specialized use in-game is disabling script tiles and level scripts (which we'll discuss later).​

Sprites - Sprites are the images you can see in the game, like Pikachu or Professor Oak. The process of creating a sprite is called spriting (and is usually done in something simple like Paint, contrary to popular belief).
Overworld Sprites (OWs) - Sprites that are used in-game to represent characters, like the player or NPCs that you can interact with.

Tileset - Tilesets are specialized sprites, which are broken into blocks of 8 x 8 pixels. These can then be used to construct a larger image on the screen, because saving space in the memory is very important to hacking.

Tilemap - Tilemaps are structures of data that tell the device how to draw a tileset on the screen to construct the larger image.​

Assembly (ASM) - Assembly language is the lowest level human-readable representation of machine code (the code that computers interpret in order to run). The assembly language used by a device is specific to it's processor. For the GBA, this means a specialized ARM7 processor, and the ARM assembly language is used. Now ARM is special because not only does it have it's main language, it also includes a smaller, reduced instruction set mode called Thumb. A lot of GBA hacking involves writing custom code in Thumb.
Assembly Hacking (ASM Hacking) - The process of injecting custom assembly code into the ROM to change how it's original programming operates.​

Tutorials You May Want To Read

Now at this point you're not required to know anything about hacking beyond the meanings I just listed above. But, if you want to get a head start and begin reading a bit, you may want to check out some of these tutorials written by fellow members.

link12552's In Depth Advanced Map Tutorial by link12552 - A basic overview of everything you'll see in Advanced Map, the main tool for map editing on the GBA.

diegoisawesome's MEGA-HUGE XSE Scripting Tutorial by diegoisawesome - Considered the tutorial on scripting, don't worry if it seems a bit intimidating at first. I'll do my best to cover practical implementations of a number of the scripts you'll see in this tutorial.
Flags, Vars, & Script Tiles by karatekid552 - For those of us interested in reading a bit more closely about variables, flags and script tiles. Requires a knowledge of scripting.​

PNG to in game sprite in 3 steps by Phasesaber - Describes how to prepare an image for insertion into the game. Despite focusing on Pokémon sprites, the technique is universal for GBA spriting.

A lot of tutorials are really specialized, so I wanted to list a few that cover core topics.

Conclusion

Well, this was a rather short step! But think of it as a small but necessary step to take before we get to it! If you have any suggestions for tutorials and/or other definitions, please share them! :)
I'll see you next time when we (finally!) get started!
 
Last edited:
Back
Top