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

Code: ASM Resource Thread

788
Posts
17
Years
  • Age 29
  • Seen Apr 25, 2024
Hall of Fame Expanded Pokémon Fix [FR]

Fixes an issue where expanded Pokémon above index 0x1FF do not show up correctly in the Hall of Fame.

For example, 0x201 would normally show up as 0x1 (Bulbasaur). This is because the Hall of Fame data only allocated 9 bits to the species number, and 0x1FF is the largest number that can be stored in that space; larger numbers only have their lowest 9 bits stored.
 
Last edited:

pikachux2

Never Evolve
115
Posts
14
Years
I literally no nothing about Assembly in fire red, but is the limited number of flags in fire red really a problem? Is it not possible to make an ASM routine that can check the value of some offset after 800000 and return a pseudo Boolean value to the last result variable 0x800D (or any other for that matter)? This will probably be an easy yes or no for a lot of you, I was just curious.
 
3
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2019

Changing the Player's Overworld ingame


Intro:

I recently made this routine, it's kind of limited in the sense that you can only be change to 30 different overworlds (excluding the special version of the default characters). While it is limited, I don't really think that that's a problem (you'd probably only be OWs swapping to 2-3 different OWs the entire game anyways, so unless you wanted to player to play as more than 30 characters, this routine will work just fine for you). It's also a little "smaller" in comparison to JPAN's 6 seperate routines which he used (though in his favor, I don't think his limits the amount like mine). I blame the table, it's weird. Actually the whole overworld loading thing is weird..it's done in like 9 places lol.

I should also note that if the OW you're changing to doesn't have a running frame, things are going to look weird when you try to run~

How to insert:

Compile into free space the following routine:
Spoiler:


Now navigate to 0x5CA4C and insert the following byte changes:
Code:
00 48 00 47 XX XX XX 08
Where XX XX XX is where you inserted this routine +1.


Usage:

The routine requires two conditions to toggle.
1) Flag 0x406 is set
2) Var 0x8000 is not 0xFF

As you may have guessed you need to set variable 0x8000 to a value which matches the overworld you want the player to transform into. Please note that for the effect to happen, you need to warp first.
Here's a list of values and their corresponding sprite to the left:
Spoiler:

While no particular value will cause a crash, I've excluded values which are "repeated" OWs. If you experience bugs, use it in conjunction with the backsprite hack I made. If you still have bugs, report them here!

Hi
I tried to apply this rutine but i got errors:
The change of the OW is lost after the player enter in a menu or enter in a battle.
I also inserted the rutine of swap BS, in that i get a problem with the change of the OW after a warp (the OW change to the Hero surfing or the hero in bike)

Error-OWGIF.gif


What can I do?
 
20
Posts
8
Years
  • Age 41
  • Seen Nov 9, 2022
Welp, it didn't work.
I compiled the routine and dropped it in the offset 71A250, wrote this script and once I checked it In-Game, this was the result.
yGrrQAK.png

Note: Just for the record, the savefile is right after defeating my Rival for the very first time, so there's no way for my Pokémon to have 76 points.

Dunno if you'll be able to fix it, but in any case thank you very much.
Would you be willing to reshare the script (the link is no longer working) in code tags? I am relatively new and trying to figure this stuff out.
 
51
Posts
9
Years
  • Age 33
  • Seen Nov 18, 2023
Does anyone know if this function (Steven battle for fire red) has been completed? They wrote that it would be enough to insert a line of code to make it complete, but unfortunately it seems that no one has chosen how to insert it.
 

Delta231

A noob
681
Posts
7
Years
Does anyone know if this function (Steven battle for fire red) has been completed? They wrote that it would be enough to insert a line of code to make it complete, but unfortunately it seems that no one has chosen how to insert it.

No this wasn't completed and I prefer to use Decompilations.
 

Blah

Free supporter
1,924
Posts
11
Years
Does anyone know if this function (Steven battle for fire red) has been completed? They wrote that it would be enough to insert a line of code to make it complete, but unfortunately it seems that no one has chosen how to insert it.

