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!

Draconius GO
Reply
 
Thread Tools
  #101    
Old December 14th, 2011 (8:55 PM).
Darthatron's Avatar
Darthatron Darthatron is offline
巨大なトロール。
  • Silver Tier
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 26
Gender: Male
Nature: Modest
Posts: 1,152
ArmoredGuns: Nah... I can't be bothered making a patch. Someone else can.

Quote:
Originally Posted by Agastya View Post
Darthatron's patch for Emerald works excellently, but there's a.. small, I guess, bug with Counter and Mirror Coat in it.

Counter won't reflect physical attacks if they're using a type that was formerly special, and Mirror Coat won't reflect special attacks if they're using a type that was formerly physical.

In the same vein if a special attack with a formerly physical type hits Counter, then it'll reflect it, and same with Mirror Coat/physicals with formerly special types.

Considering that Counter/Mirror Coat don't get used that often in the course of normal gameplay, it can be somewhat hard to notice, and probably only really a huge deal if you like using those moves often yourself.

I don't know if this happened with the JP versions of DPSS patches, because I saw Counter a grand total of zero times, so..
I dunno what they do. Explain, please? Also, does it crash, or just... do nothing? Glad it 'works', though.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote

Relevant Advertising!

  #102    
Old December 14th, 2011 (9:02 PM).
Agastya's Avatar
Agastya Agastya is offline
Grinding failed. Item Grind level dropped by 3.
     
    Join Date: Feb 2010
    Nature: Quiet
    Posts: 72
    It doesn't crash. Nothing bad happens, the moves simply fail.

    For example, A Fire-typed Physical move, like, say, Blaze Kick, will cause Counter to fail, but Mirror Coat will deal the double damage back.

    Similarly, a Ghost-typed Special move like Shadow Ball will cause Mirror Coat to fail, but it can be Countered back for doubled damage.

    I haven't tripped over anything else yet, and this is honestly more of an annoyance than anything else. The moves aren't seen very often.
    Reply With Quote
      #103    
    Old December 15th, 2011 (3:32 AM).
    Darthatron's Avatar
    Darthatron Darthatron is offline
    巨大なトロール。
    • Silver Tier
     
    Join Date: Jan 2006
    Location: Melbourne, Australia
    Age: 26
    Gender: Male
    Nature: Modest
    Posts: 1,152
    I'll look at their code some time. But it doesn't really seem that important. So yeah. Thanks for telling me, though.
    __________________
    あなた は しきしゃ です
    わたし は ばか です
    Reply With Quote
      #104    
    Old December 15th, 2011 (1:55 PM).
    Krika Krika is offline
       
      Join Date: Oct 2011
      Gender: Male
      Posts: 16
      I'd hazard a guess that they're probably coded to run off of typing, not physical/special (since there isn't a distinction between them in the non-hacked game).
      Reply With Quote
        #105    
      Old December 16th, 2011 (3:50 PM). Edited December 17th, 2011 by colcolstyles.
      colcolstyles's Avatar
      colcolstyles colcolstyles is offline
      Yours truly
      • Crystal Tier
       
      Join Date: May 2008
      Location: The Bay Area
      Gender: Male
      Nature: Lonely
      Posts: 1,590
      I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

      edit: Ah, what the hell. I've attached my patch for whoever wants to test it.
      Attached Files
      File Type: zip physpec.zip‎ (3.6 KB, 205 views) (Save to Dropbox)
      __________________

      Brother of Vrai
      Reply With Quote
        #106    
      Old December 16th, 2011 (10:34 PM).
      ArmoredGuns ArmoredGuns is offline
         
        Join Date: Jan 2010
        Posts: 12
        Quote:
        Originally Posted by colcolstyles View Post
        I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

        edit: Ah, what the hell. I've attached my patch for whoever wants to test it.
        Thanks a lot for your patch!!

        After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!
        Reply With Quote
          #107    
        Old December 16th, 2011 (11:15 PM).
        colcolstyles's Avatar
        colcolstyles colcolstyles is offline
        Yours truly
        • Crystal Tier
         
        Join Date: May 2008
        Location: The Bay Area
        Gender: Male
        Nature: Lonely
        Posts: 1,590
        Quote:
        Originally Posted by ArmoredGuns View Post
        Thanks a lot for your patch!!

        After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!
        I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

        Code:
        047f02	Changed a 'ldrb' instruction to load the custom byte
        048148	Changed a 'cmp' instruction to test for 0x0 (physical)
        0695e8	Changed a 'ldrb' instruction to load the custom byte
        069602	Inserted a "ldr + bx" hijack, branches to 0x9c1000
        069a5a	Changed a 'cmp' instruction to test for 0x0 (physical)
        069a5e	Changed a 'b' instruction to branch to a different routine
        31xxxx	All the changes to the attack data table
        9c1000	The hijacked routine, branched to from 0x69604
        __________________

        Brother of Vrai
        Reply With Quote
          #108    
        Old December 17th, 2011 (7:42 PM).
        Darthatron's Avatar
        Darthatron Darthatron is offline
        巨大なトロール。
        • Silver Tier
         
        Join Date: Jan 2006
        Location: Melbourne, Australia
        Age: 26
        Gender: Male
        Nature: Modest
        Posts: 1,152
        Quote:
        Originally Posted by colcolstyles View Post
        I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

        Code:
        047f02	Changed a 'ldrb' instruction to load the custom byte
        048148	Changed a 'cmp' instruction to test for 0x0 (physical)
        0695e8	Changed a 'ldrb' instruction to load the custom byte
        069602	Inserted a "ldr + bx" hijack, branches to 0x9c1000
        069a5a	Changed a 'cmp' instruction to test for 0x0 (physical)
        069a5e	Changed a 'b' instruction to branch to a different routine
        31xxxx	All the changes to the attack data table
        9c1000	The hijacked routine, branched to from 0x69604
        What did you need to hijack a routine for? I'm a bit confused.
        __________________
        あなた は しきしゃ です
        わたし は ばか です
        Reply With Quote
          #109    
        Old December 17th, 2011 (11:51 PM).
        colcolstyles's Avatar
        colcolstyles colcolstyles is offline
        Yours truly
        • Crystal Tier
         
        Join Date: May 2008
        Location: The Bay Area
        Gender: Male
        Nature: Lonely
        Posts: 1,590
        Quote:
        Originally Posted by Darthatron View Post
        What did you need to hijack a routine for? I'm a bit confused.
        While writing up a reply to this question, I realized that the hijack was a very kludgey means of accomplishing something which could be done a lot more simply. So I removed the hijack part and replaced it with a simple byte edit at 0x69bcc which does the same thing. Once again, I've re-uploaded my patch. Since the .asm files are obsolete, I've included the changes in the README instead.
        __________________

        Brother of Vrai
        Reply With Quote
          #110    
        Old December 18th, 2011 (12:38 AM).
        Chaos Rush's Avatar
        Chaos Rush Chaos Rush is offline
           
          Join Date: May 2007
          Gender: Male
          Posts: 1,303
          These are the offsets you need to change to activate it on Pokemon Ruby:
          Code:
          3BA94: 80 7A
          3BFBE: 00 29
          3BFC0: 00 D0
          3C124: 02 2E
          3C126: 00 DB
          3C12C: 01 28
          3C12E: 00 D0
          And for those who care, here's a patch for Ruby that has the physical/special split implemented, and has all the attacks categorized into physical/special/status:
          http://www.pokecommunity.com/showthread.php?t=268940

          Credit goes to Darthatron for posting how to do it on Emerald, since I found the Ruby offsets by searching for similar bytes to the offsets that Darthatron posted. And I'm assuming the recently found Mirror Coat/Counter glitch is present with this patch also.
          __________________
          Reply With Quote
            #111    
          Old December 21st, 2011 (3:12 AM).
          Darthatron's Avatar
          Darthatron Darthatron is offline
          巨大なトロール。
          • Silver Tier
           
          Join Date: Jan 2006
          Location: Melbourne, Australia
          Age: 26
          Gender: Male
          Nature: Modest
          Posts: 1,152
          Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



          Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
          __________________
          あなた は しきしゃ です
          わたし は ばか です
          Reply With Quote
            #112    
          Old December 21st, 2011 (7:49 AM).
          Jambo51's Avatar
          Jambo51 Jambo51 is offline
          Glory To Arstotzka
             
            Join Date: Jun 2009
            Gender: Male
            Nature: Quiet
            Posts: 732
            Quote:
            Originally Posted by Darthatron View Post
            Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



            Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
            Just out of curiosity - Why do you say working on?
            This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

            Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it.
            __________________
            Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
            Reply With Quote
              #113    
            Old December 21st, 2011 (9:00 AM). Edited December 21st, 2011 by Chaos Rush.
            Chaos Rush's Avatar
            Chaos Rush Chaos Rush is offline
               
              Join Date: May 2007
              Gender: Male
              Posts: 1,303
              Quote:
              Originally Posted by Darthatron View Post
              Here's what I'm working on now. For FireRed. Will port to other games... Maybe.



              Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
              On my Ruby hack/project thing, I was thinking of modifying the fourth page on the summary to detail the physical/special indicators rather than Contest info (thus effectively breaking Pokemon Contests in the process), but since you said you might port to other versions I'm not sure if I want to follow through on that.

              EDIT: This is what I meant:

              ^If I did this, then Pokemon Contests will become broken.
              __________________
              Reply With Quote
                #114    
              Old December 21st, 2011 (10:07 PM).
              Darthatron's Avatar
              Darthatron Darthatron is offline
              巨大なトロール。
              • Silver Tier
               
              Join Date: Jan 2006
              Location: Melbourne, Australia
              Age: 26
              Gender: Male
              Nature: Modest
              Posts: 1,152
              Quote:
              Originally Posted by Jambo51 View Post
              Just out of curiosity - Why do you say working on?
              This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

              Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it.
              I want to find a better place to put it. Right now, the image showing if it's physical/special/status appears a frame before the rest of the screen is loaded. :\ I mean, it's not that bad. I just don't love it.

              Change these bytes:
              Code:
              @0813A130: 0x2F
              @0813A17B: 0x47
              @0813A1A0: [Pointer to Routine, plus 1 (one).]
              Here's the source:
              Code:
              .align 2
              .thumb
              Start:
              	push {r0-r4}
              	ldr r0, .CurMoveIndex
              	ldrb r1, [r0]
              	lsl r1, r1, #1
              	ldr r0, .Move_List
              	add r0, r0, r1
              	ldrh r3, [r0]
              	lsl r0, r3, #1
              	add r0, r0, r3
              	lsl r0, r0, #2
              	ldr r1, .MoveBase
              	add r0, r0, r1
              	ldrb r4, [r0, #10]
              	lsl r0, r4, #1
              	add r4, r4, r0
              	lsl r4, r4, #6
              	
              	ldr r0, .SplitImages
              	add r0, r4
              	ldr r1, .VRAM
              	mov r2, #0x30
              	swi #0xB
              	
              	ldr r0, .SplitImages
              	add r0, r4
              	add r0, #0x60
              	ldr r1, .VRAM
              	mov r2, #0x1E
              	lsl r2, #0x04
              	add r1, r1, r2
              	mov r2, #0x30
              	swi #0xB
              	
              Finish:
              	pop {r0-r4}
              	ldr r4, .Some_Offset
              	ldr r0, [r4]
              	ldr r1, .Return_Addr
              	bx r1
              
              .align 2
              .MoveBase:		.word 0x08250C04
              .CurMoveIndex:	.word 0x0203B16D
              .Move_List:		.word 0x02003268
              
              .VRAM:			.word 0x06001800
              .SplitImages:	.word 0xYYYYYYYY
              
              .Some_Offset:	.word 0x0203B148
              .Return_Addr:	.word 0x0813A17C+1
              Change the .SplitImages (0xYYYYYYYY) pointer to where ever you have the images.
              The images are uncompressed. And should look like this:
              They need to be in this order. Use TileMolester or something to insert them.
              They use the same palette as the Types, which is located at 0x08E95DBC in a clean FireRed ROM.
              __________________
              あなた は しきしゃ です
              わたし は ばか です
              Reply With Quote
                #115    
              Old December 22nd, 2011 (1:53 PM). Edited December 22nd, 2011 by Jambo51.
              Jambo51's Avatar
              Jambo51 Jambo51 is offline
              Glory To Arstotzka
                 
                Join Date: Jun 2009
                Gender: Male
                Nature: Quiet
                Posts: 732
                So, say I could find where the game writes the data to the screen normally, and hijacked that code, I could potentially make it appear at the same time as the rest of the information, instead of one frame before it?

                The images also appear in cancel, which they shouldn't. However, the images themselves worked fine.

                To prevent the image showing for cancel - simply include a cmp r3, #0x0 after loading the attack ID into the register, and if it's 0, branch to Finish. I changed it to do this, and it worked satisfactorily.

                Incidentally - 1 frame, does it REALLY bother you that much? It has to be barely noticeable, surely?

                EDIT: I take it back - It is kinda annoying
                __________________
                Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                Reply With Quote
                  #116    
                Old December 22nd, 2011 (8:56 PM).
                Darthatron's Avatar
                Darthatron Darthatron is offline
                巨大なトロール。
                • Silver Tier
                 
                Join Date: Jan 2006
                Location: Melbourne, Australia
                Age: 26
                Gender: Male
                Nature: Modest
                Posts: 1,152
                I'm sure with our combined brains, we can work it out. I don't have time until after Christmas, however.
                __________________
                あなた は しきしゃ です
                わたし は ばか です
                Reply With Quote
                  #117    
                Old December 23rd, 2011 (1:45 AM).
                ArmoredGuns ArmoredGuns is offline
                   
                  Join Date: Jan 2010
                  Posts: 12
                  Seems awesome!!! I'm looking forward to an Emerald port
                  Reply With Quote
                    #118    
                  Old December 24th, 2011 (10:29 PM).
                  JJames19119 JJames19119 is offline
                     
                    Join Date: Oct 2008
                    Gender:
                    Posts: 48
                    This might sound arrogant coming from the person who started this thread and then promptly left it to grow up into a big strong man on it's own (they grow up so fast *sniff*) but when can we expect a clean DPSS patch into Fire Red? I will take the first step into admitting that my patch was nothing more then presented research designed to help anyone interested reach the goal of a clean modification that others can use to improve their own hacks. The patch itself (that I made) is horrifically broken and unprofessional, unfit for any serious hack to use. I blame this on my complete lack of education in ASM and how the GBA works, and probably wasn't even necessary for someone as smart as Darthatron, whom I am highly thankful for in whipping up an Emerald patch. My gratitude extends to everyone else too who's been working on this project and I'm glad I at least put forth the voice and research to make this possible. (Even if it might've happened anyways regardless of my attendance)

                    If there's already a clean DPSS patch for FR like there is now for Emerald, then disregard me, I lick lollipops. If not though, I'd like to know if it's in the works at least. Judging from the small amount of bytes Darthatron's Emerald DPSS changes, it'll be a lot more efficient then my bulky, strung together patch.
                    Reply With Quote
                      #119    
                    Old December 26th, 2011 (6:54 PM).
                    Wiznatts's Avatar
                    Wiznatts Wiznatts is offline
                       
                      Join Date: Dec 2010
                      Gender: Male
                      Posts: 42
                      I'm pretty sure Jambo has it implemented in his Pokedex hack, though I'd assume its pretty similar to what is out there for Ruby and Emerald. I'd ask him if he could put it out.
                      Reply With Quote
                        #120    
                      Old December 27th, 2011 (1:04 AM).
                      Jambo51's Avatar
                      Jambo51 Jambo51 is offline
                      Glory To Arstotzka
                         
                        Join Date: Jun 2009
                        Gender: Male
                        Nature: Quiet
                        Posts: 732
                        Nah, I'm still trying to work out issues with it. Some physical attacks do little or no damage at times. Oddly, this occurs more often with attacks which were physical before the split too. I'm still trying to track down the code for Mirror Coat/Counter, as that will no doubt be buggy, same as any other gen 3 Rom.
                        __________________
                        Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                        Reply With Quote
                          #121    
                        Old December 27th, 2011 (3:27 AM).
                        Darthatron's Avatar
                        Darthatron Darthatron is offline
                        巨大なトロール。
                        • Silver Tier
                         
                        Join Date: Jan 2006
                        Location: Melbourne, Australia
                        Age: 26
                        Gender: Male
                        Nature: Modest
                        Posts: 1,152
                        Did you want me to port my Emerald version to FireRed, or are you set?
                        __________________
                        あなた は しきしゃ です
                        わたし は ばか です
                        Reply With Quote
                          #122    
                        Old December 28th, 2011 (5:16 PM).
                        Krika Krika is offline
                           
                          Join Date: Oct 2011
                          Gender: Male
                          Posts: 16
                          What exactly is the tool that I should use to find the table with the move data? I was directed to PKSV-UI, but that doesn't seem to be the right tool.
                          Reply With Quote
                            #123    
                          Old December 29th, 2011 (2:44 PM).
                          Jambo51's Avatar
                          Jambo51 Jambo51 is offline
                          Glory To Arstotzka
                             
                            Join Date: Jun 2009
                            Gender: Male
                            Nature: Quiet
                            Posts: 732
                            Quote:
                            Originally Posted by Darthatron View Post
                            Did you want me to port my Emerald version to FireRed, or are you set?
                            You know what? Feel free to do it!

                            I'm beginning to get really frustrated by the coding, as it feels like I fix one thing and another breaks.
                            __________________
                            Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                            Reply With Quote
                              #124    
                            Old December 31st, 2011 (8:36 PM). Edited December 31st, 2011 by Darthatron.
                            Darthatron's Avatar
                            Darthatron Darthatron is offline
                            巨大なトロール。
                            • Silver Tier
                             
                            Join Date: Jan 2006
                            Location: Melbourne, Australia
                            Age: 26
                            Gender: Male
                            Nature: Modest
                            Posts: 1,152
                            HAPPY NEW YEAR!

                            Here's the Emerald hack ported to the other games. I find it amusing that with this hack we got it working for Emerald first, then Ruby, and then FireRed, when usually it's the complete opposite. xD

                            FireRed (US)
                            Code:
                            0803ED54: 80 7A
                            0803F226: 00 29
                            0803F228: 00 D0
                            0803F38C: 02 2F
                            0803F38E: 00 DB
                            0803F394: 01 28
                            0803F396: 00 D0
                            Ruby (US) 1
                            Code:
                            0803BA94: 80 7A
                            0803BFBE: 00 29
                            0803BFC0: 00 D0
                            0803C124: 02 2E
                            0803C126: 00 DB
                            0803C12C: 01 28
                            0803C12E: 00 D0
                            Emerald (US) 2
                            Code:
                            080695E8: 80 7A
                            08069A5A: 00 29
                            08069A5C: 00 D0
                            08069BC4: 02 2F
                            08069BC6: 00 DB
                            08069BCC: 01 28
                            08069BCE: 00 D0
                            1 Credit to Chaos Rush for the Ruby port; I don't even have a Ruby ROM. xD
                            2 Credit to colcolstyles for the Emerald hack; I based everything off of his post.

                            EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...
                            __________________
                            あなた は しきしゃ です
                            わたし は ばか です
                            Reply With Quote
                              #125    
                            Old January 1st, 2012 (10:35 AM). Edited January 6th, 2012 by Jambo51.
                            Jambo51's Avatar
                            Jambo51 Jambo51 is offline
                            Glory To Arstotzka
                               
                              Join Date: Jun 2009
                              Gender: Male
                              Nature: Quiet
                              Posts: 732
                              Quote:
                              Originally Posted by Darthatron View Post
                              FireRed (US)
                              Code:
                              0803ED54: 80 7A
                              0803F226: 00 29
                              0803F228: 00 D0
                              0803F38C: 02 2F
                              0803F38E: 00 DB
                              0803F394: 01 28
                              0803F396: 00 D0
                              EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...
                              I did a very quick test. And it has the opposite bug that my original code did. The physical attacks work fine, the special attacks do no damage at all.

                              EDIT: Never Mind. It was a leftover from the old code causing it. My bad.
                              __________________
                              Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                              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:13 AM.