That's not to say this is a dead end...the Pokerus "flag" could be used as a "Hidden Ability flag", and when the Pokemon is taken out of the PC, it'll recalculate what the hidden ability is supposed to be.
I'm going to need to do some research, to see if these bytes are actually used in the Firered games.
Double Edit: At least with givepokemon, these bytes are zero, which means that they shouldn't be an issue.
ah... haha ur right... it would make sense for it to reset it based on the flag and not randomly ... I dont know where my brain was when i was thinking that... but then we wouldn't be able to see the ability unless it was in our party, right? or is that how hidden abilites are supposed to work? Like ur not supposed to see em, they just work?
Wouldn't it just be easier to use the pokerus flag itself? like if we use the upper 4 bits while keeping the lower 4 bits 0, then the pokemon would never contract pokerus (cuz i believe pokerus is coded in the game, it just is never used), and the upper 4 bits can be put to use.
ah k... i didn't kno that... so when u encounter a pokemon (trainer or wild) the entire 100 bytes for the pokemon gets generated?
doesnt JPAN have a routine that decrypts it as part of his hacked engine? u could use that as a base...
Anyway - For the creation of formes in FR, I actually used the upper half of the mark byte as storage for the forme ID. There are 4 marks, which can be set to on or off, which is, of course, a binary setting, which means they use a bit each.
This leaves 4 bits in the upper half of that byte which are unused. After a minor rewrite of the decrypter and encrypter, I was able to gain these bits for my own use.
4 bits allows for 16 possible combinations, which is actually quite a lot in terms of formes.
The "upper half" of the byte refers to the leftmost bits in binary:
128 64 32 16 8 4 2 1
In more ROM hacking orientated terms, it means that of a mark byte 0x32, the 0x30 stands for the forme the Pokémon is currently in while the 0x2 stands for which marks is has assigned to it.
With the forms, the routine your using loads all the pokemon data, right? like type and stats and stuff and not only graphics? So then a branch could be made in that routine using the pokerus data as a check to determine if a pokemon has a hidden ability as well?
sorry bout all this, but i figured the easiest way to learn is just by asking you guys