diff --git a/asm/link.s b/asm/link.s index 8b1d2f17f..139108837 100644 --- a/asm/link.s +++ b/asm/link.s @@ -5,91 +5,6 @@ .text - thumb_func_start sub_800A73C -sub_800A73C: @ 800A73C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x10] - cmp r6, 0 - bge _0800A768 - str r7, [sp, 0x10] - negs r6, r6 -_0800A768: - movs r5, 0 - movs r1, 0x1 - negs r1, r1 - add r1, r8 - mov r10, r1 - cmp r5, r8 - bge _0800A794 -_0800A776: - mov r0, sp - adds r4, r0, r5 - adds r0, r6, 0 - movs r1, 0xA - bl __modsi3 - strb r0, [r4] - adds r0, r6, 0 - movs r1, 0xA - bl __divsi3 - adds r6, r0, 0 - adds r5, 0x1 - cmp r5, r8 - blt _0800A776 -_0800A794: - mov r5, r10 - cmp r5, 0 - blt _0800A7B4 -_0800A79A: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - adds r1, r7, 0 - mov r2, r9 - bl sub_800A678 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - subs r5, 0x1 - cmp r5, 0 - bge _0800A79A -_0800A7B4: - movs r0, 0x1 - negs r0, r0 - ldr r1, [sp, 0x10] - cmp r1, r0 - beq _0800A7CA - lsls r1, 24 - lsrs r1, 24 - movs r0, 0xA - mov r2, r9 - bl sub_800A678 -_0800A7CA: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A73C - thumb_func_start sub_800A7DC sub_800A7DC: @ 800A7DC push {r4-r7,lr} diff --git a/src/link.c b/src/link.c index c2ef12786..ede672f18 100644 --- a/src/link.c +++ b/src/link.c @@ -1157,3 +1157,31 @@ void sub_800A6E8(u32 a0, u8 a1, u8 a2, u8 a3) a1 ++; } } + +void sub_800A73C(int a0, u8 a1, u8 a2, u8 a3) +{ + u8 sp[32 / 2]; + int sp10; + int i; + + sp10 = -1; + if (a0 < 0) + { + sp10 = a1; + a0 = -a0; + } + for (i = 0; i < a3; i ++) + { + sp[i] = a0 % 10; + a0 /= 10; + } + for (i = a3 - 1; i >= 0; i --) + { + sub_800A678(sp[i], a1, a2); + a1 ++; + } + if (sp10 != -1) + { + sub_800A678(10, sp10, a2); + } +}