Advertiser Content

Tutorial Adding new evolution methods [FR] Page 6

Started by kearnseyboy6 June 20th, 2014 1:51 AM
  • 54541 views
  • 226 replies
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
Yes, just use the evolve with other mon in party routine, G3HS has the arguments for this explained in the OP.
I didn't understand the "evolution methods" part of the OP, truth be told.
I "got" the codes alright, how to find space, how to make it appear in other hacking tools, but I couldn't identify what evolution is what in the codes there.
Of course, that's probably because I don't know this programming language yet, but no sweat, I'll study it.


You mean you only want the chellder evolution to work after the National Dex is received? Then you need a new routine that is the exact same as the above one and just use a flag check.
No, I just meant that I'll just try enabling the National Dex from start and then I'll try inserting new evolution methods into my game. Just my order of hacking the game.

Combee's: Yes
Frosslass/Gallade: No
How does it work for Combee? And why it wouldn't for the other two?
If I can't make it, also, no problem. But I'll make both these evolutions like Poliwrath's/Politoed's. A simple "two way of evolving into two different Pokémon". Plus, Gallade and Froslass would have both genders. I don't really have a problem with that.

Not the thread for this, but being researched at the moment. Shouldn't be too far away.
Found some transformations done by daniilS, I believe. For some Pokémon, it's done already and undergoing for others.
I believe they are looking for a way to generalize it to transform any Pokémon, if wanted.

Thanks a lot, man!
Age 21
Male
Seen 5 Days Ago
Posted March 23rd, 2019
545 posts
7.2 Years
After I find "C4 2F 04 08" at 0X42FC0, how do I change the pointer to 00900000 (same place OP put his code)?
Also, why the hex code stills red after I paste it over 00900000 data?
You reverse it, i.e. make 900000 to 00 00 90 08.
Next, it is red because you have changed the file and haven't saved the changes you've made. Pressing ctrl+s or File>Save will make it disappear. ^_^
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
The patch someone posted does not work with MrDollSteak's rombase. Could someone please add a patch that works with the rombase?

Edit: It probably has to do with the .ini, I'll investigate.

Edit 2: Fixed it. Just a quick .ini change and I got it to work! :)
How can I do it, bro? I'm using the newest version of MrDollSteak's Rombase, 1.5a version.
I just need to patch the game again, after MrDollSteak's own patch, right?
I noticed the .ini file has a section named [MrDS] version 1.4...
Also, noticed evolutions are in another section, different from MrDS's Rombase section.

Also, can I still add more evolution methods that are not added in the patch?
Can I edit the patched evolutions? If yes, how?
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
Does anyone know what changes I have to make to the ini files so the patch for the evolutions works in other tools with MrDS's Rombase?
It apparently works, as Mustachemon himself already did it.
Also, after applying the patch, how can I make new evolutions? I just continue the process skipping "step 1"? Or will I still have to expand the tables once more?
Thanks in advance, guys.

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
Does anyone know what changes I have to make to the ini files so the patch for the evolutions works in other tools with MrDS's Rombase?
It apparently works, as Mustachemon himself already did it.
Also, after applying the patch, how can I make new evolutions? I just continue the process skipping "step 1"? Or will I still have to expand the tables once more?
Thanks in advance, guys.
I'm not really sure, I know he repoints the move table, so you need to fix that. Maybe the Items?? But the steps are the same.
HOLIDAYING CURRENTLY!!
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
I'm not really sure, I know he repoints the move table, so you need to fix that. Maybe the Items?? But the steps are the same.
Move evolutions are none of my concern. Will move's table still affect anything?
I thing he edit the .ini in the evolution section. Adding patched evolutions to [MrDS]'s Rom. I think there's even a section for [MrDS] in the .ini the guy from the patch provided. I'll try doing that the hard way.
Also, for the steps, I hope the patch already has extended tables for evolutions. Will I have to expand them for each new evolution, or can I just skip this first step, since the patch already expands the evolution tables?
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
I'm not really sure, I know he repoints the move table, so you need to fix that. Maybe the Items?? But the steps are the same.
I managed to make it work. I've changed the ini (Just repointed the offsets in the .ini the guy provided to match the offsets in MrDS' 1.5a ini) and added the new evolutions to the evolution methods and all.
I have a doubt, though. Both .inis had the same evolutions table offsets, same everything, but the number of types and moves.
How did Ollie11 expanded the evolutions table without moving it to some new free space?

Also, kearnseyboy6, when you said you can't do a Level+Item evolution because the argument was a limiter (it could have only one argument), did you mean that G3HS can only have one argument?
Because YAPE, for example, has both an Item and a Level boxes (but they never unlock at the same time, because no evolution had both things going on).
If, and only if, G3HS had one more argument space, or both MrDS' and Ollie11's patches were compatible with YAPE, would that evolution (Level + Item) be possible?
Sorry asking this again kearnseyboy6, stuff just come together to my head, and seemed possible. I'm just need to be certain of it, before writing an evolution method code for each evolutionary item I believe the game should have. =P

EDIT: I'm posting the .ini changes using MrDS's 1.5a Rombase with the patch Ollie11 provided, if anyone still need it.

