# How to work Action Replay Pokemon

Hi guys. I wrote a guide so that you can generate codes yourself! You can find all the codes there! Hope you like it ^^.

GuideVersion 3.5 beta

1. Information for beginners

2. The codes

1. Information for beginners

We know the decimal system. You count from 0 to 9 and then you start again at 0 and do a 1 next to it, then we do 10. The same thing continues until we hit 19 and then start again at 20.
The hexadecimal system is the same, only that it has the characters A, B, C, D, E, F more. When we count, it looks like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. After F comes the 0 and the number again to the left of it is increased by 1 (from 0F to 10).
4 hex (hexadecimal) is also 4. A hex is 10 and B hex is 11 dec ... up to F hex is 15 dec. Then comes [/ i] 0x [/ i] 10 = 16 (0x is an international prefix so that everyone knows that this is a hex number) and 0x11 = 17 etc.

Now it's still easy, but how much is 0x867? And since everything in an Action Replay Code is in hexadecimal, you have to master it to some extent. (If you want to know how to do it manually, look at wikipedia.de). There is a very simple method that everyone knows: pocket calculator! If you use Windows®, you can press the Windows key (usually bottom left) + R, a window with an input field will open. Type in calcein and hit enter. Now a calculator opens. Above at view on scientific positions.
• For example, to convert 4785930 to hexadecimal, enter the respective number and then click on Hex (top left). Now this should be displayed: 49070A.
• To convert 0xFF45B into decimal, for example, click on Hex and enter the respective value and then click on Déc again. 1045595 should now be displayed.

2. Bits and Bytes

Most people confuse what a byte is and what a bit is. A bit is either a 0 or a 1. When 8 bits become one byte. This means:
8 bits = 1 byte, 16 bits = 2 bytes, 24 bits = 3 bytes, 32 = 4. 4 bits or 1/2 byte are called "nibble" and are 1 character. So 2 characters are 8 bits and thus 1 bytes. Remember: 8 bits = 1 byte = 2 characters (2 digits).

So when you have understood all of this we can start

If you speak of 2 characters you don't say that it is a byte (it wouldn't be wrong). You say an 8-bit number / word / ... anything with 2 digits. So always 8-bit and not 1 byte! 8-bit is the smallest thing you can do with the AR and the largest is 32-bit (in hex, since everything in the AR is in hex).

2.1 Executive summary

