• 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

BLAx501!

Pokemon Flux
  • 80
    Posts
    10
    Years
    Hey FBI, it's been a looooooooong time I don't post anything here xD. Well. I've been thinking about something I couldn't solve and since I think it may be ASM-Related, I summon you :P

    I was wondering if it is possible to change from one map to another (like a warp or something) and keep the music that you started playing on the previous map.
     

    metapod23

    Hardened Trainer
  • 673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    I'm interested in inserting a Focus Sash that is reusable in Fire Red. What I mean by that is that the Focus Sash, rather than being consumed like berries, will stay held by the Pokémon, but will only activate if the user has all of its available HP. I don't like that it is a one use item lol. The Focus Band in Fire Red does the same thing, and you can change it so it always activates, but it would need to be changed to check the user's current HP with its current maximum HP.

    I don't really care if it replaces Focus Band in the game, because I find it to be relatively useless as an item due to its unreliability.

    Thanks in advance for anyone willing to help!
     

    Blah

    Free supporter
  • 1,924
    Posts
    11
    Years
    Is it possible to make an effect like Absorb, but which the percentage of recover HP can be chosen?
    I have a little idea on how to do this but i think the animation will not work.

    Is it possible to make a different track play for a last Pokémon like the Gym Leaders in Black and White/cut the HP sound off after a few beeps like X/Y? Or if Characteristic / colored text for +/- stats due to ability?

    I know I ask a lot of questions, but, these are things I wonder if it's possible to do.

    I'm interested in inserting a Focus Sash that is reusable in Fire Red. What I mean by that is that the Focus Sash, rather than being consumed like berries, will stay held by the Pokémon, but will only activate if the user has all of its available HP. I don't like that it is a one use item lol. The Focus Band in Fire Red does the same thing, and you can change it so it always activates, but it would need to be changed to check the user's current HP with its current maximum HP.

    I don't really care if it replaces Focus Band in the game, because I find it to be relatively useless as an item due to its unreliability.

    Thanks in advance for anyone willing to help!

    Hi, I specifically don't do graphical ASM or battle related things. Hopefully someone will hop in and help you three out. I can tell you everything you've asked for in indeed doable. You just need to find someone willing :)


    Hey FBI, it's been a looooooooong time I don't post anything here xD. Well. I've been thinking about something I couldn't solve and since I think it may be ASM-Related, I summon you :P

    I was wondering if it is possible to change from one map to another (like a warp or something) and keep the music that you started playing on the previous map.

    Hey, it is ASM related, but fairly easy to do if I'm thinking about it right. I'll look into it.

    For the bug where the TM gets consumed upon use after the animation:

    Insert: 00 00 00 00 at 0x124F78

    I'll update my TM post with this information too.
     

    El Diabeetus

    Amateur Voice Actor / ROM Editor ('Hacker')
  • 1,064
    Posts
    17
    Years
    • Age 30
    • Seen Jun 10, 2020
    Hi, I specifically don't do graphical ASM or battle related things. Hopefully someone will hop in and help you three out. I can tell you everything you've asked for in indeed doable. You just need to find someone willing :)




    Hey, it is ASM related, but fairly easy to do if I'm thinking about it right. I'll look into it.

    For the bug where the TM gets consumed upon use after the animation:

    Insert: 00 00 00 00 at 0x124F78

    I'll update my TM post with this information too.
    Very nice! Is it supposed to be 4 sets of 00 though? I went to that offset and they already were those numbers.
     

    Dionen

    deprived of sleep
  • 295
    Posts
    12
    Years
    Fire Red gives you one trainer card with 8 gym badges, but some hacks have more than 8 gyms/travels to different regions. Is it possible to create more than one sets of badges? and maybe changing the trainer card backdrop/tileset with it. playing as a different person, stealing badges, there are many possibilities of events with it. It can be easily done with key-items, but come on, it's not the same thing. Well, just an idea. ^_^
    All badges are only in one image, so a swapping routine would deal with that, I suppose. The rest of it can be handled via scripts
     
    Last edited:
  • 51
    Posts
    9
    Years
    • Seen Nov 18, 2023
    Hello dude! (sorry for my english but i'm italian :S)
    For many days (ehm...months xD) I try to create a new pokemon menù (the menù that appeared when you press "start"), to change the classical pokémon menù, and I want to change text with pictures (for example the picture of pokédex, or a ball for pokémon etc), and replace menù in the left of the game (however the upper side is ok, but the menù must be in horizontal in this case).
    Can you help me please?
     
  • 46
    Posts
    9
    Years
    • Seen Dec 16, 2015

    Adjusting Shiny encounter chance



    How to insert:

    Before compiling the routine look at the last line. There is a .word 0x8[RANDOM +1]. Change the content after the 0x8 to be a pointer to where you inserted RANDOM +1.

    Once you've done that, look for the line that says "mov r0, #0x1 @item ID". Change 0x1 to the Item ID for your Shiny charm item. If you don't have one implemented, delete these lines:
    Code:
    	mov r0, #0x1 @item ID
    	mov r1, #0x1
    	ldr r2, =(0x8099F40 +1)
    	bl linker
    	cmp r0, #0x0
    	beq normal
    	mov r0, #0xA
    	lsl r0, r0, #0x7
    	add r0, r0, #0x55 @1/1365 chance with shiny charm
    	b calcChance

    After you've done that, compile and insert the following routine into free space:

    Spoiler:


    Now navigate to 0x3DACE and insert the following byte changes:
    Code:
    00 00 00 4F 38 47 XX XX XX 08
    Where XX XX XX is the reverse hex pointer +1 to where you inserted this routine.


    Usage:

    It's Automagic, also happens to give the shiny chance to Pokemon in wild, trainer Pokemon, given Pokemon ect.

    Right now encounter chance is 1/4096 without shiny charm, and 1/1356 with it.

    Figured I'd ask you in the thread instead of on your profile. I've got the two prerequisites inserted but I can't seem to get this code to compile. I'm getting this error message every time:
    ShinyCharm.asm: 9 : Error: invalid immediate: 279 is out of range

    This is my script:
    Spoiler:


    Any idea why?
     

    Blah

    Free supporter
  • 1,924
    Posts
    11
    Years
    Figured I'd ask you in the thread instead of on your profile. I've got the two prerequisites inserted but I can't seem to get this code to compile. I'm getting this error message every time:


    This is my script:
    Spoiler:


    Any idea why?

    mov r0, #0x117 @item ID

    Mov can only load upto 0xFF. From there you need to derrive the number. Take a look at my second beginner tutorial to see how that problem is fixed. Here's the solution:

    Code:
    mov r0, #0xFF
    add r0, #0x18
     
  • 46
    Posts
    9
    Years
    • Seen Dec 16, 2015
    mov r0, #0x117 @item ID

    Mov can only load upto 0xFF. From there you need to derrive the number. Take a look at my second beginner tutorial to see how that problem is fixed. Here's the solution:

    Code:
    mov r0, #0xFF
    add r0, #0x18

    So replace the item ID line with those two lines, correct? I did that and I'm not encountering any shinys after running around for over an hour with the item. For testing purposes I changed it to a 1/1 chance and I'm still not finding any.
     

    Blah

    Free supporter
  • 1,924
    Posts
    11
    Years
    So replace the item ID line with those two lines, correct? I did that and I'm not encountering any shinys after running around for over an hour with the item. For testing purposes I changed it to a 1/1 chance and I'm still not finding any.

    You need the random number routine and the shiny generator routine I made. The three of them work in conjunction to make this effect happen. I know it works, because my test ROM is only shinies :x
     
  • 46
    Posts
    9
    Years
    • Seen Dec 16, 2015
    You need the random number routine and the shiny generator routine I made. The three of them work in conjunction to make this effect happen. I know it works, because my test ROM is only shinies :x

    That's the thing though, I have those inserted.

    I compiled the RNG code and put it at 74B7A4.

    Then I compile this shiny generator code and put it at 74B7E4:
    Spoiler:


    I then change the bytes at 3DB00 to 00 48 00 47 E5 B7 74 and at 3DAF6 to 00 00 02 E0

    Then I compile this shiny charm code and put it at 9F83A4:
    Spoiler:


    And I change the bytes at 3DACE 00 00 00 4F 38 47 A5 83 9F 08


    Anything stupid that I'm doing that's jumping out at you? I know I'm compiling them correctly...
     

    Blah

    Free supporter
  • 1,924
    Posts
    11
    Years
    That's the thing though, I have those inserted.

    I compiled the RNG code and put it at 74B7A4.

    Then I compile this shiny generator code and put it at 74B7E4:
    Spoiler:


    I then change the bytes at 3DB00 to 00 48 00 47 E5 B7 74 and at 3DAF6 to 00 00 02 E0

    Then I compile this shiny charm code and put it at 9F83A4:
    Spoiler:


    And I change the bytes at 3DACE 00 00 00 4F 38 47 A5 83 9F 08


    Anything stupid that I'm doing that's jumping out at you? I know I'm compiling them correctly...
    Try setting 0x8002 to 0xFF. See if it turns shiny. Lets continue this discussion in the ASM help thread or something. We're kind of de-railing on this thread's purpose. At any rate, this is a problem with something in your ROM/execution rather than the routines. I have this routine setup in my ROM, and I've used similar for chain fishing which as worked fine.
     

    Teh Blazer

    Divider of Zero
  • 776
    Posts
    15
    Years
    Does the party stat checker just check the stats of pokemon or can it actually alter them? Because I think something that can change the base stats of a pokemon (like add or subtract from the original value) would be pretty neat. :P
     
  • 3,044
    Posts
    9
    Years
    I can't get the Change OW thing to work. It always crashes after the intro. Btw, I tried it out several times.
     

    leyn09

    Truant Trainer
  • 84
    Posts
    13
    Years
    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.


    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

    I have a question regarding this routine. If the pokemon has two types, how or what will the game store it to 0x8000? I'm sorry, I'm new to this asm thing. :(
     
    Back
    Top