This is Ollie11's PokeRoms.ini:
Spoiler:
[MrDS]
name = MrDollSteak's Decap and Attack Rombase (1.4a)
gamecode = BPRE
numberofpokes = 412
pokebasestats = 0x254784
pokebasestatslength = 0x1C
pokenames = 0x245EE0
pokenameslength = 0xB
typenames = 0x961B60
typenameslength = 0x7
numberoftypes = 23
items = 0x3DB028
numberofitems = 0x177
itemsdatalength = 0x2C
abilities = 0x950000
numberofabilities = 0x9C
abiltiesnamelength = 0xD
egggroups = Monster,Water1,Bug,Flying,Field,Fairy,Grass,Human-Like,Water3,Mineral,Amorphous,Water2,Ditto,Dragon,Undiscovered
leveluptypes = Medium-Fast,Erratic,Fluctuating,Medium-Slow,Fast,Slow
learnedmoves = 0x25d7b4
learnedmoveslength = 0x2
attacknames = 0x901800
numberofattacks = 0x1FF
attacknamelength = 0xD
eggmovepointer1 = 0x045C50
eggmovepointer2 = 0x045CC8
eggmovelimit = 0x045CC4
tmhmcompatibility = 0x252BC8
tmhmcompatibilitylength = 8
tmlist = 0x45A80C
tmlistentrylength = 2
numberoftms = 50
numberofhms = 8
evolutiontable = 0x259754
evolutionsperpoke = 5
lengthofoneentry = 8
evolutionmethods = Breeding Only,Friendship,Friendship (Day),Friendship (Night),Level-Up,Trade,Trade (Hold Item),Stone,ATK > DEF,ATK = DEF,ATK < DEF,PID (Wurmple->Silcoon),PID (Wurmple->Cascoon),Spawn a Second,Create Spawn,Beauty
evomethodsproperties = None,None,None,None,Level,None,Item,Item,Level,Level,Level,Level,Level,Level,Level,None
evolutiontablepointers = 0x42F6C,0x42FBC,0x43138,0x4599C,0xCE8C4
offsetstochangetolslr0r60x1 = 0x42f9c,0x43182,0x43026,0x43008,0x43016,0x43050,0x4307A,0x430A8,0x430C8,0x430EC,0x430FC
offsetstochangetonewminus1 = 0x43116,0x4319e,0x459A2
theshedinjafix = 0xCE766
changetonewnumbertimes8 = 0x4598A,0x459C0,0x4598E,0x459C2
pokedex = 0x44E850
lengthofpokedexentry = 0x24
nationaldexorder = 0x251FEE
numofnondexpokesbetweencelebiandtreeko = 25
numofnondexpokesafterchimecho = 28
dextype = FRLG
jambo51learnedmovehack = False
movetutorcomp = 0x459B7E
movetutorcomplen = 2
movetutorattacks = 0x459B60
mtattackslen = 2
mtattacksnum = 15
frontspritetable = 0x2350AC
backspritetable = 0x23654C
frontpalettetable = 0x23730C
shinypalettetable = 0x2380cc
enemyytable = 0x2349CC
playerytable = 0x235E6C
enemyaltitudetable = 0x23A004
iconspritetable = 0x3D37A0
iconpalettetable = 0x3D3E80
iconpalettes = 0x3D3740
numiconpalettes = 3
itemanimationtable = 0x45FD54
itemanimationtableentlen = 5
hoenncryauxtable = 0x2539D4
footprints = 0x43FAB0
habitats = 0x452c4c
habitatpointers = 0x106888,0x1068C8,0x106990,0x1069F8,0x106A98
locationnames = 0x3F1CAC
locationstart = 0x58
locationend = 0xC4
locationtblfmt = 1

[0000]
name = Pokemon FireRed (E)
gamecode = BPRE
numberofpokes = 412
pokebasestats = 0x254784
etc...


This is my PokeRoms.ini:
Spoiler:
[0000]
name = MrDollSteak's Decap and Attack Rombase (5)
gamecode = BPRE
numberofpokes = 412
pokebasestats = 0x254784
pokebasestatslength = 0x1C
pokenames = 0x245EE0
pokenameslength = 0xB
typenames = 0x961B50
typenameslength = 0x7
numberoftypes = 24
items = 0x3DB028
numberofitems = 0x177
itemsdatalength = 0x2C
abilities = 0x950000
numberofabilities = 0x9C
abiltiesnamelength = 0xD
egggroups = Monster,Water1,Bug,Flying,Field,Fairy,Grass,Human-Like,Water3,Mineral,Amorphous,Water2,Ditto,Dragon,Undiscovered
leveluptypes = Medium-Fast,Erratic,Fluctuating,Medium-Slow,Fast,Slow
learnedmoves = 0x25d7b4
learnedmoveslength = 0x2
attacknames = 0x901800
numberofattacks = 0x1FF
attacknamelength = 0xD
eggmovepointer1 = 0x045C50
eggmovepointer2 = 0x045CC8
eggmovelimit = 0x045CC4
tmhmcompatibility = 0x252BC8
tmhmcompatibilitylength = 8
tmlist = 0x45A80C
tmlistentrylength = 2
numberoftms = 50
numberofhms = 8
evolutiontable = 0x259754
evolutionsperpoke = 5
lengthofoneentry = 8
evolutionmethods = Breeding Only,Friendship,Friendship (Day),Friendship (Night),Level-Up,Trade,Trade (Hold Item),Stone,ATK > DEF,ATK = DEF,ATK < DEF,PID (Wurmple->Silcoon),PID (Wurmple->Cascoon),Spawn a Second,Create Spawn,Beauty,Level-Up (Male),Level-Up (Female),Level-Up (Rain),Item Hold (Night),Item Hold (Day),Move,PKMN in Party,Location
evomethodsproperties = None,None,None,None,Level,None,Item,Item,Level,Level,Level,Level,Level,Level,Level,None,Level,Level,Level,Item,Item,Move,Pokemon,Location
evolutiontablepointers = 0x42F6C,0x42FBC,0x43138,0x4599C,0xCE8C4
offsetstochangetolslr0r60x1 = 0x42f9c,0x43182,0x43026,0x43008,0x43016,0x43050,0x4307A,0x430A8,0x430C8,0x430EC,0x430FC
offsetstochangetonewminus1 = 0x43116,0x4319e,0x459A2
theshedinjafix = 0xCE766
changetonewnumbertimes8 = 0x4598A,0x459C0,0x4598E,0x459C2
pokedex = 0x44E850
lengthofpokedexentry = 0x24
nationaldexorder = 0x251FEE
numofnondexpokesbetweencelebiandtreeko = 25
numofnondexpokesafterchimecho = 28
dextype = FRLG
jambo51learnedmovehack = False
movetutorcomp = 0x459B7E
movetutorcomplen = 2
movetutorattacks = 0x459B60
mtattackslen = 2
mtattacksnum = 15
frontspritetable = 0x2350AC
backspritetable = 0x23654C
frontpalettetable = 0x23730C
shinypalettetable = 0x2380cc
enemyytable = 0x2349CC
playerytable = 0x235E6C
enemyaltitudetable = 0x23A004
iconspritetable = 0x3D37A0
iconpalettetable = 0x3D3E80
iconpalettes = 0x3D3740
numiconpalettes = 3
itemanimationtable = 0x45FD54
itemanimationtableentlen = 5
hoenncryauxtable = 0x2539D4
footprints = 0x43FAB0
habitats = 0x452c4c
habitatpointers = 0x106888,0x1068C8,0x106990,0x1069F8,0x106A98
locationnames = 0x3F1CAC
locationstart = 0x58
locationend = 0xC4
locationtblfmt = 1

