diff --git a/asm/record_mixing.s b/asm/record_mixing.s index 27aa86a2e9..bc1b27bd4d 100644 --- a/asm/record_mixing.s +++ b/asm/record_mixing.s @@ -5,155 +5,6 @@ .text - thumb_func_start sub_80E6F60 -sub_80E6F60: @ 80E6F60 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - bl sub_800A064 - cmp r0, 0 - beq _080E7014 - ldr r5, =gUnknown_0203A014 - ldr r0, [r5] - movs r1, 0xC8 - lsls r1, 4 - mov r8, r1 - add r0, r8 - bl sub_80E7B2C - ldr r0, [r5] - ldr r6, =0x00001230 - lsls r4, 24 - lsrs r4, 24 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80EAF80 - ldr r3, [r5] - ldr r1, =0x000010ac - adds r0, r3, r1 - add r3, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7B60 - ldr r0, [r5] - ldr r1, =0x00001124 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7948 - ldr r0, [r5] - add r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F01E8 - ldr r0, [r5] - ldr r1, =0x00001004 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F0C7C - ldr r0, [r5] - ldr r1, =0x00001044 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E78C4 - ldr r0, [r5] - ldr r1, =0x00001084 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812287C - ldr r0, [r5] - ldr r1, =0x000011c8 - adds r0, r1 - adds r1, r4, 0 - bl sub_80E7F68 - b _080E70BE - .pool -_080E7014: - ldr r5, =gUnknown_0203A014 - ldr r0, [r5] - movs r1, 0xC8 - lsls r1, 4 - mov r8, r1 - add r0, r8 - bl sub_80E7B2C - ldr r0, [r5] - ldr r6, =0x00001444 - lsls r4, 24 - lsrs r4, 24 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80EAF80 - ldr r0, [r5] - add r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F01E8 - ldr r0, [r5] - ldr r1, =0x00001004 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F0C7C - ldr r0, [r5] - ldr r1, =0x00001044 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E78C4 - ldr r0, [r5] - ldr r1, =0x00001084 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812287C - ldr r3, [r5] - ldr r1, =0x000010ac - adds r0, r3, r1 - add r3, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7B60 - ldr r0, [r5] - ldr r1, =0x00001124 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7948 - ldr r0, [r5] - ldr r1, =0x00001210 - adds r0, r1 - adds r1, r4, 0 - bl sub_80E7F68 - ldr r0, [r5] - ldr r1, =0x00001214 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7A14 - ldr r0, [r5] - ldr r1, =0x00001254 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E8468 - ldr r0, [r5] - ldr r1, =0x000012dc - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E89AC -_080E70BE: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6F60 - thumb_func_start sub_80E70F4 sub_80E70F4: @ 80E70F4 push {r4,lr} diff --git a/src/record_mixing.c b/src/record_mixing.c index c8259e1170..4853afb294 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -14,20 +14,19 @@ // Static type declarations struct RecordMixingData { - struct SecretBaseRecord secretBases[20]; - TVShow tvShows[25]; - PokeNews pokeNews[16]; - OldMan oldMan; - struct EasyChatPair easyChatPair[5]; - u8 unk_10ac[0x78]; - u8 unk_1124[0xa4]; - u16 unk_11c8; - u8 filler_11ca[0x46]; - u16 unk_1210; - u8 filler_1212[0x2]; - LilycoveLady lilycoveLady; - u8 unk_1254[0x88]; - u8 unk_12dc[0x168]; + /* 0x0000 */ struct SecretBaseRecord secretBases[20]; + /* 0x0c80 */ TVShow tvShows[25]; + /* 0x1004 */ PokeNews pokeNews[16]; + /* 0x1044 */ OldMan oldMan; + /* 0x1084 */ struct EasyChatPair easyChatPair[5]; + /* 0x10ac */ u8 unk_10ac[0x78]; + /* 0x1124 */ u8 unk_1124[0xa4]; + /* 0x11c8 */ u16 unk_11c8; + /* 0x11ca */ u8 filler_11ca[0x46]; + /* 0x1210 */ u16 unk_1210; + /* 0x1214 */ LilycoveLady lilycoveLady; + /* 0x1254 */ u8 unk_1254[0x88]; + /* 0x12dc */ u8 unk_12dc[0x168]; }; // 1444 // Static RAM declarations @@ -48,19 +47,29 @@ IWRAM_DATA u8 gUnknown_03001160[8]; IWRAM_DATA u32 gUnknown_03001168[3]; EWRAM_DATA struct DayCareMailRecordMixing gUnknown_02039F9C[2] = {}; -EWRAM_DATA struct { - /*0x0000*/ u8 filler_0000[0x5110]; -} *gUnknown_0203A014 = NULL; +EWRAM_DATA struct RecordMixingData *gUnknown_0203A014 = NULL; EWRAM_DATA struct RecordMixingData *gUnknown_0203A018 = NULL; // Static ROM declarations void sub_80E715C(u8 taskId); +void sub_80E78C4(OldMan *, size_t, u8); +void sub_80E7948(void *, size_t, u8); +void sub_80E7A14(LilycoveLady *, size_t, u8); +void sub_80E7B2C(TVShow *); +void sub_80E7B60(void *, size_t, u8, TVShow *); +void sub_80E7F68(void *, u8); +void sub_80E8110(void *, void *); +void sub_80E8468(void *, size_t, u8); +void sub_80E89AC(void *, size_t, u8); void sub_80E89F8(void *dest); void sub_80E8A54(void *src); -void TaskDummy4(void *src); void sub_80E8AC0(void *); -void sub_80E8110(void *, void *); +void sub_80EAF80(struct SecretBaseRecord *, size_t, u8); +void sub_80F01E8(void *, size_t, u8); +void sub_80F0C7C(PokeNews *, size_t, u8); +void sub_812287C(struct EasyChatPair *, size_t, u8); +void TaskDummy4(void *src); // .rodata @@ -156,3 +165,36 @@ void sub_80E6E24(void) sub_80E8260(gUnknown_0203A018->unk_12dc); } } + +void sub_80E6F60(u32 a0) +{ + if (sub_800A064()) + { + // Ruby/Sapphire + sub_80E7B2C(gUnknown_0203A014[0].tvShows); + sub_80EAF80(gUnknown_0203A014[0].secretBases, 0x1230, a0); + sub_80E7B60(gUnknown_0203A014[0].unk_10ac, 0x1230, a0, gUnknown_0203A014[0].tvShows); + sub_80E7948(gUnknown_0203A014[0].unk_1124, 0x1230, a0); + sub_80F01E8(gUnknown_0203A014[0].tvShows, 0x1230, a0); + sub_80F0C7C(gUnknown_0203A014[0].pokeNews, 0x1230, a0); + sub_80E78C4(&gUnknown_0203A014[0].oldMan, 0x1230, a0); + sub_812287C(gUnknown_0203A014[0].easyChatPair, 0x1230, a0); + sub_80E7F68(&gUnknown_0203A014[0].unk_11c8, a0); + } + else + { + // Emerald + sub_80E7B2C(gUnknown_0203A014[0].tvShows); + sub_80EAF80(gUnknown_0203A014[0].secretBases, 0x1444, a0); + sub_80F01E8(gUnknown_0203A014[0].tvShows, 0x1444, a0); + sub_80F0C7C(gUnknown_0203A014[0].pokeNews, 0x1444, a0); + sub_80E78C4(&gUnknown_0203A014[0].oldMan, 0x1444, a0); + sub_812287C(gUnknown_0203A014[0].easyChatPair, 0x1444, a0); + sub_80E7B60(gUnknown_0203A014[0].unk_10ac, 0x1444, a0, gUnknown_0203A014[0].tvShows); + sub_80E7948(gUnknown_0203A014[0].unk_1124, 0x1444, a0); + sub_80E7F68(&gUnknown_0203A014[0].unk_1210, a0); + sub_80E7A14(&gUnknown_0203A014[0].lilycoveLady, 0x1444, a0); + sub_80E8468(gUnknown_0203A014[0].unk_1254, 0x1444, a0); + sub_80E89AC(gUnknown_0203A014[0].unk_12dc, 0x1444, a0); + } +}