This is done for the typical encounter battles (where you meet eyes with two trainers at once). What isn't done is a scripted double battle. That shouldn't be hard given the source code here. The caution is that it isn't thoroughly bug tested because CommHack never took off past the mapping (rip scripters).
 
51
Posts
9
Years
  • Age 33
  • Seen Nov 18, 2023
This is done for the typical encounter battles (where you meet eyes with two trainers at once). What isn't done is a scripted double battle. That shouldn't be hard given the source code here. The caution is that it isn't thoroughly bug tested because CommHack never took off past the mapping (rip scripters).

I had misunderstood how it worked then, thanks for the clarification!
If I can help, I'll get along well with the fire red scripting :)
 

Lunos

Random Uruguayan User
3,114
Posts
15
Years

[FR] Complimentary Premier Ball for purchases of over 9 Poké Balls

I've used this many many times, I love this feature as silly it may sound.
Surprisingly though, I noticed just now that it seems to glitch the blue bar containing the different HMs descriptions inside the Pokémon Party menu. Could anyone confirm?
pdFcrC7.png


Steps that I did:
1) Inserted the text string in 0x456734
Code:
C3 B4 E0 E0 00 E8 DC E6 E3 EB 00 DD E2 00 D5 00 CA E6 D9 E1 DD D9 E6 00 BC D5 E0 E0 B8 00 E8 E3 E3 AD FC 09 FF

2) Copy and pasted the routine in a text file, then I modified the offset in L39 accordingly (0x08456734) and compiled.
The result was:
Code:
30 B5 00 06 04 0E A0 00 00 19 C0 00 15 49 45 18 15 48 C1 8D 03 20 08 40 00 28 1F D0 05 20 13 4B 00 F0 1F F8 0A 21 68 5A 04 28 13 D1 02 21 68 5A 09 28 0F DD 0C 20 01 21 0D 4B 00 F0 12 F8 00 06 00 0E 01 28 06 D1 0B 49 0B 4A 20 1C 0B 4B 00 F0 08 F8 03 E0 20 1C 08 4B 00 F0 03 F8 30 BC 01 BC 00 47 18 47 98 50 00 03 F0 30 00 03 CD 22 07 08 85 A0 09 08 34 67 45 08 99 BF 09 08 5D F7 13 08

3) Inserted the routine in 0x45675C

4) Went to 0x9BF64 and wrote: 5D 67 45 08

5) Saved and tested.

I'm certainly getting the extra Premier Ball if I purchase 10 Poké Balls. No issues there.
The thing is that if I grab a clean ROM and this is the only thing that I add to it, the issue with the blue bar happens :/
 
Last edited:

Subzero Eclipse

Because I say so.
24
Posts
6
Years
  • Age 31
  • Seen Mar 4, 2023
I've used this many many times, I love this feature as silly it may sound.
Surprisingly though, I noticed just now that it seems to glitch the blue bar containing the different HMs descriptions inside the Pokémon Party menu. Could anyone confirm?
pdFcrC7.png


Steps that I did:
1) Inserted the text string in 0x456734
Code:
C3 B4 E0 E0 00 E8 DC E6 E3 EB 00 DD E2 00 D5 00 CA E6 D9 E1 DD D9 E6 00 BC D5 E0 E0 B8 00 E8 E3 E3 AD FC 09 FF

2) Copy and pasted the routine in a text file, then I modified the offset in L39 accordingly (0x08456734) and compiled.
The result was:
Code:
30 B5 00 06 04 0E A0 00 00 19 C0 00 15 49 45 18 15 48 C1 8D 03 20 08 40 00 28 1F D0 05 20 13 4B 00 F0 1F F8 0A 21 68 5A 04 28 13 D1 02 21 68 5A 09 28 0F DD 0C 20 01 21 0D 4B 00 F0 12 F8 00 06 00 0E 01 28 06 D1 0B 49 0B 4A 20 1C 0B 4B 00 F0 08 F8 03 E0 20 1C 08 4B 00 F0 03 F8 30 BC 01 BC 00 47 18 47 98 50 00 03 F0 30 00 03 CD 22 07 08 85 A0 09 08 34 67 45 08 99 BF 09 08 5D F7 13 08

