Jump to content
Bond697

research Pokemon X/Y General ROM Info

Recommended Posts

pokemon data works differently in gen 6. in gen 3/4/5, pointers to specific pokes were passed directly into functions. in gen 6, a higher-level struct is passed in that contains different pokemon info. also, in gens 3/4/5, data was read from and written to pkms by only 2-4 functions. those 2-4 functions were switch statements that were up to a couple hundred cases. so for example. in gen 3/4/5, you had something like this:

u8 PKM_getNature(void* pkm)

{

PKM_decryptPartyPoke(pkm);

u8 nature = PKM_readPartyPkmStat(pkm, FIELD_ABILITY, NULL);

PKM_encryptPartyPoke(pkm);

return nature;

}

in gen 6, it looks more like this:

u8 PKM_getNature(void* pkm_data)

{

PKM_decryptPartyPoke(pkm_data);

struct PKM_blk0* b0 = PKM_getBlock0ShuffleTypePtr(pkm_data, 1);

u8 pk_nature = b0->nature;

PKM_encryptPartyPoke(pkm_data);

return pk_nature;

}

in the first function, void* pkm is the actual pkm file in ram. in the second, pkm_data is a set of data about a pkm. the data struct looks like this so far:

0 -

4 - is pkm is party (this is used in PKM_decryptPoke and PKM_encryptPoke to decide what exactly to en/decrypt

8 - pkm pointer

C - bool is pkm encrypted

D - bool encrypt pkm

so as you can see, while data is handled by PKM_readPartyPkmStat in the former, gen 6 actually reads each piece of data out in the get function for that data. they use functions to get pointers to each of the shuffled blocks and read from there.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...