8-bit = 0 - FF. The largest number in 8-bit is FF and therefore 255 in dec.
16-bit = 0 - FFFF. 0 - 65,535 dec.
32 bit = 0 - FFFFFFFF. I don't think you need more because it is from 0 - 4,294,967,295 in dec!
(24-bit is not available in AR, if you're wondering where it is)

2. The codes

1. Ram-Write Codes German: Ram-Write Codes

There are three different types of ram write codes. These are the simplest codes that simply write a value to an address, e.g. to always have maximum life during a game or to have the weapons loaded all the time. The previous value of the address is simply overwritten.
Here you are:

0XXXXXXX YYYYYYYY 32-bit Ram-Write Code
1XXXXXXX 0000YYYY 16-bit Ram-Write Code
2XXXXXXX 000000YY 8-bit Ram-Write Code

Small note: AR codes are always 16-digit lines!

• The first character on each line of code determines the type of code. It determines what is done with the code. (Some codes have 2 characters as a type).
• After the type character (mostly) comes the address. The address is the destination and basically has 8 digits, but there is only space for 7 digits (because the max. Eh ~ 04000000), since the first digit is reserved for the code type. The address is the place where the code will have its effect. The data in the game is stored on an address, such as the money carried, the number of items and which items, etc.
The address is marked with an "X".
• Value that will work with the address. Is marked with "Y".

(This code is just an example, the addresses are incorrect and therefore it will not work).
Let's take a code to have 1,000 dollars as an example. 1,000 is in hex 3E8 (they say 0x3E8 so that everyone knows that it is in hexadecimal). Now you have to consider what is the maximum amount of money that you can carry? We can assume that we have 999.999 and that is 0xF423F, so a 16-bit code will not be enough for this, as this number is greater than 0xFFFF (max. Of a 16-bit number). Then we take the 32-bit Ram-Write Code. The address where the money is stored is 0x23B8C77, then the code looks like this:

023B8C77 000003E8

The 0 at the beginning is the type of code, i.e. a 32-bit Ram-Write. The code then writes 0x000003E8 to the address 0x023B8C77. If we had a 2 at the beginning and not a 0, the code would be an 8-bit Ram-Write and would only write 0xE8 to the address 023B8C77.

I can spend money without losing it. The code will be executed non-stop, as there is no conditional code (the conditional code is the next type of code I'll introduce you to).

2. Conditional Codes German: Condition Codes

A conditional code activates the codes that follow only and as long as a condition is met. There can only be two results: fulfilled or not fulfilled. If not fulfilled, then nothing happens, he will continue to wait. If fulfilled, then all following codes are activated until it encounters a D1 or a D2 code type.

Here is the list of conditional codes

3XXXXXXX YYYYYYYY 32-bit "greater than" code
4XXXXXXX YYYYYYYY 32-bit "less than" code
5XXXXXXX YYYYYYYY 32-bit "equals" code
6XXXXXXX YYYYYYYY 32-bit "is not the same" code
7XXXXXXX ZZZZYYYY 16-bit "greater than" code
8XXXXXXX ZZZZYYYY 16-bit "less than" code
9XXXXXXX ZZZZYYYY 16-bit "equals" code
AXXXXXXX ZZZZYYYY 16-bit "is not the same" code

If we take code type 3, the code checks whether the value YYYYYYYY is greater than the number that is in the address. This means that if the address 1234567 is where the Pokéballs are stored, then it will check whether the number in Y is greater than the number of Pokéballs. If so, the condition is met.

3. The offset German: The loss

There are codes for the US, JP and for the EU versions. They are almost exactly identical, but there is a small difference and you cannot use a US code on an EU version of the game.
The difference is in the address.
Most people believe that with the Pokémon DP codes of the US versions, you have to replace the B21C4D28 line with B21C4E68 to get an EU code, i.e. + 140. It's wrong and right, but I won't go into it.

The offset has a long history. I will only give the information you need for the AR DS. Let's assume you have a huge code and you have to add a number to all addresses everywhere so that the code works, or the address changes constantly, as I noticed with Pokemon DP with the B21C4E68. It would take a long time. So you use the offset!

example
13826778 7CC534AB
12227654 004FFF3E
04763647 1125AE3F
...
and you would have to do 367 everywhere.

Here are the offset codes:

BXXXXXXX 00000000
In XXXXXXX (+ offset) enter the address where the code makes the 32-bit value the offset. E.g. if it is the database of Pokéballs carried and you currently have 45 Pokéballs, the offset will be 45.

BC000000 YYYYYYYY
Adds the value YYYYYYYY to the offset.

D3000000 YYYYYYYY
Makes the value YYYYYYYY an offset.

If no offset is specified, then it is 0 (logical).
If the code is 12345678 00000000, it is also used that way (with an offset of 0).
With an offset of e.g. 13, the code is used as follows: 1234568B 00000000. The offset will be added to the address.
Danger! With 1FFFFFFF it will not be 20000000 with an offset of 1 because the first character is the type. In addition, there is nothing greater than FFFFFFF as an address.

Important! The offset only works with the following types of codes:
0, 1, 2, B, D6, D7, D8, D9, DA, DB, DC, E, F.

4. End Codes German: End Codes

D0000000 00000000
Ends a conditional block.

D1000000 00000000
Ends a repeat block.

D2000000 00000000
Resets the offset to 0, ends a repeat block and ends a conditional block.

Those were the codes that appear most often! Now I'm going to show you some other, more difficult, but useful codes.

5. Repeat Codedeutsch: Repeat code

C0000000 NNNNNNNN

Example:
I want him to repeat a certain code 100 times. He should repeat this: 12345678 12345678 Then I do:

C0000000 00000064 (since 64 is in hex 100)
12345678 12345678
(if codes still follow, you have to insert the D1000000 00000000 so that they are not repeated)

6. The Storeddeutsch: The stored

D4000000 YYYYYYYY
Adds the value YYYYYYYY to the stored.

D5000000 YYYYYYYY
The value YYYYYYYY becomes the stored.

D6000000 XXXXXXXX
Writes the 32-bit stored to the address in XXXXXXXX (+ offset) and adds 4 to the offset.

D7000000 XXXXXXXX
Writes the 16-bit stored to the address in XXXXXXXX (+ offset) and adds 2 to the offset.

D8000000 XXXXXXXX
Writes the 8-bit stored to the address in XXXXXXXX (+ offset) and adds 1 to the offset.

D9000000 XXXXXXXX
Loads the 32-bit value from the address XXXXXXXX (+ offset) and makes it a stored.

DA000000 XXXXXXXX
Loads the 16-bit value from the address XXXXXXXX (+ offset) and makes it a stored.

DB000000 XXXXXXXX
Loads the 8-bit value from the address XXXXXXXX (+ offset) and makes it a stored.

7. Direct Memory Write Codedeutsch: Immediate write code

EXXXXXXX NNNNNNNN
VVVVVVVV VVVVVVVV

Writes NNNNNNNNBytes of the following values ​​VVVVVVVV VVVVVVVV to the address XXXXXXXX (+ offset) and adds 4 to the address after every 32-bit value.

Example.

(Let's assume the offset is 0x10 (16 in dec))
E000013400000010
01234567 89ABCDEF
09876543 ABCDEF01

Since it will use 16 bytes, it will only look at the next 2 lines. So he will write 01234567 to address 0000134 (+ offset) and then add 4 to it (to get to the next address you have to add 4 and not 1!). Then it will write 89ABCDEF to 0000134 + 4 (+ offset) = 0000138 (+ offset).
Then on and on. 09876543 to 000013C (+ offset) and ABCDEF01 to 0000140.

8. Memory Copy German: copy of the data

Imagine you want to transfer player 1 in Animal Crossing entirely to player 2, copy it. You need the addresses again. Ok, let's assume that player 1 is exactly 100 bytes in size (0x64), i.e. 100 addresses (0x64). I'll just take the address 2003640 as an example. Now the address of the 2nd player: 20036B0.

So now the code:

FXXXXXXX NNNNNNNN
Copies NNNNNNNN bytes from the address of the offset to the address XXXXXXX.

It copies the data from the address of the offset, so we need the D3 code to set an offset. The offset must then be 2003640, i.e.: D3000000 02003640.

From there we have to copy the data. From this address 100 bytes (0x64) have to be copied, so we add it to NNNNNNNN: FXXXXXXX 00000064.

Now we still lack where it should be copied. That comes in XXXXXXX. So: F20036B000000064.

And to bring the offset back to zero, because otherwise other codes could not work, a D2000000 00000000 code is added.