3) Inserted the routine in 0x45675C

4) Went to 0x9BF64 and wrote: 5D 67 45 08

5) Saved and tested.

I'm certainly getting the extra Premier Ball if I purchase 10 Poké Balls. No issues there.
The thing is that if I grab a clean ROM and this is the only thing that I add to it, the issue with the blue bar happens :/

Hey man, I have inserted this routine in my ROM hack as well and everything is fine on my end. I would guess that this thing happens because you have put the routine before 71A240: in the past I have tried to insert other routines in free space before it and I have had the same issue as you, but when I do put them over 71A240, no problem at all. Maybe you should try to insert it somewhere there and see what happens? Hope it helps.
 
Last edited:

Lunos

Random Uruguayan User
3,114
Posts
15
Years
Hey man, I have inserted this routine in my ROM hack as well and everything is fine on my end. I would guess that this thing happens because you have put the routine before 71A240: in the past I have tried to insert other routines in free space before it and I have had the same issue as you, but when I do put them over 71A240, no problem at all. Maybe you should try to insert it somewhere there and see what happens? Hope it helps.
I just tried it out, and now it's certainly working perfectly. That's kinda dissapointing though, but eh, I guess the free space before 71A240 could be used for something else like maps or scripts..?
Anyway, thank you :D!

EDIT:

Inheriting IVs from parents (via Destiny Knot, in the daycare)

I was testing this routine out just now, and I'm not entirely sure if it's working correctly.
It looks to me like the Eggs are inheriting 3 stats alone, when they should always inherit 5 stats :/
I've been doing tests using this routine and Jiangzhengwenjz's EV-IV Screen.

In my last attempt for example, the results of the Egg were:
-03 HP IVs. Charmander has 30 and Ditto 26.
-03 Atk IVs inherited from Charmander.
-22 Def IVs inherited from Charmander or Ditto (both have 22 Def IVs.)
-23 Spd IVs. Charmander has 31 and Ditto 25.
-19 SpAtk IVs. Charmander has 31 and Ditto 10.
-31 SpDef IVs inherited from Ditto.

If we assume that HP is the random stat in this spread, Spd and SpAtk are the issue here.
The Egg should have inherited Charmander's or Ditto's values in those stats after all, right?
Has anyone tested this yet?
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Apr 15, 2024
[FR] Selection from PC Box

This hack allows the player to directly select a pokemon from the pc boxes by modifying the tasks associated with the withdraw function. It doesn't actually do anything with the selection except store relevant data, but this data can then be used in subsequent functions to modify relevant data.

Fortunately, I added in some new/updated specials to allow the user to swap pokemon between box and party for things like trading, nicknaming, and checking/setting pokeball types. Adding new specials for other data manipulation is easy enough, and I would be happy to add more if more ideas come to me.

Current Special Fixes Include:
Spoiler:


Here is the repository. The readme should do an adequate job of detailing the usage.

Here is a GIF of using this function with a wonder trade. (credit to sagiri for the dtan system)
zq6pr9c.gif
 
Last edited:

Delta231

A noob
681
Posts
7
Years
[FR] Selection from PC Box

This hack allows the player to directly select a pokemon from the pc boxes by modifying the tasks associated with the withdraw function. It doesn't actually do anything with the selection except store relevant data, but this data can then be used in subsequent functions to modify relevant data.

Fortunately, I added in some new/updated specials to allow the user to swap pokemon between box and party for things like trading, nicknaming, and checking/setting pokeball types. Adding new specials for other data manipulation is easy enough, and I would be happy to add more if more ideas come to me.

Here is the repository. The readme should do an adequate job of detailing the usage.

Here is a GIF of using this function with a wonder trade. (credit to sagiri for the dtan system)
zq6pr9c.gif

May I request to remove those .exe files in the repository as not everyone in this community uses Windows and you can just link to those utilities .
 
23
Posts
6
Years
  • Age 32
  • Seen Nov 28, 2023
