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!

Reply
 
Thread Tools
  #26    
Old October 13th, 2015 (7:15 PM).
Cruztown's Avatar
Cruztown Cruztown is offline
Squirtle Squirt.
     
    Join Date: Jul 2012
    Gender: Male
    Nature: Rash
    Posts: 45
    I had a semi-relevant question, and didn't come across an adequate answer elsewhere:
    What exactly ties the overworld weather to in-battle weather in Ruby, Sapphire, and Emerald?

    And as a follow up, how feasible would it be to import that into FireRed?
    Reply With Quote
      #27    
    Old October 15th, 2015 (4:56 AM).
    AtecainCorp.'s Avatar
    AtecainCorp. AtecainCorp. is offline
    Rejishan awake...
       
      Join Date: Jun 2008
      Location: Takoabe Town (Region Thonsu)
      Age: 25
      Gender: Male
      Nature: Hardy
      Posts: 1,297
      If you can edit weathers, Why you do not try add extra one. I mean to add THICK FOG from DPPT.
      __________________
      - My new Project comming Soon
      Reply With Quote
        #28    
      Old October 16th, 2015 (5:17 AM).
      Ttar0914's Avatar
      Ttar0914 Ttar0914 is offline
      #384
         
        Join Date: Dec 2010
        Location: Munich, Germany
        Age: 24
        Gender: Male
        Nature: Brave
        Posts: 501
        Quote:
        Originally Posted by AtecainCorp. View Post
        If you can edit weathers, Why you do not try add extra one. I mean to add THICK FOG from DPPT.
        But what about THIN FOG from DPPT? There's also THIN FOG!
        __________________
        Reply With Quote
          #29    
        Old October 16th, 2015 (5:30 AM).
        Deokishisu's Avatar
        Deokishisu Deokishisu is offline
        Mr. Magius
           
          Join Date: Feb 2006
          Location: If I'm online, it's a safe bet I'm at a computer.
          Gender: Male
          Nature: Relaxed
          Posts: 859
          Quote:
          Originally Posted by DarkBlazing Groudon View Post
          But what about THIN FOG from DPPT? There's also THIN FOG!
          Why not NOT SUPER THIN, BUT JUST THICK ENOUGH FOG? We can call it JUST RIGHT FOG.
          Reply With Quote
            #30    
          Old October 16th, 2015 (5:55 AM).
          Touched's Avatar
          Touched Touched is offline
          Resident ASMAGICIAN
             
            Join Date: Jul 2014
            Gender: Male
            Posts: 626
            Quote:
            Originally Posted by Deokishisu View Post
            Why not NOT SUPER THIN, BUT JUST THICK ENOUGH FOG? We can call it JUST RIGHT GOLDILOCKS FOG.
            ftfy
            __________________

            A Pokemon that is discriminated!
            Support squirtle and make it everyone's favourite.
            Reply With Quote
              #31    
            Old May 8th, 2016 (10:27 AM).
            pokemontutorialTV's Avatar
            pokemontutorialTV pokemontutorialTV is offline
               
              Join Date: Feb 2014
              Location: Germany, Kaiserslautern
              Gender: Male
              Nature: Calm
              Posts: 77
              Snowflakes working with this routine sometimes pretty wierd and force to fall at one spot. Anyone an idea to fix this?
              __________________
              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
                #32    
              Old January 29th, 2017 (6:47 AM).
              Panda Face's Avatar
              Panda Face Panda Face is offline
              I love Su Ping Chen
                 
                Join Date: Jan 2017
                Gender: Female
                Posts: 129
                Hello, Daniils, do you know how to add the hail effect in battle when the weather is snow flake on map? If yes, can you teach me how to add this feature by Winhex? I don't know how to use ASM, I know how to use winhex only, thank you very much. In gen 4 and gen 5, when the weather is snow on map, the battle will become hail weather. It is for Emerald.

                Hello, every body, who does know how to add the hail effect in battle when the weather is snow flake on map? If someone knows, can someone teach me how to add this feature by Winhex? I don't know how to use ASM, I know how to use winhex only, thanks lot. In gen 4 and gen 5, when the weather is snow on map, the battle will become hail weather. It is for Emerald.

                Hello, Artemis 64, do you know how to add the hail effect in battle when the weather is three snow flakes on the Map? In Rainy weather, the battle will happen rainy; in Underground flashes, the battle will happen sunny; In Sandstorm weather, the battle will happen sandstorm. So how to let in Three snow flakes, the battle will happen hail in Emerald? Thank you very much.
                __________________

                Pokemon Snowy White
                Community Link: https://www.pokecommunity.com/showthread.php?p=9569056#post9569056
                Download Link: https://pan.baidu.com/s/1ohOWbmt68281KbqFOnRlsQ
                Download Password:qv33
                Reply With Quote
                  #33    
                Old January 31st, 2017 (8:55 AM).
                pokemontutorialTV's Avatar
                pokemontutorialTV pokemontutorialTV is offline
                   
                  Join Date: Feb 2014
                  Location: Germany, Kaiserslautern
                  Gender: Male
                  Nature: Calm
                  Posts: 77
                  I dont recommend to use this code, because of the above mentoined bug. If you want to use it anyways, feel free.
                  __________________
                  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
                    #34    
                  Old February 1st, 2017 (6:28 AM).
                  kobold kobold is offline
                     
                    Join Date: Jan 2017
                    Gender: Male
                    Posts: 13
                    I got sunny weather working in FR absolutely fine. I was wondering if it is possible to slow down the animation speed of the effect though? I've never really liked how sunny weather looked in gen III - it looks more like the screen is flashing than sunny weather and looks too distracting to use for a large area in a hack IMO.

                    I think it would look a lot better if the screen would get brighter and darker again more slowly, maybe at half the speed it is now. Is this possible? Could anyone better at ASM than me give me an idea where to look? Lol
                    Reply With Quote
                      #35    
                    Old February 1st, 2017 (6:12 PM). Edited February 6th, 2017 by BluRose.
                    BluRose BluRose is offline
                    blu rass
                       
                      Join Date: Apr 2014
                      Location: hyakkoku city
                      Age: 17
                      Gender: Male
                      Nature: Timid
                      Posts: 759
                      a lot of people have always seemed to want this smh


                      the video of this image took like 5 years to upload ok
                      i just ripped the tiles from neti's rombase and did the tiles in like 5 minutes because i had to have a pretty gif for this <3


                      MAKING WEATHERS OUTSIDE CORRESPOND TO THOSE IN-BATTLE
                      specifically hail

                      First, insert this routine:
                      Spoiler:
                      Code:
                      .text
                      .align 2
                      .thumb
                      
                      set_hail_environment:
                      	ldr r3, weather
                      	ldrh r1, [r3]
                      	mov r2, #0x80
                      	mov r0, r2
                      	and r0, r1
                      	cmp r0, #0x0
                      	bne default
                      	strh r2, [r3, #0x0]
                      	ldr r1, unk_2023FC4	@ this address +0x10 is the animation we want to play probably
                      	mov r0, #0xD		@ Hail animation
                      	strb r0, [r1, #0x10]
                      	mov r3, r10
                      	strb r3, [r1, #0x17]
                      return:
                      	ldr r0, return1
                      	bx r0
                      default:
                      	ldr r0, default_weather
                      	bx r0
                      
                      .align 2
                      weather:
                      	.word 0x02023F1C
                      unk_2023FC4:
                      	.word 0x02023FC4
                      default_weather:
                      	.word 0x0801A251
                      return1:
                      	.word 0x0801A247
                      And here it is compiled (because Panda Face asked for it):
                      Code:
                      08 4B 19 88 80 22 10 1C 08 40 00 28 07 D1 1A 80 05 49 0D 20 08 74 53 46 CB 75 05 48 00 47 03 48 00 47 00 00 1C 3F 02 02 C4 3F 02 02 51 A2 01 08 47 A2 01 08

                      Now, here is the fun part:

                      0x01A1B8 has a jumptable with a pointer to it at 0x01A1B4.
                      Here it is, for all to see:
                      Code:
                      Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
                      0001A1B0                          E4 A1 01 08 50 A2 01 08 
                      0001A1C0  E4 A1 01 08 14 BE 76 08 58 5F 76 08 08 A2 01 08 
                      0001A1D0  50 A2 01 08 50 A2 01 08 50 A2 01 08 2C A2 01 08
                      0001A1E0  E4 A1 01 08
                      NOTICE: NONE OF THEM HAVE +1!

                      This table of pointers' entries each correspond to a weather value from 0x3 to 0xD (Rainy weather to Underground flashes [sic]/Extreme sun).
                      Weather values (taken from AMap .ini):
                      Spoiler:
                      Code:
                      [Wetter]
                      00=In-house weather
                      01=Sunny weather with clouds in water
                      02=Regular weather
                      03=Rainy weather
                      04=Three snow flakes
                      05=Rain with thunder storm
                      06=Steady mist
                      07=Steady snowing
                      08=Sand storm
                      09=Mist from top right corner
                      0A=Dense bright mist
                      0B=Cloudy
                      0C=Underground flashes
                      0D=Heavy rain with thunder storm
                      0E=Underwater mist
                      We'll go into adjusting the maximum and minimum values later (if for whatever reason you want to).

                      So, what do you want to do?
                      "Steady snowing" is entry 0x7 in the list. Since we start counting at 0x3, it is the 5th entry in the table. "Three snow flakes" is entry 0x4. Since we start counting at 0x3, it is the 2nd entry in the table.
                      Hopefully, the pattern here is clear.
                      So "Steady snowing"'s entry is at 0x01A1C8; "Three snow flakes"'s is at 0x01A1BC.
                      Place a pointer to the routine (NOT +1) at its entry in the table, and voila. Hail happens when snow is present in the overworld.
                      NOTE: It MAY not be permanent! I have absolutely no idea and didn't test permanence because battles against level 2/3/4 Pokémon with level 2/3/4 Pokémon never last that long.

                      ONE LAST PART (displaying the correct message):

                      To make the correct battle message display at the start of battle, put F3 00 at 0x3FE602 (three snow flakes) and 0x3FE608 (steady snowing).
                      Shoutouts to pokemontutorialTV for informing me that this did not work on clean ROMs and for finding the fix!

                      If you want it for Emerald (Shoutouts to Panda Face!):
                      Spoiler:
                      Quote:
                      Originally Posted by Panda Face View Post
                      In Emerald:
                      42AB8 (three snow flakes):
                      Code:
                      XX XX XX XX
                      42AC4 (steady snowing):
                      Code:
                      XX XX XX XX
                      XXXXXXXX:
                      Code:
                      08 4B 19 88 80 22 10 1C 08 40 00 28 07 D1 1A 80 
                      05 49 0D 20 08 74 53 46 CB 75 05 48 00 47 03 48 
                      00 47 00 00 CC 43 02 02 74 44 02 02 4D 2B 04 08 
                      43 2B 04 08
                      And then F3 00 at both 5CC922 (three snow flakes) and 5CC928 (steady snowing).


                      EXPANDING YOUR TABLE

                      0x01A1A2 - minimum weather value (currently 0x3)
                      0x01A1A4 - [maximum weather value - minimum weather value] (currently 0xD - 0x3 = 0xA)
                      Why is this, one may ask?
                      Code:
                      ROM:0801A1A2                 SUBS    R0, #3  @ subtract current weather value by three
                      ROM:0801A1A4                 CMP     R0, #0xA  @ compare the new weather value to 0xA
                      ROM:0801A1A6                 BHI     def_801A1B0  @ if the new weather value is higher, go to the default case; no weather in-battle
                      There is a pointer to the table at 0x01A1B4.
                      And... that's it (probably)! Just repoint the table and adjust as necessary in order to expand beyond that.

                      The byte for weather in-battle:
                      Spoiler:
                      While doing this, I had to do some more research as well, but this is probably common knowledge for most of the upper hackers maybe possibly theoretically.

                      0x02023F1C - battle_weather
                      It's labelled as a halfword but I don't think ever uses the second byte? Anyways...
                      Bitmask to decide weathers:
                      Structure:
                      [bit - hail] [2 bits - sun] [2 bits - sandstorm] [3 bits - rain]
                      Any one of the bits can be used to activate the desired weather. The middle bit of rain activates a different message ("The downpour continues." instead of "Rain continues to fall.")
                      Best part? Multiple weathers are supported at once!
                      Set it to FF and you get this!
                      "The downpour continues. [rain animation]
                      The sandstorm rages. [sandstorm buffeting after animation]
                      The sunlight is strong. [sunlight animation]
                      Hail continues to fall. [hail pelting after animation]"

                      So, the rationale, then, of adding new weathers in-battle (i.e. fog and the terrains and pledges)? We have another byte which we can use for this, and I'd actually like to take a stab at doing that sometime eventually theoretically.

                      Have a nice day everyone!
                      __________________
                      am i cool yet
                      Reply With Quote
                        #36    
                      Old February 2nd, 2017 (1:04 AM).
                      Panda Face's Avatar
                      Panda Face Panda Face is offline
                      I love Su Ping Chen
                         
                        Join Date: Jan 2017
                        Gender: Female
                        Posts: 129
                        Quote:
                        Originally Posted by BluRose View Post
                        a lot of people have always seemed to want this smh


                        the video of this image took like 5 years to upload ok
                        i just ripped the tiles from neti's rombase and did the tiles in like 5 minutes because i had to have a pretty gif for this <3


                        MAKING WEATHERS OUTSIDE CORRESPOND TO THOSE IN-BATTLE
                        specifically hail

                        First, insert this routine:
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        
                        set_hail_environment:
                        	ldr r3, weather
                        	ldrh r1, [r3]
                        	mov r2, #0x80
                        	mov r0, r2
                        	and r0, r1
                        	cmp r0, #0x0
                        	bne default
                        	strh r2, [r3, #0x0]
                        	ldr r1, unk_2023FC4	@ this address +0x10 is the animation we want to play probably
                        	mov r0, #0xD		@ Hail animation
                        	strb r0, [r1, #0x10]
                        	mov r3, r10
                        	strb r3, [r1, #0x17]
                        return:
                        	ldr r0, return1
                        	bx r0
                        default:
                        	ldr r0, default_weather
                        	bx r0
                        
                        .align 2
                        weather:
                        	.word 0x02023F1C
                        unk_2023FC4:
                        	.word 0x02023FC4
                        default_weather:
                        	.word 0x0801A251
                        return1:
                        	.word 0x0801A247
                        And here it is compiled (because Panda Face asked for it):
                        Code:
                        08 4B 19 88 80 22 10 1C 08 40 00 28 07 D1 1A 80 05 49 0D 20 08 74 53 46 CB 75 05 48 00 47 03 48 00 47 00 00 1C 3F 02 02 C4 3F 02 02 51 A2 01 08 47 A2 01 08

                        Now, here is the fun part:

                        0x01A1B8 has a jumptable with a pointer to it at 0x01A1B4.
                        Here it is, for all to see:
                        Code:
                        Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
                        0001A1B0                          E4 A1 01 08 50 A2 01 08 
                        0001A1C0  E4 A1 01 08 14 BE 76 08 58 5F 76 08 08 A2 01 08 
                        0001A1D0  50 A2 01 08 50 A2 01 08 50 A2 01 08 2C A2 01 08
                        0001A1E0  E4 A1 01 08
                        NOTICE: NONE OF THEM HAVE +1!

                        This table of pointers' entries each correspond to a weather value from 0x3 to 0xD (Rainy weather to Underground flashes [sic]/Extreme sun).
                        Weather values (taken from AMap .ini):
                        Spoiler:
                        Code:
                        [Wetter]
                        00=In-house weather
                        01=Sunny weather with clouds in water
                        02=Regular weather
                        03=Rainy weather
                        04=Three snow flakes
                        05=Rain with thunder storm
                        06=Steady mist
                        07=Steady snowing
                        08=Sand storm
                        09=Mist from top right corner
                        0A=Dense bright mist
                        0B=Cloudy
                        0C=Underground flashes
                        0D=Heavy rain with thunder storm
                        0E=Underwater mist
                        We'll go into adjusting the maximum and minimum values later (if for whatever reason you want to).

                        So, what do you want to do?
                        "Steady snowing" is entry 0x7 in the list. Since we start counting at 0x3, it is the 5th entry in the table. "Three snow flakes" is entry 0x4. Since we start counting at 0x3, it is the 2nd entry in the table.
                        Hopefully, the pattern here is clear.
                        So "Steady snowing"'s entry is at 0x01A1C8; "Three snow flakes"'s is at 0x01A1BC.
                        Place a pointer to the routine (NOT +1) at its entry in the table, and voila. Hail happens when snow is present in the overworld.
                        NOTE: It MAY not be permanent! I have absolutely no idea and didn't test permanence because battles against level 2/3/4 Pokémon with level 2/3/4 Pokémon never last that long.

                        EXPANDING YOUR TABLE

                        0x01A1A2 - minimum weather value (currently 0x3)
                        0x01A1A4 - [maximum weather value - minimum weather value] (currently 0xD - 0x3 = 0xA)
                        Why is this, one may ask?
                        Code:
                        ROM:0801A1A2                 SUBS    R0, #3  @ subtract current weather value by three
                        ROM:0801A1A4                 CMP     R0, #0xA  @ compare the new weather value to 0xA
                        ROM:0801A1A6                 BHI     def_801A1B0  @ if the new weather value is higher, go to the default case; no weather in-battle
                        There is a pointer to the table at 0x01A1B4.
                        And... that's it (probably)! Just repoint the table and adjust as necessary in order to expand beyond that.

                        The byte for weather in-battle:
                        Spoiler:
                        While doing this, I had to do some more research as well, but this is probably common knowledge for most of the upper hackers maybe possibly theoretically.

                        0x02023F1C - battle_weather
                        It's labelled as a halfword but I don't think ever uses the second byte? Anyways...
                        Bitmask to decide weathers:
                        Structure:
                        [bit - hail] [2 bits - sun] [2 bits - sandstorm] [3 bits - rain]
                        Any one of the bits can be used to activate the desired weather. The middle bit of rain activates a different message ("The downpour continues." instead of "Rain continues to fall.")
                        Best part? Multiple weathers are supported at once!
                        Set it to FF and you get this!
                        "The downpour continues. [rain animation]
                        The sandstorm rages. [sandstorm buffeting after animation]
                        The sunlight is strong. [sunlight animation]
                        Hail continues to fall. [hail pelting after animation]"

                        So, the rationale, then, of adding new weathers in-battle (i.e. fog and the terrains and pledges)? We have another byte which we can use for this, and I'd actually like to take a stab at doing that sometime eventually theoretically.

                        Have a nice day everyone!
                        It is for Fire Red, how to add it in Emerald?
                        Reply With Quote
                          #37    
                        Old February 4th, 2017 (2:39 AM).
                        Panda Face's Avatar
                        Panda Face Panda Face is offline
                        I love Su Ping Chen
                           
                          Join Date: Jan 2017
                          Gender: Female
                          Posts: 129
                          In Emerald:
                          42AB8: 00 00 A2 08
                          42AC4: 00 00 A2 08
                          A20000: 08 4B 19 88 80 22 10 1C 08 40 00 28 07 D1 1A 80 05 49 0D 20 08 74 53 46 CB 75 05 48 00 47 03 48 00 47 00 00 CC 43 02 02 74 44 02 02 4D 2B 04 08 43 2B 04 08
                          __________________

                          Pokemon Snowy White
                          Community Link: https://www.pokecommunity.com/showthread.php?p=9569056#post9569056
                          Download Link: https://pan.baidu.com/s/1ohOWbmt68281KbqFOnRlsQ
                          Download Password:qv33
                          Reply With Quote
                            #38    
                          Old February 4th, 2017 (9:26 AM). Edited February 7th, 2017 by pokemontutorialTV.
                          pokemontutorialTV's Avatar
                          pokemontutorialTV pokemontutorialTV is offline
                             
                            Join Date: Feb 2014
                            Location: Germany, Kaiserslautern
                            Gender: Male
                            Nature: Calm
                            Posts: 77
                            It says "It's raining" and playing hail animation in first turn. In secound turn everything is ok.FIXED

                            I'm unable to port the fix at 0x79DBE (04 1C E1 F7 32 F8 0D 4A D9 21 C9 00 88 5C) to other language roms. It ends in a dark screen. Would be nice to know, which kind of ASM-commands there are being used.
                            __________________
                            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
                              #39    
                            Old June 8th, 2017 (2:01 PM).
                            BluRose BluRose is offline
                            blu rass
                               
                              Join Date: Apr 2014
                              Location: hyakkoku city
                              Age: 17
                              Gender: Male
                              Nature: Timid
                              Posts: 759
                              Quote:
                              Originally Posted by AtecainCorp. View Post
                              It helps a lot. But i have just one question. Which Pointer and what i should repleace with that routine.
                              185A8 - pointer to asm routine
                              185B4 - pointer to asm routine
                              neither are +1
                              __________________
                              am i cool yet
                              Reply With Quote
                                #40    
                              Old August 26th, 2018 (10:42 AM).
                              BluRose BluRose is offline
                              blu rass
                                 
                                Join Date: Apr 2014
                                Location: hyakkoku city
                                Age: 17
                                Gender: Male
                                Nature: Timid
                                Posts: 759
                                let's fix this in pokeruby

                                source code (src/field_weather_effects.c):
                                Code:
                                void sub_807ED48(struct Sprite *sprite)
                                {
                                    s16 r3;
                                    s16 r2;
                                
                                    sprite->data[0] += sprite->data[1];
                                    sprite->pos1.y = sprite->data[0] >> 7;
                                    sprite->data[3] = (sprite->data[3] + sprite->data[2]) & 0xFF;
                                    sprite->pos2.x = gSineTable[sprite->data[3]] / 64;
                                
                                    r3 = (sprite->pos1.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX) & 0x1FF;
                                    if (r3 & 0x100)
                                        r3 = -0x100 | r3;  // hmm... what is this?
                                    if (r3 < -3)
                                        sprite->pos1.x = 242 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                    else if (r3 > 242)
                                        sprite->pos1.x = -3 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                
                                    r2 = (sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY) & 0xFF;
                                    if (r2 > 163 && r2 < 171)
                                    {
                                        sprite->pos1.y = 250 - (gSpriteCoordOffsetY + sprite->centerToCornerVecY);
                                        sprite->data[0] = sprite->pos1.y * 128;
                                        sprite->data[5] = 0;
                                        sprite->data[6] = 220;
                                    }
                                    else if (r2 > 242 && r2 < 250)
                                    {
                                        sprite->pos1.y = 163;
                                        sprite->data[0] = sprite->pos1.y * 128;
                                        sprite->data[5] = 0;
                                        sprite->data[6] = 220;
                                        sprite->invisible = TRUE;
                                        sprite->callback = sub_807ECEC;
                                    }
                                
                                    sprite->data[5]++;
                                    if (sprite->data[5] == sprite->data[6])
                                    {
                                        sub_807EC40(sprite);
                                        sprite->pos1.y = 250;
                                        sprite->invisible = TRUE;
                                        sprite->callback = sub_807ECEC;
                                    }
                                }
                                this is responsible for assigning the flakes their position

                                now, essentially what daniils does with his byte change (the 4B E0) is tell the game to skip over a bunch of the code responsible for "deleting" the snow flake sprites, except it actually just makes them invisible; they're still floating around on the screen ahaha
                                so the new fix?
                                Code:
                                void sub_807ED48(struct Sprite *sprite)
                                {
                                    s16 r3;
                                
                                    sprite->data[0] += sprite->data[1];
                                    sprite->pos1.y = sprite->data[0] >> 7;
                                    sprite->data[3] = (sprite->data[3] + sprite->data[2]) & 0xFF;
                                    sprite->pos2.x = gSineTable[sprite->data[3]] / 64;
                                
                                    r3 = (sprite->pos1.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX) & 0x1FF;
                                    if (r3 & 0x100)
                                        r3 = -0x100 | r3;  // hmm... what is this?
                                    if (r3 < -3)
                                        sprite->pos1.x = 242 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                    else if (r3 > 242)
                                        sprite->pos1.x = -3 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                }
                                and that does it
                                i think what gamefreak wanted to do with the rest was make it so that the snow seemed like it was landing and melting. however, they never made the sprites visible again at the top, so it in essence "deleted" the snow

                                also, if you want to edit the number of flakes:
                                Code:
                                void Snow_InitVars(void)
                                {
                                    gWeatherPtr->initStep = 0;
                                    gWeatherPtr->weatherGfxLoaded = FALSE;
                                    gWeatherPtr->gammaTargetIndex = 3;
                                    gWeatherPtr->gammaStepDelay = 20;
                                    gWeatherPtr->unknown_6E5 = 16; // THIS NUMBER RIGHT HERE, i've put it up to 50 before
                                    gWeatherPtr->unknown_6E0 = 0;
                                }
                                finally, if you want to make it so that the game never fades for snow, head over to field_weather.c: and search for "case WEATHER_SNOW," deleting both instances.
                                __________________
                                am i cool yet
                                Reply With Quote
                                  #41    
                                Old August 26th, 2018 (12:38 PM).
                                AtecainCorp.'s Avatar
                                AtecainCorp. AtecainCorp. is offline
                                Rejishan awake...
                                   
                                  Join Date: Jun 2008
                                  Location: Takoabe Town (Region Thonsu)
                                  Age: 25
                                  Gender: Male
                                  Nature: Hardy
                                  Posts: 1,297
                                  Quote:
                                  Originally Posted by BluRose View Post
                                  let's fix this in pokeruby

                                  source code (src/field_weather_effects.c):
                                  Code:
                                  void sub_807ED48(struct Sprite *sprite)
                                  {
                                      s16 r3;
                                      s16 r2;
                                  
                                      sprite->data[0] += sprite->data[1];
                                      sprite->pos1.y = sprite->data[0] >> 7;
                                      sprite->data[3] = (sprite->data[3] + sprite->data[2]) & 0xFF;
                                      sprite->pos2.x = gSineTable[sprite->data[3]] / 64;
                                  
                                      r3 = (sprite->pos1.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX) & 0x1FF;
                                      if (r3 & 0x100)
                                          r3 = -0x100 | r3;  // hmm... what is this?
                                      if (r3 < -3)
                                          sprite->pos1.x = 242 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                      else if (r3 > 242)
                                          sprite->pos1.x = -3 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                  
                                      r2 = (sprite->pos1.y + sprite->centerToCornerVecY + gSpriteCoordOffsetY) & 0xFF;
                                      if (r2 > 163 && r2 < 171)
                                      {
                                          sprite->pos1.y = 250 - (gSpriteCoordOffsetY + sprite->centerToCornerVecY);
                                          sprite->data[0] = sprite->pos1.y * 128;
                                          sprite->data[5] = 0;
                                          sprite->data[6] = 220;
                                      }
                                      else if (r2 > 242 && r2 < 250)
                                      {
                                          sprite->pos1.y = 163;
                                          sprite->data[0] = sprite->pos1.y * 128;
                                          sprite->data[5] = 0;
                                          sprite->data[6] = 220;
                                          sprite->invisible = TRUE;
                                          sprite->callback = sub_807ECEC;
                                      }
                                  
                                      sprite->data[5]++;
                                      if (sprite->data[5] == sprite->data[6])
                                      {
                                          sub_807EC40(sprite);
                                          sprite->pos1.y = 250;
                                          sprite->invisible = TRUE;
                                          sprite->callback = sub_807ECEC;
                                      }
                                  }
                                  this is responsible for assigning the flakes their position

                                  now, essentially what daniils does with his byte change (the 4B E0) is tell the game to skip over a bunch of the code responsible for "deleting" the snow flake sprites, except it actually just makes them invisible; they're still floating around on the screen ahaha
                                  so the new fix?
                                  Code:
                                  void sub_807ED48(struct Sprite *sprite)
                                  {
                                      s16 r3;
                                  
                                      sprite->data[0] += sprite->data[1];
                                      sprite->pos1.y = sprite->data[0] >> 7;
                                      sprite->data[3] = (sprite->data[3] + sprite->data[2]) & 0xFF;
                                      sprite->pos2.x = gSineTable[sprite->data[3]] / 64;
                                  
                                      r3 = (sprite->pos1.x + sprite->centerToCornerVecX + gSpriteCoordOffsetX) & 0x1FF;
                                      if (r3 & 0x100)
                                          r3 = -0x100 | r3;  // hmm... what is this?
                                      if (r3 < -3)
                                          sprite->pos1.x = 242 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                      else if (r3 > 242)
                                          sprite->pos1.x = -3 - (gSpriteCoordOffsetX + sprite->centerToCornerVecX);
                                  }
                                  and that does it
                                  i think what gamefreak wanted to do with the rest was make it so that the snow seemed like it was landing and melting. however, they never made the sprites visible again at the top, so it in essence "deleted" the snow

                                  also, if you want to edit the number of flakes:
                                  Code:
                                  void Snow_InitVars(void)
                                  {
                                      gWeatherPtr->initStep = 0;
                                      gWeatherPtr->weatherGfxLoaded = FALSE;
                                      gWeatherPtr->gammaTargetIndex = 3;
                                      gWeatherPtr->gammaStepDelay = 20;
                                      gWeatherPtr->unknown_6E5 = 16; // THIS NUMBER RIGHT HERE, i've put it up to 50 before
                                      gWeatherPtr->unknown_6E0 = 0;
                                  }
                                  finally, if you want to make it so that the game never fades for snow, head over to field_weather.c: and search for "case WEATHER_SNOW," deleting both instances.
                                  Nice. But you have that same solution in Hex?
                                  __________________
                                  - My new Project comming Soon
                                  Reply With Quote
                                    #42    
                                  Old August 26th, 2018 (1:39 PM).
                                  BluRose BluRose is offline
                                  blu rass
                                     
                                    Join Date: Apr 2014
                                    Location: hyakkoku city
                                    Age: 17
                                    Gender: Male
                                    Nature: Timid
                                    Posts: 759
                                    Quote:
                                    Originally Posted by AtecainCorp. View Post
                                    Nice. But you have that same solution in Hex?
                                    7EDDA: 4B E0 fixes the flakes
                                    7E9F2 is the # of flakes

                                    is the rest of it even necessary? not honestly sure, it seems to be pretty much covered with that
                                    if you want to remove the faded screen, then i'll look at it sometime ahaha

                                    and i'll respond to your pm here:
                                    Quote:
                                    Originally Posted by AtecainCorp. View Post
                                    I also tested your routine. And my game acts weirdly. FIrst Torchich change forme, secoundly rain and sandstorm runs at that same time.
                                    i'll look at it sometime ahaha
                                    how did the torchic change form though? like what happened exactly?
                                    __________________
                                    am i cool yet
                                    Reply With Quote
                                      #43    
                                    Old August 26th, 2018 (2:30 PM).
                                    AtecainCorp.'s Avatar
                                    AtecainCorp. AtecainCorp. is offline
                                    Rejishan awake...
                                       
                                      Join Date: Jun 2008
                                      Location: Takoabe Town (Region Thonsu)
                                      Age: 25
                                      Gender: Male
                                      Nature: Hardy
                                      Posts: 1,297
                                      Quote:
                                      Originally Posted by BluRose View Post
                                      7EDDA: 4B E0 fixes the flakes
                                      7E9F2 is the # of flakes

                                      is the rest of it even necessary? not honestly sure, it seems to be pretty much covered with that
                                      if you want to remove the faded screen, then i'll look at it sometime ahaha

                                      and i'll respond to your pm here:
                                      i'll look at it sometime ahaha
                                      how did the torchic change form though? like what happened exactly?
                                      First I had Healing Animation. After that Torchic turns into Hero backsprite with "Transform" Animation <That gives me hint for work with that on ability called Limber and Ilusion> Anyways. After that two effects. Rain and Sandstorm started at the same time.
                                      __________________
                                      - My new Project comming Soon
                                      Reply With Quote
                                        #44    
                                      Old August 26th, 2018 (2:53 PM).
                                      BluRose BluRose is offline
                                      blu rass
                                         
                                        Join Date: Apr 2014
                                        Location: hyakkoku city
                                        Age: 17
                                        Gender: Male
                                        Nature: Timid
                                        Posts: 759
                                        Quote:
                                        Originally Posted by AtecainCorp. View Post
                                        First I had Healing Animation. After that Torchic turns into Hero backsprite with "Transform" Animation <That gives me hint for work with that on ability called Limber and Ilusion> Anyways. After that two effects. Rain and Sandstorm started at the same time.
                                        awesome, thank you!
                                        this is probably caused by the battle animation effects not being the same in ruby as they are in fire red/emerald, so the routine loads and executes the wrong one. the weather bits, however, i am a bit confused about, ahaha
                                        the hail bit seems like it should be set correctly (0x02024DB8); it's handled exactly as it should be. did you shift around the battle ram at all?
                                        __________________
                                        am i cool yet
                                        Reply With Quote
                                          #45    
                                        Old August 26th, 2018 (3:23 PM).
                                        AtecainCorp.'s Avatar
                                        AtecainCorp. AtecainCorp. is offline
                                        Rejishan awake...
                                           
                                          Join Date: Jun 2008
                                          Location: Takoabe Town (Region Thonsu)
                                          Age: 25
                                          Gender: Male
                                          Nature: Hardy
                                          Posts: 1,297
                                          Quote:
                                          Originally Posted by BluRose View Post
                                          awesome, thank you!
                                          this is probably caused by the battle animation effects not being the same in ruby as they are in fire red/emerald, so the routine loads and executes the wrong one. the weather bits, however, i am a bit confused about, ahaha
                                          the hail bit seems like it should be set correctly (0x02024DB8); it's handled exactly as it should be. did you shift around the battle ram at all?
                                          No. I do not change anything in ram so far.
                                          __________________
                                          - My new Project comming Soon
                                          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
                                          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 10:35 PM.