Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old January 1st, 2015 (1:15 PM). Edited February 18th, 2015 by daniilS.
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
     
    Join Date: Aug 2013
    Age: 18
    Gender: Male
    Posts: 409
    Alright, I have been asked to share the routines I made for form(e) changing in Platinum Red & Blue multiple times, and I finally found the time to do so. This thread will be updated as I clean up old routines and create new ones. Enjoy.

    Rotom & Deoxys
    Spoiler:
    This routine simply changes the index number of a Pokémon in your party.
    Code:
    .thumb
    
    getpokeoffset:
    	push {r4, lr}
    	ldr r0, var8004
    	ldrh r2, [r0]
    	mov r0, #100
    	mul r2, r0
    	ldr r0, poke_slot_1
    	add r4, r2, r0
    getandsetnewindexnumber:
    	ldr r2, var8005
    	mov r1, #0xB
    	mov r0, r4
    	ldr r3, pokemon_setattr
    	bl jump
    recalc20bytes:
    	mov r0, r4
    	ldr r3, pokemon_calc_effective_stats
    	bl jump
    	pop {r4, pc}
    jump:
    	mov pc, r3
    	
    .align 2
    	var8004:			.word 0x020270B8 + 0x8004 * 2
    	poke_slot_1:			.word 0x02024284
    	var8005:			.word 0x020270B8 + 0x8005 * 2
    	pokemon_setattr:		.word 0x0804037C
    	pokemon_calc_effective_stats:	.word 0x0803e47c
    
    /*insert anywhere. set var 0x8004 to the desired pokemon's slot and 0x8005 to the new index number, then callasm this routine+1.*/


    Burmy
    Spoiler:
    These routines will transform any Burmy that enters the battlefield according to the terrain.

    The first routine, burmytransformjump:
    Code:
    .thumb
    
    main:
    	ldr r3, burmytransform
    	mov pc, r3
    
    burmytransform:	.word 0x________	@address of burmytransform.asm here
    
    continue:
    	str r0, [sp]
    
    /*insert at 08030D40*/
    That routine loads a second routine, burmytransform:
    Code:
    .thumb
    
    getdex:
    	mov r1, #0xB
    	ldr r3, pokemon_getattr
    	bl jump
    	mov r6, r0
    	ldr r3, species_to_pokedex_index
    	bl jump
    compareburmy:
    	ldr r1, burmy_dex
    	cmp r0, r1
    	bne ender
    getform:
    	ldr r0, idx_for_battle_screen_elements_by_env
    	ldrb r0, [r0]
    	lsl r0, #0x1
    	ldr r2, area_to_burmy_cloak_table
    	add r2, r0
    	ldrh r0, [r2]
    	cmp r0, #0x0
    	beq ender
    burmeeeeeeeeeeeeeeeeeeh:
    	mov r0, r4
    	mov r1, #0xB
    	ldr r3, pokemon_setattr
    	bl jump
    ender:
    	mov r0, r6
    	ldr r3, return
    jump:
    	mov pc, r3
    	
    .align
    	pokemon_getattr:			.word 0x0803FBE8
    	species_to_pokedex_index:		.word 0x08043298
    	idx_for_battle_screen_elements_by_env:	.word 0x02022B50
    	area_to_burmy_cloak_table:		.word 0x________	@pointer to burmytable here
    	pokemon_setattr:			.word 0x0804037C
    	return:					.word 0x08030D48
    	burmy_dex:				.word ____		@dex number of burmy here
    
    /*insert anywhere. place a pointer to this routine in burmytransformjump.*/
    Now, this routine uses a so-called burmytable. It has ten halfword entries, being either zero or the index number of the following forms:
    Code:
    plant plant sandy 0000 0000 0000 sandy sandy trash plant
    Insert it anywhere, and place a pointer to it in the routine above.


    A note on spelling
    Spoiler:
    Please use the word forme for legendaries and form for other Pokémon. Thank you.
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old January 1st, 2015 (2:27 PM).
    Joexv's Avatar
    Joexv Joexv is offline
    WHO ARE YOU PEOPLE
    • Silver Tier
     
    Join Date: Oct 2012
    Location: Oregon
    Age: 20
    Gender: Male
    Nature: Sassy
    Posts: 1,024
    Oh my gosh you've finally RELEASED IT!!
    I hope you release the arceus forms soon.
    __________________
    I'm bored
    Jesus Christ is my Savior
    Bros with Percy

    My Rom hacks
    A New Dawn---Gentlemon
    Not in Production:
    Blackened Night---Holiday Hacks
    Reply With Quote
      #3    
    Old January 1st, 2015 (2:42 PM).
    Dark Zeta's Avatar
    Dark Zeta Dark Zeta is offline
    That guy you don't know yet
       
      Join Date: Dec 2014
      Location: Mississippi, U.S.
      Age: 23
      Gender: Male
      Nature: Lax
      Posts: 211
      I came home from work to this. I exploded from joy...

      I really can't wait for the rest, but I do have a question. Will you be doing the moves related to Rotom?
      __________________
      D&D Editor
      Romhack.me

      Twitter
      Reply With Quote
        #4    
      Old January 1st, 2015 (2:46 PM).
      daniilS's Avatar
      daniilS daniilS is offline
      busy trying to do stuff not done yet
         
        Join Date: Aug 2013
        Age: 18
        Gender: Male
        Posts: 409
        Quote:
        Originally Posted by joexv View Post
        Oh my gosh you've finally RELEASED IT!!
        I hope you release the arceus forms soon.
        Yup, they're next! :D
        Quote:
        Originally Posted by Dark Zeta View Post
        I came home from work to this. I exploded from joy...

        I really can't wait for the rest, but I do have a question. Will you be doing the moves related to Rotom?
        Nope, the moves can be handled from the script. Ask Bela if you want an example


        (by the way guys, an ugly version of this first routine has been available for quite some time :/)
        __________________
        Reply With Quote
          #5    
        Old January 2nd, 2015 (5:16 AM).
        LCCoolJ95's Avatar
        LCCoolJ95 LCCoolJ95 is offline
        Limited Capacity
           
          Join Date: May 2009
          Location: The World That Never Was
          Age: 22
          Gender: Male
          Nature: Naive
          Posts: 527
          ....I'm lost, what does this routine do, and how can I implement it?
          __________________
          "The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

          Pokémon Theta Emerald EX: https://www.pokecommunity.com/showthread.php?t=386240
          Reply With Quote
            #6    
          Old January 2nd, 2015 (5:18 AM).
          daniilS's Avatar
          daniilS daniilS is offline
          busy trying to do stuff not done yet
             
            Join Date: Aug 2013
            Age: 18
            Gender: Male
            Posts: 409
            Quote:
            Originally Posted by LCCoolJ95 View Post
            ....I'm lost, what does this routine do, and how can I implement it?
            It changes the index number of the Pokémon in party slot X (var 0x8004) to Y (var 0x8005). Instructions on how to implement it are in the last line of the routine, as always.
            __________________
            Reply With Quote
              #7    
            Old January 2nd, 2015 (6:55 AM).
            Lance32497's Avatar
            Lance32497 Lance32497 is offline
            LanceKoijer of Pokemon_Addicts
               
              Join Date: Aug 2014
              Location: Criscanto town-Ginoa Region xD
              Gender: Male
              Nature: Adamant
              Posts: 793
              so the script

              Quote:
              ...
              special 0x9F
              waitstate
              compare 0x8004 0x0
              if false goto @1
              setvar 0x8005 0x85
              callasm 0x800000
              ...
              by the way, thanks for this routine
              __________________
              This signature has been disabled.
              Scrollbar appears
              Please review and fix the issues by reading the signature rules.

              You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

              Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
              Reply With Quote
                #8    
              Old January 2nd, 2015 (8:30 AM).
              mkarthick98's Avatar
              mkarthick98 mkarthick98 is offline
              Tensai
                 
                Join Date: Oct 2014
                Location: India
                Gender: Male
                Nature: Lonely
                Posts: 44
                Yay, this is amazing! I have a doubt on this. Can I PM you?
                Reply With Quote
                  #9    
                Old January 2nd, 2015 (8:58 AM). Edited January 3rd, 2015 by daniilS.
                daniilS's Avatar
                daniilS daniilS is offline
                busy trying to do stuff not done yet
                   
                  Join Date: Aug 2013
                  Age: 18
                  Gender: Male
                  Posts: 409
                  Quote:
                  Originally Posted by Lance32497 View Post
                  so the script
                  by the way, thanks for this routine
                  I used this:
                  Code:
                  compare 0x8004 0x5
                  if 0x2 goto @end
                  Quote:
                  Originally Posted by mkarthick98 View Post
                  Yay, this is amazing! I have a doubt on this. Can I PM you?
                  Of course
                  __________________
                  Reply With Quote
                    #10    
                  Old January 2nd, 2015 (8:59 AM).
                  Dark Zeta's Avatar
                  Dark Zeta Dark Zeta is offline
                  That guy you don't know yet
                     
                    Join Date: Dec 2014
                    Location: Mississippi, U.S.
                    Age: 23
                    Gender: Male
                    Nature: Lax
                    Posts: 211
                    Quote:
                    Originally Posted by LCCoolJ95 View Post
                    ....I'm lost, what does this routine do, and how can I implement it?
                    It's very simple. Say you want to change Rotom to Wash Rotom. Well you use special 0x9F to choose the Rotom from your party and it is indexed at 0x10. Well this routine takes that Rotom and changes its index from 0x10 to whatever you set var 0x8005 to (we will use 0x11 in this case). Thus changing Rotom (0x10) to Wash Rotom (0x11).
                    Reply With Quote
                      #11    
                    Old January 2nd, 2015 (10:02 AM).
                    wally-217's Avatar
                    wally-217 wally-217 is offline
                       
                      Join Date: Nov 2012
                      Location: Yorkshire, UK
                      Gender: Male
                      Posts: 95
                      Apologies if this doesn't contribute much to the thread but when you say "Platinum Red & Blue", what do you mean by that? Which rom is this for?
                      - Thanks,
                      __________________
                      Reply With Quote
                        #12    
                      Old January 2nd, 2015 (10:06 AM).
                      daniilS's Avatar
                      daniilS daniilS is offline
                      busy trying to do stuff not done yet
                         
                        Join Date: Aug 2013
                        Age: 18
                        Gender: Male
                        Posts: 409
                        Quote:
                        Originally Posted by wally-217 View Post
                        Apologies if this doesn't contribute much to the thread but when you say "Platinum Red & Blue", what do you mean by that? Which rom is this for?
                        - Thanks,
                        By that I mean they're the routines used in this hack: link
                        Everything is just FR so far, until somebody ports it.
                        __________________
                        Reply With Quote
                          #13    
                        Old January 2nd, 2015 (3:41 PM).
                        Lance32497's Avatar
                        Lance32497 Lance32497 is offline
                        LanceKoijer of Pokemon_Addicts
                           
                          Join Date: Aug 2014
                          Location: Criscanto town-Ginoa Region xD
                          Gender: Male
                          Nature: Adamant
                          Posts: 793
                          Quote:
                          Originally Posted by daniilS View Post
                          I used this:
                          Code:
                          compare 0x8004 0x5
                          if 0x3 goto @end
                          Of course
                          I dont get it xD
                          what is 0x3?
                          __________________
                          This signature has been disabled.
                          Scrollbar appears
                          Please review and fix the issues by reading the signature rules.

                          You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

                          Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
                          Reply With Quote
                            #14    
                          Old January 2nd, 2015 (9:19 PM).
                          CosmicBlazer's Avatar
                          CosmicBlazer CosmicBlazer is offline
                          Batman
                             
                            Join Date: Jan 2013
                            Location: USA
                            Gender: Male
                            Posts: 193
                            Could this asm be used in a way to get Mega Evolutions? Just a theory. I dont know much about ASM xD so yeah.
                            __________________
                            Pokemon Cosmic: A New Threat

                            For God so loved the world, that he gave his only begotten Son, that who ever believe in him should not perish, but have everlasting life. - John 3:16

                            I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.[/sig-reason]
                            Reply With Quote
                              #15    
                            Old January 3rd, 2015 (3:34 AM).
                            daniilS's Avatar
                            daniilS daniilS is offline
                            busy trying to do stuff not done yet
                               
                              Join Date: Aug 2013
                              Age: 18
                              Gender: Male
                              Posts: 409
                              Quote:
                              Originally Posted by CosmicBlazer View Post
                              Could this asm be used in a way to get Mega Evolutions? Just a theory. I dont know much about ASM xD so yeah.
                              Not in its current form. Touched and I might create something for it later.
                              __________________
                              Reply With Quote
                                #16    
                              Old January 3rd, 2015 (4:53 AM).
                              Chacha Dinosaur's Avatar
                              Chacha Dinosaur Chacha Dinosaur is online now
                              Adamant and adaptive dinosaur.
                                 
                                Join Date: Jul 2013
                                Age: 23
                                Gender: Male
                                Posts: 454
                                Quote:
                                Originally Posted by daniilS View Post
                                Not in its current form. Touched and I might create something for it later.
                                Will you work on Stance Change?
                                Reply With Quote
                                  #17    
                                Old January 3rd, 2015 (4:57 AM).
                                daniilS's Avatar
                                daniilS daniilS is offline
                                busy trying to do stuff not done yet
                                   
                                  Join Date: Aug 2013
                                  Age: 18
                                  Gender: Male
                                  Posts: 409
                                  Quote:
                                  Originally Posted by KDS View Post
                                  Will you work on Stance Change?
                                  Maybe later, together with megas (and Cherrim)
                                  __________________
                                  Reply With Quote
                                    #18    
                                  Old January 3rd, 2015 (7:13 AM).
                                  CosmicBlazer's Avatar
                                  CosmicBlazer CosmicBlazer is offline
                                  Batman
                                     
                                    Join Date: Jan 2013
                                    Location: USA
                                    Gender: Male
                                    Posts: 193
                                    Quote:
                                    Originally Posted by daniilS View Post
                                    Not in its current form. Touched and I might create something for it later.
                                    Alright well good luck on it. Thanks for everything you contribute.
                                    __________________
                                    Pokemon Cosmic: A New Threat

                                    For God so loved the world, that he gave his only begotten Son, that who ever believe in him should not perish, but have everlasting life. - John 3:16

                                    I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this in your signature.[/sig-reason]
                                    Reply With Quote
                                      #19    
                                    Old January 3rd, 2015 (8:10 AM). Edited January 3rd, 2015 by daniilS.
                                    daniilS's Avatar
                                    daniilS daniilS is offline
                                    busy trying to do stuff not done yet
                                       
                                      Join Date: Aug 2013
                                      Age: 18
                                      Gender: Male
                                      Posts: 409
                                      Quote:
                                      Originally Posted by Lance32497 View Post
                                      I dont get it xD
                                      what is 0x3?
                                      I'm sorry, didn't see this one at first. Typo: I meant 0x2 , which means if greater than. Special 0x9F will return a party slot from 0 to 5, and 7 if no pokemon is selected.
                                      Also, for the full script you need to check if the selected pokemon is in fact a Rotom or Deoxys too, of course.

                                      EDIT: whoops, seems like I missed the fact that in Platinum you never actually have to select a Rotom or a Deoxys... :/
                                      Derp here, so I guess this would require one of FBI's routines instead.
                                      __________________
                                      Reply With Quote
                                        #20    
                                      Old January 3rd, 2015 (12:49 PM).
                                      Dark Zeta's Avatar
                                      Dark Zeta Dark Zeta is offline
                                      That guy you don't know yet
                                         
                                        Join Date: Dec 2014
                                        Location: Mississippi, U.S.
                                        Age: 23
                                        Gender: Male
                                        Nature: Lax
                                        Posts: 211
                                        Just a question.

                                        Will you be going all out on Shaymin's formes?
                                        __________________
                                        D&D Editor
                                        Romhack.me

                                        Twitter
                                        Reply With Quote
                                          #21    
                                        Old January 3rd, 2015 (1:25 PM).
                                        AtecainCorp.'s Avatar
                                        AtecainCorp. AtecainCorp. is online now
                                        Rejishan awake...
                                           
                                          Join Date: Jun 2008
                                          Location: Takoabe Town (Region Thonsu)
                                          Age: 24
                                          Gender: Male
                                          Nature: Hardy
                                          Posts: 1,266
                                          It was any possible to convert this code into RUBY or EMERALD?
                                          __________________
                                          - My new Project comming Soon
                                          Reply With Quote
                                            #22    
                                          Old January 3rd, 2015 (1:55 PM).
                                          daniilS's Avatar
                                          daniilS daniilS is offline
                                          busy trying to do stuff not done yet
                                             
                                            Join Date: Aug 2013
                                            Age: 18
                                            Gender: Male
                                            Posts: 409
                                            Quote:
                                            Originally Posted by Dark Zeta View Post
                                            Just a question.

                                            Will you be going all out on Shaymin's formes?
                                            Yes
                                            Quote:
                                            Originally Posted by Ksiazek Bartlomiej View Post
                                            It was any possible to convert this code into RUBY or EMERALD?
                                            Yes

                                            dangitpcwhydomypostsevenneedtobe25charactersthisisridiculous
                                            __________________
                                            Reply With Quote
                                              #23    
                                            Old January 3rd, 2015 (2:09 PM).
                                            BlackStorm20x's Avatar
                                            BlackStorm20x BlackStorm20x is offline
                                            idek
                                               
                                              Join Date: Apr 2014
                                              Gender: Male
                                              Nature: Quiet
                                              Posts: 476
                                              AWESOME. I'll need this for my hack. :D
                                              __________________
                                              Reply With Quote
                                                #24    
                                              Old January 3rd, 2015 (3:15 PM).
                                              Lance32497's Avatar
                                              Lance32497 Lance32497 is offline
                                              LanceKoijer of Pokemon_Addicts
                                                 
                                                Join Date: Aug 2014
                                                Location: Criscanto town-Ginoa Region xD
                                                Gender: Male
                                                Nature: Adamant
                                                Posts: 793
                                                Quote:
                                                Originally Posted by daniilS View Post
                                                I'm sorry, didn't see this one at first. Typo: I meant 0x2 , which means if greater than. Special 0x9F will return a party slot from 0 to 5, and 7 if no pokemon is selected.
                                                Also, for the full script you need to check if the selected pokemon is in fact a Rotom or Deoxys too, of course.

                                                EDIT: whoops, seems like I missed the fact that in Platinum you never actually have to select a Rotom or a Deoxys... :/
                                                Derp here, so I guess this would require one of FBI's routines instead.
                                                ahhhhh.... thanks I was just confused what and why 0x3
                                                __________________
                                                This signature has been disabled.
                                                Scrollbar appears
                                                Please review and fix the issues by reading the signature rules.

                                                You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

                                                Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
                                                Reply With Quote
                                                  #25    
                                                Old January 3rd, 2015 (3:56 PM).
                                                daniilS's Avatar
                                                daniilS daniilS is offline
                                                busy trying to do stuff not done yet
                                                   
                                                  Join Date: Aug 2013
                                                  Age: 18
                                                  Gender: Male
                                                  Posts: 409
                                                  Arceus and Giratina will have to wait because Game Freak ignored logic when coding the Pokémon Storage System. However, the first post has been updated for BURMY!
                                                  __________________
                                                  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 8:35 AM.