diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 09:21:55 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-23 09:21:55 -0400 |
commit | eeaa6c5fd4957b6719fcb9f76cef5f9931237891 (patch) | |
tree | 0a0db13dc2751b995a7742bbc8bb78c0037ce81e | |
parent | ab81a9b0a3619b5043f4752580d79f2c14b96e73 (diff) | |
download | gen3uploader-eeaa6c5fd4957b6719fcb9f76cef5f9931237891.tar.gz gen3uploader-eeaa6c5fd4957b6719fcb9f76cef5f9931237891.tar.bz2 gen3uploader-eeaa6c5fd4957b6719fcb9f76cef5f9931237891.zip |
Expanded gender field
Rather than representing it as a binary, the data structure now uses two bits for gender, in order to represent genderless Pokémon.
-rw-r--r-- | gba/source/serialize.c | 5 | ||||
-rw-r--r-- | include/pokemon.h | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 069418d..d08dfc2 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c | |||
@@ -99,7 +99,10 @@ void PokemonIntermediateInit( | |||
99 | // Derive gender from the personality value. | 99 | // Derive gender from the personality value. |
100 | int genderThreshold = baseStats->genderRatio; | 100 | int genderThreshold = baseStats->genderRatio; |
101 | 101 | ||
102 | if ((genderThreshold == 0) || (genderThreshold == 255)) | 102 | if (genderThreshold == 255) |
103 | { | ||
104 | pki->gender = 2; | ||
105 | } else if (genderThreshold == 0) | ||
103 | { | 106 | { |
104 | pki->gender = 0; | 107 | pki->gender = 0; |
105 | } else if (genderThreshold == 254) | 108 | } else if (genderThreshold == 254) |
diff --git a/include/pokemon.h b/include/pokemon.h index 072386f..04ecfa0 100644 --- a/include/pokemon.h +++ b/include/pokemon.h | |||
@@ -63,12 +63,9 @@ struct __attribute__((aligned(4))) PokemonIntermediate { | |||
63 | u8 language:3; | 63 | u8 language:3; |
64 | u8 altAbility:1; | 64 | u8 altAbility:1; |
65 | u8 orre:1; | 65 | u8 orre:1; |
66 | u8 filler:3; // waste of space but nothing to pack it with | 66 | u8 gender:2; |
67 | |||
68 | // the following values are generated from the personality value. | ||
69 | u8 nature:6; | ||
70 | u8 gender:1; | ||
71 | u8 shiny:1; | 67 | u8 shiny:1; |
68 | u8 nature; | ||
72 | u8 unownLetter; | 69 | u8 unownLetter; |
73 | 70 | ||
74 | // the level is calculated from the species and experience. this is mostly | 71 | // the level is calculated from the species and experience. this is mostly |