• 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

22
Posts
9
Years
    • Seen Feb 1, 2020
    Side Quest Menu [FR]

    This hack converts the PC item storage menu into a side quest menu, or task list, etc.

    Here is the repository, the compilation instructions are included in the readme. You will need to define your own parameters/ram in src/headers/defs.asm and create your own tables of string pointers for all of the quest names, descriptions, item images, and quest details. I kept the item image part to allow hackers to include items that might be symbolic of their quest, eg. a scroll or key or pokeball.

    To use in a script (XSE)
    Code:
    writebytetooffset 0x1 <your questflag ram in src/headers/defs.asm>
    fadescreen 0x1
    callasm 0x80EBCD9
    waitstate

    Enjoy! And please let me know of any bugs.

    I'm trying to build that but I'm getting an error code:
    Code:
    arm-none-eabi-as -mthumb -c src/quest_select_msg.asm -o build/src/quest_select_msg.o
    make: arm-none-eabi-as: Command not found
    make: *** [makefile:17: build/src/quest_select_msg.o] Error 127

    I built lots of other things but never got this error. What should I do?

    EDIT: Ok, forgot it. It was a typing mistake on my system path to the DevkitARM bin folder.
     
    Last edited:
    22
    Posts
    9
    Years
    • Seen Feb 1, 2020
    I'm searching for a routine that opens the bag to select an item (like when you give some item to a pokemon from the pokemon menu) and it saves the item ID into a variable. Does anyone know something about it or how to do it?
     
    1
    Posts
    4
    Years
    • Seen Jun 1, 2019
    Would it be possible to remove the character and rival naming process and make them both a set name in FireRed?
     
    5,256
    Posts
    16
    Years
  • [FR] Switch the title screen's "Charizard" tilemap based on a flag


    Code:
    .thumb
    
    .equ rom, 0x08000000
    .equ free_space, 0x
    .equ title_screen_default_palette, 0xEAD5E8 @ these are the default for FireRed's Charizard tilemap
    .equ title_screen_default_tileset, 0xEAD608
    .equ title_screen_default_tilemap, 0xEADEE4
    .equ title_screen_new_palette, 0x
    .equ title_screen_new_tileset, 0x
    .equ title_screen_new_tilemap, 0x
    .equ new_flag, 0x
    
    .org 0x78A1A, 0xFF
    hook:
        ldr r0, =(rom + main + 1)
        bx r0
    .pool
    
    .org 0x78F62, 0xFF
    hook1:
        ldr r0, =(rom + main1 + 1)
        bx r0
    .pool
    
    .org 0x79670, 0xFF
    hook2:
        ldr r0, =(rom + main2 + 1)
        bx r0
    .pool
    
    .org free_space, 0xFF
    main:
        push {r5}
        mov r5, r4
    
        ldr r0, =new_flag
        bl flag_check
        cmp r0, #1
        beq new
    
    default:
        ldr r0, =(rom + title_screen_default_palette)
        mov r1, #0xD0
        mov r2, #0x20
        bl gpu_pal_apply
    
        ldr r1, =(rom + title_screen_default_tileset)
        str r4, [sp]
        mov r0, #1
        mov r2, #0
        mov r3, #0
        bl decompress_with_fallback_maybe
    
        ldr r1, =(rom + title_screen_default_tilemap)
        b continue
    
    new:
        ldr r0, =(rom + title_screen_new_palette)
        mov r1, #0xD0
        mov r2, #0x20
        bl gpu_pal_apply
    
        ldr r1, =(rom + title_screen_new_tileset)
        str r4, [sp]
        mov r0, #1
        mov r2, #0
        mov r3, #0
        bl decompress_with_fallback_maybe
    
        ldr r1, =(rom + title_screen_new_tilemap)
    
    continue:
        str r6, [sp]
        mov r0, #1
        mov r2, #0
        mov r3, #0
        bl decompress_with_fallback_maybe
    
        mov r4, r5
        pop {r5}    
        ldr r0, =(rom + 0x78a40 + 1)
        bx r0
    
    .pool
    
    main1:
        ldr r0, =new_flag
        bl flag_check
        cmp r0, #1
        beq new1
    
    default1:
        ldr r0, =(rom + title_screen_default_palette)
        b continue1
        
    new1:
        ldr r0, =(rom + title_screen_new_palette)
    
    continue1:
        ldr r1, =0x2037398
        mov r2, #0x10
        bl CpuSet
        mov r0, #0x2
        lsl r0, r0, #0xC
        str r5, [sp]
        str r7, [sp, #4]
        str r7, [sp, #4]
        ldr r1, =(rom + 0x78f76 + 1)
        bx r1
    
    .pool
    
    main2:
        ldr r0, =new_flag
        bl flag_check
        cmp r0, #1
        beq new2
    
    default2:
        ldr r0, =(rom + title_screen_default_palette)
        b continue2
        
    new2:
        ldr r0, =(rom + title_screen_new_palette)
    
    continue2:
        mov r1, #0xD0
        mov r2, #0x20
        bl gpu_pal_apply
    
        ldr r4, =(rom + 0x7967a + 1)
        bx r4
    
    .pool
    
    gpu_pal_apply:
        ldr r3, =(rom + 0x703EC + 1)
        bx r3
    
    flag_check:
        ldr r1, =(rom + 0x6E6D0 + 1)
        bx r1
    
    decompress_with_fallback_maybe:
        ldr r4, =(rom + 0xF6878 + 1)
        bx r4
    
    CpuSet:
        ldr r3, =(rom + 0x1E3B64 + 1)
        bx r3
    
    .pool

    Pretty easily extendible for more than 2 different ones, if you swap out the flag for a variable (obviously assuming you have some ASM fluency).
     
    Last edited:
    62
    Posts
    5
    Years
  • Actually, I wouldn't recommend using JPAN's method: for some reason he wrote a completely custom decryptor, while there is an existing one in the rom already. It's way easier to use because changing a pokémon's species requires just a single callasm. (If anybody is interested, I made this in ancient times: )
    Spoiler:

    However, I believe the thing that's important about his request is playing the evolution animation, which isn't as easy to do as this.

    My question regarding this how can I make it so that not every pokemon that is picked can change into the form?
    Also, I noticed that when you change forms it changes the pokemon's level to be one less than it was before.
     
    62
    Posts
    5
    Years
  • I just copy-pasted and compiled it with no problems.

    usage:

    So if I wanted to evolve the 3rd Pokemon in my party I would put:
    setvar 0x8001 0x2
    callasm 0xOffset +1

    Here's a compiled version:
    Code:
    FF B5 49 48 00 88 64 21 48 43 48 49 40 18 07 1C 0B 21 47 4B 00 F0 84 F8 05 1C 00 F0 29 F8 06 1C 38 1C 38 21 42 4B 00 F0 7B F8 04 1C 38 1C 3D 4A 31 1C 11 80 0B 21 3F 4B 00 F0 72 F8 38 1C 3E 4B 00 F0 6E F8 30 1C 3D 4B 00 F0 6A F8 30 1C 02 21 3B 4B 00 F0 65 F8 30 1C 03 21 39 4B 00 F0 60 F8 38 1C 38 21 32 4B 00 F0 5B F8 A0 42 37 D1 0C E0 04 21 41 43 40 18 C0 00 32 4B C1 18 48 88 8A 88 90 42 00 DC 70 47 10 1C 70 47 38 1C 2E 49 0A 1C 02 21 27 4B 00 F0 44 F8 2C 48 0B 21 69 43 09 18 0D 1C 29 49 0C 1C 00 20 0A 28 0D D0 01 35 29 78 01 34 22 78 8A 42 32 D1 FF 2A 00 D0 02 E0 FF 29 02 D0 2C E0 01 30 EF E7 20 4A 0B 20 46 43 B6 18 38 1C 32 1C 02 21 17 4B 00 F0 22 F8 1F E0 A0 42 D3 D0 02 1C 38 1C 19 21 11 4B 00 F0 19 F8 01 1C 00 09 A2 42 01 D9 09 18 00 E0 09 1A 09 4A 11 60 19 21 38 1C 0B 4B 00 F0 0B F8 38 1C 0A 4B 00 F0 07 F8 38 1C 38 21 06 4B 00 F0 02 F8 DF E7 FF BD 18 47 C0 46 B8 70 03 02 BA 70 03 02 84 42 02 02 E9 FB 03 08 7D 03 04 08 7D E4 03 08 99 32 04 08 75 8E 08 08 54 97 25 08 D0 1C 02 02 E0 5E 24 08

    So let's say I wanted to make Deoxys "evolve" into another form of Deoxys when I talk to a meteor. How would I go about making the "evolve" Deoxys specifically whether it is in slot 1 or 3 or 5, etc?
     
    62
    Posts
    5
    Years
  • Misc:

    Evolution via Callasm in FR

    Spoiler:

    A EV-IV Display Screen

    RENEWAL:
    Spoiler:

    OLD CONTENT:
    Spoiler:

    80x80 mugshots

    Spoiler:

    Some new movement bytes (including a patch)

    Spoiler:

    Hey would you by chance have a variant of that code that skips the evolution cutscene? I'm trying to do it for form changes, and the form change ASM routines here base it off of slot number and don't really give the option to check if you have a certain pokemon or not. For example. One will let you choose any pokemon to evolve into what you want and the other bases it on what slot number the pokemon is in. I need a code that will change a specific pokemon's index number or even making it "evolve" silently.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    Hey would you by chance have a variant of that code that skips the evolution cutscene? I'm trying to do it for form changes, and the form change ASM routines here base it off of slot number and don't really give the option to check if you have a certain pokemon or not. For example. One will let you choose any pokemon to evolve into what you want and the other bases it on what slot number the pokemon is in. I need a code that will change a specific pokemon's index number or even making it "evolve" silently.
    For silent evo you'd better take a look at FBI's routine which is also posted under this thread.

    If you still want to use my routine:
    Spoiler:


    (I posted detailed explanation because several people asked me about that routine. )
     
    Last edited:
    62
    Posts
    5
    Years
  • No, no! Use a modified one.
    Here:

    Spoiler:


    That one uses the variable 0x8002 to determine it's evolution. You can use it to evolve into a specific evolution that way. Or be silly and evolve Rattata into a Venasaur :3


    Mini update:

    Remember how the TMs were showing quantities? Well I fixed that now. I'll edit my original post with the details as well. Here it is:

    Compile and insert into free space:
    Spoiler:


    Now navigate to 0x131EF4 and insert:
    Code:
    00 48 00 47 XX XX XX 08
    Where XX XX XX is the pointer to where you assembled the routine +1

    Now navigate to 0x131EA5 and change the byte to E0
    That's all.
    3nina1p.png

    So I'm having an issue using both codes when using them. The first code only works on pokemon that are not part of my expanded dex, as well as it doesn't work on custom evolutions for some reason. For example, I use it on deoxys to try to evolve it to some random pokemon and it just freezes the game upon execution.

    The second code works for my expanded mons, but for some reason, when I use it on expanded pokemon it changes the pokemon's name. For example I evolved clefairy into Ribombee and its name turned into SHADOW PU lol what is going on here?
     
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    Hi, I'm new here, don't know if this has been said already, but I've been working on my own hack for a while, I've been stuck at this one thing, i made the evolution stones like water stone, etc, cost like 20,000 pokedollars, but when i go to buy them, i see they cost ?000...when i select it, it shows it's 20,000, i just would like to increase the length of the prices to show 5 digits, i followed the advice of a person named Touched, he said to change 04 to 05 at some offset i cant remeber right now...i changed it to 05 but the game froze, changed it back to 04 and the game went back to normal. Please help me, anyone, I'm doing fire red
     

    RichterSnipes

    Not even a nibble...
    513
    Posts
    12
    Years
  • Hi, I'm new here, don't know if this has been said already, but I've been working on my own hack for a while, I've been stuck at this one thing, i made the evolution stones like water stone, etc, cost like 20,000 pokedollars, but when i go to buy them, i see they cost ?000...when i select it, it shows it's 20,000, i just would like to increase the length of the prices to show 5 digits, i followed the advice of a person named Touched, he said to change 04 to 05 at some offset i cant remeber right now...i changed it to 05 but the game froze, changed it back to 04 and the game went back to normal. Please help me, anyone, I'm doing fire red
    This isn't really the place to ask these questions. This thread is about developing ASM routines to add/modify functions to the game. The Quick Research & Development Thread is what you're looking for.

    Your answer seems to be there, too! Try following this post and see if it fixes your problems.
     
    Last edited:
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    Thanks Ritcher! I thought I could ask here because I thought I needed an ASM code or something, but now I see I just needed to change 3 different value not just two. Thanks I did get the result I needed. And thanks to all you guys being so great at all this ASM coding and being so helpful with your great skill of programming!
     

    RichterSnipes

    Not even a nibble...
    513
    Posts
    12
    Years
  • Thanks Ritcher! I thought I could ask here because I thought I needed an ASM code or something, but now I see I just needed to change 3 different value not just two. Thanks I did get the result I needed. And thanks to all you guys being so great at all this ASM coding and being so helpful with your great skill of programming!
    No problem, glad to be of help!

    Anyways, I've got my own idea. I don't know how much anyone cares to implement something like this, or if it's even possible. It's a pretty crazy thing to begin with. I'll still ask nonetheless.

    Would it be possible to modify the GBA games to have two dedicated save files for two different people? The games already use all the space for a second save file to store a backup save. If possible, why not make a more practical use for it?

    I know that this would cause problems with functions that don't require you to load up a save first, such as New Game, Options, Mystery Gift, GameCube to Game Boy Advance linking, migrating Pokémon to the Gen IV games, and save editing. My idea would be to make it so the most recently used save is the "active" save file. This way these functions interface with the active save, the Options menu reflects the settings of the active user, and New Game will save over the active save. Or, alternatively, change the New Game saving situation to be like the later games where you have to delete a save first. Then you can change the active save by loading up the "secondary" save file, which would now push the other save into secondary status.

    I've always loved the idea of having multiple save files on one Pokémon cartridge. I know that it'll never be a feature in the official games, early on because of technical reasons (the first couple of generations couldn't handle it) and later on strictly for monetary reasons (buy more copies of the games!). But it'd still be a watershed moment in my eyes for it to become a reality.
     
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    No problem, glad to be of help!

    Anyways, I've got my own idea. I don't know how much anyone cares to implement something like this, or if it's even possible. It's a pretty crazy thing to begin with. I'll still ask nonetheless.

    Would it be possible to modify the GBA games to have two dedicated save files for two different people? The games already use all the space for a second save file to store a backup save. If possible, why not make a more practical use for it?

    I know that this would cause problems with functions that don't require you to load up a save first, such as New Game, Options, Mystery Gift, GameCube to Game Boy Advance linking, migrating Pokémon to the Gen IV games, and save editing. My idea would be to make it so the most recently used save is the "active" save file. This way these functions interface with the active save, the Options menu reflects the settings of the active user, and New Game will save over the active save. Or, alternatively, change the New Game saving situation to be like the later games where you have to delete a save first. Then you can change the active save by loading up the "secondary" save file, which would now push the other save into secondary status.

    I've always loved the idea of having multiple save files on one Pokémon cartridge. I know that it'll never be a feature in the official games, early on because of technical reasons (the first couple of generations couldn't handle it) and later on strictly for monetary reasons (buy more copies of the games!). But it'd still be a watershed moment in my eyes for it to become a reality.

    yes richter, I agree with you and your idea as well. My daughter is always playing my savefiles, luckily for the switch has different profiles so she plays her own pokemon go pikachu file while she doesnt mess with mine. It's a great feature!
     

    Sudonim

    Doing things that are completely unnecessary
    20
    Posts
    4
    Years
  • I'm going to go ahead and feel free to request something. So a while back i wanted to edit emerald to force only super effective moves to deal damage, and i figured the best way to do this was to edit the type chart. After doing that and playing the game, i quickly realized that editing the type chart also applies to status moves (e.g. Toxic, Growl, etc.) which is undesirable. I could have also edited the abilities for every Pokémon to have Wonder guard instead, but i feel like that's taking a lazy approach, and in that situation Slaking not having truant would make it even more over powered. So now that i have free time again i decided to come back to this project, and see if i can finally make this come to fruition. I would do this myself, but i don't understand ASM at all, and through my searching i haven't come up with any info about how i would even go about adding this rule in (I'm guessing it needs to be added to the damage calculation?).

    TL;DR Wonder Guard at all times while keeping abilities and status moves in tact.
     
    18
    Posts
    7
    Years
    • Seen Jan 7, 2024
    i have same issues in pokemon stadium i cant add new types due to next addresses being for moves animations , accuracy and evasion i dont know how to reallocate the chart
     
    46
    Posts
    17
    Years
    • Seen Jan 23, 2024
    Can someone please help me with the Sitrus Berry Updates for Pokemon Emerald? I'm a bit new to ASM and not sure if I should run an overworld script with callasm command in game somewhere to change the effect the Sitrus Berry has or if I insert the pointer somewhere else in the Rom to get the desired effect out of the ASM in the First Post.

    Diluting the process down to Hex and Free Space finding would be appreciated too!

    Right now I've got an ASM folder with the thumb compiler. What all would I then need to copy/paste save and convert to HEX? With such a HEX code I'd insert it into freespace ending in 0 and then where do I go from here?
     
    Last edited:
    788
    Posts
    17
    Years
    • Seen yesterday
    After spending way too much time tinkering with the build system and README, I can finally present:

    Move Item [FR]

    Black and White 2 introduced a feature where you can move items directly between two Pokémon in your party from within the party menu, rather than having to use the bag as middle man. This ports that feature to FR ROMs.

    bpre-move-item.gif
     
    Back
    Top