Registrarse

[ASM] Change status of pokemon

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 :
.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:
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 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 )
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 :)
Finally here's a sample script:
# dynamic 0x800000
# org @ start
lock
setvar 0x8000 0x1
callasm 0xoffset + 1
release
end
If you have any questions or concerns do not hesitate to ask ^^
 

Edo

You've met with a terrible fate, haven't you?
Miembro de honor
Respuesta: ROUTINE ASM: Change status of pokemon

Nice work, dude. I think is a very good job, and so util.
Cya!
 

PabloGTD

WiiU developer
Respuesta: ROUTINE ASM: Change status of pokemon

Interesting. Nice work that I´m going to use in my project I was looking something like this.
 

Andrea

Usuario mítico
Re: ROUTINE ASM: Change status of pokemon

i post the routine already compiled:
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:
addormentato: 01
scottatura: 10
congelamento: 20
paralizzato: 40

if you have problem, wrote in the comment ^^
 
Respuesta: ROUTINE ASM: Change status of pokemon

Excellent work, did not know what was the direction of the states, thank you very much, I hope you continue making more progress in the ASM, keep it up

luck
 

eing

Miembro de honor
Miembro de honor
Respuesta: ROUTINE ASM: Change status of pokemon

Es un buen tutorial andrea y muy util para cambiarle el status a un pokemon de tu equipo.
Pero desde mi punto de vista la rutina asm se podria mejorar, poniendo condicionales y agregando mas variables.
Por ejemplo:
Var 8000 = nº pokemon afectados por el estado (1-6)
Var 8001 = a partir de que slot (1-6) se empiezan a afectar pokes.
Var 8002 = estado que afecte al pokemon.

La rutina se alargaria un poco debido a los cmp para controlar las variables, pero seria mas factible no crees?

Buen aporte!
 

cosarara97

Dejad de cambiar de nick
Miembro de honor
Respuesta: ROUTINE ASM: Change status of pokemon

Es una rutina bastante sencilla, lo más importante es saber las direcciones y espacios. De todos modos me parece un aporte muy bueno.
Falta decir algo muy importante, pero. ¿Para qué base es esto?
 

Andrea

Usuario mítico
Re: ROUTINE ASM: Change status of pokemon

Hello everyone :)
.thumb
.align 2

push {r0-r3,lr}
ldr r2, .8002 /*variabile 8002*/
ldrh r2,[r2]
cmp r2, #0x0 /*control var 8002 if it's 0*/
beq parte2
b loop

parte2:
ldr r0, .8000 /*variabile 8000*/
ldrh r0,[r0]
ldr r1,.100 /*interval byte between pokemon team*/
mul r1,r0
ldr r0, .pokemon_data /*offset state*/
add r0, r0, r1
ldr r1, .8001 /*save state*/
strb r1,[r0]
b fine

loop:
ldr r2, .8002 /*variabile 8002*/
ldrh r2,[r2]
ldr r3,.100 /*interval byte between pokemon team*/
mul r3,r2
ldr r0, .pokemon_data /*offset state*/
add r0, r0, r3
ldr r1, .8001 /*save state*/
strb r1,[r0]
sub r2, r2, #0x80 /*tolgo 80*/
sub r2, r2, #0x80 /*tolgo 80*/
cmp r2, #0x0 /*controllo che la var 8002 non sia 0*/
beq fine
b loop

fine:
pop {r0-r3,pc}

.align 2
.pokemon_data:
.word 0x030043B0
.8000:
.word 0x0202e8c4
.8001:
.word 0x0202e8c6
.8002:
.word 0x0202e8c8
.100:
.word 0x00000100
weel this is the new routine ^^"
i explain you every single part:
ldr r2, .8002
ldrh r2,[r2]
cmp r2, #0x0
beq parte2
b loop
load var 8002, if the val of var 8002 it's 0 then go to part2 :)
else go to loop because var 8002 decides how many pokemon change status :)
parte2:
ldr r0, .8000
ldrh r0,[r0]
ldr r1,.100
mul r1,r0
ldr r0, .pokemon_data
add r0, r0, r1
ldr r1, .8001
strb r1,[r0]
b fine
this part of routine used to infect single pokemon in the team with setting var 8000 for the pokemon place in the team and var 8001 the state :)
ldr r2, .8002 /*variabile 8002*/
ldrh r2,[r2]
ldr r3,.100 /*interval byte between pokemon team*/
mul r3,r2
ldr r0, .pokemon_data /*offset state*/
add r0, r0, r3
ldr r1, .8001 /*save state*/
strb r1,[r0]
same thing with part of routine on top :)
sub r2, r2, #0x80
sub r2, r2, #0x80
cmp r2, #0x0
beq fine
b loop
this is important part of routine :)
so the var 8002 it's stored in the r2 and we setting with:
number of pokemon *100
the comand sub subtract 100 (80+80) to var 8002 and avery loop infect a pokemon :)
fine:
pop {r0-r3,pc}
end of routine x'D
example of script:
to infect one pokemon:

setvar 0x8000 0x4 /fourth pokemon in the team
setvar 0x8001 0x80 /poisong state
callasm 0x700001

to infect 3 pokemon of your team:

setvar 0x8002 0x300 /3 pokemon*100
setvar 0x8001 0x10 /burn state
callasm 0x700001

if you have problem write in the comment :) bye
 
Respuesta: ROUTINE ASM: Change status of pokemon

Avevo già visto questa tua routine :)
Complimenti col tempo sei diventato un grandissimo hacker
-----
I had already seen this your routine :)
Congratulations eventually you become a great hacker
 
Arriba