PKHeX icon indicating copy to clipboard operation
PKHeX copied to clipboard

Crystal - Egg Availability Flag

Open hylianpi opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I find that eggs take tediously long to become available at the daycare in Pokemon Crystal, so I would really appreciate the egg availability flag to be added to the flag list.

Describe the solution you'd like I have researched this and found the offset of the flag. It is located at both 1C83 and 2A83 (I'm not sure why data is duplicated), and it is the 2nd bit in the byte there. For example, I updated the byte from a1 to e1 (1010 to 1110) and successfully had an egg available. In another test I've seen it go from 81 to c1 (1000 to 1100). I do not know what the other bits are for.

hylianpi avatar Apr 16 '23 22:04 hylianpi

Great find! - We might need to do a bit more research though! The duplicate data is just part of redundancy in the Gen 2 save format to help identify/work around any data that might get corrupted, so no worries there!

However, Gen 2 save files are all over the place with their offsets, Gold/Silver are different to Crystal, and International/JP/Korean versions of each also have their own offsets!

Assuming 0x1C83/0x2A83 are for International Crystal, we'll also need the flag location in: International Gold/Silver Korean Gold/Silver Japanese Gold/Silver Japanese Crystal

Zazsona avatar Jul 10 '23 15:07 Zazsona

This is actually a little more complex. Offset 0x2A83 in international Crystal stores a saved copy of the wram var wDayCareMan (as named in Pret disassemblies). This var is a bit field, and the bit 6 is the one that toggles the egg available.

So this need to be accessed as a flag value, something like SAV.setFlag(0x2A83, 6, true);

Offsets:

International Gold/Silver - 0x2AA8 Korean Gold/Silver - 0x2AEA Japanese Gold/Silver - 0x2A2A International Crystal - 0x2A83 Japanese Crystal - 0x2A06

@hylianpi you can already do what you want with my plugin FlagsEditorEX. It is available through the Edit Flags > Raw Flags Edit > Sys Flags

image

Not all flags need to be exposed by the main PKHeX, unless they are pretty useful and not cause major issues if misused. This one is problematic due to breeding needing data in daycare slots, which might not happen if user toggles this flag without data set.

fattard avatar Dec 13 '23 01:12 fattard