diff options
Diffstat (limited to 'arm9/src')
-rw-r--r-- | arm9/src/unk_02029FB0.c | 269 |
1 files changed, 269 insertions, 0 deletions
diff --git a/arm9/src/unk_02029FB0.c b/arm9/src/unk_02029FB0.c new file mode 100644 index 00000000..3ed3a8c4 --- /dev/null +++ b/arm9/src/unk_02029FB0.c @@ -0,0 +1,269 @@ +#include "global.h"
+#include "pokedex.h"
+#include "unk_02029FB0.h"
+
+const u16 UNK_020EEA7C[] = {
+ 0x0001, // 00
+ 0x0001, // 01
+ 0x0001, // 02
+ 0x0001, // 03
+ 0x0001, // 04
+ 0x0001, // 05
+ 0x0002, // 06
+ 0x0002, // 07
+ 0x0002, // 08
+ 0x0002, // 09
+ 0x0003, // 10
+ 0x0003, // 11
+ 0x0003, // 12
+ 0x0007, // 13
+ 0x0007, // 14
+ 0x0007, // 15
+ 0x000A, // 16
+ 0x000A, // 17
+ 0x000B, // 18
+ 0x000B, // 19
+ 0x000B, // 20
+ 0x000B, // 21
+ 0x0014, // 22
+ 0x001E, // 23
+ 0x0023, // 24
+ 0x0028, // 25
+ 0x01F4, // 26
+ 0x2710, // 27
+ 0x001E, // 28
+ 0x001E, // 29
+ 0x0002, // 30
+ 0x0005, // 31
+ 0x0001, // 32
+ 0x0001, // 33
+ 0x0005, // 34
+ 0x0003, // 35
+ 0x0001, // 36
+ 0x0001, // 37
+};
+
+u8 UNK_02105CD8[] = {
+ TRUE, // 000
+ TRUE, // 001
+ FALSE, // 002
+ TRUE, // 003
+ TRUE, // 004
+ TRUE, // 005
+ TRUE, // 006
+ TRUE, // 007
+ TRUE, // 008
+ FALSE, // 009
+ FALSE, // 010
+ FALSE, // 011
+ TRUE, // 012
+ TRUE, // 013
+ TRUE, // 014
+ TRUE, // 015
+ TRUE, // 016
+ TRUE, // 017
+ TRUE, // 018
+ TRUE, // 019
+ TRUE, // 020
+ TRUE, // 021
+ TRUE, // 022
+ TRUE, // 023
+ TRUE, // 024
+ TRUE, // 025
+ TRUE, // 026
+ TRUE, // 027
+ TRUE, // 028
+ TRUE, // 029
+ TRUE, // 030
+ TRUE, // 031
+ TRUE, // 032
+ TRUE, // 033
+ TRUE, // 034
+ TRUE, // 035
+ TRUE, // 036
+ TRUE, // 037
+ TRUE, // 038
+ TRUE, // 039
+ TRUE, // 040
+ FALSE, // 041
+ FALSE, // 042
+ FALSE, // 043
+ TRUE, // 044
+ TRUE, // 045
+ FALSE, // 046
+ TRUE, // 047
+ TRUE, // 048
+ FALSE, // 049
+ FALSE, // 050
+ FALSE, // 051
+ FALSE, // 052
+ FALSE, // 053
+ FALSE, // 054
+ FALSE, // 055
+ FALSE, // 056
+ FALSE, // 057
+ FALSE, // 058
+ FALSE, // 059
+ FALSE, // 060
+ FALSE, // 061
+ FALSE, // 062
+ FALSE, // 063
+ FALSE, // 064
+ FALSE, // 065
+ FALSE, // 066
+ TRUE, // 067
+ FALSE, // 068
+ FALSE, // 069
+ FALSE, // 070
+ FALSE, // 071
+ FALSE, // 072
+ FALSE, // 073
+ FALSE, // 074
+ FALSE, // 075
+ FALSE, // 076
+ FALSE, // 077
+ FALSE, // 078
+ FALSE, // 079
+ FALSE, // 080
+ FALSE, // 081
+ FALSE, // 082
+ FALSE, // 083
+ FALSE, // 084
+ TRUE, // 085
+ FALSE, // 086
+ FALSE, // 087
+ FALSE, // 088
+ FALSE, // 089
+ FALSE, // 090
+ FALSE, // 091
+ FALSE, // 092
+ FALSE, // 093
+ FALSE, // 094
+ FALSE, // 095
+ FALSE, // 096
+ FALSE, // 097
+ FALSE, // 098
+ FALSE, // 099
+ FALSE, // 100
+ FALSE, // 101
+ FALSE, // 102
+ FALSE, // 103
+ FALSE, // 104
+ FALSE, // 105
+ FALSE, // 106
+ FALSE, // 107
+ FALSE, // 108
+ FALSE, // 109
+ FALSE, // 110
+ FALSE, // 111
+ FALSE, // 112
+ FALSE, // 113
+ FALSE, // 114
+ FALSE, // 115
+ FALSE, // 116
+ FALSE, // 117
+ FALSE, // 118
+ FALSE, // 119
+ FALSE, // 120
+ FALSE, // 121
+};
+
+static inline s32 GetOffsetToUnk00(s32 a0)
+{
+ return a0;
+}
+
+static inline s32 GetOffsetToUnkB0(s32 a0)
+{
+ return a0 - 44;
+}
+
+THUMB_FUNC u32 FUN_02029FB0(void)
+{
+ return sizeof(struct UnkStruct_02029FB0);
+}
+
+THUMB_FUNC void FUN_02029FB8(struct UnkStruct_02029FB0 * ptr)
+{
+ MI_CpuClear32(ptr, sizeof(struct UnkStruct_02029FB0));
+}
+
+THUMB_FUNC struct UnkStruct_02029FB0 * FUN_02029FC8(struct SaveBlock2 * sav2)
+{
+ return SavArray_get(sav2, 20);
+}
+
+THUMB_FUNC u32 FUN_02029FD4(struct UnkStruct_02029FB0 * ptr, s32 a1)
+{
+ if (a1 < 44)
+ {
+ return ptr->unk_00[GetOffsetToUnk00(a1)];
+ }
+ else if (a1 < 121)
+ {
+ return ptr->unk_B0[GetOffsetToUnkB0(a1)];
+ }
+ else
+ {
+ GF_ASSERT(0);
+ return 0;
+ }
+}
+
+THUMB_FUNC u32 FUN_02029FF8(struct UnkStruct_02029FB0 * ptr, s32 a1, u32 a2)
+{
+ if (a1 < 44)
+ {
+ ptr->unk_00[GetOffsetToUnk00(a1)] = a2;
+ }
+ else if (a1 < 121)
+ {
+ ptr->unk_B0[GetOffsetToUnkB0(a1)] = a2;
+ }
+ else
+ {
+ GF_ASSERT(0);
+ }
+ return FUN_02029FD4(ptr, a1);
+}
+
+THUMB_FUNC u32 FUN_0202A028(s32 a0)
+{
+ if (a0 < 44)
+ {
+ if (UNK_02105CD8[a0])
+ return 999999999;
+ else
+ return 999999;
+ }
+ else if (a0 < 121)
+ {
+ if (UNK_02105CD8[a0])
+ return 0xFFFF;
+ else
+ return 9999;
+ }
+ else
+ {
+ GF_ASSERT(0);
+ return 0;
+ }
+}
+
+THUMB_FUNC u16 FUN_0202A070(s32 a0)
+{
+ return UNK_020EEA7C[a0];
+}
+
+THUMB_FUNC u32 FUN_0202A07C(struct UnkStruct_02029FB0 * ptr, s32 a1, u32 a2)
+{
+ u32 r2 = FUN_0202A028(a1);
+ if (a2 < r2)
+ {
+ return FUN_02029FF8(ptr, a1, a2);
+ }
+ else
+ {
+ return FUN_02029FF8(ptr, a1, r2);
+ }
+}
|