[Evos]
name = Pokemon FireRed (E)
gamecode = BPRE
numberofpokes = 412
pokebasestats = 0x254784
etc...


In both cases, I just copied MrDS's Rombase .ini as it contains the only changes you really need to make and some part of the last section, so you don't get lost.
In the last section, the one with the new evolutions that starts with [000], change to any 4 letter combination (I chose "Evos"), so MrDS's Rombase stills [0000]. That's only change you need to do to this section, as you are not going to use this.

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
I managed to make it work. I've changed the ini (Just repointed the offsets in the .ini the guy provided to match the offsets in MrDS' 1.5a ini) and added the new evolutions to the evolution methods and all.
I have a doubt, though. Both .inis had the same evolutions table offsets, same everything, but the number of types and moves.
How did Ollie11 expanded the evolutions table without moving it to some new free space?

Also, kearnseyboy6, when you said you can't do a Level+Item evolution because the argument was a limiter (it could have only one argument), did you mean that G3HS can only have one argument?
Because YAPE, for example, has both an Item and a Level boxes (but they never unlock at the same time, because no evolution had both things going on).
If, and only if, G3HS had one more argument space, or both MrDS' and Ollie11's patches were compatible with YAPE, would that evolution (Level + Item) be possible?
Sorry asking this again kearnseyboy6, stuff just come together to my head, and seemed possible. I'm just need to be certain of it, before writing an evolution method code for each evolutionary item I believe the game should have. =P
First question: G3HS will find the table you repointed so don't worry about it.
Item + Level will never work dynamically. In each evolution routine it loads a argument that will customable. But there is only 1 argument in the routine. So trying to have 2 customizable routines won't work... That's also why Aipom will evolve at any level with double hit in my routine. Purely because the move is customizable so I cannot have a custom level too...

I can write a seperate evolution routine for checking 1 move and any level, but then I would need a routine for ancient power too and mimic and rollout... possible just tedious.

I hope that helped! :)
HOLIDAYING CURRENTLY!!
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
First question: G3HS will find the table you repointed so don't worry about it.
Item + Level will never work dynamically. In each evolution routine it loads a argument that will customable. But there is only 1 argument in the routine. So trying to have 2 customizable routines won't work... That's also why Aipom will evolve at any level with double hit in my routine. Purely because the move is customizable so I cannot have a custom level too...

I can write a seperate evolution routine for checking 1 move and any level, but then I would need a routine for ancient power too and mimic and rollout... possible just tedious.

I hope that helped! :)
Yeah, that's the same thing you explained.

I was thinking with Java something like this:
Spoiler:

Onix gets x exp in a fight and levels up
pokemonlevel++;
if pokemonlevel>49 {
          check if pokemonitem = item199;          // Metal Coat's index number
          if true, goto "evolution routine";
          else break;
}
break;

...and why the hell that could not be possible in ASM, seeming so easy - and mainly possible - in Java ways of thinking (assuming there is a variable for Pokémon item hold and for its level and of course, just creating what I need to get it done =P).

I just asked this 'cause I saw the argument box in G3HS and remembered there was one for item and one for level in YAPE. Thought it could be a limitation of the tool G3HS...
Anyways, I'll write a code for every evolutionary item, then. It is goddamn tedious, but it's better than not having it.
Thanks again man!

EDIT: http://www.pokecommunity.com/showthread.php?p=8793205#post8793205
Can I use this with Mantyke's evolution method for the Slowpoke idea?

