• 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

RichterSnipes

Not even a nibble...
513
Posts
12
Years
  • Yeah, Touched! Using Leaf Green instead of Fire Red is very creative! Why do you think Advanced Adventure is my favorite hack ever?
    Not to dogpile on this point, but hacking LeafGreen instead of FireRed isn't exactly that much of a revelation in most cases. If anything, most of the things done to FR can be ported to LG - including most, if not all, of the FR ASM routines in this thread - just by searching for equivalent offsets in it. If I were to create an entire game hack using FR as a base, then proceeded to port everything over to LG and release the hack just for that version, would that be considered revolutionary? Not only does it take extra effort by the hacker, it also causes an extra inconvenience to those who want to play the hack, as they'd be expecting it to be a hack of FR. The word "creative" might kind of fit in this situation, but it surely isn't convenient or intuitive.

    The only reason I personally do it is because of a key principle I'm holding for the specific work I'm doing. Even then, LG support is secondary to FR for me. If I was working on a "typical" Pokémon hack based on FR/LG, I wouldn't even consider using LG for a second.
     
    199
    Posts
    12
    Years
    • Seen Jul 18, 2016

    Pre-battle Mugshot Hack in BPEE


    I'm trying to make elite four rematches but I can only make it show the first palette (which is in the image you posted.)
    It works fine when I make a regular trainer use the mugshot but anything that uses the "elite four" trainer class just doesn't work.

    Anyway you can make it work with elite four trainer class too?
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    I'm trying to make elite four rematches but i can only make it show the first palette (which is in the image you posted.)
    It works fine when I make a regular trainer use the mugshot but anything that uses the "elite four" trainer class just doesn't work.

    Anyway you can make it work with elite four trainer class too?

    I think that's very simple. You can see a palette pointer table at 0x5C8FDC and that's the palettes for elites and champion (first 5 entries). You can modify them by using APE (all not LZ77 compressed).
    There will be boy player & girl player palette after that, but please ignore them as they're not used at all.


    /*=============================================================================================================================*/


    Things in the spoiler below are something need help and it may be better in the ASM help thread.
    Spoiler:
     
    Last edited:

    Blah

    Free supporter
    1,924
    Posts
    11
    Years

  • What a coincidence, this morning I was making an Rbox hack myself. As for yours, the function is too complicated. You can just define most of that stuff in the routine, also use a table to avoid those variable sets, as they can get expensive/annoying if you're manually updating the box often.

    What exactly are you trying to do here though?
     
    Last edited:

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    What a coincidence, this morning I was making an Rbox hack myself. As for yours, the function is too complicated. You can just define most of that stuff in the routine, also use a table to avoid those variable sets, as they can get expensive/annoying if you're manually updating the box often.

    What exactly are you trying to do here though?

    I'm inheriting your way to build a table for strings, and before I wrote this function I hadn't ever imagined that there will be so many parameters. :(
    I want to customize this function myself because many things of the original special function can't be controlled (even coordinates, which can be controlled in "multichoice" command in script)
    I think the size of the box is also important, so I've added that thing.
    For this thing
    0x8004: start_option_No.
    0x8005: arrow_position_in_current_box
    It's really not important, as most people set them to 0 so it won't cause problem.

    Anyway, could you help me solve the problem in the post?

    Edit: here're something I've commented on which may make you interested:
    Spoiler:

    Another thing: would you mind modifying (or deleting) the quote part in your reply to me, as it's quite long and I've placed it in a spoiler.
     
    Last edited:

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Temporarily disabling prize money from battle

    (Only works in FireRed)

    Here is a routine that will prevent you from getting money after you won a battle against a trainer. Good for tournament-style battles, where it makes no sense that you get or lose money.

    How to insert:

    Compile and insert this routine anywhere into free space:
    Spoiler:
    Now navigate to 0x0259E8 and insert following bytes:
    Code:
    00 48 00 47 XX XX XX 08
    Where XX XX XX is the location of the routine you inserted + 1.


    Next compile and insert this routine into free space:
    Spoiler:
    Finally navigate to 0x054BE0 and insert following bytes where XX XX XX is the location of the second routine +1:
    Code:
    00 48 00 47 XX XX XX 08
    This thing requires two routines, that's because the money gets reduced when you black out while the prize money is gained after the message appears. These are two different places so there have to be two different functions :P


    At last you should also want to remove the text that appears after winning/losing that informs you about the money you gained/lost. You need another routine for that. Compile and insert into free space:
    Spoiler:
    Now change the bytes at 0x032B44 to following (XX XX XX) is the location of this last routine:
    Code:
    00 48 00 47 XX XX XX 08
    How to use:

    In order to disable prize money you have to set the flag 0x203.
    If you want to reenable it just clear the flag and you will get money again.

    WOW! You're great thanks man!
     

    pokefreak890

    The One that will make everything great
    853
    Posts
    9
    Years
    • Seen May 18, 2023
    okay so the upgraded sturdy worked and now im trying to do no guard so i got to the point where i had to insert 00 49 08 47 xx xx xx 08 00 00 at 046754 and i did that and my offset is A0A1A8 but i did it reverse so it should be A9A1A0 so when i test it i miss but when i put 00 instead of 08 i dont miss but the game freezes plz help
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    All the codes are now on github and the auto-insertion is completed via armips.
    https://github.com/jiangzhengwenjz/Double_wild_battle

    Old post:
    Spoiler:
     
    Last edited:

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Scrolling Multi-choice boxes


    Multiple choice boxes have been a really cool, yet in my opinion, a very unmastered feature in ROM hacks. Most people use JPAN's patch to make multichoice boxes, others edit the existing ones in the ROM. However, it seems like there is no solution for when the multiple choice box needs to hold more than just 8 or so options. Most competent hackers seem to have the last option be something which opens another box. It seems clunky and quite troublesome, so I decided to hack it and make it support scrolling and customization :)

    Here are some things which are in some popular hacks which use a work around that can be avoided altogether with this hack:
    20.png
    7xjCAol.png
    CnolW43.png


    The hack in action:



    How to insert:

    Before getting started with the hack there is a little bit of setting up which is required.

    You need to set up a table of pointers somewhere in your ROM. This table will be a table of pointers to possible mulitchoice boxes in your ROM. Each pointer in that table will point to a location of another table. The second table will have pointers to 0xFF terminated strings which will appear in your multichoice box. Visually this is what it should look like:
    Spoiler:


    Once you've configured the above tables, take a look at the routine in the spoilers.
    Code:
    table:
    	.word 0x8[Location of your table, do not +1]
    Change this line according to wherever you put your first table.

    Once that's done compile and insert the routine into free word-aligned space!

    Spoiler:


    Now navigate to 080CB94C and insert the following byte changes:
    Code:
    00 49 08 47 XX XX XX 08
    Where XX XX XX is wherever you inserted this routine +1. Note that the trailing 08 may change depending on your ROM situation!


    Usage:

    So this is a hack of special 0x158. I've essentially fixed the hard coded table read, and removed limitters as well as recoded the size readings to read of a variable instead. So the script usage of this implementation is quite simple, yet there are some complications which arise along the way. I'll talk about those complications later and first describe usage!

    Code:
    Paramaters:
    var 0x8000 = which multichoice box should be shown from the table of multichoice boxes
    var 0x8001 = How many options are supposed to be shown
    var 0x8004 = leave as 0x0 for expected output. It does more, but don't play with it for now (I'll document it on a later day!).
    
    Return value:
    var 0x800D = Which option was selected, where 0x0 is the first option and 0x1 is the second options....ect.

    Sample script snipplet.
    Code:
    #dyn 0x740000
    #org @start
    lock
    faceplayer
    msgbox 0x874001B
    callstd MSG_NORMAL
    setvar 0x8000 0x0 'Use first multichoice box
    setvar 0x8001 0x12 ' First box has 18 options
    setvar 0x8004 0x0 ' standard
    special 0x158
    waitspecial
    release
    end
    
    #org 0x874001B
    = Hello here's some tough choices

    Note, after the waitspecial command finishes, variable 0x800D will have the selected option's index number inside it. From there you can do your own checks to verify which option the user had selected.

    Some usage requirements:

    - 0x8004 = 0. Keep it like this for now until I explain it more a later day. You can play with it too if you want, but it will likely cause a game crash.

    - The menu does not close unless the "B" button is pressed inplace of an option, OR the last option is selected. FR counters this by having an "EXIT" option as the last option of the multichoice box, and any scripts which use the multichoice box are looped as well. I have a fix for this:
    Code:
    @ 080CBB84 insert the following byte changes:
    @ 00 00 00 00
    So use this if you don't want to use the last option EXIT :)

    This is, indeed, an awesome hack and I had implemented it so great thanks FBI, but, I have a little suggestion about this hack, I don't know if it can be implemented by setting value in a certain var or whatever, it would be cool if we can set or change the Xpos and Ypos of the multibox and extend the height of it.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    This is, indeed, an awesome hack and I had implemented it so great thanks FBI, but, I have a little suggestion about this hack, I don't know if it can be implemented by setting value in a certain var or whatever, it would be cool if we can set or change the Xpos and Ypos of the multibox and extend the height of it.

    I've done some features in this post
     
    457
    Posts
    10
    Years
    • Seen Apr 9, 2024
    I dunno if someone already done this before, but... can I request for a routine that disables the registering of Pokemon into Pokedex, both Seen and Caught? It is just like when you encounter some such species in Battle Frontier/Subway/Maison, and PWT, then it will not register to Pokedex.
     

    mkarthick98

    Tensai
    44
    Posts
    9
    Years
  • Since people will be coming up with Mega Evolution hacks soon, I was wondering if there is a way to store all 40+ Mega stones in the bag. Would it be possible to hack the TM case and make something like a 'Mega Stone case', which can hold these stones?
     
    417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Since people will be coming up with Mega Evolution hacks soon, I was wondering if there is a way to store all 40+ Mega stones in the bag. Would it be possible to hack the TM case and make something like a 'Mega Stone case', which can hold these stones?
    I don't know the logistics of essentially creating a brand new pocket, but it isn't really necessary. You can just expand the regular items pocket. The bigger cost is finding 4 bytes for each unique item. I personally used JPAN's save research (not the "save block hack").
     
    116
    Posts
    16
    Years
  • Could I require a routine which can let the multiple Pokemon roaming at once in Emerald by using its original engine like the same as Gold/ Silver version? Thank you very much in advance.
     
    Last edited:

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • Hi Guys.
    I wanted to know if it would be somehow possible an ASM Routine to change the Main Character Overworld permanently, until you trigger another ASM which reverts that.

    Example:
    Item 1: Calls the 1st ASM which would change your Overworld permanently for another one, the main girl character for example.

    Item 2: Reverts what the first item did by triggering a 2nd asm.

    Would that be possible?
    I've just learned some hours ago, how to trigger a script through an item and the single idea of having clothes as Key Items sounds wonderful <3

    But the method with the Write Bytes to Offset is kinda "Meh", because it disappear when you refresh the map or use a warp, and it would be very annoying to put the whole WBtO thing in every single warp of the game >_< ..
     
    Last edited:

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Hi Guys.
    I wanted to know if it would be somehow possible an ASM Routine to change the Main Character Overworld permanently, until you trigger another ASM which reverts that.

    Example:
    Item 1: Calls the 1st ASM which would change your Overworld permanently for another one, the main girl character for example.

    Item 2: Reverts what the first item did by triggering a 2nd asm.

    Would that be possible?
    I've just learned some hours ago, how to trigger a script through an item and the single idea of having clothes as Key Items sounds wonderful <3

    But the method with the Write Bytes to Offset is kinda "Meh", because it disappear when you refresh the map or use a warp, and it would be very annoying to put the whole WBtO thing in every single warp of the game >_< ..

    one of JPAN Routine does that
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I don't know the logistics of essentially creating a brand new pocket, but it isn't really necessary. You can just expand the regular items pocket. The bigger cost is finding 4 bytes for each unique item. I personally used JPAN's save research (not the "save block hack").

    4 Bytes for more than 50 items, gg well played.
    A brand new pocket TM Case like sounds way too more organized.

    ON:
    My previous question still stands since i wasn't able to find JPAN's routine xD
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    Hi Guys.
    I wanted to know if it would be somehow possible an ASM Routine to change the Main Character Overworld permanently, until you trigger another ASM which reverts that.

    Example:
    Item 1: Calls the 1st ASM which would change your Overworld permanently for another one, the main girl character for example.

    Item 2: Reverts what the first item did by triggering a 2nd asm.

    Would that be possible?
    I've just learned some hours ago, how to trigger a script through an item and the single idea of having clothes as Key Items sounds wonderful <3

    But the method with the Write Bytes to Offset is kinda "Meh", because it disappear when you refresh the map or use a warp, and it would be very annoying to put the whole WBtO thing in every single warp of the game >_< ..

    Dunno if this will help you, but

    Multiple Characters

    Despite gender being binary in the games, there is actually an entire byte set aside for it in the second saveblock. You can change this byte with a simple ASM routine, e.g.

    Spoiler:

    Set it to zero for male and one for female. Use another byte for another for another character

    Note, this will break the script checkgender command! In order to restore it, you should first call checkgender, copy the value it returns in 0x800D to another unused var. Then set the gender using the above. Then you can restore it properly.

    Lastly, apply this hook (untested):

    Spoiler:
    You'll need to customise that table at the bottom. Each character you want must have its own 6 byte entry, even if you don't plan on using all the frames. The example entry above is a duplicate male character. Just change the bytes to the overworld sprites of your new character (the same in advance map when chooses a sprite for an NPC). Keep in mind you'll need running frames for the target character.

    This probably will only refresh when you change map, so use the next hack.

    Instant NPC sprite switch

    This is related to the last hack, but can be more useful for a less permanent change. It can also work on other NPCs. Callasm as usual with the NPC person number in 0x8000 (same ID you use with applymovement - and 0xFF for the player) and the target sprite (the sprite index you'd use in advance map) in 0x8001.

    Spoiler:
     
    Last edited:
    Back
    Top