• 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

1
Posts
6
Years
    • Seen May 20, 2018
    Misc:

    A EV-IV Display Screen

    RENEWAL:
    Spoiler:

    The EV-IV display here looks fantastic! Unfortunately, I am unsure how to insert it into a ROM (Emerald).

    The readme file says I need to have "Devkitarm" and "make" installed and that "armips v0.8/0.9" is required.

    Mainly, I just have no clue what those programs are and how I would get them installed correctly in order to compile and insert this code into my ROM. I believe I MAY have Devkitarm installed (from using DizzyEgg's Emerald Battle Engine Upgrade), but I'm not sure about "make" nor "armips".

    Any help on this would be absolutely appreciated, otherwise it seems I may have a lot of basic research on my hands before I'm able to include this in my ROM (which I'm also unsure of where to start).
     
    2
    Posts
    6
    Years
    • Seen Jan 7, 2019
    Hi everyone. I was hoping someone could take a look at an asm routine and a script and tell me what i'm doing wrong. Here's the routine, originally made by FBI,

    Spoiler:


    It is meant to rename the player from the overworld, but if the name is invalid (contains spaces), is sets 0x800D to 0x1. Everything works, except that last part. If I put a space in the name, it acts as if the name is valid and continues without changing the name.

    Here is the script I wrote for it,

    Spoiler:


    Is it something wrong with the routine or my script?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Hi everyone. I was hoping someone could take a look at an asm routine and a script and tell me what i'm doing wrong. Here's the routine, originally made by FBI,

    Spoiler:


    It is meant to rename the player from the overworld, but if the name is invalid (contains spaces), is sets 0x800D to 0x1. Everything works, except that last part. If I put a space in the name, it acts as if the name is valid and continues without changing the name.

    Here is the script I wrote for it,

    Spoiler:


    Is it something wrong with the routine or my script?
    The validity check in the routine is very naive. It simply checks if the first character is a space, or no name was written. You'd have to do some sort of while loop or similar to validate spaces.
    Code:
    checkValidName:
    ldr r0, =(0x300500C)
    ldr r0, [r0]
    ldrb r2, [r0]
    cmp r2, #0xff
    beq invalid
    mov r1, #0x0
    
    loop:
    cmp r1, #0x13 @whatever max limit is for a name 0xff inclusive
    beq done
    add r0, r0, r1
    ldrb r2, [r0]
    cmp r2, #0x0
    beq invalid
    add r1, r1, #0x1
    b loop

    Something like that...
     
    Last edited:
    2
    Posts
    6
    Years
    • Seen Jan 7, 2019
    The validity check in the routine is very naive. It simply checks if the first character is a space, or no name was written. You'd have to do some sort of while loop or similar to validate spaces.
    Code:
    checkValidName:
    ldr r0, =(0x300500C)
    ldr r0, [r0]
    ldrb r2, [r0]
    cmp r2, #0xff
    beq invalid
    mov r1, #0x0
    
    loop:
    cmp r1, #0x13 @whatever max limit is for a name 0xff inclusive
    beq done
    add r0, r0, r1
    ldrb r2, [r0]
    cmp r2, #0x0
    beq invalid
    add r1, r1, #0x1
    b loop

    Something like that...

    Sorry that's actually what I meant, I just worded it poorly. In the original routine, if I type just a space and no name, it acts as though it is valid and then keeps the name the character had before.
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Inherit Pokeball from Mother (Emerald)

    I have ported this to Fire Red!

    Routine 1: Put 00 49 08 47 XX XX XX 08 at 0x46250
    Spoiler:


    Routine 2: Put 00 48 00 47 XX XX XX 08 at 0x46D10
    Spoiler:


    Routine 3: 00 4A 10 47 XX XX XX 08 at 0x46DD0
    Spoiler:


    I have also made a routine that will cause the PokeBall to be random. To use this:

    1. Don't insert Routine 1.
    2. Instead of Routine 2, insert the routine below.
    3. Insert Routine 3 normally.

    Routine: Put 00 48 00 47 XX XX XX 08 at 0x46D10
    Spoiler:
     
    41
    Posts
    7
    Years
    • Seen Dec 16, 2018

    Wild Pokemon With custom attacks


    Well, this took me longer than it should have lol. I initially just edited the wild Pokemon in RAM to have the moves I wanted, and used masterballs to capture it (i.e I didn't battle it).
    Then I got a PP problem where the PP didn't match, so I wrote a routine to try and fix the PP problem. Then I talked to a friend on IRC, and he pointed out that I should make sure the Pokemon has the same moves in battle. Yeah, needless to say it didn't lol. So I ended up hacking the wild pokemon generator.

    How to insert:

    First compile this ASM routine.
    ASM Routine:
    Spoiler:


    compiled version:
    Code:
    0F 4D 00 24 29 1C 09 78 00 29 13 D0 02 21 61 43 49 19 09 88 40 46 0B 4B 00 F0 10 F8 01 34 04 2C F0 D1 00 04 49 46 0D 0C 00 9B 07 49 48 45 06 D1 06 49 08 47 03 4B 00 F0 01 F8 F2 E7 18 47 08 47 B8 70 03 02 B1 E8 03 08 61 EA 03 08 57 EA 03 08

    Now go to 0x3EA46 and insert:
    Code:
    01 48 00 47 00 00 XX XX XX 08

    Where XX XX XX is the reverse hex pointer to where you inserted the previously compiled routine.

    How to use:
    Set var 0x8000 to 0x0 to disable.
    Variables 0x8000 to 0x8003 are the 4 custom attacks you want inserted.
    So to set the first attack of the wild Pokemon to firepunch, I would setvar 0x8000 0x7.

    Here's a present :3
    LjzUa9a.png


    EDIT: Attacks must be between 0x0-0xFFFF

    Just want to report that none of these is working.
     

    Delta231

    A noob
    681
    Posts
    7
    Years
  • 5,256
    Posts
    16
    Years
  • Stats on the Pokédex screen replacing the weight comparison


    QMVkkkn.png
    LpH11UN.png
    8pyCTYQ.png

    Code:
    .thumb
    
    @ credits to DoesntKnowHowToPlay and Squeetz
    
    .equ rom, 0x08000000
    .equ offset, 0x
    
    .org 0x10611E, 0xFF
    	.byte 0x43, 0xE0
    	
    .org 0x106370, 0xFF
    	.byte 0x0, 0x48, 0x0, 0x47
    	.word main + rom + 1
    
    .org 0x106530, 0xFF
    	.byte 0xCE, 0xE0
    	
    .org 0x452200, 0xFF
    	.byte 0xA
    
    .org offset, 0xFF
    main:
        mov r5, #4
        str r5, [sp]
        str r6, [sp, #4]
        mov r0, r10
        cmp r0, #0
        beq unknown_base_stats
    
    hp:
        mov r0, #0
        bl print_stat
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    atk:
        mov r0, #1
        bl print_stat
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    def:
        mov r0, #2
        bl print_stat
        mov r3, #18 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spa:
        mov r0, #4
        bl print_stat
        mov r3, #18 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spd:
        mov r0, #5
        bl print_stat
        mov r3, #32 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spe:
        mov r0, #3
        bl print_stat
        mov r3, #32 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    print_ability_one:
        ldr r0, [sp, #0x1C]
        mov r3, #0x1C
        mul r0, r3
        ldr r1, base_stats
    	ldr r1, [r1]
        mov r3, #0x16
        add r1, r1, r3
        add r1, r0, r1
        ldr r3, abilities
    	ldr r3, [r3]
        ldrb r2, [r1]
        mov r1, #0xD
        mul r1, r2
        add r2, r1, r3    
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        mov r3, #46
        str r3, [sp]
        mov r3, #0
        ldr r5, write_method
        bl call_via_r5
        
    print_ability_two:
        ldr r0, [sp, #0x1C]
        mov r3, #0x1C
        mul r0, r3
        ldr r1, base_stats
    	ldr r1, [r1]
        mov r3, #0x16
        add r1, r1, r3
        add r1, r0, r1
        ldrb r2, [r1, #1]
        ldrb r5, [r1, #0]
        ldr r3, abilities
    	ldr r3, [r3]
        cmp r2, r5
        beq return
        cmp r2, #0
        beq return
        mov r1, #0xD
        mul r1, r2
        add r2, r1, r3
        
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        mov r3, #60
        str r3, [sp]
        mov r3, #0
        ldr r5, write_method
        bl call_via_r5
        b return
        
    unknown_base_stats:
        mov r0, r1
        mov r1, #0
        ldr r2, str_unknown
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    return:
        mov r5, #0
        ldr r0, return_loc
        bx r0
        
    print_stat:
        push {lr}
        ldr r3, [sp, #0x20]
        mov r1, #0x1C
        mul r3, r1
        ldr r2, base_stats
    	ldr r2, [r2]
        add r2, r3
        add r2, r0
        ldrb r1, [r2]
        mov r4, r0
        ldr r0, fcode_buffer2
        mov r3, #0
        cmp r1, #99
        bhi no_leading_zeroes
        cmp r1, #9
        bhi one_leading_zero
    
    two_leading_zeroes:
        str r3, [r0]
        add r0, #1
    
    one_leading_zero:
        str r3, [r0]
        add r0, #1
    
    no_leading_zeroes:
        mov r3, #3
        ldr r5, int_to_str
        bl call_via_r5
        
        mov r2, r4
        ldr r0, displayed_string
        ldr r1, str_table
        lsl r2, r2, #2
        add r1, r2
        ldr r1, [r1]
        ldr r5, fdecoder
        bl call_via_r5
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        ldr r2, displayed_string
        pop {r5}
        
    call_via_r5:
        bx r5
    
    .align 2
        base_stats:             .word 0x1BC + rom
        abilities:              .word 0x1C0 + rom
        str_table:              .word table + rom
        str_unknown:            .word capture + rom
        fcode_buffer2:          .word 0x02021CD0
        displayed_string:       .word 0x02021D18
        int_to_str:             .word 0x08008E78|1
        fdecoder:               .word 0x08008FCC|1
        write_method:           .word 0x081047C8|1
        return_loc:             .word 0x08106380|1
    table:
    	.word stat_hp + rom
    	.word stat_atk + rom
    	.word stat_def + rom
    	.word stat_spe + rom
    	.word stat_spa + rom
    	.word stat_spd + rom
    	
    stat_hp:
    	.byte 0xC2, 0xCA, 0x0, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_atk:
    	.byte 0xBB, 0xE8, 0xDF, 0x0, 0xFD, 0x2, 0xFF 
    	
    stat_def:
    	.byte 0xBE, 0xD9, 0xDA, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spe:
    	.byte 0xCD, 0xE4, 0xD9, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spa:
    	.byte 0xCD, 0xE4, 0xBB, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spd:
    	.byte 0xCD, 0xE4, 0xBE, 0x0, 0xFD, 0x2, 0xFF
    	
    capture:
    	.byte 0xBD, 0xD5, 0xE4, 0xE8, 0xE9, 0xE6, 0xD9, 0x0, 0xDA, 0xE3, 0xE6, 0xFE, 0xE1, 0xE3, 0xE6, 0xD9, 0x0, 0xDD, 0xE2, 0xDA, 0xE3, 0xE6, 0xE1, 0xD5, 0xE8, 0xDD, 0xE3, 0xE2, 0xAB, 0xFF

    Thanks to DoesntKnowHowToPlay for the base routine which I slightly edited / optimised, and to Squeetz for making the routine into a form that can be applied as a patch.
     
    Last edited:

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • So I've extracted both Gnumake and devkitARM v45. I have the double battle code extracted as well. I've read the readmes for all these files and they definitely don't assume i'm a beginner. Has anyone ever done this and wanna do a quick step-by-step? Thanks again.
     
    75
    Posts
    10
    Years
  • Stats on the Pok?dex screen replacing the weight comparison


    QMVkkkn.png
    LpH11UN.png
    8pyCTYQ.png

    Code:
    .thumb
    
    @ credits to DoesntKnowHowToPlay and Squeetz
    
    .equ rom, 0x08000000
    .equ offset, 0x
    
    .org 0x10611E, 0xFF
    	.byte 0x43, 0xE0
    	
    .org 0x106370, 0xFF
    	.byte 0x0, 0x48, 0x0, 0x47
    	.word main + rom + 1
    
    .org 0x106530, 0xFF
    	.byte 0xCE, 0xE0
    	
    .org 0x452200, 0xFF
    	.byte 0xA
    
    .org offset, 0xFF
    main:
        mov r5, #4
        str r5, [sp]
        str r6, [sp, #4]
        mov r0, r10
        cmp r0, #0
        beq unknown_base_stats
    
    hp:
        mov r0, #0
        bl print_stat
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    atk:
        mov r0, #1
        bl print_stat
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    def:
        mov r0, #2
        bl print_stat
        mov r3, #18 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spa:
        mov r0, #4
        bl print_stat
        mov r3, #18 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spd:
        mov r0, #5
        bl print_stat
        mov r3, #32 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
         
    spe:
        mov r0, #3
        bl print_stat
        mov r3, #32 @ y co-ord
        str r3, [sp]
        mov r3, #0x2C @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    print_ability_one:
        ldr r0, [sp, #0x1C]
        mov r3, #0x1C
        mul r0, r3
        ldr r1, base_stats
    	ldr r1, [r1]
        mov r3, #0x16
        add r1, r1, r3
        add r1, r0, r1
        ldr r3, abilities
    	ldr r3, [r3]
        ldrb r2, [r1]
        mov r1, #0xD
        mul r1, r2
        add r2, r1, r3    
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        mov r3, #46
        str r3, [sp]
        mov r3, #0
        ldr r5, write_method
        bl call_via_r5
        
    print_ability_two:
        ldr r0, [sp, #0x1C]
        mov r3, #0x1C
        mul r0, r3
        ldr r1, base_stats
    	ldr r1, [r1]
        mov r3, #0x16
        add r1, r1, r3
        add r1, r0, r1
        ldrb r2, [r1, #1]
        ldrb r5, [r1, #0]
        ldr r3, abilities
    	ldr r3, [r3]
        cmp r2, r5
        beq return
        cmp r2, #0
        beq return
        mov r1, #0xD
        mul r1, r2
        add r2, r1, r3
        
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        mov r3, #60
        str r3, [sp]
        mov r3, #0
        ldr r5, write_method
        bl call_via_r5
        b return
        
    unknown_base_stats:
        mov r0, r1
        mov r1, #0
        ldr r2, str_unknown
        mov r3, #4 @ y co-ord
        str r3, [sp]
        mov r3, #0 @ x co-ord
        ldr r5, write_method
        bl call_via_r5
        
    return:
        mov r5, #0
        ldr r0, return_loc
        bx r0
        
    print_stat:
        push {lr}
        ldr r3, [sp, #0x20]
        mov r1, #0x1C
        mul r3, r1
        ldr r2, base_stats
    	ldr r2, [r2]
        add r2, r3
        add r2, r0
        ldrb r1, [r2]
        mov r4, r0
        ldr r0, fcode_buffer2
        mov r3, #0
        cmp r1, #99
        bhi no_leading_zeroes
        cmp r1, #9
        bhi one_leading_zero
    
    two_leading_zeroes:
        str r3, [r0]
        add r0, #1
    
    one_leading_zero:
        str r3, [r0]
        add r0, #1
    
    no_leading_zeroes:
        mov r3, #3
        ldr r5, int_to_str
        bl call_via_r5
        
        mov r2, r4
        ldr r0, displayed_string
        ldr r1, str_table
        lsl r2, r2, #2
        add r1, r2
        ldr r1, [r1]
        ldr r5, fdecoder
        bl call_via_r5
        ldr r1, [r7]
        add r1, #0x53
        ldrb r1, [r1]
        mov r0, r1
        mov r1, #0
        ldr r2, displayed_string
        pop {r5}
        
    call_via_r5:
        bx r5
    
    .align 2
        base_stats:             .word 0x1BC + rom
        abilities:              .word 0x1C0 + rom
        str_table:              .word table + rom
        str_unknown:            .word capture + rom
        fcode_buffer2:          .word 0x02021CD0
        displayed_string:       .word 0x02021D18
        int_to_str:             .word 0x08008E78|1
        fdecoder:               .word 0x08008FCC|1
        write_method:           .word 0x081047C8|1
        return_loc:             .word 0x08106380|1
    table:
    	.word stat_hp + rom
    	.word stat_atk + rom
    	.word stat_def + rom
    	.word stat_spe + rom
    	.word stat_spa + rom
    	.word stat_spd + rom
    	
    stat_hp:
    	.byte 0xC2, 0xCA, 0x0, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_atk:
    	.byte 0xBB, 0xE8, 0xDF, 0x0, 0xFD, 0x2, 0xFF 
    	
    stat_def:
    	.byte 0xBE, 0xD9, 0xDA, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spe:
    	.byte 0xCD, 0xE4, 0xD9, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spa:
    	.byte 0xCD, 0xE4, 0xBB, 0x0, 0xFD, 0x2, 0xFF
    	
    stat_spd:
    	.byte 0xCD, 0xE4, 0xBE, 0x0, 0xFD, 0x2, 0xFF
    	
    capture:
    	.byte 0xBD, 0xD5, 0xE4, 0xE8, 0xE9, 0xE6, 0xD9, 0x0, 0xDA, 0xE3, 0xE6, 0xFE, 0xE1, 0xE3, 0xE6, 0xD9, 0x0, 0xDD, 0xE2, 0xDA, 0xE3, 0xE6, 0xE1, 0xD5, 0xE8, 0xDD, 0xE3, 0xE2, 0xAB, 0xFF

    Thanks to DoesntKnowHowToPlay for the base routine which I slightly edited / optimised, and to Squeetz for making the routine into a form that needs less proir hex editing to insert.

    I like this idea, it looks great the pokedex .. when this list the routine you leave the explanation of how to insert it: D
     
    5,256
    Posts
    16
    Years
  • I like this idea, it looks great the pokedex .. when this list the routine you leave the explanation of how to insert it: D

    Type in the offset you wish to insert the routine at next to the .equ offset, 0x keyword in the .asm file. Save the .asm file, and then assemble it using a thumb assembler. Open the produced .bin file in a hex editor, along with your ROM. Go to each .org keyword in the routine, and copy the address beside it (for example, 10611E). Go to each of these addresses in both your ROM and .bin file, and copy the non-FF bytes from the .bin file to the same location as your ROM. Repeat this until you've made all of these changes. Then go to the offset you typed at the top of the routine, next to .equ offset, 0x, and, again, copy the bytes from the .bin file to your ROM. Save your changes, and test in game.

    I hope that helps.
     
    Last edited:
    75
    Posts
    10
    Years
  • Type in the offset you wish to insert the routine at next to the .equ offset, 0x keyword in the .asm file. Save the .asm file, and then assemble it using a thumb assembler. Open the produced .bin file in a hex editor, along with your ROM. Go to each .org keyword in the routine, and copy the address beside it (for example, 10611E). Go to each of these addresses in both your ROM and .bin file, and copy the non-FF bytes from the .bin file to the same location as your ROM. Repeat this until you've made all of these changes. Then go to the offset you typed at the top of the routine, next to .equ offset, 0x, and, again, copy the bytes from the .bin file to your ROM. Save your changes, and test in game.

    I hope that helps.

    1.- Copy and paste the routine in a text editor.

    2- On the line where it says ".equ offset, 0x" I put the address (in my case it is B00000)

    3.- I keep the routine and name it as .asm (in my case, Dex.asm)

    4.- I go to the thumb folder and I put my Dex.asm to Dex.bin

    5.- Then I open with HxD a clean rom and the Dex.bin

    .....

    Until this step can I understand .. what should I do now? explain me with a little more detail and I hope I do not bother much ...
     
    Last edited:

    Lance Koijer 2.0

    Lance Koijer
    105
    Posts
    6
    Years
  • I have modified and enhanced azurile13's (credits and kudos to him) routine to make this supported on the Compiler's THUMB.bat. These are the things I modified:
    • Added routines creating the hooks that are to be copy-pasted on their respective locations. There are 11 hooks.
    • Added the master location of the routine in which the hooks will create locations for those routines. Insert your free space on .equ MyLoc. Format: 0x###### (Hexadecimal Number)
    • Created and added a new index list of Pokémon up to Generation VI including the formes in style of KDS/Chacha Dinosaur from the filenames of MrDollSteak's sprites in his Sugimori and Gen VI threads. I think there is no master index list for Generation VII. If there is, please PM me and I will add those.
    • With the list created as stated above, you will just have to create your own Regional Pokédex by copy-pasting from your Excel and Notepad file to below "regional_dex_order" and .hword 0x0000 should be first in the list. Make sure the names are all CAPS-LOCKED. In case of Nidorans, Farfetch'd, Mr. Mime, Ho-Oh, Mime Jr., Porygon-Z, and Flabébé, their characters are changed so you'll have to look for them in the master list. NOTE: Cohagrigus have been filtered out and changed into asterisks (*). Remember to correct its name before generating the binary file otherwise the .asm file won't work.

    Custom Regional Pokédex for FireRed:
    Spoiler:

    hello... it was indeeed a nice recoding of yours...

    I have questions though, does the byte on the equ. part is the actual index number of that Pokémon or that is what can be seen in National Dex. I have, however, made the arrangement that all mons first and the the forms will be the last slot.. by doing that, do I have to edit the index and replace it with the corresponding pokemon index?

    Also, does it support forms now? Liké Flabebe but they will share the same index number.

    EDIT: I have tried to compile all these to my THUMB Assembler but I got no luck because the code is too many that the compiler can't manage to assemble lol. Is there anyway I can compile it? I tried CMD and what I always get is error... tried piece-by-piece assembly but still the compiler can't process it.
     
    Last edited:
    5,256
    Posts
    16
    Years
  • 1.- Copy and paste the routine in a text editor.

    2- On the line where it says ".equ offset, 0x" I put the address (in my case it is B00000)

    3.- I keep the routine and name it as .asm (in my case, Dex.asm)

    4.- I go to the thumb folder and I put my Dex.asm to Dex.bin

    5.- Then I open with HxD a clean rom and the Dex.bin

    .....

    Until this step can I understand .. what should I do now? explain me with a little more detail and I hope I do not bother much ...

    Open your ROM (not a clean one, the one you actually want to insert it into) and Dex.bin in HxD.

    Go to 0x10611E in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x106370 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x106530 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x452200 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to the address you put next to .equ offset, 0xB00000. in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Save your ROM.
     
    Last edited:
    75
    Posts
    10
    Years
  • Open your ROM (not a clean one, the one you actually want to insert it into) and Dex.bin in HxD.

    Go to 0x10611E in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x106370 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x106530 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to 0x452200 in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Go to the address you put next to .equ offset, 0xB00000. in both Dex.bin and your ROM, copy the bytes from Dex.bin, and paste them in your ROM.
    Save your ROM.

    Muchaaaaas Gracias Hermano :D it worked perfectly
     

    Dr. Seuss

    Will finish GS Chronicles, I swear!
    523
    Posts
    10
    Years
  • I have a request. i'm not sure if that is possible or if it was already created, but. Is there a way to create a custom giveegg? I mean, I'd like to create an event that gives the player a Pokemon egg. and that egg will hatch with an specific shiny rate and custom moves. Like the Odd Egg you receive in GSC from the Day-care man that hatches knowing Dizzy Punch.
     
    Last edited:
    22
    Posts
    9
    Years
    • Seen Feb 1, 2020
    I have a request that I'm pretty sure it's possible. I want a routine that modify the giveitem command (or something similar) in order to give the specified amount in a var of certain item. Example: The var 0x8000 is set to 3, then execute the giveitem command and it gives 3 items.
     
    5,256
    Posts
    16
    Years
  • I have a request that I'm pretty sure it's possible. I want a routine that modify the giveitem command (or something similar) in order to give the specified amount in a var of certain item. Example: The var 0x8000 is set to 3, then execute the giveitem command and it gives 3 items.

    I'm fairly certain the giveitem command lets you do this already, certainly just additem should. Just use the variable number in place of the value.

    So for example:

    Code:
    setvar 0x8004 0xA
    giveitem ITEM_POTION 0x8004 MSG_OBTAIN

    would give you 10 Potions.
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • I'm fairly certain the giveitem command lets you do this already, certainly just additem should. Just use the variable number in place of the value.

    So for example:

    Code:
    setvar 0x8004 0xA
    giveitem ITEM_POTION 0x8004 MSG_OBTAIN

    would give you 10 Potions.

    I'm not sure about the giveitem command... However the givemoney command does have this problem in which you cannot give a variable as the value. The game takes the value of the variable number not what the variable itself is pointing to. This is a problem for me also, and I was wondering if it is a problem ASM can solve.
     
    Back
    Top