Advertiser Content

Development Weather hacking Page 2

Started by daniilS June 29th, 2015 7:24 AM
  • 18101 views
  • 49 replies

Panda Face

Pokemon Ultra Snowy White

Female
Seen October 9th, 2019
Posted August 10th, 2019
130 posts
2.8 Years
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/1G7r6-XtiGp2iqnHo9ka7kg
Download Password:zt4c
Male
Seen September 12th, 2019
Posted October 23rd, 2017
13 posts
2.8 Years
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

BluRose

blu rass

Age 18
Male
rip x
Seen 11 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
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:
.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):
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:
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:
[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:
In Emerald:
42AB8 (three snow flakes):
XX XX XX XX
42AC4 (steady snowing):
XX XX XX XX
XXXXXXXX:
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?
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

Panda Face

Pokemon Ultra Snowy White

Female
Seen October 9th, 2019
Posted August 10th, 2019
130 posts
2.8 Years
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:
.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):
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:
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:
[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?
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?

Panda Face

Pokemon Ultra Snowy White

Female
Seen October 9th, 2019
Posted August 10th, 2019
130 posts
2.8 Years
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/1G7r6-XtiGp2iqnHo9ka7kg
Download Password:zt4c

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 5 Days Ago
Posted 2 Weeks Ago
1,348 posts
11.4 Years
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:
.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):
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:
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:
[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 Pokmon with level 2/3/4 Pokmon 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:

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?
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!
Is any way to use it on Pokemon Ruby?
- My new Project comming Soon

BluRose

blu rass

Age 18
Male
rip x
Seen 11 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
Is any way to use it on Pokemon Ruby?
dw i'm not ignoring you
will get back to you on that though when i have my laptop to look through roms with <3

EDIT:
routine (try it, may not work; had to adjust it, ruby does it weird):
Spoiler:
.text
.align 2
.thumb

set_hail_environment:
	ldr r2, weather
	ldrh r1, [r2]
	mov r0, #0x80
	and r0, r1
	cmp r0, #0x0
	bne default
	mov r0, #0xD
	strh r0, [r2]
	ldr r0, unk_20160A4
	mov r1, #0xD
	strb r1, [r2]
return:
	ldr r1, return1
	bx r1
default:
	ldr r0, default_weather
	bx r0

.align 2
weather:
	.word 0x02024DB8
unk_20160A4:
	.word 0x020160A4
default_weather:
	.word 0x0801864D
return1:
	.word 0x0801863B
185A0 - jumptable pointer
185A4 - jumptable
4015F6 - F3 00
4015FC - F3 00

that should be enough info? not tested, please test and report back <3
am i cool yet

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 5 Days Ago
Posted 2 Weeks Ago
1,348 posts
11.4 Years
dw i'm not ignoring you
will get back to you on that though when i have my laptop to look through roms with <3

EDIT:
routine (try it, may not work; had to adjust it, ruby does it weird):
Spoiler:
.text
.align 2
.thumb

set_hail_environment:
	ldr r2, weather
	ldrh r1, [r2]
	mov r0, #0x80
	and r0, r1
	cmp r0, #0x0
	bne default
	mov r0, #0xD
	strh r0, [r2]
	ldr r0, unk_20160A4
	mov r1, #0xD
	strb r1, [r2]
return:
	ldr r1, return1
	bx r1
default:
	ldr r0, default_weather
	bx r0

.align 2
weather:
	.word 0x02024DB8
unk_20160A4:
	.word 0x020160A4
default_weather:
	.word 0x0801864D
return1:
	.word 0x0801863B
185A0 - jumptable pointer
185A4 - jumptable
4015F6 - F3 00
4015FC - F3 00

that should be enough info? not tested, please test and report back <3
It helps a lot. But i have just one question. Which Pointer and what i should repleace with that routine.
- My new Project comming Soon

ShinyDragonHunter

Male
Seen September 19th, 2019
Posted September 19th, 2019
31 posts
9 Years
Emerald offsets for 'Three snowflakes' fix:

AB162: 04 1C E1 F7 32 F8 0D 4A D9 21 C9 00 88 5C (Causes game to go black and the player is the only thing on screen. I recommend not changing this one)

AB480: F4 B4 (This is what prevents the screen from going darker)

ABD16: 80 5C 03 28 0D DB 04 28 0B D0 06 28 03 DD 0D 28 07 DC 0B 28 05 DB 01 22 04 E0 (Appears to make no difference in game, so changing the bytes here isn't needed)

ACFA6: 00 (This isn't even needed. You can keep it at the default as it doesn't change anything)

ACFB6: 20 (setting it to this value causes an issue where if you look in your bag and then go back to the overworld, the game takes longer to load and the higher the value, the more time the game takes to load)

AD39E: 4B E0 (Fixes spawning issue with the snowflakes)

BluRose

blu rass

Age 18
Male
rip x
Seen 11 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
let's fix this in pokeruby

source code (src/field_weather_effects.c):
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?
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:
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

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 5 Days Ago
Posted 2 Weeks Ago
1,348 posts
11.4 Years
let's fix this in pokeruby

source code (src/field_weather_effects.c):
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?
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:
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

BluRose

blu rass

Age 18
Male
rip x
Seen 11 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
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:
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

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 5 Days Ago
Posted 2 Weeks Ago
1,348 posts
11.4 Years
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

BluRose

blu rass

Age 18
Male
rip x
Seen 11 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
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

AtecainCorp.

Rejishan awake...

Age 26
Male
Takoabe Town (Region Thonsu)
Seen 5 Days Ago
Posted 2 Weeks Ago
1,348 posts
11.4 Years
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
Advertiser Content