diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-08-29 23:18:46 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-08-29 23:18:46 -0400 |
commit | 99d478f1d392729a421c4d50ad074f49501857e3 (patch) | |
tree | edacd217d44b9d40a3e3f42f42b3eef363f31855 | |
parent | c3f70c933c0a32d70ce1a471cc66833b88ce03f1 (diff) |
Through sub_80417B8
-rw-r--r-- | asm/daycare.s | 53 | ||||
-rw-r--r-- | include/daycare.h | 2 | ||||
-rw-r--r-- | src/daycare.c | 13 |
3 files changed, 14 insertions, 54 deletions
diff --git a/asm/daycare.s b/asm/daycare.s index e1ccebec9..7f62cc9a9 100644 --- a/asm/daycare.s +++ b/asm/daycare.s @@ -6,59 +6,6 @@ .text - thumb_func_start sub_8041790 -sub_8041790: @ 8041790 - lsls r0, 16 - lsrs r0, 16 - ldr r2, _080417AC @ =gSaveBlock1 - ldr r1, _080417B0 @ =0x000030ac - adds r3, r2, r1 - ldr r1, [r3] - adds r1, r0 - str r1, [r3] - ldr r1, _080417B4 @ =0x000030b0 - adds r2, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r2] - bx lr - .align 2, 0 -_080417AC: .4byte gSaveBlock1 -_080417B0: .4byte 0x000030ac -_080417B4: .4byte 0x000030b0 - thumb_func_end sub_8041790 - - thumb_func_start sub_80417B8 -sub_80417B8: @ 80417B8 - push {r4,r5,lr} - ldr r5, _080417D8 @ =gSpecialVar_0x8004 - ldrh r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 4 - ldr r4, _080417DC @ =gSaveBlock1 + 0x2F9C - adds r0, r4 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - bne _080417E0 - movs r0, 0 - b _080417EC - .align 2, 0 -_080417D8: .4byte gSpecialVar_0x8004 -_080417DC: .4byte gSaveBlock1 + 0x2F9C -_080417E0: - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_80416E8 - lsls r0, 24 - lsrs r0, 24 -_080417EC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80417B8 - thumb_func_start sub_80417F4 sub_80417F4: @ 80417F4 push {lr} diff --git a/include/daycare.h b/include/daycare.h index 23ddb1cdd..59d10e18f 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -3,7 +3,7 @@ u8 Daycare_CountPokemon(struct BoxPokemon *); void sub_8041324(struct BoxPokemon *, struct DayCareMailEtc *); -void sub_8041790(int i); +void sub_8041790(u16 i); u16 sub_8041870(u16); void sub_8041940(void); void sub_8041950(void); diff --git a/src/daycare.c b/src/daycare.c index 2a66548cf..fc5e9a0d0 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -219,3 +219,16 @@ void sub_8041770(void) { gSpecialVar_0x8005 = sub_8041728(&gSaveBlock1.daycareData, gSpecialVar_0x8004); } + +void sub_8041790(u16 i) +{ + gSaveBlock1.daycareData.mail.extra.steps[0] += i; + gSaveBlock1.daycareData.mail.extra.steps[1] += i; +} + +u8 sub_80417B8(void) +{ + if (GetBoxMonData(&gSaveBlock1.daycareData.mons[gSpecialVar_0x8004], MON_DATA_SPECIES) != 0) + return sub_80416E8(&gSaveBlock1.daycareData, gSpecialVar_0x8004); + return 0; +} |