• 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

7
Posts
5
Years
    • Seen Feb 19, 2022
    I would like to request for someone to make a fire red ASM routine that will always write the text string "Super Effective" if the move effectivness returns greater than 1 and "not very effective" if it returns less than 1.

    I made changes to my type effectivness table to add better depth to it and now the game no longer prints the text!

    Ive been trying to understand ASM for months now and just cant seem to teach myself fully. Someone with amazing skills...Please help!!!
     
    1
    Posts
    3
    Years
  • Hello.
    I'm starting to make a ROM hack (or at least trying to make), and I recently discovered a specific program called TLP which I can edit the sprites.
    Just to clarify, my plan is to make a Red or a Gold pokemon hack, with the main objective of maintaining the vintage aesthetic of the first game but with more pokemon beyond those that exist only in the first generation.
    These programs were all founded through google, more specificaly in other threads in this forum.
    In addition to this program, I am aware of what makes me able to edit the map as a puzzle, but I know that there are still many programs that I need to know and I need to see if I would be able to use it on my computer without problems (many programs that I found through internet had specific problems when I tried to run it, and it certainly has nothing related to problems in my computer, which has a good configuration).
    I really want to know if I'm on the right path and if there is things that I need to know before move forward with the project. For now, I'm making the sprites of the story characters. The history that I have in mind is a universe full of life, something that I have several texts telling from different moments besides being something that I share with my friends who help me in the story.
    This first ROM hack I plan on will tell only the beginning of the story. If it works, I intend to go to the end. If it goes as planned, I'm sure things will work out.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Hello.
    I'm starting to make a ROM hack (or at least trying to make), and I recently discovered a specific program called TLP which I can edit the sprites.
    Just to clarify, my plan is to make a Red or a Gold pokemon hack, with the main objective of maintaining the vintage aesthetic of the first game but with more pokemon beyond those that exist only in the first generation.
    These programs were all founded through google, more specificaly in other threads in this forum.
    In addition to this program, I am aware of what makes me able to edit the map as a puzzle, but I know that there are still many programs that I need to know and I need to see if I would be able to use it on my computer without problems (many programs that I found through internet had specific problems when I tried to run it, and it certainly has nothing related to problems in my computer, which has a good configuration).
    I really want to know if I'm on the right path and if there is things that I need to know before move forward with the project. For now, I'm making the sprites of the story characters. The history that I have in mind is a universe full of life, something that I have several texts telling from different moments besides being something that I share with my friends who help me in the story.
    This first ROM hack I plan on will tell only the beginning of the story. If it works, I intend to go to the end. If it goes as planned, I'm sure things will work out.

    have you run into the pokered/pokecrystal disassemblies?
     

    Lioniac

    High-level Language Developer trying to learn ASM
    13
    Posts
    6
    Years
    • Seen Nov 13, 2021
    Hello,

    This is a request.

    I'm learning XSE and trying to create a method to replace tileset dynamically for a map, but I cannot find the right script commands. I guess I'll have to go to ASM. Is it right? If so, it's a long learning curve LOL
    Use case explained: I want to use RNG Weather + Battle weather that mimics OW weather + dynamic change OW tiles to snow ones when it's snowing.

    - First I tried to create custom tileset, set it in the cities maps (A-Map) and using a script to change every tile using setmaptile... super impractical and waste of resource consumption... super ugly approach.
    - Then, I realized the tile positions (X,Y) are static, so creating a "snow tileset" version with tiles in the same position of the original would be much more efficient. I just need a way to dynamic change the tileset when it's snowing.

    That would be also useful if you want to generate events that dynamically change the map in general (e.g A HUGE Earthquake), so I believe this request could open many possibilities.

    Example:
    Spoiler:


    Thanks in advance.

    PS: Yeah, I know about Seasons by DNS tool but I could not find the source code or anything to edit. The tool does not allow you to freely edit the months... e.g. I live in Brazil and December is Summer, not Winter... if anyone has a Github/source code on that, it should work as well.
     
    Last edited:
    39
    Posts
    5
    Years
  • Frontier Routines - Opponent Party generation


    I've been meaning to implement a frontier of sorts into FireRed for some time but never really got a good opportunity to do so. Today I got a little bored and decided that I might as well start up. The first problem is obviously to generate a pseudo random party for the opposing trainer. That's what I've done today!

    I had made a generation routine in the past as well, but it was incomplete and a little buggy. This one, as far as I can tell in my tests, should work fine :)


    Setting up some prerequisites:
    When making the routine for Pokemon generation, it was important that the hacker had some customization about which Pokemon were allowed into the opponents party (to prevent legendary Pokemon, or some specific Pokemon into the competition). The best way to do that is to either make a table of the Pokemon allowed to be in the opponent's party, or a table of the Pokemon not allowed to be in it. I decided to make the hacker do a table of all the Pokemon species allowed to be in the opponent's party.

    It's important to remember that Pokemon Species ID takes 2 bytes per species, and that each entry in the table is in reverse hex. Bulbasaur for example would be: "01 00" in the table. The size of the table is up to you. The biggest reason I made the table be a table of all the Pokemon allowed is because this allows you to put more than 1 entry of the same Pokemon (thus increasing it's likelihood to be selected) ==> not all Pokemon species have the same chance of being selected!

    Find some half-word aligned free space (offset divisible by 2) and fill up your table with as many entries as you'd like in this format:
    Code:
    [2 bytes (ID)] [2 bytes (ID)] ...

    Write down how many entries you have, and where the start of the table is.


    How to insert:

    First take a look at the routine in the spoiler. Scroll to the very bottom, and you will see two fields which need filling. The first is called "Table". Table is supposed to be a location to the table of IDs we made earlier, replace 0x8750000 with your table location. Tsize is supposed to be the amount of Pokemon your table has in it, adjust that accordingly as well.

    Finally, the routine is flag toggled. If flag 0x205 is set, the opponent is generated a random party. To adjust this change these lines accordingly:
    Code:
    	mov r0, #0xFF
    	lsl r0, r0, #0x1 @0xFF * 2
    	add r0, r0, #0x7 @ 0x1FE + 7

    Once the adjustments are complete, compile and insert into free space.
    Spoiler:


    Finally, in a hex editor insert the following byte changes at 0x112F8:
    Code:
    00 48 00 47 XX XX XX 08

    Where XX XX XX is the place you inserted the routine +1. Note that the trailing 08 may change depending on where you placed the routine.


    Usage:

    The routine is flag toggled. Set flag 0x205 before entering battle, and the rest is done automatically.

    I wonder how to use this code for double battles ...
     
    1
    Posts
    3
    Years
    • Seen Jul 7, 2021
    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.

    Do you know How to do that in emerald?
     
    56
    Posts
    6
    Years
    • Seen May 8, 2024

    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!

    Anyone out there that can help me with this? I want my temp sprite at the beginning of the game to disappear right after the first battle with Gary in Oaks lab
     
    392
    Posts
    3
    Years
    • Seen Nov 24, 2023
    Anyone out there that can help me with this? I want my temp sprite at the beginning of the game to disappear right after the first battle with Gary in Oaks lab

    Assemble the routine. The open your rom in your hex editor and paste the contents of the .bin into your rom, overwriting enough FF bytes, and make sure the offset ends in 0, 4, 8, or C. Then Copy the offset and add 1 to it. Then reverse it: Example:
    Let's say the offset is 800000:
    800000+1=800001: 01 00 80
    Or if the number of digits is odd:
    5673C+1=5673D=05673D: 3D 67 05
    Then overwrite bytes at 5CA4C
    00 48 00 47 [reverse hex pointer] 08
    Then make the script
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • I've noticed significant demand for working Dawn Stone evolutions, specifically ones that require the mon to be a specific gender. My bad if this is already posted somewhere but here y'all go:

    Code:
    .org 0x4318e
    lsl r0, r0, #0x0
    ldr r2, .MethodAddr
    bx r2
    
    .MethodAddr: .word 0x085B2521 #UPDATE THIS TO MAIN FUNCTION OFFSET+1
    
    
    .org 0x5B2520 #UPDATE THIS TO MOST CONVENIENT FREE SPACE IN YOUR HACK
    cmp r0, #0x7
    beq StandardStone
    cmp r0, #0x14 #UPDATE THIS
    beq MaleStone
    cmp r0, #0x15 #UPDATE THIS
    beq FemaleStone
    b NoEvo
    
    MaleStone:
    push {r1-r3}
    mov r0, r7
    mov r1, r8
    ldr r1, [r1, #0x0]
    bl DetermineGender
    pop {r1-r3}
    cmp r0, #0x0
    beq StandardStone
    b NoEvo
    
    
    FemaleStone:
    push {r1-r3}
    mov r0, r7
    mov r1, r8
    ldr r1, [r1, #0x0]
    bl DetermineGender
    pop {r1-r3}
    cmp r0, #0xFE
    beq StandardStone
    b NoEvo
    
    
    StandardStone:
    ldrh r0, [r1, #0x2]
    cmp r0, r9
    beq Finish
    
    NoEvo:
    ldr r2, .NoEvoReturn
    bx r2
    
    DetermineGender:
    ldr r2, .DetermineGenderFunc
    bx r2
    
    Finish:
    ldr r2, .EvoReturn
    bx r2
    
    .NoEvoReturn: .word 0x08043199
    .EvoReturn: .word 0x0804317d
    .DetermineGenderFunc: .word 0x0803f78d
    Change the values in the lines marked UPDATE THIS to the indexes of male stone evos and female stone evos. Leave their entries blank in the general evolution table; stone evolutions function differently from level-up evolutions.
    this is 5 years old, but don't leave the entries blank in the general evolution table: it misbehaves when interacting with other evolutions.
    if my kirlia has a level-up evolution method and a gendered stone evolution method, then when leveling up the game will crash. adding the pointers for the stone evolution in the gendered stone entries will fix the crash. in effect, write 26 30 04 08 in those entries.
     

    FireFig

    Ignite
    199
    Posts
    3
    Years
    • Seen Jun 20, 2022
    Request for FIRERED:

    An asm routine that gets into the Item storage in PC directly without opening any kind of menu first if (you get the gist ryt?) through calling the asm in a script.

    It would be useful in many ways. Thanks :)
     
    Last edited:

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Summary Screen Wrap-Around

    First of all, I would like to thank Zeturic for creating the original routine for this. My routine is different from theirs, and I have extended it a bit, which is why I am posting this here.

    Anyway, this patch modifies the summary screens in both the Party Menu and in the PC so that if you are on the first Pokemon and you go upwards, you will loop around to the last Pokemon (and vice versa). Ordinarily, in this circumstance, nothing would happen.

    (Download)

    This folder contains the patch itself, and the two routines that comprise it. There were two functions which were replaced, and both of the new functions were shorter than the originals (hence why this could be turned into a patch).

    This patch will skip over Eggs when scrolling while in the Party or PC, but if you want to see the Egg's summary (to see how long it will take to hatch), you can select their summary individually.
     
    62
    Posts
    5
    Years
  • Toggle Run Away

    It can work with Toggle Capture very well, or completely independently.
    If you use the same Variable as Toggle Capture, if the value is set to 0x1,
    a Pokemon will be uncapturable, and you will be unable to Run Away from it.
    If the value is 0x0, the game is as normal. If the value is anything else,
    you cannot Run Away from the Pokemon BUT you can catch it.

    However if you use a completely different variable you will be able to
    run away, but not to catch the Pokemon, though to me this is pointless,
    because if you have an uncatchable Pokemon, why would you be able to
    Run Away from it?

    Anyway here is the routine!

    Fire Red


    Spoiler:


    Once I finish porting other abilities I'll make a brand new post for the
    Emerald version of this.

    I'm probably very late to the party with this one, but I've run into an issue, where whenever the player obtains any items, be it a gift from a trainer, or a hidden item on the ground, the game locks running away. I have no code that sets it, but it instead auto sets and won't be dismissed until the var 0x8000 is set back to 0 via an event. Any one else face this problem and if so what was your solution? I know var 8000 is used quite a bit as a temporary var behind the scenes, so i was wondering if there was a safer one? I've tried using regular vars, but it seems as though it needs to be one of the temp ones specifically?

    Edit: I fixed the issue by changing the var to 0x8003, for some reason 8001 and 8002 were insufficient, as obtaining an item from an NPC would still trigger the lock. Now what I'm wondering/ am worried about is whether or not the game is going to trigger this var behind the scenes like it did with the others, if so are there any temporary vars that go completely unused? Thanks :)
     
    Last edited:

    Paperfairy

    WHAT ARE U LOOKIN' AT?
    62
    Posts
    19
    Years
  • Here are the byte changes he wants you to do inorder to achieve an intro skip similar to Pokemon Rose (which you guys should all checkout, Bela's it's quite an awesome project).

    So this works perfectly for removing the blue screen intro and the Oak intro. I am trying to retain the blue screen intro, but remove the Oak intro (I'll handle setting the player name with a custom routine later).

    I tried editing this line by line to check and see what works, but didn't have any success or changes aside from noticing a binary change. Could somebody please point me in the right direction?
     

    Dreamaker

    Banned
    97
    Posts
    14
    Years
  • So because I have a life, I spent way too long yesterday writing a routine to change the measurements for the height and weight in the PokeDex to be in metric (for those who eschew the imperial system).

    EDIT: I neglected to have this change the units for SEEN entries as well as CAUGHT entries. I fixed that now.

    bVZzTYj.png

    d1mFFEB.png

    Height (Feet to Metres - (Uncaught Pokemon)):
    Spoiler:


    Height (Feet to Metres):
    Spoiler:


    Weight (Pounds to Kilograms):
    Spoiler:


    FKayVct.png

    9QvzU7S.png
     

    Manekimoney

    Banned
    169
    Posts
    6
    Years
    • Seen Jan 18, 2024

    Party Stat Checker


    I promised someone that I'd post this once I found it. Well, I found it :P

    How to insert:
    Compile the following routine into free space:

    Spoiler:


    Usage:
    setvar 0x8001 0x[stat you want to retreive]
    setvar 0x8000 0x[value you want stat to match]
    callasm 0x[routine +1]

    The return value will be stored in var 0x8000

    Here's a brief list of useful stats you may be interested in checking:
    Spoiler:

    This routine is odd. It's supposed to use 8001 to see which stat you want, then searches your entire team for a pokemon that has that stat equal to 8000 and then saves the first party slot number that matches that in 8000 (or outputs number 6 if none).

    But the problem is that it thinks that the pokemon is valid, as long as it has the stat HIGHER or equal to what you use. For stuff like levels, atk, def etc. this has a use. But when searching stuff like species, items, attack or status ailments it completely falls apart (unless you want to check how deep down the pokedex a party member is? lol)

    Anyway, my ASM knowledge is probably negative, but for searching these I think that "bge PokeMatch" would need to be changed to "beq PokeMatch", if you want to match the stats you search (correct me if I'm wrong) and in a cavemanish way, have two of these inserted and using one when you need higher than and the other one for matching the stat.

    Honestly, it took me a while to figure out how the function is even supposed to work, since it's not very clearly explained.
    This one caused me quite a headache, so hopefully this helps some poor lad out.
     

    Manekimoney

    Banned
    169
    Posts
    6
    Years
    • Seen Jan 18, 2024
    Nature Changing
    Before I begin, I should mention that this only works for FireRed at the moment. This is because it uses the Lustre stat, which in FireRed is unused but in Emerald is not. If you can find another stat to use, (or you don't have contests in your Emerald hack), then you can use this.

    Offsets listed here are for FireRed, though, so keep that in mind if you decide to port it.

    Anyway, without further ado, I present Nature Changing!

    How Does It Work?
    Skip this if you don't care about the behind the scenes stuff.

    Basically, this hijacks the GetNature function. It first checks the Lustre stat of the Pokemon in question. If it's equal to zero, then it gets the Nature form the PID as usual. If it's not zero, then it uses the Lustre value as the Nature, effectively changing the Pokemon's Nature without messing with the PID (and potentially messing up other stuff like the Pokemon's gender, Shininess, etc.).

    This does mean you can't set the Nature to Hardy, but this is not that big of a deal since there are other neutral Natures you can use.

    The Main Event
    I have written an instruction manual that explains how to use the hack in detail. It also contains links to download everything.

    The link presented below is the link to download the folder with the Instruction Manual and all the routines. Not every routine in the folder is one you need to insert, as there are a couple of optional add-ons to make changed Natures compatible with other hacks.

    Download: Here!

    Would it be possible to use a similar system to this one to change Pokemon IVs? I'm guessing it's not as simple as using 0x8005 to change IVs directly, but perhaps it would be possible to use other useless stats (like Lustre), to change IVs of pre-existing pokemon?
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Would it be possible to use a similar system to this one to change Pokemon IVs? I'm guessing it's not as simple as using 0x8005 to change IVs directly, but perhaps it would be possible to use other useless stats (like Lustre), to change IVs of pre-existing pokemon?

    You can use the Decrypt Function used in the Nature Changing Routine to change the IVs. Each IV is controlled individually, so if you use the right index number in the Decrypt Function, then you can edit the IVs.

    The IVs are:
    HP = 0x27
    Attack = 0x28
    Defence = 0x29
    Speed = 0x2A
    Sp. Attack = 0x2B
    Sp. Defence = 0x2C

    So, it actually is as simple as using 0x8005 to modify the IVs directly.
     
    Last edited:

    JK0JK

    JK is JK
    25
    Posts
    3
    Years
  • 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!

    How would I go about cloning to the Male Hero Bike sprite without using a bike or having it be the Female Hero Bike sprite?
    Also, what do you mean by "repeated" OWs?

    Any more clonable sprites are always helpful, especially in the rom hack I'm making.
     

    JK0JK

    JK is JK
    25
    Posts
    3
    Years
  • Trying to make it work. Got a few questions, though...
    1. 0x5CA4C already has things on it. Should I worry about overriting the already existing data? What does the data already in do and what did you change?
    2. What does flag 0x406 do? It's also not free space but what other scripts use it?
    3. Variable 0x8000 is also not free space by default. What does it do normally?
    4. Variable 0x8000 needs to be set to a number. Should we convert that number to bytes or does the game do that automatically?

    Sorry for the noob questions, this is my first experience with Rom Hacking.
     
    Back
    Top