• 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.

Quick Research & Development Thread

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
If anyone's interested, here's a tiny little morsel of information that I found recently. At the address '0x3A72A0' in Fire Red, you will find two bytes: '0xCD' and '0xFF'. These two bytes are used whenever the player is given two or more of some item using the 'giveitem' construct. The '0xCD' corresponds to an uppercase 'S' while the '0xFF' is the terminator byte, signifying the end of the string. If you change the byte from '0xCD' to '0xE7', the 'S' will become a lowercase 's'. I figure this might come in handy for those de-capitalization patches because it's really annoying to see "Player received the Poké BallS!" every time the player receives more than one of an item.

Adding onto this, the location of the (S) when selling multiple items in the PokeMart is at 0x41696C. (Still in FireRed).
 

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
Haven't seen these on here so I thought I'd post what I've found.
These are both for Emerald.
Change moves called in the Nature Power table:

The offset of the Nature Power table in FireRed is 0x25081C. The limiter is at 0xD75FC.

Also I found a couple of item checks:

At 0x1E496 is the Critical-Hit Ratio item checks. So this is for stuff like Lucky Punch, Stick and Scope Lens.
At 0x21CC2 is the Exp. Share check.

There appears to be more than one Exp. Share check. I foun two others: one at 0x21BBC and one at 0x21DAA.

The one at 0x21BBC appears to only be used by Pokemon who were sent out into battle. I'm not sure about the 0x21DAA one.

