• 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

19
Posts
7
Years
  • Age 28
  • Seen Apr 14, 2017
Firered's "wait-for-interrupt"-loop is quite inefficient. Here is my suggested patch. (Experimental, may or may not freeze the game.)
Code:
BEFORE:
080008aa  8b91 ldrh r1, [r2, #0x1c]
080008ac  1c18 add r0, r3, #0x0
080008ae  4008 and r0, r1
080008b0  2800 cmp r0, #0x0
080008b2  d0fa beq $080008aa
080008b4  bc01 pop {r0}
080008b6  4700 bx r0

AFTER:
080008aa  df02 swi $02
080008ac  8b91 ldrh r1, [r2, #0x1c]
080008ae  1c18 add r0, r3, #0x0
080008b0  4008 and r0, r1
080008b2  2800 cmp r0, #0x0
080008b4  d0f9 beq $080008aa
080008b6  bd00 pop {pc}
This should be useful if emulation is slow on your machine. Or if you want to be even faster when holding the space key.

The same improvement can be made to Emerald.

Code:
BEFORE:
080008c6  8b91 ldrh r1, [r2, #0x1c]
080008c8  1c18 add r0, r3, #0x0
080008ca  4008 and r0, r1
080008cc  2800 cmp r0, #0x0
080008ce  d0fa beq $080008c6
080008d0  bc01 pop {r0}
080008d2  4700 bx r0

AFTER:
080008c6  df02 swi $02
080008c8  8b91 ldrh r1, [r2, #0x1c]
080008ca  1c18 add r0, r3, #0x0
080008cc  4008 and r0, r1
080008ce  2800 cmp r0, #0x0
080008d0  d0f9 beq $080008c6
080008d2  bd00 pop {pc}

TL;DR:
At 0x8C6, change:
91 8B 18 1C 08 40 00 28 FA D0 01 BC 00 47
to:
02 DF 91 8B 18 1C 08 40 00 28 F9 D0 00 BD
 

Squeetz

ROM Hacker
191
Posts
10
Years
Toggling "set" battle mode (Firered)

First insert this somewhere:
Code:
29 00 [COLOR="Red"]FE F4 03 02[/COLOR] AA 92 87 1D 08 2B 04 D0 3D 02 02 00 00 40 00 92 87 1D 08 28 35 87 1D 08

Then, at 0x1D8727, put:
Code:
28 XX XX XX 08
Where XX is the pointer to the battle script you inserted above.

Usage:
In a script, put this:
Code:
...
writebytetooffset 0xAA 0x203F4FE
...
Make sure you writebytetooffset 0x0 0x203F4FE after the battle(s) and on the whiteout script, so it doesn't get stuck on Set mode forever.

Explanation:
This is a really cheap and inefficient solution that branches off the original script that asks this:
XOZLhfX.png

And if 0x203F4FE = 0xAA, it won't ask at all regardless of the player's option setting.
This could be useful if you're making a battle facility and don't want them to be able to switch after knocking out a Pok?mon.

I colored some of the numbers in red, this is the ram offset 0203F4FE, so if you're using this for something else, find another area. (By default this isn't used).

Credits to Doesnt who made the "forced" version:
Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.
 
19
Posts
7
Years
  • Age 28
  • Seen Apr 14, 2017
Surprised nobody has posted this before.

Change Daycare XP Amount Per Step (Emerald)

At 0x70AE8, change 01 30 to XX 30, where XX is the amount of XP you want per step. Personally, I think 2 is more reasonable than 1.
At 0x70B04, change 04 39 to 04 31. This fixes the eggs-not-appearing-with-even-xp-amounts thing. This does have one minor side-effect: the first chance for an egg to appear after placing 2 Pokemon in the daycare can take anywhere between 1 and 256 steps instead of a fixed amount of 256 steps. After the first "egg chance" it goes back to the fixed 1 chance per 256 steps as usual.

Edit: Even values may or may not break breeding (eggs won't show up). Looking into this more currently. Fixed.
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
Before I start digging much further, has anybody been able to figure out how to increase the maximum number of casino coins beyond 9,999?

I'll post anything I find here. I will begin by looking at the following commands/offsets:
display coins: 0806C258
show coins: 0809B578
get coin amount: 0809BB00
add coins: 0809BB20
hide coins: 0809B5A0
updatecoins: 0809B5B4
 
19
Posts
7
Years
  • Age 28
  • Seen Apr 14, 2017
Continuing with my daycare stuff:

Change Daycare Breeding Rate [EM]

For those unaware, the "Breeding Rate" is the chance of receiving an egg after taking 256 steps.

This is just a basic version that requires only small hex edits; I'm planning on trying to create a routine that separates the one 50% value into two separate configurable values as well as hopefully allowing Pokemon from the same evolution chain to count as "same species" instead of different species (that has always bothered me).

Anyway, the default breeding rates work like this:
  • 70%: Same Species, Different OT
  • 50%: Same Species, Same OT, or[/] Different Species, Different OT
    [*]20%: Different Species, Same OT


To change the 70% value, the following hex edits are required:
  1. At 0x70E48, change 46 20 to XX 20
  2. At 0x70EAC, change 46 2A to XX 2A
To change the 50% value...:
  1. At 0x70E5A, change 32 20 to XX 20
  2. At 0x70EA6, change 32 28 to XX 28
To change the 20% value...:
  1. At 0x70E56, change 14 20 to XX 20
  2. At 0x70EA0, change 14 28 to XX 28
XX would be the percentage value you'd like (in hex of course), 0(?) to 100. The first edits listed are to the main compatibility check function, the second edits are to the function that determines which message the daycare man displays when spoken to.
 

Skeli

Lord of the Rings
300
Posts
10
Years
I just copied the above post because I'm lazy. Credits go to MWisBest for the format.

Change Daycare Breeding Rate [FR]

To change the 70% value, the following hex edits are required:
  • At 0x46648, change 46 20 to XX 20
  • At 0x466A8, change 46 2A to XX 2A
To change the 50% value...:
  • At 0x4665A, change 32 20 to XX 20
  • At 0x466A2, change 32 28 to XX 28
To change the 20% value...:
  • At 0x46656, change 14 20 to XX 20
  • At 0x4669C, change 14 28 to XX 28
XX would be the percentage value you'd like (in hex of course), 0(?) to 100. The first edits listed are to the main compatibility check function, the second edits are to the function that determines which message the daycare man displays when spoken to.
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
To continue a bit on the cries research from 3 years ago there is a byte at:

Emerald: 0x080626AE - Opponent
Emerald: 0x0805CA30 - Ally


*FireRed: 0x08038C32 - Opponent
*FireRed: 0x08033428 - Ally

This byte controls the pitch of the cry played when a Pokemon faints. It is normally set to 5 which is low pitched but follows the same structure as the cry command seen here.

I tested them from 0x0 to 0x10 and it's the same as previously researched. As far as I know it only affects fainting in battle, it won't affect the lower pitched cries when your Pokemon is sent out with low hp or overworld cries.

Useful if you don't want lower pitched faint cries, maybe you're using separate cries for fainting or maybe you want high pitched cries.

*Not 100% sure on the FireRed offsets since I found these in Emerald but the routines are almost identical so pretty likely to be correct.
 
Last edited:
794
Posts
10
Years

Emerald: 0x080626AE


This byte controls the pitch of the cry played when a Pokemon faints. It is normally set to 5 which is low pitched but follows the same structure as the cry command seen here.

I tested them from 0x0 to 0x10 and it's the same as previously researched. As far as I know it only affects fainting in battle, it won't affect the lower pitched cries when your Pokemon is sent out with low hp or overworld cries.
.

Actually it just controls the fainting cry of the pokemon's opponent.
Btw, do you know what does the 0x19 before it do? It's an argument too.
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
Actually it just controls the fainting cry of the pokemon's opponent.
Btw, do you know what does the 0x19 before it do? It's an argument too.

Do you mean when you make the opponent faint as opposed to self destruct/poison etc?

I noticed the 0x19 first but then messed around with the 0x5 and got results so I just ignored 0x19. Can you please share your extra information on this?
 
794
Posts
10
Years
Do you mean when you make the opponent faint as opposed to self destruct/poison etc?

I noticed the 0x19 first but then messed around with the 0x5 and got results so I just ignored 0x19. Can you please share your extra information on this?

I mean whenever an opposing pokemon faints, so not yours or yours partner, but the opposing one.

This code is calling a function that plays poke cry. First argument is species, second is 0x19 which I dont know what does and the third is 0x5 which you said is responsible for the pitch.
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
I mean whenever an opposing pokemon faints, so not yours or yours partner, but the opposing one.

This code is calling a function that plays poke cry. First argument is species, second is 0x19 which I dont know what does and the third is 0x5 which you said is responsible for the pitch.

Makes sense since I when looking for a breakpoint I only tested fainting the opponent. I hope it's done in a similar way, will make it easy to find.

Also makes sense, I spent ages looking at the prepare faint cry function then came across this just looking at the playcry function. I orignially though 0x19 would be speed but I can't really hear a difference in speed.
 

Aryan 10

Battle Legend
163
Posts
7
Years
[FireRed] Mew Obey Fix tutorial


In Pokemon FireRed, if you will encounter Mew by any method except Event, then Mew will not obey.

Game Freak made the rarest Pokemon cheat-protected. This is also true with Deoxys, but the Deoxys caught at Birth Island will obey. Since Mew is uncatchable in FireRed. It is not possible with Mew.

So I don't know if someone posted this but I can tell how to fix it. It is really easy to do it.

[Step 1]Open any hex editor.

[Step 2]Change the byte at 0x801D402(0x801D416 for FireRed 1.1, in case if someone needs that) from 0x97 to 0x00.

By doing this you no longer need to use 'setobedience' command in every Mew battle script.
 
Last edited:
19
Posts
7
Years
  • Age 28
  • Seen Apr 14, 2017
Berries Replant Forever [EM]

As most people know, you only have so much time to pick a grown berry before it "replants itself" and becomes a sprout again. By default, the berry can only do this 9 times (for a total of 10 plantings, including the initial time you put the berry in the soil yourself). This has always bothered me because it's possible to lose rare berries forever if you aren't careful, and I tend to be very forgetful.

To allow berries to continue to replant themselves until you pick them, make the following change:
At 0xE185A, replace 04 48 41 68 00 68 20 60 61 60 with 00 20 60 71 C0 46 C0 46 C0 46.
 
5,256
Posts
16
Years
Just a reminder to some users who have been using this as a quick question thread: if you don't provide at least some semblance of research or development of your own, your question does not belong here. Instead, create a thread in the parent ROM Hacking forum, here: https://www.pokecommunity.com/forumdisplay.php?f=284, and give it the appropriate category (usually, this will be [ASM & Hex] if you were choosing to post here).
 
19
Posts
7
Years
  • Age 28
  • Seen Apr 14, 2017
HM Flash Lightens Entire Screen [EM]

I got a little irked trying to train in the Victory Road basement by the Flash HM not clearing the entire screen. I'm playing the game on my phone, which has an AMOLED display. AMOLED displays are very susceptible to burn-in, so to avoid getting a nice big dark circle in the middle of my screen...

I modified the Flash brightness table to make it work like FR/LG and light up the entire screen:

At 0x54FE66, change 48 to C8.

This is kind of cheap because it makes navigating Granite Cave and Victory Road easier than intended, but whatever.
 
352
Posts
7
Years
  • Age 30
  • Seen Mar 10, 2022
<Remove Field Moves options from Pokémon menu [FR]>
0x122A8C: 00
0x45A76E: 00 00

<Remove Ending Credits (Reset the Game) [FR]>
0x16730B: 9C 50 00 6B 02 FF (see the EDIT below)

EDIT:

In some free space place 00 DF 00 00 and save it's offset

At 0x16730B: 23 XX XX XX 08 FF (XX XX XX is the reverse of the offset you saved +1)
 
Last edited:
Back
Top