summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/GX_layers.h45
-rw-r--r--include/WIFI_stubsmd5_dummy.h11
-rw-r--r--include/constants/decorations.h144
-rw-r--r--include/error_handling.h2
-rw-r--r--include/error_message_reset.h28
-rw-r--r--include/font.h6
-rw-r--r--include/gf_gfx_loader.h23
-rw-r--r--include/gf_rtc.h31
-rw-r--r--include/global.h2
-rw-r--r--include/heap.h26
-rw-r--r--include/list_menu.h88
-rw-r--r--include/list_menu_cursor.h17
-rw-r--r--include/list_menu_items.h21
-rw-r--r--include/main.h30
-rw-r--r--include/overlay_manager.h4
-rw-r--r--include/sav_chatot.h24
-rw-r--r--include/sav_system_info.h2
-rw-r--r--include/scrcmd.h185
-rw-r--r--include/script.h11
-rw-r--r--include/script_buffers.h5
-rw-r--r--include/sdat.h47
-rw-r--r--include/sound.h33
-rw-r--r--include/text.h86
-rw-r--r--include/text_02054590.h19
-rw-r--r--include/timer3.h12
-rw-r--r--include/unk_0200BA78.h19
-rw-r--r--include/unk_0200BB14.h243
-rw-r--r--include/unk_0200CA44.h10
-rw-r--r--include/unk_02015E30.h6
-rw-r--r--include/unk_02016B94.h340
-rw-r--r--include/unk_02022504.h14
-rw-r--r--include/unk_02024E64.h20
-rw-r--r--include/unk_02025484.h2
-rw-r--r--include/unk_020286F8.h4
-rw-r--r--include/unk_0202D858.h10
-rw-r--r--include/unk_0202E29C.h142
-rw-r--r--include/unk_0202F150.h182
-rw-r--r--include/unk_02031480.h30
-rw-r--r--include/unk_02031734.h215
-rw-r--r--include/unk_02033778.h9
-rw-r--r--include/unk_020337E8.h25
-rw-r--r--include/unk_020377F0.h30
-rw-r--r--include/unk_0204639C.h12
-rw-r--r--include/unk_0204B0A0.h25
-rw-r--r--include/unk_0205FA2C.h57
-rw-r--r--include/unk_0206015C.h30
-rw-r--r--include/unk_0206439C.h15
-rw-r--r--include/unk_0208890C.h25
-rw-r--r--include/unk_02088DD8.h19
-rw-r--r--include/unk_0208A300.h17
50 files changed, 2025 insertions, 378 deletions
diff --git a/include/GX_layers.h b/include/GX_layers.h
index e94fb4ec..3943d582 100644
--- a/include/GX_layers.h
+++ b/include/GX_layers.h
@@ -3,9 +3,6 @@
#include "global.h"
-#include "GX_vramcnt.h"
-#include "error_message_reset.h"
-#include "gx.h"
struct GX_LayerData
{
@@ -20,14 +17,38 @@ typedef enum {
} GX_LayerToggle;
-THUMB_FUNC void GX_SetBanks(const struct GraphicsBanks *banks);
-THUMB_FUNC void GX_DisableEngineALayers();
-THUMB_FUNC void GX_EngineAToggleLayers(u32 layer_mask, GX_LayerToggle layer_toggle);
-THUMB_FUNC void GX_SetEngineALayers(u32 layer_mask);
-THUMB_FUNC void GX_DisableEngineBLayers();
-THUMB_FUNC void GX_EngineBToggleLayers(u32 layer_mask, GX_LayerToggle layer_toggle);
-THUMB_FUNC void GX_BothDispOn();
-THUMB_FUNC void GX_SwapDisplay();
-THUMB_FUNC u32 GX_GetEngineALayers();
+struct GraphicsBanks
+{
+ s32 bg;
+ s32 bgextpltt;
+ s32 subbg;
+ s32 subbgextpltt;
+ s32 obj;
+ s32 objextpltt;
+ s32 subobj;
+ s32 subobjextpltt;
+ s32 tex;
+ s32 texpltt;
+};
+
+
+struct GraphicsModes {
+ u32 mode1;
+ u32 mode2;
+ u32 mode3;
+ u32 mode4;
+};
+
+
+
+void GX_SetBanks(const struct GraphicsBanks *banks);
+void GX_DisableEngineALayers();
+void GX_EngineAToggleLayers(u32 layer_mask, GX_LayerToggle layer_toggle);
+void GX_SetEngineALayers(u32 layer_mask);
+void GX_DisableEngineBLayers();
+void GX_EngineBToggleLayers(u32 layer_mask, GX_LayerToggle layer_toggle);
+void GX_BothDispOn();
+void GX_SwapDisplay();
+u32 GX_GetEngineALayers();
#endif //POKEDIAMOND_GX_LAYERS_H
diff --git a/include/WIFI_stubsmd5_dummy.h b/include/WIFI_stubsmd5_dummy.h
new file mode 100644
index 00000000..d82b55c5
--- /dev/null
+++ b/include/WIFI_stubsmd5_dummy.h
@@ -0,0 +1,11 @@
+#ifndef POKEDIAMOND_WIFI_STUBSMD5_DUMMY_H
+#define POKEDIAMOND_WIFI_STUBSMD5_DUMMY_H
+
+#include "nitro/types.h"
+#include "dgt.h"
+
+void MD5Final(u8 *digest, struct DGTHash1Context *context);
+void MD5Update(struct DGTHash1Context *context, u8 *input, u32 length);
+void MD5Init(struct DGTHash1Context *context);
+
+#endif //POKEDIAMOND_WIFI_STUBSMD5_DUMMY_H
diff --git a/include/constants/decorations.h b/include/constants/decorations.h
new file mode 100644
index 00000000..e9b4e947
--- /dev/null
+++ b/include/constants/decorations.h
@@ -0,0 +1,144 @@
+#ifndef POKEDIAMOND_DECORATIONS_H
+#define POKEDIAMOND_DECORATIONS_H
+
+#define DECORATION_NONE 0
+#define DECORATION_DUMMY_1 1
+#define DECORATION_DUMMY_2 2
+#define DECORATION_DUMMY_3 3
+#define DECORATION_DUMMY_4 4
+#define DECORATION_DUMMY_5 5
+#define DECORATION_BIG_BOULDER 6
+#define DECORATION_YELLOW_CUSHION 7
+#define DECORATION_BLUE_CUSHION 8
+#define DECORATION_WOODEN_CHAIR 9
+#define DECORATION_BIG_TABLE 10
+#define DECORATION_PLAIN_TABLE 11
+#define DECORATION_SMALL_TABLE 12
+#define DECORATION_LONG_TABLE 13
+#define DECORATION_WIDE_TABLE 14
+#define DECORATION_POKE_TABLE 15
+#define DECORATION_BIG_BOOKSHELF 16
+#define DECORATION_SMALL_BOOKSHELF 17
+#define DECORATION_RESEARCH_SHELF 18
+#define DECORATION_BIKE_RACK 19
+#define DECORATION_SHOP_SHELF 20
+#define DECORATION_DISPLAY_SHELF 21
+#define DECORATION_CUPBOARD 22
+#define DECORATION_WOOD_DRESSER 23
+#define DECORATION_PINK_DRESSER 24
+#define DECORATION_TV 25
+#define DECORATION_REFRIGERATOR 26
+#define DECORATION_PRETTY_SINK 27
+#define DECORATION_FEATHERY_BED 28
+#define DECORATION_TRASH_CAN 29
+#define DECORATION_CARDBOARD_BOX 30
+#define DECORATION_CRATE 31
+#define DECORATION_CONTAINER 32
+#define DECORATION_OIL_DRUM 33
+#define DECORATION_BIG_OIL_DRUM 34
+#define DECORATION_IRON_BEAM 35
+#define DECORATION_POTTED_PLANT 36
+#define DECORATION_POKE_FLOWER 37
+#define DECORATION_HEALING_MACHINE 38
+#define DECORATION_LAB_MACHINE 39
+#define DECORATION_TEST_MACHINE 40
+#define DECORATION_GAME_SYSTEM 41
+#define DECORATION_VENDING_MACHINE 42
+#define DECORATION_RED_BIKE 43
+#define DECORATION_GREEN_BIKE 44
+#define DECORATION_BINOCULARS 45
+#define DECORATION_GLOBE 46
+#define DECORATION_GYM_STATUE 47
+#define DECORATION_RED_TENT 48
+#define DECORATION_BLUE_TENT 49
+#define DECORATION_CLEAR_TENT 50
+#define DECORATION_MAZE_BLOCK_1 51
+#define DECORATION_MAZE_BLOCK_2 52
+#define DECORATION_MAZE_BLOCK_3 53
+#define DECORATION_MAZE_BLOCK_4 54
+#define DECORATION_MAZE_BLOCK_5 55
+#define DECORATION_HOLE_TOOL 56
+#define DECORATION_PIT_TOOL 57
+#define DECORATION_SMOKE_TOOL 58
+#define DECORATION_BIG_SMOKE_TOOL 59
+#define DECORATION_ROCK_TOOL 60
+#define DECORATION_ROCKFALL_TOOL 61
+#define DECORATION_FOAM_TOOL 62
+#define DECORATION_BUBBLE_TOOL 63
+#define DECORATION_ALERT_TOOL_1 64
+#define DECORATION_ALERT_TOOL_2 65
+#define DECORATION_ALERT_TOOL_3 66
+#define DECORATION_ALERT_TOOL_4 67
+#define DECORATION_LEAF_TOOL 68
+#define DECORATION_FLOWER_TOOL 69
+#define DECORATION_EMBER_TOOL 70
+#define DECORATION_FIRE_TOOL 71
+#define DECORATION_CUTE_CUP 72
+#define DECORATION_COOL_CUP 73
+#define DECORATION_BEAUTY_CUP 74
+#define DECORATION_TOUGH_CUP 75
+#define DECORATION_CLEVER_CUP 76
+#define DECORATION_BLUE_CRYSTAL 77
+#define DECORATION_PINK_CRYSTAL 78
+#define DECORATION_RED_CRYSTAL 79
+#define DECORATION_YELLOW_CRYSTAL 80
+#define DECORATION_PRETTY_GEM 81
+#define DECORATION_SHINY_GEM 82
+#define DECORATION_MYSTIC_GEM 83
+#define DECORATION_GLITTER_GEM 84
+#define DECORATION_BRONZE_TROPHY 85
+#define DECORATION_SILVER_TROPHY 86
+#define DECORATION_GOLD_TROPHY 87
+#define DECORATION_GREAT_TROPHY 88
+#define DECORATION_BALL_ORNAMENT 89
+#define DECORATION_ROUND_ORNAMENT 90
+#define DECORATION_CLEAR_ORNAMENT 91
+#define DECORATION_CHARMANDER_DOLL 92
+#define DECORATION_BULBASAUR_DOLL 93
+#define DECORATION_SQUIRTLE_DOLL 94
+#define DECORATION_CYNDAQUIL_DOLL 95
+#define DECORATION_CHIKORITA_DOLL 96
+#define DECORATION_TOTODILE_DOLL 97
+#define DECORATION_TORCHIC_DOLL 98
+#define DECORATION_TREECKO_DOLL 99
+#define DECORATION_MUDKIP_DOLL 100
+#define DECORATION_CHIMCHAR_DOLL 101
+#define DECORATION_TURTWIG_DOLL 102
+#define DECORATION_PIPLUP_DOLL 103
+#define DECORATION_PIKACHU_DOLL 104
+#define DECORATION_PLUSLE_DOLL 105
+#define DECORATION_MINUN_DOLL 106
+#define DECORATION_CLEFAIRY_DOLL 107
+#define DECORATION_JIGGLYPUFF_DOLL 108
+#define DECORATION_WOBBUFFET_DOLL 109
+#define DECORATION_MEOWTH_DOLL 110
+#define DECORATION_SKITTY_DOLL 111
+#define DECORATION_GLAMEOW_DOLL 112
+#define DECORATION_BUNEARY_DOLL 113
+#define DECORATION_WEAVILE_DOLL 114
+#define DECORATION_MUNCHLAX_DOLL 115
+#define DECORATION_BONSLY_DOLL 116
+#define DECORATION_MIME_JR__DOLL 117
+#define DECORATION_LUCARIO_DOLL 118
+#define DECORATION_MANTYKE_DOLL 119
+#define DECORATION_BUIZEL_DOLL 120
+#define DECORATION_CHATOT_DOLL 121
+#define DECORATION_MANAPHY_DOLL 122
+#define DECORATION_SNORLAX_DOLL 123
+#define DECORATION_WAILORD_DOLL 124
+#define DECORATION_MAGNEZONE_DOLL 125
+#define DECORATION_DRIFLOON_DOLL 126
+#define DECORATION_HAPPINY_DOLL 127
+#define DECORATION_PACHIRISU_DOLL 128
+#define DECORATION_129 129
+#define DECORATION_130 130
+#define DECORATION_131 131
+#define DECORATION_132 132
+#define DECORATION_WIDE_SOFA 133
+#define DECORATION_BONSAI 134
+#define DECORATION_DAINTY_FLOWERS 135
+#define DECORATION_LOVELY_FLOWERS 136
+#define DECORATION_PRETTY_FLOWERS 137
+#define DECORATION_LAVISH_FLOWERS 138
+
+#endif //POKEDIAMOND_DECORATIONS_H
diff --git a/include/error_handling.h b/include/error_handling.h
index 1299fcba..c14c93fe 100644
--- a/include/error_handling.h
+++ b/include/error_handling.h
@@ -1,6 +1,6 @@
#ifndef POKEDIAMOND_ERROR_HANDLING_H
#define POKEDIAMOND_ERROR_HANDLING_H
-void ErrorHandling(void);
+void GF_AssertFail(void);
#endif //POKEDIAMOND_ERROR_HANDLING_H
diff --git a/include/error_message_reset.h b/include/error_message_reset.h
index d12cbf33..01286ca9 100644
--- a/include/error_message_reset.h
+++ b/include/error_message_reset.h
@@ -9,31 +9,7 @@
#include "text.h"
-
-struct GraphicsBanks
-{
- s32 bg;
- s32 bgextpltt;
- s32 subbg;
- s32 subbgextpltt;
- s32 obj;
- s32 objextpltt;
- s32 subobj;
- s32 subobjextpltt;
- s32 tex;
- s32 texpltt;
-};
-
-
-struct GraphicsModes {
- u32 mode1;
- u32 mode2;
- u32 mode3;
- u32 mode4;
-};
-
-
-THUMB_FUNC void VBlankHandler();
-THUMB_FUNC void PrintErrorMessageAndReset();
+void VBlankHandler();
+void PrintErrorMessageAndReset();
#endif //POKEDIAMOND_ERROR_MESSAGE_RESET_H
diff --git a/include/font.h b/include/font.h
new file mode 100644
index 00000000..e5e64e88
--- /dev/null
+++ b/include/font.h
@@ -0,0 +1,6 @@
+#ifndef POKEDIAMOND_FONT_H
+#define POKEDIAMOND_FONT_H
+
+extern s32 GetFontAttribute(u8 fontId, s32 attr);
+
+#endif // POKEDIAMOND_FONT_H
diff --git a/include/gf_gfx_loader.h b/include/gf_gfx_loader.h
new file mode 100644
index 00000000..b95075dc
--- /dev/null
+++ b/include/gf_gfx_loader.h
@@ -0,0 +1,23 @@
+#ifndef POKEDIAMOND_GF_GFX_LOADER_H
+#define POKEDIAMOND_GF_GFX_LOADER_H
+
+#include "unk_02016B94.h"
+
+u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct UnkStruct_02016B94_2 * unkStruct02016B94_2, u32 a3, u32 a4, u32 szByte, BOOL isCompressed, u32 heap_id);
+void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct UnkStruct_02016B94_2 * unkStruct02016B94_2, u32 a3, u32 a4, u32 szByte, BOOL isCompressed, u32 heap_id);
+void GfGfxLoader_GXLoadPal(NarcId narcId, s32 memberNo, u32 whichRoutine, u32 baseAddr, u32 szByte, u32 heap_id);
+void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, u32 whichRoutine, u32 srcOffset, u32 baseAddr, u32 szByte, u32 heap_id);
+u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 whichRoutine, u32 baseAddr, u32 szByte, BOOL isCompressed, u32 heap_id);
+void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heap_id, NNSG2dImagePaletteProxy * pPltProxy);
+u32 GfGfxLoader_LoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 whichRoutine, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, u32 heap_id, NNSG2dImageProxy *pImgProxy);
+void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 whichRoutine, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, u32 heap_id, NNSG2dImageProxy * pImageProxy);
+void * GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCharacterData ** ppCharData, u32 heap_id);
+void * GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dScreenData ** ppScrData, u32 heap_id);
+void * GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData ** ppPltData, u32 heap_id);
+void * GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCellDataBank ** ppCellBank, u32 heap_id);
+void * GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dAnimBankData ** ppAnimBank, u32 heap_id);
+void * GfGfxLoader_UncompressFromNarc(NarcId narcId, s32 memberId, u32 heap_id);
+void * GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd);
+void * GfGfxLoader_LoadFromNarc_GetSizeOut(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd, u32 *size_p);
+
+#endif //POKEDIAMOND_GF_GFX_LOADER_H
diff --git a/include/gf_rtc.h b/include/gf_rtc.h
new file mode 100644
index 00000000..f7a4e2a7
--- /dev/null
+++ b/include/gf_rtc.h
@@ -0,0 +1,31 @@
+#ifndef POKEDIAMOND_GF_RTC_H
+#define POKEDIAMOND_GF_RTC_H
+
+#include "RTC_api.h"
+
+enum RTC_Month
+{
+ RTC_MONTH_JANUARY = 1,
+ RTC_MONTH_FEBRUARY,
+ RTC_MONTH_MARCH,
+ RTC_MONTH_APRIL,
+ RTC_MONTH_MAY,
+ RTC_MONTH_JUNE,
+ RTC_MONTH_JULY,
+ RTC_MONTH_AUGUST,
+ RTC_MONTH_SEPTEMBER,
+ RTC_MONTH_OCTOBER,
+ RTC_MONTH_NOVEMBER,
+ RTC_MONTH_DECEMBER,
+};
+
+enum RTC_TimeOfDay
+{
+ RTC_TIMEOFDAY_MORN = 0,
+ RTC_TIMEOFDAY_DAY,
+ RTC_TIMEOFDAY_EVE,
+ RTC_TIMEOFDAY_NITE,
+ RTC_TIMEOFDAY_LATE,
+};
+
+#endif //POKEDIAMOND_GF_RTC_H
diff --git a/include/global.h b/include/global.h
index 1c92a1ec..1853dbc3 100644
--- a/include/global.h
+++ b/include/global.h
@@ -11,7 +11,7 @@
#define NELEMS(a) (sizeof(a) / sizeof(*(a)))
-#define GF_ASSERT(expr) do {if (!(expr)) ErrorHandling();} while (0)
+#define GF_ASSERT(expr) do {if (!(expr)) GF_AssertFail();} while (0)
#ifndef IN_MAIN_C
extern const u8 gGameLanguage;
diff --git a/include/heap.h b/include/heap.h
index 69aedd9e..de1f5f18 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -17,21 +17,21 @@ struct UnkStruct_020166C8
};
-THUMB_FUNC void FUN_020166C8(u32 *param0, u32 param1, u32 param2, u32 pre_size);
-THUMB_FUNC s32 FUN_020167F4();
-THUMB_FUNC u32 FUN_0201681C(u32 param0, u32 heap_id, u32 param2);
-THUMB_FUNC u32 FUN_02016828(u32 param0, u32 param1, u32 param2);
-THUMB_FUNC u32 FUN_02016834(u32 param0, u32 param1, u32 param2, s32 param3);
-THUMB_FUNC void FUN_020168D0(u32 heap_id);
-THUMB_FUNC u32 *FUN_02016944(void *param0, u32 param1, s32 param2, u32 param3);
-THUMB_FUNC void FUN_02016988();
+void FUN_020166C8(u32 *param0, u32 param1, u32 param2, u32 pre_size);
+s32 FUN_020167F4();
+u32 FUN_0201681C(u32 param0, u32 heap_id, u32 param2);
+u32 FUN_02016828(u32 param0, u32 param1, u32 param2);
+u32 FUN_02016834(u32 param0, u32 param1, u32 param2, s32 param3);
+void FUN_020168D0(u32 heap_id);
+u32 *FUN_02016944(void *param0, u32 param1, s32 param2, u32 param3);
+void FUN_02016988();
void *AllocFromHeap(u32 heap_id, u32 size);
void *AllocFromHeapAtEnd(u32 heap_id, u32 size);
void FreeToHeap(void *ptr);
-void FUN_02016A8C(u32 heap_id, void * ptr);
-THUMB_FUNC u32 FUN_02016AF8(u32 param0);
-THUMB_FUNC void FUN_02016B20(u32 param0, u32 param1, u32 param2);
-THUMB_FUNC void FUN_02016B44(void *ptr, u32 param1);
-THUMB_FUNC u32 FUN_02016B90(u32 param0);
+void FreeToHeapExplicit(u32 heap_id, void * ptr);
+u32 FUN_02016AF8(u32 param0);
+void FUN_02016B20(u32 param0, u32 param1, u32 param2);
+void FUN_02016B44(void *ptr, u32 param1);
+u32 FUN_02016B90(u32 param0);
#endif //POKEDIAMOND_HEAP_H
diff --git a/include/list_menu.h b/include/list_menu.h
new file mode 100644
index 00000000..a02e1273
--- /dev/null
+++ b/include/list_menu.h
@@ -0,0 +1,88 @@
+#ifndef POKEDIAMOND_LIST_MENU_H
+#define POKEDIAMOND_LIST_MENU_H
+
+#include "list_menu_cursor.h"
+#include "list_menu_items.h"
+
+#define LIST_HEADER -3
+#define LIST_CANCEL -2
+#define LIST_NOTHING_CHOSEN -1
+
+#define LIST_NO_MULTIPLE_SCROLL 0
+#define LIST_MULTIPLE_SCROLL_DPAD 1
+#define LIST_MULTIPLE_SCROLL_L_R 2
+
+struct ListMenu;
+
+// TODO: Document remaining fields.
+// A lot of these are named based on similar fields in gen 3.
+
+typedef void (*LM_MoveCursorFunc_t)(struct ListMenu *list, s32 index, u8 onInit);
+typedef void (*LM_ItemPrintFunc_t)(struct ListMenu *list, s32 index, u8 y);
+
+struct ListMenuTemplate
+{
+ /*0x00*/ struct ListMenuItem * items;
+ /*0x04*/ LM_MoveCursorFunc_t moveCursorFunc;
+ /*0x08*/ LM_ItemPrintFunc_t itemPrintFunc;
+ /*0x0C*/ struct Window * window;
+ /*0x10*/ u16 totalItems;
+ /*0x12*/ u16 maxShowed;
+ /*0x14*/ u8 header_X;
+ /*0x15*/ u8 item_X;
+ /*0x16*/ u8 cursor_X;
+ /*0x17*/ u8 upText_Y:4;
+ u8 cursorPal:4;
+ /*0x18*/ u8 fillValue:4;
+ u8 cursorShadowPal:4;
+ /*0x1A*/ u16 lettersSpacing:3;
+ u16 itemVerticalPadding:4;
+ u16 scrollMultiple:2;
+ u16 fontId:6;
+ u16 cursorKind:1;
+ /*0x1C*/ u32 unk_1C;
+};
+
+struct ListMenu
+{
+ /*0x00*/ struct ListMenuTemplate template;
+ // ListMenuOverride from gen 3
+ /*0x20*/ u8 cursorPal:4;
+ u8 fillValue:4;
+ /*0x21*/ u8 cursorShadowPal:4;
+ u8 unk_21_4:4;
+ /*0x22*/ u8 lettersSpacing:6;
+ /*0x23*/ u8 unk_23;
+ /*0x24*/ u8 fontId:7;
+ u8 overrideEnabled:1;
+ /*0x28*/ struct ListMenuCursor *cursor;
+ /*0x2c*/ u16 cursorPos;
+ /*0x2e*/ u16 itemsAbove;
+ /*0x30*/ u8 unk_30;
+ /*0x31*/ u8 unk_31;
+ /*0x32*/ u8 taskId;
+ /*0x33*/ u8 unk_33;
+ /*0x34*/ u8 heap_id;
+};
+
+struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u32 heap_id);
+s32 ListMenu_ProcessInput(struct ListMenu * list);
+void DestroyListMenu(struct ListMenu * list, u16 * cursorPos, u16 * itemsAbove);
+void RedrawListMenu(struct ListMenu * list);
+s32 ListMenuTestInputInternal(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 updateFlag, u16 input, u16 *newCursorPos, u16 *newItemsAbove);
+s32 ListMenuTestInput(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 input, u16 *newCursorPos, u16 *newItemsAbove);
+void ListMenuOverrideSetColors(struct ListMenu * list, u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
+void ListMenuGetCurrentItemArrayId(struct ListMenu * list, u16 * index_p);
+void ListMenuGetScrollAndRow(struct ListMenu * list, u16 * cursorPos_p, u16 * itemsAbove_p);
+u8 ListMenuGetUnk33(struct ListMenu * list);
+s32 ListMenuGetValueByArrayId(struct ListMenu * list, s32 index);
+s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr);
+void ListMenuSetTemplateField(struct ListMenu * list, u32 attr, s32 value);
+void ListMenuGetItemStr(struct ListMenu * list, struct ListMenuItem * items);
+void ListMenuPrint(struct ListMenu * list, struct String * str, u8 x, u8 y);
+void ListMenuErasePrintedCursor(struct ListMenu * list, u16 itemsAbove);
+u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, u8 movingDown);
+void ListMenuScroll(struct ListMenu * list, u8 count, u8 movingDown);
+void ListMenuCopyToVram(struct ListMenu * list);
+
+#endif // POKEDIAMOND_LIST_MENU_H
diff --git a/include/list_menu_cursor.h b/include/list_menu_cursor.h
new file mode 100644
index 00000000..e4a4b6b9
--- /dev/null
+++ b/include/list_menu_cursor.h
@@ -0,0 +1,17 @@
+#ifndef POKEDIAMOND_LIST_MENU_CURSOR_H
+#define POKEDIAMOND_LIST_MENU_CURSOR_H
+
+#include "unk_02016B94.h"
+
+// TODO: Move to its own header, and fill it out
+struct ListMenuCursor
+{
+ // ???
+};
+
+extern struct ListMenuCursor * ListMenuCursorNew(u32 heap_id);
+extern void ListMenuUpdateCursorObj(struct ListMenuCursor *, struct Window *, u8 x, u8 y);
+extern void ListMenuCursorSetColor(struct ListMenuCursor *, u32);
+extern void DestroyListMenuCursorObj(struct ListMenuCursor *);
+
+#endif // POKEDIAMOND_LIST_MENU_CURSOR_H
diff --git a/include/list_menu_items.h b/include/list_menu_items.h
new file mode 100644
index 00000000..ec96d480
--- /dev/null
+++ b/include/list_menu_items.h
@@ -0,0 +1,21 @@
+#ifndef POKEDIAMOND_LIST_MENU_ITEMS_H
+#define POKEDIAMOND_LIST_MENU_ITEMS_H
+
+#include "string16.h"
+#include "msgdata.h"
+
+struct ListMenuItem
+{
+ struct String * text;
+ s32 value;
+};
+
+struct ListMenuItem * ListMenuItems_ctor(u32 count, u32 heap_id);
+void ListMenuItems_dtor(struct ListMenuItem * items);
+void ListMenuItems_AppendFromMsgData(struct ListMenuItem * items, struct MsgData * msgData, u32 msgNo, s32 value);
+void ListMenuItems_AddItem(struct ListMenuItem * items, struct String * str, s32 value);
+void ListMenuItems_CopyItem(struct ListMenuItem * items, struct ListMenuItem * src);
+struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, u32 * heap_id_p);
+void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items);
+
+#endif // POKEDIAMOND_LIST_MENU_ITEMS_H
diff --git a/include/main.h b/include/main.h
index d40e22f9..9227d9a8 100644
--- a/include/main.h
+++ b/include/main.h
@@ -20,7 +20,7 @@ struct UnkStruct_02006234
struct Unk21DBE18 ovly_mgr;
u32 unk10;
u32 unk14;
- int * unk18;
+ s32 * unk18;
void * unk1C;
struct SaveBlock2 * unk20;
u32 unk24;
@@ -31,9 +31,9 @@ struct Unk2106FA0
PMBackLightSwitch unk0;
s32 unk4;
FSOverlayID unk8;
- s32 unkC;
+ struct UnkStruct_02006234 *unkC;
FSOverlayID unk10;
- struct Unk21DBE18 * unk14;
+ const struct Unk21DBE18 * unk14;
s32 unk18;
s32 unk1C;
struct SaveBlock2 * unk20;
@@ -84,8 +84,8 @@ struct Main
u32 unk3C;
u32 unk40;
u32 unk44;
- u32 unk48;
- u32 unk4C;
+ u32 newKeys;
+ u32 newAndRepeatedKeys;
s32 unk50;
s32 unk54;
s32 unk58;
@@ -104,8 +104,22 @@ struct Main
//extern struct UnkStruct_021C4918 gMain + 0x60;
-extern struct Unk2106FA0 gBacklightTop;
-extern struct Unk2106FA0 gBacklightTop_2; // same as the first one, it's referenced twice in the constant pool...
+extern PMBackLightSwitch gBacklightTop;
+extern s32 UNK_02016FA4;
+
+struct UnkStruct_02016FA8
+{
+ FSOverlayID unk0;
+ struct UnkStruct_02006234 *unk4;
+ FSOverlayID unk8;
+ const struct Unk21DBE18 * unkC;
+ s32 unk10;
+ s32 unk14;
+ struct SaveBlock2 * unk18;
+
+};
+
+extern struct UnkStruct_02016FA8 UNK_02016FA8;
void NitroMain(void);
@@ -113,7 +127,7 @@ extern struct Main gMain;
void FUN_02000DF4(void);
void Main_RunOverlayManager(void);
-void RegisterMainOverlay(FSOverlayID id, struct Unk21DBE18 * arg1);
+void RegisterMainOverlay(FSOverlayID id, const struct Unk21DBE18 * arg1);
void FUN_02000E9C(void);
void FUN_02000EC8(u32 parameter);
void FUN_02000EE8(void);
diff --git a/include/overlay_manager.h b/include/overlay_manager.h
index 193bc7e8..8d9bd6e3 100644
--- a/include/overlay_manager.h
+++ b/include/overlay_manager.h
@@ -5,12 +5,12 @@
struct Unk21DBE18;
-struct UnkStruct_02006234 * OverlayManager_new(struct Unk21DBE18 * ovly_mgr, int * a1, u32 heap_id);
+struct UnkStruct_02006234 * OverlayManager_new(const struct Unk21DBE18 * ovly_mgr, s32 * a1, u32 heap_id);
void OverlayManager_delete(struct UnkStruct_02006234 * a0);
void * OverlayManager_CreateAndGetData(struct UnkStruct_02006234 * a0, u32 size, u32 heap_id);
void * OverlayManager_GetData(struct UnkStruct_02006234 * a0);
void OverlayManager_FreeData(struct UnkStruct_02006234 * a0);
-int * OverlayManager_GetField18(struct UnkStruct_02006234 * a0);
+s32 * OverlayManager_GetField18(struct UnkStruct_02006234 * a0);
BOOL OverlayManager_Run(struct UnkStruct_02006234 * a0);
#endif //POKEDIAMOND_OVERLAY_MANAGER_H
diff --git a/include/sav_chatot.h b/include/sav_chatot.h
new file mode 100644
index 00000000..858423c5
--- /dev/null
+++ b/include/sav_chatot.h
@@ -0,0 +1,24 @@
+#ifndef POKEDIAMOND_SAV_CHATOT_H
+#define POKEDIAMOND_SAV_CHATOT_H
+
+#include "save_block_2.h"
+
+struct SaveChatotSoundClip
+{
+ // TODO: Fill this in
+ BOOL exists;
+ s8 data[1000];
+};
+
+u32 Sav2_Chatot_sizeof(void);
+void Sav2_Chatot_init(struct SaveChatotSoundClip * chatot);
+struct SaveChatotSoundClip * Chatot_new(u32 heap_id);
+struct SaveChatotSoundClip * Sav2_Chatot_get(struct SaveBlock2 * sav2);
+BOOL Chatot_exists(struct SaveChatotSoundClip * chatot);
+void Chatot_invalidate(struct SaveChatotSoundClip * chatot);
+s8 * Chatot_GetData(struct SaveChatotSoundClip * chatot);
+void Chatot_Decode(s8 * dest, const s8 * data);
+void Chatot_Encode(struct SaveChatotSoundClip * chatot, const s8 * data);
+void Chatot_copy(struct SaveChatotSoundClip * dest, const struct SaveChatotSoundClip * src);
+
+#endif //POKEDIAMOND_SAV_CHATOT_H
diff --git a/include/sav_system_info.h b/include/sav_system_info.h
index 696cfe07..bded91f7 100644
--- a/include/sav_system_info.h
+++ b/include/sav_system_info.h
@@ -3,6 +3,8 @@
#include "RTC_api.h"
+struct SaveBlock2;
+
struct UnkSaveStruct_0202376C_sub
{
/* 0x00 */ u32 field_00;
diff --git a/include/scrcmd.h b/include/scrcmd.h
index 120a0c96..91cb306c 100644
--- a/include/scrcmd.h
+++ b/include/scrcmd.h
@@ -67,7 +67,7 @@ BOOL ScrCmd_Unk01FC(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01FD(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01FE(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01FF(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk026D(struct ScriptContext* ctx);
+BOOL ScrCmd_MessageUnown(struct ScriptContext* ctx);
BOOL ScrCmd_Unk002C(struct ScriptContext* ctx);
BOOL ScrCmd_Unk002D(struct ScriptContext* ctx);
BOOL ScrCmd_Unk02C0(struct ScriptContext* ctx);
@@ -77,9 +77,9 @@ BOOL ScrCmd_Unk002F(struct ScriptContext* ctx);
BOOL ScrCmd_WaitButtonAB(struct ScriptContext* ctx);
BOOL ScrCmd_WaitButtonABTime(struct ScriptContext *ctx);
BOOL ScrCmd_WaitButton(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0032(struct ScriptContext *ctx);
+BOOL ScrCmd_WaitButtonABPad(struct ScriptContext *ctx);
BOOL ScrCmd_Unk0033(struct ScriptContext *ctx);
-BOOL ScrCmd_Unk0034(struct ScriptContext* ctx);
+BOOL ScrCmd_CloseMessageBox(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0035(struct ScriptContext* ctx);
BOOL ScrCmd_ScrollBg(struct ScriptContext* ctx);
BOOL ScrCmd_CreateMessageBox(struct ScriptContext* ctx);
@@ -105,38 +105,46 @@ BOOL ScrCmd_Unk0047(struct ScriptContext *ctx);
BOOL ScrCmd_Unk0048(struct ScriptContext *ctx);
BOOL ScrCmd_Unk02CF(struct ScriptContext *ctx);
BOOL ScrCmd_Unk02D0(struct ScriptContext *ctx);
+BOOL ScrCmd_Unk005E(struct ScriptContext *ctx);
+
+// scrcmd_mart.c
+BOOL ScrCmd_NormalMart(struct ScriptContext * ctx);
+BOOL ScrCmd_SpecialMart(struct ScriptContext * ctx);
+BOOL ScrCmd_GoodsMart(struct ScriptContext * ctx);
+BOOL ScrCmd_SealsMart(struct ScriptContext * ctx);
+BOOL ScrCmd_AccessoriesShop(struct ScriptContext * ctx);
//scrcmd_4.c
BOOL ScrCmd_GetPlayerName(struct ScriptContext* ctx);
BOOL ScrCmd_GetRivalName(struct ScriptContext* ctx);
BOOL ScrCmd_GetFriendName(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk00D0(struct ScriptContext* ctx);
+BOOL ScrCmd_GetPokemonName(struct ScriptContext* ctx);
BOOL ScrCmd_GetItemName(struct ScriptContext* ctx);
BOOL ScrCmd_GetPocketName(struct ScriptContext* ctx);
BOOL ScrCmd_GetTMHMMoveName(struct ScriptContext* ctx);
BOOL ScrCmd_GetMoveName(struct ScriptContext* ctx);
BOOL ScrCmd_Unk00D5(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0280(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk00D6(struct ScriptContext* ctx);
+BOOL ScrCmd_GetPokemonNickname(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0251(struct ScriptContext* ctx);
BOOL ScrCmd_GetPoketchAppName(struct ScriptContext* ctx);
BOOL ScrCmd_GetTrainerClassName(struct ScriptContext* ctx);
BOOL ScrCmd_Unk00D9(struct ScriptContext* ctx);
BOOL ScrCmd_Unk00DA(struct ScriptContext* ctx);
struct String* FUN_02040AE4(u32 msg_no, u32 heap_id);
-BOOL ScrCmd_Unk00DB(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk00DC(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk00DD(struct ScriptContext* ctx);
+BOOL ScrCmd_GetPlayerStarterName(struct ScriptContext* ctx);
+BOOL ScrCmd_GetRivalStarterName(struct ScriptContext* ctx);
+BOOL ScrCmd_GetCounterpartStarterName(struct ScriptContext* ctx);
BOOL ScrCmd_GetDecorationName(struct ScriptContext* ctx);
BOOL ScrCmd_GetUndergroundTrapName(struct ScriptContext* ctx);
BOOL ScrCmd_GetUndergroundItemName(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk00E2(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk017B(struct ScriptContext* ctx);
+BOOL ScrCmd_GetMapName(struct ScriptContext* ctx);
+BOOL ScrCmd_GetBerryName(struct ScriptContext* ctx);
BOOL ScrCmd_GetNatureName(struct ScriptContext* ctx);
BOOL ScrCmd_GetFashionName(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0272(struct ScriptContext* ctx);
+BOOL ScrCmd_GetWhiteRockInscription(struct ScriptContext* ctx);
BOOL ScrCmd_GetPokemonMoveName(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0232(struct ScriptContext* ctx);
+BOOL ScrCmd_GetRibbonName(struct ScriptContext* ctx);
BOOL ScrCmd_GetSealName(struct ScriptContext* ctx);
BOOL ScrCmd_GetItemNameWithIndefArticle(struct ScriptContext* ctx);
BOOL ScrCmd_GetItemNamePlural(struct ScriptContext* ctx);
@@ -150,16 +158,48 @@ BOOL ScrCmd_Unk02CC(struct ScriptContext* ctx);
BOOL ScrCmd_GetSealNamePlural(struct ScriptContext* ctx);
BOOL ScrCmd_CapitalizeFirstChar(struct ScriptContext* ctx);
-//scrcmd_11.c
-BOOL ScrCmd_Unk017D(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk017E(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk017F(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0180(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0181(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0182(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0183(struct ScriptContext* ctx);
+//scrcmd_sound.c
+BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx);
+BOOL ScrCmd_PlayBgm(struct ScriptContext *ctx);
+BOOL ScrCmd_StopBgm(struct ScriptContext *ctx);
+BOOL ScrCmd_PlayDefaultBgm(struct ScriptContext *ctx);
+BOOL ScrCmd_Unk0053(struct ScriptContext *ctx);
+BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx);
+BOOL FUN_02041464(struct ScriptContext *ctx);
+BOOL ScrCmd_FadeInBgm(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0056(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0057(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0058(struct ScriptContext* ctx);
+BOOL ScrCmd_PlayFanfare(struct ScriptContext* ctx);
+BOOL ScrCmd_StopFanfare(struct ScriptContext* ctx);
+BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx);
+BOOL FUN_02041540(struct ScriptContext* ctx);
+BOOL ScrCmd_PlayCry(struct ScriptContext* ctx);
+BOOL ScrCmd_PlayCryWait(struct ScriptContext* ctx);
+BOOL FUN_02041598(struct ScriptContext* ctx);
+BOOL ScrCmd_PlaySoundWait(struct ScriptContext* ctx);
+BOOL FUN_020415CC(struct ScriptContext* ctx);
+BOOL ScrCmd_PlaySound(struct ScriptContext* ctx);
+BOOL ScrCmd_CheckChatotCry(struct ScriptContext* ctx);
+BOOL ScrCmd_StartChatotRecord(struct ScriptContext* ctx);
+BOOL ScrCmd_StopChatotRecord(struct ScriptContext* ctx);
+BOOL ScrCmd_SaveChatotCry(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk005D(struct ScriptContext* ctx);
+BOOL ScrCmd_SetVolume(struct ScriptContext *ctx);
+
+//scrcmd_8.c
+BOOL ScrCmd_Unk021D(struct ScriptContext* ctx);
+
+//scrcmd_berry_trees.c
+BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx);
+BOOL ScrCmd_GetBerryTreeType(struct ScriptContext* ctx);
+BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext* ctx);
+BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext* ctx);
+BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext* ctx);
+BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext* ctx);
+BOOL ScrCmd_SetBerryTreeType(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0184(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0185(struct ScriptContext* ctx);
+BOOL ScrCmd_TakeBerryTreeBerries(struct ScriptContext* ctx);
//scrcmd_13.c
BOOL ScrCmd_Unk0253(struct ScriptContext* ctx);
@@ -168,9 +208,9 @@ BOOL ScrCmd_Unk0255(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0256(struct ScriptContext* ctx);
//scrcmd_coins.c
-BOOL ScrCmd_Unk0075(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0076(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0077(struct ScriptContext* ctx);
+BOOL ScrCmd_ShowCoinBox(struct ScriptContext* ctx);
+BOOL ScrCmd_HideCoinBox(struct ScriptContext* ctx);
+BOOL ScrCmd_UpdateCoinBox(struct ScriptContext* ctx);
BOOL ScrCmd_GetCoins(struct ScriptContext* ctx);
BOOL ScrCmd_GiveCoins(struct ScriptContext* ctx);
BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext* ctx);
@@ -185,18 +225,18 @@ BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext* ctx);
BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext* ctx);
BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext* ctx);
BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0072(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0073(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0074(struct ScriptContext* ctx);
+BOOL ScrCmd_ShowMoneyBox(struct ScriptContext* ctx);
+BOOL ScrCmd_HideMoneyBox(struct ScriptContext* ctx);
+BOOL ScrCmd_UpdateMoneyBox(struct ScriptContext* ctx);
//scrcmd_daycare.c
-BOOL ScrCmd_Unk016D(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk016E(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk01A8(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk01A9(struct ScriptContext* ctx);
+BOOL ScrCmd_GetDaycarePokemonNames(struct ScriptContext* ctx);
+BOOL ScrCmd_GetDaycareStatus(struct ScriptContext* ctx);
+BOOL ScrCmd_DeleteDaycareEgg(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01A4(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01AA(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk01AE(struct ScriptContext* ctx);
+BOOL ScrCmd_GetDaycareLevel(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01AF(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01B0(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01BC(struct ScriptContext* ctx);
@@ -210,15 +250,37 @@ BOOL ScrCmd_Unk01AD(struct ScriptContext* ctx);
//scrcmd_18.c
BOOL ScrCmd_GiveMon(struct ScriptContext* ctx);
-//scrcmd_19.c
-BOOL ScrCmd_Unk01F1(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk01F4(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk01F5(struct ScriptContext* ctx);
+//scrcmd_fossils.c
+BOOL ScrCmd_CountFossils(struct ScriptContext* ctx);
+BOOL ScrCmd_GetFossilPokemon(struct ScriptContext* ctx);
+BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01F2(struct ScriptContext* ctx);
BOOL ScrCmd_Unk01F3(struct ScriptContext* ctx);
-//scrcmd_20.c
-BOOL ScrCmd_Unk02A6(struct ScriptContext* ctx);
+//scrcmd_prizes.c
+BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext* ctx);
+
+//scrcmd_flags.c
+BOOL ScrCmd_HasSinnohDex(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveSinnohDex(struct ScriptContext* ctx);
+BOOL ScrCmd_HasRunningShoes(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveRunningShoes(struct ScriptContext* ctx);
+BOOL ScrCmd_HasBadge(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveBadge(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveBag(struct ScriptContext* ctx);
+BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext* ctx);
+BOOL ScrCmd_HasBag(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0160(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0161(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0162(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0163(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0164(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0165(struct ScriptContext* ctx);
+BOOL ScrCmd_CheckGameCompleted(struct ScriptContext* ctx);
+BOOL ScrCmd_SetGameCompleted(struct ScriptContext* ctx);
+BOOL ScrCmd_GetSetStrength(struct ScriptContext* ctx);
+BOOL ScrCmd_GetSetFlash(struct ScriptContext* ctx);
+BOOL ScrCmd_GetSetDefog(struct ScriptContext* ctx);
//scrcmd_items.c
BOOL ScrCmd_GiveItem(struct ScriptContext* ctx);
@@ -230,23 +292,36 @@ BOOL ScrCmd_GetItemPocketId(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0081(struct ScriptContext* ctx);
BOOL ScrCmd_Unk0082(struct ScriptContext* ctx);
-//scrcmd_23.c
-BOOL ScrCmd_Unk0083(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0084(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0085(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0086(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0087(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0088(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0089(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008A(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008B(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008C(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008D(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008E(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk008F(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0090(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0091(struct ScriptContext* ctx);
-BOOL ScrCmd_Unk0092(struct ScriptContext* ctx);
+//scrcmd_underground.c
+BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext* ctx);
+BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext* ctx);
+BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext* ctx);
+BOOL ScrCmd_GetDecorationCount(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext* ctx);
+BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext* ctx);
+BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext* ctx);
+BOOL ScrCmd_GetTrapCount(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveTreasure(struct ScriptContext* ctx);
+BOOL ScrCmd_TakeTreasure(struct ScriptContext* ctx);
+BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext* ctx);
+BOOL ScrCmd_GetTreasureCount(struct ScriptContext* ctx);
+BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext* ctx);
+BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext* ctx);
+BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext* ctx);
+BOOL ScrCmd_GetSphereCount(struct ScriptContext* ctx);
+
+//scrcmd_24.c
+BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk021E(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk021F(struct ScriptContext* ctx);
+void FUN_02045E74(struct ScriptContext* ctx, u8 a1, struct Pokemon* pokemon, void* a3);
+BOOL ScrCmd_Unk0220(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0221(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0224(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0222(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0223(struct ScriptContext* ctx);
+BOOL ScrCmd_Unk0225(struct ScriptContext* ctx);
//scrcmd_25.c
BOOL ScrCmd_Unk023F(struct ScriptContext* ctx);
diff --git a/include/script.h b/include/script.h
index 9a7270c2..01bba305 100644
--- a/include/script.h
+++ b/include/script.h
@@ -4,6 +4,8 @@
#include "global.h"
#include "msgdata.h"
#include "save_block_2.h"
+#include "unk_02016B94.h"
+
struct ScriptContext;
@@ -26,9 +28,10 @@ struct UnkStruct_02046444
struct UnkSavStruct80
{
u8 padding[0x8];
- u32 unk08;
+ struct UnkStruct_02016B94_2 *unk08;
struct SaveBlock2 *saveBlock2; //0xC
- u8 padding2[0xC];
+ struct UnkStruct_0204639C *unk10;
+ u8 padding2[0x8];
u32 *mapId; //0x1C
u8 padding3[0x18];
u32 unk38;
@@ -36,7 +39,9 @@ struct UnkSavStruct80
u32 unk60;
u8 padding5[0x14];
u32 unk78;
- u8 padding6[0x2C];
+ u8 padding6[0x1C];
+ void *unk98;
+ u8 padding7[0xC];
struct UnkStruct_02046444 * unkA8;
};
diff --git a/include/script_buffers.h b/include/script_buffers.h
index d0fff528..9a742545 100644
--- a/include/script_buffers.h
+++ b/include/script_buffers.h
@@ -4,6 +4,7 @@
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "trainer_data.h"
+#include "unk_02016B94.h"
struct UnkStruct_0200AA80_sub_sub
{
@@ -105,7 +106,7 @@ void StringExpandPlaceholders(struct ScrStrBufs * mgr, struct String * dest, str
void ScrStrBufs_ResetBuffers(struct ScrStrBufs * mgr);
struct UnkStruct_0200B870 * MessagePrinter_new(u32 r5, u32 r6, u32 sp4, u32 r4);
void MessagePrinter_delete(struct UnkStruct_0200B870 * a0);
-void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, int a2, int a3, int a4);
-void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, int sp30, int r5, int r7);
+void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window * a2, int a3, int a4);
+void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y);
#endif //POKEDIAMOND_SCRIPT_BUFFERS_H
diff --git a/include/sdat.h b/include/sdat.h
deleted file mode 100644
index 3ba8583c..00000000
--- a/include/sdat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef GUARD_LIBSDAT_H
-#define GUARD_LIBSDAT_H
-
-struct SDATHeader
-{
- // Generic header
- char magic[4];
- u16 bom;
- u16 version;
- u32 filesize;
- u16 header_size;
- u16 section_count;
- // SDAT chunks
- u32 symb_offset, symb_size;
- u32 info_offset, info_size;
- u32 fat_offset, fat_size;
- u32 file_offset, file_size;
-};
-
-struct SDATFileMgr
-{
- struct SDATHeader header;
- BOOL is_init;
- FSFile file; // 00034
- FSFileID fileID; // 7C
- void * fat_p;
- void * symb_p;
- void * info_p;
-};
-
-void SDAT_Init(void);
-void * FUN_020C2A94(void *, u32);
-void SDAT_Open(struct SDATFileMgr *, char *, void *, u32);
-void FUN_020C39CC(void *);
-void FUN_020C01A0(void);
-int FUN_020C290C(void *);
-void FUN_020C2828(void *, int);
-BOOL FUN_020C36A8(u32 *, void *);
-BOOL FUN_020C3674(u32 *, void *);
-BOOL FUN_020C35E0(u32 *, u32 *, void *);
-BOOL FUN_020C360C(u32 *, void *);
-BOOL FUN_020C3640(u32 *, void *);
-void FUN_020C0F80(u32 *);
-void FUN_020C1040(int, int);
-void FUN_020C0F68(void);
-
-#endif //GUARD_LIBSDAT_H
diff --git a/include/sound.h b/include/sound.h
index 9b50542f..781c6b5b 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -2,15 +2,18 @@
#define POKEDIAMOND_SOUND_H
#include "FS_file.h"
-#include "sdat.h"
+#include "NNS_SND_arc.h"
+#include "NNS_SND_heap.h"
+#include "NNS_SND_arc_loader.h"
#include "player_data.h"
+#include "sav_chatot.h"
struct SoundData
{
- struct SDATFileMgr header;
- void * unk_00090;
- u8 unk_00094[0xBBC00];
- u32 unk_BBC94[9];
+ NNSSndArc header;
+ NNSSndHeapHandle * heap; // 0x00090
+ u8 heapBuffer[0xBBC00];
+ u32 players[9];
u32 unk_BBCB8;
u32 unk_BBCBC;
u8 unk_BBCC0[0x20];
@@ -42,7 +45,7 @@ struct SoundData
u32 unk_BCD3C;
u64 unk_BCD40;
u32 unk_BCD48;
- void * unk_BCD4C;
+ struct SaveChatotSoundClip * chatot;
u32 unk_BCD50;
u32 unk_BCD54;
u32 unk_BCD58;
@@ -50,16 +53,16 @@ struct SoundData
};
struct SoundData * GetSoundDataPointer(void);
-void InitSoundData(void * a0, struct Options * a1);
+void InitSoundData(struct SaveChatotSoundClip * chatot, struct Options * options);
void * FUN_02003D38(u32 a0);
-int FUN_02003F3C(int * a0);
-void FUN_02003F64(int a0);
-BOOL FUN_02003F78(u32 * a0);
-BOOL FUN_02003F90(u32 * a0);
-BOOL FUN_02003FA8(u32 * a0, u32 * a1);
-BOOL FUN_02003FC4(u32 * a0);
-BOOL FUN_02003FDC(u32 * a0);
-u32 * FUN_02003FF4(int a0);
+int GF_Snd_SaveState(int * level_p);
+void GF_Snd_RestoreState(int level);
+BOOL GF_Snd_LoadGroup(int groupNo);
+BOOL GF_Snd_LoadSeq(int seqNo);
+BOOL GF_Snd_LoadSeqEx(int seqNo, u32 loadFlag);
+BOOL GF_Snd_LoadWaveArc(int waveArcNo);
+BOOL GF_Snd_LoadBank(int bankNo);
+u32 * FUN_02003FF4(int playerNo);
u32 FUN_02004018(u32 a0);
void DoSoundUpdateFrame(void);
diff --git a/include/text.h b/include/text.h
index 40f4d03a..c9984d75 100644
--- a/include/text.h
+++ b/include/text.h
@@ -2,52 +2,66 @@
#define POKEDIAMOND_TEXT_H
#include "global.h"
+#include "font.h"
+#include "unk_02016B94.h"
+
+
+#define CHAR_0 0x00A2
+#define CHAR_1 0x00A3
+#define CHAR_2 0x00A4
+#define CHAR_3 0x00A5
+#define CHAR_4 0x00A6
+#define CHAR_5 0x00A7
+#define CHAR_6 0x00A8
+#define CHAR_7 0x00A9
+#define CHAR_8 0x00AA
+#define CHAR_9 0x00AB
+
+union StrbufForPrint
+{
+ struct String * wrapped;
+ const u16 * raw;
+};
struct TextPrinterTemplate
{
- const u16* currentChar;
- u32 windowId;
- u8 padding[1];
- u8 fontId;
- u8 x;
- u8 y;
- u8 currentX;
- u8 currentY;
- u8 letterSpacing;
- u8 lineSpacing;
- u8 unk;
- u8 fgColor;
- u8 bgColor;
- u8 shadowColor;
- union
- {
- struct
- {
- u16 unk2;
- u8 unk3;
- u8 unk4;
- };
- u32 Unk20; //todo this can't be right
- };
+ union StrbufForPrint currentChar; // 0
+ struct Window * window; // 4
+ u8 padding[1]; // 8
+ u8 fontId; // 9
+ u8 x; // a
+ u8 y; // b
+ u8 currentX; // c
+ u8 currentY; // d
+ u8 letterSpacing; // e
+ u8 lineSpacing; // f
+ u8 unk; // 10
+ u8 fgColor; // 11
+ u8 bgColor; // 12
+ u8 shadowColor; // 13
+ u16 unk2; // 14
+ u8 unk3; // 16
+ u8 unk4; // 17
};
struct TextPrinter
{
struct TextPrinterTemplate printerTemplate;
- u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x10
+ u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x18
u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother
- u8 active;
- u8 state; // 0x1C
- u8 textSpeedBottom:7;
+ // 1c
+ u8 active; // 23
+ u8 state; // 0x24
+ u8 textSpeedBottom:7; // 25
u8 textSpeedTop:1;
- u8 delayCounter;
- u8 scrollDistance;
- u8 minLetterSpacing; // 0x20
+ u8 delayCounter; // 26
+ u8 scrollDistance; // 27
+ u8 minLetterSpacing; // 0x28
u8 Unk29; // used to be japanese, not sure about that anymore
u16 Unk2A;
- void *Unk2C;
+ u16 *Unk2C;
};
struct FontInfo
@@ -69,16 +83,16 @@ BOOL FUN_0201BD44(u32 param0);
void FUN_0201BD5C(void);
u8 FUN_0201BD70(u32 param0);
void FUN_0201BD7C(u32 param0);
-u16 AddTextPrinterParameterized(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
-u16 AddTextPrinterParameterized2(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16));
-u16 AddTextPrinterParameterized3(u32 windowId, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16));
u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
void RunTextPrinter(u32 param0, struct TextPrinter *printer);
u32 RenderFont(struct TextPrinter *printer);
void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor);
void DecompressGlyphTile(const u16 *src, u16 *dst);
void FUN_0201C1A8(struct TextPrinter *printer);
-void *FUN_0201C1B0(void);
+u16 *FUN_0201C1B0(void);
void FUN_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3);
void FUN_0201C238(struct TextPrinter *printer);
diff --git a/include/text_02054590.h b/include/text_02054590.h
index 725bd9b4..77170e70 100644
--- a/include/text_02054590.h
+++ b/include/text_02054590.h
@@ -3,15 +3,18 @@
#include "global.h"
#include "options.h"
+#include "unk_02016B94.h"
+#include "string16.h"
+
void FUN_02054590(u32 param0, u32 param1);
-void FUN_020545B8(u32 param0, u32 param1, u32 param2);
-void FUN_02054608(u32 *param0, struct Options *options);
-void FUN_0205464C(u32 *param0);
-u16 FUN_02054658(u8 windowId, const u16 *str, struct Options *options, u8 param3);
-u16 DrawFieldMessage(u8 windowId, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5);
+void FUN_020545B8(struct UnkStruct_02016B94_2 *param0, struct Window *param1, u32 param2);
+void FUN_02054608(struct Window *param0, struct Options *options);
+void FUN_0205464C(struct Window *param0);
+u16 FUN_02054658(struct Window * window, struct String *str, struct Options *options, u8 param3);
+u16 DrawFieldMessage(struct Window * window, struct String *str, u8 fontId, u32 speed, u8 a4, u32 a5);
u8 FUN_020546C8(u32 param0);
-void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3);
-void FUN_02054744(u32 *param0, u32 param1, u32 param2);
+void FUN_020546E0(struct UnkStruct_02016B94_2 *param0, struct Window *param1, u32 param2, u32 param3);
+void FUN_02054744(struct Window *param0, u32 param1, u32 param2);
-#endif //POKEDIAMOND_UNK_02054590_H
+#endif // POKEDIAMOND_UNK_02054590_H
diff --git a/include/timer3.h b/include/timer3.h
index be6e1da8..3220c7a3 100644
--- a/include/timer3.h
+++ b/include/timer3.h
@@ -10,12 +10,12 @@ struct Timer3Data
vu64 Timer3Counter;
};
-THUMB_FUNC void Init_Timer3();
-THUMB_FUNC void CountUpTimer3();
-THUMB_FUNC u64 internal_GetTimer3Count();
-THUMB_FUNC u64 GetTimer3Count();
-THUMB_FUNC u64 Timer3CountToMilliSeconds(u64 count);
-THUMB_FUNC u64 Timer3CountToSeconds(u64 count);
+void Init_Timer3();
+void CountUpTimer3();
+u64 internal_GetTimer3Count();
+u64 GetTimer3Count();
+u64 Timer3CountToMilliSeconds(u64 count);
+u64 Timer3CountToSeconds(u64 count);
#endif //POKEDIAMOND_TIMER3_H
diff --git a/include/unk_0200BA78.h b/include/unk_0200BA78.h
new file mode 100644
index 00000000..2efe233e
--- /dev/null
+++ b/include/unk_0200BA78.h
@@ -0,0 +1,19 @@
+#ifndef POKEDIAMOND_UNK_0200BA78_H
+#define POKEDIAMOND_UNK_0200BA78_H
+
+#include "global.h"
+#include "script_buffers.h"
+
+void FUN_0200BA78(struct UnkStruct_0200B870 *param0,
+ int param1,
+ u32 value,
+ u32 n,
+ enum PrintingMode mode,
+ struct Window *window,
+ int x,
+ int y);
+
+void FUN_0200BAAC(
+ struct UnkStruct_0200B870 *param0, u32 value, u32 n, enum PrintingMode mode, void *dest);
+
+#endif // POKEDIAMOND_UNK_0200BA78_H
diff --git a/include/unk_0200BB14.h b/include/unk_0200BB14.h
new file mode 100644
index 00000000..a252fd93
--- /dev/null
+++ b/include/unk_0200BB14.h
@@ -0,0 +1,243 @@
+#ifndef POKEDIAMOND_UNK_0200BB14_H
+#define POKEDIAMOND_UNK_0200BB14_H
+
+#include "global.h"
+
+struct UnkStruct_0200BB14_1
+{
+ u32 unk000;
+ u32 unk004;
+ u32 unk008;
+ u32 unk00c;
+ u8 unk010[0x128];
+};
+
+struct UnkStruct_0200BB14_2
+{
+ u32 unk00;
+ u32 unk04;
+ u32 *unk08;
+ u32 unk0c[6];
+ u32 *unk24[6];
+ u32 unk3c[6];
+ s32 unk54;
+};
+
+struct UnkStruct_0200BB14_3
+{
+ u32 unk00;
+ s16 unk04;
+ s16 unk06;
+ u16 unk08;
+ u16 unk0a;
+ u32 unk0c;
+ u32 unk10;
+ u32 unk14;
+ u32 unk18;
+ u32 unk1c;
+ u32 unk20;
+ u32 unk24;
+};
+
+struct UnkStruct_0200BB14_sub
+{
+ u8 unk00[0x24];
+};
+
+struct UnkStruct_0200BB14_4
+{
+ u32 unk00;
+ struct UnkStruct_0200BB14_sub *unk04;
+ s32 unk08;
+ s32 unk0c;
+ s32 unk10;
+ u32 unk14;
+ u32 unk18;
+ u32 unk1c;
+ u16 unk20;
+ u32 unk24;
+ u32 unk28;
+ u32 unk2c;
+};
+
+struct UnkStruct_0200BB14_6
+{
+ struct UnkStruct_0200BB14_sub *unk0;
+ u32 unk4;
+};
+struct UnkStruct_0200BB14_5
+{
+ u32 unk00;
+ struct UnkStruct_0200BB14_sub *unk04;
+ struct UnkStruct_0200BB14_6 *unk08;
+ u32 unk0c;
+};
+
+struct UnkStruct_0200BB14_1 *FUN_0200BB14(u32 heap_id);
+struct UnkStruct_0200BB14_2 *FUN_0200BB34(struct UnkStruct_0200BB14_1 *param0);
+u32 FUN_0200BB68(u32 param0);
+BOOL FUN_0200BB6C(struct UnkStruct_0200BB14_1 *param0, u32 *param1, u32 *param2, u32 param3);
+BOOL FUN_0200BBF0(
+ struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2);
+void FUN_0200BC14(u32 param0);
+void FUN_0200BC1C(u32 *param0);
+void FUN_0200BC30();
+void FUN_0200BC38();
+void FUN_0200BC40(struct UnkStruct_0200BB14_2 *param0);
+void FUN_0200BC4C(struct UnkStruct_0200BB14_2 *param0);
+void FUN_0200BC5C(struct UnkStruct_0200BB14_2 *param0);
+void FUN_0200BCB0(u32 *param0);
+void FUN_0200BCD0(struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1);
+void FUN_0200BCE0(struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1);
+void FUN_0200BD04(u32 *param0);
+BOOL FUN_0200BD20(
+ struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, const char **param2);
+u32 FUN_0200BE38(u32 *param0, u32 *param1, struct UnkStruct_0200BB14_3 *param2);
+u32 FUN_0200BE74(u32 *param0,
+ u32 *param1,
+ u32 param2,
+ s16 param3,
+ s16 param4,
+ s16 param5,
+ u16 param6,
+ u32 param7,
+ u32 param8,
+ u32 param9,
+ u32 param10,
+ u32 param11,
+ u32 param12,
+ u32 param13);
+BOOL FUN_0200BF60(
+ struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 *param2);
+BOOL FUN_0200C00C(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ u32 param5,
+ s32 param6);
+s32 FUN_0200C06C(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ u32 param5,
+ u32 param6,
+ s32 param7);
+u8 FUN_0200C0DC(u32 param0,
+ u32 param1,
+ u32 *param2,
+ struct UnkStruct_0200BB14_2 *param3,
+ u32 param4,
+ u32 param5,
+ u32 param6,
+ u32 param7,
+ u32 param8,
+ s32 param9);
+u32 FUN_0200C124(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ s32 param5);
+u32 FUN_0200C13C(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ s32 param5);
+struct UnkStruct_0200BB14_5 *FUN_0200C154(
+ struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 *param2);
+u32 FUN_0200C334(u32 *param0, u32 param1);
+u32 FUN_0200C344(u32 *param0, u32 param1, u32 param2);
+u32 FUN_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1);
+u32 FUN_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1);
+u32 FUN_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1);
+u32 FUN_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1);
+void FUN_0200C398(struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1);
+void FUN_0200C3DC(u32 *param0);
+BOOL FUN_0200C404(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ u32 param5,
+ s32 param6);
+BOOL FUN_0200C474(u32 *param0, u32 param1);
+BOOL FUN_0200C4A8(u32 param0, u32 *param1, u32 param2);
+BOOL FUN_0200C4F4(u32 param0, u32 *param1, u32 param2);
+BOOL FUN_0200C548(u32 param0, u32 *param1, u32 param2);
+void FUN_0200C59C(u32 param0);
+void FUN_0200C5A8(u32 *param0);
+void FUN_0200C5B4(u32 *param0, u32 param1);
+void FUN_0200C5C0(u32 *param0, u32 param1);
+u32 FUN_0200C5CC(u32 *param0);
+void FUN_0200C5D8(u32 param0, u32 param1);
+void FUN_0200C5E0(u32 *param0, u32 param1);
+void FUN_0200C5EC(u32 param0, u32 param1);
+void FUN_0200C5F4(u32 *param0, u32 param1);
+u32 FUN_0200C600(u32 param0);
+u32 FUN_0200C608(u32 *param0);
+void FUN_0200C614(u32 param0);
+void FUN_0200C61C(u32 *param0);
+void FUN_0200C628(u32 param0);
+void FUN_0200C630(u32 *param0);
+void FUN_0200C63C(u32 param0, u32 param1);
+void FUN_0200C644(u32 *param0, u32 param1);
+u8 FUN_0200C650(u32 param0);
+u8 FUN_0200C658(u32 *param0);
+void FUN_0200C664(u32 param0, u32 param1);
+void FUN_0200C66C(u32 *param0, u32 param1);
+void FUN_0200C678(u32 param0, u32 param1);
+void FUN_0200C680(u32 *param0, u32 param1);
+u8 FUN_0200C68C(u32 *param0);
+void FUN_0200C698(u32 param0, u32 param1);
+u8 FUN_0200C6A4(u32 *param0);
+void FUN_0200C6B0(u32 *param0, u32 param1);
+void FUN_0200C6BC(u32 param0, u32 param1);
+void FUN_0200C6C4(u32 *param0, u32 param1);
+u16 FUN_0200C6D0(u32 param0);
+u16 FUN_0200C6D8(u32 *param0);
+void FUN_0200C6E4(u32 param0, u32 param1, u32 param2);
+void FUN_0200C714(u32 *param0, u32 param1, u32 param2);
+void FUN_0200C720(u32 param0, u32 param1, u32 param2, u32 param3);
+void FUN_0200C750(u32 *param0, u32 param1, u32 param2, u32 param3);
+void FUN_0200C75C(u32 param0, u16 *param1, u16 *param2);
+void FUN_0200C7A0(u32 *param0, u16 *param1, u16 *param2);
+void FUN_0200C7AC(u32 param0, u16 *param1, u16 *param2, u32 param3);
+void FUN_0200C7F0(u32 *param0, u16 *param1, u16 *param2, u32 param3);
+void FUN_0200C7FC(u32 param0, u16 *param1, u16 *param2);
+void FUN_0200C82C(u32 *param0, u16 *param1, u16 *param2);
+void FUN_0200C838(u32 param0, u32 param1);
+void FUN_0200C840(u32 *param0, u32 param1);
+void FUN_0200C84C(u32 param0, f32 param1, f32 param2);
+void FUN_0200C884(u32 *param0, f32 param1, f32 param2);
+void FUN_0200C890(u32 param0, u16 param1);
+void FUN_0200C898(u32 *param0, u16 param1);
+void FUN_0200C8A4(u32 param0, u32 param1);
+void FUN_0200C8BC(u32 *param0, u32 param1);
+void FUN_0200C8C8(u32 param0, u32 param1);
+void FUN_0200C8D0(u32 *param0, u32 param1);
+void FUN_0200C8DC(u32 *param0, u32 param1, u32 param2);
+void FUN_0200C8F8(u32 *param0, u32 param1);
+void FUN_0200C904(u32 param0, u32 param1);
+void FUN_0200C90C(u32 *param0, u32 param1);
+BOOL FUN_0200C918(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ u32 param5,
+ s32 param6);
+BOOL FUN_0200C978(u32 *param0,
+ struct UnkStruct_0200BB14_2 *param1,
+ u32 param2,
+ u32 param3,
+ u32 param4,
+ u32 param5,
+ s32 param6);
+void FUN_0200C9D8(u32 *param0, u32 *param1, u32 param2, u32 param3, u32 param4, u32 param5);
+void FUN_0200CA0C(u32 *param0, u32 *param1, u32 param2, u32 param3, u32 param4, u32 param5);
+u32 FUN_0200CA40(u32 *param0);
+
+#endif // POKEDIAMOND_UNK_0200BB14_H
diff --git a/include/unk_0200CA44.h b/include/unk_0200CA44.h
index 2e479ab8..6dd208c3 100644
--- a/include/unk_0200CA44.h
+++ b/include/unk_0200CA44.h
@@ -1,10 +1,12 @@
#ifndef POKEDIAMOND_UNK_0200CA44_H
#define POKEDIAMOND_UNK_0200CA44_H
-BOOL FUN_0200CA44(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA60(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA7C(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA98(void (*r0)(u32, void *), void * r1, void * r2);
+#include "text.h"
+
+BOOL FUN_0200CA44(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA60(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA7C(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA98(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
void FUN_0200CAB4(s32 unk1);
#endif //POKEDIAMOND_UNK_0200CA44_H
diff --git a/include/unk_02015E30.h b/include/unk_02015E30.h
index 6a4d6c15..67a7aaaf 100644
--- a/include/unk_02015E30.h
+++ b/include/unk_02015E30.h
@@ -15,8 +15,8 @@ struct UnkStruct_02015E30
u64 unk18;
};
-THUMB_FUNC void FUN_02015E30();
-THUMB_FUNC void FUN_02015E3C(struct IGT *igt);
-THUMB_FUNC void FUN_02015E60();
+void FUN_02015E30();
+void FUN_02015E3C(struct IGT *igt);
+void FUN_02015E60();
#endif //POKEDIAMOND_UNK_02015E30_H
diff --git a/include/unk_02016B94.h b/include/unk_02016B94.h
new file mode 100644
index 00000000..fec45cd8
--- /dev/null
+++ b/include/unk_02016B94.h
@@ -0,0 +1,340 @@
+#ifndef POKEDIAMOND_UNK_02016B94_H
+#define POKEDIAMOND_UNK_02016B94_H
+
+#include "global.h"
+#include "GX_layers.h"
+#include "MI_uncompress.h"
+#include "OS_cache.h"
+#include "gx.h"
+#include "heap.h"
+#include "math_util.h"
+
+#define reg_G2_BG2P (u32 *)0x4000020
+#define reg_G2_BG3P (u32 *)0x4000030
+#define reg_G2S_DB_BG2P (u32 *)0x4001020
+#define reg_G2S_DB_BG3P (u32 *)0x4001030
+struct UnkStruct_02016B94_1
+{
+ u32 unk00;
+ u32 unk04;
+ u32 unk08;
+ u32 unk0c;
+
+ u8 unk10;
+ u8 unk11;
+ u8 unk12;
+ u8 unk13;
+ u8 unk14;
+ u8 unk15;
+ u8 unk16;
+ u8 unk17; // probably paddding
+ u32 unk18;
+};
+
+struct UnkStruct_02016B94_2
+{
+ u32 unk00;
+ u16 unk04;
+ u16 unk06;
+
+ struct UnkStruct_02016B94_2_sub
+ {
+ void *unk08;
+ u32 unk0c;
+ u32 unk10;
+
+ fx32 unk14;
+ fx32 unk18;
+
+ u8 unk1c;
+ u8 unk1d;
+ u8 unk1e;
+ u8 unk1f;
+ u16 unk20;
+ u16 unk22; // probably padding
+ fx32 unk24;
+ fx32 unk28;
+ fx32 unk2c;
+ fx32 unk30;
+ } unk08[8];
+};
+
+struct UnkStruct_02016B94_3
+{
+ void *unk00;
+ u16 unk04;
+ u16 unk06;
+};
+
+struct UnkStruct_02016B94_4
+{
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+ u8 unk5;
+ u16 unk6;
+};
+
+struct Window
+{
+ struct UnkStruct_02016B94_2 *unk00;
+ u8 unk04;
+ u8 unk05;
+ u8 unk06;
+ u8 width;
+ u8 height;
+ u8 unk09;
+ u16 unk0a_0 : 15;
+ u16 unk0b_15 : 1;
+ void *unk0c;
+};
+
+struct UnkStruct_02016B94_2 *FUN_02016B94(u32 heap_id);
+u32 FUN_02016BB8(u32 *param0);
+void FUN_02016BBC(const struct GraphicsModes *modes);
+void FUN_02016BF4(u32 *param0, u32 param1);
+void FUN_02016C18(
+ struct UnkStruct_02016B94_2 *param0, u8 param1, struct UnkStruct_02016B94_1 *param2, u8 param3);
+void FUN_020170F4(struct UnkStruct_02016B94_2 *param0, u8 param1, u32 param2, u8 param3);
+u8 FUN_020177DC(u8 param0, u32 param1);
+void FUN_02017850(u32 param0, u8 *param1, u8 *param2);
+void FUN_020178A0(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_020178BC(u32 param0, u16 param1);
+void FUN_0201797C(u32 param0, GX_LayerToggle toggle);
+void FUN_020179E0(struct UnkStruct_02016B94_2 *param0, u32 param1, u32 param2, fx32 val);
+fx32 FUN_02017B48(struct UnkStruct_02016B94_2 *param0, u32 param1);
+fx32 FUN_02017B54(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_02017B60(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ u32 param2,
+ fx32 param3,
+ struct Mtx22 *param4,
+ fx32 param5,
+ fx32 param6);
+void FUN_02017B8C(struct UnkStruct_02016B94_2_sub *param0, u32 param1, fx32 val);
+void FUN_02017BD0(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ struct Mtx22 *param2,
+ fx32 param3,
+ fx32 param4);
+void FUN_02017C6C(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_02017C98(const void *param0, void *param1, u32 param2);
+void FUN_02017CD0(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_02017CE8(
+ struct UnkStruct_02016B94_2 *param0, u32 param1, u32 *param2, u32 param3, u32 param4);
+void FUN_02017D68(u32 param0, void *param1, u32 offset, u32 size);
+void FUN_02017DFC(struct UnkStruct_02016B94_2 *param0, u32 param1, void *param2, u32 param3);
+void FUN_02017E14(
+ struct UnkStruct_02016B94_2 *param0, u32 param1, u32 *param2, u32 param3, u32 param4);
+void FUN_02017E40(
+ struct UnkStruct_02016B94_2 *param0, u32 param1, u32 *param2, u32 param3, u32 param4);
+void FUN_02017E84(u32 param0, void *param1, u32 offset, u32 size);
+void FUN_02017F18(u32 param0, u32 size, u32 offset, u32 heap_id);
+void FUN_02017F48(
+ struct UnkStruct_02016B94_2 *param0, u32 param1, u32 param2, u32 param3, u32 param4);
+void FUN_02017FB4(u32 param0, void *param1, u32 offset, u32 size);
+void FUN_02017FE4(u32 param0, u32 param1);
+u16 FUN_02017FFC(u8 param0, u8 param1, u8 param2);
+u16 FUN_02018068(u8 param0, u8 param1, u8 param2, u8 param3);
+void FUN_02018148(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ void *param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6);
+void FUN_02018170(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ void *param6,
+ u8 param7,
+ u8 param8,
+ u8 param9,
+ u8 param10);
+void FUN_020181EC(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ void *param6,
+ u8 param7,
+ u8 param8,
+ u8 param9,
+ u8 param10);
+void FUN_02018268(struct UnkStruct_02016B94_2_sub *param0,
+ u8 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u16 *param5,
+ u8 param6,
+ u8 param7,
+ u8 param8,
+ u8 param9,
+ u8 param10);
+void FUN_020183DC(struct UnkStruct_02016B94_2_sub *param0,
+ u8 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 *param5,
+ u8 param6,
+ u8 param7,
+ u8 param8,
+ u8 param9,
+ u8 param10);
+void FUN_02018540(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ u16 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6,
+ u8 param7);
+void FUN_02018590(struct UnkStruct_02016B94_2_sub *param0,
+ u16 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6);
+void FUN_02018640(
+ struct UnkStruct_02016B94_2_sub *param0, u8 param1, u8 param2, u8 param3, u8 param4, u8 param5);
+void FUN_020186B4(struct UnkStruct_02016B94_2 *param0,
+ u32 param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6);
+void FUN_02018744(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_02018768(struct UnkStruct_02016B94_2 *param0, u32 param1, u16 param2);
+void FUN_0201878C(struct UnkStruct_02016B94_2 *param0, u32 param1, u16 param2);
+void *FUN_020187B0(u32 param0);
+void FUN_02018808(u8 *param0, u32 param1, u8 (*param2)[2], u8 param3);
+u8 (*FUN_02018848(u8 *param0, u32 param1, u8 param2, u32 heap_id))[2];
+void *FUN_0201886C(struct UnkStruct_02016B94_2 *param0, u8 param1);
+u16 FUN_02018878(struct UnkStruct_02016B94_2 *param0, u32 param1);
+u8 FUN_02018884(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void BlitBitmapRect4Bit(struct UnkStruct_02016B94_3 *param0,
+ struct UnkStruct_02016B94_3 *param1,
+ u16 param2,
+ u16 param3,
+ u16 param4,
+ u16 param5,
+ u16 param6,
+ u16 param7,
+ u16 param8);
+void BlitBitmapRect8Bit(struct UnkStruct_02016B94_3 *param0,
+ struct UnkStruct_02016B94_3 *param1,
+ u16 param2,
+ u16 param3,
+ u16 param4,
+ u16 param5,
+ u16 param6,
+ u16 param7,
+ u16 param8);
+void FUN_02018E88(
+ struct UnkStruct_02016B94_3 *param0, u16 param1, u16 param2, u16 param3, u16 param4, u8 param5);
+void FUN_02018F4C(
+ struct UnkStruct_02016B94_3 *param0, u16 param1, u16 param2, u16 param3, u16 param4, u8 param5);
+void *AllocWindows(u32 heap_id, s32 size);
+void InitWindow(struct Window *param0);
+BOOL FUN_02019048(struct Window *param0);
+void FUN_02019064(struct UnkStruct_02016B94_2 *param0,
+ struct Window *param1,
+ u8 param2,
+ u8 param3,
+ u8 param4,
+ u8 param5,
+ u8 param6,
+ u8 param7,
+ u16 param8);
+void FUN_020190EC(struct UnkStruct_02016B94_2 *param0,
+ struct Window *param1,
+ u8 param2,
+ u8 param3,
+ u16 param4,
+ u8 param5);
+void FUN_02019150(struct UnkStruct_02016B94_2 *param0,
+ struct Window *param1,
+ struct UnkStruct_02016B94_4 *param2);
+void FUN_02019178(struct Window *param0);
+void FUN_020191A4(struct Window *param0, int param1);
+void CopyWindowToVram(struct Window *param0);
+void FUN_02019220(struct Window *param0);
+void FUN_02019270(struct Window *param0);
+void FUN_0201928C(struct Window *param0, u8 param1, u8 param2);
+void FUN_020192B8(struct Window *param0);
+void FUN_020192D4(struct Window *param0);
+void FUN_02019358(struct Window *param0);
+void FUN_020193B4(struct Window *param0);
+void FUN_02019444(struct Window *param0);
+void FUN_0201949C(struct Window *window);
+void FUN_020194C8(struct Window *window);
+void FUN_020194E0(struct Window *window);
+void FUN_0201951C(struct Window *window);
+void FUN_02019548(struct Window *window);
+void FUN_02019570(struct Window *window);
+void FUN_0201958C(struct Window *window);
+void FUN_020195A8(struct Window *window);
+void FUN_020195D0(struct Window *window);
+void FUN_020195E4(struct Window *window);
+void FUN_0201960C(struct Window *window);
+void FillWindowPixelBuffer(struct Window *window, u8 param1);
+void BlitBitmapRectToWindow(struct Window *window,
+ const void *src,
+ u16 srcX,
+ u16 srcY,
+ u16 srcWidth,
+ u16 srcHeight,
+ u16 dstX,
+ u16 dstY,
+ u16 dstWidth,
+ u16 dstHeight);
+void BlitBitmapRect(struct Window *window,
+ void *param1,
+ u16 param2,
+ u16 param3,
+ u16 param4,
+ u16 param5,
+ u16 param6,
+ u16 param7,
+ u16 param8,
+ u16 param9,
+ u16 param10);
+void FillWindowPixelRect(struct Window *window, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
+void FUN_0201974C(
+ struct Window *window, u32 *param1, u32 param2, u32 param3, u16 param4, u16 param5, u32 param6);
+void ScrollWindow(struct Window *window, u32 param1, u8 param2, u8 param3);
+void FUN_0201A8E8(struct Window *window, u32 param1, u8 param2, u8 param3);
+void FUN_0201A9D4(struct Window *window, u32 param1, u8 param2, u8 param3);
+u8 FUN_0201AB08(struct Window *window);
+u8 GetWindowWidth(struct Window *window);
+u8 GetWindowHeight(struct Window *window);
+u8 FUN_0201AB14(struct Window *window);
+u8 FUN_0201AB18(struct Window *window);
+void FUN_0201AB1C(struct Window *window, u8 param1);
+void FUN_0201AB20(struct Window *window, u8 param1);
+void FUN_0201AB24(struct Window *window, u8 param1);
+u32 FUN_0201AB28(struct Window *window, u32 heap_id, const char *path);
+u32 FUN_0201AB44(struct Window *window, u32 heap_id, const char *path);
+void FUN_0201AB60(struct UnkStruct_02016B94_2 *param0);
+void FUN_0201AB78(struct UnkStruct_02016B94_2 *param0);
+void FUN_0201AC68(struct UnkStruct_02016B94_2 *param0, u32 param1);
+void FUN_0201AC78(struct UnkStruct_02016B94_2 *param0);
+void FUN_0201AEE4(struct UnkStruct_02016B94_2 *param0, u32 param1, u32 param2, fx32 param3);
+void FUN_0201AF08(struct UnkStruct_02016B94_2 *param0, u32 param1, u32 param2, u16 param3);
+void FUN_0201AF2C(struct UnkStruct_02016B94_2_sub *param0, u32 param1, u16 val);
+void FUN_0201AF50(struct UnkStruct_02016B94_2 *param0, u32 param1, u32 param2, fx32 param3);
+void FUN_0201AF74(struct UnkStruct_02016B94_2_sub *param0, u32 param1, fx32 val);
+u32 FUN_0201AFBC(struct UnkStruct_02016B94_2 *param0, u8 param1, u8 param2, u8 param3, u16 *param4);
+void FUN_0201B118(struct UnkStruct_02016B94_2 *param0, u8 param1, u8 *param2);
+
+#endif // POKEDIAMOND_UNK_02016B94_H
diff --git a/include/unk_02022504.h b/include/unk_02022504.h
new file mode 100644
index 00000000..62e4def1
--- /dev/null
+++ b/include/unk_02022504.h
@@ -0,0 +1,14 @@
+#ifndef POKEDIAMOND_UNK_02022504_H
+#define POKEDIAMOND_UNK_02022504_H
+
+#include "save_block_2.h"
+#include "pokemon_storage_system.h"
+
+void *FUN_02022504(struct SaveBlock2 *sav2);
+struct PCStorage *GetStoragePCPointer(struct SaveBlock2 *sav2);
+void *FUN_0202251C(struct SaveBlock2 *sav2);
+void *FUN_02022528(struct SaveBlock2 *sav2);
+u8 *LoadHallOfFame(struct SaveBlock2 *sav2, u32 heap_id, int *ret_p);
+s32 SaveHallOfFame(struct SaveBlock2 *sav2, u8 *data);
+
+#endif //POKEDIAMOND_UNK_02022504_H
diff --git a/include/unk_02024E64.h b/include/unk_02024E64.h
index ed1bd447..68e7103c 100644
--- a/include/unk_02024E64.h
+++ b/include/unk_02024E64.h
@@ -14,15 +14,15 @@ struct UnkStruct_02024E64 {
u8 unk74A[2]; // might be padding
};
-THUMB_FUNC u32 FUN_02024E64();
-THUMB_FUNC void FUN_02024E6C(struct UnkStruct_02024E64 *param0);
-THUMB_FUNC struct UnkStruct_02024E64 *FUN_02024EB4(struct SaveBlock2 *sav2);
-THUMB_FUNC void *FUN_02024EC0(struct SaveBlock2 *sav2);
-THUMB_FUNC struct UnkStruct_02024E64 *FUN_02024ECC(struct SaveBlock2 *sav2);
-THUMB_FUNC void *FUN_02024ED8(struct SaveBlock2 *sav2);
-THUMB_FUNC u16 *GetRivalNamePtr(struct UnkStruct_02024E64 *unk);
-THUMB_FUNC void RivalsNameToU16Array(struct UnkStruct_02024E64 *unk, struct String *str);
-THUMB_FUNC u16 *FUN_02024F0C(struct UnkStruct_02024E64 *unk);
-THUMB_FUNC void FUN_02024F18(struct UnkStruct_02024E64 *unk, struct String *str);
+u32 FUN_02024E64();
+void FUN_02024E6C(struct UnkStruct_02024E64 *param0);
+struct UnkStruct_02024E64 *FUN_02024EB4(struct SaveBlock2 *sav2);
+void *FUN_02024EC0(struct SaveBlock2 *sav2);
+struct UnkStruct_02024E64 *FUN_02024ECC(struct SaveBlock2 *sav2);
+void *FUN_02024ED8(struct SaveBlock2 *sav2);
+u16 *GetRivalNamePtr(struct UnkStruct_02024E64 *unk);
+void RivalsNameToU16Array(struct UnkStruct_02024E64 *unk, struct String *str);
+u16 *FUN_02024F0C(struct UnkStruct_02024E64 *unk);
+void FUN_02024F18(struct UnkStruct_02024E64 *unk, struct String *str);
#endif
diff --git a/include/unk_02025484.h b/include/unk_02025484.h
index 0412dda1..d2feccb3 100644
--- a/include/unk_02025484.h
+++ b/include/unk_02025484.h
@@ -9,7 +9,7 @@ struct unk_2025484
u8 padding[0x1C];
};
-void FUN_02025484(struct unk_2025484 *r0, u32 r1);
+void FUN_02025484(struct unk_2025484 *r0);
u32 *FUN_02025490(struct unk_2025484 *r0, u32 r1);
u32 *FUN_020254A0(struct unk_2025484 *r0, u32 r1);
u32 FUN_020254B4(struct unk_2025484 *r0);
diff --git a/include/unk_020286F8.h b/include/unk_020286F8.h
index 3d81753a..99ecd982 100644
--- a/include/unk_020286F8.h
+++ b/include/unk_020286F8.h
@@ -21,10 +21,10 @@ void FUN_02028788(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j);
u32 FUN_020287A4(struct UnkSaveStruct_020286F8 * ptr);
u16 * FUN_020287A8(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j);
void FUN_020287C0(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j, struct String * k);
-void FUN_020287EC(struct UnkSaveStruct_020286F8 * ptr, u32 i, u8 j);
+void FUN_020287EC(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j);
u8 FUN_020287F8(struct UnkSaveStruct_020286F8 * ptr, u32 i);
u8 FUN_02028804(struct UnkSaveStruct_020286F8 * ptr, u32 i);
-void FUN_02028810(struct UnkSaveStruct_020286F8 * ptr, u32 i, u8 j);
+void FUN_02028810(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j);
struct UnkSaveStruct_020286F8 * FUN_0202881C(struct SaveBlock2 * sav2);
BOOL FUN_02028828(struct UnkSaveStruct_020286F8 * ptr, u32 i);
BOOL FUN_02028840(struct UnkSaveStruct_020286F8 * ptr, int i);
diff --git a/include/unk_0202D858.h b/include/unk_0202D858.h
new file mode 100644
index 00000000..b5845998
--- /dev/null
+++ b/include/unk_0202D858.h
@@ -0,0 +1,10 @@
+#ifndef POKEDIAMOND_UNK_0202D858_H
+#define POKEDIAMOND_UNK_0202D858_H
+
+#include "global.h"
+
+u8 FUN_0202D858(u16 param0);
+u8 FUN_0202D884(u16 param0);
+u32 FUN_0202D8B0(int param0);
+
+#endif // POKEDIAMOND_UNK_0202D858_H
diff --git a/include/unk_0202E29C.h b/include/unk_0202E29C.h
new file mode 100644
index 00000000..92998f7c
--- /dev/null
+++ b/include/unk_0202E29C.h
@@ -0,0 +1,142 @@
+#ifndef POKEDIAMOND_UNK_0202E29C_H
+#define POKEDIAMOND_UNK_0202E29C_H
+
+#include "global.h"
+#include "mail_message.h"
+#include "player_data.h"
+
+struct UnkStruct_0202E29C_sub4
+{
+ u32 unk00;
+ u8 unk04;
+ u8 unk05;
+ u8 unk06;
+ u8 unk07;
+ u8 unk08[8];
+ struct PlayerData unk10;
+ u8 unk30[0x40];
+};
+
+struct UnkStruct_0202E29C_sub
+{
+ u32 unk00;
+ u8 unk04[6];
+ u8 unk0A[0x2C];
+ u16 unk36;
+ u8 unk38[0x18];
+ struct UnkStruct_0202E29C_sub4 unk50;
+};
+
+struct UnkStruct_0202E29C_sub3
+{
+ struct MailMessage unk00;
+ struct PlayerData unk08;
+ u8 unk28[0x20];
+ u8 unk48[0x4];
+ u8 unk4C;
+ u8 unk4D[7];
+};
+
+struct UnkStruct_0202E29C_sub2
+{
+ u32 unk00;
+ u8 unk04;
+ u8 unk05;
+ u8 unk06;
+ struct UnkStruct_0202E29C_sub3 unk08;
+};
+
+struct UnkStruct_0202E29C
+{
+ struct UnkStruct_0202E29C_sub3 unk000;
+ struct UnkStruct_0202E29C_sub unk054[16];
+ u8 unkC54[8][6];
+ u16 unkC84[16];
+ void *unkCA4;
+ struct MailMessage unkCA8;
+ u32 unkCB0;
+ u8 unkCB4;
+ struct PlayerData *unkCB8;
+ void *unkCBC;
+ u32 unkCC0;
+ struct UnkStruct_0202E29C_sub2 unkCC4;
+ u8 unkD20[0x84];
+ u16 unkDA4;
+ u16 unkDA6;
+ u8 unkDA8;
+ u8 unkDA9;
+ u8 unkDAA;
+ u8 unkDAB;
+ u8 unkDAC;
+ u8 unkDAD_0:1;
+ u8 unkDAD_1:1;
+ u8 unkDAD_2:1;
+ u8 unkDAD_3:1;
+ u8 unkDAD_4:1;
+ u8 unkDAD_5:1;
+ u8 unkDAE[0x2];
+};
+
+void FUN_0202E29C(struct PlayerData *player_data);
+BOOL FUN_0202E344();
+BOOL FUN_0202E358(u8 *param0, u8 *param1, s32 param2);
+void FUN_0202E380(struct UnkStruct_0202E29C_sub *param0, u32 param1);
+void FUN_0202E470(u32 param0, u32 param1);
+void FUN_0202E488();
+void FUN_0202E49C();
+BOOL FUN_0202E4C8();
+BOOL FUN_0202E4DC();
+void FUN_0202E4F0();
+void FUN_0202E500();
+void FUN_0202E538();
+void FUN_0202E56C(u32 param0);
+void FUN_0202E594();
+BOOL FUN_0202E5F8(u32 param0, u32 param1, u32 param2);
+u32 FUN_0202E66C(u32 param0, u32 param1);
+u32 FUN_0202E6F0();
+BOOL FUN_0202E784();
+void FUN_0202E7B0(u32 param0);
+void FUN_0202E7D8();
+u32 FUN_0202E810();
+s32 FUN_0202E844(u32 param0);
+u8 FUN_0202E878();
+void FUN_0202E88C();
+s32 FUN_0202E8A0(s32 param0);
+s32 FUN_0202E8D0(s32 param0);
+s32 FUN_0202E8F4();
+s32 FUN_0202E950();
+void FUN_0202E9AC(u32 param0, struct PlayerData *player_data);
+u32 FUN_0202E9E8(u32 param0);
+void FUN_0202EA54();
+void FUN_0202EA9C();
+void FUN_0202EB7C();
+void FUN_0202EBD0(u16 param0);
+void FUN_0202ED70(u16 param0);
+u32 FUN_0202ED84(u16 param0);
+u32 FUN_0202EDB8();
+BOOL FUN_0202EDD8();
+BOOL FUN_0202EDF8();
+u32 FUN_0202EE0C();
+u32 FUN_0202EE24();
+BOOL FUN_0202EE44();
+BOOL FUN_0202EE60();
+void FUN_0202EE84(u32 param0);
+void FUN_0202EEB0(u32 param0);
+u32 FUN_0202EEE8(u16 param0);
+struct UnkStruct_0202E29C_sub *FUN_0202EF18(u32 param0);
+struct UnkStruct_0202E29C_sub4 *FUN_0202EF44(s32 param0);
+struct PlayerData *FUN_0202EF70();
+struct PlayerData *FUN_0202EF84(int param0);
+void FUN_0202EFAC(u8 *param0, s32 param1);
+BOOL FUN_0202EFE4(u8 *param0);
+u32 FUN_0202F03C();
+void FUN_0202F05C();
+void FUN_0202F078(struct MailMessage *mail_message);
+void FUN_0202F094(void *param0);
+void FUN_0202F0B8();
+u32 FUN_0202F0DC(u8 param0);
+BOOL FUN_0202F104();
+void FUN_0202F10C(struct UnkStruct_0202E29C_sub3 *param0);
+u8 *FUN_0202F124(u32 param0);
+
+#endif // POKEDIAMOND_UNK_0202E29C_H
diff --git a/include/unk_0202F150.h b/include/unk_0202F150.h
index 3996c1c8..b87bbf0c 100644
--- a/include/unk_0202F150.h
+++ b/include/unk_0202F150.h
@@ -6,6 +6,8 @@
#include "RTC_api.h"
#include "heap.h"
#include "main.h"
+#include "unk_0202D858.h"
+#include "unk_02031480.h"
struct UnkStruct0202F150_sub1
{
@@ -85,100 +87,100 @@ struct UnkStruct0202F150
u8 unk68B;
};
-THUMB_FUNC u32 FUN_0202F150(u32 param0, u32 param1);
-THUMB_FUNC void FUN_0202F2F0();
-THUMB_FUNC void FUN_0202F5A4();
-THUMB_FUNC void FUN_0202F820(int param0);
-THUMB_FUNC void FUN_0202F8D4();
-THUMB_FUNC void FUN_0202F910(int param0);
-THUMB_FUNC u32 FUN_0202F918(u32 param0, u32 param1, u32 param2, u32 param3);
-THUMB_FUNC u32 FUN_0202F950(u32 param0, u32 param1, u32 param2);
-THUMB_FUNC void FUN_0202F984();
-THUMB_FUNC void FUN_0202F9E0(u32 param0);
-THUMB_FUNC void FUN_0202FA10();
-THUMB_FUNC void FUN_0202FA1C();
-THUMB_FUNC u8 FUN_0202FA28();
-THUMB_FUNC u32 FUN_0202FA48();
-THUMB_FUNC void FUN_0202FA5C();
-THUMB_FUNC u32 FUN_0202FB18(u32 param0);
-THUMB_FUNC void FUN_0202FB20();
-THUMB_FUNC void FUN_0202FB58();
-THUMB_FUNC u32 FUN_0202FB80();
-THUMB_FUNC void FUN_0202FC60();
-THUMB_FUNC void FUN_0202FC80();
-THUMB_FUNC void FUN_0202FCA8();
-THUMB_FUNC void FUN_0202FCCC();
-THUMB_FUNC u32 FUN_0202FE2C(int param0);
-THUMB_FUNC void FUN_0202FEEC();
-THUMB_FUNC void FUN_02030074();
-THUMB_FUNC void FUN_02030238(u32 param0, void *param1, u32 param2);
-THUMB_FUNC void FUN_0203026C(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC void FUN_020303BC(u32 param0, u8 *param1, u16 param2);
-THUMB_FUNC void FUN_020303F4(u32 param0, u8 *param1, u16 param2);
-THUMB_FUNC void FUN_020304D4(u32 param0);
-THUMB_FUNC void FUN_020304F0(u32 param0);
-THUMB_FUNC void FUN_0203050C();
-THUMB_FUNC void FUN_02030674();
-THUMB_FUNC void FUN_020307A8();
-THUMB_FUNC void FUN_020307BC();
-THUMB_FUNC void FUN_020307D0();
-THUMB_FUNC u32 FUN_020307E4(u8 *param0, u32 param1);
-THUMB_FUNC void FUN_0203086C();
-THUMB_FUNC u32 FUN_02030870(u8 *param0);
-THUMB_FUNC u32 FUN_02030930(u8 *param0);
-THUMB_FUNC void FUN_02030A00(u8 *param0);
-THUMB_FUNC u32 FUN_02030A78(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC u32 FUN_02030ADC(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC u32 FUN_02030B3C(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC u32 FUN_02030BC4(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC u32 FUN_02030C4C(u32 param0, u8 *param1);
-THUMB_FUNC int FUN_02030C58();
-THUMB_FUNC void FUN_02030C70(
+u32 FUN_0202F150(u32 param0, u32 param1);
+void FUN_0202F2F0();
+void FUN_0202F5A4();
+void FUN_0202F820(int param0);
+void FUN_0202F8D4();
+void FUN_0202F910(int param0);
+BOOL FUN_0202F918(u32 param0, u32 param1, u32 param2, u32 param3);
+u32 FUN_0202F950(u32 param0, u32 param1, u32 param2);
+void FUN_0202F984();
+void FUN_0202F9E0(u32 param0);
+void FUN_0202FA10();
+void FUN_0202FA1C();
+u8 FUN_0202FA28();
+u32 FUN_0202FA48();
+void FUN_0202FA5C();
+u32 FUN_0202FB18(u32 param0);
+void FUN_0202FB20();
+void FUN_0202FB58();
+BOOL FUN_0202FB80();
+void FUN_0202FC60();
+void FUN_0202FC80();
+void FUN_0202FCA8();
+void FUN_0202FCCC();
+u32 FUN_0202FE2C(int param0);
+void FUN_0202FEEC();
+void FUN_02030074();
+void FUN_02030238(u32 param0, u8 *param1, u32 param2);
+void FUN_0203026C(u32 param0, u8 *param1, u32 param2);
+void FUN_020303BC(u32 param0, u8 *param1, u32 param2);
+void FUN_020303F4(u32 param0, u8 *param1, u32 param2);
+void FUN_020304D4(u32 param0);
+void FUN_020304F0(u32 param0);
+void FUN_0203050C();
+void FUN_02030674();
+void FUN_020307A8();
+void FUN_020307BC();
+void FUN_020307D0();
+u32 FUN_020307E4(u8 *param0, u32 param1);
+void FUN_0203086C();
+u32 FUN_02030870(u8 *param0);
+u32 FUN_02030930(u8 *param0);
+void FUN_02030A00(u8 *param0);
+u32 FUN_02030A78(u32 param0, u8 *param1, u32 param2);
+u32 FUN_02030ADC(u32 param0, u8 *param1, u32 param2);
+u32 FUN_02030B3C(u32 param0, u8 *param1, u32 param2);
+u32 FUN_02030BC4(u32 param0, u8 *param1, u32 param2);
+u32 FUN_02030C4C(u32 param0, u8 *param1);
+int FUN_02030C58();
+void FUN_02030C70(
u32 param0, u32 param1, u32 param2, void *param3, struct UnkStruct0202F150_sub2 *param4);
-THUMB_FUNC void FUN_02030C8C(struct UnkStruct0202F150_sub1 *param0,
+void FUN_02030C8C(struct UnkStruct0202F150_sub1 *param0,
u32 param1,
void *param2,
u32 param3,
struct UnkStruct0202F150_sub2 *param4);
-THUMB_FUNC void FUN_02030DA4();
-THUMB_FUNC void FUN_02030DFC();
-THUMB_FUNC u32 FUN_02030E7C(u16 param0);
-THUMB_FUNC u32 FUN_02030F20();
-THUMB_FUNC u32 FUN_02030F40();
-THUMB_FUNC void FUN_02030F60(u8 param0);
-THUMB_FUNC u8 FUN_02030F74(u32 param0);
-THUMB_FUNC u32 FUN_02030F88(u32 param0);
-THUMB_FUNC void FUN_02030FA8();
-THUMB_FUNC void FUN_02030FC8();
-THUMB_FUNC u32 FUN_02030FE0();
-THUMB_FUNC void FUN_02031000(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC void FUN_0203105C(u32 param0, u8 *param1, u32 param2);
-THUMB_FUNC void FUN_02031088();
-THUMB_FUNC void FUN_0203110C(u32 param0, u32 param1, u8 *param2);
-THUMB_FUNC void FUN_02031134(u32 param0, u32 param1, u8 *param2);
-THUMB_FUNC void FUN_0203115C(u32 param0, u32 param1, u8 *param2);
-THUMB_FUNC u16 FUN_02031190();
-THUMB_FUNC u32 FUN_020311D0(u32 param0, u8 *param1);
-THUMB_FUNC u32 FUN_020311DC(u32 param0);
-THUMB_FUNC u32 FUN_020311E8();
-THUMB_FUNC u32 FUN_020311F0();
-THUMB_FUNC int FUN_02031228(u16 param0);
-THUMB_FUNC u32 FUN_02031248(u32 param0);
-THUMB_FUNC u32 FUN_02031258(u32 param0);
-THUMB_FUNC void FUN_02031268(u8 param0);
-THUMB_FUNC u8 FUN_02031280();
-THUMB_FUNC void FUN_0203129C();
-THUMB_FUNC void FUN_020312BC(s64 *param0);
-THUMB_FUNC void FUN_02031354(u32 param0);
-THUMB_FUNC u32 FUN_02031370();
-THUMB_FUNC u32 FUN_02031388();
-THUMB_FUNC void FUN_020313A0(u8 param0);
-THUMB_FUNC void FUN_020313B4(u8 param0, u32 param1);
-THUMB_FUNC u32 FUN_020313CC(u32 param0);
-THUMB_FUNC u32 FUN_020313EC();
-THUMB_FUNC void FUN_02031400(u32 param0);
-THUMB_FUNC u32 FUN_02031438();
-THUMB_FUNC void FUN_02031454();
-THUMB_FUNC void FUN_02031468();
+void FUN_02030DA4();
+void FUN_02030DFC();
+u32 FUN_02030E7C(u16 param0);
+s32 FUN_02030F20();
+BOOL FUN_02030F40();
+void FUN_02030F60(u8 param0);
+u8 FUN_02030F74(u32 param0);
+u32 FUN_02030F88(u32 param0);
+void FUN_02030FA8();
+void FUN_02030FC8();
+u32 FUN_02030FE0();
+void FUN_02031000(u32 param0, u8 *param1, u32 param2);
+void FUN_0203105C(u32 param0, u8 *param1, u32 param2);
+void FUN_02031088();
+void FUN_0203110C(u32 param0, u32 param1, u8 *param2);
+void FUN_02031134(u32 param0, u32 param1, u8 *param2);
+void FUN_0203115C(u32 param0, u32 param1, u8 *param2);
+u16 FUN_02031190();
+u32 FUN_020311D0(u32 param0, u8 *param1);
+u32 FUN_020311DC(u32 param0);
+u32 FUN_020311E8();
+BOOL FUN_020311F0();
+int FUN_02031228(u16 param0);
+int FUN_02031248(u32 param0);
+int FUN_02031258(u32 param0);
+void FUN_02031268(u8 param0);
+u8 FUN_02031280();
+void FUN_0203129C();
+void FUN_020312BC(s64 *param0);
+void FUN_02031354(u32 param0);
+u32 FUN_02031370();
+u32 FUN_02031388();
+void FUN_020313A0(u8 param0);
+void FUN_020313B4(u8 param0, u32 param1);
+u32 FUN_020313CC(u32 param0);
+u32 FUN_020313EC();
+void FUN_02031400(u32 param0);
+u32 FUN_02031438();
+void FUN_02031454();
+void FUN_02031468();
#endif // POKEDIAMOND_UNK_0202F150_H
diff --git a/include/unk_02031480.h b/include/unk_02031480.h
new file mode 100644
index 00000000..951a3717
--- /dev/null
+++ b/include/unk_02031480.h
@@ -0,0 +1,30 @@
+#ifndef POKEDIAMOND_UNK_02031480_H
+#define POKEDIAMOND_UNK_02031480_H
+
+#include "global.h"
+#include "MI_memory.h"
+#include "heap.h"
+#include "unk_0202F150.h"
+
+void FUN_02031480(u32 heap_id);
+void FUN_020314D0();
+BOOL FUN_020314E8();
+void FUN_020314FC(u8 param0, u32 param1, u8 *param2);
+void FUN_02031560(u32 param0, u32 param1, u8 *param2);
+void FUN_02031574(u32 param0, u32 param1, u8 *param2);
+void FUN_02031588(u8 param0);
+void FUN_020315A4();
+BOOL FUN_020315D8(u8 param0);
+u8 FUN_020315FC(u8 index);
+void FUN_0203160C(u32 param0, u32 param1, u8 *param2);
+u32 FUN_02031628();
+void FUN_0203162C(u8 param0, u8 param1);
+int FUN_02031640(u32 param0, u8 param1);
+void FUN_02031668();
+void FUN_0203168C();
+BOOL FUN_020316AC(u32 param0, void *param1);
+u8 *FUN_020316E0(int param0);
+void FUN_02031704(u32 param0, u32 param1, void *param2);
+u32 FUN_02031730();
+
+#endif // POKEDIAMOND_UNK_02031480_H
diff --git a/include/unk_02031734.h b/include/unk_02031734.h
new file mode 100644
index 00000000..baf3901f
--- /dev/null
+++ b/include/unk_02031734.h
@@ -0,0 +1,215 @@
+#ifndef POKEDIAMOND_UNK_02031734_H
+#define POKEDIAMOND_UNK_02031734_H
+
+#include "global.h"
+
+struct UnkStruct_02031734_const1
+{
+ u32 unk00[3];
+};
+
+struct UnkStruct_02031734_const2
+{
+ u32 unk00[2];
+};
+
+struct UnkStruct_02031734
+{
+ void *unk00;
+ u8 unk04[6];
+ s64 unk0C[3];
+ void (*unk24)();
+ struct SaveBlock2 *unk28;
+ struct PlayerData *unk2C;
+ u32 unk30;
+ u32 unk34;
+ u16 unk38;
+ u16 unk3A;
+ u8 unk3C;
+ u8 unk3D;
+ u8 unk3E;
+ u8 unk3F;
+ u8 unk40;
+ u8 unk41;
+ u8 unk42;
+ u8 unk43;
+ u8 unk44;
+ u8 unk45;
+ u8 unk46;
+ u8 unk47;
+ u8 unk48;
+ u8 unk49;
+ u8 unk4A;
+ u8 unk4B;
+ u8 unk4C;
+ u8 unk4D;
+ u8 unk4E;
+ u8 unk4F;
+};
+
+inline u32 compute(s64 *param0, u32 param1)
+{
+ param0[0] = param0[1] * param0[0] + param0[2];
+
+ return (u32)(((s64)((u64)(param0[0]) >> 32) * param1) >> 32);
+}
+
+void FUN_02031734(struct SaveBlock2 *sav2, u8 param1);
+void FUN_020317C0();
+BOOL FUN_02031810();
+void FUN_02031824(struct SaveBlock2 *sav2);
+void FUN_02031860();
+void FUN_02031880();
+void FUN_020318A4(u8 param0);
+void FUN_020318B4();
+BOOL FUN_020318C4();
+void FUN_02031914();
+void FUN_02031924();
+void FUN_02031934();
+void FUN_02031948(struct SaveBlock2 *sav2, u8 param1, u8 param2, u32 param3);
+void FUN_02031990(struct SaveBlock2 *sav2, u8 param1, u8 param2, u32 param3);
+void FUN_020319D8(u8 param0);
+void FUN_020319F4();
+void FUN_02031A08();
+void FUN_02031A24();
+BOOL FUN_02031A2C();
+void FUN_02031A7C(struct SaveBlock2 *sav2);
+void FUN_02031AC8(u8 param0);
+s32 FUN_02031AF4();
+BOOL FUN_02031B2C();
+void FUN_02031B50();
+u32 FUN_02031BD0();
+void FUN_02031BF4();
+void FUN_02031C10();
+void FUN_02031C2C();
+void FUN_02031C54();
+void FUN_02031C64();
+void FUN_02031C74(struct SaveBlock2 *sav2, u8 param1);
+void FUN_02031CA8(struct SaveBlock2 *sav2, u8 param1);
+void FUN_02031CDC();
+void FUN_02031D20(void (*param0)(), u32 param1);
+void FUN_02031D30();
+void FUN_02031E08();
+void FUN_02031E8C();
+void FUN_02031EE0();
+void FUN_02031F60();
+void FUN_02031FC8();
+void FUN_02032028();
+void FUN_02032040();
+void FUN_02032058();
+void FUN_020320C4();
+void FUN_02032118();
+void FUN_02032138();
+void FUN_0203213C();
+void FUN_02032140();
+void FUN_02032178();
+void FUN_02032194();
+void FUN_020321B8();
+void FUN_020321D0();
+void FUN_02032218();
+void FUN_02032234();
+void FUN_0203224C();
+void FUN_02032290();
+void FUN_02032298();
+void FUN_020322C0();
+void FUN_020322F8();
+void FUN_0203230C();
+void FUN_0203234C();
+void FUN_02032364();
+void FUN_02032378();
+void FUN_020323B8();
+void FUN_020323BC();
+void FUN_020323CC();
+void FUN_020323DC();
+void FUN_02032424();
+void FUN_02032440();
+void FUN_02032478();
+void FUN_020324C8();
+void FUN_020324F8();
+void FUN_02032510();
+void FUN_02032578();
+void FUN_020325D0();
+void FUN_02032628();
+void FUN_02032640();
+void FUN_0203266C();
+void FUN_020326D0();
+void FUN_02032738();
+void FUN_0203279C();
+void FUN_020327B4();
+void FUN_020327B8();
+void FUN_020327FC();
+void FUN_02032850();
+void FUN_02032888();
+void FUN_020328C0(u8 param0);
+void FUN_020328E4();
+void FUN_020328F4(u8 param0);
+void FUN_02032924();
+void FUN_0203293C();
+void FUN_02032978();
+void FUN_020329F4();
+void FUN_02032A8C(u8 param0, u32 param1, u8 *param2);
+void FUN_02032AEC(u32 param0, u32 param1, u8 *param2);
+u32 FUN_02032B68();
+void FUN_02032B6C(u8 param0);
+void FUN_02032B84();
+void FUN_02032B8C();
+void FUN_02032BD0(struct SaveBlock2 *sav2);
+void FUN_02032C0C();
+u32 FUN_02032C28();
+void FUN_02032C6C(u32 param0, u32 param1);
+void FUN_02032CF4();
+void FUN_02032D44(struct SaveBlock2 *sav2);
+void FUN_02032D80();
+u8 FUN_02032D9C();
+BOOL FUN_02032DAC();
+void FUN_02032E00();
+void FUN_02032E48();
+void FUN_02032E8C();
+void FUN_02032E90();
+void FUN_02032EA8();
+void FUN_02032EAC();
+void FUN_02032EB0();
+void FUN_02032F20(u32 param0);
+void FUN_02032F34();
+void FUN_02032F98();
+u32 FUN_02032FDC(u8 param0);
+u32 FUN_0203300C();
+void FUN_02033060();
+void FUN_020330A0();
+void FUN_020330E4();
+u8 FUN_02033128();
+u32 FUN_02033138();
+u32 FUN_02033154();
+u32 FUN_02033180();
+void FUN_0203318C();
+void FUN_020331C4();
+void FUN_020331E8();
+void FUN_02033208();
+void FUN_0203323C();
+u32 FUN_02033250();
+void FUN_02033288(struct SaveBlock2 *sav2);
+void FUN_020332DC();
+void FUN_02033310(struct SaveBlock2 *sav2);
+void FUN_02033364();
+u32 FUN_02033398();
+void FUN_020333F0();
+void FUN_0203341C();
+void *FUN_0203346C(struct SaveBlock2 *sav2, u32 param1);
+void *FUN_020334DC();
+void FUN_020334E8(u8 param0, u8 param1);
+u8 FUN_02033510();
+s32 FUN_02033534();
+u8 FUN_0203354C();
+void FUN_02033564(void *src);
+void FUN_02033578(void *dst);
+u32 FUN_02033590();
+void FUN_020335A4(u8 param0);
+u8 FUN_020335B8();
+void FUN_020335D0(s32 param0);
+void FUN_020335E0();
+void FUN_020335F0();
+void FUN_020335F4();
+BOOL FUN_02033678();
+u32 FUN_020336A0(u8 param0);
+
+#endif // POKEDIAMOND_UNK_0202F150_H
diff --git a/include/unk_02033778.h b/include/unk_02033778.h
new file mode 100644
index 00000000..e1f64e05
--- /dev/null
+++ b/include/unk_02033778.h
@@ -0,0 +1,9 @@
+#ifndef POKEDIAMOND_UNK_02033778_H
+#define POKEDIAMOND_UNK_02033778_H
+
+#include "nitro/types.h"
+
+void FUN_02033778(u32 param0);
+void FUN_020337C8(u32 param0, u32 param1, u32 param2, u32 language);
+
+#endif //POKEDIAMOND_UNK_02033778_H
diff --git a/include/unk_020337E8.h b/include/unk_020337E8.h
new file mode 100644
index 00000000..228570ea
--- /dev/null
+++ b/include/unk_020337E8.h
@@ -0,0 +1,25 @@
+#ifndef POKEDIAMOND_UNK_020337E8_H
+#define POKEDIAMOND_UNK_020337E8_H
+
+#include "global.h"
+#include "save_block_2.h"
+
+// Dummy struct until DWC_account
+struct DWC_Struct
+{
+ s32 unk0;
+};
+
+struct DWC_token
+{
+ // size: 0xC
+ u8 fill0[0xC];
+};
+
+s32 FUN_020337E8(u32 heap_id);
+void FUN_0203380C(struct DWC_Struct *);
+s32 FUN_02033830(struct DWC_Struct *);
+BOOL FUN_0203384C(struct SaveBlock2 *);
+
+
+#endif // POKEDIAMOND_UNK_020337E8_H
diff --git a/include/unk_020377F0.h b/include/unk_020377F0.h
new file mode 100644
index 00000000..91276889
--- /dev/null
+++ b/include/unk_020377F0.h
@@ -0,0 +1,30 @@
+#ifndef POKEDIAMOND_UNK_020377F0_H
+#define POKEDIAMOND_UNK_020377F0_H
+
+struct Options;
+struct PlayerParty;
+
+// This struct gets created from a bunch of places, not just 0x02037CF0. This was
+// just the first place I (tgsm) found it being created.
+struct UnkStruct_02037CF0
+{
+ struct PlayerParty* party;
+ struct Options* options;
+ u16* name_buf;
+ u32 trainer_id;
+ u8 gender;
+ u8 unk11;
+ u8 unk12;
+ u8 party_count;
+ u8 unk14;
+ u8 unk15;
+ u8 unk16;
+ u8 padding;
+ u16 unk18;
+ u8 padding2[0x2];
+ BOOL has_national_dex;
+ u8 padding3[0xC];
+ BOOL unk2C;
+};
+
+#endif
diff --git a/include/unk_0204639C.h b/include/unk_0204639C.h
index cff2241f..cebe192d 100644
--- a/include/unk_0204639C.h
+++ b/include/unk_0204639C.h
@@ -1,6 +1,8 @@
#ifndef GUARD_UNK_0204639C_H
#define GUARD_UNK_0204639C_H
+#include "script.h"
+
struct UnkStruct_0204639C;
typedef BOOL (*UnkStruct_0204639C_cb)(struct UnkStruct_0204639C * );
@@ -13,18 +15,18 @@ struct UnkStruct_0204639C
u32 * unkC;
struct UnkStruct_0204639C * unk10;
void * unk14;
- struct UnkStruct_0204639C * unk18;
+ struct UnkSavStruct80 * unk18;
u32 * unk1C;
};
extern void LoadOverlay_MODULE_05(void *);
-extern void FUN_020373D4(struct UnkStruct_0204639C *, u32, u32);
+extern void FUN_020373D4(struct UnkSavStruct80 *, u32, u32);
extern BOOL FUN_020373AC(void *);
extern BOOL FUN_0203739C(void *);
extern BOOL FUN_020373C4(void *);
-struct UnkStruct_0204639C * FUN_0204639C(struct UnkStruct_0204639C * r5, UnkStruct_0204639C_cb r6, u32 * r7);
-void FUN_020463CC(struct UnkStruct_0204639C * r5, UnkStruct_0204639C_cb r4, u32 * r6);
+struct UnkStruct_0204639C * FUN_0204639C(struct UnkSavStruct80 * r5, UnkStruct_0204639C_cb r6, u32 * r7);
+void FUN_020463CC(struct UnkSavStruct80 * r5, UnkStruct_0204639C_cb r4, u32 * r6);
void FUN_020463EC(struct UnkStruct_0204639C * r4, UnkStruct_0204639C_cb r1, u32 * r2);
void FUN_0204640C(struct UnkStruct_0204639C * r4, UnkStruct_0204639C_cb r1, u32 * r2);
BOOL FUN_02046420(struct UnkStruct_0204639C * r5);
@@ -37,6 +39,6 @@ void FUN_02046500(struct UnkStruct_0204639C * r6, u32 r5, u32 r4);
u32 * FUN_0204652C(struct UnkStruct_0204639C * r0);
u32 * FUN_02046530(struct UnkStruct_0204639C * r0);
u32 FUN_02046534(struct UnkStruct_0204639C * r0);
-struct UnkStruct_0204639C * FUN_02046528(struct UnkStruct_0204639C *);
+struct UnkSavStruct80 * FUN_02046528(struct UnkStruct_0204639C *);
#endif //GUARD_UNK_0204639C_H
diff --git a/include/unk_0204B0A0.h b/include/unk_0204B0A0.h
new file mode 100644
index 00000000..8d37e354
--- /dev/null
+++ b/include/unk_0204B0A0.h
@@ -0,0 +1,25 @@
+#ifndef POKEDIAMOND_UNK_0204B0A0_H
+#define POKEDIAMOND_UNK_0204B0A0_H
+
+#include "RTC_api.h"
+#include "RTC_convert.h"
+#include "sav_system_info.h"
+#include "script.h"
+
+void FUN_0204B0F8(struct UnkSavStruct80* unk);
+void FUN_0204B130(struct UnkSavStruct80* unk, struct UnkSaveStruct_0202376C_sub* rtc_info, struct RTCDate* date);
+void FUN_0204B158(struct UnkSavStruct80* unk, struct UnkSaveStruct_0202376C_sub* rtc_info, struct RTCDate* date, struct RTCTime* time);
+void FUN_0204B1DC(struct UnkSavStruct80* unk, s32 a1);
+void FUN_0204B270(struct UnkSavStruct80* unk, s32 a1, struct RTCTime* time);
+u32 Script_GetTimeOfDay(struct UnkSavStruct80* unk);
+u32 Script_GetMonth(struct UnkSavStruct80* unk);
+u32 Script_GetDay(struct UnkSavStruct80* unk);
+RTCWeek Script_GetWeekday(struct UnkSavStruct80* unk);
+u32 Script_GetHour(struct UnkSavStruct80* unk);
+u32 Script_GetMinute(struct UnkSavStruct80* unk);
+void Script_SavRTC_x24toDateTime(struct UnkSavStruct80* unk, struct RTCDate* date, struct RTCTime* time);
+void Script_SavRTC_x2CtoDateTime(struct UnkSavStruct80* unk, struct RTCDate* date, struct RTCTime* time);
+void Script_SavRTC_DateTimeTox2C(struct UnkSavStruct80* unk);
+BOOL FUN_0204B33C(struct UnkSavStruct80* unk);
+
+#endif
diff --git a/include/unk_0205FA2C.h b/include/unk_0205FA2C.h
index 99cf7606..418c7077 100644
--- a/include/unk_0205FA2C.h
+++ b/include/unk_0205FA2C.h
@@ -13,6 +13,7 @@
#include "unk_0202A8F4.h"
#include "unk_0204639C.h"
#include "unk_0206BB28.h"
+#include "unk_02031480.h"
struct UnkPlayerStruct1_0205FA2C
{
@@ -79,16 +80,16 @@ struct UnkCallbackStruct2_0205FA2C
u16 unk14;
};
-THUMB_FUNC u32 FUN_0205FA2C(
- struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id);
-THUMB_FUNC u32 FUN_0205FAD8(
- struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1);
-THUMB_FUNC u32 FUN_0205FB34(
- struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1, u32 heap_id);
-THUMB_FUNC u32 FUN_0205FBC0(
- struct UnkCallbackStruct1_0205FA2C *param0, struct UnkStruct_0204639C *param1);
-THUMB_FUNC int FUN_0205FBE8(struct UnkStruct_0204639C *param0);
-THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
+u32 FUN_0205FA2C(
+ struct UnkCallbackStruct1_0205FA2C *param0, struct UnkSavStruct80 *param1, u32 heap_id);
+u32 FUN_0205FAD8(
+ struct UnkCallbackStruct1_0205FA2C *param0, struct UnkSavStruct80 *param1);
+u32 FUN_0205FB34(
+ struct UnkCallbackStruct1_0205FA2C *param0, struct UnkSavStruct80 *param1, u32 heap_id);
+u32 FUN_0205FBC0(
+ struct UnkCallbackStruct1_0205FA2C *param0, struct UnkSavStruct80 *param1);
+int FUN_0205FBE8(struct UnkStruct_0204639C *param0);
+void FUN_0205FC50(struct UnkStruct_0204639C *param0,
void **param1,
u8 param2,
u8 param3,
@@ -97,24 +98,24 @@ THUMB_FUNC void FUN_0205FC50(struct UnkStruct_0204639C *param0,
u8 param6,
u8 param7);
-THUMB_FUNC u32 FUN_0205FC9C(
- struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1);
-THUMB_FUNC u32 FUN_0205FCC4(
- struct UnkCallbackStruct2_0205FA2C *param0, struct UnkStruct_0204639C *param1);
-THUMB_FUNC int FUN_0205FCE8(struct UnkStruct_0204639C *param0);
-THUMB_FUNC void FUN_0205FD38(struct UnkStruct_0204639C *param0, u16 param1, u16 param2, u16 param3);
+u32 FUN_0205FC9C(
+ struct UnkCallbackStruct2_0205FA2C *param0, struct UnkSavStruct80 *param1);
+u32 FUN_0205FCC4(
+ struct UnkCallbackStruct2_0205FA2C *param0, struct UnkSavStruct80 *param1);
+int FUN_0205FCE8(struct UnkStruct_0204639C *param0);
+void FUN_0205FD38(struct UnkStruct_0204639C *param0, u16 param1, u16 param2, u16 param3);
-THUMB_FUNC int FUN_0205FD70(struct UnkStruct_0204639C *param0);
-THUMB_FUNC void FUN_0205FDDC(struct UnkStruct_0204639C *param0, u16 param1, u16 param2);
+int FUN_0205FD70(struct UnkStruct_0204639C *param0);
+void FUN_0205FDDC(struct UnkStruct_0204639C *param0, u16 param1, u16 param2);
-THUMB_FUNC u32 FUN_0205FE10(struct SaveBlock2 *sav2);
-THUMB_FUNC u32 FUN_0205FF5C(struct SaveBlock2 *sav2);
-THUMB_FUNC void FUN_02060044(u16 **param0, u32 *param1);
-THUMB_FUNC u32 FUN_02060064(u32 param0);
-THUMB_FUNC u32 FUN_02060070(u32 param0);
-THUMB_FUNC u32 FUN_0206007C(struct SaveBlock2 *sav2);
-THUMB_FUNC u32 FUN_020600A0(struct SaveBlock2 *sav2);
-THUMB_FUNC u32 FUN_020600DC(struct SaveBlock2 *sav2);
-THUMB_FUNC BOOL FUN_02060144(u32 **param0);
+u32 FUN_0205FE10(struct SaveBlock2 *sav2);
+u32 FUN_0205FF5C(struct SaveBlock2 *sav2);
+void FUN_02060044(u16 **param0, u32 *param1);
+u32 FUN_02060064(u32 param0);
+u32 FUN_02060070(u32 param0);
+u32 FUN_0206007C(struct SaveBlock2 *sav2);
+u32 FUN_020600A0(struct SaveBlock2 *sav2);
+u32 FUN_020600DC(struct SaveBlock2 *sav2);
+BOOL FUN_02060144(u32 **param0);
-#endif // POKEDIAMOND_UNK_0205FA2C_H \ No newline at end of file
+#endif // POKEDIAMOND_UNK_0205FA2C_H
diff --git a/include/unk_0206015C.h b/include/unk_0206015C.h
new file mode 100644
index 00000000..c285fac9
--- /dev/null
+++ b/include/unk_0206015C.h
@@ -0,0 +1,30 @@
+#ifndef UNK_0206015C_H_GUARD
+#define UNK_0206015C_H_GUARD
+
+#include "global.h"
+#include "script.h"
+#include "unk_0204639C.h"
+
+struct UnkStruct_0206015C
+{
+ u32 unk0;
+ u32 unk4;
+ u32 unk8;
+ u8 unkC;
+ u8 unkD;
+};
+
+struct UnkStruct_0204652C
+{
+ void* unk0;
+ u32 unk4;
+ u32 unk8;
+ u8 action;
+ u8 unkD; // some kind of counter?
+ u8 unkE; // some kind of counter?
+};
+
+void FUN_0206015C(struct UnkSavStruct80* savStruct);
+BOOL FUN_02060194(struct UnkStruct_0204639C * unkStruct0);
+
+#endif //UNK_0206015C_H_GUARD
diff --git a/include/unk_0206439C.h b/include/unk_0206439C.h
new file mode 100644
index 00000000..6d094e5c
--- /dev/null
+++ b/include/unk_0206439C.h
@@ -0,0 +1,15 @@
+#ifndef POKEDIAMOND_UNK_0206439C_H
+#define POKEDIAMOND_UNK_0206439C_H
+
+struct Pokemon;
+struct SaveBlock2;
+
+struct UnkStruct_0206439C
+{
+ struct Pokemon* pokemon;
+ void* unk4;
+};
+
+struct UnkStruct_0206439C* FUN_0206439C(u32 heap_id, u8 mon_idx, struct SaveBlock2* sav2);
+
+#endif
diff --git a/include/unk_0208890C.h b/include/unk_0208890C.h
new file mode 100644
index 00000000..9ec040a1
--- /dev/null
+++ b/include/unk_0208890C.h
@@ -0,0 +1,25 @@
+#ifndef POKEDIAMOND_UNK_0208890C_H
+#define POKEDIAMOND_UNK_0208890C_H
+
+struct Bag;
+struct Options;
+struct PlayerData;
+struct SaveBlock2;
+
+struct UnkStruct_0208890C
+{
+ u8 padding[0x4];
+ void* unk4;
+ void* unk8;
+ struct SaveBlock2* sav2;
+ struct PlayerData* player;
+ struct Bag* bag;
+ struct Options* options;
+ void* unk1C;
+};
+
+struct UnkStruct_0208890C* FUN_0208890C(void*, struct SaveBlock2* sav2, u32 heap_id, void*);
+void FUN_02088950(struct UnkSavStruct80*, struct UnkStruct_0208890C*);
+struct UnkStruct_0208890C* FUN_02088960(struct UnkSavStruct80*, void*, u32 heap_id);
+
+#endif
diff --git a/include/unk_02088DD8.h b/include/unk_02088DD8.h
new file mode 100644
index 00000000..318a98fb
--- /dev/null
+++ b/include/unk_02088DD8.h
@@ -0,0 +1,19 @@
+#ifndef POKEDIAMOND_UNK_02088DD8_H
+#define POKEDIAMOND_UNK_02088DD8_H
+
+struct Options;
+struct PlayerData;
+struct Pokemon;
+
+struct UnkStruct_02088DD8
+{
+ struct Pokemon* pokemon;
+ struct PlayerData* player;
+ struct Options* options;
+ void* unkC;
+ u8 padding[0x5];
+ u8 unk15;
+ u8 padding2[0x2];
+};
+
+#endif
diff --git a/include/unk_0208A300.h b/include/unk_0208A300.h
new file mode 100644
index 00000000..9c2ae898
--- /dev/null
+++ b/include/unk_0208A300.h
@@ -0,0 +1,17 @@
+#ifndef POKEDIAMOND_UNK_0208A300_H
+#define POKEDIAMOND_UNK_0208A300_H
+
+struct UnkStruct_0208A300
+{
+ u32 unk0;
+ u32 unk4;
+};
+
+struct UnkStruct_0208A300* FUN_0208A300(u32 heap_id);
+void FUN_0208A320(struct UnkStruct_0208A300* unk);
+u32 FUN_0208A328(struct UnkStruct_0208A300* unk);
+void FUN_0208A32C(struct UnkStruct_0208A300* unk, u32 a1);
+u32 FUN_0208A330(struct UnkStruct_0208A300* unk);
+void FUN_0208A334(struct UnkStruct_0208A300* unk, u32 a1);
+
+#endif