The PokéCommunity Forums Fan Games ROM Hacking Tools, Tutorials & Resources
Tutorial [FR/EM]Show item image when it added to the bag

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.


Reply
 
Thread Tools
  #1    
Old May 29th, 2017 (11:16 AM). Edited June 15th, 2017 by ~Andrea.
~Andrea's Avatar
~Andrea ~Andrea is offline
     
    Join Date: Oct 2012
    Gender: Male
    Posts: 180
    Good morning!
    These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
    Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!

    # 1 - Hook and Routine asm
    Spoiler:

    FIRE RED:
    Spoiler:
    Let's get to the offset 080F6F08 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.

    EMERALD:
    Spoiler:
    Let's get to the offset 081973E8 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.
    Next, go to the offset 08099738 and overwrite the bytes present with 00 00.

    Next we compile the following routine in a free offset within the rom:
    Spoiler:

    .equ GAMECODE_BPRE, 0
    .equ GAMECODE_BPEE, 1
    .equ GAMECODE_AXVE, 2

    .equ GAMECODE, 0

    .THUMB
    .ALIGN 2

    CMP R4, #1
    BNE END

    MOV R0, R5
    MOV R1, #3
    BL BOX

    PUSH {R0-R7}
    LDR R0, .SCRIPT
    LDR R0, [R0]
    LDR R1, .SCRIPT1
    LDR R2, .SCRIPT2
    CMP R0, R1
    BEQ LOAD
    CMP R0, R2
    BNE END_

    LOAD:
    LDR R0, .8007
    LDRH R0, [R0]
    LSL R0, R0, #3
    LDR R5, .TABLE
    ADD R5, R0
    LDR R0, [R5]
    LDR R1, .TILE
    SWI 0x12

    MOV R2, R1
    LDR R0, [R5, #4]
    LDR R1, .PAL
    SWI 0x12

    MOV R0, #0x7F
    LSL R0, R0, #8
    ADD R0, #0xFF
    STRH R0, [R1, #0x1E]

    MOV R0, R2
    MOV R6, #0x12
    LSL R6, R6, #5
    MOV R5, #0

    LOOP_:
    LDRB R1, [R0, R5]
    LDRB R2, [R0, R5]
    MOV R3, #0x0F
    MOV R4, #0xF0
    AND R1, R3
    AND R2, R4
    CMP R1, #0
    BNE LAST

    MOV R1, #0x0F

    LAST:
    LSR R3, R2, #4
    CMP R3, #0
    BNE CONTROL

    MOV R2, #0xF0

    CONTROL:
    ORR R2, R1

    ADD R5, #1
    CMP R5, #2
    BNE BYTE

    LSL R2, R2, #8
    ORR R7, R2
    STRH R7, [R0]
    ADD R0, #2
    MOV R5, #0
    B COUNTER

    BYTE:
    MOV R7, R2

    COUNTER:
    SUB R6, #1
    BPL LOOP_

    MOV R1, #0xD
    LSL R1, R1, #12
    ADD R1, R1, #1
    MOV R2, #2
    MOV R3, #2
    LDR R0, .RAW
    LOOP:
    STRH R1, [R0]
    ADD R0, #2
    ADD R1, #1
    SUB R2, #1
    BPL LOOP
    MOV R2, #2
    ADD R0, #0x3A
    SUB R3, #1
    BPL LOOP
    END_:
    POP {R0-R7}

    END:
    POP {R4, R5}
    POP {R0}
    BX R0

    BOX:
    PUSH {R0}
    LDR R0, .BOX
    MOV R10, R0
    POP {R0}
    BX R10

    .ALIGN 2
    .if GAMECODE==0
    .BOX: .word 0x08003F20+1
    .RAW: .word 0x02001C6E
    .PAL: .word 0x02037798
    .SCRIPT: .word 0x03000EC4
    .SCRIPT1: .word 0x081A6816
    .SCRIPT2: .word 0x081A6820
    .8007: .word 0x020370C0
    .TABLE: .word 0x083D4294
    .TILE: .word 0x06008020
    .elseif GAMECODE==1
    .BOX: .word 0x08003658+1
    .RAW: .word 0x02001C70
    .PAL: .word 0x02037CB4
    .SCRIPT: .word 0x03000E54
    .SCRIPT1: .word 0x08271C62
    .SCRIPT2: .word 0x08271C85
    .8007: .word 0x020375E0
    .TABLE: .word 0x08614410
    .TILE: .word 0x06008020
    .else
    .fail 0
    .endif

    In the asm routine, there is a red istruction:
    Quote:
    .equ GAMECODE, 0
    Put 1 if you want the routine will be compiled for emerald, otherwise leave 0 if you want the routine works on red fire.


    Important notes:
    - it's not compatible with Jpan's Hacked Engine, for now
    - The routine works only with the type message 1 (MSG_FIND) of the giveitem:
    Quote:
    giveitem 0xIndex 1 1
    #2 - Final Result:
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old June 3rd, 2017 (6:50 AM).
    Sakib66's Avatar
    Sakib66 Sakib66 is offline
       
      Join Date: Jan 2017
      Gender: Male
      Posts: 160
      I can't believe no one commented on this....Great Tutorial!
      Reply With Quote
        #3    
      Old June 3rd, 2017 (8:46 AM).
      RuFF's Avatar
      RuFF RuFF is offline
      Hope you're having a RuFF day!
         
        Join Date: Aug 2012
        Location: Philippines
        Age: 20
        Gender: Male
        Nature: Lonely
        Posts: 360
        I have a problem. Items given by NPC don't appear.
        __________________
        My Hack:
        Reply With Quote
          #4    
        Old June 4th, 2017 (7:58 PM).
        BluRose BluRose is offline
        blu rass
           
          Join Date: Apr 2014
          Location: hyakkoku city
          Age: 17
          Gender: Male
          Nature: Timid
          Posts: 737
          i was doing a quick lookover and saw no swi commands and had a heart attack
          and then i looked it over again and saw it anyways xD

          buen aporte~
          __________________
          am i cool yet
          Reply With Quote
            #5    
          Old June 15th, 2017 (4:20 AM).
          ~Andrea's Avatar
          ~Andrea ~Andrea is offline
             
            Join Date: Oct 2012
            Gender: Male
            Posts: 180
            Quote:
            Originally Posted by Sakib66 View Post
            I can't believe no one commented on this....Great Tutorial!
            Quote:
            Originally Posted by BluRose View Post
            i was doing a quick lookover and saw no swi commands and had a heart attack
            and then i looked it over again and saw it anyways xD
            buen aporte~
            Sakib66 and BluRose, thank you!

            Quote:
            Originally Posted by RuFF View Post
            I have a problem. Items given by NPC don't appear.
            Strange, did you apply Jpan's hacked Engine to your ROM?
            At the moment, the routine doesn't work with JHE...

            Small update: I've extended compatibility even with Emerald!
            __________________
            Reply With Quote
              #6    
            Old June 15th, 2017 (4:26 AM).
            RuFF's Avatar
            RuFF RuFF is offline
            Hope you're having a RuFF day!
               
              Join Date: Aug 2012
              Location: Philippines
              Age: 20
              Gender: Male
              Nature: Lonely
              Posts: 360
              Quote:
              Originally Posted by ~Andrea View Post
              Sakib66 and BluRose, thank you!


              Strange, did you apply Jpan's hacked Engine to your ROM?
              At the moment, the routine doesn't work with JHE...

              Small update: I've extended compatibility even with Emerald!
              Nope. I didn't use JPan's Hacked Engine.

              It works when the item is found on the ground but not when it is given by an NPC.

              EDIT: Well. I just read the OP and I realized it only works on MSG_FIND.
              __________________
              My Hack:
              Reply With Quote
                #7    
              Old June 16th, 2017 (6:11 PM).
              BlackWhiteRobin's Avatar
              BlackWhiteRobin BlackWhiteRobin is offline
                 
                Join Date: Sep 2012
                Age: 20
                Gender: Male
                Nature: Quirky
                Posts: 543
                Quote:
                Originally Posted by ~Andrea View Post
                Good morning!
                These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
                Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!

                # 1 - Hook and Routine asm
                Spoiler:

                FIRE RED:
                Spoiler:
                Let's get to the offset 080F6F08 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.

                EMERALD:
                Spoiler:
                Let's get to the offset 081973E8 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.
                Next, go to the offset 08099738 and overwrite the bytes present with 00 00.

                Next we compile the following routine in a free offset within the rom:
                Spoiler:

                .equ GAMECODE_BPRE, 0
                .equ GAMECODE_BPEE, 1
                .equ GAMECODE_AXVE, 2

                .equ GAMECODE, 0

                .THUMB
                .ALIGN 2

                CMP R4, #1
                BNE END

                MOV R0, R5
                MOV R1, #3
                BL BOX

                PUSH {R0-R7}
                LDR R0, .SCRIPT
                LDR R0, [R0]
                LDR R1, .SCRIPT1
                LDR R2, .SCRIPT2
                CMP R0, R1
                BEQ LOAD
                CMP R0, R2
                BNE END_

                LOAD:
                LDR R0, .8007
                LDRH R0, [R0]
                LSL R0, R0, #3
                LDR R5, .TABLE
                ADD R5, R0
                LDR R0, [R5]
                LDR R1, .TILE
                SWI 0x12

                MOV R2, R1
                LDR R0, [R5, #4]
                LDR R1, .PAL
                SWI 0x12

                MOV R0, #0x7F
                LSL R0, R0, #8
                ADD R0, #0xFF
                STRH R0, [R1, #0x1E]

                MOV R0, R2
                MOV R6, #0x12
                LSL R6, R6, #5
                MOV R5, #0

                LOOP_:
                LDRB R1, [R0, R5]
                LDRB R2, [R0, R5]
                MOV R3, #0x0F
                MOV R4, #0xF0
                AND R1, R3
                AND R2, R4
                CMP R1, #0
                BNE LAST

                MOV R1, #0x0F

                LAST:
                LSR R3, R2, #4
                CMP R3, #0
                BNE CONTROL

                MOV R2, #0xF0

                CONTROL:
                ORR R2, R1

                ADD R5, #1
                CMP R5, #2
                BNE BYTE

                LSL R2, R2, #8
                ORR R7, R2
                STRH R7, [R0]
                ADD R0, #2
                MOV R5, #0
                B COUNTER

                BYTE:
                MOV R7, R2

                COUNTER:
                SUB R6, #1
                BPL LOOP_

                MOV R1, #0xD
                LSL R1, R1, #12
                ADD R1, R1, #1
                MOV R2, #2
                MOV R3, #2
                LDR R0, .RAW
                LOOP:
                STRH R1, [R0]
                ADD R0, #2
                ADD R1, #1
                SUB R2, #1
                BPL LOOP
                MOV R2, #2
                ADD R0, #0x3A
                SUB R3, #1
                BPL LOOP
                END_:
                POP {R0-R7}

                END:
                POP {R4, R5}
                POP {R0}
                BX R0

                BOX:
                PUSH {R0}
                LDR R0, .BOX
                MOV R10, R0
                POP {R0}
                BX R10

                .ALIGN 2
                .if GAMECODE==0
                .BOX: .word 0x08003F20+1
                .RAW: .word 0x02001C6E
                .PAL: .word 0x02037798
                .SCRIPT: .word 0x03000EC4
                .SCRIPT1: .word 0x081A6816
                .SCRIPT2: .word 0x081A6820
                .8007: .word 0x020370C0
                .TABLE: .word 0x083D4294
                .TILE: .word 0x06008020
                .elseif GAMECODE==1
                .BOX: .word 0x08003658+1
                .RAW: .word 0x02001C70
                .PAL: .word 0x02037CB4
                .SCRIPT: .word 0x03000E54
                .SCRIPT1: .word 0x08271C62
                .SCRIPT2: .word 0x08271C85
                .8007: .word 0x020375E0
                .TABLE: .word 0x08614410
                .TILE: .word 0x06008020
                .else
                .fail 0
                .endif

                In the asm routine, there is a red istruction:

                Put 1 if you want the routine will be compiled for emerald, otherwise leave 0 if you want the routine works on red fire.


                Important notes:
                - it's not compatible with Jpan's Hacked Engine, for now
                - The routine works only with the type message 1 (MSG_FIND) of the giveitem:


                #2 - Final Result:
                Is there a way to change the x and y positioning of the sprite? I think looks a little too low. :/
                Reply With Quote
                  #8    
                Old June 17th, 2017 (3:00 AM).
                VoltYellow's Avatar
                VoltYellow VoltYellow is offline
                And then Everyone Dies™
                   
                  Join Date: Feb 2017
                  Location: IDK...GPS isn't working..
                  Gender: Male
                  Nature: Lonely
                  Posts: 681
                  Do you do this with a hex editor? If yes then please tell how
                  __________________

                  Somehow I find the world
                  more beautiful when. . . .
                  I'm alone. . . .

                  Credits to Ben for these Beautiful Templates!
                  Reply With Quote
                    #9    
                  Old June 17th, 2017 (5:57 AM).
                  Froosty's Avatar
                  Froosty Froosty is offline
                  The_Learner
                     
                    Join Date: Sep 2014
                    Location: Somewhere in this world.
                    Age: 20
                    Gender: Male
                    Nature: Brave
                    Posts: 541
                    Quote:
                    Originally Posted by Volty Shocks View Post
                    Do you do this with a hex editor? If yes then please tell how
                    Firstly you compile the asm routine provided,
                    and then do the byte changes in the hex editor as suggested,

                    If you dont know about inserting the asm codes then I strongly suggest you to learn that :)
                    __________________
                    Want to talk with me regarding Rom-hacking ??? Want to get access to my works exclusive than anywhere else ???
                    Click here to get in the discord server here where rom-hacking is a everyday talk and task.

                    Want to showcase your hack on discord server ??? Click here to get the dask done.

                    My works:
                    TOOL: TL's Quick Enhancer
                    TUTORIAL: Fire red habitat editing
                    TUTORIAL: Fire red Transparent text-box


                    | |
                    Reply With Quote
                      #10    
                    Old June 17th, 2017 (6:55 AM).
                    Sakib66's Avatar
                    Sakib66 Sakib66 is offline
                       
                      Join Date: Jan 2017
                      Gender: Male
                      Posts: 160
                      Quote:
                      Originally Posted by Volty Shocks View Post
                      Do you do this with a hex editor? If yes then please tell how
                      First compile the .asm file. Then you will see a .bin file. Open that with your Hex editor, copy those bytes and paste them in free space of your ROM
                      Reply With Quote
                        #11    
                      Old June 17th, 2017 (2:10 PM). Edited June 17th, 2017 by Sky0fBlades.
                      Sky0fBlades's Avatar
                      Sky0fBlades Sky0fBlades is offline
                         
                        Join Date: Jan 2017
                        Gender: Male
                        Nature: Mild
                        Posts: 63
                        Wow this is neat, thanks for sharing it. Any way to make it work with the other types such as the hidden Itemfinder items? Even if not, it's still great!

                        Edit: Unfortunately it appears to crash the game when picking up TMs in Emerald, not sure about the other games.
                        Reply With Quote
                          #12    
                        Old June 19th, 2017 (1:13 AM).
                        pokemontutorialTV's Avatar
                        pokemontutorialTV pokemontutorialTV is offline
                           
                          Join Date: Feb 2014
                          Location: Germany, Kaiserslautern
                          Gender: Male
                          Nature: Calm
                          Posts: 75
                          The routine is indeed cool - but senseless, when you cant change X&Y position and it dont showing up a seperate box in the background.
                          __________________
                          Making Youtube Videos about Pokémon.
                          _______________________________________________
                          Pokémon Zoisit:

                          _______________________________________________
                          My Youtube Channel with over 1000 videos to Pokémon: http://www.youtube.com/user/pokemontutorialTV
                          Reply With Quote
                            #13    
                          Old June 20th, 2017 (8:21 AM).
                          Criminon's Avatar
                          Criminon Criminon is offline
                          Pokemon: Aqua Blue
                             
                            Join Date: Aug 2012
                            Gender: Male
                            Posts: 243
                            This is great! Would it be possible to do other methods, or add customization to the ASM?

                            Would be good to see the poke portrait pop up with the item icon inside, or be able to change the x and y in the asm. Also I noticed someone said that it only appears with MSG find. Any way to make it work with all versions of acquiring items?
                            __________________
                            FC: 3582 - 9598 - 9978. Add me!
                            Reply With Quote
                              #14    
                            Old June 22nd, 2017 (11:40 PM).
                            ~Andrea's Avatar
                            ~Andrea ~Andrea is offline
                               
                              Join Date: Oct 2012
                              Gender: Male
                              Posts: 180
                              Quote:
                              Originally Posted by BlackWhiteRobin View Post
                              Is there a way to change the x and y positioning of the sprite? I think looks a little too low. :/
                              Quote:
                              Originally Posted by pokemontutorialTV View Post
                              The routine is indeed cool - but senseless, when you cant change X&Y position and it dont showing up a seperate box in the background.
                              At this time, being the object sprite is a tile, it is not possible to change the x/y coordinates if not 8 pixels.
                              So, even if I changed the coordinates, it would still be decentralized.
                              If we want to have the object sprite central, we should use two asm routines: the first to create an oam with the object's image, the second delete it when the message ends.
                              Unfortunately I'm denied with oam...

                              Quote:
                              Originally Posted by Sky0fBlades View Post
                              Wow this is neat, thanks for sharing it. Any way to make it work with the other types such as the hidden Itemfinder items? Even if not, it's still great!

                              Edit: Unfortunately it appears to crash the game when picking up TMs in Emerald, not sure about the other games.
                              Did you remember to put +1 in routine calloffset?

                              Quote:
                              Originally Posted by Criminon View Post
                              This is great! Would it be possible to do other methods, or add customization to the ASM?

                              Would be good to see the poke portrait pop up with the item icon inside, or be able to change the x and y in the asm. Also I noticed someone said that it only appears with MSG find. Any way to make it work with all versions of acquiring items?
                              I think it's possible, but it will lose all the automatism that has the routine; let me explain:
                              The routine works automatically, reading the index of the object and making it appear during the msgbox.
                              To show the portrait of a pokemon, which default isn't inside the ROM, for example, you should create a table with images and use a variable to decide which portrait to appear.
                              I think it's a pretty awkward thing...

                              In this period i'm very busy with the exams, as soon as, when i've some free time, i'll try to improve the routine by making it compatible for both types of message.
                              __________________
                              Reply With Quote
                                #15    
                              Old June 23rd, 2017 (2:21 PM).
                              Daman's Avatar
                              Daman Daman is offline
                              Former Douchebag
                                 
                                Join Date: Feb 2015
                                Location: North Carolina
                                Gender: Male
                                Nature: Rash
                                Posts: 181
                                This is amazing! Gotta give it a shot for sure.

                                Edit: Just realized you said this doesn't work with JPAN's engine. :(
                                __________________

                                Name: Boid
                                Adopt one yourself! @Pokémon Orphanage
                                Reply With Quote
                                  #16    
                                Old June 23rd, 2017 (2:58 PM).
                                ASDBUDDY's Avatar
                                ASDBUDDY ASDBUDDY is offline
                                The Derp
                                • EO
                                 
                                Join Date: Apr 2017
                                Location: aint gonna tell ya
                                Age: 17
                                Gender: Male
                                Nature: Docile
                                Posts: 338
                                Hey thanks this looks great! thanks a lot :)
                                __________________
                                https://discord.gg/bEwyPd7
                                Reply With Quote
                                  #17    
                                Old June 25th, 2017 (1:13 AM).
                                Nisarg's Avatar
                                Nisarg Nisarg is offline
                                   
                                  Join Date: Jan 2017
                                  Gender: Male
                                  Posts: 207
                                  Can we change the X and Y position of item image?
                                  the Y-cord looks low.
                                  __________________
                                  Reply With Quote
                                    #18    
                                  Old June 25th, 2017 (6:13 AM).
                                  Neon Skylar's Avatar
                                  Neon Skylar Neon Skylar is offline
                                     
                                    Join Date: May 2014
                                    Location: Venezuela n_n
                                    Gender: Male
                                    Posts: 53
                                    Quote:
                                    Originally Posted by ~Andrea View Post
                                    Good morning!
                                    These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
                                    Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!

                                    # 1 - Hook and Routine asm
                                    Spoiler:

                                    FIRE RED:
                                    Spoiler:
                                    Let's get to the offset 080F6F08 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.

                                    EMERALD:
                                    Spoiler:
                                    Let's get to the offset 081973E8 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.
                                    Next, go to the offset 08099738 and overwrite the bytes present with 00 00.

                                    Next we compile the following routine in a free offset within the rom:
                                    Spoiler:

                                    .equ GAMECODE_BPRE, 0
                                    .equ GAMECODE_BPEE, 1
                                    .equ GAMECODE_AXVE, 2

                                    .equ GAMECODE, 0

                                    .THUMB
                                    .ALIGN 2

                                    CMP R4, #1
                                    BNE END

                                    MOV R0, R5
                                    MOV R1, #3
                                    BL BOX

                                    PUSH {R0-R7}
                                    LDR R0, .SCRIPT
                                    LDR R0, [R0]
                                    LDR R1, .SCRIPT1
                                    LDR R2, .SCRIPT2
                                    CMP R0, R1
                                    BEQ LOAD
                                    CMP R0, R2
                                    BNE END_

                                    LOAD:
                                    LDR R0, .8007
                                    LDRH R0, [R0]
                                    LSL R0, R0, #3
                                    LDR R5, .TABLE
                                    ADD R5, R0
                                    LDR R0, [R5]
                                    LDR R1, .TILE
                                    SWI 0x12

                                    MOV R2, R1
                                    LDR R0, [R5, #4]
                                    LDR R1, .PAL
                                    SWI 0x12

                                    MOV R0, #0x7F
                                    LSL R0, R0, #8
                                    ADD R0, #0xFF
                                    STRH R0, [R1, #0x1E]

                                    MOV R0, R2
                                    MOV R6, #0x12
                                    LSL R6, R6, #5
                                    MOV R5, #0

                                    LOOP_:
                                    LDRB R1, [R0, R5]
                                    LDRB R2, [R0, R5]
                                    MOV R3, #0x0F
                                    MOV R4, #0xF0
                                    AND R1, R3
                                    AND R2, R4
                                    CMP R1, #0
                                    BNE LAST

                                    MOV R1, #0x0F

                                    LAST:
                                    LSR R3, R2, #4
                                    CMP R3, #0
                                    BNE CONTROL

                                    MOV R2, #0xF0

                                    CONTROL:
                                    ORR R2, R1

                                    ADD R5, #1
                                    CMP R5, #2
                                    BNE BYTE

                                    LSL R2, R2, #8
                                    ORR R7, R2
                                    STRH R7, [R0]
                                    ADD R0, #2
                                    MOV R5, #0
                                    B COUNTER

                                    BYTE:
                                    MOV R7, R2

                                    COUNTER:
                                    SUB R6, #1
                                    BPL LOOP_

                                    MOV R1, #0xD
                                    LSL R1, R1, #12
                                    ADD R1, R1, #1
                                    MOV R2, #2
                                    MOV R3, #2
                                    LDR R0, .RAW
                                    LOOP:
                                    STRH R1, [R0]
                                    ADD R0, #2
                                    ADD R1, #1
                                    SUB R2, #1
                                    BPL LOOP
                                    MOV R2, #2
                                    ADD R0, #0x3A
                                    SUB R3, #1
                                    BPL LOOP
                                    END_:
                                    POP {R0-R7}

                                    END:
                                    POP {R4, R5}
                                    POP {R0}
                                    BX R0

                                    BOX:
                                    PUSH {R0}
                                    LDR R0, .BOX
                                    MOV R10, R0
                                    POP {R0}
                                    BX R10

                                    .ALIGN 2
                                    .if GAMECODE==0
                                    .BOX: .word 0x08003F20+1
                                    .RAW: .word 0x02001C6E
                                    .PAL: .word 0x02037798
                                    .SCRIPT: .word 0x03000EC4
                                    .SCRIPT1: .word 0x081A6816
                                    .SCRIPT2: .word 0x081A6820
                                    .8007: .word 0x020370C0
                                    .TABLE: .word 0x083D4294
                                    .TILE: .word 0x06008020
                                    .elseif GAMECODE==1
                                    .BOX: .word 0x08003658+1
                                    .RAW: .word 0x02001C70
                                    .PAL: .word 0x02037CB4
                                    .SCRIPT: .word 0x03000E54
                                    .SCRIPT1: .word 0x08271C62
                                    .SCRIPT2: .word 0x08271C85
                                    .8007: .word 0x020375E0
                                    .TABLE: .word 0x08614410
                                    .TILE: .word 0x06008020
                                    .else
                                    .fail 0
                                    .endif

                                    In the asm routine, there is a red istruction:

                                    Put 1 if you want the routine will be compiled for emerald, otherwise leave 0 if you want the routine works on red fire.


                                    Important notes:
                                    - it's not compatible with Jpan's Hacked Engine, for now
                                    - The routine works only with the type message 1 (MSG_FIND) of the giveitem:


                                    #2 - Final Result:
                                    I'm learning a bit of asm, I already compile and use a hex editor, but I still lack a lot ... the question is that when I go to look for offset 081973E8 and 08099738 does not appear .. I put Control + G to search and it does not come out .. should we swap?
                                    Reply With Quote
                                      #19    
                                    Old June 25th, 2017 (6:18 AM).
                                    RuFF's Avatar
                                    RuFF RuFF is offline
                                    Hope you're having a RuFF day!
                                       
                                      Join Date: Aug 2012
                                      Location: Philippines
                                      Age: 20
                                      Gender: Male
                                      Nature: Lonely
                                      Posts: 360
                                      Quote:
                                      Originally Posted by Neon Skylar View Post
                                      I'm learning a bit of asm, I already compile and use a hex editor, but I still lack a lot ... the question is that when I go to look for offset 081973E8 and 08099738 does not appear .. I put Control + G to search and it does not come out .. should we swap?

                                      Just search 1973E8 and 99738 only
                                      __________________
                                      My Hack:
                                      Reply With Quote
                                        #20    
                                      Old June 26th, 2017 (9:25 PM).
                                      Sky0fBlades's Avatar
                                      Sky0fBlades Sky0fBlades is offline
                                         
                                        Join Date: Jan 2017
                                        Gender: Male
                                        Nature: Mild
                                        Posts: 63
                                        Quote:
                                        Originally Posted by ~Andrea View Post
                                        Did you remember to put +1 in routine calloffset?
                                        Yes, and it was working with other items such as Rare Candies, Potions, etc. However, when picking up a TM (in my case the Iron Tail TM in Meteor Falls), it resulted in a crash while the message box was showing; unlike the instant crash when not +1-ing the offset.
                                        Reply With Quote
                                          #21    
                                        Old November 9th, 2017 (8:08 AM).
                                        Lunos's Avatar
                                        Lunos Lunos is online now
                                        The Observer
                                           
                                          Join Date: Oct 2008
                                          Location: Montevideo (Uruguay)
                                          Gender: Male
                                          Nature: Lonely
                                          Posts: 1,521
                                          Quote:
                                          Originally Posted by Sky0fBlades View Post
                                          Yes, and it was working with other items such as Rare Candies, Potions, etc. However, when picking up a TM (in my case the Iron Tail TM in Meteor Falls), it resulted in a crash while the message box was showing; unlike the instant crash when not +1-ing the offset.
                                          I'm like 4 months and 1 or 2 weeks late, but I just tried this routine because of reasons and I'm getting the same result, except that something's also screwing up the ROM's initial event.
                                          When you exit the truck, your mom never comes out to greet you. You can move around freely and there's the truck which you can walk through perfectly fine. I even recorded a video about it.


                                          Did I screwed up somewhere or something?
                                          __________________
                                          Reply With Quote
                                            #22    
                                          Old November 27th, 2017 (10:48 AM). Edited November 27th, 2017 by Aiolia.leo.
                                          Aiolia.leo's Avatar
                                          Aiolia.leo Aiolia.leo is offline
                                             
                                            Join Date: Feb 2013
                                            Location: Ecruteak City
                                            Gender: Other
                                            Nature: Lonely
                                            Posts: 42
                                            Quote:
                                            Originally Posted by ~Andrea View Post
                                            Good morning!
                                            These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
                                            Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!

                                            # 1 - Hook and Routine asm
                                            Spoiler:

                                            FIRE RED:
                                            Spoiler:
                                            Let's get to the offset 080F6F08 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.

                                            EMERALD:
                                            Spoiler:
                                            Let's get to the offset 081973E8 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.
                                            Next, go to the offset 08099738 and overwrite the bytes present with 00 00.

                                            Next we compile the following routine in a free offset within the rom:
                                            Spoiler:

                                            .equ GAMECODE_BPRE, 0
                                            .equ GAMECODE_BPEE, 1
                                            .equ GAMECODE_AXVE, 2

                                            .equ GAMECODE, 0

                                            .THUMB
                                            .ALIGN 2

                                            CMP R4, #1
                                            BNE END

                                            MOV R0, R5
                                            MOV R1, #3
                                            BL BOX

                                            PUSH {R0-R7}
                                            LDR R0, .SCRIPT
                                            LDR R0, [R0]
                                            LDR R1, .SCRIPT1
                                            LDR R2, .SCRIPT2
                                            CMP R0, R1
                                            BEQ LOAD
                                            CMP R0, R2
                                            BNE END_

                                            LOAD:
                                            LDR R0, .8007
                                            LDRH R0, [R0]
                                            LSL R0, R0, #3
                                            LDR R5, .TABLE
                                            ADD R5, R0
                                            LDR R0, [R5]
                                            LDR R1, .TILE
                                            SWI 0x12

                                            MOV R2, R1
                                            LDR R0, [R5, #4]
                                            LDR R1, .PAL
                                            SWI 0x12

                                            MOV R0, #0x7F
                                            LSL R0, R0, #8
                                            ADD R0, #0xFF
                                            STRH R0, [R1, #0x1E]

                                            MOV R0, R2
                                            MOV R6, #0x12
                                            LSL R6, R6, #5
                                            MOV R5, #0

                                            LOOP_:
                                            LDRB R1, [R0, R5]
                                            LDRB R2, [R0, R5]
                                            MOV R3, #0x0F
                                            MOV R4, #0xF0
                                            AND R1, R3
                                            AND R2, R4
                                            CMP R1, #0
                                            BNE LAST

                                            MOV R1, #0x0F

                                            LAST:
                                            LSR R3, R2, #4
                                            CMP R3, #0
                                            BNE CONTROL

                                            MOV R2, #0xF0

                                            CONTROL:
                                            ORR R2, R1

                                            ADD R5, #1
                                            CMP R5, #2
                                            BNE BYTE

                                            LSL R2, R2, #8
                                            ORR R7, R2
                                            STRH R7, [R0]
                                            ADD R0, #2
                                            MOV R5, #0
                                            B COUNTER

                                            BYTE:
                                            MOV R7, R2

                                            COUNTER:
                                            SUB R6, #1
                                            BPL LOOP_

                                            MOV R1, #0xD
                                            LSL R1, R1, #12
                                            ADD R1, R1, #1
                                            MOV R2, #2
                                            MOV R3, #2
                                            LDR R0, .RAW
                                            LOOP:
                                            STRH R1, [R0]
                                            ADD R0, #2
                                            ADD R1, #1
                                            SUB R2, #1
                                            BPL LOOP
                                            MOV R2, #2
                                            ADD R0, #0x3A
                                            SUB R3, #1
                                            BPL LOOP
                                            END_:
                                            POP {R0-R7}

                                            END:
                                            POP {R4, R5}
                                            POP {R0}
                                            BX R0

                                            BOX:
                                            PUSH {R0}
                                            LDR R0, .BOX
                                            MOV R10, R0
                                            POP {R0}
                                            BX R10

                                            .ALIGN 2
                                            .if GAMECODE==0
                                            .BOX: .word 0x08003F20+1
                                            .RAW: .word 0x02001C6E
                                            .PAL: .word 0x02037798
                                            .SCRIPT: .word 0x03000EC4
                                            .SCRIPT1: .word 0x081A6816
                                            .SCRIPT2: .word 0x081A6820
                                            .8007: .word 0x020370C0
                                            .TABLE: .word 0x083D4294
                                            .TILE: .word 0x06008020
                                            .elseif GAMECODE==1
                                            .BOX: .word 0x08003658+1
                                            .RAW: .word 0x02001C70
                                            .PAL: .word 0x02037CB4
                                            .SCRIPT: .word 0x03000E54
                                            .SCRIPT1: .word 0x08271C62
                                            .SCRIPT2: .word 0x08271C85
                                            .8007: .word 0x020375E0
                                            .TABLE: .word 0x08614410
                                            .TILE: .word 0x06008020
                                            .else
                                            .fail 0
                                            .endif

                                            In the asm routine, there is a red istruction:

                                            Put 1 if you want the routine will be compiled for emerald, otherwise leave 0 if you want the routine works on red fire.


                                            Important notes:
                                            - it's not compatible with Jpan's Hacked Engine, for now
                                            - The routine works only with the type message 1 (MSG_FIND) of the giveitem:


                                            #2 - Final Result:
                                            Thanks for this enhancement. I'm having a little bit of troubles here tho. Wether it's a clear or not fire red rom, the image shown is with a transparent background and it shows your map behind. Like this below, any suggestions?

                                            Reply With Quote
                                              #23    
                                            Old December 14th, 2017 (7:22 AM). Edited December 17th, 2017 by pokemon pika pikachu.
                                            pokemon pika pikachu's Avatar
                                            pokemon pika pikachu pokemon pika pikachu is offline
                                               
                                              Join Date: Sep 2017
                                              Posts: 18
                                              Quote:
                                              Originally Posted by ~Andrea View Post
                                              Good morning!
                                              These days i saw an update of an Italian hack, where there was a very interesting feature, that is the loading the image of items when they added to the bag.
                                              Since it seemed like a nice thing to implement in our ROMs, today i'll explain how to do that!

                                              # 1 - Hook and Routine asm
                                              Spoiler:

                                              FIRE RED:
                                              Spoiler:
                                              Let's get to the offset 080F6F08 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.

                                              EMERALD:
                                              Spoiler:
                                              Let's get to the offset 081973E8 and overwrite bytes with 00480047XXXXXX08Instead of XX the offset of asm routine will be inserted in little endian.
                                              Next, go to the offset 08099738 and overwrite the bytes present with 00 00.

                                              Next we compile the following routine in a free offset within the rom:
                                              Spoiler:

                                              .equ GAMECODE_BPRE, 0
                                              .equ GAMECODE_BPEE, 1
                                              .equ GAMECODE_AXVE, 2

                                              .equ GAMECODE, 0

                                              .THUMB
                                              .ALIGN 2

                                              CMP R4, #1
                                              BNE END

                                              MOV R0, R5
                                              MOV R1, #3
                                              BL BOX

                                              PUSH {R0-R7}
                                              LDR R0, .SCRIPT
                                              LDR R0, [R0]
                                              LDR R1, .SCRIPT1
                                              LDR R2, .SCRIPT2
                                              CMP R0, R1
                                              BEQ LOAD
                                              CMP R0, R2
                                              BNE END_

                                              LOAD:
                                              LDR R0, .8007
                                              LDRH R0, [R0]
                                              LSL R0, R0, #3
                                              LDR R5, .TABLE
                                              ADD R5, R0
                                              LDR R0, [R5]
                                              LDR R1, .TILE
                                              SWI 0x12

                                              MOV R2, R1
                                              LDR R0, [R5, #4]
                                              LDR R1, .PAL
                                              SWI 0x12

                                              MOV R0, #0x7F
                                              LSL R0, R0, #8
                                              ADD R0, #0xFF
                                              STRH R0, [R1, #0x1E]

                                              MOV R0, R2
                                              MOV R6, #0x12
                                              LSL R6, R6, #5
                                              MOV R5, #0

                                              LOOP_:
                                              LDRB R1, [R0, R5]
                                              LDRB R2, [R0, R5]
                                              MOV R3, #0x0F
                                              MOV R4, #0xF0
                                              AND R1, R3
                                              AND R2, R4
                                              CMP R1, #0
                                              BNE LAST

                                              MOV R1, #0x0F

                                              LAST:
                                              LSR R3, R2, #4
                                              CMP R3, #0
                                              BNE CONTROL

                                              MOV R2, #0xF0

                                              CONTROL:
                                              ORR R2, R1

                                              ADD R5, #1
                                              CMP R5, #2
                                              BNE BYTE

                                              LSL R2, R2, #8
                                              ORR R7, R2
                                              STRH R7, [R0]
                                              ADD R0, #2
                                              MOV R5, #0
                                              B COUNTER

                                              BYTE:
                                              MOV R7, R2

                                              COUNTER:
                                              SUB R6, #1
                                              BPL LOOP_

                                              MOV R1, #0xD
                                              LSL R1, R1, #12
                                              ADD R1, R1, #1
                                              MOV R2, #2
                                              MOV R3, #2
                                              LDR R0, .RAW
                                              LOOP:
                                              STRH R1, [R0]
                                              ADD R0, #2
                                              ADD R1, #1
                                              SUB R2, #1
                                              BPL LOOP
                                              MOV R2, #2
                                              ADD R0, #0x3A
                                              SUB R3, #1
                                              BPL LOOP
                                              END_:
                                              POP {R0-R7}

                                              END:
                                              POP {R4, R5}
                                              POP {R0}
                                              BX R0

                                              BOX:
                                              PUSH {R0}
                                              LDR R0, .BOX
                                              MOV R10, R0
                                              POP {R0}
                                              BX R10

                                              .ALIGN 2
                                              .if GAMECODE==0
                                              .BOX: .word 0x08003F20+1
                                              .RAW: .word 0x02001C6E
                                              .PAL: .word 0x02037798
                                              .SCRIPT: .word 0x03000EC4
                                              .SCRIPT1: .word 0x081A6816
                                              .SCRIPT2: .word 0x081A6820
                                              .8007: .word 0x020370C0
                                              .TABLE: .word 0x083D4294
                                              .TILE: .word 0x06008020
                                              .elseif GAMECODE==1
                                              .BOX: .word 0x08003658+1
                                              .RAW: .word 0x02001C70
                                              .PAL: .word 0x02037CB4
                                              .SCRIPT: .word 0x03000E54
                                              .SCRIPT1: .word 0x08271C62
                                              .SCRIPT2: .word 0x08271C85
                                              .8007: .word 0x020375E0
                                              .TABLE: .word 0x08614410
                                              .TILE: .word 0x06008020
                                              .else
                                              .fail 0
                                              .endif

                                              In the asm routine, there is a red istruction:

                                              Put 1 if you want the routine will be compiled for emerald, otherwise leave 0 if you want the routine works on red fire.


                                              Important notes:
                                              - it's not compatible with Jpan's Hacked Engine, for now
                                              - The routine works only with the type message 1 (MSG_FIND) of the giveitem:


                                              #2 - Final Result:
                                              excuse me when i assembled the code it gave binaries in chinese lang can you help please.
                                              thx in advance.

                                              EDIT: found my mistake. sorry for the disturbance
                                              Reply With Quote
                                              Reply

                                              Quick Reply

                                              Join the conversation!

                                              Create an account to post a reply in this thread, participate in other discussions, and more!

                                              Create a PokéCommunity Account

                                              Sponsored Links
                                              Thread Tools

                                              Posting Rules
                                              You may not post new threads
                                              You may not post replies
                                              You may not post attachments
                                              You may not edit your posts

                                              BB code is On
                                              Smilies are On
                                              [IMG] code is On
                                              HTML code is Off

                                              Forum Jump


                                              All times are GMT -8. The time now is 2:48 PM.