From ca2bc94c2be5d7b915e5ab913ef026aa12b8fc0f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 3 Nov 2017 20:59:29 -0400 Subject: through sub_80E6BF8 --- include/cable_club.h | 12 ++++++++++++ include/global.h | 6 +++--- include/record_mixing.h | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 include/cable_club.h create mode 100644 include/record_mixing.h (limited to 'include') diff --git a/include/cable_club.h b/include/cable_club.h new file mode 100644 index 000000000..adb0c4f90 --- /dev/null +++ b/include/cable_club.h @@ -0,0 +1,12 @@ +#ifndef GUARD_CABLE_CLUB_H +#define GUARD_CABLE_CLUB_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +void sub_80B37D4(TaskFunc taskFunc); + +#endif //GUARD_CABLE_CLUB_H diff --git a/include/global.h b/include/global.h index 3421517d7..ad4f23c2b 100644 --- a/include/global.h +++ b/include/global.h @@ -192,7 +192,8 @@ struct SaveBlock2 /*0xAC*/ u32 encryptionKey; // TODO: fix and verify labels - /*0xB0*/ u8 field_B0[316]; + /*0xB0*/ u8 field_B0[0x2c]; + /*0xDC*/ u8 field_0DC[0x110]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; @@ -579,13 +580,12 @@ struct SaveBlock1 /*0x2BB0*/ u16 unk2BB0[6]; /*0x2BBC*/ u16 unk2BBC[6]; /*0x2BC8*/ u16 unk2BC8[6]; - /*0x2BD4*/ u16 unk2BD4[3]; + /*0x2BD4*/ u16 unk2BD4[6]; /*0x2BE0*/ struct MailStruct mail[16]; /*0x2E20*/ u8 additionalPhrases[5]; // bitfield for 33 additional phrases in easy chat system /*0x2E25*/ u8 unk2E25[3]; // possibly padding? /*0x2E28*/ OldMan oldMan; /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2e8c*/ u8 filler_2E8C[0x4]; /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum /*0x3030*/ struct DaycareData daycare; /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5]; diff --git a/include/record_mixing.h b/include/record_mixing.h new file mode 100644 index 000000000..5ccbdc0dd --- /dev/null +++ b/include/record_mixing.h @@ -0,0 +1,19 @@ +#ifndef GUARD_RECORD_MIXING_H +#define GUARD_RECORD_MIXING_H + +// Exported type declarations + +struct DayCareMailRecordMixing { + struct MailStruct mail; + u8 OT_name[OT_NAME_LENGTH + 1]; + u8 monName[11]; + u8 language_maybe : 4; + u8 unknown : 4; + u32 stepsTaken; +}; + +// Exported RAM declarations + +// Exported ROM declarations + +#endif //GUARD_RECORD_MIXING_H -- cgit v1.2.3 From f8486b31c531dd9622e748e1382ab9e4b8a5fc5c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 3 Nov 2017 21:56:18 -0400 Subject: sub_80E6CA0 --- include/battle_tower.h | 1 + include/gba/gba.h | 1 + include/gba/libc.h | 10 ++++++++++ include/global.h | 7 ------- include/mystery_event_script.h | 1 + 5 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 include/gba/libc.h (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 25b439c1b..a3bd3b6e8 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -2,5 +2,6 @@ #define GUARD_BATTLE_TOWER_H u16 sub_8164FCC(u8, u8); +void sub_81659DC(void *a0, void *a1); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/gba/gba.h b/include/gba/gba.h index 42ae3cdde..19b65dbca 100644 --- a/include/gba/gba.h +++ b/include/gba/gba.h @@ -7,5 +7,6 @@ #include "gba/multiboot.h" #include "gba/syscall.h" #include "gba/macro.h" +#include "gba/libc.h" #endif // GUARD_GBA_GBA_H diff --git a/include/gba/libc.h b/include/gba/libc.h new file mode 100644 index 000000000..9ed82ac28 --- /dev/null +++ b/include/gba/libc.h @@ -0,0 +1,10 @@ +#ifndef GUARD_LIBC_H +#define GUARD_LIBC_H + +void *memset(void *dst, int val, size_t size); +void *memcpy(void *dst, const void *src, size_t size); +int strcmp(const char *s1, const char *s2); +char *strcpy(char *dst0, const char *src0); +#define abs(x) ((x) >= 0 ? (x) : -(x)) + +#endif //GUARD_LIBC_H diff --git a/include/global.h b/include/global.h index ad4f23c2b..f3c58a3d8 100644 --- a/include/global.h +++ b/include/global.h @@ -11,13 +11,6 @@ #define asm_comment(x) asm volatile("@ -- " x " -- ") #define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided") -#if defined (__APPLE__) || defined (__CYGWIN__) -void *memset(void *, int, size_t); -void *memcpy(void *, const void *, size_t); -int strcmp(const char *s1, const char *s2); -char* strcpy(char *dst0, const char *src0); -#endif // __APPLE__ - #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) // useful math macros diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h index ab23a8d00..1fad6c485 100644 --- a/include/mystery_event_script.h +++ b/include/mystery_event_script.h @@ -4,5 +4,6 @@ u32 RunMysteryEventScript(u8 *); void SetMysteryEventScriptStatus(u32 val); u16 GetRecordMixingGift(void); +u16 sub_81539D4(void); #endif // GUARD_MYSTERY_EVENT_SCRIPT_H -- cgit v1.2.3 From 20ebcf71699a3463e130b68b1c2c2a3f984c8db8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 3 Nov 2017 22:07:36 -0400 Subject: sub_80E6D54 --- include/mauville_old_man.h | 1 + include/secret_base.h | 1 + include/tv.h | 1 + 3 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index aefc76083..25c5d8cd2 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -4,5 +4,6 @@ void SetMauvilleOldMan(void); u8 sub_81201C8(void); +void sub_8120B70(OldMan *dest); #endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/secret_base.h b/include/secret_base.h index 14defff26..d3ef57653 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -8,5 +8,6 @@ // Exported ROM declarations void sub_80E9578(void); void sub_80E980C(void); +void sub_80EB18C(struct SecretBaseRecord *dest); #endif //GUARD_SECRET_BASE_H diff --git a/include/tv.h b/include/tv.h index 43f36d69f..ea5bb726f 100644 --- a/include/tv.h +++ b/include/tv.h @@ -13,5 +13,6 @@ void sub_80EE184(void); void sub_80EEA70(void); void sub_80F14F8(TVShow *shows); size_t sub_80EF370(int value); +void sub_80F1208(TVShow *dest); #endif //GUARD_TV_H -- cgit v1.2.3 From 1c3e7f169f26d471280a0f7aa1043dbd68e981c7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 3 Nov 2017 22:26:12 -0400 Subject: sub_80E6E24 --- include/global.h | 5 +++-- include/link.h | 2 ++ include/record_mixing.h | 2 ++ include/secret_base.h | 1 + include/tv.h | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index f3c58a3d8..8343f99f8 100644 --- a/include/global.h +++ b/include/global.h @@ -490,12 +490,13 @@ struct LilycoveLadyContest /*0x00e*/ u8 language; }; -typedef union // TODO +typedef union { struct LilycoveLadyQuiz quiz; struct LilycoveLadyFavour favour; struct LilycoveLadyContest contest; u8 id; + u8 pad[0x40]; } LilycoveLady; struct WaldaPhrase @@ -592,7 +593,7 @@ struct SaveBlock1 /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; /*0x3B58*/ LilycoveLady lilycoveLady; - /*0x3B88*/ u8 filler_3B88[0x1E8]; + /*0x3B98*/ u8 filler_3B88[0x1D8]; /*0x3D70*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3D88 }; diff --git a/include/link.h b/include/link.h index 7a6563144..1bcdb047c 100644 --- a/include/link.h +++ b/include/link.h @@ -192,5 +192,7 @@ void sub_8011BD0(void); u8 sub_800ABAC(void); u8 sub_800ABBC(void); void sub_800AC34(void); +bool32 sub_800A064(void); +bool32 sub_800A03C(void); #endif // GUARD_LINK_H diff --git a/include/record_mixing.h b/include/record_mixing.h index 5ccbdc0dd..86e4b982e 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -16,4 +16,6 @@ struct DayCareMailRecordMixing { // Exported ROM declarations +void sub_80E8260(void *); + #endif //GUARD_RECORD_MIXING_H diff --git a/include/secret_base.h b/include/secret_base.h index d3ef57653..43ea66ebc 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -9,5 +9,6 @@ void sub_80E9578(void); void sub_80E980C(void); void sub_80EB18C(struct SecretBaseRecord *dest); +void sub_80E9914(void); #endif //GUARD_SECRET_BASE_H diff --git a/include/tv.h b/include/tv.h index ea5bb726f..9dc0f7719 100644 --- a/include/tv.h +++ b/include/tv.h @@ -14,5 +14,6 @@ void sub_80EEA70(void); void sub_80F14F8(TVShow *shows); size_t sub_80EF370(int value); void sub_80F1208(TVShow *dest); +void sub_80F0BB8(void); #endif //GUARD_TV_H -- cgit v1.2.3 From c05444679059e0692275781d065d36e79610cc4c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 10:15:58 -0400 Subject: through sub_80E715C --- include/cable_club.h | 1 + include/field_screen.h | 1 + include/fldeff_80F9BCC.h | 2 ++ include/link.h | 3 ++- include/overworld.h | 1 + include/strings.h | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cable_club.h b/include/cable_club.h index adb0c4f90..44831235c 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -8,5 +8,6 @@ // Exported ROM declarations void sub_80B37D4(TaskFunc taskFunc); +u8 sub_80B3050(void); #endif //GUARD_CABLE_CLUB_H diff --git a/include/field_screen.h b/include/field_screen.h index 089e79cc4..6e33a8b7b 100644 --- a/include/field_screen.h +++ b/include/field_screen.h @@ -9,5 +9,6 @@ void pal_fill_black(void); bool8 sub_80ABDFC(void); void sub_80AF168(void); +void sub_80AF2B4(u8 taskId); #endif //GUARD_FIELD_SCREEN_H diff --git a/include/fldeff_80F9BCC.h b/include/fldeff_80F9BCC.h index ecce04943..aae4751c1 100644 --- a/include/fldeff_80F9BCC.h +++ b/include/fldeff_80F9BCC.h @@ -9,5 +9,7 @@ void sub_80FA5E4(s16 id, s16 x, s16 y); void sub_80FA794(s16 x, s16 y); +void sub_80FB00C(void); +void sub_80FB074(void); #endif //GUARD_FLDEFF_80F9BCC_H diff --git a/include/link.h b/include/link.h index 1bcdb047c..6e60a1a84 100644 --- a/include/link.h +++ b/include/link.h @@ -192,7 +192,8 @@ void sub_8011BD0(void); u8 sub_800ABAC(void); u8 sub_800ABBC(void); void sub_800AC34(void); -bool32 sub_800A064(void); +bool32 Link_AnyPartnersPlayingRubyOrSapphrie(void); bool32 sub_800A03C(void); +void sub_8009628(u8); #endif // GUARD_LINK_H diff --git a/include/overworld.h b/include/overworld.h index 19bcaaf01..63c54eee3 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -64,5 +64,6 @@ void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpNum); void c2_load_new_map(void); void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused); void mapldr_default(void); +void sub_808729C(void); #endif //GUARD_ROM4_H diff --git a/include/strings.h b/include/strings.h index fcdb1eca4..735fc1f1c 100644 --- a/include/strings.h +++ b/include/strings.h @@ -75,5 +75,6 @@ extern const u8 gText_NoRegistry[]; extern const u8 gText_OkayToDeleteFromRegistry[]; extern const u8 gText_RegisteredDataDeleted[]; extern const u8 gUnknown_085EA79D[]; +extern const u8 gText_RecordMixingComplete[]; #endif //GUARD_STRINGS_H -- cgit v1.2.3 From 411cb29f4ab513da00d15ff16fc98fed8b31dfdb Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 10:55:39 -0400 Subject: sub_80E7324 --- include/link.h | 2 ++ include/strings.h | 1 + 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index 6e60a1a84..8cd2ee72e 100644 --- a/include/link.h +++ b/include/link.h @@ -195,5 +195,7 @@ void sub_800AC34(void); bool32 Link_AnyPartnersPlayingRubyOrSapphrie(void); bool32 sub_800A03C(void); void sub_8009628(u8); +u8 sub_800AA48(void); +void sub_8009FAC(void); #endif // GUARD_LINK_H diff --git a/include/strings.h b/include/strings.h index 735fc1f1c..7ba979cdc 100644 --- a/include/strings.h +++ b/include/strings.h @@ -75,6 +75,7 @@ extern const u8 gText_NoRegistry[]; extern const u8 gText_OkayToDeleteFromRegistry[]; extern const u8 gText_RegisteredDataDeleted[]; extern const u8 gUnknown_085EA79D[]; +extern const u8 gText_MixingRecords[]; extern const u8 gText_RecordMixingComplete[]; #endif //GUARD_STRINGS_H -- cgit v1.2.3 From 6c746425ed48ba6d4d6519959b13914192da95b7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 11:16:07 -0400 Subject: sub_80E756C --- include/link.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index 8cd2ee72e..79ec62961 100644 --- a/include/link.h +++ b/include/link.h @@ -6,6 +6,8 @@ #define QUEUE_CAPACITY 50 #define BLOCK_BUFFER_SIZE 0x100 +#define gBlockSendBuffer gUnknown_020228C4 // FIXME + #define LINK_STAT_LOCAL_ID 0x00000003 #define LINK_STAT_PLAYER_COUNT 0x0000001C #define LINK_STAT_PLAYER_COUNT_SHIFT 2 @@ -197,5 +199,6 @@ bool32 sub_800A03C(void); void sub_8009628(u8); u8 sub_800AA48(void); void sub_8009FAC(void); +void sub_800A4D8(u8); #endif // GUARD_LINK_H -- cgit v1.2.3 From d921e555d20151c420eb0dab03913125a7bbf1fb Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 11:39:23 -0400 Subject: sub_80E7630 --- include/link.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/link.h b/include/link.h index 79ec62961..04a7d3864 100644 --- a/include/link.h +++ b/include/link.h @@ -200,5 +200,6 @@ void sub_8009628(u8); u8 sub_800AA48(void); void sub_8009FAC(void); void sub_800A4D8(u8); +u8 sub_800A9D8(void); #endif // GUARD_LINK_H -- cgit v1.2.3 From 158e9ff7623a8eba3e00c962e1050c6937bf535a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 12:20:40 -0400 Subject: sub_80E78C4 --- include/link.h | 2 +- include/mauville_old_man.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/link.h b/include/link.h index 04a7d3864..77e9a9d24 100644 --- a/include/link.h +++ b/include/link.h @@ -194,7 +194,7 @@ void sub_8011BD0(void); u8 sub_800ABAC(void); u8 sub_800ABBC(void); void sub_800AC34(void); -bool32 Link_AnyPartnersPlayingRubyOrSapphrie(void); +bool32 Link_AnyPartnersPlayingRubyOrSapphire(void); bool32 sub_800A03C(void); void sub_8009628(u8); u8 sub_800AA48(void); diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index 25c5d8cd2..0c0ed624a 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -5,5 +5,8 @@ void SetMauvilleOldMan(void); u8 sub_81201C8(void); void sub_8120B70(OldMan *dest); +void sub_8120D34(OldMan *dest, u8 version, u16 language); +void sub_8120CD0(OldMan *dest, u8 version, u16 language); +void sub_8120670(void); #endif // GUARD_MAUVILLE_OLD_MAN_H -- cgit v1.2.3 From f2e723660bba8432f398784f9a1ea0d609e24e8d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 18:48:13 -0400 Subject: sub_80E7948 --- include/battle_tower.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index a3bd3b6e8..7bacf5249 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -1,7 +1,44 @@ #ifndef GUARD_BATTLE_TOWER_H #define GUARD_BATTLE_TOWER_H +struct RSBattleTowerRecord { + /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 + /*0x01*/ u8 trainerClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[8]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ struct { + u16 easyChat[6]; + } greeting; + /*0x1C*/ struct UnknownPokemonStruct party[3]; + /*0xA0*/ u32 checksum; + /*0xA4*/ u16 unk_11c8; +}; + +struct EmeraldBattleTowerRecord { + /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 + /*0x01*/ u8 trainerClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[8]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ struct { + u16 easyChat[6]; + } greeting; + /*0x1C*/ u8 filler_1c[0x18]; + /*0x34*/ struct UnknownPokemonStruct party[4]; + /*0xe4*/ u8 language; + u8 filler_e5[7]; +}; + +union BattleTowerRecord { + struct RSBattleTowerRecord ruby_sapphire; + struct EmeraldBattleTowerRecord emerald; +}; + u16 sub_8164FCC(u8, u8); -void sub_81659DC(void *a0, void *a1); +void sub_81659DC(union BattleTowerRecord *a0, union BattleTowerRecord *a1); +bool32 sub_816587C(union BattleTowerRecord *, union BattleTowerRecord *); +bool32 sub_8164F70(union BattleTowerRecord *); +void sub_81628A0(union BattleTowerRecord *); #endif //GUARD_BATTLE_TOWER_H -- cgit v1.2.3 From 8d05aeccec2efb8943823124aaca79277d5ed305 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 4 Nov 2017 19:03:41 -0400 Subject: sub_80E7A14 --- include/lilycove_lady.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index c7776131b..66922273e 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -6,7 +6,7 @@ void SetLilycoveLady(void); void sub_818DA78(void); void sub_818DEF4(void); void sub_818E564(void); -void sub_818E570(const struct LilycoveLadyQuiz *quiz); +void sub_818E570(const LilycoveLady *lilycoveLady); bool8 sub_818E704(struct Pokeblock *pokeblock); void sub_818E7E0(u8 *dest1, u8 *dest2); void sub_818E81C(u8 *dest); -- cgit v1.2.3 From 0a17fc98f6cc08151aab395064185815e41ab898 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 6 Nov 2017 23:03:11 -0500 Subject: nonmatching sub_80E7B60 --- include/record_mixing.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/record_mixing.h b/include/record_mixing.h index 86e4b982e..e327d1510 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -7,11 +7,16 @@ struct DayCareMailRecordMixing { struct MailStruct mail; u8 OT_name[OT_NAME_LENGTH + 1]; u8 monName[11]; - u8 language_maybe : 4; - u8 unknown : 4; - u32 stepsTaken; + u8 language_maybe:4; + u8 unknown:4; }; +struct UnkStruct_80E7B60 { + struct DayCareMailRecordMixing unk_00[2]; + u32 unk_70; + u16 unk_74[2]; +}; // size = 0x78 + // Exported RAM declarations // Exported ROM declarations -- cgit v1.2.3 From 8d6007256f2d59765c89c41af4f3487e283e9381 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 6 Nov 2017 23:20:11 -0500 Subject: sub_80E7F68 --- include/items.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/items.h b/include/items.h index 69515f18e..b8cc23d82 100644 --- a/include/items.h +++ b/include/items.h @@ -386,4 +386,13 @@ enum ITEM_OLD_SEA_MAP, // 0x178 }; +enum +{ + ITEMS_POCKET, + BALLS_POCKET, + TMHM_POCKET, + BERRIES_POCKET, + KEYITEMS_POCKET +}; + #endif // GUARD_ITEMS_H -- cgit v1.2.3 From bc063b45d05716d1eab283f6d474bcdc601cafde Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 6 Nov 2017 23:33:39 -0500 Subject: sub_80E7FF8 --- include/link.h | 1 + include/load_save.h | 3 ++- include/save.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/link.h b/include/link.h index 77e9a9d24..a33c7da89 100644 --- a/include/link.h +++ b/include/link.h @@ -201,5 +201,6 @@ u8 sub_800AA48(void); void sub_8009FAC(void); void sub_800A4D8(u8); u8 sub_800A9D8(void); +bool8 sub_801048C(u8); #endif // GUARD_LINK_H diff --git a/include/load_save.h b/include/load_save.h index 1f406bbad..ba85d4ad8 100644 --- a/include/load_save.h +++ b/include/load_save.h @@ -19,6 +19,7 @@ void LoadSerializedGame(void); void LoadPlayerBag(void); void SavePlayerBag(void); void SetSaveBlocksPointers(u16); -void MoveSaveBlocks_ResetHeap(void); +void sub_8076D5C(void); +void sav2_gender2_inplace_and_xFE(void); #endif // GUARD_LOAD_SAVE_H diff --git a/include/save.h b/include/save.h index 6c1238cd2..a3473371e 100644 --- a/include/save.h +++ b/include/save.h @@ -92,5 +92,8 @@ u8 HandleSavingData(u8 saveType); //u8 unref_sub_8126080(u8 sector, u8 *data); u16 sub_815355C(void); u8 sub_81534D0(u8); +u8 sub_8153430(void); +bool8 sub_8153474(void); +void sub_8153688(u8 taskId); #endif // GUARD_SAVE_H -- cgit v1.2.3 From 1a8d5132d66c731c59ac1eee7eb33ea37a8cc1c4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 20 May 2018 10:51:09 +0200 Subject: fix record mixing for real --- include/global.h | 1 - include/link.h | 1 - include/link_rfu.h | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index a117a6391..bd2dbe7a6 100644 --- a/include/global.h +++ b/include/global.h @@ -749,7 +749,6 @@ struct SaveBlock1 /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; /*0x3B58*/ LilycoveLady lilycoveLady; - /*0x3B88*/ u8 filler_3B88[0x10]; /*0x3B98*/ struct UnkSaveSubstruct_3b98 unk_3B98[20]; /*0x3C88*/ u8 filler_3C88[0xE8]; /*0x3D70*/ struct WaldaPhrase waldaPhrase; diff --git a/include/link.h b/include/link.h index 9dd85460e..5b3cd26ca 100644 --- a/include/link.h +++ b/include/link.h @@ -300,7 +300,6 @@ u8 sub_800AA48(void); void sub_8009FAC(void); bool8 sub_800A4D8(u8 a0); u8 sub_800A9D8(void); -bool8 sub_801048C(u8); u8 sub_800A0C8(s32, s32); #endif // GUARD_LINK_H diff --git a/include/link_rfu.h b/include/link_rfu.h index a6084b138..ca39c2fb2 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -231,5 +231,6 @@ struct UnkLinkRfuStruct_02022B14 *sub_800F7DC(void); void sub_8011068(u8 a0); void sub_8011170(u32 a0); void sub_8011A64(u8 a0, u16 a1); +u8 sub_801048C(bool32 a0); #endif //GUARD_LINK_RFU_H -- cgit v1.2.3 From 03b593d3c3c763f29ba6e7c27e06fcae8a62054a Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 22 May 2018 21:54:57 +0200 Subject: try my luck with record mixing --- include/global.h | 62 ++++++++++++++++++++++++++++++++++++++++++------- include/record_mixing.h | 33 ++++++++++++++++---------- 2 files changed, 75 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index bd2dbe7a6..fe82ea9a7 100644 --- a/include/global.h +++ b/include/global.h @@ -281,7 +281,11 @@ struct SaveBlock2 /*0xAC*/ u32 encryptionKey; // TODO: fix and verify labels - /*0xB0*/ u8 field_B0[0x2c]; + /*0xB0*/ u8 field_B0; + /*0xB1*/ u8 field_B1; + /*0xB2*/ u8 field_B2_0:3; + /*0xB2*/ u8 field_B2_1:2; + /*0xB3*/ u8 field_B3[0x29]; /*0xDC*/ u8 field_0DC[0x110]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; @@ -308,22 +312,64 @@ struct SaveBlock2 /*0xCA9*/ u8 field_CA9_f : 1; // 0x80 /*0xCAA*/ u16 field_CAA[4]; /*0xCB2*/ u16 battlePyramidWildHeaderId; - /*0xCB4*/ u16 field_CB4[41]; + /*0xCB4*/ u16 field_CB4[30]; + /*0xCF0*/ u16 field_CF0[2]; + /*0xCF4*/ u16 field_CF4[2]; + /*0xCF8*/ u16 field_CF8[2]; + /*0xCFC*/ u16 field_CFC[5]; /*0xD06*/ u8 field_D06; /*0xD07*/ u8 field_D07; - /*0xD08*/ u8 filler_D08[0x112]; + /*0xD08*/ u8 filler_D08; + /*0xD09*/ u8 filler_D09; + /*0xD0A*/ u8 filler_D0A; + /*0xD0B*/ u8 filler_D0B; + /*0xD0C*/ u8 filler_D0C; + /*0xD0D*/ u8 filler_D0D; + /*0xD0E*/ u8 filler_D0E; + /*0xD0F*/ u8 filler_D0F; + /*0xD10*/ u8 filler_D10; + /*0xD11*/ u8 filler_D11; + /*0xD12*/ u8 filler_D12; + /*0xD13*/ u8 filler_D13; + /*0xD14*/ u16 field_D14[2]; + /*0xD18*/ u8 field_D18[0xB8]; + /*0xDD0*/ u16 field_DD0[2]; + /*0xDD4*/ u16 field_DD4[2]; + /*0xDD8*/ u16 field_DD8; + /*0xDDA*/ u16 field_DDA; + /*0xDDC*/ u16 field_DDC; + /*0xDDE*/ u16 field_DDE[2]; + /*0xDE2*/ u16 field_DE2; + /*0xDE4*/ u16 field_DE4; + /*0xDE6*/ u16 field_DE6; + /*0xDE8*/ u16 field_DE8; + /*0xDEA*/ u16 field_DEA[2]; + /*0xDEE*/ u16 field_DEE; + /*0xDF0*/ u16 field_DF0; + /*0xDF2*/ u16 field_DF2; + /*0xDF4*/ u16 field_DF4; + /*0xDF6*/ u16 field_DF6; + /*0xDF8*/ u16 field_DF8; + /*0xDFA*/ u16 field_DFA; + /*0xDFC*/ u16 field_DFC; + /*0xDFE*/ u16 field_DFE; + /*0xE00*/ u16 field_E00; + /*0xE02*/ u16 field_E02; + /*0xE04*/ u16 field_E04; + /*0xE06*/ u16 field_E06; + /*0xE08*/ u16 field_E08[9]; /*0xE1A*/ u16 battlePyramidFloor; // possibly? - /*0xE1C*/ u8 field_E1C[16]; + /*0xE1C*/ u16 field_E1C; + /*0xE1E*/ u16 field_E1E[7]; /*0xE2C*/ struct PyramidBag pyramidBag; /*0x???*/ u8 field_unkown[6]; /*0xE6E*/ u16 battleTentWinStreak; /*0xE70*/ u8 field_E70[72]; /*0xEB8*/ u16 frontierBattlePoints; /*0xEBA*/ u8 field_EBA[39]; - /*0xEE1*/ u8 field_EE1; - /*0xEE2*/ u8 field_EE2[7]; - /*0xEE9*/ u8 field_EE9; - /*0xEEA*/ u8 field_EEA[66]; + /*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH]; + /*0xEF1*/ u8 field_EF1[2][4]; + /*0xEF9*/ u8 field_EF9[51]; // sizeof=0xF2C }; diff --git a/include/record_mixing.h b/include/record_mixing.h index e327d1510..875eca815 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -2,25 +2,34 @@ #define GUARD_RECORD_MIXING_H // Exported type declarations +struct UnkRecordMixingStruct2a +{ + u8 playerId[4]; + u16 field_4; + u8 playerName[PLAYER_NAME_LENGTH]; + u8 language; +}; -struct DayCareMailRecordMixing { - struct MailStruct mail; - u8 OT_name[OT_NAME_LENGTH + 1]; - u8 monName[11]; - u8 language_maybe:4; - u8 unknown:4; +struct UnkRecordMixingStruct2b +{ + u8 playerId1[4]; + u8 playerId2[4]; + u16 field_8; + u8 playerName1[PLAYER_NAME_LENGTH]; + u8 playerName2[PLAYER_NAME_LENGTH]; + u8 language; }; -struct UnkStruct_80E7B60 { - struct DayCareMailRecordMixing unk_00[2]; - u32 unk_70; - u16 unk_74[2]; -}; // size = 0x78 +struct UnkRecordMixingStruct2 +{ + struct UnkRecordMixingStruct2a field_0[9][2]; + struct UnkRecordMixingStruct2b field_120[2]; +}; // Exported RAM declarations // Exported ROM declarations -void sub_80E8260(void *); +void sub_80E8260(struct UnkRecordMixingStruct2 *arg0); #endif //GUARD_RECORD_MIXING_H -- cgit v1.2.3 From b051cbaaab8bacd0cdc65ce609a92bc9dd868a1f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 25 May 2018 21:00:41 +0200 Subject: more record mixing decomp --- include/global.h | 21 +++++++++++---------- include/record_mixing.h | 2 ++ 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index fe82ea9a7..b869da813 100644 --- a/include/global.h +++ b/include/global.h @@ -256,6 +256,13 @@ struct UnknownSaveBlock2Struct u8 field_EB; }; // sizeof = 0xEC +struct UnkRecordMixingStruct +{ + u8 field_0[0x34]; + u8 playerId[4]; + u8 field_38[10]; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH]; @@ -286,7 +293,7 @@ struct SaveBlock2 /*0xB2*/ u8 field_B2_0:3; /*0xB2*/ u8 field_B2_1:2; /*0xB3*/ u8 field_B3[0x29]; - /*0xDC*/ u8 field_0DC[0x110]; + /*0xDC*/ struct UnkRecordMixingStruct field_DC[4]; /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpResults pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; @@ -605,9 +612,9 @@ struct ContestWinner u8 contestRank; }; -struct DaycareMiscMon +struct DayCareMail { - struct MailStruct mail; + struct MailStruct message; u8 OT_name[OT_NAME_LENGTH + 1]; u8 monName[POKEMON_NAME_LENGTH + 1]; u8 gameLanguage:4; @@ -617,7 +624,7 @@ struct DaycareMiscMon struct DaycareMon { struct BoxPokemon mon; - struct DaycareMiscMon misc; + struct DayCareMail mail; u32 steps; }; @@ -628,12 +635,6 @@ struct DayCare u8 stepCounter; }; -struct DayCareMail -{ - /*0x00*/ struct MailStruct message; - /*0x24*/ u8 names[19]; -}; - struct RecordMixingDayCareMail { struct DayCareMail mail[DAYCARE_MON_COUNT]; diff --git a/include/record_mixing.h b/include/record_mixing.h index 875eca815..900951516 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -26,6 +26,8 @@ struct UnkRecordMixingStruct2 struct UnkRecordMixingStruct2b field_120[2]; }; + + // Exported RAM declarations // Exported ROM declarations -- cgit v1.2.3 From 9e7965fab085a06f700756f448fbc072ee7e0095 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 May 2018 00:25:36 +0200 Subject: document record mixing --- include/battle_tower.h | 25 +++++---------------- include/fldeff_80F9BCC.h | 4 ++-- include/global.h | 51 +++++++++++++++++++++++++++++++++++++++--- include/mauville_old_man.h | 4 ++-- include/mystery_event_script.h | 1 - include/pokemon.h | 27 ---------------------- include/record_mixing.h | 4 +--- include/tv.h | 4 ++-- 8 files changed, 61 insertions(+), 59 deletions(-) (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 7bacf5249..9d4553132 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -1,7 +1,8 @@ #ifndef GUARD_BATTLE_TOWER_H #define GUARD_BATTLE_TOWER_H -struct RSBattleTowerRecord { +struct RSBattleTowerRecord +{ /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 /*0x01*/ u8 trainerClass; /*0x02*/ u16 winStreak; @@ -15,30 +16,16 @@ struct RSBattleTowerRecord { /*0xA4*/ u16 unk_11c8; }; -struct EmeraldBattleTowerRecord { - /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 - /*0x01*/ u8 trainerClass; - /*0x02*/ u16 winStreak; - /*0x04*/ u8 name[8]; - /*0x0C*/ u8 trainerId[4]; - /*0x10*/ struct { - u16 easyChat[6]; - } greeting; - /*0x1C*/ u8 filler_1c[0x18]; - /*0x34*/ struct UnknownPokemonStruct party[4]; - /*0xe4*/ u8 language; - u8 filler_e5[7]; -}; - -union BattleTowerRecord { +union BattleTowerRecord +{ struct RSBattleTowerRecord ruby_sapphire; struct EmeraldBattleTowerRecord emerald; }; u16 sub_8164FCC(u8, u8); -void sub_81659DC(union BattleTowerRecord *a0, union BattleTowerRecord *a1); +void sub_81659DC(struct RSBattleTowerRecord *a0, struct RSBattleTowerRecord *a1); bool32 sub_816587C(union BattleTowerRecord *, union BattleTowerRecord *); -bool32 sub_8164F70(union BattleTowerRecord *); +void CalcEmeraldBattleTowerChecksum(struct EmeraldBattleTowerRecord *); void sub_81628A0(union BattleTowerRecord *); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/fldeff_80F9BCC.h b/include/fldeff_80F9BCC.h index 4169e328d..ba775cd6d 100644 --- a/include/fldeff_80F9BCC.h +++ b/include/fldeff_80F9BCC.h @@ -9,8 +9,8 @@ void sub_80FA5E4(s16 id, s16 x, s16 y); void sub_80FA794(s16 x, s16 y); -void sub_80FB00C(void); -void sub_80FB074(void); +void CreateRecordMixingSprite(void); +void DestroyRecordMixingSprite(void); void overworld_poison_effect(void); bool8 sub_80FADE4(u16, u8); diff --git a/include/global.h b/include/global.h index b869da813..f9e0aa66e 100644 --- a/include/global.h +++ b/include/global.h @@ -103,6 +103,8 @@ enum LanguageId #define VARS_COUNT 256 #define MAIL_COUNT 16 #define SECRET_BASES_COUNT 20 +#define TV_SHOWS_COUNT 25 +#define POKE_NEWS_COUNT 16 #define PC_ITEMS_COUNT 50 #define BAG_ITEMS_COUNT 30 #define BAG_KEYITEMS_COUNT 30 @@ -263,6 +265,49 @@ struct UnkRecordMixingStruct u8 field_38[10]; }; +struct UnknownPokemonStruct +{ + u16 species; + u16 heldItem; + u16 moves[4]; + u8 level; + u8 ppBonuses; + u8 hpEV; + u8 attackEV; + u8 defenseEV; + u8 speedEV; + u8 spAttackEV; + u8 spDefenseEV; + u32 otId; + u32 hpIV:5; + u32 attackIV:5; + u32 defenseIV:5; + u32 speedIV:5; + u32 spAttackIV:5; + u32 spDefenseIV:5; + u32 gap:1; + u32 altAbility:1; + u32 personality; + u8 nickname[POKEMON_NAME_LENGTH + 1]; + u8 friendship; +}; + +struct EmeraldBattleTowerRecord +{ + /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100 + /*0x01*/ u8 trainerClass; + /*0x02*/ u16 winStreak; + /*0x04*/ u8 name[8]; + /*0x0C*/ u8 trainerId[4]; + /*0x10*/ struct { + u16 easyChat[6]; + } greeting; + /*0x1C*/ u8 filler_1c[0x18]; + /*0x34*/ struct UnknownPokemonStruct party[4]; + /*0xE4*/ u8 language; + /*0xE8*/ u32 checksum; +}; + struct SaveBlock2 { /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH]; @@ -302,7 +347,7 @@ struct SaveBlock2 // All below could be a one giant struct - /*0x64C*/ u8 field_64C[236]; + /*0x64C*/ struct EmeraldBattleTowerRecord battleTower; /*0x738*/ struct UnknownSaveBlock2Struct field_738[5]; // No idea here, it's probably wrong, no clue. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; @@ -763,8 +808,8 @@ struct SaveBlock1 /*0x????*/ u8 decorDoll[40]; /*0x????*/ u8 decorCushion[10]; /*0x27CA*/ u8 padding_27CA[2]; - /*0x27CC*/ TVShow tvShows[25]; - /*0x2B50*/ PokeNews pokeNews[16]; + /*0x27CC*/ TVShow tvShows[TV_SHOWS_COUNT]; + /*0x2B50*/ PokeNews pokeNews[POKE_NEWS_COUNT]; /*0x2B90*/ u16 outbreakPokemonSpecies; /*0x2B92*/ u8 outbreakLocationMapNum; /*0x2B93*/ u8 outbreakLocationMapGroup; diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index b1f10314a..e318ac8bb 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -19,8 +19,8 @@ void ScrSpecial_SetMauvilleOldManMapObjGfx(void); u8 sub_81201C8(void); void sub_8120B70(OldMan *dest); void sub_8120670(void); -void sub_8120D34(union OldMan * oldMan, u32 r1, u32 r6); -void sub_8120CD0(union OldMan * oldMan, u32 unused, u32 a2); +void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); +void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); void ResetMauvilleOldManFlag(void); #endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h index 0857c7188..991cab53a 100644 --- a/include/mystery_event_script.h +++ b/include/mystery_event_script.h @@ -6,6 +6,5 @@ bool32 sub_8153884(u32 *a0); u32 RunMysteryEventScript(u8 *script); void SetMysteryEventScriptStatus(u32 val); u16 GetRecordMixingGift(void); -u16 GetRecordMixingGift(void); #endif // GUARD_MYSTERY_EVENT_SCRIPT_H diff --git a/include/pokemon.h b/include/pokemon.h index b6b0d6d36..37028821a 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -240,33 +240,6 @@ struct PokemonStorage /*0x83C2*/ u8 boxWallpapers[14]; }; -struct UnknownPokemonStruct -{ - u16 species; - u16 heldItem; - u16 moves[4]; - u8 level; - u8 ppBonuses; - u8 hpEV; - u8 attackEV; - u8 defenseEV; - u8 speedEV; - u8 spAttackEV; - u8 spDefenseEV; - u32 otId; - u32 hpIV:5; - u32 attackIV:5; - u32 defenseIV:5; - u32 speedIV:5; - u32 spAttackIV:5; - u32 spDefenseIV:5; - u32 gap:1; - u32 altAbility:1; - u32 personality; - u8 nickname[POKEMON_NAME_LENGTH + 1]; - u8 friendship; -}; - struct UnknownPokemonSubStruct2 { u16 species; diff --git a/include/record_mixing.h b/include/record_mixing.h index 900951516..3cd4d649e 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -26,12 +26,10 @@ struct UnkRecordMixingStruct2 struct UnkRecordMixingStruct2b field_120[2]; }; - - // Exported RAM declarations // Exported ROM declarations - +void sub_80E6BE8(void); void sub_80E8260(struct UnkRecordMixingStruct2 *arg0); #endif //GUARD_RECORD_MIXING_H diff --git a/include/tv.h b/include/tv.h index 1b3423275..17be8c43c 100644 --- a/include/tv.h +++ b/include/tv.h @@ -16,7 +16,7 @@ void sub_80EED10(void); void sub_80EED34(void); void sub_80EED60(u16 delta); void sub_80F01B8(void); -void sub_80F01E8(void *src, u32 size, u8 masterIdx); +void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx); void sub_80EE4DC(struct Pokemon *pokemon, u8 ribbonMonDataIdx); u32 GetPlayerIDAsU32(void); bool8 GetPriceReduction(u8 newsKind); @@ -30,7 +30,7 @@ void sub_80EEA70(void); void sub_80EDB44(void); void sub_80EDC60(const u16 *words); void sub_80EDA80(void); -void sub_80F0C7C(void *src, u32 size, u8 masterIdx); +void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx); void sub_80F0BB8(void); void sub_80ED950(bool8 flag); void sub_80EEC80(void); -- cgit v1.2.3