Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
Yeah, that should work. The registers shouldn't need changing as far as I can tell. Best way to know is to test yourself and have a script that buffers the Pokémon's friendship so you can test; that's what I did.
I tested your routine on a pokemon that had 70 base happiness to start with, holding a soothe bell without factoring met location/luxury ball and its happiness grew by 50 (10 from berry and 40 from halving 80), making it 120 base happiness, instead of 85 ( 70 + 10 +5).
You could probably use r6 for the add_ten/five/two_happiness and also 'add r6, #1' for met location bonus/luxury ball bonus.
I tested your routine on a pokemon that had 70 base happiness to start with, holding a soothe bell without factoring met location/luxury ball and its happiness grew by 50 (10 from berry and 40 from halving 80), making it 120 base happiness, instead of 85 ( 70 + 10 +5).
You could probably use r6 for the add_ten/five/two_happiness and also 'add r6, #1' for met location bonus/luxury ball bonus.
edit: here's a fix for ease!
If you use this, the new length will be 0x49C bytes
Spherical Ice' [FR] EV-reducing Berries does in fact bring back the Pomeg Glitch. If you want to fix this, go to offset 0x3E742 and make the following change:
0029 04D1 ->02 29 04 DC
Credits to HackMew: https://www.pokecommunity.com/showthread.php?t=207217
Note: Despite what Wichu said about Pomeg no longer being usable on Shedinja in that thread- I've tested it and it works. I'm also not aware if this change affects anything else during gameplay, so if anybody else could chime in...
Building off of another post in the Quick Research and Development thread about trainerbattle 0x9, turns out that changing the reserved byte from 0x3 to 0x0 in trainerbattle 0x9 removes the text, but also causes you to white out instead of continue with the script if you lose.
This routine hijacks the trainerbattle command to use variable 0x8000 to toggle Oak's text on or off, while keeping the same functionality of continuing the script even if you lose the battle. I mentioned this in my linked post, but 0x1 is also written to variable 0x800D if you lose, allowing you to branch the script based on your battle result.
Here is the code/insertion instructions:
Code:
.text
.align 2
.thumb
.thumb_func
@At 08080478: 00 48 00 47 XX XX XX 08
main:
ldr r0, =(0x020370B8) @variable 0x8000
ldrb r0, [r0]
cmp r0, #0x1
beq NoText
ldr r0, =(0x080803D8 +1)
bl linker
mov r1, #0x3
and r1, r0
cmp r1, #0x0
beq NoText
ldr r0, =(0x08080484 +1) @jump back to original routine
bx r0
NoText:
ldr r0, =(0x0808048C +1)
bx r0
linker:
bx r0
.align 2
I fixed the issue of Squeetz's Synchronize routine and FBI's Shiny Generator routine conflicting.
Squeetz's routine works by taking the Synchronize Pokemon's nature and setting that BEFORE the PID is generated. Turns out, FBI's Shiny Generator routine is activated afterwards, and completely redoes the PID generation, essentially making Squeetz's routine never actually come into effect.
To use both, you can use this combination of both their routines in one. I tested it in my game and it works for all four of these scenarios
1. Not Shiny and no Synchronize Pokemon
2. Not Shiny with a Synchronize Pokemon
3. Shiny and no Synchronize Pokemon
4. Shiny with a Synchronize Pokemon
It might not be super efficient, because it loops a lot, but I couldn't find a better way to do it and still get the desired result.
Spoiler:
/*Insert 00 48 00 47 XX XX XX 08 at 0x3DB00*/
/*Also insert 00 00 02 E0 at 0x3DAF6*/
.text
.align 2
.thumb
.thumb_func
Main:
/*Checks if 0x8003 = 1*/
/*If false it goes back to normal*/
ldr r0, .Var8003
ldrb r0, [r0]
cmp r0, #0x1
bne Return
SetBackToZero:
/*Sets 0x8003 back to 0*/
push {r4-r7}
ldr r0, .Var8003
mov r1, #0x0
strb r1, [r0]
SynchronizeCheck:
/*Checks for first Pokemon's ability*/
bl GetAbility
cmp r1, #0x1C
beq Synchronize
b SetPID
GenPID:
/*Generates a new bottom half of PID*/
/*Puts it together with stored top half*/
/*Checks to see if it matches nature*/
bl GeneratePID
mov r4, r0
bl GetNature
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, r5
beq GenerateC
b GenPID
SetPID:
/*Generates a PID for the Pokemon*/
bl GeneratePID
mov r4, r0
GenerateC:
/*This generates a random number between 0 and 8*/
/*This number will be used as C*/
bl RNG
lsr r0, r0, #0x8
cmp r0, #0x7
bgt GenerateC
mov r3, r0
ConcatenateR4R3:
/*Concatenate means 'to link together'*/
/*This puts PID1 and PID2 together*/
lsl r3, r3, #0x10
orr r3, r3, r4 /*PID for Shiny Pokemon*/
bl GetAbility
cmp r1, #0x1C
beq CheckNatureAgain
b PrepareEnd
CheckNatureAgain:
/*Basically loops through the whole process again*/
/*Until it finds a PID that gives the right nature*/
/*And is Shiny as well*/
mov r6, r3
mov r0, r3
bl GetNature
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, r5
bne GenPID
mov r3, r6
This replaces the Shiny Generator routine, so branch to it at 0x3DB00. You can get rid of the branch at the old Synchronize location since that's not being used.
If you use this, be sure to credit both FBI and Squeetz for their original routines. I don't want to take any credit for their hard work. I just merged the two preexisting codes.
A note, this particular routine makes Synchronize activate 100% of the time. Squeetz's routine had a 50% chance. If you want that still, you can add some sort of RNG/compare thing. There's already an RNG in the routine, so this shouldn't be too hard to do (I hope. I've never tried it).
This also makes Synchronize work with Eggs (I also think, because it did for me, but I hatched the egg immediately after getting it, and I forget when natures are determined.)
Inheriting IVs from parents (via Destiny Knot, in the daycare)
How to insert:
Before doing anything, look at the code. There are two comments that say:
@masterball lol. Change to item you want :D
@Parent2 has masterball :D
At those lines, change the line to "cmp r0, #0xDestinyKnotItemID" and
"cmp r3, #0xDestinyKnotItemID" respectively.
Once you're done that, compile and insert into free space.
Where XX XX XX is the pointer in reverse hex +1 of the routine you just compiled.
How it works:
When the egg is generated, we check both parents to see if their holding an item matching the item we're looking for. If they are, the egg inherits 5/6 IVs from their parents. Each parent has a 50% chance to pass down one of their IVs.
There is no usage section, because the rest is done automagically when you have two compatible Pokemon in the daycare and they make an egg :)
Also, sorry for the double post, I wanted a fresh post for the first page :P
Spherical Ice' [FR] EV-reducing Berries does in fact bring back the Pomeg Glitch. If you want to fix this, go to offset 0x3E742 and make the following change:
0029 04D1 ->02 29 04 DC
Credits to HackMew: https://www.pokecommunity.com/showthread.php?t=207217
Note: Despite what Wichu said about Pomeg no longer being usable on Shedinja in that thread- I've tested it and it works. I'm also not aware if this change affects anything else during gameplay, so if anybody else could chime in...
I don't know if anyone here has already posted this one,
But i'm sure someone researched this and used it in their hack. (BTW It's Glazed if you don't know)
Credits to: TheCreatorofGlazed for the wonderful Idea, BluRose for the Initialization and Touched Sensei for everything else.
Here it is:
[FR] Text Display Input Routine
Basically what this do is get an input from user via naming_function and stores it somewhere in the ram then compare it to some string you can define.
Note: I'm not GOOD at ASM so don't judge me if i said something wrong or explained something wrong. Please point it out instead . It's just that those ones who I asked to help me are very GOOOOOOOOOOOOD at ASM.
Routine:
You can define your password by putting :
loadpointer 0 @password
before the callasm. (note: you can't set your password more than the max Characters in the Input or else it will fail)
#org @password
= yourpass (yes you treat it like a msgstring and also remember the note above)
and what does this do if the input matches your password?
it sets var 0x800D to 1
and if not ViceVersa
and also. instead of defining the password on your script , you can point it out at any address in the rom as long as it's a string that is not more than the max input char.
you can do that by changing the label real_password to the address of your password.
That's it .
and another one , You can also change the "Rival's Name" text or "PKMN name" if you found out how to do that . It'll be really helpful :)
This Routine can be used for many things not just for Password System. You can use it to name People in your game , It's up to you.
I don't know if anyone here has already posted this one,
But i'm sure someone researched this and used it in their hack. (BTW It's Glazed if you don't know)
Credits to: TheCreatorofGlazed for the wonderful Idea, BluRose for the Initialization and Touched Sensei for everything else.
Here it is:
[FR] Text Display Input Routine
Basically what this do is get an input from user via naming_function and stores it somewhere in the ram then compare it to some string you can define.
Note: I'm not GOOD at ASM so don't judge me if i said something wrong or explained something wrong. Please point it out instead . It's just that those ones who I asked to help me are very GOOOOOOOOOOOOD at ASM.
Routine:
Spoiler:
Code:
.text
.align 2
main:
push {r4, lr}
sub sp, #8
mov r0, #0x4 @set this to 0x1 or 0x2 for Pokemon_nicknaming and 0x4 for rival (if you change it to Rival im not sure if it will require additional args)
ldr r1, fcode_buffer
mov r2, #0
mov r3, #0
mov r4, #0
str r4, [sp]
adr r4, continue
add r4, #1
str r4, [sp, #4]
ldr r4, display_text
bl call_via_r4
add sp, #8
pop {r4, pc}
.align 2
display_text: .word 0x0809d954|1
continue:
push {r4, lr}
ldr r0,fcode_buffer
ldr r1, real_password
ldr r1, [r1]
ldr r4, strcomp
bl call_via_r4
cmp r0, #0
beq matched
mov r0, #0
b return
matched:
mov r0, #1
return:
ldr r1, var_800D
strh r0, [r1]
ldr r4, =0x080568E0|1
bl call_via_r4
pop {r4, pc}
call_via_r4:
bx r4
.align 2
strcomp: .word 0x08008E28|1
fcode_buffer: .word 0x02021CE0
real_password:.word 0x03000EB0+0x64
var_800D: .word 0x020370D0
Instruction:
Spoiler:
You can define your password by putting :
loadpointer 0 @password
before the callasm. (note: you can't set your password more than the max Characters in the Input or else it will fail)
#org @password
= yourpass (yes you treat it like a msgstring and also remember the note above)
and what does this do if the input matches your password?
it sets var 0x800D to 1
and if not ViceVersa
and also. instead of defining the password on your script , you can point it out at any address in the rom as long as it's a string that is not more than the max input char.
you can do that by changing the label real_password to the address of your password.
That's it .
and another one , You can also change the "Rival's Name" text or "PKMN name" if you found out how to do that . It'll be really helpful :)
This Routine can be used for many things not just for Password System. You can use it to name People in your game , It's up to you.
mov r0, #0x4 @set this to 0x1 or 0x2 for Pokemon_nicknaming and 0x4 for rival (if you change it to Rival im not sure if it will require additional args)
00 is player
01 is for box naming
02 is for pokémon
03 is literally 02, maybe used for hatching?
04 is the rival
and now, adding on to it
note: i've not actually gotten the following to work satisfactorily, even when just copying a previous entry directly onto the new one, so i'm considering this incomplete but usable
okay so basically we're going to repoint the table at x3E248C which has 5 pointers. there's exactly one pointer to this table, should be at x9DB58
add a new pointer to at least 12 bytes of free space (not hexadecimal). in these bytes, you're going to put some data.
now, the sequence goes like this:
1 byte - ida lists this as "pre-filled," meaning you could fill in things automatically? neat, no idea how that would work, though
1 byte - length of entry. max is 13 (0D)
1 byte - image index
1 byte - gender icon shown - 00 no, 01 yes
1 byte - this one seems to change what it looks like when the naming screen is accessed, but it always looks like this anyways
3 unknown bytes
4 bytes - pointer to what the text for the prompt should be (i.e. "YOUR NAME?" "RIVAL's NAME?")
* image index can be one of the following values
00 - nothing shows on the shadow thing
01 - player character, probably changes depending on gender
02 - the pc icon, used for renaming boxes (what i use for the password purpose)
03 - pokémon icon (because no pokémon is loaded in r2, we get the question mark)
04 - gary overworld
05 and above reset the game
and so we go for what i put to simulate the password
00 0A 02 00 01 00 00 00 XX XX XX 08
which means it is not pre-filled, the password is ten characters long, the icon used is the one for the pc, there is no gender icon, the "access screen" is 01, and the text for the prompt is located at 08XXXXXX.
and now for the problem which you all may have caught earlier
there's no text, leaving this large blank white space. the pointer i mentioned earlier doesn't seem to affect anything. i even took the rival's entry and pasted it over exactly, and... well, here's the results:
however, editing earlier entries works just finely
so, um, yeah. happy hacking~
EDIT3: when 0xFB (celebi index) is in r2, we get this when image is set to 03
can't figure out other two registers though so uh ahaha
HOPEFULLY final edit:
okay! so now we're going to do this rather hackily but it should work (has worked for my testing).
change the bytes at x47614, x9FD1A, xCC038, and xCC112 from 03 to 02. this makes it so that we can use 03 for our purposes. hatching eggs uses 03, but i'm able to nickname hatched pokémon just finely with 02.
so, x3E248C, the table. repoint x3E2498 to some freespace. at this freespace, fill out your entry:
00 for unfilled, length of entry up to 0D, 03 for loading the pokémon icon, 00 for no gender icon, 01 00 00 00, and then a pointer to ANY byte that is JUST FF. my entry looks like this:
Code:
00 0D 03 00 01 00 00 00 D0 00 00 08
and now the weird part. the pokémon names each have a limit of 10 bytes, right? well, yes, but this routine loads until a FF shows up. so, what we can do is use two pokémon names to have our own custom message!
so, i put BF C8 CE BF CC 00 CA BB CD CD D1 C9 CC BE AD FF (ENTER PASSWORD.) at x2469B4, which is the start of the name of the pokémon index 0xFC, or the empty one right after celebi.
and so we edit the beginning of the routine:
Code:
mov r0, #[b]0x3[/b] @Type: 0-4 , 4=rival 3=Pokemon
ldr r1, fcode_buffer
mov r2, #0xFC @or whichever pokémon you desire that has your custom icon and message, have to edit the routine a bit if over FF
mov r3, #0
mov r4, #0
honestly i'm ashamed that i spent so much time on figuring out this horrible method
and now the product:
i changed the icon to a blue ralts to show customizability. but there you have it i guess, certainly a subpar solution but it does the job. a better way would probably have been to point the prompt of a vanilla routine to somewhere in the ram, but that doesn't permit the custom icons.
mov r0, #0x4 @set this to 0x1 or 0x2 for Pokemon_nicknaming and 0x4 for rival (if you change it to Rival im not sure if it will require additional args)
00 is player
01 is for box naming
02 is for pokémon
03 is literally 02, maybe used for hatching?
04 is the rival
and now, adding on to it
note: i've not actually gotten the following to work satisfactorily, even when just copying a previous entry directly onto the new one, so i'm considering this incomplete but usable
okay so basically we're going to repoint the table at x3E248C which has 5 pointers. there's exactly one pointer to this table, should be at x9DB58
add a new pointer to at least 12 bytes of free space (not hexadecimal). in these bytes, you're going to put some data.
now, the sequence goes like this:
1 byte - ida lists this as "pre-filled," meaning you could fill in things automatically? neat, no idea how that would work, though
1 byte - length of entry. max is 13 (0D)
1 byte - image index
1 byte - gender icon shown - 00 no, 01 yes
1 byte - this one seems to change what it looks like when the naming screen is accessed, but it always looks like this anyways
3 unknown bytes
4 bytes - pointer to what the text for the prompt should be (i.e. "YOUR NAME?" "RIVAL's NAME?")
* image index can be one of the following values
00 - nothing shows on the shadow thing
01 - player character, probably changes depending on gender
02 - the pc icon, used for renaming boxes (what i use for the password purpose)
03 - pokémon icon (because no pokémon is loaded, it is the question mark)
04 - gary overworld
05 and above reset the game
and so we go for what i put to simulate the password
00 0A 02 00 01 00 00 00 XX XX XX 08
which means it is not pre-filled, the password is ten characters long, the icon used is the one for the pc, there is no gender icon, the "access screen" is 01, and the text for the prompt is located at 08XXXXXX.
and now for the problem which you all may have caught earlier
there's no text, leaving this large blank white space. the pointer i mentioned earlier doesn't seem to affect anything. i even took the rival's entry and pasted it over exactly, and... well, here's the results:
however, editing earlier entries works just finely
WTH did you just do? now it's complete :D (Not ,yet :P)
Just wanna add something ,if you wan't to modify the icon and change it to something custom.
Actually you can, How? Change the type to 03, (Pokemon encounter)
now rememeber that it Writes there the Species name and Icon? well , you just need to add your Custom icon and put it somewhere (You add new pokemon actually, Let's you change the icon and Title) .
But to be able to choose Pokemon number you need to put a MOV r2, #thePokemonIndexHere.
That means that argument3 actually becomes the Pokemon Specie number.
You can check out the other Arguments to the funcetion here's what i know:
r0 - type ()
r1 - Pointer to the address you want store the inputted string. in the routine.
r2 - the PokemonIndexNumber
Edit: Not yet complete actually, By choosing 0x3 as type (Pokemon) you can customize the Icon but the Title will Show + nickname at the end of the Custom Title (Pokemon Name)
Can someone help me make wild Pokemon jump at the start of a battle just like how they do on the status screen (Fire Red)? Like how when you view a Pokemon on the status screen in Fire Red they shift/jump slightly up and down. Thanks.
Can someone help me make wild Pokemon jump at the start of a battle just like how they do on the status screen (Fire Red)? Like how when you view a Pokemon on the status screen in Fire Red they shift/jump slightly up and down. Thanks.
Hmm. It's really not. I'm not looking to animate the sprites but merely to make them 'jump' such as when viewing them from Fire Red's status screen. The code's already there it just needs to be adapted or changed for when there's a battle to make it happen like that. It should be easy enough to do, I just don't know enough ARM, so I posted here hoping to get some help since this doesn't seem to have been done, yet. Thank you for trying, though.
Yeah, I can fix my OP to have the Emerald version of the routines too (if you provide them :P).
1) I don't know why it's reseting, I haven't tried Darthatron's method and I don't have another method :x
2) This is a text edit. Look for the text string in the ROM and change it.
Player Backsprite swapping
So basically, it just sets your backsprite to another backsprite.
In a script insert:
setvar 0x8000 0x[backsprite number]
callasm 0x[routine +1]
Here is a list of possible backsprite numbers:
Code:
0x0 - Male Hero
0x1 - Female Hero
0x2 - Brendon
0x3 - May
0x4 - Teachy TV guy
0x5 - Old man
Greater than 0x5 - game crash :3
Before using this routine there are a few things you should know about it. There is a limit of 6 possible backsprite swaps including: Male Hero, Female Hero, Brendon, May, Teachy TV guy, Old man.
If you need to have more than 6, then figure that out yourself. Otherwise I would just edit over the existing ones rather than inserting new ones.
The second thing you need to know is that this routine works by changing the Player's gender byte. You need to set it back to normal after you're done with the event, or it will reflect in the overworld in the form of a nice buggy player char.
However, you cannot use the checkgender scripting command to figure this out, because we overwrote that byte. So luckily for you, I already thought of that and decided to write the player's backsprite to RAM offset 0x203C231.
So to set it back, use this after the end of your event:
Code:
copybyte 0x20370B8 0x203C231 '@will put the player's old gender byte in 0x8000
callasm 0x[routine +1]
If this is possible is it also possible for not only the back sprite but the front sprite used for the trainer card and the overworld sprites simultaneously? I was thinking of having the trainer in Emerald be able to change their clothes to the ones from Ruby and Sapphire if the player wanted.
If this is possible is it also possible for not only the back sprite but the front sprite used for the trainer card and the overworld sprites simultaneously? I was thinking of having the trainer in Emerald be able to change their clothes to the ones from Ruby and Sapphire if the player wanted.
The algorithm of changing gender to change the backsprite is fundamentally flawed. But I suppose you can write a small hook to change the front sprite too. Anyways this is years old and I have no intention of updating, much less for Emerald.
CLICK FOR EMERALD
This is probably the least efficient way to do this, but it works.
Attack:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x137134
ldr r1, [r2]
ldrb r2,[r1,#4]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #1 @ Lonely
beq red
cmp r0, #2 @ Brave
beq red
cmp r0, #3 @ Adamant
beq red
cmp r0, #4 @ Naughty
beq red
cmp r0, #5 @ Bold
beq blue
cmp r0, #10 @ Timid
beq blue
cmp r0, #15 @ Modest
beq blue
cmp r0, #20 @ Calm
beq blue
black:
ldr r6, blackfont
b end
red:
ldr r6, redfont
b end
blue:
ldr r6, bluefont
end:
pop {r0-r3}
ldr r1, =(0x0813713c+1)
bx r1
decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2
getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Defense:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x137158
ldr r1, [r2]
ldrb r2,[r1,#6]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #1 @ Lonely
beq blue
cmp r0, #5 @ Nold
beq red
cmp r0, #7 @ Relaxed
beq red
cmp r0, #8 @ Impish
beq red
cmp r0, #9 @ Lax
beq red
cmp r0, #11 @ Hasty
beq blue
cmp r0, #16 @ Mild
beq blue
cmp r0, #21 @ Gentle
beq blue
black:
ldr r6, blackfont
b end
red:
ldr r6, redfont
b end
blue:
ldr r6, bluefont
end:
pop {r0-r3}
ldr r1, =(0x08137162+1)
bx r1
decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2
getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Special Attack:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x13717C
mov r2,r8
ldr r1, [r2]
ldrb r2,[r1,#8]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #3 @ Adamant
beq blue
cmp r0, #8 @ Impish
beq blue
cmp r0, #13 @ Jolly
beq blue
cmp r0, #15 @ Modest
beq red
cmp r0, #16 @ Mild
beq red
cmp r0, #17 @ Quiet
beq red
cmp r0, #19 @ Rash
beq red
cmp r0, #23 @ Careful
beq blue
black:
ldr r6, blackfont
b end
red:
ldr r6, redfont
b end
blue:
ldr r6, bluefont
end:
pop {r0-r3}
ldr r1, =(0x08137188+1)
bx r1
decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2
getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Special Defense:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x1371A4
ldr r1, [r2]
ldrb r2,[r1,#0xA]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #4 @ Naughty
beq blue
cmp r0, #9 @ Lax
beq blue
cmp r0, #14 @ Naive
beq blue
cmp r0, #19 @ Rash
beq blue
cmp r0, #20 @ Calm
beq red
cmp r0, #21 @ Gentle
beq red
cmp r0, #22 @ Sassy
beq red
cmp r0, #23 @ Careful
beq red
black:
ldr r6, blackfont
b end
red:
ldr r6, redfont
b end
blue:
ldr r6, bluefont
end:
pop {r0-r3}
ldr r1, =(0x081371AE+1)
bx r1
decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2
getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Speed:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at x1371C8
mov r2,r8
ldr r1, [r2]
ldrb r2,[r1,#0xC]
add r2,#0x32
lsl r2,r2,#0x18
lsr r2,r2,#0x18
push {r0-r3}
ldr r0, =(0x0203B140)
ldr r0, [r0]
ldr r2, =(0x3290)
add r0, r0, r2
mov r1, #0
bl decryptbranch
bl getnaturebranch
cmp r0, #2 @ Brave
beq blue
cmp r0, #7 @ Relaxed
beq blue
cmp r0, #10 @ Timid
beq red
cmp r0, #11 @ Hasty
beq red
cmp r0, #13 @ Jolly
beq red
cmp r0, #14 @ Naive
beq red
cmp r0, #17 @ Quiet
beq blue
cmp r0, #22 @ Sassy
beq blue
black:
ldr r6, blackfont
b end
red:
ldr r6, redfont
b end
blue:
ldr r6, bluefont
end:
pop {r0-r3}
ldr r1, =(0x081371d4+1)
bx r1
decryptbranch:
ldr r2, =(0x0803FBE8+1)
bx r2
getnaturebranch:
ldr r2, =(0x08042EB4+1)
bx r2
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
redfont: .word 0x08RRRRRR @ ROM location that contains: 00 01 0A 00
bluefont: .word 0x08BBBBBB @ ROM location that contains: 00 07 0A 00
Reverting the font colour back to black:
Code:
.thumb
@ 00 49 08 47 XX XX XX XX at 081371F0
ldr r1, [r2]
ldrb r2,[r1,#0xE]
add r2,#0xF
lsl r2,r2,#0x18
lsr r2,r2,#0x18
ldr r6, blackfont
ldr r1, =(0x081371FA+1)
bx r1
.align 2
blackfont: .word 0x08463FA4 @ In a vanilla FR ROM, this contains: 00 0E 0A 00
where XX XX XX XX is the location of each routine +1.
This colours the stat increased by the Pokémon's nature red, and the stat that is decreased blue.
Edit: Updated 23/12/2015, the old routines had a few errors that I forgot to update after making changes to my ROM. I've also confirmed what bluefont should be in a vanilla ROM. Enjoy!