• 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.

ROUTINE ASM: Change status of pokemon

249
Posts
11
Years
  • Seen Apr 22, 2024
Hello guys today I would like to offer you a little routine for asm
change the status of a pokemon of our team ^^
first of all we need to know where is the offset required in this case:
offset_stato: 030043B0
the bytes of the pokemon from each team are distant from each other than 100 bytes
this is the routin we will use:
Spoiler:

but we look for good everywhere:
ldr r0 ,.8000
ldrh r0, [r0]
except in 8000 var r0
ldr r1,.100
mul r1, r0
So here, we load the value "100" in r1 and then multiply it with r0 (the var 8000)
because we did? to choose the pokemon you want to change the status ^^ first of all we need to set the var 8000 with the number of pokemon to infect -1 for example, the 2 pokemon in team
setvar 0x8000 0x1 ( -1 we have to do to place in the team)
we said that the bytes of the team move away from each other by 100 bytes then the routine will multiply 1 by 100
1x100=100
then adds +100 to pokemon_data and we will have the offset of the state of 2 pokemon ^^
ldr r0 ,.pokemon_data
add r0,r0 ,r1
as I said before, the routine loads the pokemon_data and the sum of the product of the variable * 100.
sum pokemon_data + product and puts everything in r0
mov r1 , # 0x80
strb r1, [ r0 ]
we r1 in the value of 80 (he was poisoned),and finally save the byte :)
Spoiler:


this is the compiled routine:
03 B5 05 48 00 88 05 49 41 43 02 48 40 18 80 21 01 70 03 BD B0 43 00 03 C4 E8 02 02 00 01 00 00

80 21 corresponds to our mov r1, # 0x80 then to change the status of the pokemon for example we have to change the byte 80 ^^

here we are given vary status byte:
sleeping: 01
burned: 10
frozen: 20
paralized: 40

If you have any questions or concerns do not hesitate to ask ^^
 

kearnseyboy6

Aussie's Toughest Mudder
300
Posts
15
Years
  • Seen Jun 22, 2019
This is a great tutorial, great place to start with little ASM skills (it's the first place I went to) but the tutorial is very specific, especially when the pokemon data block contains so much more information to edit like its level, any stat, pokerus, nickname. This is just a suggestion but it could really broaden your tutorial. It's still great how ever!

Also I think when you select a pokemon from a 'special' (i forget which one) it stores the variable into 0x8004 as either (0,1,2,3,4,5) for the slot which can be used to allow the player to select a pokemon.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
While this will work, you should absolutely never directly access the Pokémon data. You should always use the built in encrypter to set data.

The reason being that the checksum can be affected by writes to the data, and not updating it correctly will result in your nice shiny Pokémon turning into a bad egg. Also, most of the encryption functions have built in checks and balances to prevent you writing nonsense data in. Just a little advice for you. :)
 
Back
Top