When I was messing around with them (I was trying to make some sort of Exp. All routine but gave up because I couldn't figure out how to get it not to give experience to eggs) the one at 0x21CC2 is the one that gave me the best results when I branched off of it.
 
Last edited:

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
The Great And Powerful Lucky Egg
Bag_Lucky_Egg_Sprite.png


The check for the Lucky Egg is at:

FireRed: 0x21DBA
Emerald: 0x4A67A

The byte that determines the experience multiplier is at:

FireRed: 0x21DC2
Emerald: 0x4A682

In the vanilla games, this byte has a value of 0x96, or 150 is decimal.

This gives a multiplier of 1.5.

So if you want to change the amount of experience the Lucky Egg gives you, just follow these three easy steps!

1. Choose a value that you want to multiply the gained experience by (It will have to be less than 2.5 without using ASM).

2. Take away the decimal point (so 1.5 would be 150, 2.0 would be 200).

3. Convert that value to hex (so 1.5 is 0x96, 2.5 is 0xFA) and put that value at the offset listed above.
 
5,256
Posts
16
Years
Just to be clear, what does this actually do? Will making these hex changes allow me to get Shedinja by evolving Nincada in Firered? Or do I have to do more than that?

If you expanded the number of evolutions per Pokémon, the evolution method for spawning Shedinja will be broken until you make those hex changes. If you're simply using vanilla FireRed, you don't need to make these hex changes.
 
325
Posts
10
Years
So here's a little bonus thing on b_status3_bits_pbs, or 0x02023DFC in FR. Setting it to 0x8000 or 1000000000000000b, on the defender, then that Pokemon will not be hit by critical hits, like Shell Armor and Battle Armor. This applies to all Gen 3 games, but I don't know the exact offsets of the status bits.
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
So here's a little bonus thing on b_status3_bits_pbs, or 0x02023DFC in FR. Setting it to 0x8000 or 1000000000000000b, on the defender, then that Pokemon will not be hit by critical hits, like Shell Armor and Battle Armor. This applies to all Gen 3 games, but I don't know the exact offsets of the status bits.

Just to quickly add it's 0x020242AC for Emerald.
 

Froosty

The_Learner
535
Posts
9
Years
So lately I've been studying ASM a bit and gonna try and finally get it down. I've managed to locate parts of the START menu's code simply by finding their text pointer, and then the pointer to that table of pointers, and then looking at the surrounding code in VBA's disassembler. Whenever I saw something such "mov r2, #0x8", I wondered what would happen if I had a different value load into that register. As a result, I've figured this out so far:

0x0806EF94 = X positioning of [name] in the START menu.
Change it and you can reposition [name]:
HWEpZe8.png


0x0806EFD0 = the font used in the START menu.
00 gives you the smaller font. Any other value doesn't seem to do anything.
3vhCUhy.png


0x0806EFD4 = X positioning of the text in the START menu (except [name])
The default value is 08. This is what it looks like if you change it to 00:
VpItE5B.png

(Changing it to FF/giving longer text strings will NOT magically make the menu box's width longer unlike the multichoice boxes that the script engine uses)

0x0806F0DE = relative X positioning of cursor in START menu
0x0806F0E0 = relative Y positioning of cursor in START menu
By positioning, I don't mean the actual selection within the start menu, I mean the actual pixel coordinates of the cursor within the start menu.

None of this info is useful yet, but eventually I would like to port Emerald's START menu look onto FireRed because I find it more aesthetically pleasing.

But that's not all I found!

At 0x083A7344 is a table that basically controls the START menu itself. The format of the table goes like this:
[XX XX XX 08][YY YY YY 08]
XX XX XX 08 = pointer to text string within START menu (such as POK?DEX, POK?MON, BAG, etc.)
YY YY YY 08 = pointer to the routine of aforementioned function. Yes, I'm serious. You can literally switch around your START menu like this:
1ci5ayY.png

Notice how POK?MON is in the first slot like in B/W/B2/W2/X/Y, not POK?DEX like in Gens I-IV. And no, I did not just switch the text string pointer, I switched around the function pointers too. Don't believe me? Try it yourself! It's fun!

Here's the table at 0x083A7344 in detail:
41627D = POK?DEX text string
06F411 = POK?DEX routine (+1)

415A66 = POK?MON text string
06F44D = POK?MON routine (+1)

416285 = BAG text string
06F481 = BAG routine (+1)

41628E = [name] text string
06F4B5 = Trainer Card routine (+1)

416291 = SAVE text string
06F4E9 = SAVE routine (+1)

416296 = OPTION text string
06F4FD = OPTION routine (+1)

41629D = EXIT text string
06F541 = EXIT routine (+1)

4162A2 = RETIRE text string (Safari Zone)
06F555 = RETIRE routine(+1)

41628E = [name] text string
06F56D = ??? (+1) (fadescreen then freezes the game, I'm assuming its for the alternate Trainer Card shown during Link Battles/Trades)

Unfortunately I haven't been able to find what dictates how many entries the START menu gets, but hopefully with this knowledge, it will be a lot easier to implement something like the a Pok?Gear onto FireRed. Not to mention that these offsets are the actual routines used for the Pok?dex, party screen, bag, Trainer Card, Save menu, and Options. I'm not joking lol, if you literally put this in a script:
Code:
//---------------
#dynamic 0x800000
#org @main
callasm 0x806F411 //this is the Pok?dex routine offset from the START menu table
end
It will open up the Pok?dex. You can literally use callasm and use any of the offsets from the table and it will load up that function!

So say, you wrote a custom Pok?Gear code. You can edit one of the function pointers in the table to your new code and voila, you'll have a Pok?Gear within your START menu. Of course, what would be more ideal is if we could figure out how to expand the number of entries the START menu gets. I'm sure it wouldn't be that hard, the thing is that I have no idea how to find the routine that the game uses when you actually press the START button.

I am always amazed by your findings, do you think if there is any way we could add icons to the menu..... it would be more amazing then :)
 
22
Posts
8
Years
I've found a bunch of information on HM scripts and ported Ephraim225's HM check to Emerald so that you don't need to teach HM's to use them.

Emerald HM scripts:
Surf:271EA0
Waterfall:290A49
Dive:290B0F
Dive(return to surface):290b5a
Cut:2906BB
Rock Smash:2907A6
Strength:2908BA
Surf check(prescript asm):insert 0000 @9c80a to disable (go here for fire red offset)
use a level script for Flash.

Emerald offsets for HM check routine(http://www.pokecommunity.com/showpost.php?p=8927083&postcount=726):
Players party:0x20244EC
Decrypt:0x0806A519
TM compatibility table(default):0x831E898
Var 0x800D:0x20375F0
Players team size:0x20244E9
*Note that you'll need a separate slightly modified version of this asm to check for Waterfall and Dive because they are found on a different byte in the compatibility table.
Spoiler:


Call fly HM asm with an item:
Insert an XSE script with the item script routine(also in Complete Item Editor).
Fly asm appears to be @0x8124690, but to make it work I needed to use callasm 11 times in my script. It seems weird but it worked for me(maybe there's a loop somewhere?).
In your script use loadbytefrompointer with 0x20375F0(var 0x800D's ram location) and setfarbyte to write the result of your HM or move check to
0x203ced1 so that the right Pokemon will appear in the animation.
Look here for info on checking the map type(indoors, cave etc.)
EDIT: Fly map isn't showing location names unless you move the cursor over the Pokemon League.

Black bar HM animation offset:080B84F8
RAM where shown Pokemon's hex appears:2038C08
 
Last edited:
325
Posts
10
Years
MAKING A TRAINERBATTLE CONTINUE AFTER DEFEAT
36 at 0x804D0 in FR
So usually we use trainer battle 0x9 for this but you also have to include Oak's stupid dialogue, so I got rid of that. Use it like so; trainerbattle 0x9 (trainer id) 0x0 (pointer) (pointer). Yeah, don't use the 0x3. It'll still give out money from your pocket. Using this, all trainerbattles with that style will continue with the script regardless of whether you won or lost.

~EDIT~ Your pokemon sprite may not show up when switching. I'm not sure why, but be aware of it. It works fine with one Pokemon which was all I was testing it with at first.
 
Last edited:

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
  • Age 24
  • Seen Nov 19, 2023
I think I was looking into this like 2 years ago but wasn't able to find it. Anyone know how to change the badge that controls whether you can use Flash in the overworld? (EM)
 
22
Posts
8
Years
Something quick from the Emerald IDB for anyone replacing Pokemon:
The byte @7090C checks for Pichu when breeding for Volt Tackle. To change this to Pikachu(0x19) or any other Pokemon just replace 0xAC with the 'mons index.
 
352
Posts
7
Years
  • Age 30
  • Seen Mar 10, 2022
Same principles apply for FireRed, but the offsets are as follows:

@ CE762 change 80 00 to C0 00 (00 01 if you expanded to 16 evolution methods, etc.)
@ CE766 change 44 50 to 00 00

The Shedinja's evolution was fixed but not registering on Pokédex.
 
352
Posts
7
Years
  • Age 30
  • Seen Mar 10, 2022
Well, this is what I did, while learning how to do stuff like debugging and doing new mechanics changes in the game.
Thanks to Touched-sensei, who helped me through the entire process. Thanks to daniilS and kleenexfeu, who also helped in the very end. This is for Fire Red:

REUSABLE POKÉBALLS

- First, go to 0xA1E30. Change 01 21 to 00 21 (with this, Pokéballs won't be deleted when you select them in your bag);
- Now, find some free space and insert this routine there:
Spoiler:
Here's a compiled version:
Spoiler:

This is the code that deletes the Pokéball;
- Finally, go to 0x2D924 and paste write this "00 48 00 47 XX XX XX 08" there. It's a hook to the routine you just inserted. Change the XX XX XX for the pointer to the offset you placed the above routine. Remember to +1 the offset before changing it to a pointer.

With this hack, you won't spend Pokéballs if you don't capture a wild Pokémon. I wanted to do it inspired in the anime.
Again, simple, some people will think it's a broken functionality, but it will do well for that time when you encounter a shiny Pokémon with that one single Pokéball in your bag. =P
Thanks again, everybody. Hope it's helpful.

giphy.gif


I'm using your routine but when I'm fishing when I catch the Pokémon my rod disappears, but it only happens at the Safari Zone. Do you know how to fix it?

EDIT: I think it's caused by your "deleteball" routine, because it removes the last item used from the Bag, but the Safari Balls isn't on the Bag and the reusable function isn't working on them.
 
Last edited:

Froosty

The_Learner
535
Posts
9
Years
gen 6 exp share system (FR)

Just make the byte changes
21C3A - 02 21
21CD0 - 01 22
21D70 - 01 20

In gen 6, the pokemon battling used to get 100% and rest on team 50%
but with this all the pokemon including the one that battled will get 50% exp
 
Last edited:

Skeli

Lord of the Rings
300
Posts
10
Years
If you decide to update your Pokemon Centers by extending the counter for instance, the animation for healing your Pokemon will be off. Use these offsets to fix it.
3CAF90 - The image for the Poke Balls and flashing screen. Open it in NSE with dimensions 32x72.
3CAFB0 - The palette for the Poke Balls and screens.
3CC014, 3CC01C, 3CC024 - A byte located at each of these controls the width between the two columns of Poke Balls on the healing machine.
83BB0 - A byte which controls the X coordinate proportional to the player sprite, of the Poke Balls on the healing machine. Fiddle around with it until you get the result you want.
83BB4 - A byte which controls the Y coordinate proportional to the player sprite, of the Poke Balls on the healing machine.
83BB9 - A byte which controls the X coordinate proportional to the player sprite, of the flashing screen.
83BBC - A byte which controls the Y coordinate proportional to the player sprite, of the flashing screen.
*NOTE: None of these bytes are coordinates in A-Map so don't go setting it to those.
 
Back
Top