Hello, I am interested in hacking the wild pokemon generator of Fire Red to influence the species in a similar manner as Static and Magnet Pull do in later games. I've searched many places, including this thread, but I have not found a routine for this. Does anyone know if this has been done before? If not, could you kindly give me advice on how to approach this problem? I am new to ASM but I have experience from other languages so I'm not a total beginner. I know how to compile and insert routines.
 

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
It doesn't break flashcart compatibility if you're using the newest version, but it does mean you can't use Save Editors anymore, and you have to start a new save file. This may not be ideal for everyone (it wasn't for me), so here is the way to free up some RAM that gets saved.

To free up the RAM just do the following:

1. Put 28 E0 at 0x110F24
2. Put 04 20 at 0x11192A
3. Put 70 47 at 0x110AEC
4. Put 70 47 at 0x1123BC

This will free up about 8000 flags and 2900 vars (numbers are approximate). Full details are in this post below (ORIGINALLY BY JPAN SO THANK HIM)

https://www.pokecommunity.com/showpost.php?p=8795370&postcount=4

The RAM that I used to free up item space started at 0x2026840 and believe me it is plenty of space. What will happen is that you will lose any items currently in your bag after you switch over. So you'll need to deposit them/give them to PC Pokemon if you want to keep them (alternatively you can write a routine to move the data at the original item RAM over to the new one).

If you have a previous save file, your bag will be a bunch of junk because the save file wrote stuff in the RAM from the Previously On Your Quest thing. To fix that use this routine:

Spoiler:


This routine just makes everything in the RAM range go to zero (so your bag will then be empty and you can put all your items back in).

To use the above routine just insert it and then write an NPC using callasm and call the routine. Then just talk to the NPC you gave it to in-game, save and you'll be done. You can delete the routine and the script afterwards if you want to.
 
1
Posts
5
Years
  • Age 31
  • Seen Aug 17, 2019
I've been working on a FR hack for a few months recreating Pokémon Colosseum/Gale of Darkness. About 95% done with the trainer editing (The shadow pokemon concept wasn't really working out as I was having trouble catching a specific pokemon from a trainer's party, so I've just been using the givepokemon command after the battle and using the flags from various overworld item sprites).

I'd really like to add a function where an opponents party level matches the highest in your party, like in the Mt Battle area in those games. Is there a way to set that up in a specific area of the game? Like to pull a certain trainer hex ID into the trainerbattle command and temporarily adjust the levels from their original setting to the highest in your party? Or would entirely new trainers have to be made? I'm leaning toward that because I've tried to find the trainers in the Trainer Tower in FR but they don't seem to be available to edit in trainer editing programs.

I've been scouring threads looking for info on this, but haven't had much luck. If anyone is able to help, wants to take a crack at it, or point me in the right direction I'd greatly appreciate it.

EDIT

I've come across how to get the highest level in my party, but I'm unsure how to have the game temporarily overwrite the trainer's pokemon level with a script, so I was thinking an ASM routine might be the way to go.
 
Last edited:
51
Posts
9
Years
  • Age 33
  • Seen Nov 18, 2023
[FR] Selection from PC Box

This hack allows the player to directly select a pokemon from the pc boxes by modifying the tasks associated with the withdraw function. It doesn't actually do anything with the selection except store relevant data, but this data can then be used in subsequent functions to modify relevant data.

Fortunately, I added in some new/updated specials to allow the user to swap pokemon between box and party for things like trading, nicknaming, and checking/setting pokeball types. Adding new specials for other data manipulation is easy enough, and I would be happy to add more if more ideas come to me.

Current Special Fixes Include:
Spoiler:


Here is the repository. The readme should do an adequate job of detailing the usage.

Here is a GIF of using this function with a wonder trade. (credit to sagiri for the dtan system)
zq6pr9c.gif

GREAT!!!!
Can u make a example script please? I don't understand how to make it (I just read the README text in the repository). Thank you :)
 

rubenturen

Also Known as: Canned Brain
51
Posts
5
Years
im using emerald
Hello I wanted to know if there
Is a way to make a asm routine that I can call in a script Wich shows a trainer battle sprite anywhere on screen
Like a modified showpokepic or something

(P.s. i'm Not good at making asm myself so pls design the routine for me)
 
Last edited:
Back
Top