• 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

39
Posts
7
Years
  • That is what happens when you just type make..

    You need to be in the "build" folder directory...

    Either use:
    cd C:/User/"computername"/Desktop/Build
    Then hit enter...
    Now use the "make" command and as long as you have everything else installed like DevkitArm and Cygwin then it will work like a charm.

    Hope this helps

    Thanks for the reply. I actually tried what you said but, unfortunately I'm still getting errors :(

    This is the problem that I'm getting:
    rMEPALf.png


    Judging by this message, I think the problem was on.... ...DevKitArm?

    I have those on my pc. As well as GNU Win and Cygwin. So, I dunno what's exactly the problem. ;-;
     

    Phantom Phoenix

    Lost on the road of life
    167
    Posts
    8
    Years
    • Age 27
    • ???
    • Seen Jul 1, 2020
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    Thanks for the reply. I actually tried what you said but, unfortunately I'm still getting errors :(

    This is the problem that I'm getting:
    rMEPALf.png


    Judging by this message, I think the problem was on.... ...DevKitArm?

    I have those on my pc. As well as GNU Win and Cygwin. So, I dunno what's exactly the problem. ;-;


    From what it looks like you need to add C:/Devkitarm/bin to the environment variables.
    In Windows 7 go to "Control Panel\All Control Panel Items\System" then click on
    Advance system settings then go to "Environment Variables" and click on it.

    Now go down to "System Variables" and find "Path" then in the path add ";C:/Devkitarm/bin" to the path, also if check to see if Cygwin is also in the path....

    Adding that to your environment variable will make it so you can call Devkitarm from the cmd.
    You should also check if Cygwin is also in the path...
    Without them in the environment variable path you wont be able to call them from the cmd.

    If this don't help look on youtube on adding environment variable... That's how I figured it out awhile back

    Hope this helps
     
    39
    Posts
    7
    Years

  • Used it. Thanks :) This feat Sir is awesome!! ^^

    If this don't help look on youtube on adding environment variable... That's how I figured it out awhile back

    Hope this helps

    Yassss!

    I did some 'googling' (w/c I should've done from the start :S) and end up on the mega evolution hack. I follow the instructions there on how to redirect(?) the environment variable and finally able to make it work. Although it's quiet troubling because I use Windows 10 and all the tuts (including YouTube) are for 7.

    Thank you. It helped me a lot. Happy Holidays ^^
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hey FBI, I know that maybe I shouldn't ask this being this directly and there's Visitor Profiles or MPs, but since it could benefit everyone I'll just go ahead: Do you think we'll ever see a freely usable Wonder Trade system or it'll stay exclusive to the community's ROM Hack forever?
     
    9
    Posts
    12
    Years
    • Seen Apr 27, 2023
    REQUEST -

    ASM for EMERALD

    * COIL script to work like CHARGE, where the next POISON move deals additional damage.

    * Dual typing "FIRE PUNCH", "THUNDER PUNCH", "ICE PUNCH", similar to how FLYING PRESS works.


    Thank you and Happy New Year!
     
    794
    Posts
    10
    Years
  • Hey FBI, I know that maybe I shouldn't ask this being this directly and there's Visitor Profiles or MPs, but since it could benefit everyone I'll just go ahead: Do you think we'll ever see a freely usable Wonder Trade system or it'll stay exclusive to the community's ROM Hack forever?

    First of all, it's not 'real' Wonder Trade but rather Random Pokemon Generator Trade.
    Secondly, the pokecommunity rom hack is open-sourced and all the code can be seen on github, including the trade system.
     
    9
    Posts
    12
    Years
    • Seen Apr 27, 2023
    This is not a request thread. You can do all of those changes yourself with DizzyEgg's Emerald Engine Upgrade.

    I know I can, I just don't know how, and I saw ppl making request in this thread already, I'm not demanding anything, just asking.

    Maybe for you it's easy, but I don't know how to create a string for those moves on the engine. I'm in fact making a hack rom using his tool, but I don't know how to make those 2 things.

    Would you mind making it or teaching me how to do it?
     
    Last edited:

    Trev

    [span="font-size: 8px; color: white;"][font="Monts
    1,505
    Posts
    11
    Years
    • Age 27
    • Seen Nov 15, 2023
    If you can't figure it out, the Move Resource Thread probably has an answer, as that thread is specifically focused towards the development and maintenance of moves. This thread is more for small, general ASM routines and not specifically geared towards solving move issues.
     
    457
    Posts
    10
    Years
    • Seen Apr 9, 2024
    Pokemon Emerald Multichoice Scrolling Box

    So, the mechanic for that is already implemented, we just have to repoint some tables. So let's get down to work.
    First, there's a table at 0x085B2CF0. Each entry is a pointer to text to be displayed in the box. One set consist of 16 options. This is important. Anyway, repoint to free space and change pointers to this table. It ends at 0x085B3030.

    Now, there's a jumptable at 0x813A156. It ends at 0x0813A19C. It has 12 entries, repoint it to free space. Now for every new set of options you want to add, you have to add a routine like this:
    Spoiler:

    Note that you can change parameters in those routines. Play with them and see which ones look the best for you. Now, every routine like that above, goes at the end of the repointed jumptable. There are 12-in game sets, so you'll start with 13. Change the byte at 0x813A148 to the amount of all sets.

    One more thing, even though the table of pointers to text can only hold 16 pointers, it doesn't mean you're limited to only that many options. You can go to 126 max, because 127 is treated as hitting B. How? Well, in the routine above set how many in total to the amount you want and ignore occupied slots. For example if you want your set to have 50 options, divide it by 16, so you get 3 and some remainder. That means this set occupies 4 places in the jumptable, like this:
    XX XX XX 08 00 00 00 00 00 00 00 00 00 00 00 00 NEW SET GOES HERE

    Using it in a script is easy, just do this:
    setvar 0x8004 slot in the jumptable (starts at 13, since 12 are already occupied in-game)
    special 0x1BE
    waitstate
    Result is stored in the 0x800D. First option chosen is 0, second is 1, and so on. Hitting B be is 0x7F.
    compare 0x800D 0x0
    if 0x1 goto @first_option
    ....
    compare 0x800D 0x7F
    if 0x1 goto @chose_cancel

    I hope everything's understandable. :)

    Sorry to ask like I'm too dumb, but I would like to understand more on how things are gotten. I think replacing stuff in the ASM code needs a further explanation... especially on the bold parts I want to clarify because when I change it into something (trying out 32 choices... or maybe less), none seem to be appearing right.

    Code:
    .text
    .thumb
    .thumb_func
    .align 2
    
    main:
        mov r0, #5
    [B]    strh r0, [r3, #8] @how many are displayed[/B] [I](Inserted the vanilla code and it actually showed 8 choices)[/I]
        mov r0, #8
    [B]    strh r0, [r3, #0xA] @how many are in total[/B] [I](Are there total 10? I'm wonder how to find out this one. If it's ten, it only scrolled 8 choices.)[/I]
        mov r0, #1
        strh r0, [r3, #0xC] @X coordinate
        mov r0, #1
        strh r0, [r3, #0xE] @Y coordinate
        mov r0, #9
        strh r0, [r3, #0x10] @unkown
        mov r0, #0xA 
    [B]    strh r0, [r3, #0x12] @box height, should be displayed * 2[/B] [I](If multiplied by 2, then it was 0x9. Where 0x9 came from?)[/I]
        mov r0, #0
        strh r0, [r3, #0x14] @unkown 
        strh r4, [r3, #0x26] @task id, don't change it
        pop {r4}
        pop {r0}
        bx r0
     
    2
    Posts
    7
    Years
    • Seen Jan 6, 2017
    Capturing a Trainer's Pokémon
    With a Specific Poké Ball
    Hello, when I insert the routine and follow the steps, this happens to me when I catch a pkm from a caster it becomes an egg and when I catch pkm the battle ends I hope they have the solution
     
    Last edited:

    Froosty

    The_Learner
    535
    Posts
    9
    Years
  • wanted to make a small request here.
    Spoiler:

    I wanted this feature to be ported to emerald as well..
    I think it would be only a short task of finding the proper pointers,
    so if anyone would do it..
    then not only me but other emerald hackers would also enjoy it :)
    so it my request :)
     
    10
    Posts
    7
    Years
    • Seen Apr 23, 2018
    anyone can please create/find a routine to create a clock (for fire red) That when the time runs out you will restart the mission?
     
    32
    Posts
    10
    Years
    • Seen Sep 1, 2021
    I found that how frustration when playing some Emerald hack with bad egg/event corruption caused by usage of unsafe flag/var.
    IDK if anyone had already port Jambo's routine to Emerald because I can't find any relevant post ATM.

    Emerald safe variables hack
    Spoiler:



    Emerald safe flag hack
    Spoiler:


    Pls tell me if any bug found.

    Hi, I tried expanding the variables and I noticed several sprite problems like this: (the bag is gone)
    ywS7ogi.png
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • smh nathan closing tabs like what the hell

    EXPANDING THE THING THAT MAKES NIDORAN'S/ILLUMISE'S MALE VARIANTS HATCH FROM EGGS
    based on a table

    first, the routine:
    Spoiler:
    usage:
    - table at the end has a structure:
    [hword] - species 1
    [hword] - species 2
    an egg that is supposed to be species 1 has a 50% chance of turning into species 2 (note at the bottom), and it NEEDS to end with FE FE 00 00 as it does in the example.
    - i included addresses for emerald and ruby as well. replace as desired (the hook address and the getparents routine address)
    - you need to know where you are going to insert the routine BEFORE compiling it; the table is placed right after the routine and is referenced as such.

    proof of concept:
    Spoiler:


    shoutouts to doesntknowhowtoplay for his research on the subject and to chaotix for initial testing and suggesting the idea of a table instead of some extremely inefficient shtuff that was originally going to happen.

    notes:
    - species 2 does not ever turn into species 1. so you're breeding your volbeat to get an illumise? you'll only ever get volbeat. just add an entry for volbeat to illumise.
    - if you want species 1 to turn into multiple species: i have been testing for literally five hours with the game running consistently at about 300% and have yet to see a phanpy come from my illumise. moral of the story: this code, even with modifications telling it to continue looping after setting the id, doesn't support 1 pokémon to multiple.
    i did however manage to get illumise and this after doing like a weird chain thing (illumise -> volbeat -> phanpy), but it negated volbeat, and no we'd not like that:
    Va3fqEl.png

    - not tested on bpee or axve but there is no reason it shouldn't work (axve is the same thing while bpee i think interchanges two different registers)
    - OH ALSO you have 0x2A bytes of unused space at 46070 for you to use for whatever! knock yourself out with all of that free space
     
    Last edited:

    Phantom Phoenix

    Lost on the road of life
    167
    Posts
    8
    Years
    • Age 27
    • ???
    • Seen Jul 1, 2020
    I know jpan's engine has a pedometer. But I don't know vanilla FR has one or not. So, here it is.
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    
    main:
    push { r0-r2,lr }
    mov r0, #0x5
    ldr r1, sav1_get_secure
    bl linker
    ldr r2 , var
    strh r0, [ r2 , #0x0 ]
    pop { r0-r2, pc }
    
    linker:
    bx r1
    
    
    .align 2
    sav1_get_secure:     .word 0x08054EC5
    var:                            .word 0x020370c0
    You can count players steps now! It will be stored in last result or var 800d after you callasm this routine.
    First asm :)
    Thanks to Touched for answering my noob asm questions.
     
    Last edited:
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    So I had a problem with buffering a 4byte number in a message script for viewing the players bank balance in my hack.

    I brought it up in a IRC and FBI had given me a basic routine but it wasn't complete or tailor made to my needs.
    Now I have fixed it all up to my needs and would like to share what I have.

    Spoiler:


    As it is it works rather well and have had no bugs so far that I can see at least.
    There might be a better way to do this but as it stands I haven't seen it.

    Also I am now putting all I have together and will release a custom Bank Account system that will include:
    Pokemart Inflation/Deflation, Battle Money to Var (can store up to 4bytes or 0xFFFF FFFF) depending on setflag 0x250, ATM, Buffer 4byte number (though it can only print max 0xFFFF FF7F), Account Interest, Withdraw/Deposit/Balance and Loans.

    Anyway hope this is helpful!
     

    Phantom Phoenix

    Lost on the road of life
    167
    Posts
    8
    Years
    • Age 27
    • ???
    • Seen Jul 1, 2020
    anyone can please create/find a routine to create a clock (for fire red) That when the time runs out you will restart the mission?


    You want a routine which will end/restart a mission if your given time is over?
    Not sure if this will help you but you can try this routine.
    Timer in FR
    Spoiler:

    info:
    1.This routine uses safe var 4011, 4012,8002 and flag 248 and 24c
    2. Flag 248 is used to start the timer
    3. 8002 is used to know how many minutes mission will continue
    How to use:
    1.insert this hook at 0x054894
    00480047 xx+1 yy zz (xx yy zz is where u inserted the routine)
    2.In The script which will start the timer based event you have to write this three line
    setvar 0x8002 0xXX (XX = the minutes you want event to run )
    setvar 0x4012 0xYY {YY = flag you want to set be if event is not finished in time )
    setflag 0x248 (start the timer)
    -------------------------------------
    Now that you have started the timer this routine will run every second and when your given time in var 8002 is over it will set a flag (which is also given in var 4012). Depending on that flag in var 4012 you can determine mission is over / restart the mission / time over can't redo the mission etc.
    Note: If player finishes the task in the mission you will obviously wouldn't want the timer to continue.So, clearflag 248 and 24C in that script
    .
     
    Last edited:
    Back
    Top