From 54c8580d34b61dfd1db5dd91e301dfc788e564de Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 15 Sep 2017 22:12:45 -0400 Subject: rom_81700F8 --- include/gpu_regs.h | 15 +++++++++++++++ include/load_save.h | 1 + include/malloc.h | 3 +++ include/new_game.h | 2 ++ include/rom4.h | 15 +++++++++++++++ include/save.h | 4 ++++ 6 files changed, 40 insertions(+) create mode 100644 include/gpu_regs.h create mode 100644 include/rom4.h (limited to 'include') diff --git a/include/gpu_regs.h b/include/gpu_regs.h new file mode 100644 index 000000000..2d47d602c --- /dev/null +++ b/include/gpu_regs.h @@ -0,0 +1,15 @@ +// +// Created by scott on 9/15/2017. +// + +#ifndef POKEEMERALD_GPU_REGS_H +#define POKEEMERALD_GPU_REGS_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void ClearGpuRegBits(u8 regOffset, u16 mask); + +#endif //POKEEMERALD_GPU_REGS_H diff --git a/include/load_save.h b/include/load_save.h index 0fedd720b..20848e1a7 100644 --- a/include/load_save.h +++ b/include/load_save.h @@ -18,5 +18,6 @@ void SaveSerializedGame(void); void LoadSerializedGame(void); void LoadPlayerBag(void); void SavePlayerBag(void); +void SetSaveBlocksPointers(u16); #endif // GUARD_LOAD_SAVE_H diff --git a/include/malloc.h b/include/malloc.h index bd870ede3..d26d19242 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -1,8 +1,11 @@ #ifndef GUARD_MALLOC_H #define GUARD_MALLOC_H +extern u8 gHeap[]; + void *Alloc(u32 size); void *AllocZeroed(u32 size); void Free(void *pointer); +void InitHeap(void *pointer, u32 size); #endif // GUARD_MALLOC_H diff --git a/include/new_game.h b/include/new_game.h index f9ad7fcb8..060279c25 100644 --- a/include/new_game.h +++ b/include/new_game.h @@ -9,5 +9,7 @@ void ClearPokedexFlags(void); void WarpToTruck(void); void NewGameInitData(void); void ResetMiniGamesResults(void); +void sub_808447C(void); +void Sav2_ClearSetDefault(void); #endif // GUARD_NEW_GAME_H diff --git a/include/rom4.h b/include/rom4.h new file mode 100644 index 000000000..1538f5dbc --- /dev/null +++ b/include/rom4.h @@ -0,0 +1,15 @@ +// +// Created by scott on 9/15/2017. +// + +#ifndef POKEEMERALD_ROM4_H +#define POKEEMERALD_ROM4_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_8086230(void); + +#endif //POKEEMERALD_ROM4_H diff --git a/include/save.h b/include/save.h index 1d7fdd6e3..e98233c67 100644 --- a/include/save.h +++ b/include/save.h @@ -1,6 +1,8 @@ #ifndef GUARD_SAVE_H #define GUARD_SAVE_H +extern u16 gSaveFileStatus; + struct SaveSectionLocation { void *data; @@ -88,5 +90,7 @@ u16 CalculateChecksum(void *, u16); //u8 unref_sub_8125FF0(u8 *data, u16 size); //u8 unref_sub_8126068(u8 sector, u8 *data, u32 size); //u8 unref_sub_8126080(u8 sector, u8 *data); +u16 sub_815355C(void); +u8 sub_81534D0(u8); #endif // GUARD_SAVE_H -- cgit v1.2.3 From 052c9f0234a6034b9db8fce30f779b95b8869df5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 16 Sep 2017 15:13:26 -0400 Subject: Fix header guards --- include/gpu_regs.h | 6 +++--- include/rom4.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/gpu_regs.h b/include/gpu_regs.h index 2d47d602c..28b97fb6e 100644 --- a/include/gpu_regs.h +++ b/include/gpu_regs.h @@ -2,8 +2,8 @@ // Created by scott on 9/15/2017. // -#ifndef POKEEMERALD_GPU_REGS_H -#define POKEEMERALD_GPU_REGS_H +#ifndef GUARD_GPU_REGS_H +#define GUARD_GPU_REGS_H // Exported type declarations @@ -12,4 +12,4 @@ // Exported ROM declarations void ClearGpuRegBits(u8 regOffset, u16 mask); -#endif //POKEEMERALD_GPU_REGS_H +#endif //GUARD_GPU_REGS_H diff --git a/include/rom4.h b/include/rom4.h index 1538f5dbc..3164c81ea 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -2,8 +2,8 @@ // Created by scott on 9/15/2017. // -#ifndef POKEEMERALD_ROM4_H -#define POKEEMERALD_ROM4_H +#ifndef GUARD_ROM4_H +#define GUARD_ROM4_H // Exported type declarations @@ -12,4 +12,4 @@ // Exported ROM declarations void sub_8086230(void); -#endif //POKEEMERALD_ROM4_H +#endif //GUARD_ROM4_H -- cgit v1.2.3 From 16f2e40576b29fd85366305b4165da3aff4aef0e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 17 Sep 2017 23:42:44 -0400 Subject: Fix naming conflicts --- include/global.berry.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/global.berry.h b/include/global.berry.h index 4b9ca644c..a77da20ba 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -46,10 +46,6 @@ struct EnigmaBerry u8 holdEffect; u8 holdEffectParam; u32 checksum; - u8 pic[(6 * 6) * TILE_SIZE_4BPP]; - u16 palette[16]; - u8 description1[45]; - u8 description2[45]; }; struct BattleEnigmaBerry -- cgit v1.2.3 From 8604291b0f0e430b01f0099ea4e098171938505b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 18 Sep 2017 08:52:57 -0400 Subject: Start decomp --- include/gba/multiboot.h | 26 +++++++++++++------------- include/gpu_regs.h | 13 +++++++++++++ include/multiboot.h | 2 +- include/unknown_task.h | 11 +++++++++++ 4 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 include/gpu_regs.h create mode 100644 include/unknown_task.h (limited to 'include') diff --git a/include/gba/multiboot.h b/include/gba/multiboot.h index e88b43a19..61c02ec52 100644 --- a/include/gba/multiboot.h +++ b/include/gba/multiboot.h @@ -8,19 +8,19 @@ struct MultiBootParam { - u32 system_work[5]; - u8 handshake_data; - u8 padding; - u16 handshake_timeout; - u8 probe_count; - u8 client_data[MULTIBOOT_NCHILD]; - u8 palette_data; - u8 response_bit; - u8 client_bit; - u8 reserved1; - u8 *boot_srcp; - u8 *boot_endp; - u8 *masterp; + u32 system_work[5]; // 00 + u8 handshake_data; // 14 + u8 padding; // 15 + u16 handshake_timeout; // 16 + u8 probe_count; // 18 + u8 client_data[MULTIBOOT_NCHILD]; // 19 + u8 palette_data; // 1c + u8 response_bit; // 1d + u8 client_bit; // 1e + u8 reserved1; // 1f + u8 *boot_srcp; // 20 + u8 *boot_endp; // 24 + const u8 *masterp; u8 *reserved2[MULTIBOOT_NCHILD]; u32 system_work2[4]; u8 sendflag; diff --git a/include/gpu_regs.h b/include/gpu_regs.h new file mode 100644 index 000000000..d0528bb83 --- /dev/null +++ b/include/gpu_regs.h @@ -0,0 +1,13 @@ +#ifndef GUARD_gpu_regs_H +#define GUARD_gpu_regs_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void DisableInterrupts(u16); +void EnableInterrupts(u16); +void SetGpuReg(u8, u16); + +#endif //GUARD_gpu_regs_H diff --git a/include/multiboot.h b/include/multiboot.h index 950c853d0..d4700ff4e 100644 --- a/include/multiboot.h +++ b/include/multiboot.h @@ -15,7 +15,7 @@ void MultiBootInit(struct MultiBootParam *mp); int MultiBootMain(struct MultiBootParam *mp); void MultiBootStartProbe(struct MultiBootParam *mp); -void MultiBootStartMaster(struct MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed); +void MultiBootStartMaster(struct MultiBootParam *mp, const u8 *srcp, int length, u8 palette_color, s8 palette_speed); int MultiBootCheckComplete(struct MultiBootParam *mp); #endif // GUARD_MULTIBOOT_H diff --git a/include/unknown_task.h b/include/unknown_task.h new file mode 100644 index 000000000..f59ca9ac3 --- /dev/null +++ b/include/unknown_task.h @@ -0,0 +1,11 @@ +#ifndef GUARD_unknown_task_H +#define GUARD_unknown_task_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void remove_some_task(void); + +#endif //GUARD_unknown_task_H -- cgit v1.2.3 From c5dddf41f58446139b52d3b60cb8738052e4a084 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 18 Sep 2017 11:26:45 -0400 Subject: sub_81BF5A4 --- include/bg.h | 19 +++++++++++++++++++ include/gba/multiboot.h | 4 ++-- include/menu.h | 2 ++ include/text.h | 4 ++-- include/window.h | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 include/bg.h (limited to 'include') diff --git a/include/bg.h b/include/bg.h new file mode 100644 index 000000000..7a0782c1b --- /dev/null +++ b/include/bg.h @@ -0,0 +1,19 @@ +#ifndef GUARD_bg_H +#define GUARD_bg_H + +struct BgTemplate { + u32 bg:2; + u32 charBaseIndex:2; + u32 mapBaseIndex:5; + u32 screenSize:2; + u32 paletteMode:1; + u32 priority:2; + u32 baseTile:10; +}; + +void ResetBgsAndClearDma3BusyFlags(u32); +void InitBgsFromTemplates(u8, const struct BgTemplate *, u8); +u32 ChangeBgX(u8, u32, u8); +u32 ChangeBgY(u8, u32, u8); + +#endif //GUARD_bg_H diff --git a/include/gba/multiboot.h b/include/gba/multiboot.h index 61c02ec52..14b6594b2 100644 --- a/include/gba/multiboot.h +++ b/include/gba/multiboot.h @@ -18,8 +18,8 @@ struct MultiBootParam u8 response_bit; // 1d u8 client_bit; // 1e u8 reserved1; // 1f - u8 *boot_srcp; // 20 - u8 *boot_endp; // 24 + const u8 *boot_srcp; // 20 + const u8 *boot_endp; // 24 const u8 *masterp; u8 *reserved2[MULTIBOOT_NCHILD]; u32 system_work2[4]; diff --git a/include/menu.h b/include/menu.h index c8aafcb30..9a23401e0 100644 --- a/include/menu.h +++ b/include/menu.h @@ -15,4 +15,6 @@ struct MenuAction2 void (*func)(u8); }; +void box_print(u8, u8, u8, u8, const void *, s8, const u8 *); + #endif // GUARD_MENU_H diff --git a/include/text.h b/include/text.h index 73e6e5437..c61f6cc98 100644 --- a/include/text.h +++ b/include/text.h @@ -186,9 +186,9 @@ bool8 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); bool8 TextPrinterWait(struct TextPrinter *textPrinter); void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); u16 RenderText(struct TextPrinter *textPrinter); -u32 GetStringWidthFixedWidthFont(u8 *str, u8 fontId, u8 letterSpacing); +u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing); u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32); -s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing); +u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing); u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str); u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y); u8 GetKeypadIconTileOffset(u8 keypadIconId); diff --git a/include/window.h b/include/window.h index 36a71a1e0..20e5fefa3 100644 --- a/include/window.h +++ b/include/window.h @@ -30,7 +30,7 @@ struct Window u8 *tileData; }; -bool16 InitWindows(struct WindowTemplate *templates); +bool16 InitWindows(const struct WindowTemplate *templates); u16 AddWindow(const struct WindowTemplate *template); int AddWindowWithoutTileMap(struct WindowTemplate *template); void RemoveWindow(u8 windowId); -- cgit v1.2.3 From 39e6bdf094ac1b53109782c9b5b98c211bbe3149 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 18 Sep 2017 14:04:00 -0400 Subject: sub_81BF7E8 --- include/bg.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/bg.h b/include/bg.h index 7a0782c1b..444d3f3c2 100644 --- a/include/bg.h +++ b/include/bg.h @@ -15,5 +15,9 @@ void ResetBgsAndClearDma3BusyFlags(u32); void InitBgsFromTemplates(u8, const struct BgTemplate *, u8); u32 ChangeBgX(u8, u32, u8); u32 ChangeBgY(u8, u32, u8); +void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); +void ShowBg(u8); +void HideBg(u8); +void CopyBgTilemapBufferToVram(u8); #endif //GUARD_bg_H -- cgit v1.2.3 From bff89725ec31f87c296ec45f107f81dfe3cd54d6 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 09:46:17 -0400 Subject: Add battle_dome_cards header to expose symbols as needed --- include/battle_dome_cards.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 include/battle_dome_cards.h (limited to 'include') diff --git a/include/battle_dome_cards.h b/include/battle_dome_cards.h new file mode 100644 index 000000000..a0696d156 --- /dev/null +++ b/include/battle_dome_cards.h @@ -0,0 +1,13 @@ +#ifndef GUARD_BATTLE_DOME_CARDS_H +#define GUARD_BATTLE_DOME_CARDS_H + +bool16 dp13_810BB8C(void); +u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D7D8(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D820(u16 spriteId); +u16 sub_818D8AC(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag); +u16 sub_818D8F0(u16 spriteId); +u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId); +u8 sub_818D97C(u8 a0, u8 a1); + +#endif //GUARD_BATTLE_DOME_CARDS_H -- cgit v1.2.3 From e7e1938094081ba2e20232caca0239cb2290251f Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:17:23 -0400 Subject: Start decompilation of lilycove_lady --- include/global.h | 35 ++++++++++++++++++++++++++++++++++- include/vars.h | 2 ++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index e694a5974..764eff563 100644 --- a/include/global.h +++ b/include/global.h @@ -655,6 +655,39 @@ struct DaycareData #define FLAGS_COUNT 300 #define VARS_COUNT 256 +enum { + LILYCOVE_LADY_QUIZ, + LILYCOVE_LADY_FAVOUR, + LILYCOVE_LADY_CONTEST +}; + +typedef union // TODO +{ + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 language; + } quiz; + + struct + { + /*0x000*/ u8 id; + } flavor; + + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[12]; + /*0x00d*/ u8 category; // maybe? + } contest; + + struct + { + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[535]; + } common; +} LilycoveLady; + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -738,7 +771,7 @@ struct SaveBlock1 /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; - /*0x3B58*/ u8 lilycoveLady[536]; // TODO: convert to a union + /*0x3B58*/ LilycoveLady lilycoveLady; // TODO: convert to a union /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; diff --git a/include/vars.h b/include/vars.h index 5da960640..7c0edeb77 100644 --- a/include/vars.h +++ b/include/vars.h @@ -12,6 +12,8 @@ #define VAR_0x4008 0x4008 #define VAR_0x4009 0x4009 #define VAR_0x400A 0x400A +#define VAR_0x4010 0x4010 +#define VAR_0x4011 0x4011 #define VAR_0x401F 0x401F #define VAR_RECYCLE_GOODS 0x4020 #define VAR_REPEL_STEP_COUNT 0x4021 -- cgit v1.2.3 From b26eb6713bb866f1173b4c7192ce231d894d19ea Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:32:33 -0400 Subject: sub_818DB20 --- include/global.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 764eff563..92435ce28 100644 --- a/include/global.h +++ b/include/global.h @@ -672,7 +672,11 @@ typedef union // TODO struct { /*0x000*/ u8 id; - } flavor; + /*0x001*/ u8 filler_001[11]; + /*0x00c*/ u8 unk_00c; + /*0x00d*/ u8 filler_00d[3]; + /*0x010*/ u16 unk_010; + } favour; struct { -- cgit v1.2.3 From 4e8a2c6934c4f8a44ed8d350fe96996beda21d0e Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 16:55:53 -0400 Subject: SetLilycoveFavourLady --- include/global.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 92435ce28..0fc860e68 100644 --- a/include/global.h +++ b/include/global.h @@ -672,10 +672,16 @@ typedef union // TODO struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[11]; + /*0x001*/ u8 unk_001; + /*0x002*/ u8 unk_002; + /*0x003*/ u8 unk_003; + /*0x004*/ u8 unk_004; + /*0x005*/ u8 filler_005[7]; /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d[3]; + /*0x00d*/ u8 filler_00d; + /*0x00e*/ u16 unk_00e; /*0x010*/ u16 unk_010; + /*0x012*/ u8 language; } favour; struct -- cgit v1.2.3 From 3b3423d1a751134ff7941b41bad72e0e75314647 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 19 Sep 2017 17:07:36 -0400 Subject: sub_818DC60 --- include/global.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 0fc860e68..42629cf48 100644 --- a/include/global.h +++ b/include/global.h @@ -675,8 +675,7 @@ typedef union // TODO /*0x001*/ u8 unk_001; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004; - /*0x005*/ u8 filler_005[7]; + /*0x004*/ u8 unk_004[8]; /*0x00c*/ u8 unk_00c; /*0x00d*/ u8 filler_00d; /*0x00e*/ u16 unk_00e; -- cgit v1.2.3 From 316f9f4d83d118437c266526cc0e6da1dfc90461 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 21:28:01 -0400 Subject: through sub_818DD14 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 64ed869ef..8c2122b39 100644 --- a/include/global.h +++ b/include/global.h @@ -684,7 +684,7 @@ typedef union // TODO /*0x004*/ u8 unk_004[8]; /*0x00c*/ u8 unk_00c; /*0x00d*/ u8 filler_00d; - /*0x00e*/ u16 unk_00e; + /*0x00e*/ u16 itemId; /*0x010*/ u16 unk_010; /*0x012*/ u8 language; } favour; -- cgit v1.2.3 From 534dd2c4b0259f87657b2e8795d96217e8bf12cc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 21:47:15 -0400 Subject: sub_818DD84 --- include/item_menu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 include/item_menu.h (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h new file mode 100644 index 000000000..f402f5cdd --- /dev/null +++ b/include/item_menu.h @@ -0,0 +1,11 @@ +#ifndef GUARD_item_menu_H +#define GUARD_item_menu_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_81AAC50(void); + +#endif //GUARD_item_menu_H -- cgit v1.2.3 From 73ee165ef6b05417dc42be721e625712c6538ed6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 22:25:31 -0400 Subject: sub_818DF00 --- include/global.h | 66 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 8c2122b39..42fe0cfbb 100644 --- a/include/global.h +++ b/include/global.h @@ -667,39 +667,51 @@ enum { LILYCOVE_LADY_CONTEST }; -typedef union // TODO +struct LilycoveLadyQuiz { - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 language; - } quiz; + /*0x000*/ u8 id; + /*0x001*/ u8 language; + /*0x002*/ u16 unk_002[9]; + /*0x014*/ u16 unk_014; + /*0x016*/ u8 filler_016[2]; + /*0x018*/ u8 unk_018; + /*0x019*/ u8 filler_019[15]; + /*0x028*/ u16 unk_028; + /*0x02a*/ u8 filler_02a; + /*0x02b*/ u8 unk_02b; +}; - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; - /*0x002*/ u8 unk_002; - /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004[8]; - /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d; - /*0x00e*/ u16 itemId; - /*0x010*/ u16 unk_010; - /*0x012*/ u8 language; - } favour; +struct LilycoveLadyFavour +{ + /*0x000*/ u8 id; + /*0x001*/ u8 unk_001; + /*0x002*/ u8 unk_002; + /*0x003*/ u8 unk_003; + /*0x004*/ u8 unk_004[8]; + /*0x00c*/ u8 unk_00c; + /*0x00d*/ u8 filler_00d; + /*0x00e*/ u16 itemId; + /*0x010*/ u16 unk_010; + /*0x012*/ u8 language; +}; - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[12]; - /*0x00d*/ u8 category; // maybe? - } contest; +struct LilycoveLadyContest +{ + /*0x000*/ u8 id; + /*0x001*/ u8 filler_001[12]; + /*0x00d*/ u8 category; // maybe? +}; + +typedef union // TODO +{ + struct LilycoveLadyQuiz quiz; + struct LilycoveLadyFavour favour; + struct LilycoveLadyContest contest; struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[535]; + /*0x001*/ u8 filler_001[0x207]; } common; } LilycoveLady; @@ -786,7 +798,7 @@ struct SaveBlock1 /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; - /*0x3B58*/ LilycoveLady lilycoveLady; // TODO: convert to a union + /*0x3B58*/ LilycoveLady lilycoveLady; /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; -- cgit v1.2.3 From 28d0fa33fef825dcb22d45db966ef814c461dd08 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 19 Sep 2017 22:35:40 -0400 Subject: SetLilicoveQuizLady --- include/global.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 42fe0cfbb..84c70a16e 100644 --- a/include/global.h +++ b/include/global.h @@ -670,15 +670,18 @@ enum { struct LilycoveLadyQuiz { /*0x000*/ u8 id; - /*0x001*/ u8 language; + /*0x001*/ u8 unk_001; /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; - /*0x016*/ u8 filler_016[2]; + /*0x016*/ u16 unk_016; /*0x018*/ u8 unk_018; - /*0x019*/ u8 filler_019[15]; + /*0x019*/ u8 filler_019[7]; + /*0x020*/ u16 unk_020[4]; /*0x028*/ u16 unk_028; - /*0x02a*/ u8 filler_02a; + /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; + /*0x02c*/ u8 unk_02c; + /*0x02d*/ u8 language; }; struct LilycoveLadyFavour -- cgit v1.2.3 From 0b81c2920aa87aae3403efdf60e40b58445efbbf Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 10:45:00 -0400 Subject: sub_818E1F4 --- include/global.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 84c70a16e..569345355 100644 --- a/include/global.h +++ b/include/global.h @@ -674,9 +674,8 @@ struct LilycoveLadyQuiz /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; /*0x016*/ u16 unk_016; - /*0x018*/ u8 unk_018; - /*0x019*/ u8 filler_019[7]; - /*0x020*/ u16 unk_020[4]; + /*0x018*/ u8 playerName[8]; + /*0x020*/ u16 playerTrainerId[4]; /*0x028*/ u16 unk_028; /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; @@ -690,9 +689,8 @@ struct LilycoveLadyFavour /*0x001*/ u8 unk_001; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; - /*0x004*/ u8 unk_004[8]; + /*0x004*/ u8 playerName[8]; /*0x00c*/ u8 unk_00c; - /*0x00d*/ u8 filler_00d; /*0x00e*/ u16 itemId; /*0x010*/ u16 unk_010; /*0x012*/ u8 language; -- cgit v1.2.3 From 8a31e58689af6e62c8c272c24397310c2a44f6f5 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:30:09 -0400 Subject: sub_818E298 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 569345355..09dabf822 100644 --- a/include/global.h +++ b/include/global.h @@ -676,7 +676,7 @@ struct LilycoveLadyQuiz /*0x016*/ u16 unk_016; /*0x018*/ u8 playerName[8]; /*0x020*/ u16 playerTrainerId[4]; - /*0x028*/ u16 unk_028; + /*0x028*/ u16 itemId; /*0x02a*/ u8 unk_02a; /*0x02b*/ u8 unk_02b; /*0x02c*/ u8 unk_02c; -- cgit v1.2.3 From 213fef604247d31f6981bd83c703bb1d3e1bbd31 Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:44:20 -0400 Subject: through sub_818E308 --- include/easy_chat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/easy_chat.h b/include/easy_chat.h index 5143aa39c..d7dc72410 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -29,5 +29,7 @@ enum }; void InitEasyChatPhrases(void); +void easy_chat_input_maybe(void); +void CopyEasyChatWord(u8 *, u16); #endif // GUARD_EASYCHAT_H -- cgit v1.2.3 From fdea92edffb4360db50cb0e7dcc044dc7242defe Mon Sep 17 00:00:00 2001 From: scnorton Date: Wed, 20 Sep 2017 11:48:11 -0400 Subject: through sub_818E3E0 --- include/item_menu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h index f402f5cdd..85655e9d5 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -7,5 +7,6 @@ // Exported ROM declarations void sub_81AAC50(void); +void sub_81AAC70(void); #endif //GUARD_item_menu_H -- cgit v1.2.3 From d22a9acc63b9f7c72e0d7ec81396b799af94e270 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 16:12:18 -0400 Subject: through sub_818E490 --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 09dabf822..6fa8cb92d 100644 --- a/include/global.h +++ b/include/global.h @@ -712,7 +712,7 @@ typedef union // TODO struct { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[0x207]; + /*0x001*/ u8 filler_001[0x217]; } common; } LilycoveLady; -- cgit v1.2.3 From 7c8cbc6b88d745da215fc45730f84b598869438f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 16:49:22 -0400 Subject: SetLilycoveContestLady --- include/global.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 6fa8cb92d..fa7856786 100644 --- a/include/global.h +++ b/include/global.h @@ -670,7 +670,7 @@ enum { struct LilycoveLadyQuiz { /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; + /*0x001*/ u8 phase; /*0x002*/ u16 unk_002[9]; /*0x014*/ u16 unk_014; /*0x016*/ u16 unk_016; @@ -686,7 +686,7 @@ struct LilycoveLadyQuiz struct LilycoveLadyFavour { /*0x000*/ u8 id; - /*0x001*/ u8 unk_001; + /*0x001*/ u8 phase; /*0x002*/ u8 unk_002; /*0x003*/ u8 unk_003; /*0x004*/ u8 playerName[8]; @@ -699,8 +699,13 @@ struct LilycoveLadyFavour struct LilycoveLadyContest { /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[12]; - /*0x00d*/ u8 category; // maybe? + /*0x001*/ u8 phase; + /*0x002*/ u8 fave_pkblk; + /*0x003*/ u8 other_pkblk; + /*0x004*/ u8 playerName[8]; + /*0x00c*/ u8 max_sheen; + /*0x00d*/ u8 category; + /*0x00e*/ u8 language; }; typedef union // TODO @@ -708,12 +713,7 @@ typedef union // TODO struct LilycoveLadyQuiz quiz; struct LilycoveLadyFavour favour; struct LilycoveLadyContest contest; - - struct - { - /*0x000*/ u8 id; - /*0x001*/ u8 filler_001[0x217]; - } common; + u8 id; } LilycoveLady; struct SaveBlock1 @@ -800,6 +800,7 @@ struct SaveBlock1 /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; /*0x3B58*/ LilycoveLady lilycoveLady; + /*0x3B88*/ u8 filler_3B88[0x1E8]; /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; -- cgit v1.2.3 From d263750f1903a89fc61b2496453ff1c5b4b9a58b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 20:48:32 -0400 Subject: remaining lilycove lady functions --- include/rom4.h | 1 + include/rom6.h | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 include/rom6.h (limited to 'include') diff --git a/include/rom4.h b/include/rom4.h index a1c4281e9..e19d277a6 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -28,5 +28,6 @@ void strange_npc_table_clear(void); const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); void sub_8086230(void); +void c2_exit_to_overworld_2_switch(void); #endif //GUARD_ROM4_H diff --git a/include/rom6.h b/include/rom6.h new file mode 100644 index 000000000..15070616d --- /dev/null +++ b/include/rom6.h @@ -0,0 +1,6 @@ +#ifndef GUARD_ROM6_H +#define GUARD_ROM6_H + +void sub_81357FC(u8, void(void)); + +#endif //GUARD_ROM6_H -- cgit v1.2.3 From 942fbe87d42ed1208217deac3cfa4f21908d446a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Sep 2017 21:03:57 -0400 Subject: Populate header, label as static whatever won't break things --- include/easy_chat.h | 1 + include/lilycove_lady.h | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/easy_chat.h b/include/easy_chat.h index d7dc72410..fc44b6a8a 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -31,5 +31,6 @@ enum void InitEasyChatPhrases(void); void easy_chat_input_maybe(void); void CopyEasyChatWord(u8 *, u16); +bool32 sub_811F8D8(u16); #endif // GUARD_EASYCHAT_H diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index 81825d8ac..c7776131b 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -1,6 +1,17 @@ #ifndef GUARD_LILYCOVE_LADY_H #define GUARD_LILYCOVE_LADY_H +u8 GetLilycoveLadyId(void); void SetLilycoveLady(void); +void sub_818DA78(void); +void sub_818DEF4(void); +void sub_818E564(void); +void sub_818E570(const struct LilycoveLadyQuiz *quiz); +bool8 sub_818E704(struct Pokeblock *pokeblock); +void sub_818E7E0(u8 *dest1, u8 *dest2); +void sub_818E81C(u8 *dest); +void sub_818E848(u8 *dest); +void sub_818E868(u8 *dest, u8 category); +u8 sub_818E880(void); #endif //GUARD_LILYCOVE_LADY_H -- cgit v1.2.3