EDIT 2: Something that occurred to me today. The tables you referred in OP that we have to extend contain pointers to the actual evolution routines, right?
Can I, instead of expanding, just change the pointer of an existing evolution (that I'll not use, like "Trade" or "Trade+Item") to the pointer of my new evolution routine?
That way I wouldn't have to expand the table for the pointers.
Can I do it? Just assemble a routine for a new evolution and swap its pointer with an existing one I'm not going to use?

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
Yeah, that's the same thing you explained.

I was thinking with Java something like this:
Spoiler:

Onix gets x exp in a fight and levels up
pokemonlevel++;
if pokemonlevel>49 {
          check if pokemonitem = item199;          // Metal Coat's index number
          if true, goto "evolution routine";
          else break;
}
break;

...and why the hell that could not be possible in ASM, seeming so easy - and mainly possible - in Java ways of thinking (assuming there is a variable for Pokémon item hold and for its level and of course, just creating what I need to get it done =P).

It is possible XD

I just asked this 'cause I saw the argument box in G3HS and remembered there was one for item and one for level in YAPE. Thought it could be a limitation of the tool G3HS...
Anyways, I'll write a code for every evolutionary item, then. It is goddamn tedious, but it's better than not having it.
Thanks again man!

EDIT: http://www.pokecommunity.com/showthread.php?p=8793205#post8793205
Can I use this with Mantyke's evolution method for the Slowpoke idea?

EDIT 2: Something that occurred to me today. The tables you referred in OP that we have to extend contain pointers to the actual evolution routines, right?
Can I, instead of expanding, just change the pointer of an existing evolution (that I'll not use, like "Trade" or "Trade+Item") to the pointer of my new evolution routine?
That way I wouldn't have to expand the table for the pointers.
Can I do it? Just assemble a routine for a new evolution and swap its pointer with an existing one I'm not going to use?
Yes it's possible just tedious. YAPE will cause errors or not work because there is definitely only 1 parameter:

http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_evolution_data_structure_in_Generation_III
HOLIDAYING CURRENTLY!!

Joexv

joexv.github.io

Age 22
Male
Oregon
Seen 3 Weeks Ago
Posted August 7th, 2018
1,031 posts
7.1 Years
Yes it's possible just tedious. YAPE will cause errors or not work because there is definitely only 1 parameter:

http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_evolution_data_structure_in_Generation_III
@FamiliaWerneck
I'll make a evo routine that works for this. Granted as you said, G3HS only has one param so the items used will be based off of a table, is that ok?
I died and am dead
Male
São Paulo, Brasil
Seen September 7th, 2019
Posted September 7th, 2019
275 posts
4.5 Years
Yes it's possible just tedious. YAPE will cause errors or not work because there is definitely only 1 parameter:

http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_evolution_data_structure_in_Generation_III
Thanks again kearnseyboy6. Also, thanks for the link. Never saw it before and it did help a bit. =D

@FamiliaWerneck
I'll make a evo routine that works for this. Granted as you said, G3HS only has one param so the items used will be based off of a table, is that ok?
I didn't ask for it, 'cause I didn't want to bother (I did ask kearnseyboy6 for help with the evolution routines. Talk about bother... =P).
I also wanted to try my very first ASM challenge. Can we work together?

Also, for both you guys. Do you think we can use that HackMew's 'Take Pokémon" code to take a Shellder when a Slowpoke evolves?

jiangzhengwenjzw

now working on pokefirered

Male
Online now
Posted September 29th, 2019
173 posts
7.2 Years
Final notes, I am a bit vague on the structure of the routine musts because I am still learning it. However finally all evolutions will be open-sourced and available below in the spoiler (will add more over time).

Spoiler:
Evolutions

NOTE:
If you have used the "Changed Number of Evolutions per MON'" button on G3HS, these routines ain't going to work.

Assemble them anyway and change the .bin file accordingly.



Evolve with a Fairy type move (KDS Credits)

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global sylveon

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
ldr r4, movedata
mov r6, #0xC
mul r6, r1
add r4, r4, r6
ldrb r4, [r4, #0x2]
cmp r4, #0xXX @replace XX with 16 if you are using MrDollSteak's rombase, otherwise keep the index that you have set while adding fairy type
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

.align
movedata: .word 0x08250C04 @if you have repointed the moves table this needs to be changed as well, for MrDollSteak's rombase set to 0x08900000
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9

Pancham Evolution (KDS Credits)


Spoiler:
.text
.align 2
.thumb
.thumb_func
.global Pancham

main:
push {r0-r7}
mov r5, #0x0
loop:
ldr r0, firstpoke
mov r1, #0xB
mov r6, #0x64
add r4, r5, #0x0
mul r4, r6
add r0, r0, r4
bl decrypt
mov r9, r0
pop {r0-r7}
mov r1, r9
ldr r3, basestattable
mov r4, #0x1C
mul r4, r1
add r3, r3, r4
ldrb r6, [r3, #0x6]
ldrb r7, [r3, #0x7]
cmp r6, #0x11
beq levelcheck
cmp r7, #0x11
beq levelcheck
cmp r5, #0x5
beq exit
add r5, #0x1
b loop

levelcheck:
pop {r0-r7}
ldr r0, levelcheckloc
bx r0

exit:
pop {r0-r7}
ldr r0, noevo
bx r0

decrypt:
push {r0-r7}
ldr r2, decryptpoke
bx r2

.align
basestattable: .word 0x08254784
firstpoke: .word 0x02024284
levelcheckloc: .word 0x08043017
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9


Specific Map Evolution (Not available in G3HS yet, hex edit only)

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global mapbankANDnapnumber

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
ldr r6, mapbank
ldrh r6, [r6, #0x0]
cmp r6, r2
bne exit
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, levelcheckloc
bx r0
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
mapbank: .word 0x02031DBC


Male Evolutions (please don't forget to update your pokemon base stats table...)
Spoiler:
main:
push {r0-r7}
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrb r2, [r3, #0x2]
mov r0, r8
bl decrypt2
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
blt exit
mov r0, r8
mov r1, #0xFF
ldr r0, [r0, #0x0]
and r1, r0
mov r0, r8
bl decrypt
mov r11, r0
pop {r0-r7}
mov r5, r11
ldr r2, pokemondata
mov r4, #0x1C
mul r5, r4
add r5, r5, r2
ldrb r5, [r5, #0x10]
cmp r1, r5
blt exit
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, levelcheckloc
bx r0
exit: pop {r0-r7}
ldr r0, noevo
bx r0
decrypt: push {r0-r7}
mov r1, #0xB
ldr r2, decryptpoke
bx r2
decrypt2: push {r0-r7}
mov r1, #0x38
ldr r2, decryptpoke
bx r2
.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9
pokemondata: .word 0x08254784


Female Evolutions (please don't forget to update your pokemon base stats table...)
Spoiler:
main:
push {r0-r7}
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrb r2, [r3, #0x2]
mov r0, r8
bl decrypt2
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
blt exit
mov r0, r8
mov r1, #0xFF
ldr r0, [r0, #0x0]
and r1, r0
mov r0, r8
bl decrypt
mov r11, r0
pop {r0-r7}
mov r5, r11
ldr r2, pokemondata
mov r4, #0x1C
mul r5, r4
add r5, r5, r2
ldrb r5, [r5, #0x10]
cmp r1, r5
bge exit
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, levelcheckloc
bx r0
exit: pop {r0-r7}
ldr r0, noevo
bx r0
decrypt: push {r0-r7}
mov r1, #0xB
ldr r2, decryptpoke
bx r2
decrypt2: push {r0-r7}
mov r1, #0x38
ldr r2, decryptpoke
bx r2
.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9
pokemondata: .word 0x08254784


Raining in the Overworld (Goodra)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global weatherevo

main:
push {r0-r7}
ldr r6, currentweather
ldrb r6, [r6, #0x0]
cmp r6, #0x3
beq rain
cmp r6, #0x5
beq rain
cmp r6, #0xD
beq rain
pop {r0-r7}
ldr r0, noevo
bx r0
rain:
pop {r0-r7}
ldr r0, levelcheckloc
bx r0

.align
levelcheckloc: .word 0x08043017
noevo: .word 0x08043111
currentweather: .word 0x02036E12


Night Time Level Up (KDS credits)

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global nightlevelup
main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge level
cmp r5, #0x6
blt level
b exit
level:
pop {r0-r7}
ldr r0, levelcheckloc
bx r0
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
levelcheckloc: .word 0x08043017
noevo: .word 0x08043111
time: .word 0x03005542


Day Time Level Induced Tyruant (KDS credits)

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global dayLevel
main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge exit
cmp r5, #0x6
bge level
exit:
pop {r0-r7}
ldr r0, noevo
bx r0
level:
pop {r0-r7}
ldr r0, levelcheckloc
bx r0

.align
levelcheckloc: .word 0x08043017
noevo: .word 0x08043111
time: .word 0x03005542


Night time Item Hold Induced Evolution
(if you edited the Pokemon data structure table in the RAM the item clearing will not work)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global nightevoitemhold

main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge test
cmp r5, #0x6
blt test
b exit
test:
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrh r2, [r3, #0x2]
mov r0, r8
mov r1, #0xC
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
bne exit
mov r1, #0xC
mov r0, r8
bl encrypt
pop {r0-r7}
mov r9, r3
pop {r0-r7}
mov r1, r9
ldr r0, levelcheckloc
bx r0
decrypt:
push {r0-r7}
ldr r2, decryptpoke
bx r2
encrypt:
push {r0-r7}
ldr r2, blank
ldr r5, encryptpoke
bx r5
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
time: .word 0x03005542
blank: .word 0x020242A2
decryptpoke: .word 0x0803FBE9
encryptpoke: .word 0x0804037D

Day time Item Hold Induced Evolution (if you edited the Pokemon data structure table in the RAM the item clearing will not work)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global dayevoitemhold

main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge exit
cmp r5, #0x6
blt exit
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrh r2, [r3, #0x2]
mov r0, r8
mov r1, #0xC
bl decrypt
mov r11, r0
pop {r0-r7}
mov r1, r11
cmp r1, r2
bne exit
mov r1, #0xC
mov r0, r8
bl encrypt
pop {r0-r7}
mov r9, r3
pop {r0-r7}
mov r1, r9
ldr r0, levelcheckloc
bx r0
decrypt:
push {r0-r7}
ldr r2, decryptpoke
bx r2
encrypt:
push {r0-r7}
ldr r2, blank
ldr r5, encryptpoke
bx r5
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
time: .word 0x03005542
blank: .word 0x020242A2
decryptpoke: .word 0x0803FBE9
encryptpoke: .word 0x0804037D


Night Friendship (You can edit the routine in the table already because they don't work in FR)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global dayFriendship
main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge friendshipevo
cmp r5, #0x6
blt friendshipevo
pop {r0-r7}
ldr r0, noevo
bx r0

.align
friendshipevo: .word 0x08043001
noevo: .word 0x08043111
time: .word 0x03005542


Day Friendship (You can edit the routine in the table already because they don't work in FR)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global dayFriendship
main:
push {r0-r7}
ldr r5, time
ldrb r5, [r5, #0x0]
cmp r5, #0x15
bge exit
cmp r5, #0x6
bge friendshipevo
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
friendshipevo: .word 0x08043001
noevo: .word 0x08043111
time: .word 0x03005542


Evolution by Move induced
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

.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9


Evolve with other Pokemon in Party
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global mantykeevo

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 r5, #0x0
loop: ldr r0, firstpoke
mov r1, #0xB
mov r6, #0x64
add r4, r5, #0x0
mul r4, r6
add r0, r0, r4
bl decrypt
mov r9, r0
pop {r0-r7}
mov r1, r9
cmp r1, r2
beq levelcheck
cmp r5, #0x5
beq exit
add r5, #0x1
b loop
levelcheck: mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, levelcheckloc
bx r0
exit: pop {r0-r7}
ldr r0, noevo
bx r0
decrypt: push {r0-r7}
ldr r2, decryptpoke
bx r2
.align
firstpoke: .word 0x02024284
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
decryptpoke: .word 0x0803FBE9


Secific Map Name evolution (Joexv Credits)
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global mapevo

main:
push {r0-r7}
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r3, r0, r3
ldrb r2, [r3, #0x2]
mov r0, r8
ldr r6, map
ldrb r6, [r6, #0x0]
cmp r6, r2
bne exit
mov r10, r3
pop {r0-r7}
mov r1, r10
ldr r0, levelcheckloc
bx r0
exit:
pop {r0-r7}
ldr r0, noevo
bx r0

.align
levelcheckloc: .word 0x0804310D
noevo: .word 0x08043111
map: .word 0x02036E10
More to come... Send in your evolutions


Lastly, acknowledgements go to Daniils and Jambo for their guidance and locations for everything.

~ Thank you and good luck


Hello, I am a newbie and I'm kinda confused with this kind of method to write routines as it always push registers and use much stack space.
For example, if I want to use the "specific map evolution", I will write the following function:
Spoiler:

.thumb
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, mapbank
ldrh r1, [r1]
cmp r1, r0
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
evolve: .word 0x0804310D
mapbank: .word 0x02031DBC

I think it does nothing different with the original routine in the thread so I'm really confused about it. (I haven't tested it yet)
Does evolution hack use special ways to write routines?

Anyway, I've updated the night friendship evolution and day friendship evolution routine so that they will work in fr.
Spoiler:

night friendship evolution:
.thumb

push {r0}
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge evolution
cmp r0, #0x6
blt evolution
pop {r0}
ldr r0, noevo
bx r0

evolution:
pop {r0}
ldr r1, evolve
bx r1

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
day friendship evolution:
.thumb

push {r0}
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge abort
cmp r0, #0x6
blt abort
pop {r0}
ldr r1, evolve
bx r1

abort:
pop {r0}
ldr r0, noevo
bx r0

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111

They're also not tested.

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
Hello, I am a newbie and I'm kinda confused with this kind of method to write routines as it always push registers and use much stack space.
For example, if I want to use the "specific map evolution", I will write the following function:
Spoiler:

.thumb
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, mapbank
ldrh r1, [r1]
cmp r1, r0
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
evolve: .word 0x0804310D
mapbank: .word 0x02031DBC

I think it does nothing different with the original routine in the thread so I'm really confused about it. (I haven't tested it yet)
Does evolution hack use special ways to write routines?

Anyway, I've updated the night friendship evolution and day friendship evolution routine so that they will work in fr.
Spoiler:

night friendship evolution:
.thumb

push {r0}
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge evolution
cmp r0, #0x6
blt evolution
pop {r0}
ldr r0, noevo
bx r0

evolution:
pop {r0}
ldr r1, evolve
bx r1

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
day friendship evolution:
.thumb

push {r0}
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge abort
cmp r0, #0x6
blt abort
pop {r0}
ldr r1, evolve
bx r1

abort:
pop {r0}
ldr r0, noevo
bx r0

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111

They're also not tested.

Then I've written the slowpoke evolution method in anime, which is linked with Shellder and the Shellder in the party will be deleted. (which is mainly based on JPAN's deletion function) However, I haven't tested it and I'm really not sure what will happen if the player abort the evolution by pressing "b".(As I haven't tested it, I absolutely haven't debugged the evolution process) Anyway, here's my routine (may have error as it is much more complicated than the others)
Spoiler:
.thumb

protection:
push {r1-r7}
mov r4, #0x0
mov r6, #0x0

loop:
mov r5, #0x96
lsl r5, #0x2
cmp r4, r5
bhs abort
ldr r0, pkmnaddr
add r0, r0, r4
mov r1, #0xb
add r6, #0x1
push {r6}
push {r0}
bl decrypt
pop {r1}
pop {r6}
add r4, #0x64
cmp r0, #0x5a
bne loop

deletefunc:
mov r2, r8
cmp r1, r2
blt adjust

delete:
add r3, r1, #0x0        
add r3, #0x64
sub r0 ,r6, #0x1

main_loop:        
mov r2, #0x0                
mov r4, #0x0                
cmp r0, #0x5
beq delete_loop        
add r0, #0x1                

copy_loop:       
ldr r4, [r3, #0x0]        
str r4, [r1, #0x0]        
add r3, #0x4                
add r1, #0x4                
add r2, #0x4                
cmp r2, #0x64
beq main_loop
b copy_loop                                        

delete_loop:        
str r4, [r1, #0x0]        
add r1, #0x4
add r2, #0x4
cmp r2, #0x64
bne delete_loop

end:
pop {r1-r7}
ldr r0, evolve
bx r0

decrypt:
ldr r2, decrypter
bx r2

abort:
pop {r1-r7}
ldr r0, quit
bx r0

adjust:
sub r2, #0x64
mov r8, r2
b delete

.align 2
pkmnaddr: .word 0x02024284
decrypter: .word 0x0803fbe9
quit: .word 0x08043111
evolve: .word 0x08043017


Edit:I've tested the last one and I found that it worked ok except when the player press B to abort the evolution because the routine is also executed in this case so the shellder will be deleted although the evolution is aborted. Maybe I must look into the evolution routine to get it fixed. But I don't think the item related routine which requires to delete the pokemon's item is safe, if in the same case.

(I don't use an English ROM, sorry for that.)


It has a glitch, so temporarily removed.
That's good work ^^

For the map evolution it load the argument (map ID) an just compares it to the current map. Very simple routine :)
HOLIDAYING CURRENTLY!!

jiangzhengwenjzw

now working on pokefirered

Male
Online now
Posted September 29th, 2019
173 posts
7.2 Years
That's good work ^^

For the map evolution it load the argument (map ID) an just compares it to the current map. Very simple routine :)
Thank u for ur reply! Therefore, I think there's no point in wasting stack spaces to push & pop so many registers, maybe all the routines in the thread can all be simplified (Maybe I will do this when I have free time). By the way, could you please replace the routines in the thread with mine if my codes are tested working appropriately? (I think they should work though I haven't tested them yet XD)

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
Thank u for ur reply! Therefore, I think there's no point in wasting stack spaces to push & pop so many registers, maybe all the routines in the thread can all be simplified (Maybe I will do this when I have free time). By the way, could you please replace the routines in the thread with mine if my codes are tested working appropriately? (I think they should work though I haven't tested them yet XD)
Yep you are right! Except you still need to push r4-7 if you use them, I know they are assumed to have random value returning from a branch or something.

Yeah anything you make I will add :)
HOLIDAYING CURRENTLY!!

jiangzhengwenjzw

now working on pokefirered

Male
Online now
Posted September 29th, 2019
173 posts
7.2 Years
Yep you are right! Except you still need to push r4-7 if you use them, I know they are assumed to have random value returning from a branch or something.

Yeah anything you make I will add :)
Thank you very much if you can test and add them ;)
For the latter sentence, r u speaking of the last function? Then r4 needn't be protected as the decrypter function pushes and pops r4 so it won't change XD
And please ignore the last function as it is very bugged and it couldn't be done if the pokemon is not the first one in the party. (I tried to change r8 to fix it as you can see in the label "adjust", but failed.)

Then I've just written a routine to evolve at specific level (the second parameter in the evolution table) when it detects a certain event has happened by checking flag 0x200.
Not tested.
Spoiler:
.thumb
mov r0, #0x1
lsl r0, r0, #0x9 @you can change the flag ID here and I use 0x200
push {r1-r7}
ldr r1, decrypter
bl decrypt
pop {r1-r7}
cmp r0, #0x1
bne abort
ldr r0, evolve
bx r0

abort:
ldr r0, evolve
add r0, #0xfa
bx r0

decrypt:
bx r1

.align 2
decrypter: .word 0x0806e6d1
evolve: .word 0x8043017


In addition, the routine checking if the Pokemon is shiny to go to level evolution. (Also not tested and I'm a bit not sure if the pokemon data pointer is in r8)
Spoiler:
.thumb
mov r0, r8
push {r1-r2}
ldrh r1, [r0]
ldrh r2, [r0, #0x2]
eor r1, r2
ldrh r2, [r0, #0x4]
ldrh r0, [r0, #0x6]
eor r0, r2
eor r0, r1
pop {r1-r2}
cmp r0, #0x7
bls evolution
ldr r0, evolve
add r0, #0xfa
bx r0

evolution:
ldr r0, evolve
bx r0

.align 2
evolve: .word 0x8043017


And here I will post the simplified routines in the thread, all not tested. (The routines I write before several days will also be included)
Now the simplified routines are all finished because i only simplified some of them.
Spoiler:

evolve in the specific map:
.thumb

add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, mapbank
ldrh r1, [r1]
cmp r1, r0
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
evolve: .word 0x0804310D
mapbank: .word 0x02031DBC
Day friendship:
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge abort
cmp r0, #0x6
blt abort
ldr r1, evolve
bx r1

abort:
ldr r0, noevo
bx r0

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
night friendship:
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge evolution
cmp r0, #0x6
blt evolution
ldr r0, noevo
bx r0

evolution:
ldr r1, evolve
bx r1

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
Raining in the Overworld (Goodra)
.thumb
ldr r0, currentweather
ldrb r0, [r0, #0x0]
cmp r0, #0x3
beq rain
cmp r0, #0x5
beq rain
cmp r0, #0xd
beq rain
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

rain:
ldr r0, levelcheckloc
bx r0

.align 2
levelcheckloc: .word 0x08043017
currentweather: .word 0x02036E12
Night Time Level Up
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge level
cmp r0, #0x6
blt level
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

level:
ldr r0, levelcheckloc
bx r0


.align 2
levelcheckloc: .word 0x08043017
time: .word 0x03005542
Day Time Level Induced Tyruant(I keep its original time)
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge exit
cmp r0, #0x6
bls exit
ldr r0, levelcheckloc
bx r0

exit:
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

.align 2
levelcheckloc: .word 0x08043017
time: .word 0x03005542
Specific Map Name evolution(I don't quite know what it means, but anyway I've simplified it)
.thumb
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, map
ldrb r1, [r1]
cmp r0, r1
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
map: .word 0x2036e10
evolve: .word 0x804310d
I won't simplify the other routines because I'm very lazy and busy. I think they are great and do not need modification.
If you've found any glitches, please post a reply to this post and testing them is very appreciated.


I am not sure if my way of writing evolution routines is correct as it looks different from the original ones in the thread.
Seen July 3rd, 2015
Posted June 27th, 2015
8 posts
4.5 Years
kearnseyboy6, Nice Tutorial!!! I have a problem, I used your patch poke fire red new evos in my rom... The new evos works very well, but i can't do trade link... how I do to fix it???? Apeears this message...

Hey!!! Nice tutorial!! Please help me!!! What I'm doing wrong??? The new evolution method doesn't work - Level-Up (Male)...I followed the tutorial!!! but didn't work!!! Sorry English!!!

Joexv

joexv.github.io

Age 22
Male
Oregon
Seen 3 Weeks Ago
Posted August 7th, 2018
1,031 posts
7.1 Years
Thank you very much if you can test and add them ;)
For the latter sentence, r u speaking of the last function? Then r4 needn't be protected as the decrypter function pushes and pops r4 so it won't change XD
And please ignore the last function as it is very bugged and it couldn't be done if the pokemon is not the first one in the party. (I tried to change r8 to fix it as you can see in the label "adjust", but failed.)

Then I've just written a routine to evolve at specific level (the second parameter in the evolution table) when it detects a certain event has happened by checking flag 0x200.
Not tested.
Spoiler:
.thumb
mov r0, #0x1
lsl r0, r0, #0x9 @you can change the flag ID here and I use 0x200
push {r1-r7}
ldr r1, decrypter
bl decrypt
pop {r1-r7}
cmp r0, #0x1
bne abort
ldr r0, evolve
bx r0

abort:
ldr r0, evolve
add r0, #0xfa
bx r0

decrypt:
bx r1

.align 2
decrypter: .word 0x0806e6d1
evolve: .word 0x8043017


In addition, the routine checking if the Pokemon is shiny to go to level evolution. (Also not tested and I'm a bit not sure if the pokemon data pointer is in r8)
Spoiler:
.thumb
mov r0, r8
push {r1-r2}
ldrh r1, [r0]
ldrh r2, [r0, #0x2]
eor r1, r2
ldrh r2, [r0, #0x4]
ldrh r0, [r0, #0x6]
eor r0, r2
eor r0, r1
pop {r1-r2}
cmp r0, #0x7
bls evolution
ldr r0, evolve
add r0, #0xfa
bx r0

evolution:
ldr r0, evolve
bx r0

.align 2
evolve: .word 0x8043017


And here I will post the simplified routines in the thread, all not tested. (The routines I write before several days will also be included)
Now the simplified routines are all finished because i only simplified some of them.
Spoiler:

evolve in the specific map:
.thumb

add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, mapbank
ldrh r1, [r1]
cmp r1, r0
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
evolve: .word 0x0804310D
mapbank: .word 0x02031DBC
Day friendship:
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge abort
cmp r0, #0x6
blt abort
ldr r1, evolve
bx r1

abort:
ldr r0, noevo
bx r0

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
night friendship:
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge evolution
cmp r0, #0x6
blt evolution
ldr r0, noevo
bx r0

evolution:
ldr r1, evolve
bx r1

.align 2
time: .word 0x3005542
evolve: .word 0x8043001
noevo: .word 0x8043111
Raining in the Overworld (Goodra)
.thumb
ldr r0, currentweather
ldrb r0, [r0, #0x0]
cmp r0, #0x3
beq rain
cmp r0, #0x5
beq rain
cmp r0, #0xd
beq rain
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

rain:
ldr r0, levelcheckloc
bx r0

.align 2
levelcheckloc: .word 0x08043017
currentweather: .word 0x02036E12
Night Time Level Up
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge level
cmp r0, #0x6
blt level
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

level:
ldr r0, levelcheckloc
bx r0


.align 2
levelcheckloc: .word 0x08043017
time: .word 0x03005542
Day Time Level Induced Tyruant(I keep its original time)
.thumb
ldr r0, time
ldrb r0, [r0]
cmp r0, #0x15
bge exit
cmp r0, #0x6
bls exit
ldr r0, levelcheckloc
bx r0

exit:
ldr r0, levelcheckloc
add r0, #0xfa
bx r0

.align 2
levelcheckloc: .word 0x08043017
time: .word 0x03005542
Specific Map Name evolution(I don't quite know what it means, but anyway I've simplified it)
.thumb
add r0, r6, r7
lsl r0, r0, #0x3
add r0, r2, r0
add r1, r0, r3
ldrh r0, [r1, #0x2]
push {r1}
ldr r1, map
ldrb r1, [r1]
cmp r0, r1
bne exit
pop {r1}
ldr r0, evolve
bx r0

exit:
pop {r1}
ldr r0, evolve
add r0, r0, #0x4
bx r0

.align 2
map: .word 0x2036e10
evolve: .word 0x804310d
I won't simplify the other routines because I'm very lazy and busy. I think they are great and do not need modification.
If you've found any glitches, please post a reply to this post and testing them is very appreciated.


I am not sure if my way of writing evolution routines is correct as it looks different from the original ones in the thread.
Just gonna say this now, before anyone flips their lids trying to get your evo methods to work, they all will NOT work. You left out very important pieces of the code that must be in the routine to be able to run properly. You may want to reread the OP to be able to make actually working methods.
I died and am dead

jiangzhengwenjzw

now working on pokefirered

Male
Online now
Posted September 29th, 2019
173 posts
7.2 Years
Just gonna say this now, before anyone flips their lids trying to get your evo methods to work, they all will NOT work. You left out very important pieces of the code that must be in the routine to be able to run properly. You may want to reread the OP to be able to make actually working methods.
Actually I think I know what the thread means. However, I don't think that way of writing codes is necessary and I think all that I need to do is to "insert" some codes I need to do compares or some similar things and make sure that they won't influence the routines i branch to, which is often 0x4310c, 0x43016, 0x43000 and the abort routine 0x43110. There's no point in pushing so many registers when not using a decrypter or other complex routines.

I think if you want to branch to the function at 0x4310c, you should keep the codes at the beginning (but you can use registers more flexibly) and you don't need them if you directly branch to the routine at 0x43016 as it will do all the things for you. Anyway afaik pushing r0-r7 is always useless as r0 will be immediately refreshed so at least you don't need to push r0 to the stack to waste stack space, though you pop it after that so r13 is recovered and your original code will work without any problem.

All above are my own opinions, maybe they're not right. Someone has tested some of the routines i wrote and found no problem. ;) (Absolutely i can't make sure that all my routines work, as I haven't tested them)

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
10.9 Years
Actually I think I know what the thread means. However, I don't think that way of writing codes is necessary and I think all that I need to do is to "insert" some codes I need to do compares or some similar things and make sure that they won't influence the routines i branch to, which is often 0x4310c, 0x43016, 0x43000 and the abort routine 0x43110. There's no point in pushing so many registers when not using a decrypter or other complex routines.

I think if you want to branch to the function at 0x4310c, you should keep the codes at the beginning (but you can use registers more flexibly) and you don't need them if you directly branch to the routine at 0x43016 as it will do all the things for you. Anyway afaik pushing r0-r7 is always useless as r0 will be immediately refreshed so at least you don't need to push r0 to the stack to waste stack space, though you pop it after that so r13 is recovered and your original code will work without any problem.

All above are my own opinions, maybe they're not right. Someone has tested some of the routines i wrote and found no problem. ;) (Absolutely i can't make sure that all my routines work, as I haven't tested them)
You're right, r0-r3 are assumed to be jumbled on return so you really never need to push them!
HOLIDAYING CURRENTLY!!

jiangzhengwenjzw

now working on pokefirered

Male
Online now
Posted September 29th, 2019
173 posts
7.2 Years
You're right, r0-r3 are assumed to be jumbled on return so you really never need to push them!
Really? I'm not sure about what you've said and I'm just speaking of r0 XD.

Actually I'm a bit confused that why 0x43110 is the location of the abort routine as it's the pointer of 6 different evolution methods.
The routine to read the table locates at around 0x42fb4, and i really don't know how the routine at 0x43110 work.

Joexv

joexv.github.io

Age 22
Male
Oregon
Seen 3 Weeks Ago
Posted August 7th, 2018
1,031 posts
7.1 Years
Actually I think I know what the thread means. However, I don't think that way of writing codes is necessary and I think all that I need to do is to "insert" some codes I need to do compares or some similar things and make sure that they won't influence the routines i branch to, which is often 0x4310c, 0x43016, 0x43000 and the abort routine 0x43110. There's no point in pushing so many registers when not using a decrypter or other complex routines.

I think if you want to branch to the function at 0x4310c, you should keep the codes at the beginning (but you can use registers more flexibly) and you don't need them if you directly branch to the routine at 0x43016 as it will do all the things for you. Anyway afaik pushing r0-r7 is always useless as r0 will be immediately refreshed so at least you don't need to push r0 to the stack to waste stack space, though you pop it after that so r13 is recovered and your original code will work without any problem.

All above are my own opinions, maybe they're not right. Someone has tested some of the routines i wrote and found no problem. ;) (Absolutely i can't make sure that all my routines work, as I haven't tested them)
Well if they work then I apologize! I was under the impresion that that "required" code was what determined more than just used in decrypting. So good job on simplifying those then!
I died and am dead
Advertiser Content