Andrea
Usuario mítico
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
Between each pokemon status distance themselves 100 bytes
this is the routine that we will use :
but we look for good everywhere:
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 for example, the 2 pokemon in team
setvar 0x8000 0x1 ( -1 we have to do to place in the team : C)
we said that the bytes of the team move away from each other by 100 bytes then the routine will multiply 1 by 100
1 * 100 = 100
then adds +100 to pokemon_data and we will have the offset of the state of 2 pokemon ^^
(it's a slightly convoluted reasoning x'D I hope you understand otherwise leave a comment )
sum pokemon_data + product and puts everything in r0
Finally here's a sample script:
If you have any questions or concerns do not hesitate to ask ^^
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
Between each pokemon status distance themselves 100 bytes
this is the routine that we will use :
.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
.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
except in 8000 var r0ldr r0 , .8000
ldrh r0 , [ r0 ]
So here we load the value "100" in r1 and then multiply it with r0 ( the var 8000)ldr r1, .100
mul r1, r0
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 for example, the 2 pokemon in team
setvar 0x8000 0x1 ( -1 we have to do to place in the team : C)
we said that the bytes of the team move away from each other by 100 bytes then the routine will multiply 1 by 100
1 * 100 = 100
then adds +100 to pokemon_data and we will have the offset of the state of 2 pokemon ^^
(it's a slightly convoluted reasoning x'D I hope you understand otherwise leave a comment )
as I said before, the routine loads the pokemon_data and the sum of the product of the variable * 100.ldr r0 , . pokemon_data
add r0 , r0 , r1
sum pokemon_data + product and puts everything in r0
we r1 in the value of 80 ( he was poisoned ), and finally save the bytemov r1 , # 0x80
strb r1, [ r0 ]
Finally here's a sample script:
# dynamic 0x800000
# org @ start
lock
setvar 0x8000 0x1
callasm 0xoffset + 1
release
end
# org @ start
lock
setvar 0x8000 0x1
callasm 0xoffset + 1
release
end