diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-09-01 15:00:51 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-09-01 15:00:51 -0400 |
commit | 9f78a9adb195635f0e6fd76141cbf51e65114629 (patch) | |
tree | 1e32072eefa9ad5a8dd3116dd3ae6bc783d233dd | |
parent | 45c27a8336f4c87f637104fdcee41abbe29d00c2 (diff) |
Decompile unk_0206BB28
-rw-r--r-- | arm9/asm/unk_0206BB28.s | 37 | ||||
-rw-r--r-- | arm9/src/unk_0206BB28.c | 25 | ||||
-rw-r--r-- | include/pokedex.h | 2 | ||||
-rw-r--r-- | include/unk_0206BB28.h | 12 |
4 files changed, 39 insertions, 37 deletions
diff --git a/arm9/asm/unk_0206BB28.s b/arm9/asm/unk_0206BB28.s deleted file mode 100644 index 15f4469e..00000000 --- a/arm9/asm/unk_0206BB28.s +++ /dev/null @@ -1,37 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start FUN_0206BB28 -FUN_0206BB28: ; 0x0206BB28 - push {r3, lr} - bl Sav2_Pokedex_get - bl FUN_0206BB34 - pop {r3, pc} - - thumb_func_start FUN_0206BB34 -FUN_0206BB34: ; 0x0206BB34 - push {r3, lr} - bl Pokedex_GetNatDexFlag - cmp r0, #0x1 - bne _0206BB42 - mov r0, #0x1 - pop {r3, pc} -_0206BB42: - mov r0, #0x0 - pop {r3, pc} - .balign 4 - - thumb_func_start FUN_0206BB48 -FUN_0206BB48: ; 0x0206BB48 - push {r3, lr} - cmp r0, #0x0 - bne _0206BB58 - lsl r0, r1, #0x10 - lsr r0, r0, #0x10 - bl SpeciesToSinnohDexNo - add r1, r0, #0x0 -_0206BB58: - add r0, r1, #0x0 - pop {r3, pc} diff --git a/arm9/src/unk_0206BB28.c b/arm9/src/unk_0206BB28.c new file mode 100644 index 00000000..baaecc6a --- /dev/null +++ b/arm9/src/unk_0206BB28.c @@ -0,0 +1,25 @@ +#include "global.h" +#include "save_block_2.h" +#include "pokedex.h" +#include "pokemon.h" +#include "unk_0206BB28.h" + +#pragma thumb on + +BOOL FUN_0206BB28(struct SaveBlock2 * sav2) +{ + return FUN_0206BB34(Sav2_Pokedex_get(sav2)); +} + +BOOL FUN_0206BB34(struct Pokedex * pokedex) +{ + return Pokedex_GetNatDexFlag(pokedex) == TRUE; +} + +u32 FUN_0206BB48(BOOL isNationalDex, u32 species) +{ + if (!isNationalDex) + species = SpeciesToSinnohDexNo((u16)species); + return species; +} + diff --git a/include/pokedex.h b/include/pokedex.h index 11058569..891fddb5 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -2,6 +2,8 @@ #define POKEDIAMOND_POKEDEX_H #include "global.h" +#include "pokemon.h" +#include "save_block_2.h" struct Pokedex { diff --git a/include/unk_0206BB28.h b/include/unk_0206BB28.h new file mode 100644 index 00000000..ff60e220 --- /dev/null +++ b/include/unk_0206BB28.h @@ -0,0 +1,12 @@ +#ifndef POKEDIAMOND_UNK_0206BB28_H +#define POKEDIAMOND_UNK_0206BB28_H + +#include "save_block_2.h" +#include "pokedex.h" +#include "pokemon.h" + +BOOL FUN_0206BB28(struct SaveBlock2 * sav2); +BOOL FUN_0206BB34(struct Pokedex * pokedex); +u32 FUN_0206BB48(BOOL isNationalDex, u32 species); + +#endif //POKEDIAMOND_UNK_0206BB28_H |