Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
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.
I've been having some trouble getting the Berry System to work. For some reason, the script crashes when it gets to the first instance of the Get Tree Data routine. I know this is where the problem is because if I remove it from the script, it doesn't crash until it gets to the Berry Bag Selection routine, which for some reason crashes the game if I have a berry in the bag, but that could be a result of removing the Get Tree Ddata routine. I thought that maybe the problem was I installed JPAN's Save Block hack wrong (instructions seemed a little confusing at first, but I'm pretty sure I did it right), so I found this patch with the hack, applied it a clean FireRed 1.0 ROM, and then put all the other routines in, and had the same problem.
My script was a simple copy/paste from this thread, which the offsets filled in properly of course. All the ASM rotuines were also unmodified, and copied directly from this thread, I also tried compiling them myself and inserting them that way, but nothing seems to work.
I've been having some trouble getting the Berry System to work. For some reason, the script crashes when it gets to the first instance of the Get Tree Data routine. I know this is where the problem is because if I remove it from the script, it doesn't crash until it gets to the Berry Bag Selection routine, which for some reason crashes the game if I have a berry in the bag, but that could be a result of removing the Get Tree Ddata routine. I thought that maybe the problem was I installed JPAN's Save Block hack wrong (instructions seemed a little confusing at first, but I'm pretty sure I did it right), so I found this patch with the hack, applied it a clean FireRed 1.0 ROM, and then put all the other routines in, and had the same problem.
My script was a simple copy/paste from this thread, which the offsets filled in properly of course. All the ASM rotuines were also unmodified, and copied directly from this thread, I also tried compiling them myself and inserting them that way, but nothing seems to work.
Hi FBI, first of all thanks for your work! You've been really helpful.
My question regards your battle routine https://www.pokecommunity.com/showthread.php?p=8527650#8527650 .
I've been trying it without success in my Ruby rom hack hoping it would work just like in Fire Red.
Is there any way to remove the whiteout after losing a battle in a Ruby hack rom?
That's actually very easy. There's a bit in RAM somewhere which controls this. I vaguely remember posting about it here, but I'll get back to you with more content.
I'd like to say that this thread has been really helpful for me as my ASM skills are far worse than sub-par and, also, the Chain-Fishing one in particular is really cool to me. (◕‿◕✿)
I'd also like to request something for Fire Red BPRE v1.0 (adding to the infinite list of requests...):
Stance Change.
Basically, where a Pokémon uses an offensive move and changes its form to a more offensive Pokémon (or, rather, just a different index-number Pokémon entirely). However, when it uses a certain move (or just a status move would be fine, too), it reverts back to the old form.
EDIT: Oh, and it would also have to revert to the other form outside of battle.
What I was thinking was two separate abilities in order to accomplish this, but if one is possible, then that's great too!
Thanks in advance!
God I sound so rude I am so sorry
EDIT: Also, should I go to DaniilS with this? I noticed that he had his own thread for form(e)s...
EDIT EDIT: Okay, I just noticed something while I was trying to get the Male-only and Female-only evolution methods working on Burmy.
But ALL of the Pokémon generated by your routine are Male unless if they have more of an 82 percent chance of being female, in which case they are, and the Pokémon already caught turn into females. This is also shown in you post showcasing it, as the Tyranitar are also all Male.
Just wanted to say this, haha...
Yes, go to daniilS with this. He should be done by now, 4 or so months ago he said he was working on forms and mega evolutions. He should have everything worked out now if he isn't slacking ;D
Few simple questions on breeding, egg groups and all that. You said it's all doable via a Pokémon Editor. What I want, actually is that Charizard evolutionary line breeds only with its line and/or Ditto. No Dragon/Monster egg groups. Will I have to make an egg group for each evolutionary family?
Also, how can I make Ditto breeds with himself too, not only all other Pokémon? And genderless Pokémon, like Magnemite? How can I make them breed?
Finally, for Nidorans and Volbeat/Illumise, I wanna make the male breed with the female, but not breedable with Ditto. How can I do it?
Here, I just want to know if I can make all Pokémon to be Docile as default or if I can change all natures' data, so all natures behave like Docile. Is either of these possible?
Thanks in advance!
FD 0F 00 E0 E3 E7 E8 00 E7 E3 E1 D9 00 E3 DA 00 DD E8 E7 00 C2 CA AB FF
Bonus, Life Orb boost (lightball updated included). UPDATE for Emerald : I added a routine to make a new item that boost a certain type of attack. If you have a fairy type in your hack rom, you can now have an item that boost that type. You can adjust the boost the same way than miracle seed and such in G3T. I also implemented the TimeSpace orb in the routine :
Spoiler:
Emerald:
Code:
CheckLifeOrb:
cmp r2, #[I][U]0x43[/U][/I] /*Held item effect of life orb, I chose 0x43 (= 67 in decimal) because it's unused*/
beq Lifeorb
CheckNewItem:
cmp r2, #[I][U]0x44[/U][/I] /*Held item effect of the boost item, I chose 0x44 (= 68 in decimal) because it's unused*/
beq NewItem
CheckAdamantOrb:
cmp r2, #[I][U]0x45[/U][/I] /*Unused held item effect*/
bne CheckLustreous
ldrh r0, [r6]
mov r3, #0xFF /*0xFF + 0xE4 = 0x1E3 = 483 = index number of Dialga*/
add r3, #0xE4
cmp r0, r3
beq AdamantOrb
CheckLustreous:
cmp r2, #[I][U]0x46[/U][/I] /*Unused held item effect*/
bne CheckGriseous
ldrh r0, [r6]
mov r3, #0xFF /*0xFF + 0xE5 = 0x1E4 = 484 = index number of Palkia*/
add r3, #0xE5
cmp r0, r3
beq LustreousOrb
CheckGriseous:
cmp r2, #[I][U]0x47[/U][/I] /*Unused held item effect*/
bne CheckLightBall
ldrh r0, [r6]
mov r3, #0xFF /*0xFF + 0xE8 = 0x1E7 = 487 = index number of Giratina*/
add r3, #0xE8
cmp r0, r3
beq GriseousOrb
b Back
AdamantOrb:
push {r0-r5}
mov r1, #8 /*Steel type*/
mov r2, #0x10 /*Dragon type*/
b CheckExceptionTypeAttack
LustreousOrb:
push {r0-r5}
mov r1, #0xB /*Water type*/
mov r2, #0x10 /*Dragon type*/
b CheckExceptionTypeAttack
GriseousOrb:
push {r0-r5}
mov r1, #7 /*Ghost type*/
mov r2, #0x10 /*Dragon type*/
b CheckExceptionTypeAttack
NewItem:
push {r0-r5}
mov r1, #9 /*New type you want to boost*/
mov r2, #9 /*New type you want to boost, here I choose the same because I want it boost only one type*/
CheckExceptionTypeAttack:
ldr r4, CheckTypeLoc
ldr r4, [r4]
ldrb r4, [r4, #0x13]
cmp r4, #0
beq GetMoveType
mov r5, #0x3F
and r4, r5
cmp r4, r1
beq Boost
cmp r4, r2
beq Boost
b PopAndBack
Back:
ldr r0, Return
bx r0
PopAndBack:
pop {r0-r5}
b Back
CheckLightBall:
cmp r2, #0x2D
bne Back
ldrh r0, [r6]
cmp r0, #0x19
beq Lightball
b Back
GetMoveType:
ldr r3, CurMoveIndex
ldrh r3, [r3]
ldr r4, MoveData
mov r5, #0xC
mul r5, r3
add r4, r5
ldrb r4, [r4, #2]
cmp r4, r1
beq Boost
cmp r4, r2
bne PopAndBack
Boost:
pop {r0-r5}
ldrh r3, [r6, #0x2E]
lsl r0, r3, #4
push {r1}
mov r1, #6
mul r3, r1
pop {r1}
add r3, r0
lsl r3, #1
ldr r0, LocItems
add r3, r0
add r3, #0x13
ldrb r0, [r3]
mov r3, #0x52
mul r0, r3
lsr r0, #6
add r0, #0x7B
mul r7, r0
lsr r7, #7
mov r3, r8
mul r3, r0
lsr r3, #7
mov r8, r3
b Back
Lifeorb:
mov r0, r8
mov r3, #0xA7
mul r0, r3
lsr r0, #7
mov r8, r0
mul r7, r3
lsr r7, #7
b Back
Lightball:
mov r0, r8
lsl r0, r0, #0x1
mov r8, r0
lsl r7, r7, #0x1
b Back
.align 2
Return: .word 0x0806983E+1
LocItems: .word 0x085839A0 /*Location of your items Data*/
CurMoveIndex: .word 0x020241EA
MoveData: .word 0x0831C898 /*Location of your move data*/
CheckTypeLoc: .word 0x0202449C
/*00 48 00 47 XX XX XX 08 00 00 00 at 0x6982C*/
Fire Red:
Code:
cmp r2, #0x43 /*Held item effect, I chose 0x43 (=67 in dec) because it is unused in the game*/
beq Lifeorb
cmp r2, #0x2D
bne Back
ldrh r0, [r6]
cmp r0, #0x19
beq Lightball
b Back
Lifeorb:
mov r0, r8
mov r3, #0xA7
mul r0, r3
lsr r0, #7
mov r8, r0
mul r7, r3
lsr r7, #7
b Back
Lightball:
mov r0, r8
lsl r0, r0, #0x1
mov r8, r0
lsl r7, r7, #0x1
Back:
ldr r0, Return
bx r0
.align 2
Return: .word 0x0803F00A+1
/*00 48 00 47 XX XX XX 08 00 00 00 at 0803EFF8*/
Recoil and boost work indeed seperatly, as you can see the branch aren't done at the same places. So yeah you have to give the same effect in both routine as well as assembling them to have both recoil/boost effects.
The first hackathon was probably the worst thing that could have happened for this thread. It completely killed my motivation for hacking and made me quit for a few months. There are some good things that came out of it, I was able to do a lot of research on things I hadn't before including field moves, OAM, trainer generation and such. I was looking around my older routines for OAM manipulation, and I had trouble understanding and ripping my own code! I had lost the source code, so I decided to rip as much as I can and redo the jibberish including some clean up.
Similar routines to these ones I'm presenting were used for the custom intro in team 4's hackoff ROM :)
Generating OAMs
This routine is only to generate OAMs which are trainer or Pokemon sprites. I've modified it to be usable with a script, but honestly, setting the values yourself via ASM would've been faster (not that this is noticeably slow, just comparatively). I will have to do more research on making it portray an arbitrary image, but with the expansion work on the Pokedex and such, I don't see it as very necessary anymore.
How to insert:
Compile and insert the following routine into a free word aligned offset.
Usage:
The usage is quite simple, but it takes up a lot of temporary variables :P
Code:
@var 0x8000 - Slot #. Set 0x6 for shiny.
@var 0x8001 - X-pos
@var 0x8002 - Y-pos
@var 0x8003 - Unoccupied Pal ID number. See OAM viewer.
@var 0x8004 - Occupacity silluette set 1
@var 0x8005 - species/trainer sprite ID
@var 0x8006 - Front (1) or Back (0)
@var 0x8007 - Toggle trainer or Pokemon
Some quick notes about these variables.
Variable 0x8000 is to determine the Pokemon's shinyness. If you're showing a Pokemon in your party just use that Pokemon's party slot. If you're showing a shiny Pokemon go ahead and use 0x6. Basically 0x6 = shiny, anything else (must be lower) depends on party slot.
Variable 0x8003 plays a key role. Make sure in the OAM viewer the sprite ID is free.
Here sprite number 0 is taken by Oak's OAM. Click the Arrow until you find something not occupied, and set this variable to that value!
Variable 0x8007 is a switch of sorts. It determines whether to show a trainer sprite or a Pokemon sprite.
I think the rest of the variables are self explanatory. Mess around with them a little :)
OAM tracking
So I'm sure you can imagine, that at some point in time you want your OAM to disappear. You can't have it on the screen forever, maybe even make it disappear temporarily and reshow it without having to do the painfully expensive creation call again. I made a routine which will take into account the last OAM ID which you created and stores it in var 0x8008. Note that this is an ID assigned by the game code, not the same ID as the one we assigned on creation. Therefore it's important to track this.
How to insert
Compile and insert the following routine into free space.
Spoiler:
.text
.align 2
.thumb
.thumb_func
@ID of last OAM created - 0x8008
@Hook at 0x80070B0 via r1
Navigate to 080070B0 and insert the following byte changes:
Code:
00 49 08 47 XX XX XX 08
Where XX XX XX is the location your inserted your routine in reverse hex +1. The trailing "08" may change to 09 or something depending on where you inserted it. Remember to stay word aligned!
Usage:
This routine doesn't really do anything by itself. It's more of a routine which works in the background. It just writes to variable 0x8008 the last displayed OAM's ID. Basically, just insert it and do nothing :3
A quick explanation of how OAMs are shown/hidden in FireRed.
There's a neat RAM structure in FireRed which controls whether or not to show or unshow an OAM on the screen. This OAM's ID needs to be present in said structure. The structure, for some unknown reason, is 40 bytes in size. It looks like this:
[OAM ID (1 byte)] [OAM ID (1 byte)] [OAM ID (1 byte)] ... [Byte 0x3F] [Filler bytes] ...[40th filler byte]
In case you don't understand by now, it's basically a table of X entries where each entry is an OAM's ID to display. Every entry after the byte 0x3F is not read by game code, and is therefore nothing more than filler bytes!
The reason as to why I'm confused the structure is 40 bytes is because the routines which use this structure restrict themselves by using another structure. This second structure only holds 13 OAMs at a time, which is why we can only have 13 OAMs present in FR on screen at once WITHOUT fully customized code. For the most part you'll never go over 13 anyways. I used 9 in total for the custom intro and the screen was cluttered :X
My guess as to why it's 40 bytes is because it's used for animation frames as well. I'm not sure, I haven't researched that.
This structure is located at 0x2021800.
Hiding OAMs created
Now that you understood the data structure, you need to remove your OAM's byte ID from the table. But how do you know which byte is your OAM's byte? That was what the previous tracker routine was for. Right after you create your OAM the corresponding table ID will be in var 0x8008. Copy this value into somewhere you won't lose it (i,e a non-temporary variable), from there you can callasm this routine with the appropriate parameters :)
How to insert:
Compile and insert the following routine to free space:
loop:
ldrb r1, [r0]
cmp r1, r2
beq set
add r0, r0, #0x1
b loop
set:
mov r1, #0x3F
strb r1, [r0]
done:
pop {r0-r2, pc}
.align 2
Usage:
In a script, set variable 0x8000 to the OAM ID you want to vanish, then simply callasm this routine. This data structure is updated every frame from what I was able to see, so the results should be immediate.
Show OAM
Sometimes you want to hide an OAM but only temporary. This routine will show an OAM which has already been loaded, but flagged as hidden or similar.
How to insert:
Compile and insert into free space the following routine:
Spoiler:
.text
.align 2
.thumb
.thumb_func
@OAM ID to set - 0x8000
main:
push {r0-r2, lr}
ldr r0, =(0x2021800)
loop:
ldrb r1, [r0]
cmp r1, #0x3F
beq set
add r0, r0, #0x1
b loop
In a script, set variable 0x8000 to the OAM ID you want to reappear, then simply callasm this routine. This data structure is updated every frame from what I was able to see, so the results should be immediate.
Closing notes:
I may or may not update these with animations as well. One I'm particularly interested in doing is a slow fade. The biggest thing I want to address is how to use these in a script. I think it's fairly intuitive, but a quick example may help :)
Play around with it. It can be fun, and hopefully this will open more doors for hackers. I've made it as friendly as possible even opening up the potential to use it in scripts, but if you have any questions you can direct them to me at the ASM help thread or something :D
Quick research:
TMs are deleted in two places. The first place is in their own function. When called from the bag, after use the TM has it's own deletion mechanism. The second way is from the bag, after you use a TM the bag attempts to delete it as well. Well, the solution is quite simple. There's two ways to do this, either go to 0809A1D8 call your own function there which checks if the item is a TM, and if it is, just jump to the end. Or much more simply you just remove the parts from the bag and tm function that deletes the TM (Which is what I did). The former way is a way you can make another item you have unconsumable.
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
Where XX XX XX is the pointer to where you assembled the routine +1
Now navigate to 0x131EA5 and change the byte to E0
Unsellable:
Basically for the TMs, you can still sell them to vendors. To change this, you need to modify each TM individually. It's unfortunate, but the game checks if an item can be sold my comparing it's market price to zero. If it's strictly greater than zero, then you can sell it to a vendor, seems to be the rule. So to make TMs unsellable you need to set their market prices individually to zero.
I can't use my own checks to disguise the TMs as unique because the sell routine in shops are used for ALL items including potions, berries, TMs, and other items like nuggets.
I've got a HUGE problem with this!!!!
I was playing and normally using TMs for 20k Pokémon (not a number, I'm exaggerating). I'm after the league now, and I was giving Toxic to some Pokémon, to help me catch others, so I could get the 60 Pokémon to get National Dex and be able to go to Four Island.
Problem is, when I was going to give Toxic to my Chansey, it was gone! Then I looked for the Psychic TM (other move I give to her, I took it out briefly for Rock Smash), and it was gone too. What the hell happened?
Is there a limit for this?
I got my save back, from the GBA in-game save, and I had Toxic yet. I tested giving it to one Pokémon and it didn't disappear. Then I gave it to other and then it wasn't there anymore. Is there a limited amout of times I can use a TM? Or there's something incomplete about this hack?
I've got a HUGE problem with this!!!!
I was playing and normally using TMs for 20k Pokémon (not a number, I'm exaggerating). I'm after the league now, and I was giving Toxic to some Pokémon, to help me catch others, so I could get the 60 Pokémon to get National Dex and be able to go to Four Island.
Problem is, when I was going to give Toxic to my Chansey, it was gone! Then I looked for the Psychic TM (other move I give to her, I took it out briefly for Rock Smash), and it was gone too. What the hell happened?
Is there a limit for this?
I got my save back, from the GBA in-game save, and I had Toxic yet. I tested giving it to one Pokémon and it didn't disappear. Then I gave it to other and then it wasn't there anymore. Is there a limited amout of times I can use a TM? Or there's something incomplete about this hack?
No, there shouldn't be a limit. Can anyone else confirm this bug? Also can you give me a specific case for when the TM disappears? There was a bug where it can get consumed if 4 moves were already learned. I fixed that already (it's in a separate post).
No, there shouldn't be a limit. Can anyone else confirm this bug? Also can you give me a specific case for when the TM disappears? There was a bug where it can get consumed if 4 moves were already learned. I fixed that already (it's in a separate post).
I'll confirm this second bug. Also, if you want, I can record a video of me making the TM move magically disappear. HAHAHAHA
EDIT: Second bug not confirmed!
When I noticed this, I used it in my Abra, which only had Teleport. Then it was gone after I used it in my Ekans, which had 4 moves learned.
But now, I used in an Ekans with 4 moves learned first, and I kept the TM. Then I used in my Abra, which had only one, and then the TM disappeared.
So, 4 moves learned bug is not my problem, so it seems.
I've been meaning to implement a frontier of sorts into FireRed for some time but never really got a good opportunity to do so. Today I got a little bored and decided that I might as well start up. The first problem is obviously to generate a pseudo random party for the opposing trainer. That's what I've done today!
I had made a generation routine in the past as well, but it was incomplete and a little buggy. This one, as far as I can tell in my tests, should work fine :)
Setting up some prerequisites:
When making the routine for Pokemon generation, it was important that the hacker had some customization about which Pokemon were allowed into the opponents party (to prevent legendary Pokemon, or some specific Pokemon into the competition). The best way to do that is to either make a table of the Pokemon allowed to be in the opponent's party, or a table of the Pokemon not allowed to be in it. I decided to make the hacker do a table of all the Pokemon species allowed to be in the opponent's party.
It's important to remember that Pokemon Species ID takes 2 bytes per species, and that each entry in the table is in reverse hex. Bulbasaur for example would be: "01 00" in the table. The size of the table is up to you. The biggest reason I made the table be a table of all the Pokemon allowed is because this allows you to put more than 1 entry of the same Pokemon (thus increasing it's likelihood to be selected) ==> not all Pokemon species have the same chance of being selected!
Find some half-word aligned free space (offset divisible by 2) and fill up your table with as many entries as you'd like in this format:
Code:
[2 bytes (ID)] [2 bytes (ID)] ...
Write down how many entries you have, and where the start of the table is.
How to insert:
First take a look at the routine in the spoiler. Scroll to the very bottom, and you will see two fields which need filling. The first is called "Table". Table is supposed to be a location to the table of IDs we made earlier, replace 0x8750000 with your table location. Tsize is supposed to be the amount of Pokemon your table has in it, adjust that accordingly as well.
Finally, the routine is flag toggled. If flag 0x205 is set, the opponent is generated a random party. To adjust this change these lines accordingly:
I'll confirm this second bug. Also, if you want, I can record a video of me making the TM move magically disappear. HAHAHAHA
EDIT: Second bug not confirmed!
When I noticed this, I used it in my Abra, which only had Teleport. Then it was gone after I used it in my Ekans, which had 4 moves learned.
But now, I used in an Ekans with 4 moves learned first, and I kept the TM. Then I used in my Abra, which had only one, and then the TM disappeared.
So, 4 moves learned bug is not my problem, so it seems.
I've been meaning to implement a frontier of sorts into FireRed for some time but never really got a good opportunity to do so. Today I got a little bored and decided that I might as well start up. The first problem is obviously to generate a pseudo random party for the opposing trainer. That's what I've done today!
I had made a generation routine in the past as well, but it was incomplete and a little buggy. This one, as far as I can tell in my tests, should work fine :)
Setting up some prerequisites:
When making the routine for Pokemon generation, it was important that the hacker had some customization about which Pokemon were allowed into the opponents party (to prevent legendary Pokemon, or some specific Pokemon into the competition). The best way to do that is to either make a table of the Pokemon allowed to be in the opponent's party, or a table of the Pokemon not allowed to be in it. I decided to make the hacker do a table of all the Pokemon species allowed to be in the opponent's party.
It's important to remember that Pokemon Species ID takes 2 bytes per species, and that each entry in the table is in reverse hex. Bulbasaur for example would be: "01 00" in the table. The size of the table is up to you. The biggest reason I made the table be a table of all the Pokemon allowed is because this allows you to put more than 1 entry of the same Pokemon (thus increasing it's likelihood to be selected) ==> not all Pokemon species have the same chance of being selected!
Find some half-word aligned free space (offset divisible by 2) and fill up your table with as many entries as you'd like in this format:
Code:
[2 bytes (ID)] [2 bytes (ID)] ...
Write down how many entries you have, and where the start of the table is.
How to insert:
First take a look at the routine in the spoiler. Scroll to the very bottom, and you will see two fields which need filling. The first is called "Table". Table is supposed to be a location to the table of IDs we made earlier, replace 0x8750000 with your table location. Tsize is supposed to be the amount of Pokemon your table has in it, adjust that accordingly as well.
Finally, the routine is flag toggled. If flag 0x205 is set, the opponent is generated a random party. To adjust this change these lines accordingly:
It seemed to work. I'll report back if I find anything else.
Bro, please update your Reusable TM post with this information.
Not for me, I already have it working. For other people not to stumble in the same issue.
Thanks for the help!
It seemed to work. I'll report back if I find anything else.
Bro, please update your Reusable TM post with this information.
Not for me, I already have it working. For other people not to stumble in the same issue.
Thanks for the help!
I don't really feel like doing a challenge cup. Also some of your features can be achieved using the already created party checker routine. Species Clause, Evasion Clause, OHKO clause can all be done by it. Maybe if I feel like it in future :P
Custom nicknames for enemy Pokemon
So this works for any wild or trainer Pokemon. It basically allows you to nickname a Pokemon on the enemy team prior to battling. For those special trainers or maybe special Pokemon :)
How to insert:
There's actually a little bit of work before you can compile and insert routines. First look at the routine below. You'll notice at the last line there is a Pointer to something that I call "TABLE". This table is going to be a table full of nickname with each entry 0xB bytes long. Find some space in your ROM which you will use for this table and correct the offset accordingly.
Once you've made the modification to the pointer, compile and insert the routine into freespace.
Next navigate to offset 0x406DC and insert the following:
Code:
00 48 00 47 XX XX XX 08
Where XX is the pointer to the above routine in reverse hex +1.
Usage:
First navigate to your table which will contain the nicknames (it should be the offset in the routine you changed). You need to keep the table formatted like this [10 bytes (Name in hex)] [1 byte (0xFF)]. Insert as many names as you'd like.
Next, to activate the routine, you must setflag 0x270 AND you need to setvar 0x8000 0x[table starting index].
If you're battling a trainer with 6 Pokemon, the nicknames will be determined from the table. It will read six nicknames starting from the starting index given by variable 0x8000. There is no need to callasm. :)
Danny told me to find this for Emerald, and so I did. 0x406DC is for Fire Red, 0x6AFA8 is for Emerald. I did not test this, but it should theoretically work. (Of course the offsets in the routine will have to be changed, I can start doing that but it's late and stuff)
EDIT: If you ever want me to find the Emerald offsets for you, I'd be glad to.
EDIT^2: Edited routine for Emerald (Changes in Red)
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
main:
mov r0, #0x9C [COLOR="DarkOrchid"][B]@0x9C * 4 (which is what the next line does) = 0x270. Change this for the flag since it's most likely not free in Emerald[/B][/COLOR]
lsl r0, #0x2
push {r1-r7}
[COLOR="Red"]ldr r2, =(0x809D790 +1) @Flag Check[/COLOR]
bl linker
pop {r1-r7}
cmp r0, #0x0
beq old
nick:
[COLOR="Red"]ldr r0, =(0x2024744) @Opponent RAM location[/COLOR]
sub r0, r7, r0
mov r1, #0x64
[COLOR="red"]ldr r2, =(0x82E7540 +1) @slot number[/COLOR]
bl linker
mov r3, r0
[COLOR="red"]ldr r1, = (0x20375D8) @table entry position[/COLOR]
ldrb r1, [r1]
mov r2, #0xB
mul r1, r1, r2
ldr r0, .TABLE
add r0, r0, r1 @table start position
mul r3, r3, r2
add r0, r0, r3 @name to give
mov r1, r7
add r1, r1, #0x8 @nickname location
mov r4, #0x0
nameLoop:
cmp r4, #0xB
beq end
ldrb r3, [r0]
strb r3, [r1]
add r1, r1, #0x1
add r0, r0, #0x1
add r4, r4, #0x1
b nameLoop
end:
[COLOR="red"]ldr r0, =(0x806B3D8 +1)[/COLOR]
bx r0
old:
mov r2, #0x0
mov r3, r7
add r3, #0x8
oldLoop:
add r0, r3, r2
add r1, r4, r2
ldrb r1, [r1]
strb r1, [r0]
add r2, r2, #0x1
cmp r2, #0x9
ble oldLoop
[COLOR="red"]ldr r0, =(0x806B3D8 +1)[/COLOR]
bx r0
linker:
bx r2
.align 2
[B].TABLE:
.word 0x8760000[/B]
Yeah that's not too hard, but I think you'd prefer to make your own trainer if you'd have something memorable like custom items and movesets no? It would mean more tables, and more work for the inserter. So much to the point that it wouldn't really be worth the effort, kind of like having 100 TMs.
Danny told me to find this for Emerald, and so I did. 0x406DC is for Fire Red, 0x6AFA8 is for Emerald. I did not test this, but it should theoretically work. (Of course the offsets in the routine will have to be changed, I can start doing that but it's late and stuff)
EDIT: If you ever want me to find the Emerald offsets for you, I'd be glad to.