summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm9/asm/unk_0202C144.s42
-rw-r--r--arm9/src/unk_0202C144.c18
-rw-r--r--include/unk_02029FBO.h10
3 files changed, 28 insertions, 42 deletions
diff --git a/arm9/asm/unk_0202C144.s b/arm9/asm/unk_0202C144.s
deleted file mode 100644
index fb5bc6c4..00000000
--- a/arm9/asm/unk_0202C144.s
+++ /dev/null
@@ -1,42 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start FUN_0202C144
-FUN_0202C144: ; 0x0202C144
- push {r3-r7, lr}
- add r4, r1, #0x0
- add r5, r0, #0x0
- add r0, r4, #0x0
- mov r1, #0x4c
- mov r2, #0x0
- bl GetMonData
- cmp r0, #0x0
- bne _0202C194
- add r0, r5, #0x0
- bl Sav2_Pokedex_get
- add r6, r0, #0x0
- add r0, r5, #0x0
- bl FUN_02029FC8
- add r7, r0, #0x0
- add r0, r4, #0x0
- mov r1, #0x5
- mov r2, #0x0
- bl GetMonData
- add r2, r0, #0x0
- lsl r2, r2, #0x10
- add r0, r7, #0x0
- add r1, r6, #0x0
- lsr r2, r2, #0x10
- bl FUN_0202A1C4
- add r0, r6, #0x0
- add r1, r4, #0x0
- bl Pokedex_SetMonCaughtFlag
- add r0, r5, #0x0
- bl Sav2_Poketch_get
- add r1, r4, #0x0
- bl Sav2_Poketch_PokemonHistoryAddMon
-_0202C194:
- pop {r3-r7, pc}
- .balign 4
diff --git a/arm9/src/unk_0202C144.c b/arm9/src/unk_0202C144.c
new file mode 100644
index 00000000..27125eb3
--- /dev/null
+++ b/arm9/src/unk_0202C144.c
@@ -0,0 +1,18 @@
+#include "global.h"
+#include "pokemon.h"
+#include "pokedex.h"
+#include "save_block_2.h"
+#include "unk_02029FBO.h"
+#include "poketch.h"
+
+THUMB_FUNC void FUN_0202C144(struct SaveBlock2 *sav2, struct Pokemon *pokemon) {
+ if (GetMonData(pokemon, MON_DATA_IS_EGG, NULL) == 0)
+ {
+ struct Pokedex *pokedex = Sav2_Pokedex_get(sav2);
+ void *unkSavStruct = FUN_02029FC8(sav2); /* SavArray_get(sav2, 20) */
+
+ FUN_0202A1C4(unkSavStruct, pokedex, GetMonData(pokemon, MON_DATA_SPECIES, NULL));
+ Pokedex_SetMonCaughtFlag(pokedex, pokemon);
+ Sav2_Poketch_PokemonHistoryAddMon(Sav2_Poketch_get(sav2), &pokemon->box);
+ }
+} \ No newline at end of file
diff --git a/include/unk_02029FBO.h b/include/unk_02029FBO.h
new file mode 100644
index 00000000..3d01a257
--- /dev/null
+++ b/include/unk_02029FBO.h
@@ -0,0 +1,10 @@
+#ifndef POKEDIAMOND_UNK_02029FBO_H
+#define POKEDIAMOND_UNK_02029FBO_H
+
+#include "save_block_2.h"
+#include "pokedex.h"
+
+void *FUN_02029FC8(struct SaveBlock2 *sav2);
+void *FUN_0202A1C4(void *unkSavStruct, struct Pokedex *pokedex, u16 species);
+
+#endif //POKEDIAMOND_UNK_02029FBO_H \ No newline at end of file