diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-08-18 17:36:59 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-08-18 17:36:59 -0400 |
| commit | c9c42fb3319151221f317b3cbc255f6d117af5b9 (patch) | |
| tree | 74b754f9343c0f9fb6154ea200408afc088a626d /gba/source/serialize.c | |
| parent | 8ad189bc5a88f43e688fc980db30169f0adac0fb (diff) | |
| download | gen3uploader-c9c42fb3319151221f317b3cbc255f6d117af5b9.tar.gz gen3uploader-c9c42fb3319151221f317b3cbc255f6d117af5b9.tar.bz2 gen3uploader-c9c42fb3319151221f317b3cbc255f6d117af5b9.zip | |
Removed dependency on ROM-internal arrays
I looked at the base stats array and determined that, especially if I limited it to just the data I needed, that it wouldn't be too bad a thing to just include it and the other two arrays I need in my multiboot image rather than reference the ones already located in the game ROM. This way, we get back compatibility with all previously-compatible ROMs, and not just ones that I have dumped. New issue: Deoxys's base stats are actually different per-game, though, so a special case will have to be written for that.
Diffstat (limited to 'gba/source/serialize.c')
| -rw-r--r-- | gba/source/serialize.c | 9 |
1 files changed, 6 insertions, 3 deletions
| diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 72afe2f..086e751 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c | |||
| @@ -7,6 +7,9 @@ | |||
| 7 | #include "serialize.h" | 7 | #include "serialize.h" |
| 8 | #include "gamedata.h" | 8 | #include "gamedata.h" |
| 9 | #include "link.h" | 9 | #include "link.h" |
| 10 | #include "basestats.h" | ||
| 11 | #include "exptables.h" | ||
| 12 | #include "dexorder.h" | ||
| 10 | 13 | ||
| 11 | #define UNOWN_SPECIES_INDEX 201 | 14 | #define UNOWN_SPECIES_INDEX 201 |
| 12 | #define SHEDINJA_SPECIES_INDEX 303 | 15 | #define SHEDINJA_SPECIES_INDEX 303 |
| @@ -60,7 +63,7 @@ void PokemonIntermediateInit( | |||
| 60 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); | 63 | struct PokemonSubstruct2* sub2 = GetBoxPokemonSubstruct2(bpkm); |
| 61 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); | 64 | struct PokemonSubstruct3* sub3 = GetBoxPokemonSubstruct3(bpkm); |
| 62 | 65 | ||
| 63 | struct BaseStats* baseStats = &gameData->baseStats[sub0->species]; | 66 | const struct SmallBaseStats* baseStats = &gSmallBaseStats[sub0->species]; |
| 64 | 67 | ||
| 65 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) | 68 | for (int i=0; i<POKEMON_NAME_LENGTH; i++) |
| 66 | { | 69 | { |
| @@ -74,7 +77,7 @@ void PokemonIntermediateInit( | |||
| 74 | 77 | ||
| 75 | pki->otId = bpkm->otId; | 78 | pki->otId = bpkm->otId; |
| 76 | pki->otGender = sub3->otGender; | 79 | pki->otGender = sub3->otGender; |
| 77 | pki->species = gameData->natOrder[sub0->species - 1]; | 80 | pki->species = gSpeciesToNationalPokedexNum[sub0->species - 1]; |
| 78 | pki->heldItem = sub0->heldItem; | 81 | pki->heldItem = sub0->heldItem; |
| 79 | pki->experience = sub0->experience; | 82 | pki->experience = sub0->experience; |
| 80 | 83 | ||
| @@ -141,7 +144,7 @@ void PokemonIntermediateInit( | |||
| 141 | // Calculate level from experience. | 144 | // Calculate level from experience. |
| 142 | pki->level = 1; | 145 | pki->level = 1; |
| 143 | 146 | ||
| 144 | const u32* expTable = gameData->expTables[baseStats->growthRate]; | 147 | const u32* expTable = gExperienceTables[baseStats->growthRate]; |
| 145 | while ((pki->level <= 100) && (expTable[pki->level] <= sub0->experience)) | 148 | while ((pki->level <= 100) && (expTable[pki->level] <= sub0->experience)) |
| 146 | { | 149 | { |
| 147 | pki->level++; | 150 | pki->level++; |
