diff --git a/asm/link.s b/asm/link.s index ba7593695a..8b1d2f17fa 100644 --- a/asm/link.s +++ b/asm/link.s @@ -5,85 +5,6 @@ .text - thumb_func_start sub_800A6B0 -sub_800A6B0: @ 800A6B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - ldr r4, =gUnknown_03003130 - ldr r3, [r4] - lsls r3, 11 - movs r5, 0xC0 - lsls r5, 19 - adds r3, r5 - lsrs r2, 19 - adds r2, r1 - lsls r2, 1 - adds r2, r3 - ldr r3, [r4, 0x4] - lsls r3, 12 - ldr r1, [r4, 0x8] - adds r1, r0 - orrs r3, r1 - strh r3, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_800A6B0 - - thumb_func_start sub_800A6E8 -sub_800A6E8: @ 800A6E8 - push {r4-r7,lr} - sub sp, 0x10 - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - cmp r4, r3 - bge _0800A714 - movs r2, 0xF -_0800A702: - mov r0, sp - adds r1, r0, r4 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - lsrs r5, 4 - adds r4, 0x1 - cmp r4, r3 - blt _0800A702 -_0800A714: - subs r4, r3, 0x1 - cmp r4, 0 - blt _0800A734 -_0800A71A: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_800A678 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - subs r4, 0x1 - cmp r4, 0 - bge _0800A71A -_0800A734: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A6E8 - thumb_func_start sub_800A73C sub_800A73C: @ 800A73C push {r4-r7,lr} diff --git a/src/link.c b/src/link.c index 5320794981..c2ef127861 100644 --- a/src/link.c +++ b/src/link.c @@ -1132,3 +1132,28 @@ void sub_800A678(u8 a0, u8 a1, u8 a2) vAddr = (u16 *)BG_SCREEN_ADDR(gUnknown_03003130.screenBaseBlock); vAddr[a2 * 32 + a1] = (gUnknown_03003130.paletteNum << 12) | (a0 + 1 + gUnknown_03003130.dummy_8); } + +void sub_800A6B0(u8 a0, u8 a1, u8 a2) +{ + u16 *vAddr; + + vAddr = (u16 *)BG_SCREEN_ADDR(gUnknown_03003130.screenBaseBlock); + vAddr[a2 * 32 + a1] = (gUnknown_03003130.paletteNum << 12) | (a0 + gUnknown_03003130.dummy_8); +} + +void sub_800A6E8(u32 a0, u8 a1, u8 a2, u8 a3) +{ + u8 sp[32 / 2]; + int i; + + for (i = 0; i < a3; i ++) + { + sp[i] = a0 & 0xf; + a0 >>= 4; + } + for (i = a3 - 1; i >= 0; i --) + { + sub_800A678(sp[i], a1, a2); + a1 ++; + } +}