• 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

32
Posts
10
Years
    • Age 26
    • Seen Sep 1, 2021
    Guys I need some help to port this feature to the Italian Emerald rom.
    I found the battle script offset and the other offsets required but I'm pretty sure some hex valuse needs to be changed. When inserting this new battle script when I catch a pokemon it's all fine, then the pokeball disappears but the battle doesn't end, if I go to the bag and then back into the battle the pokemon is still there.
    Can someone have a look into this?

    Battle script offset: 0x2DCD10
    Pokemons evolve from this experience, replace the bytes at 0x3DE80 with B9 DE 03 08

    You can use my save file to test the results.
     

    Trev

    [span="font-size: 8px; color: white;"][font="Monts
    1,505
    Posts
    11
    Years
    • Age 27
    • Seen Nov 15, 2023
    The bytes you put at 0x3DE80 should be B5 DE 03 08. Unless that has something to do with Emerald, I don't know because I don't hack Emerald...

    Anyway, you don't need to insert any actual battle scripts. Copy this:

    Code:
    2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

    to freespace, and replace the XX XX XX XX with a pointer to:

    Code:
    2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

    which you also insert into freespace. Then, go to your offset in a hex editor, and write the pointer to the first code overtop of the pointer already there. The pointer in the first code should be XX XX XX 08 (I don't know why Chaos wouldn't put the 08 there). That's what I did in FireRed so it should, theoretically, work.

    Spoiler:

    We can repoint this, I assume, which means we could probably have a much easier time inserting and creating doors. Images encompass the animation frames, yes? Does the animation occur naturally if data is added to this table? How would we utilize a newly-inserted door in a map editor?
     
    Last edited:
    32
    Posts
    10
    Years
    • Age 26
    • Seen Sep 1, 2021
    Spoiler:


    You just made a copy paste of what Chaos wrote, didn't you? :D
    Same result, something has to be changed to get this work with the Italian rom.

    The bytes you put at 0x3DE80 should be B5 DE 03 08. Unless that has something to do with Emerald, I don't know because I don't hack Emerald...
    In the italian rom that pointer need to be changed since the bytes are not in the same place of the english one.

    Can someone download an italian rom and try to fix it please?
    (just serch for "Pokemon Smeraldo ita rom download")
    Here's my save file to test the results.
     

    Trev

    [span="font-size: 8px; color: white;"][font="Monts
    1,505
    Posts
    11
    Years
    • Age 27
    • Seen Nov 15, 2023
    [FR] If you want every Pokemon who participates in battle to receive full exp instead of having it divided, write 01 21 at 0x21C3A. Credit to Doesnt for finding this (somehow).
     
    Last edited:
    17
    Posts
    9
    Years
    • Age 30
    • Seen Sep 3, 2023
    [FR] If you want every Pokemon who participates in battle to receive full exp instead of having it divided, write 01 21 at 0x21C3A.

    On this note, the equivalent bytes to change in Emerald are located at 0x4A4FE.
     

    Froosty

    The_Learner
    535
    Posts
    9
    Years
  • I don't know if this has been posted before, but whatevs. It came to my attention today that the bag in FireRed crashes if a "main" pocket has more than 42 items (the normal max for regular items). I had always assumed the malloc was done based on a multiple of the numbers inputted at the routine beginning 0x08099E44, because the TM pocket works fine even with over 100 items, but apparently the berry/TM cases mean they run off of something different. Anyhow, to allow for sufficient malloc requests, change ".equ largest_pocket_size" to your new max and insert this:
    Code:
    .equ largest_pocket_size,	CHANGE THIS LINE
    .equ largest_pocket_size_plus_one, largest_pocket_size + 1
    .equ strings_size,	largest_pocket_size_plus_one * 19
    
    .org 0x08002B9C
    malloc:
    	push {lr}
    	mov r1, r0
    
    .org 0x081083F4
    main:
    	push {r4, lr}
    	ldr r4, =(0x0203AD18)
    	mov r0, #largest_pocket_size_plus_one
    	lsl r0, r0, #0x3
    	bl malloc
    	str r0, [r4, #0x0]
    	cmp r0, #0x0
    	beq return
    	ldr r0, =strings_size
    	bl malloc
    	str r0, [r4, #0x4]
    	cmp r0, #0x0
    	beq return
    	mov r0, #0x1
    
    return:
    	pop {r4}
    	pop {r1}
    	bx r1
    EDIT: I haven't done much testing. I've only thrown like 60 items into the general items pocket before I got bored & assumed this routine was the only problem.

    Info on 0x08099E44: http://www.pokecommunity.com/showpost.php?p=9014911&postcount=2018

    I cant seem to compile it,
    can anyone help me out???
     
    112
    Posts
    8
    Years
    • Age 27
    • Seen Mar 15, 2024
    Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?
     

    Chaotix

    Love to test
    59
    Posts
    17
    Years
    • Age 34
    • Seen Jan 11, 2020
    Try increasing the value at 0809B430 (FR) from 4 to 5. That number should be the digit length of prices for the Pokemart.

    I just tried this recently and I can't seem to get it to work. On attempting to load a pokemart containing an item with a value greater than 5 digits in it's stock the game gets stuck on a black screen. Not sure what could be going wrong here.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I just tried this recently and I can't seem to get it to work. On attempting to load a pokemart containing an item with a value greater than 5 digits in it's stock the game gets stuck on a black screen. Not sure what could be going wrong here.
    hi chaotix! me again

    figured it out
    9B430 - 05 (max characters taken from a string)
    9B440 - 05 (i have no idea, maybe max characters that can be shown? necessary nonetheless)

    so just doing these two changes creates an annoying thing where everything has its last digit cut off
    9B47A - 64 (instead of 69) (it's an x-coordinate, so i don't know if this value is exact or not)
    QzAT2K9.png

    (resultant picture, you can use to compare to original and subtract/add pixel values as necessary)

    EDIT: AHHHH KILL ATTACHED THUMBNAILS WITH FIRE
     

    Chaotix

    Love to test
    59
    Posts
    17
    Years
    • Age 34
    • Seen Jan 11, 2020
    hi chaotix! me again

    figured it out
    9B430 - 05 (max characters taken from a string)
    9B440 - 05 (i have no idea, maybe max characters that can be shown? necessary nonetheless)

    so just doing these two changes creates an annoying thing where everything has its last digit cut off
    9B47A - 64 (instead of 69) (it's an x-coordinate, so i don't know if this value is exact or not)

    I appreciate this sooo much BluRose! I'll mess around with it soon and thanks much, sorry to bother you with all this.
     

    Squeetz

    ROM Hacker
    191
    Posts
    10
    Years
  • To change what Pokémon gets the DeepseaScale and DeepseaTooth boosts, change the bytes at 0x3F24C to your new Pokémon's index, reversed. (0x175 is Clamperl)

    This will give the Pokémon both boosts, however, so if you want a separate Pokémon for each item, insert this routine somewhere:
    Spoiler:


    After that, go to 0x3EFD0 and place:
    Code:
    00 48 00 47 XX XX XX 08
    where the XX is the pointer to the routine, +1.
    After this, the byte change you made first in this post will only be relevant for the Pokémon that should get the Sp. Def boost from Deepseascale.

    A huge thanks to NewDenverCity for helping me out with this, and making me understand instructions and hooks better!
     
    22
    Posts
    11
    Years
    • Seen Jun 14, 2020
    Does anyone know how to remove the 10% stat boosts given by badges in Fire Red?

    Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?

    Open up any Pokemon editor and remove the "breeding only" in the evolutions tab for Wobbuffet, Marill and Azumarill. Its very simple.
     

    Shiny Quagsire

    I'm Still Alive, Elsewhere
    697
    Posts
    14
    Years
  • In Fire Red, 0824EFC4 contains a table of structures 4 bytes long describing which environments go with a map's Fight Type. The structure is as follows:
    Code:
    <byte> Map Type
    <byte> Battle Background Index
    <Half-Word> Padding
    An equivalent structure does not seem to exist in Emerald or Ruby.

    The routine which reads the table has a maximum of 7 elements it will attempt to check the map type against. This table can be extended by repointing it and increasing the byte value at 0800F254. In theory, this can allow forcing particular environments in a map for wild/trainer battles. This table is only ever read if the Fight Type is not index 0 (Random in A-Map), and it overrides environments from tile types (ie all grass, water, cave, trainer etc battles will be forced). In theory you could also add additional battle backgrounds by extending the structure array at 0824EE34.
     

    Trev

    [span="font-size: 8px; color: white;"][font="Monts
    1,505
    Posts
    11
    Years
    • Age 27
    • Seen Nov 15, 2023
    In Fire Red, 0824EFC4 contains a table of structures 4 bytes long describing which environments go with a map's Fight Type. The structure is as follows:
    Code:
    <byte> Map Type
    <byte> Battle Background Index
    <Half-Word> Padding
    An equivalent structure does not seem to exist in Emerald or Ruby.

    The routine which reads the table has a maximum of 7 elements it will attempt to check the map type against. This table can be extended by repointing it and increasing the byte value at 0800F254. In theory, this can allow forcing particular environments in a map for wild/trainer battles. This table is only ever read if the Fight Type is not index 0 (Random in A-Map), and it overrides environments from tile types (ie all grass, water, cave, trainer etc battles will be forced). In theory you could also add additional battle backgrounds by extending the structure array at 0824EE34.

    So, this? :v
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?
    idk if the previous answer actually works (it seems like it wouldn't because there's literally a func handling this) but here's a definite one (fire red)
    45FA8 - wynaut's index (1/2 value)
    45FB0, 45FE6 - azurill's index (1/2 value)
    45FD8, 45FDC - lax incense index
    45FE0 - wobbuffet index
    45FEE , 45FF2 - sea incense index
    45FF6 - marill index
    so the way this works is it checks for the species in the egg. if it matches with wynaut or azurill, it checks the held items of the padres. if this matches, it does nothing, if it doesn't, it changes the index to the correct one.

    the "fix?" write 00 to 45FA8, 45FB0, and 45FE6. this just changes the pokémon to check for, making the pokémon with index 0 the required pokémon to do the checks. since you never encounter 0, you won't rewlly run into a problem (but it is theoretically possible to have your 00 turn into wobbuffet/marill if you use like cheats to get it smh)
    Does anyone know how to remove the 10% stat boosts given by badges in Fire Red?

    Open up any Pokemon editor and remove the "breeding only" in the evolutions tab for Wobbuffet, Marill and Azumarill. Its very simple.
    flag checks in the damage calc for this (don't know where speed is)
    3EE1C - boulderbadge check (atk)
    3EE50 - soulbadge check (def)
    3EE86 - volcanobadge (sp. atk)
    3EEBE - volcanobadge (sp. def)
    as for speed i'm too lazy to find it :(
     
    112
    Posts
    8
    Years
    • Age 27
    • Seen Mar 15, 2024
    idk if the previous answer actually works (it seems like it wouldn't because there's literally a func handling this) but here's a definite one (fire red)
    45FA8 - wynaut's index (1/2 value)
    45FB0, 45FE6 - azurill's index (1/2 value)
    45FD8, 45FDC - lax incense index
    45FE0 - wobbuffet index
    45FEE , 45FF2 - sea incense index
    45FF6 - marill index
    so the way this works is it checks for the species in the egg. if it matches with wynaut or azurill, it checks the held items of the padres. if this matches, it does nothing, if it doesn't, it changes the index to the correct one.

    the "fix?" write 00 to 45FA8, 45FB0, and 45FE6. this just changes the pokémon to check for, making the pokémon with index 0 the required pokémon to do the checks. since you never encounter 0, you won't rewlly run into a problem (but it is theoretically possible to have your 00 turn into wobbuffet/marill if you use like cheats to get it smh)
    flag checks in the damage calc for this (don't know where speed is)
    3EE1C - boulderbadge check (atk)
    3EE50 - soulbadge check (def)
    3EE86 - volcanobadge (sp. atk)
    3EEBE - volcanobadge (sp. def)
    as for speed i'm too lazy to find it :(

    Thanks bro, I really appreciate it.
     

    Froosty

    The_Learner
    535
    Posts
    9
    Years
  • If you want to change a text box permanently navigate to 0x160450. There are pointer to textbox type 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 etc.

    Yes you can use XSE to decompile these scripts and feel free to add in anything you may desire.... permanently!

    So you won't have to call the transparency asm in every script you want, it does it automatically.

    I checked the pointer,
    the first two pointers in the offset you gave somehow account to the "found an item" and "bag is full" events,
    but the pointers after that really account to the text box :)
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • esipode's question made me do this and i have exams all throughout this week
    my priorities literally do not matter

    EDIT: a lot more values that are a lot better and that i'd actually be interested in changing!
    shoutouts to esipode again for finding 136684 way before i did

    fire red - miscellaneous summary screen values that somewhat make sense
    as they appear in my notes:
    Spoiler:
    i'll organize it sometime or something

    EDIT2: but blurose! there are multiple x-values for a few things!
    haha ye i know and i have no idea what the difference is, either!
    it's important to know that the x- and y-values don't match with what is shown in vba as x-/y-values (usually)

    EDIT3: found a few more values
    still searching for the x-value to the pokémon sprite itself (likely not hardcoded at this point)

    EDIT4: was reminded this post existed, so i went and added the x/y coordinates for the sprites since the decompilations are done (6 years later! even moved to heart gold!)
     
    Last edited:
    112
    Posts
    8
    Years
    • Age 27
    • Seen Mar 15, 2024
    Is there a way to make link battles faster, as in making the default text speed set as fast in link battles similar to how the battle mode is always SET in link battles, so basically how to change the default options in link battles?
     
    Back
    Top