From 8e10d7c0e5171b5c6b4c5f6cfa983c2835a71890 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 25 Nov 2018 20:16:41 +0100 Subject: Match some functions --- src/text.c | 725 +++++++++++++------------------------------------------------ 1 file changed, 155 insertions(+), 570 deletions(-) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index 2380e3191..8c940b0b2 100644 --- a/src/text.c +++ b/src/text.c @@ -257,584 +257,169 @@ u32 RenderFont(struct TextPrinter *textPrinter) } } -#ifdef NONMATCHING void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) { - u16* current = gFontHalfRowLookupTable; + u32 fg12, bg12, shadow12; + u32 fg8, bg8, shadow8; + u32 fg4, bg4, shadow4; + u32 temp; + + u16 *current = gFontHalfRowLookupTable; gLastTextBgColor = bgColor; gLastTextFgColor = fgColor; gLastTextShadowColor = shadowColor; - *(current++) = (bgColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (bgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (bgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (bgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (bgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (fgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (fgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (fgColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (fgColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (shadowColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (shadowColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | bgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (shadowColor << 4) | bgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (bgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (bgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (bgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (bgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (fgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (fgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (fgColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (fgColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (shadowColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (shadowColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | fgColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (shadowColor << 4) | fgColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (bgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (bgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (bgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (bgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (fgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (fgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (fgColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (fgColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (bgColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (bgColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (bgColor << 8) | (shadowColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (fgColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (fgColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (fgColor << 8) | (shadowColor << 4) | shadowColor; - - *(current++) = (bgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (fgColor << 12) | (shadowColor << 8) | (shadowColor << 4) | shadowColor; - *(current++) = (shadowColor << 12) | (shadowColor << 8) | (shadowColor << 4) | shadowColor; -} -#else -NAKED -void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) -{ - asm("push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, #0x24\n\ - lsl r0, #24\n\ - lsr r0, #24\n\ - lsl r1, #24\n\ - lsr r1, #24\n\ - lsl r2, #24\n\ - lsr r2, #24\n\ - ldr r3, =gFontHalfRowLookupTable\n\ - ldr r4, =gLastTextBgColor\n\ - strh r1, [r4]\n\ - ldr r4, =gLastTextFgColor\n\ - strh r0, [r4]\n\ - ldr r4, =gLastTextShadowColor\n\ - strh r2, [r4]\n\ - lsl r5, r1, #12\n\ - lsl r6, r0, #12\n\ - lsl r4, r2, #12\n\ - mov r8, r4\n\ - lsl r7, r1, #8\n\ - str r7, [sp]\n\ - lsl r4, r1, #4\n\ - mov r9, r4\n\ - orr r7, r4\n\ - str r7, [sp, #0x4]\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - lsl r7, r0, #8\n\ - mov r10, r7\n\ - mov r4, r10\n\ - mov r7, r9\n\ - orr r4, r7\n\ - str r4, [sp, #0x8]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - lsl r7, r2, #8\n\ - mov r12, r7\n\ - mov r4, r12\n\ - mov r7, r9\n\ - orr r4, r7\n\ - str r4, [sp, #0xC]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - lsl r7, r0, #4\n\ - mov r9, r7\n\ - ldr r4, [sp]\n\ - orr r4, r7\n\ - str r4, [sp, #0x10]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - mov r7, r10\n\ - add r4, r7, #0\n\ - mov r7, r9\n\ - orr r4, r7\n\ - str r4, [sp, #0x14]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - mov r7, r12\n\ - add r4, r7, #0\n\ - mov r7, r9\n\ - orr r4, r7\n\ - str r4, [sp, #0x18]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - lsl r7, r2, #4\n\ - mov r9, r7\n\ - mov r4, r9\n\ - ldr r7, [sp]\n\ - orr r7, r4\n\ - str r7, [sp, #0x1C]\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - mov r7, r9\n\ - mov r4, r10\n\ - orr r4, r7\n\ - str r4, [sp, #0x20]\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r4, r5, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - add r4, r6, #0\n\ - orr r4, r7\n\ - strh r4, [r3]\n\ - add r3, #0x2\n\ - mov r4, r8\n\ - orr r7, r4\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - mov r4, r12\n\ - mov r7, r9\n\ - orr r4, r7\n\ - add r7, r4, #0\n\ - orr r7, r1\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x4]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x8]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0xC]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x10]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x14]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x18]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x1C]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - ldr r7, [sp, #0x20]\n\ - orr r7, r0\n\ - add r1, r5, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - add r1, r6, #0\n\ - orr r1, r7\n\ - strh r1, [r3]\n\ - add r3, #0x2\n\ - mov r1, r8\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r4, #0\n\ - orr r7, r0\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r0, [sp, #0x4]\n\ - orr r7, r0\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - orr r7, r1\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x8]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0xC]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x10]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x14]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x18]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x1C]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - ldr r1, [sp, #0x20]\n\ - orr r7, r1\n\ - add r0, r5, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - add r0, r6, #0\n\ - orr r0, r7\n\ - strh r0, [r3]\n\ - add r3, #0x2\n\ - mov r0, r8\n\ - orr r7, r0\n\ - strh r7, [r3]\n\ - add r3, #0x2\n\ - add r7, r2, #0\n\ - orr r7, r4\n\ - orr r5, r7\n\ - strh r5, [r3]\n\ - add r3, #0x2\n\ - orr r6, r7\n\ - strh r6, [r3]\n\ - orr r0, r7\n\ - strh r0, [r3, #0x2]\n\ - add sp, #0x24\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .pool"); + bg12 = bgColor << 12; + fg12 = fgColor << 12; + shadow12 = shadowColor << 12; + + bg8 = bgColor << 8; + bg4 = bgColor << 4; + + temp = (bg8) | (bg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + fg8 = fgColor << 8; + + temp = (fg8) | (bg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + shadow8 = shadowColor << 8; + + temp = (shadow8) | (bg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + fg4 = fgColor << 4; + + temp = (bg8) | (fg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (fg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (fg4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + shadow4 = shadowColor << 4; + + temp = (bg8) | (shadow4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (shadow4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (shadow4) | bgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (bg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (bg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (bg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (fg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (fg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (fg4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (shadow4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (shadow4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (shadow4) | fgColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (bg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (bg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (bg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (fg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (fg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (fg4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (bg8) | (shadow4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (fg8) | (shadow4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; + + temp = (shadow8) | (shadow4) | shadowColor; + *(current++) = (bg12) | temp; + *(current++) = (fg12) | temp; + *(current++) = (shadow12) | temp; } -#endif void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor) { -- cgit v1.2.3 From c9b3f3e3cb0c68a7baae53a34e080376e6d8f666 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 26 Nov 2018 20:19:52 +0100 Subject: Fix indentation --- src/text.c | 67 +++++++++++++++++++++++++------------------------------------- 1 file changed, 27 insertions(+), 40 deletions(-) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index 8c940b0b2..ecd3a3095 100644 --- a/src/text.c +++ b/src/text.c @@ -260,8 +260,6 @@ u32 RenderFont(struct TextPrinter *textPrinter) void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) { u32 fg12, bg12, shadow12; - u32 fg8, bg8, shadow8; - u32 fg4, bg4, shadow4; u32 temp; u16 *current = gFontHalfRowLookupTable; @@ -274,148 +272,137 @@ void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) fg12 = fgColor << 12; shadow12 = shadowColor << 12; - bg8 = bgColor << 8; - bg4 = bgColor << 4; - - temp = (bg8) | (bg4) | bgColor; + temp = (bgColor << 8) | (bgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - fg8 = fgColor << 8; - - temp = (fg8) | (bg4) | bgColor; + temp = (fgColor << 8) | (bgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - shadow8 = shadowColor << 8; - - temp = (shadow8) | (bg4) | bgColor; + temp = (shadowColor << 8) | (bgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - fg4 = fgColor << 4; - - temp = (bg8) | (fg4) | bgColor; + temp = (bgColor << 8) | (fgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (fg4) | bgColor; + temp = (fgColor << 8) | (fgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (fg4) | bgColor; + temp = (shadowColor << 8) | (fgColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - shadow4 = shadowColor << 4; - - temp = (bg8) | (shadow4) | bgColor; + temp = (bgColor << 8) | (shadowColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (shadow4) | bgColor; + temp = (fgColor << 8) | (shadowColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (shadow4) | bgColor; + temp = (shadowColor << 8) | (shadowColor << 4) | bgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (bg4) | fgColor; + temp = (bgColor << 8) | (bgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (bg4) | fgColor; + temp = (fgColor << 8) | (bgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (bg4) | fgColor; + temp = (shadowColor << 8) | (bgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (fg4) | fgColor; + temp = (bgColor << 8) | (fgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (fg4) | fgColor; + temp = (fgColor << 8) | (fgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (fg4) | fgColor; + temp = (shadowColor << 8) | (fgColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (shadow4) | fgColor; + temp = (bgColor << 8) | (shadowColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (shadow4) | fgColor; + temp = (fgColor << 8) | (shadowColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (shadow4) | fgColor; + temp = (shadowColor << 8) | (shadowColor << 4) | fgColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (bg4) | shadowColor; + temp = (bgColor << 8) | (bgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (bg4) | shadowColor; + temp = (fgColor << 8) | (bgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (bg4) | shadowColor; + temp = (shadowColor << 8) | (bgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (fg4) | shadowColor; + temp = (bgColor << 8) | (fgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (fg4) | shadowColor; + temp = (fgColor << 8) | (fgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (fg4) | shadowColor; + temp = (shadowColor << 8) | (fgColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (bg8) | (shadow4) | shadowColor; + temp = (bgColor << 8) | (shadowColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (fg8) | (shadow4) | shadowColor; + temp = (fgColor << 8) | (shadowColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; - temp = (shadow8) | (shadow4) | shadowColor; + temp = (shadowColor << 8) | (shadowColor << 4) | shadowColor; *(current++) = (bg12) | temp; *(current++) = (fg12) | temp; *(current++) = (shadow12) | temp; -- cgit v1.2.3