Found the problem. The wrong part of the code is this one:
The first one has to be 0x021D15A8, because this is the address of the Current Seed. While 0x021D15AC is the address of the Initial Seed.
Can you tell me instead why, when i use save state, it only save the right Current Seed, Initial Seed and Delay, but doesn't save the Frame? Is there a way to fix this?