diff options
-rw-r--r-- | include/pokemon.h | 5 | ||||
-rw-r--r-- | src/pokemon_1.c | 38 |
2 files changed, 7 insertions, 36 deletions
diff --git a/include/pokemon.h b/include/pokemon.h index 7658425..223c74f 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -101,8 +101,7 @@ struct gPokemon /* 0x1C */ bool8 isMoving; /* 0x1D */ u8 unk1D; /* 0x1E */ u16 base_hp; - /* 0x20 */ u16 base_exp; - /* 0x22 */ u16 unk22; + /* 0x20 */ s32 base_exp; /* 0x24 */ u16 base_att_spatt[2]; /* 0x28 */ u16 base_def_spdef[2]; /* 0x2C */ u16 lowkick_dmg; @@ -151,7 +150,7 @@ s16 GetDexInternalNo(s16 index, u32 r1); s16 GetBaseRecruit(s16 index); s16 GetAlphabetParentNo(s16 index, s32 r1); s16 GetInternalNo(s16 index); -u32 CalculateEXPGain(s16 index, s32 level); +s32 CalculateEXPGain(s16 index, s32 level); s16 GetPokemonEvolveConditons(s16 index, struct unkEvolve *r1); u8 GetPokemonOverworldPalette(s16 index, u32 r1); bool8 IsPokemonDialogueSpriteAvail(s16 index, s32 r1); diff --git a/src/pokemon_1.c b/src/pokemon_1.c index 86f410d..8966ce7 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -129,39 +129,11 @@ s16 GetInternalNo(s16 index) return gMonsterParameters[index].dexInternal[1]; } -#ifdef NONMATCHING -u32 CalculateEXPGain(s16 index, s32 level) -{ - return gMonsterParameters[index].base_exp + (gMonsterParameters[index].base_exp * (level- 1)) / 10; -} -#else -NAKED -u32 CalculateEXPGain(s16 index, s32 level) -{ - asm_unified("\tpush {r4,lr}\n" - "\tlsls r0, 16\n" - "\tasrs r0, 16\n" - "\tldr r2, _0808DD44\n" - "\tldr r3, [r2]\n" - "\tlsls r2, r0, 3\n" - "\tadds r2, r0\n" - "\tlsls r2, 3\n" - "\tadds r2, r3\n" - "\tldr r4, [r2, 0x20]\n" - "\tsubs r1, 0x1\n" - "\tadds r0, r4, 0\n" - "\tmuls r0, r1\n" - "\tmovs r1, 0xA\n" - "\tbl __divsi3\n" - "\tadds r4, r0\n" - "\tadds r0, r4, 0\n" - "\tpop {r4}\n" - "\tpop {r1}\n" - "\tbx r1\n" - "\t.align 2, 0\n" -"_0808DD44: .4byte gMonsterParameters"); -} -#endif +s32 CalculateEXPGain(s16 index, s32 level) +{ + s32 baseEXP = gMonsterParameters[index].base_exp; + return baseEXP + (baseEXP * (level - 1)) / 10; +} s16 GetPokemonEvolveConditions(s16 index, struct unkEvolve *r1) { |