• 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

Blah

Free supporter
1,924
Posts
11
Years
  • Pokemon Item Checker + Silent Evolution Combination as an item effect
    This is my personal request that canbe a general feature.
    I wanted in my hack to make Mewtwo evolves into Armoured Mewtwo with "Legendary Armour"
    but this is not the same in others, It will evolve Mewtwo using Metal Vessel if it is holding Legendary Armour but in a silent mode.

    You would use the party checker routine to check if Mewtwo is holding the item. Then, depending on the return you would call silent evolution. It's just simply combining two routines I've already done.

    If you would read some of the older posts, Fbi Agent said he wasnt gonna do this cause daniilS has done it but hes working on it some more. aSk him is you would want to use it.
    Thanks.

    Get Pokemon Type


    Recently, someone commented on the limitations of my special 0x12b edit. Honestly speaking it is very limited, and only really has a use for checking if you have a certain type of Pokemon. If you had multiple pokemon of the same type it would only return the first one..ect.ect. Well I decided to customize it a little more. It's less powerful now, but more useful (hopefully). All it does is return the type of a Pokemon in a certain slot.

    How to insert:

    Compile and insert into free space the following routine:
    Spoiler:


    Usage:
    setvar 0x8000 0x[pokemon slot from 0 to 5]
    callasm 0x[routine +1]

    It will store the Pokemon's type in variable 0x8000 in the form of an integer. The values in decimal follow this table (it will be stored in hex of course):
    Code:
    0x0 - Normal
    0x1 - Fighting	
    0x2 - Flying
    0x3 - Poison
    0x4 - Ground
    0x5 - Rock
    0x6 - Bug
    0x7 - Ghost
    0x8 - Steel
    0x9 - ???
    0xA - Fire
    0xB - Water
    0xC - Grass
    0xD - Electric
    0xE - Psychic
    0xF - Ice
    0x10 - Dragon
    0x11 - Dark
     
    252
    Posts
    11
    Years
    • Seen Jul 6, 2019
    Ahhm okay ^_^
    Evolution through script
    This is just an opposite of Silent evolution, when a var is set into something, it will evolve the pokemon wherever in slot you wanted with the Evolution effect.
    That's ... exactly what silent evolution does. -_- Unless you're talking about silent evolution with the evolution animation added, which FBI is working on, if you read his post closely.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Unless you're talking about silent evolution with the evolution animation added, which FBI is working on, if you read his post closely.

    Yah, that is what Im looking for, His Silent evolutuon with evolution animation, I didnt noticed that he is working for that..
    A liitle question, Is that you who's working on an specific Pokemon when enters the battle, it calls rain or sunny day, although it doesnt have Drought and Drizzle ability?
    As far as I remember, that's you.
    Looking forward for it >_<
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • I have a request, but it may be a little too game specific. Could you make a routine that after every battle scans to see if a certain pokemon evolved? And then runs a set script when it happens?
    I guess the scan party for a Pokemon script would work too but is there a way to make it run after every battle?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • FBI, yup a combination but It will be an item effect
    What is the code?
    Use Darthatron's code, and follow the instructions carefully, it works.

    Ahhm okay ^_^
    Evolution through script
    This is just an opposite of Silent evolution, when a var is set into something, it will evolve the pokemon wherever in slot you wanted with the Evolution effect.
    The evolution animation is actually kinda wierd. I have the whole animation working, however once the animation is over and it's time to return to overworld the game freezes. I'm not too sure why that is, I just know it's not very easy to fix (I have to ask my graphics sensei). Oh plus this is graphics :P

    That's ... exactly what silent evolution does. -_- Unless you're talking about silent evolution with the evolution animation added, which FBI is working on, if you read his post closely.
    Thanks.


    I have a request, but it may be a little too game specific. Could you make a routine that after every battle scans to see if a certain pokemon evolved? And then runs a set script when it happens?
    I guess the scan party for a Pokemon script would work too but is there a way to make it run after every battle?
    Oh man. I'm not very confident I can do it, but I'll try and see how it goes. There's a few complications, for example how do I know it evolved? The only real way to know is if the game's evolution routine was called. Hacking that is actually not a good idea, it's kinda weird. The routine has a very LOW priority and so the script will end up running before the routine.

    To check if a Pokemon evolved the best way to do it is to store the party's species before the battle, and then compare it after the battle. Even then, like I said the evolution routine will end up running AFTER the script, so the check will show nothing evolve, and then it will evolve lol. This would work very nicely in scripted battles, but non-scripted battles it would probably fail. I would just have made it so that it runs the script after you take a step after battle.

    Slight progress on trainer sliding:

    G4JV5RK.png
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • Oh man. I'm not very confident I can do it, but I'll try and see how it goes. There's a few complications, for example how do I know it evolved? The only real way to know is if the game's evolution routine was called. Hacking that is actually not a good idea, it's kinda weird. The routine has a very LOW priority and so the script will end up running before the routine.

    To check if a Pokemon evolved the best way to do it is to store the party's species before the battle, and then compare it after the battle. Even then, like I said the evolution routine will end up running AFTER the script, so the check will show nothing evolve, and then it will evolve lol. This would work very nicely in scripted battles, but non-scripted battles it would probably fail. I would just have made it so that it runs the script after you take a step after battle.

    Dang I was hoping to avoid a scripted battle.:/ But I guess your silent evolution would work for that. Anyways, how bout making new trainerbattle 0x9?(The ones that run even if you lose.)
    Maybe make one that doesnt have any of the annoying msgboxes and screen highlights?
     

    Turtl3Skulll

    Blue Turtl3
    76
    Posts
    10
    Years
  • From what I've you do since this thread started, you are an incredible hacker as far as this community goes.
    1st Thanks for all the work you've done this has gotten to so many ideas, and you've made them real in no time.
    I still need to try everything you've done since its genius, but tell me if any of these sound plausible to do:

    Illegal capture flag -- setting a flag which would make it 'illegal' to capture wild pokemon as long as its on, like for a fancy garden where the owner doesn't like pokemon being captured or a town which believes its wrong to capture pokemon...
    Longer nickname for pokemon -- such that you could add the prefix 'Shadow/SHDW' to wild nicknamed pokemon.

    Lastly its on the border of graphical since idk if it means full on graphic changes or just a small change:
    Change the box color surrounding a pokemon like in shinies to a different color via script?
    shiny.jpg
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Dang I was hoping to avoid a scripted battle.:/ But I guess your silent evolution would work for that. Anyways, how bout making new trainerbattle 0x9?(The ones that run even if you lose.)
    Maybe make one that doesnt have any of the annoying msgboxes and screen highlights?
    The Oak battle is actually it's own little special battle. To mimic it, would be to re-write the whole thing. However, you're in luck. I'm already in the works of writing a battle-cancel routine which ends the battle forcibly and continues the script. So far it's working very well! To modify that to work when the player has lost the match is actually a little harder, but maybe if I have time I'll look into it :P

    From what I've you do since this thread started, you are an incredible hacker as far as this community goes.
    1st Thanks for all the work you've done this has gotten to so many ideas, and you've made them real in no time.
    I still need to try everything you've done since its genius, but tell me if any of these sound plausible to do:

    Illegal capture flag -- setting a flag which would make it 'illegal' to capture wild pokemon as long as its on, like for a fancy garden where the owner doesn't like pokemon being captured or a town which believes its wrong to capture pokemon...
    Longer nickname for pokemon -- such that you could add the prefix 'Shadow/SHDW' to wild nicknamed pokemon.

    Lastly its on the border of graphical since idk if it means full on graphic changes or just a small change:
    Change the box color surrounding a pokemon like in shinies to a different color via script?
    shiny.jpg

    Thank you for your kind words, I appreciate that you appreciate what I'm doing :)

    1) Illegal capture flag? I've made a routine that toggles capturability of Pokemon already, look in the first post!
    2) Longer nickname for Pokemon (I don't really feel the need to do it, because no one will really use it.) Pokemon Nicknames are stored in RAM as 11 bytes, changing that to be longer would require a full rework of the Pokemon storage (aka, not easy or really feasible). That being said, I suppose I can make longer names read from a pointer.
    Hmmm...if I have time and patience to step through I'll look into it. I'm sure I will end up having to hook in many places, and there will most definitely be text overflow somewhere.

    3) Why not just make the Pokemon shiny? HackMew's made a tool for shiny Pokemon
     

    Turtl3Skulll

    Blue Turtl3
    76
    Posts
    10
    Years
  • The Oak battle is actually it's own little special battle. To mimic it, would be to re-write the whole thing. However, you're in luck. I'm already in the works of writing a battle-cancel routine which ends the battle forcibly and continues the script. So far it's working very well! To modify that to work when the player has lost the match is actually a little harder, but maybe if I have time I'll look into it :P



    Thank you for your kind words, I appreciate that you appreciate what I'm doing :)

    1) Illegal capture flag? I've made a routine that toggles capturability of Pokemon already, look in the first post!
    2) Longer nickname for Pokemon (I don't really feel the need to do it, because no one will really use it.) Pokemon Nicknames are stored in RAM as 11 bytes, changing that to be longer would require a full rework of the Pokemon storage (aka, not easy or really feasible). That being said, I suppose I can make longer names read from a pointer.
    Hmmm...if I have time and patience to step through I'll look into it. I'm sure I will end up having to hook in many places, and there will most definitely be text overflow somewhere.

    3) Why not just make the Pokemon shiny? HackMew's made a tool for shiny Pokemon

    Dood you're welcome I love your work :)

    1) I thought the toggle capturability was in succession with the capture trainer pokemon only, if it works with wild pokemon then nevermind lol
    2) I imagine an overflow error would occur, if you can that'd be great, I knew that would be a real stretch though.
    3) I don't want it to be shiny, I want to be able to change that box color to any other color to symbolize special pokemon such as Shadow pokemon, since coding a shadow pokemon would be too much of a hassle.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Dood you're welcome I love your work :)

    1) I thought the toggle capturability was in succession with the capture trainer pokemon only, if it works with wild pokemon then nevermind lol
    2) I imagine an overflow error would occur, if you can that'd be great, I knew that would be a real stretch though.
    3) I don't want it to be shiny, I want to be able to change that box color to any other color to symbolize special pokemon such as Shadow pokemon, since coding a shadow pokemon would be too much of a hassle.

    1) There's another routine I wrote separate for wild pokemon and a second one for trainers.
    2) Yeah, probably not gonna be able to in the near future :(
    3) This is a graphical implementation, however, I like you, so I'll look into it :P
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Special Shiny Pokemon box!


    This is the first, and probably last, graphical hack I ever want to do. All it does is add the nice Shiny box and start around a Pokemon that's not actually shiny.

    How to insert:

    Compile the following routine into free space:
    Spoiler:


    Navigate to offset 0x44472 and insert the following byte changes:
    Code:
    01 4D 28 47 00 00 XX XX XX 08
    Where XX XX XX is the pointer to the routine we just compiled +1!

    Compile into free space the following optional routine:
    Spoiler:


    This routine is optional, it takes into var 0x8004 a slot number 0-5 for a pokemon and applies the property needed to give it a shiny box. You can do this yourself in a different routine if you would like :)

    Usage:
    Everything is done internally. If you wish to give a Pokemon a shiny box, setvar 0x8004 to the slot number of it from 0-5 and callasm to the second routine. That's all :D

    Here's how it look like:
    Before:
    0DNWTmf.png

    After:
    RsGXARn.png



    I've also got similar routines to enable the shiny palette as well, if anyone cares to know :x
     
    Last edited:

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years

  • Is it real? Is it real!? Oh! My! God! I cant wait for the routine! Its awesome!
    About how to make the palette to be shiny, Im interested!

    Changing the HM-enabling badge
    I havent found any tutorial on how
    to make the first badge enables you to use
    Cut instead Flash
    Boulder-Hm 01 Cut
    Cascade-Hm 06 Rock Smash
    Thunder-Hm 04 Strength
    Rainbow-Hm 02 Fly
    Soul-Hm 05 Rock Climb
    Marsh-Hm03 Surf
    Volcano-Hm08 Dive
    Earth-Hm07 Waterfall
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Inserting Routines into your ROM


    This is not exactly the same as my normal ASM resources. Instead of a routine I have a mini-tutorial. This has been covered in a lot of other ASM tutorials, but I'm just going to go over inserting routines into your ROM in general (and hopefully in detail). I've just been getting a large amount of PMs and VMs regarding this, so I thought it was about time I write a small guide.
    This guide may seem like a large amount of work, but all the steps take me about 10 seconds to do. Literally 10 seconds.

    Before we start you will need the following tools:
    - This thumb compiler (http://www.mediafire.com/download/bxzzfe543qq7697/Compiler.rar)
    - Hex editor (I use ftp://wa651f4:[email protected]/HxDSetupEN.zip)
    - Some knowledge of how to use the command line/a computer in general



    Setting up your routine for compilation


    1) Make a separate folder somewhere and put the thumb compiler you downloaded in the first post. into this folder. In this example I make a folder on my Desktop called ASM, and inside that folder I have my thumb compiler.
    Spoiler:


    2) Now open your routine inside a word processor. I use notepad (thought you should use notepad ++ or something similar). Save the file as Name.asm and move it into the folder containing the compiler. I'm going to be using my "Average Level" routine because I have to test it still, and this is a good opportunity to do that!
    Spoiler:


    You've now set up the files in a needed matter to assemble your routine!

    Compiling the routine:


    Before I begin, if you're running a windows machine (Windows 7, Vista, XP (maybe 8 works, I'm not sure)), you don't need to read this part of the tutorial. Skip to the Windows-compile section of this tutorial.

    1) Open the start menu and open your command line. In Windows this is cmd, most other operating systems call it the Terminal. Whatever you call it, open it! It should be a black or dark purple box depending on the OS you're using.
    Spoiler:


    2) We need to navigate to our folder containing the compiler and our ASM Routine! To do we use the cd command (short for change directory). You can find the directory of the file you're using if you navigate to it and click the directory browser.

    Here's a picture of what I'm talking about:
    Spoiler:


    3) We will insert into the command line "cd \file\path" where these words file path are the names of the folders we have to go through to reach our routine. In my case the filepath to the folder containing the routine and compiler was C:\Users\Guest\Desktop\ASM. My command line is currently on:
    Code:
    C:\Users\Guest>
    So I will type in:
    Code:
    cd Desktop\ASM

    Hit Enter/return when you're done.

    It looks like this:
    Spoiler:


    4) Run the compiler on the Routine. The line to do this is simply:
    Code:
    thumb filename.asm outputFileName.bin
    The only thing here that will remain the same for you is the word "thumb" as that is the name as the.bat file. The following file names after the word "thumb" are not case sensitive and the outputFileName.asm is actually optional. If you don't specify an output file, the compiler is smart enough to make one with the same name as the input file, but with a .bin extension.

    So all you really need to type in the end is:
    Code:
    thumb fileName.asm

    In my case I named my file AverageLevel.asm. So I would type, obviously:
    ZLmL4Rq.png


    5)If the routine you compiled, is error free, it will say "Assembled Successfully"


    Windows Compile:


    If you're not running a Windows machine, this doesn't apply to you (maybe it does, I haven't confirmed :P). Feel free to skip to the next section.

    1)Drag your .ASM file into your thumb.bat file. It will look like this:
    Spoiler:


    2) If your .ASM file doesn't have any errors a new File with the same name but with a .bin extension will be created. If a .bin file isn't created than the file you're trying to compile has an error. Go back to the "Compiling your Routine" section and do it manually to find the error.



    Inserting the compile Routine into the ROM!


    1) Open both the ROM and the .bin File inside a hex editor. Remember, you want the .bin file which was created in the compilation process, not the .asm file.

    2) Copy the contents the hex editor gives for your .bin file
    Spoiler:


    3) Find some free space in the ROM (denoted by 0xFF) and insert there the .bin file's hex form. In HxD you simply ctrl+c the bin file's hex, then at the free space in the ROM do ctrl +B.
    Spoiler:


    4) You need to make sure the address you insert the routine in is divisible by 4. The simple way to ensure this is to make sure that the address ends in 0, 4, 8 or C. In my case I will insert the routine in 00720000.



    Running the Rountine from your ROM.
    In your script have "callasm 0xRoutineAddress +1".
    So if I had inserted my routine at 0x720000, I would have the command "callasm 0x720001". That's all there is to compiling and using ASM routines.

    If you still don't understand, I would advise you to go and play outside instead :)
     
    Last edited:

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Is it real? Is it real!? Oh! My! God! I cant wait for the routine! Its awesome!
    About how to make the palette to be shiny, Im interested!

    Changing the HM-enabling badge
    I havent found any tutorial on how
    to make the first badge enables you to use
    Cut instead Flash
    Boulder-Hm 01 Cut
    Cascade-Hm 06 Rock Smash
    Thunder-Hm 04 Strength
    Rainbow-Hm 02 Fly
    Soul-Hm 05 Rock Climb
    Marsh-Hm03 Surf
    Volcano-Hm08 Dive
    Earth-Hm07 Waterfall

    Hi, I documented this in my HM crusade. Most of these are easy, the only ones that will take effort are fly, surf and waterfall. All which I've talked about before.

    How about over 50 TMS? Its not yet implemented in FR

    This is a rather pointless feature. TM bag space is limited to I think it's limited to 43 different types of TMs in the TM bag at once. This means that if you convert TMs to the newer generation compatibility (unconsumable) you will run out of bag space. Having studied the bag for my Bag deletion/restoration routines, I can tell you that expanding the bag slots will also be a very hard task. So no, I'm not going to expand TMs, and for anyone who bothers to try, that's a wall they will end up hitting.

    Some research on Shiny Pals routine (not the frame/star, the Pokemon itself)
    It's determined at 0x80440F4. This routine is run for enemy Pokemon and for your own. Which means it's actually possible (and very sad) to find a shiny which belongs to a trainer!

    It does the same shiny check as normal, taking species, OTID and applying the algorithm. The line that determines all of this is at 0x8044122. Happy hacking!
     
    Last edited:

    DJTiki

    top 3 most uninteresting microcelebrities
    1,257
    Posts
    10
    Years
  • I recently began planning for a hack and for what I wanted to do, it involved changing the overworld colors inbetween segments. Although it is graphical hack, I am curious(since it sort of has to do with the mechanics of Fire Red)

    Turn the coloring of the game's overworld to the same Black and White Filter used in Flashbacks.

    By this, flashbacks use a filter that turns all colors to Black and White. If you could set some var and use this on the spot, that'd be cool. I mainly want to do this because detective monolouges are always cool(or super emotional cutscenes, your preference)
     
    Last edited:

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • I'm really enjoying this thread. Its great seeing so many interesting routines being churned out, whether they're big or small. Its the first thread I open up whenever I log on to PC now. Keep up the excellent work FBI and the same goes for all of the hard-working elves who pop-in now and then to assist :P

    I recently began planning for a hack and for what I wanted to do, it involved changing the overworld colors inbetween segments. Although it is graphical hack, I am curious(since it sort of has to do with the mechanics of Fire Red)

    Turn the coloring of the game's overworld to the same Black and White Filter used in Flashbacks.

    By this, flashbacks use a filter that turns all colors to Black and White. If you could set some var and use this on the spot, that'd be cool. I mainly want to do this because detective monolouges are always cool(or super emotional cutscenes, your preference)

    You can already do this with a writebytetooffset command as shown here. There's also some talk about it on the 19th page of the Quick R&D thread which should allow you to revert the game's colour back to normal without warping.
     
    Back
    Top