PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Other Generations Hacking > Guides & Documentation

Guides & Documentation Learn how to make your own Pokémon game through the process of ROM Hacking, or help out the community by sharing your information.

Reply
 
Thread Tools Display Modes
Old 21st October 2013, 01:51 PM   #1
Andrea
Getting there...
 
Join Date: Oct 2013
Posts: 40
Andrea
Default ROUTINE ASM: Change status of pokemon

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:

.thumb
.align 2

push {r0-r1,lr}
ldr r0, .8000 /*variabile 8000*/
ldrh r0,[r0]
ldr r1,.100 /*interval between the bytes status in pokemon team*/
mul r1,r0
ldr r0, .pokemon_data /*byte team pokemon status*/
add r0, r0, r1
mov r1, #0x80 /*poisong status*/
strb r1,[r0]
pop {r0-r1,pc}

.align 2
.pokemon_data:
.word 0x030043B0
.8000:
.word 0x0202e8c4
.100:
.word 0x00000100

but we look for good everywhere:
Quote:
ldr r0 ,.8000
ldrh r0, [r0]
except in 8000 var r0
Quote:
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 ^^
Quote:
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
Quote:
mov r1 , # 0x80
strb r1, [ r0 ]
we r1 in the value of 80 (he was poisoned),and finally save the byte
Spoiler:

# dynamic 0x800000
# org @ start
lock
setvar 0x8000 0x1
callasm 0xoffset + 1
release
end



this is the compiled routine:
Quote:
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
Quote:
80 21
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 ^^
Andrea is offline   Reply With Quote
Likes Linkandzelda liked this post
Sponsored Links
Reply

Tags
asm, change, pokemon, routine, status, [Tutorial]

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:24 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts