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.