Binary Hack Research & DevelopmentGot a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
I found the special but is only a pop up, when i click yes...nothing, the script restart with "would you like to save the game?".
You should put waitstate
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.
You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.
Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Set in variable 0x8004 the slot number of the Pokemon who's ability you want to swap. Note that Pokemon with only 1 ability won't have their abilities swapped. I've made it so it's easy to use with special 0x9F in your ability swap item script.
'---------------
#org @next
fanfare 0x71
waitfanfare
msgbox @text1 MSG_KEEPOPEN '"[buffer1]'s potential has\nbeen re..."
removeitem 0x72 0x1 ///this is set up for items. this is the item I used.
closeonkeypress
release
end
This is what I'm using for it, but it doesn't seem to be doing anything. I AM using the JPAN engine if that helps. I know it references 8004 a lot, but it shouldn't matter on this, right?
Also! I have a few ASM ideas, and as long as its not against the rules, I would be happy to pay you for them!
Would it be possible to make it so you permanently have a chance to receive a held item from wild pokemon after fainting them? Kind of like a loot system? Maybe even a check to see if you have enough item space and then maybe spawning a pokeball with the item for a later pickup that disappears once you leave the map? I'm imagining the later would be harder, but would love to hear back from you. Everything you do is amazing, and I can't wait to understand ASM more.
Another interesting one would be modifying the trainer views to have it when a certain variable is set, they don't see you. I've been planning on adding in the cardboard box from MSG, haha.
And finally a variable that when toggled causes a certain amount of money to be taken from each battle you have. with a message. IE: "20% of your rewards have gone to Team Rocket" I plan on making being a team rocket member a possibility, allowing you to catch trainer pokemon, (which is already done) but at the same time you lose funds from trainer battles, as well as people treat you differently.
#582Link to this post, but load the entire thread.
May 24th, 2015 (2:20 AM).
Edited July 28th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Damage Reduction Berries
1. Assemble the following table and insert it somewhere in Free Space:
Spoiler:
Replace YYY with the index number of the berries mentioned in the comments.
The byte below the index number for each berry represents the type of the move the berry protects it against.
1. Assemble the following table and insert it somewhere in Free Space:
Spoiler:
Replace YYY with the index number of the berries mentioned in the comments.
The byte below the index number for each berry represents the type of the move the berry protects it against.
That's awesome KDS! Have you found where the other berries activate ? (to try and make it more like 6th gen, where they activate in the end of a battle script as opposed to the start/end of turn).
I guess this would be pretty separate to that, but still I'd love to try and fix that, and buff the sitrus berry too while I'm at it.
#584Link to this post, but load the entire thread.
May 26th, 2015 (3:15 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by MrDollSteak
That's awesome KDS! Have you found where the other berries activate ? (to try and make it more like 6th gen, where they activate in the end of a battle script as opposed to the start/end of turn).
I guess this would be pretty separate to that, but still I'd love to try and fix that, and buff the sitrus berry too while I'm at it.
Yes. It is located where I made the hook for blacksludge. It reads a table using the held item effect byte as a index for pinch berries and leftovers then selects the routine from the table.
Yes. It is located where I made the hook for blacksludge. It reads a table using the held item effect byte as a index for pinch berries and leftovers then selects the routine from the table.
Ooh cheers KDS, I'll look into that. It must be located after all the move / ability effects (such as Rain Dish) etc. I'll try and redo the Sitrus berry routine, and just nop the entry table, and instead trigger them from the end BS routine.
Also while I'm at it, which command removes the item exactly? I'm just thinking for the Focus Sash (and a few other consumable items), but more importantly would like to see how the game handles consumability, so that I can make an Unburden check there somewhere (so that when an item is consumed I'd double the stat in the RAM, that way it resets on switch).
#586Link to this post, but load the entire thread.
May 26th, 2015 (4:02 AM).
Edited May 26th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by MrDollSteak
Ooh cheers KDS, I'll look into that. It must be located after all the move / ability effects (such as Rain Dish) etc. I'll try and redo the Sitrus berry routine, and just nop the entry table, and instead trigger them from the end BS routine.
Also while I'm at it, which command removes the item exactly? I'm just thinking for the Focus Sash (and a few other consumable items), but more importantly would like to see how the game handles consumability, so that I can make an Unburden check there somewhere (so that when an item is consumed I'd double the stat in the RAM, that way it resets on switch).
To remove item from battling pokemon, the battle script command 6a (with a byte as a single parameter) can be used. I was also thinking to used this routine to set unburden. Also to avoid the hassle of unsetting unburden bytes you can use the special status flag structure starting at x2023dfc which automatically resets on switching and has a few vacant values left and most importantly does not stack with baton pass unlike ingrain and block.
You can disable the table by setting the entries to the fail pointer (which is same for deepseascale which does not have any end turn effect) except leftovers or change the table reader routine to only accomodate leftovers (and similar items like black sludge,sticky barb etc.)
It's been some time since I've been around this thread because I have been testing every single ASM posted here. Though just yesterday, I was testing this one and found a little bit of problem.
Quote:
Originally Posted by FBI agent
Bag Deletion and Restoration
Delete Backup
It may be the case that you want to use this "bag swap" more than once. For that to work, you will have to delete the current backup. Normally if you don't delete the backup and you attempt to restore the bag for a second time, you will not have a problem. However, in the case that the first time you had your bag and you had more items that time than the second time it will not all be overwritten and you will add "extras". So to be on the safe side, after an event is over ALWAYS delete the backup!
How to insert:
Compile and insert into free space the following routine:
Usage:
Like all of these routines, you just need to callasm to this routine somewhere in your script. That's all, the rest is handle automagically!
That part of the Bag Deletion and Restoration Routines. Whenever I try to delete the backup I made, and try to restore the "should've-been-deleted backup" of my items (for testing purposes), it proves that the only things it deletes in the backup are the Normal ITEMS (i.e. the Pokeballs and Key Items are still there and even keep adding more). Why is it? Can it be fixed?
Oh, and I have a few requests that I hope someone could fulfill.
1. A loot system routine (like what Criminon suggested earlier that I think nobody noticed) that will give you items or money after a wild battle. I know it can be done via scripting but I personally think that doing it that way is not kinda good. I think if it was ASM'd, it would be better.
2. A display money in textbox routine. I'm not sure if this is doable via scripting because the only thing I saw there was the showmoney and I wouldn't like it. I actually wanted money to be shown via some kind of a buffer.
3. A gender change routine. Well a name player in overworld routine exists, why not a gender change routine? :P
4. Uhmm... I don't think this is possible, a Display a 256color fullscreen image routine.
5. A Change trainer levels routine based on your party's average level.
6. A Bag deletion and restoration routine that only deletes the normal items and keeps the key items and pokeballs.
That's about it. I hope someone can. Thank you! :D
#588Link to this post, but load the entire thread.
May 29th, 2015 (7:31 AM).
Edited July 18th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Flame Orb and Toxic Orb
Spoiler:
Inserting this is a bit complicated than other items. Also this was the most challenging to implement.
Anyways, here are the steps: Step I
Spoiler:
Select the bytes from x182FC to x1834B. This is a table and we are going to repoint it.
Search for 80 (or 0x50) bytes of contiguous free space and then copy and paste the table.
Now go to x182F8 and insert a series of 4 bytes corresponding to the pointer to the new location of our table. For example, if the table is at 0x731240 then in reverse hex it would be 40 12 73 08.
Step II
Spoiler:
Insert this routine in free space.
Routine at XXXXXX:
Spoiler:
EEEEEE is location for a battle script to be inserted which I will tell about later.
Now expand the table in such a way that XX XX XX 08 (Don't use +1 in this case) is the second last entry of the table (do not remove the old entries). This ensures that the orbs will activate at the extreme end of a turn after ingrain, weather damage etc.
The last entry should be 38 8C 01 08 (which is there in the original) because it successfully terminates the operation of this table.
Since the no. of entries in the table have been changed to 0x14 from 0x13, we need to break the limiters. Goto x182e6 and x18C64 and insert 0x14 there
Step III
Spoiler:
Insert the Battle Scripts and Routines in free space and change the dummy pointers mentioned in the post according to where there are inserted.
Thie battle scripts assume that F8 is the callasm command and FB is the setword command., so change it according to your ROM.
FD 0F 00 EB D5 E7 00 D6 D5 D8 E0 ED 00 E4 E3 DD E7 E3 E2 D9 D8 FE D6 ED 00 E8 DC D9 00 CE E3 EC DD D7 00 C9 E6 D6 AB
Some info about the table
Spoiler:
This table controls the order of end turn events like (weather, some end turn abilities, pinch berries, poison damage etc.) and executes them.
Interchanging the order of the table entries results in change of the order of their execution at the end turn. i.e You can make the 'Ingrain Healing' script play after the 'Burn Damaging' script by changing the order.
By expanding the table you can add things like Aqua Ring (prefably should be placed near the 1st entry which is for Ingrain), custom counters etc.
Inserting this is a bit complicated than other items. Also was the most challenging to implement.
Anyways, here are the steps: Step I
Spoiler:
Select the bytes from x182FC to x1834B. This is a table and we are going to repoint it.
Search for 80 (or 0x50) bytes of contiguous free space and then copy and paste the table.
Now go to x18F28 and insert the pointer of the new location of our table. For example, if the table is at 0x731240 then in reverse it would be 40 12 73 08.
Step II
Spoiler:
Insert this routine in free space.
Routine at XXXXXX:
Spoiler:
EEEEEE is location for a battle script to be inserted which I will tell later.
Now expand the table in such a way that XX XX XX 08 (Don't use +1 in this case) is the second last entry of the table (do not remove the old entries). This ensures that the orbs will activate at the extreme end of a turn after ingrain, weather damage etc.
The last entry should be 38 8C 01 08 (which is there in the original) because it successfully terminates the operation of this table.
Since the no. of entries in the table have been changed to 0x14 from 0x13, we need to break the limiters. Goto x182e6 and x18C64 at change it to 0x14.
Step III
Spoiler:
Insert the Battle Scripts and Routines in free space and change the dummy pointers mentioned in the post according to where there are inserted.
FD 0F 00 EB D5 E7 00 D6 D5 D8 E0 ED 00 E4 E3 DD E7 E3 E2 D9 D8 FE D6 ED 00 E8 DC D9 00 CE E3 EC DD D7 00 C9 E6 D6 AB
Some info about the table
Spoiler:
This table controls the order of end turn events like (weather, some end turn abilities, pinch berries, poison damage etc.) and executes them.
Interchanging the order of the table entries results in change of the order of their execution at the end turn. i.e You can make the 'Ingrain Healing' script play after the 'Burn Damaging' script by changing the order.
By expanding the table you can add things like Aqua Ring (prefably should be place near the 1st entry which is for Ingrain), custom counters etc.
This is awesome, congrats on that ! You should precise that is for firered, I didn't see it in the post
Note: This is not 100% working. I left this here just in case someone would like fix this one.
Quote:
Originally Posted by KDS
Flame Orb and Toxic Orb
Spoiler:
Inserting this is a bit complicated than other items. Also this was the most challenging to implement.
Anyways, here are the steps: Step I
Spoiler:
Select the bytes from x182FC to x1834B. This is a table and we are going to repoint it.
Search for 80 (or 0x50) bytes of contiguous free space and then copy and paste the table.
Now go to x18F28 and insert a series of 4 bytes corresponding to the pointer to the new location of our table. For example, if the table is at 0x731240 then in reverse hex it would be 40 12 73 08.
Step II
Spoiler:
Insert this routine in free space.
Routine at XXXXXX:
Spoiler:
EEEEEE is location for a battle script to be inserted which I will tell about later.
Now expand the table in such a way that XX XX XX 08 (Don't use +1 in this case) is the second last entry of the table (do not remove the old entries). This ensures that the orbs will activate at the extreme end of a turn after ingrain, weather damage etc.
The last entry should be 38 8C 01 08 (which is there in the original) because it successfully terminates the operation of this table.
Since the no. of entries in the table have been changed to 0x14 from 0x13, we need to break the limiters. Goto x182e6 and x18C64 and insert 0x14 there
Step III
Spoiler:
Insert the Battle Scripts and Routines in free space and change the dummy pointers mentioned in the post according to where there are inserted.
Thie battle scripts assume that F8 is the callasm command and FB is the setword command., so change it according to your ROM.
FD 0F 00 EB D5 E7 00 D6 D5 D8 E0 ED 00 E4 E3 DD E7 E3 E2 D9 D8 FE D6 ED 00 E8 DC D9 00 CE E3 EC DD D7 00 C9 E6 D6 AB
Some info about the table
Spoiler:
This table controls the order of end turn events like (weather, some end turn abilities, pinch berries, poison damage etc.) and executes them.
Interchanging the order of the table entries results in change of the order of their execution at the end turn. i.e You can make the 'Ingrain Healing' script play after the 'Burn Damaging' script by changing the order.
By expanding the table you can add things like Aqua Ring (prefably should be placed near the 1st entry which is for Ingrain), custom counters etc.
Nice work KDS... I have somehow change the offsets which would work on Emerald:
Spoiler:
Inserting this is a bit complicated than other items. Also this was the most challenging to implement.
Anyways, here are the steps: Step I
Spoiler:
Select the bytes from x409C8 to x40A17. This is a table and we are going to repoint it.
Search for 80 (or 0x50) bytes of contiguous free space and then copy and paste the table.
Now go to x41644 and insert a series of 4 bytes corresponding to the pointer to the new location of our table. For example, if the table is at 0xDE4B40 then in reverse hex it would be 40 4B DE 08.
Step II
Spoiler:
Insert this routine in free space.
Routine at XXXXXX:
Spoiler:
EEEEEE is location for a battle script to be inserted which I will tell about later.
Now expand the table in such a way that XX XX XX 08 (Don't use +1 in this case) is the second last entry of the table (do not remove the old entries). This ensures that the orbs will activate at the extreme end of a turn after ingrain, weather damage etc.
The last entry should be 04 13 04 08 (which is there in the original) because it successfully terminates the operation of this table.
Since the no. of entries in the table have been changed to 0x14 from 0x13, we need to break the limiters. Goto x409B2 and x41330 and insert 0x14 there
Step III
Spoiler:
Insert the Battle Scripts and Routines in free space and change the dummy pointers mentioned in the post according to where there are inserted.
Thie battle scripts assume that F9 is the callasm command and FA is the setword command., so change it according to your ROM.
FD 0F 00 EB D5 E7 00 D6 D5 D8 E0 ED 00 E4 E3 DD E7 E3 E2 D9 D8 FE D6 ED 00 E8 DC D9 00 CE E3 EC DD D7 00 C9 E6 D6 AB
Some info about the table
Spoiler:
This table controls the order of end turn events like (weather, some end turn abilities, pinch berries, poison damage etc.) and executes them.
Interchanging the order of the table entries results in change of the order of their execution at the end turn. i.e You can make the 'Ingrain Healing' script play after the 'Burn Damaging' script by changing the order.
By expanding the table you can add things like Aqua Ring (prefably should be placed near the 1st entry which is for Ingrain), custom counters etc.
I only changed the offsets used in the ASMs and Battle Script commands. I haven't changed offsets in Battle Scripts. I just dunno which is right which will work on Emerald. I haven't tested this yet so KDS, hope you can help me this one now.
Replace KK with the effect byte of Flame Orb.
Replace LL with the effect byte of Toxic Orb.
Quick question: What do you mean for this one? Is it the item number of those two or is it something it has to do on the expanded table on the first step? I'm really confuse with this one. :/
#592Link to this post, but load the entire thread.
May 30th, 2015 (11:35 PM).
Edited June 1st, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Sky High
Quick question: What do you mean for this one? Is it the item number of those two or is it something it has to do on the expanded table on the first step? I'm really confuse with this one. :/
EDIT: Didn't read the first point regarding the offsets. In the battle scripts, change the first paramter of setword command to x203e320 from x203c020 in reverse hex. Also make the battle string loader has the same offset as the parameter.
Inserting this is a bit complicated than other items. Also this was the most challenging to implement.
Anyways, here are the steps: Step I
Spoiler:
Select the bytes from x182FC to x1834B. This is a table and we are going to repoint it.
Search for 80 (or 0x50) bytes of contiguous free space and then copy and paste the table.
Now go to x18F28 and insert a series of 4 bytes corresponding to the pointer to the new location of our table. For example, if the table is at 0x731240 then in reverse hex it would be 40 12 73 08.
Step II
Spoiler:
Insert this routine in free space.
Routine at XXXXXX:
Spoiler:
EEEEEE is location for a battle script to be inserted which I will tell about later.
Now expand the table in such a way that XX XX XX 08 (Don't use +1 in this case) is the second last entry of the table (do not remove the old entries). This ensures that the orbs will activate at the extreme end of a turn after ingrain, weather damage etc.
The last entry should be 38 8C 01 08 (which is there in the original) because it successfully terminates the operation of this table.
Since the no. of entries in the table have been changed to 0x14 from 0x13, we need to break the limiters. Goto x182e6 and x18C64 and insert 0x14 there
Step III
Spoiler:
Insert the Battle Scripts and Routines in free space and change the dummy pointers mentioned in the post according to where there are inserted.
Thie battle scripts assume that F8 is the callasm command and FB is the setword command., so change it according to your ROM.
FD 0F 00 EB D5 E7 00 D6 D5 D8 E0 ED 00 E4 E3 DD E7 E3 E2 D9 D8 FE D6 ED 00 E8 DC D9 00 CE E3 EC DD D7 00 C9 E6 D6 AB
Some info about the table
Spoiler:
This table controls the order of end turn events like (weather, some end turn abilities, pinch berries, poison damage etc.) and executes them.
Interchanging the order of the table entries results in change of the order of their execution at the end turn. i.e You can make the 'Ingrain Healing' script play after the 'Burn Damaging' script by changing the order.
By expanding the table you can add things like Aqua Ring (prefably should be placed near the 1st entry which is for Ingrain), custom counters etc.
I thought about something, I didn't take a look into it yet but, do you think we could use the same place for life orb ? If you can give a statut we could also make the pok takes damages. For Bad Dreams I made a simple operation and put the result at 020241F0 (if I remember well, and in Emerald), could it be possible the same way here ?
#594Link to this post, but load the entire thread.
May 31st, 2015 (3:07 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by kleenexfeu
I thought about something, I didn't take a look into it yet but, do you think we could use the same place for life orb ? If you can give a statut we could also make the pok takes damages. For Bad Dreams I made a simple operation and put the result at 020241F0 (if I remember well, and in Emerald), could it be possible the same way here ?
IMO, the life orb recoil should pe part of a damaging battle script. It means to make an hook in an existing BS command that appears in all damaging battle scripts and then inserting the life orb logic.
IMO, the life orb recoil should pe part of a damaging battle script. It means to make an hook in an existing BS command that appears in all damaging battle scripts and then inserting the life orb logic.
Probably the Set effect with chance command would make sense, or the faint Pokemon command.
Those are in all of them I believe.
It would also allow for life orb damage to be blocked by Sheer Force more easily as the best place for the Sheer Force check is in the set effect with chance command anyway.
#596Link to this post, but load the entire thread.
May 31st, 2015 (4:24 AM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by MrDollSteak
Probably the Set effect with chance command would make sense, or the faint Pokemon command.
Those are in all of them I believe.
It would also allow for life orb damage to be blocked by Sheer Force more easily as the best place for the Sheer Force check is in the set effect with chance command anyway.
Yes, these commands look the best place.
The only problem to solve is to make a command push more than one Battle Scripts per command.
These commands already have a chance to push another battle script for burn,recoil, item knock off, etc.
To insert:
Do the byte changes below
0x124F78: 00 00 00 00
0x125C80: 00 00 00 00
Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0
Make it consumable after animation:
Insert: 00 00 00 00 at 0x124F78
But in another post you said
Quote:
TM deletion fix (another one):
This one is for if you try and teach a Pokemon with less than 4 moves a TM. Apparently it does the deletion else where. To fix this insert the following byte changes:
@ 0x124EAC: 00 00 00 00
Should the latter be included in the "reusable TM" post or it is for another hack?
#600Link to this post, but load the entire thread.
June 7th, 2015 (4:11 AM).
Edited June 8th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
EV-enhancing items (Power Items)
Spoiler:
The routine now does not require any new Held Effect Item Byte. The new power items are tied to Macho Brace's Held Item Effect Byte. (Thanks to MrDollSteak for giving the idea.)
The type of EV gain is now differentiated by the Second Held Effect Byte (the byte just after the Primary Held Effect Byte in the Item Table).
There is no need to code the Speed Drop explicitly for Power Items.
Usage is now like this by using the following parameters in the Item Table: Primary Byte | Secondary Byte | Item Name
0x18 | 0x0 | Macho Brace
0x18 | 0x1 | Power Weight
0x18 | 0x2 | Power Bracer
0x18 | 0x3 | Power Belt
0x18 | 0x4 | Power Anklet
0x18 | 0x5 | Power Lens
0x18 | 0x6 | Power Band
Also, there are additional byte changes mentioned in the Spoiler to limit the EVs for each stat from 255 to 252 to avoid wastage of EVs by normal battling.
Fire Red:-
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
Main:
push {r2}
mov r0, r8 /*Load pokemon slot no*/
mov r1, #0xC
mov r2, #0x0
bl Decrypter /* Load pokemon's item */
lsl r0, r0, #0x10
lsr r0, r0, #0x10
pop {r2} /* Restore Pokerus Factor*/
cmp r0, #0xAF
beq EnigmaBerry
add r3, r0, #0x0
bl GetItemEffect /* Get Held Item's Effect Byte*/
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x18
bne NoPowerItem
add r0, r3, #0x0
bl GetSecondEffectByte
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x0
beq MachoBrace
add r1, r6, #0x1 /*Load a Power Item's Secondary Effect Byte*/
cmp r1, r0 /*Match items*/
bne NoPowerItem /*No Power Item or No Match for that particular stat*/
lsl r2, r2, #0x2
add r4, r4, r2 /* Add 4 EVs or 8 (due to Pokerus) */
NoPowerItem:
ldr r3, =0x080439D9
bx r3
EnigmaBerry:
ldr r3, =0x0804398F
bx r3
MachoBrace:
ldr r3, =0x080439D5
bx r3
Decrypter:
ldr r3, =0x0803FBE9
bx r3
GetItemEffect:
ldr r1, =0x0809A925
bx r1
GetSecondEffectByte:
ldr r1, =0x0809A949
bx r1
/*At 43978: 04 1C 54 43 00 49 08 47 XX+1 XX XX 08 00 00 00 00 00 00 00 00 00 00*/
/*At 439FC && 43A02: FC to limit EV growth for each stat to 252 */
Emerald:-
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
Main:
push {r2}
mov r0, r8 /*Load pokemon slot no*/
mov r1, #0xC
mov r2, #0x0
bl Decrypter /* Load pokemon's item */
lsl r0, r0, #0x10
lsr r0, r0, #0x10
pop {r2} /* Restore Pokerus Factor*/
cmp r0, #0xAF
beq EnigmaBerry
add r3, r0, #0x0
bl GetItemEffect /* Get Held Item's Effect Byte*/
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x18
bne NoPowerItem
add r0, r3, #0x0
bl GetSecondEffectByte
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #0x0
beq MachoBrace
add r1, r6, #0x1 /*Load a Power Item's Secondary Effect Byte*/
cmp r1, r0 /*Match items*/
bne NoPowerItem /*No Power Item or No Match for that particular stat*/
lsl r2, r2, #0x2
add r4, r4, r2 /* Add 4 EVs or 8 (due to Pokerus) */
NoPowerItem:
ldr r3, =0x0806DC25
bx r3
EnigmaBerry:
ldr r3, =0x0806DBDB
bx r3
MachoBrace:
ldr r3, =0x0806DC21
bx r3
Decrypter:
ldr r3, =0x0806A519
bx r3
GetItemEffect:
ldr r1, =0x080D74DD
bx r1
GetSecondEffectByte:
ldr r1, =0x080D7501
bx r1
/*At 6DBC4: 04 1C 54 43 00 49 08 47 XX+1 XX XX 08 00 00 00 00 00 00 00 00 00 00*/
/*At 6DC48 && 6DC4E: FC to limit EV growth for each stat to 252 */