The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Move Evolutions (https://www.pokecommunity.com/showthread.php?t=359007)

partys over November 25th, 2015 10:09 PM

Move Evolutions
 
So, in the hack I am working on, I want to add the sinnoh evolutions where they evolve by learning a move. It has been done in Platinum Red and Blue, as seen here. I can't seem to find the ASM though, does anyone know where it is?

azurile13 November 26th, 2015 12:27 AM

Quote:

Originally Posted by frog (Post 9010309)
So, in the hack I am working on, I want to add the sinnoh evolutions where they evolve by learning a move. It has been done in Platinum Red and Blue, as seen here. I can't seem to find the ASM though, does anyone know where it is?

I doubt this is the specific code used in them, but if you don't know how to write the asm/are lazy, I would assume the routines here www.pokecommunity.com/showthread.php?t=329357 should work.

partys over November 26th, 2015 12:37 AM

Quote:

Originally Posted by azurile13 (Post 9010386)
I doubt this is the specific code used in them, but if you don't know how to write the asm/are lazy, I would assume the routines here www.pokecommunity.com/showthread.php?t=329357 should work.

So, I found one in there that should work. It's here:
Spoiler:
text
.align 2
.thumb
.thumb_func
.global Evomove

main:
push {r0-r7}
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrh r2, [r3, #0x2]
mov r0, r8
mov r5, #0x0
loop:
mov r1, #0xD
add r1, r1, r5
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
beq true
cmp r5, #0x3
beq exit
add r5, #0x1
b loop

decrypt:
push {r0-r7}
ldr r2, decryptpoke
bx r2
true:
mov r9, r3
pop {r0-r7}
mov r1, r9
ldr r0, levelcheckloc
bx r0
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

edit: nevermind, I didn't read the link you showed.

azurile13 November 27th, 2015 1:42 PM

o_O so many unnecessary pushes, pops, and moves. So if you plan on using that, the place it is comparing moves would be:
Code:

loop:
mov r1, #0xD
add r1, r1, r5
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
beq true


It goes through this loop four times, once for each move the mon knows, with the move result being in r0 after the “bl decrypt.” If you follow that move id further, you’ll see that it is eventually compared to the r2 that was awkwardly popped sometime after being awkwardly pushed right before the branch to the decryptpoke. If you backtrack on the content of that r2, you see it comes from ldrh r2, [r3, #0x2]. Presumably, this is the second halfword in an evolution entry of the pokemon and that each eight byte evolution entry is structured:
[halfword: evolution type]
[halfword: evolution argument]
[halfword: evolves into]
[halfword: padding]
Perhaps the first and third halfword are flipped; I don’t really remember.
So the location that you change the move is not in the routine; it is an argument in the evolution table, so you can probably control it with a tool such as G3HS with a modified ini.

partys over November 27th, 2015 10:52 PM

Quote:

Originally Posted by azurile13 (Post 9012188)
o_O so many unnecessary pushes, pops, and moves. So if you plan on using that, the place it is comparing moves would be:
Code:

loop:
mov r1, #0xD
add r1, r1, r5
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
beq true


It goes through this loop four times, once for each move the mon knows, with the move result being in r0 after the “bl decrypt.” If you follow that move id further, you’ll see that it is eventually compared to the r2 that was awkwardly popped sometime after being awkwardly pushed right before the branch to the decryptpoke. If you backtrack on the content of that r2, you see it comes from ldrh r2, [r3, #0x2]. Presumably, this is the second halfword in an evolution entry of the pokemon and that each eight byte evolution entry is structured:
[halfword: evolution type]
[halfword: evolution argument]
[halfword: evolves into]
[halfword: padding]
Perhaps the first and third halfword are flipped; I don’t really remember.
So the location that you change the move is not in the routine; it is an argument in the evolution table, so you can probably control it with a tool such as G3HS with a modified ini.

Yeah, I read the tutorial, it makes sense. But, what is your asm code about? Is it a replacement for the one I found?

azurile13 November 28th, 2015 3:05 AM

Quote:

Originally Posted by frog (Post 9012885)
Yeah, I read the tutorial, it makes sense. But, what is your asm code about? Is it a replacement for the one I found?

No. It is a snippet from the code you posted for explanation purposes :| I literally copy pasted from your post...


All times are GMT -8. The time now is 2:26 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.