summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhondew <pokehondew@gmail.com>2021-03-20 23:20:12 -0400
committerhondew <pokehondew@gmail.com>2021-03-20 23:20:12 -0400
commit2fe62832f7b10a39ec55fe2adcdd8243fcfc1344 (patch)
tree1b96830f2898053d6273a8795d0340402bf189e6
parent08b17cc7dd272a0f6fbbb88a507c7bd02e1d1d63 (diff)
Use asmproc for text.c nonmatch
-rw-r--r--arm9/asm/nonmatchings/GenerateFontHalfRowLookupTable.s1
-rw-r--r--arm9/src/text.c88
-rw-r--r--tools/asm_processor/compile.sh2
3 files changed, 2 insertions, 89 deletions
diff --git a/arm9/asm/nonmatchings/GenerateFontHalfRowLookupTable.s b/arm9/asm/nonmatchings/GenerateFontHalfRowLookupTable.s
index a083bf2e..a590ef02 100644
--- a/arm9/asm/nonmatchings/GenerateFontHalfRowLookupTable.s
+++ b/arm9/asm/nonmatchings/GenerateFontHalfRowLookupTable.s
@@ -1,4 +1,3 @@
-
.section .text
glabel GenerateFontHalfRowLookupTable
diff --git a/arm9/src/text.c b/arm9/src/text.c
index 6207d913..aadb84c0 100644
--- a/arm9/src/text.c
+++ b/arm9/src/text.c
@@ -416,93 +416,7 @@ THUMB_FUNC void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadow
*(current++) = (shadow12) | temp;
}
#else
-THUMB_FUNC void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) //TODO use asm preprocessor
-{
- asm {
- // push {r3-r7, lr}
- sub sp, #0x30
- ldr r3, =UNK_021C570C
- mov r5, #0x0
- str r5, [sp, #0x20]
- str r0, [sp, #0x24]
- str r2, [sp, #0x28]
- str r1, [sp, #0x2c]
- strh r1, [r3, #0x6]
- strh r0, [r3, #0x2]
- add r0, sp, #0x20
- strh r2, [r3, #0x4]
- str r5, [sp, #0x14]
- str r0, [sp, #0x8]
- mov r12, r0
- mov lr, r0
- str r0, [sp, #0x18]
- _0201C07E:
- mov r0, #0x0
- str r0, [sp, #0x10]
- ldr r0, [sp, #0x18]
- str r0, [sp, #0x4]
- ldr r0, [sp, #0x8]
- ldr r0, [r0, #0x0]
- str r0, [sp, #0x1c]
- _0201C08C:
- mov r0, #0x0
- str r0, [sp, #0xc]
- mov r0, lr
- str r0, [sp, #0x0]
- ldr r0, [sp, #0x4]
- ldr r0, [r0, #0x0]
- lsl r7, r0, #0x4
- _0201C09A:
- ldr r0, [sp, #0x0]
- mov r3, #0x0
- ldr r0, [r0, #0x0]
- mov r4, r12
- lsl r6, r0, #0x8
- _0201C0A4:
- ldr r0, [r4, #0x0]
- add r1, r7, #0x0
- lsl r0, r0, #0xc
- orr r0, r6
- orr r1, r0
- ldr r0, [sp, #0x1c]
- add r3, r3, #0x1
- add r2, r0, #0x0
- orr r2, r1
- lsl r1, r5, #0x1
- ldr r0, =UNK_021C5734
- add r5, r5, #0x1
- add r4, r4, #0x4
- strh r2, [r0, r1]
- cmp r3, #0x4
- blt _0201C0A4
- ldr r0, [sp, #0x0]
- add r0, r0, #0x4
- str r0, [sp, #0x0]
- ldr r0, [sp, #0xc]
- add r0, r0, #0x1
- str r0, [sp, #0xc]
- cmp r0, #0x4
- blt _0201C09A
- ldr r0, [sp, #0x4]
- add r0, r0, #0x4
- str r0, [sp, #0x4]
- ldr r0, [sp, #0x10]
- add r0, r0, #0x1
- str r0, [sp, #0x10]
- cmp r0, #0x4
- blt _0201C08C
- ldr r0, [sp, #0x8]
- add r0, r0, #0x4
- str r0, [sp, #0x8]
- ldr r0, [sp, #0x14]
- add r0, r0, #0x1
- str r0, [sp, #0x14]
- cmp r0, #0x4
- blt _0201C07E
- add sp, #0x30
- // pop {r3-r7, pc}
- }
-}
+GLOBAL_ASM("asm/nonmatchings/GenerateFontHalfRowLookupTable.s")
#endif
THUMB_FUNC void DecompressGlyphTile(const u16 *src, u16 *dst)
diff --git a/tools/asm_processor/compile.sh b/tools/asm_processor/compile.sh
index 8c367b3e..c4cb0846 100644
--- a/tools/asm_processor/compile.sh
+++ b/tools/asm_processor/compile.sh
@@ -20,7 +20,7 @@ cat global.inc >> "$PRELUDE"
# Inject the matching assembly into the padded obj file.
../tools/asm_processor/asm_processor.py "$SRC" --post-process "$PADDED_OBJ" --assembler "$AS" --asm-prelude "$PRELUDE"
-$DEVKITARM/bin/arm-none-eabi-objcopy --remove-section .comment "$PADDED_OBJ" "$OBJ"
+arm-none-eabi-objcopy --remove-section .comment "$PADDED_OBJ" "$OBJ"
rm "$PADDED_SRC"
rm "$PADDED_OBJ"