NAKED match xxx_draw_char()

This commit is contained in:
Kermalis 2023-08-07 08:16:51 -04:00
parent 315ae86101
commit 175400074e
7 changed files with 601 additions and 597 deletions

View File

@ -5,577 +5,6 @@
.text .text
thumb_func_start xxx_draw_char
xxx_draw_char:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x28
adds r6, r1, 0
mov r10, r2
adds r4, r3, 0
ldr r2, [sp, 0x48]
ldr r3, [sp, 0x4C]
lsls r1, r3, 3
adds r1, r3
lsls r1, 3
adds r5, r0, r1
ldr r1, _080074B8
movs r0, 0xF
ands r2, r0
lsls r2, 2
adds r2, r1
ldr r2, [r2]
str r2, [sp, 0x18]
ldr r0, _080074BC
ldr r0, [r0]
cmp r0, 0x1
bne _080074CC
cmp r4, 0x70
beq _080074B0
cmp r4, 0x6A
beq _080074B0
cmp r4, 0x71
beq _080074B0
cmp r4, 0x79
beq _080074B0
cmp r4, 0x67
bne _080074C0
_080074B0:
movs r0, 0x2
add r10, r0
b _080074CC
.align 2, 0
_080074B8: .4byte gUnknown_80B853C
_080074BC: .4byte gCurrentCharmap
_080074C0:
ldr r0, _080074F8
cmp r4, r0
bne _080074CC
movs r1, 0x2
negs r1, r1
add r10, r1
_080074CC:
adds r0, r4, 0
bl GetCharacter
str r0, [sp]
ldr r2, [r0]
str r2, [sp, 0x4]
str r2, [sp, 0xC]
adds r3, r2, 0
subs r3, 0x6
str r3, [sp, 0x8]
ldr r0, _080074FC
ldrb r0, [r0]
cmp r0, 0
beq _08007500
ldr r4, [sp]
ldrb r1, [r4, 0xA]
lsrs r7, r1, 1
movs r0, 0x1
adds r2, r7, 0
ands r2, r0
str r2, [sp, 0x1C]
b _08007508
.align 2, 0
_080074F8: .4byte 0x00008199
_080074FC: .4byte gUnknown_202B034
_08007500:
movs r3, 0
str r3, [sp, 0x1C]
ldr r4, [sp]
ldrb r1, [r4, 0xA]
_08007508:
movs r0, 0x1
ands r0, r1
cmp r0, 0
bne _08007512
b _08007670
_08007512:
mov r0, r10
cmp r0, 0
bge _0800751A
adds r0, 0x7
_0800751A:
asrs r4, r0, 3
movs r7, 0x4
ldrsh r0, [r5, r7]
muls r0, r4
adds r2, r6, 0
cmp r6, 0
bge _0800752A
adds r2, r6, 0x7
_0800752A:
asrs r2, 3
adds r0, r2
lsls r0, 5
ldr r1, [r5, 0x18]
adds r3, r1, r0
lsls r0, r4, 3
mov r1, r10
subs r0, r1, r0
lsls r0, 2
adds r3, r0
lsls r0, r2, 3
subs r0, r6, r0
lsls r0, 4
ldr r1, _08007664
adds r0, r1
mov r12, r0
mov r9, r2
str r4, [sp, 0x14]
movs r2, 0x8
ldrsh r0, [r5, r2]
cmp r4, r0
blt _08007558
b _0800786C
_08007558:
movs r4, 0
str r4, [sp, 0x10]
ldr r2, _08007668
ldr r1, _0800766C
ldr r0, [r1]
lsls r0, 2
adds r0, r2
ldr r0, [r0]
cmp r4, r0
blt _0800756E
b _0800786C
_0800756E:
adds r4, r2, 0
_08007570:
ldr r6, [sp, 0x4]
ldrh r0, [r6, 0x2]
lsls r2, r0, 16
ldrh r0, [r6]
orrs r2, r0
cmp r2, 0
beq _080075CC
movs r7, 0x4
ldrsh r0, [r5, r7]
cmp r9, r0
bge _080075A6
mov r0, r12
ldr r1, [r0]
ands r1, r2
ldr r0, [r0, 0x8]
lsls r1, r0
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
ldr r0, [r5, 0x3C]
cmp r0, r3
bls _0800759E
str r3, [r5, 0x3C]
_0800759E:
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _080075A6
str r3, [r5, 0x40]
_080075A6:
movs r1, 0x4
ldrsh r0, [r5, r1]
subs r0, 0x1
cmp r9, r0
bge _080075CC
adds r3, 0x20
mov r6, r12
ldr r0, [r6, 0x4]
ands r2, r0
ldr r0, [r6, 0xC]
lsrs r2, r0
ldr r0, [r3]
orrs r0, r2
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _080075CA
str r3, [r5, 0x40]
_080075CA:
subs r3, 0x20
_080075CC:
ldr r7, [sp, 0x4]
ldrh r2, [r7, 0x4]
cmp r2, 0
beq _08007620
movs r1, 0x4
ldrsh r0, [r5, r1]
subs r0, 0x1
cmp r9, r0
bge _080075FA
adds r3, 0x20
mov r6, r12
ldr r1, [r6]
ands r1, r2
ldr r0, [r6, 0x8]
lsls r1, r0
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _080075F8
str r3, [r5, 0x40]
_080075F8:
subs r3, 0x20
_080075FA:
movs r7, 0x4
ldrsh r0, [r5, r7]
subs r0, 0x2
cmp r9, r0
bge _08007620
adds r3, 0x40
mov r1, r12
ldr r0, [r1, 0x4]
ands r2, r0
ldr r0, [r1, 0xC]
lsrs r2, r0
ldr r0, [r3]
orrs r0, r2
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _0800761E
str r3, [r5, 0x40]
_0800761E:
subs r3, 0x40
_08007620:
ldr r2, [sp, 0x4]
adds r2, 0x6
str r2, [sp, 0x4]
adds r3, 0x4
movs r6, 0x1
add r10, r6
movs r0, 0x7
mov r7, r10
ands r0, r7
cmp r0, 0
bne _0800764E
ldr r0, [r5, 0x20]
lsls r0, 2
adds r3, r0
ldr r0, [sp, 0x14]
adds r0, 0x1
str r0, [sp, 0x14]
movs r1, 0x8
ldrsh r0, [r5, r1]
ldr r2, [sp, 0x14]
cmp r2, r0
blt _0800764E
b _0800786C
_0800764E:
ldr r6, [sp, 0x10]
adds r6, 0x1
str r6, [sp, 0x10]
ldr r7, _0800766C
ldr r0, [r7]
lsls r0, 2
adds r0, r4
ldr r0, [r0]
cmp r6, r0
blt _08007570
b _0800786C
.align 2, 0
_08007664: .4byte gUnknown_80B85DC
_08007668: .4byte gUnknown_202B028
_0800766C: .4byte gCurrentCharmap
_08007670:
movs r0, 0
str r0, [sp, 0x20]
mov r0, r10
cmp r0, 0
bge _0800767C
adds r0, 0x7
_0800767C:
asrs r4, r0, 3
movs r1, 0x4
ldrsh r0, [r5, r1]
adds r1, r4, 0
muls r1, r0
adds r0, r6, 0
cmp r6, 0
bge _0800768E
adds r0, r6, 0x7
_0800768E:
asrs r2, r0, 3
adds r0, r1, r2
lsls r0, 5
ldr r1, [r5, 0x18]
adds r3, r1, r0
lsls r0, r4, 3
mov r7, r10
subs r0, r7, r0
lsls r0, 2
adds r3, r0
lsls r0, r2, 3
subs r0, r6, r0
lsls r0, 4
ldr r1, _0800788C
adds r0, r1
mov r12, r0
mov r9, r2
str r4, [sp, 0x14]
movs r1, 0x8
ldrsh r0, [r5, r1]
cmp r4, r0
blt _080076BC
b _0800786C
_080076BC:
movs r2, 0
str r2, [sp, 0x10]
ldr r2, _08007890
ldr r1, _08007894
ldr r0, [r1]
lsls r0, 2
adds r0, r2
ldr r0, [r0]
ldr r4, [sp, 0x10]
cmp r4, r0
blt _080076D4
b _0800786C
_080076D4:
ldr r6, [sp, 0x4]
ldrh r0, [r6, 0x2]
lsls r4, r0, 16
ldrh r0, [r6]
orrs r4, r0
ldr r1, _08007898
ands r1, r4
ldr r0, [sp, 0x18]
ands r0, r4
adds r2, r1, r0
ldr r7, [sp, 0x1C]
cmp r7, 0
beq _08007724
ldr r1, [sp, 0xC]
ldrh r0, [r1, 0x2]
lsls r0, 16
ldrh r1, [r1]
orrs r0, r1
lsls r1, r0, 4
mvns r6, r4
mov r8, r6
bics r1, r4
ldr r7, _0800789C
ldr r6, [r7]
ands r1, r6
orrs r2, r1
ldr r0, [sp, 0x20]
cmp r0, 0
beq _08007724
ldr r1, [sp, 0x8]
ldrh r0, [r1, 0x2]
lsls r0, 16
ldrh r1, [r1]
orrs r0, r1
lsls r1, r0, 4
eors r1, r4
mov r4, r8
ands r1, r4
ands r1, r6
orrs r2, r1
_08007724:
cmp r2, 0
beq _08007776
movs r6, 0x4
ldrsh r0, [r5, r6]
cmp r9, r0
bge _08007750
mov r7, r12
ldr r1, [r7]
ands r1, r2
ldr r0, [r7, 0x8]
lsls r1, r0
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
ldr r0, [r5, 0x3C]
cmp r0, r3
bls _08007748
str r3, [r5, 0x3C]
_08007748:
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _08007750
str r3, [r5, 0x40]
_08007750:
movs r1, 0x4
ldrsh r0, [r5, r1]
subs r0, 0x1
cmp r9, r0
bge _08007776
adds r3, 0x20
mov r4, r12
ldr r0, [r4, 0x4]
ands r2, r0
ldr r0, [r4, 0xC]
lsrs r2, r0
ldr r0, [r3]
orrs r0, r2
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _08007774
str r3, [r5, 0x40]
_08007774:
subs r3, 0x20
_08007776:
ldr r6, [sp, 0x4]
ldrh r4, [r6, 0x4]
ldr r1, _08007898
ands r1, r4
ldr r0, [sp, 0x18]
ands r0, r4
adds r2, r1, r0
ldr r7, [sp, 0x1C]
cmp r7, 0
beq _080077CC
ldr r1, [sp, 0xC]
ldrh r0, [r1, 0x4]
lsls r1, r0, 4
ldr r6, [sp, 0xC]
ldrh r0, [r6, 0x2]
movs r7, 0xF
mov r8, r7
lsrs r0, 12
orrs r1, r0
mvns r0, r4
str r0, [sp, 0x24]
bics r1, r4
ldr r7, _0800789C
ldr r6, [r7]
ands r1, r6
orrs r2, r1
ldr r0, [sp, 0x20]
cmp r0, 0
beq _080077CC
ldr r1, [sp, 0x8]
ldrh r0, [r1, 0x4]
lsls r1, r0, 4
ldr r7, [sp, 0x8]
ldrh r0, [r7, 0x2]
lsrs r0, 12
mov r7, r8
ands r0, r7
orrs r1, r0
eors r1, r4
ldr r0, [sp, 0x24]
ands r1, r0
ands r1, r6
orrs r2, r1
_080077CC:
cmp r2, 0
beq _0800781C
movs r1, 0x4
ldrsh r0, [r5, r1]
subs r0, 0x1
cmp r9, r0
bge _080077F6
adds r3, 0x20
mov r4, r12
ldr r1, [r4]
ands r1, r2
ldr r0, [r4, 0x8]
lsls r1, r0
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _080077F4
str r3, [r5, 0x40]
_080077F4:
subs r3, 0x20
_080077F6:
movs r6, 0x4
ldrsh r0, [r5, r6]
subs r0, 0x2
cmp r9, r0
bge _0800781C
adds r3, 0x40
mov r7, r12
ldr r0, [r7, 0x4]
ands r2, r0
ldr r0, [r7, 0xC]
lsrs r2, r0
ldr r0, [r3]
orrs r0, r2
str r0, [r3]
ldr r0, [r5, 0x40]
cmp r0, r3
bcs _0800781A
str r3, [r5, 0x40]
_0800781A:
subs r3, 0x40
_0800781C:
movs r0, 0x1
str r0, [sp, 0x20]
ldr r1, [sp, 0x4]
adds r1, 0x6
str r1, [sp, 0x4]
ldr r2, [sp, 0x8]
adds r2, 0x6
str r2, [sp, 0x8]
ldr r4, [sp, 0xC]
adds r4, 0x6
str r4, [sp, 0xC]
adds r3, 0x4
add r10, r0
movs r0, 0x7
mov r6, r10
ands r0, r6
cmp r0, 0
bne _08007854
ldr r0, [r5, 0x20]
lsls r0, 2
adds r3, r0
ldr r7, [sp, 0x14]
adds r7, 0x1
str r7, [sp, 0x14]
movs r1, 0x8
ldrsh r0, [r5, r1]
cmp r7, r0
bge _0800786C
_08007854:
ldr r2, [sp, 0x10]
adds r2, 0x1
str r2, [sp, 0x10]
ldr r4, _08007894
ldr r0, [r4]
lsls r0, 2
ldr r6, _08007890
adds r0, r6
ldr r0, [r0]
cmp r2, r0
bge _0800786C
b _080076D4
_0800786C:
ldr r7, [sp]
movs r1, 0x6
ldrsh r0, [r7, r1]
ldr r2, _080078A0
movs r3, 0
ldrsh r1, [r2, r3]
adds r0, r1
add sp, 0x28
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.align 2, 0
_0800788C: .4byte gUnknown_80B85DC
_08007890: .4byte gUnknown_202B028
_08007894: .4byte gCurrentCharmap
_08007898: .4byte 0x11111111
_0800789C: .4byte gUnknown_202B030
_080078A0: .4byte gCharacterSpacing
thumb_func_end xxx_draw_char
thumb_func_start sub_80078A4 thumb_func_start sub_80078A4
sub_80078A4: sub_80078A4:
push {r4-r6,lr} push {r4-r6,lr}

View File

@ -1823,12 +1823,15 @@ gUnknown_80B853C: @ 80B853C
.global gUnknown_80B857C .global gUnknown_80B857C
gUnknown_80B857C: @ 80B857C gUnknown_80B857C: @ 80B857C
.4byte 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0 @ Type: UnkTextStruct2[4]
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.global gUnknown_80B85DC .global gUnknown_80B85DC
gUnknown_80B85DC: @ 80B85DC gUnknown_80B85DC: @ 80B85DC
@ Some kind of bit shifting and masking table @ Type: unkShiftData[8]
@ byte1, byte2, shift_left, shift_right
.4byte 0xFFFFFFFF, 0x00000000, 0x00, 0x20 .4byte 0xFFFFFFFF, 0x00000000, 0x00, 0x20
.4byte 0x0FFFFFFF, 0xF0000000, 0x04, 0x1C .4byte 0x0FFFFFFF, 0xF0000000, 0x04, 0x1C
.4byte 0x00FFFFFF, 0xFF000000, 0x08, 0x18 .4byte 0x00FFFFFF, 0xFF000000, 0x08, 0x18

View File

@ -3,7 +3,24 @@
#include "text.h" #include "text.h"
u32 xxx_call_draw_char(u32, u32, u32, u32, u32); // size: 0x10
struct unkShiftData
{
u32 bytesA;
u32 bytesB;
u32 shift_left;
u32 shift_right;
};
// size: 0x8
struct unkChar
{
u32 *unk0;
s16 unk4;
s16 unk6;
};
u32 xxx_call_draw_char(s32, s32, u32, u32, u32);
void sub_8006518(struct UnkTextStruct2 *); void sub_8006518(struct UnkTextStruct2 *);
void sub_8006554(struct UnkTextStruct1 *, u32 *, u32 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8); void sub_8006554(struct UnkTextStruct1 *, u32 *, u32 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8);
@ -11,6 +28,7 @@ void sub_80073B8(s32);
void sub_80073E0(s32); void sub_80073E0(s32);
// text.s // text.s
extern struct unkChar *GetCharacter(u32);
extern void InitGraphics(void); extern void InitGraphics(void);
extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32); extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32);

View File

@ -4,6 +4,7 @@
#include "memory.h" #include "memory.h"
#include "input.h" #include "input.h"
#include "text1.h" #include "text1.h"
#include "text2.h"
#include "text_util.h" #include "text_util.h"
struct unkStruct_203B200 struct unkStruct_203B200
@ -53,15 +54,6 @@ enum
extern u32 ReturnIntFromChar2(u8); extern u32 ReturnIntFromChar2(u8);
struct unkChar
{
u32 unk0;
s16 unk4;
s16 unk6;
};
struct unkChar *GetCharacter(u32);
s32 sub_8015FEC(u8 *buffer, s32 size) s32 sub_8015FEC(u8 *buffer, s32 size)
{ {

View File

@ -8,12 +8,6 @@
#include "code_800D090.h" #include "code_800D090.h"
#include "menu_input.h" #include "menu_input.h"
struct unkChar
{
u32 unk0;
s16 unk4;
s16 unk6;
};
extern u8 gUnknown_80D4828[]; extern u8 gUnknown_80D4828[];
extern void PlayMenuSoundEffect(u32); extern void PlayMenuSoundEffect(u32);
@ -24,7 +18,6 @@ void sub_8012EBC(struct MenuStruct *param_1);
extern void sub_8013134(struct MenuInputStruct *, u32, u32); extern void sub_8013134(struct MenuInputStruct *, u32, u32);
extern s16 sub_8009614(u32, u32); extern s16 sub_8009614(u32, u32);
extern u32 ReturnIntFromChar2(u8); extern u32 ReturnIntFromChar2(u8);
struct unkChar *GetCharacter(u32);
extern void nullsub_7(u16 *); extern void nullsub_7(u16 *);
extern void nullsub_34(struct MenuInputStructSub *r0); extern void nullsub_34(struct MenuInputStructSub *r0);

View File

@ -7,7 +7,7 @@
EWRAM_DATA struct UnkTextStruct1 gUnknown_2027370[4]; EWRAM_DATA struct UnkTextStruct1 gUnknown_2027370[4];
EWRAM_DATA u8 *gCharmaps[2]; EWRAM_DATA u8 *gCharmaps[2];
EWRAM_DATA u16 gCharacterSpacing; EWRAM_DATA s16 gCharacterSpacing;
EWRAM_DATA u8 gUnknown_20274A5; EWRAM_DATA u8 gUnknown_20274A5;
EWRAM_DATA u32 gCurrentCharmap; EWRAM_DATA u32 gCurrentCharmap;
EWRAM_DATA vu32 gUnknown_20274B0; EWRAM_DATA vu32 gUnknown_20274B0;

View File

@ -8,7 +8,7 @@ extern const u32 gUnknown_80B8814[];
// text.s // text.s
extern void sub_8008C6C(struct UnkTextStruct1 *, u32); extern void sub_8008C6C(struct UnkTextStruct1 *, u32);
u32 xxx_draw_char(struct UnkTextStruct1 *, u32, u32, u32, u32, u32); u32 xxx_draw_char(struct UnkTextStruct1 *, s32, s32, u32, u32, u32);
void sub_800677C(struct UnkTextStruct1 *, s32, u16 *, u8); void sub_800677C(struct UnkTextStruct1 *, s32, u16 *, u8);
void sub_80069CC(struct UnkTextStruct1 *, s32, s32, s32, u16 *); void sub_80069CC(struct UnkTextStruct1 *, s32, s32, s32, u16 *);
@ -1314,7 +1314,7 @@ void nullsub_156(void)
{ {
} }
u32 xxx_call_draw_char(u32 x, u32 y, u32 a2, u32 color, u32 a4) u32 xxx_call_draw_char(s32 x, s32 y, u32 a2, u32 color, u32 a4)
{ {
return xxx_draw_char(gUnknown_2027370, x, y, a2, color, a4); return xxx_draw_char(gUnknown_2027370, x, y, a2, color, a4);
} }
@ -1325,7 +1325,576 @@ bool8 sub_8007464(void)
return FALSE; return FALSE;
} }
/*u32 xxx_draw_char(struct UnkTextStruct1 *a0, u32 x, u32 y, u32 a3, u32 color, u32 a5) // https://decomp.me/scratch/F06Ty
NAKED
u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 color, u32 a5)
{ {
asm_unified(
}*/ "push {r4-r7,lr}\n"
"\tmov r7, r10\n"
"\tmov r6, r9\n"
"\tmov r5, r8\n"
"\tpush {r5-r7}\n"
"\tsub sp, 0x28\n"
"\tadds r6, r1, 0\n"
"\tmov r10, r2\n"
"\tadds r4, r3, 0\n"
"\tldr r2, [sp, 0x48]\n"
"\tldr r3, [sp, 0x4C]\n"
"\tlsls r1, r3, 3\n"
"\tadds r1, r3\n"
"\tlsls r1, 3\n"
"\tadds r5, r0, r1\n"
"\tldr r1, _080074B8\n"
"\tmovs r0, 0xF\n"
"\tands r2, r0\n"
"\tlsls r2, 2\n"
"\tadds r2, r1\n"
"\tldr r2, [r2]\n"
"\tstr r2, [sp, 0x18]\n"
"\tldr r0, _080074BC\n"
"\tldr r0, [r0]\n"
"\tcmp r0, 0x1\n"
"\tbne _080074CC\n"
"\tcmp r4, 0x70\n"
"\tbeq _080074B0\n"
"\tcmp r4, 0x6A\n"
"\tbeq _080074B0\n"
"\tcmp r4, 0x71\n"
"\tbeq _080074B0\n"
"\tcmp r4, 0x79\n"
"\tbeq _080074B0\n"
"\tcmp r4, 0x67\n"
"\tbne _080074C0\n"
"_080074B0:\n"
"\tmovs r0, 0x2\n"
"\tadd r10, r0\n"
"\tb _080074CC\n"
"\t.align 2, 0\n"
"_080074B8: .4byte gUnknown_80B853C\n"
"_080074BC: .4byte gCurrentCharmap\n"
"_080074C0:\n"
"\tldr r0, _080074F8\n"
"\tcmp r4, r0\n"
"\tbne _080074CC\n"
"\tmovs r1, 0x2\n"
"\tnegs r1, r1\n"
"\tadd r10, r1\n"
"_080074CC:\n"
"\tadds r0, r4, 0\n"
"\tbl GetCharacter\n"
"\tstr r0, [sp]\n"
"\tldr r2, [r0]\n"
"\tstr r2, [sp, 0x4]\n"
"\tstr r2, [sp, 0xC]\n"
"\tadds r3, r2, 0\n"
"\tsubs r3, 0x6\n"
"\tstr r3, [sp, 0x8]\n"
"\tldr r0, _080074FC\n"
"\tldrb r0, [r0]\n"
"\tcmp r0, 0\n"
"\tbeq _08007500\n"
"\tldr r4, [sp]\n"
"\tldrb r1, [r4, 0xA]\n"
"\tlsrs r7, r1, 1\n"
"\tmovs r0, 0x1\n"
"\tadds r2, r7, 0\n"
"\tands r2, r0\n"
"\tstr r2, [sp, 0x1C]\n"
"\tb _08007508\n"
"\t.align 2, 0\n"
"_080074F8: .4byte 0x00008199\n"
"_080074FC: .4byte gUnknown_202B034\n"
"_08007500:\n"
"\tmovs r3, 0\n"
"\tstr r3, [sp, 0x1C]\n"
"\tldr r4, [sp]\n"
"\tldrb r1, [r4, 0xA]\n"
"_08007508:\n"
"\tmovs r0, 0x1\n"
"\tands r0, r1\n"
"\tcmp r0, 0\n"
"\tbne _08007512\n"
"\tb _08007670\n"
"_08007512:\n"
"\tmov r0, r10\n"
"\tcmp r0, 0\n"
"\tbge _0800751A\n"
"\tadds r0, 0x7\n"
"_0800751A:\n"
"\tasrs r4, r0, 3\n"
"\tmovs r7, 0x4\n"
"\tldrsh r0, [r5, r7]\n"
"\tmuls r0, r4\n"
"\tadds r2, r6, 0\n"
"\tcmp r6, 0\n"
"\tbge _0800752A\n"
"\tadds r2, r6, 0x7\n"
"_0800752A:\n"
"\tasrs r2, 3\n"
"\tadds r0, r2\n"
"\tlsls r0, 5\n"
"\tldr r1, [r5, 0x18]\n"
"\tadds r3, r1, r0\n"
"\tlsls r0, r4, 3\n"
"\tmov r1, r10\n"
"\tsubs r0, r1, r0\n"
"\tlsls r0, 2\n"
"\tadds r3, r0\n"
"\tlsls r0, r2, 3\n"
"\tsubs r0, r6, r0\n"
"\tlsls r0, 4\n"
"\tldr r1, _08007664\n"
"\tadds r0, r1\n"
"\tmov r12, r0\n"
"\tmov r9, r2\n"
"\tstr r4, [sp, 0x14]\n"
"\tmovs r2, 0x8\n"
"\tldrsh r0, [r5, r2]\n"
"\tcmp r4, r0\n"
"\tblt _08007558\n"
"\tb _0800786C\n"
"_08007558:\n"
"\tmovs r4, 0\n"
"\tstr r4, [sp, 0x10]\n"
"\tldr r2, _08007668\n"
"\tldr r1, _0800766C\n"
"\tldr r0, [r1]\n"
"\tlsls r0, 2\n"
"\tadds r0, r2\n"
"\tldr r0, [r0]\n"
"\tcmp r4, r0\n"
"\tblt _0800756E\n"
"\tb _0800786C\n"
"_0800756E:\n"
"\tadds r4, r2, 0\n"
"_08007570:\n"
"\tldr r6, [sp, 0x4]\n"
"\tldrh r0, [r6, 0x2]\n"
"\tlsls r2, r0, 16\n"
"\tldrh r0, [r6]\n"
"\torrs r2, r0\n"
"\tcmp r2, 0\n"
"\tbeq _080075CC\n"
"\tmovs r7, 0x4\n"
"\tldrsh r0, [r5, r7]\n"
"\tcmp r9, r0\n"
"\tbge _080075A6\n"
"\tmov r0, r12\n"
"\tldr r1, [r0]\n"
"\tands r1, r2\n"
"\tldr r0, [r0, 0x8]\n"
"\tlsls r1, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r1\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x3C]\n"
"\tcmp r0, r3\n"
"\tbls _0800759E\n"
"\tstr r3, [r5, 0x3C]\n"
"_0800759E:\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _080075A6\n"
"\tstr r3, [r5, 0x40]\n"
"_080075A6:\n"
"\tmovs r1, 0x4\n"
"\tldrsh r0, [r5, r1]\n"
"\tsubs r0, 0x1\n"
"\tcmp r9, r0\n"
"\tbge _080075CC\n"
"\tadds r3, 0x20\n"
"\tmov r6, r12\n"
"\tldr r0, [r6, 0x4]\n"
"\tands r2, r0\n"
"\tldr r0, [r6, 0xC]\n"
"\tlsrs r2, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r2\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _080075CA\n"
"\tstr r3, [r5, 0x40]\n"
"_080075CA:\n"
"\tsubs r3, 0x20\n"
"_080075CC:\n"
"\tldr r7, [sp, 0x4]\n"
"\tldrh r2, [r7, 0x4]\n"
"\tcmp r2, 0\n"
"\tbeq _08007620\n"
"\tmovs r1, 0x4\n"
"\tldrsh r0, [r5, r1]\n"
"\tsubs r0, 0x1\n"
"\tcmp r9, r0\n"
"\tbge _080075FA\n"
"\tadds r3, 0x20\n"
"\tmov r6, r12\n"
"\tldr r1, [r6]\n"
"\tands r1, r2\n"
"\tldr r0, [r6, 0x8]\n"
"\tlsls r1, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r1\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _080075F8\n"
"\tstr r3, [r5, 0x40]\n"
"_080075F8:\n"
"\tsubs r3, 0x20\n"
"_080075FA:\n"
"\tmovs r7, 0x4\n"
"\tldrsh r0, [r5, r7]\n"
"\tsubs r0, 0x2\n"
"\tcmp r9, r0\n"
"\tbge _08007620\n"
"\tadds r3, 0x40\n"
"\tmov r1, r12\n"
"\tldr r0, [r1, 0x4]\n"
"\tands r2, r0\n"
"\tldr r0, [r1, 0xC]\n"
"\tlsrs r2, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r2\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _0800761E\n"
"\tstr r3, [r5, 0x40]\n"
"_0800761E:\n"
"\tsubs r3, 0x40\n"
"_08007620:\n"
"\tldr r2, [sp, 0x4]\n"
"\tadds r2, 0x6\n"
"\tstr r2, [sp, 0x4]\n"
"\tadds r3, 0x4\n"
"\tmovs r6, 0x1\n"
"\tadd r10, r6\n"
"\tmovs r0, 0x7\n"
"\tmov r7, r10\n"
"\tands r0, r7\n"
"\tcmp r0, 0\n"
"\tbne _0800764E\n"
"\tldr r0, [r5, 0x20]\n"
"\tlsls r0, 2\n"
"\tadds r3, r0\n"
"\tldr r0, [sp, 0x14]\n"
"\tadds r0, 0x1\n"
"\tstr r0, [sp, 0x14]\n"
"\tmovs r1, 0x8\n"
"\tldrsh r0, [r5, r1]\n"
"\tldr r2, [sp, 0x14]\n"
"\tcmp r2, r0\n"
"\tblt _0800764E\n"
"\tb _0800786C\n"
"_0800764E:\n"
"\tldr r6, [sp, 0x10]\n"
"\tadds r6, 0x1\n"
"\tstr r6, [sp, 0x10]\n"
"\tldr r7, _0800766C\n"
"\tldr r0, [r7]\n"
"\tlsls r0, 2\n"
"\tadds r0, r4\n"
"\tldr r0, [r0]\n"
"\tcmp r6, r0\n"
"\tblt _08007570\n"
"\tb _0800786C\n"
"\t.align 2, 0\n"
"_08007664: .4byte gUnknown_80B85DC\n"
"_08007668: .4byte gUnknown_202B028\n"
"_0800766C: .4byte gCurrentCharmap\n"
"_08007670:\n"
"\tmovs r0, 0\n"
"\tstr r0, [sp, 0x20]\n"
"\tmov r0, r10\n"
"\tcmp r0, 0\n"
"\tbge _0800767C\n"
"\tadds r0, 0x7\n"
"_0800767C:\n"
"\tasrs r4, r0, 3\n"
"\tmovs r1, 0x4\n"
"\tldrsh r0, [r5, r1]\n"
"\tadds r1, r4, 0\n"
"\tmuls r1, r0\n"
"\tadds r0, r6, 0\n"
"\tcmp r6, 0\n"
"\tbge _0800768E\n"
"\tadds r0, r6, 0x7\n"
"_0800768E:\n"
"\tasrs r2, r0, 3\n"
"\tadds r0, r1, r2\n"
"\tlsls r0, 5\n"
"\tldr r1, [r5, 0x18]\n"
"\tadds r3, r1, r0\n"
"\tlsls r0, r4, 3\n"
"\tmov r7, r10\n"
"\tsubs r0, r7, r0\n"
"\tlsls r0, 2\n"
"\tadds r3, r0\n"
"\tlsls r0, r2, 3\n"
"\tsubs r0, r6, r0\n"
"\tlsls r0, 4\n"
"\tldr r1, _0800788C\n"
"\tadds r0, r1\n"
"\tmov r12, r0\n"
"\tmov r9, r2\n"
"\tstr r4, [sp, 0x14]\n"
"\tmovs r1, 0x8\n"
"\tldrsh r0, [r5, r1]\n"
"\tcmp r4, r0\n"
"\tblt _080076BC\n"
"\tb _0800786C\n"
"_080076BC:\n"
"\tmovs r2, 0\n"
"\tstr r2, [sp, 0x10]\n"
"\tldr r2, _08007890\n"
"\tldr r1, _08007894\n"
"\tldr r0, [r1]\n"
"\tlsls r0, 2\n"
"\tadds r0, r2\n"
"\tldr r0, [r0]\n"
"\tldr r4, [sp, 0x10]\n"
"\tcmp r4, r0\n"
"\tblt _080076D4\n"
"\tb _0800786C\n"
"_080076D4:\n"
"\tldr r6, [sp, 0x4]\n"
"\tldrh r0, [r6, 0x2]\n"
"\tlsls r4, r0, 16\n"
"\tldrh r0, [r6]\n"
"\torrs r4, r0\n"
"\tldr r1, _08007898\n"
"\tands r1, r4\n"
"\tldr r0, [sp, 0x18]\n"
"\tands r0, r4\n"
"\tadds r2, r1, r0\n"
"\tldr r7, [sp, 0x1C]\n"
"\tcmp r7, 0\n"
"\tbeq _08007724\n"
"\tldr r1, [sp, 0xC]\n"
"\tldrh r0, [r1, 0x2]\n"
"\tlsls r0, 16\n"
"\tldrh r1, [r1]\n"
"\torrs r0, r1\n"
"\tlsls r1, r0, 4\n"
"\tmvns r6, r4\n"
"\tmov r8, r6\n"
"\tbics r1, r4\n"
"\tldr r7, _0800789C\n"
"\tldr r6, [r7]\n"
"\tands r1, r6\n"
"\torrs r2, r1\n"
"\tldr r0, [sp, 0x20]\n"
"\tcmp r0, 0\n"
"\tbeq _08007724\n"
"\tldr r1, [sp, 0x8]\n"
"\tldrh r0, [r1, 0x2]\n"
"\tlsls r0, 16\n"
"\tldrh r1, [r1]\n"
"\torrs r0, r1\n"
"\tlsls r1, r0, 4\n"
"\teors r1, r4\n"
"\tmov r4, r8\n"
"\tands r1, r4\n"
"\tands r1, r6\n"
"\torrs r2, r1\n"
"_08007724:\n"
"\tcmp r2, 0\n"
"\tbeq _08007776\n"
"\tmovs r6, 0x4\n"
"\tldrsh r0, [r5, r6]\n"
"\tcmp r9, r0\n"
"\tbge _08007750\n"
"\tmov r7, r12\n"
"\tldr r1, [r7]\n"
"\tands r1, r2\n"
"\tldr r0, [r7, 0x8]\n"
"\tlsls r1, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r1\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x3C]\n"
"\tcmp r0, r3\n"
"\tbls _08007748\n"
"\tstr r3, [r5, 0x3C]\n"
"_08007748:\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _08007750\n"
"\tstr r3, [r5, 0x40]\n"
"_08007750:\n"
"\tmovs r1, 0x4\n"
"\tldrsh r0, [r5, r1]\n"
"\tsubs r0, 0x1\n"
"\tcmp r9, r0\n"
"\tbge _08007776\n"
"\tadds r3, 0x20\n"
"\tmov r4, r12\n"
"\tldr r0, [r4, 0x4]\n"
"\tands r2, r0\n"
"\tldr r0, [r4, 0xC]\n"
"\tlsrs r2, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r2\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _08007774\n"
"\tstr r3, [r5, 0x40]\n"
"_08007774:\n"
"\tsubs r3, 0x20\n"
"_08007776:\n"
"\tldr r6, [sp, 0x4]\n"
"\tldrh r4, [r6, 0x4]\n"
"\tldr r1, _08007898\n"
"\tands r1, r4\n"
"\tldr r0, [sp, 0x18]\n"
"\tands r0, r4\n"
"\tadds r2, r1, r0\n"
"\tldr r7, [sp, 0x1C]\n"
"\tcmp r7, 0\n"
"\tbeq _080077CC\n"
"\tldr r1, [sp, 0xC]\n"
"\tldrh r0, [r1, 0x4]\n"
"\tlsls r1, r0, 4\n"
"\tldr r6, [sp, 0xC]\n"
"\tldrh r0, [r6, 0x2]\n"
"\tmovs r7, 0xF\n"
"\tmov r8, r7\n"
"\tlsrs r0, 12\n"
"\torrs r1, r0\n"
"\tmvns r0, r4\n"
"\tstr r0, [sp, 0x24]\n"
"\tbics r1, r4\n"
"\tldr r7, _0800789C\n"
"\tldr r6, [r7]\n"
"\tands r1, r6\n"
"\torrs r2, r1\n"
"\tldr r0, [sp, 0x20]\n"
"\tcmp r0, 0\n"
"\tbeq _080077CC\n"
"\tldr r1, [sp, 0x8]\n"
"\tldrh r0, [r1, 0x4]\n"
"\tlsls r1, r0, 4\n"
"\tldr r7, [sp, 0x8]\n"
"\tldrh r0, [r7, 0x2]\n"
"\tlsrs r0, 12\n"
"\tmov r7, r8\n"
"\tands r0, r7\n"
"\torrs r1, r0\n"
"\teors r1, r4\n"
"\tldr r0, [sp, 0x24]\n"
"\tands r1, r0\n"
"\tands r1, r6\n"
"\torrs r2, r1\n"
"_080077CC:\n"
"\tcmp r2, 0\n"
"\tbeq _0800781C\n"
"\tmovs r1, 0x4\n"
"\tldrsh r0, [r5, r1]\n"
"\tsubs r0, 0x1\n"
"\tcmp r9, r0\n"
"\tbge _080077F6\n"
"\tadds r3, 0x20\n"
"\tmov r4, r12\n"
"\tldr r1, [r4]\n"
"\tands r1, r2\n"
"\tldr r0, [r4, 0x8]\n"
"\tlsls r1, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r1\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _080077F4\n"
"\tstr r3, [r5, 0x40]\n"
"_080077F4:\n"
"\tsubs r3, 0x20\n"
"_080077F6:\n"
"\tmovs r6, 0x4\n"
"\tldrsh r0, [r5, r6]\n"
"\tsubs r0, 0x2\n"
"\tcmp r9, r0\n"
"\tbge _0800781C\n"
"\tadds r3, 0x40\n"
"\tmov r7, r12\n"
"\tldr r0, [r7, 0x4]\n"
"\tands r2, r0\n"
"\tldr r0, [r7, 0xC]\n"
"\tlsrs r2, r0\n"
"\tldr r0, [r3]\n"
"\torrs r0, r2\n"
"\tstr r0, [r3]\n"
"\tldr r0, [r5, 0x40]\n"
"\tcmp r0, r3\n"
"\tbcs _0800781A\n"
"\tstr r3, [r5, 0x40]\n"
"_0800781A:\n"
"\tsubs r3, 0x40\n"
"_0800781C:\n"
"\tmovs r0, 0x1\n"
"\tstr r0, [sp, 0x20]\n"
"\tldr r1, [sp, 0x4]\n"
"\tadds r1, 0x6\n"
"\tstr r1, [sp, 0x4]\n"
"\tldr r2, [sp, 0x8]\n"
"\tadds r2, 0x6\n"
"\tstr r2, [sp, 0x8]\n"
"\tldr r4, [sp, 0xC]\n"
"\tadds r4, 0x6\n"
"\tstr r4, [sp, 0xC]\n"
"\tadds r3, 0x4\n"
"\tadd r10, r0\n"
"\tmovs r0, 0x7\n"
"\tmov r6, r10\n"
"\tands r0, r6\n"
"\tcmp r0, 0\n"
"\tbne _08007854\n"
"\tldr r0, [r5, 0x20]\n"
"\tlsls r0, 2\n"
"\tadds r3, r0\n"
"\tldr r7, [sp, 0x14]\n"
"\tadds r7, 0x1\n"
"\tstr r7, [sp, 0x14]\n"
"\tmovs r1, 0x8\n"
"\tldrsh r0, [r5, r1]\n"
"\tcmp r7, r0\n"
"\tbge _0800786C\n"
"_08007854:\n"
"\tldr r2, [sp, 0x10]\n"
"\tadds r2, 0x1\n"
"\tstr r2, [sp, 0x10]\n"
"\tldr r4, _08007894\n"
"\tldr r0, [r4]\n"
"\tlsls r0, 2\n"
"\tldr r6, _08007890\n"
"\tadds r0, r6\n"
"\tldr r0, [r0]\n"
"\tcmp r2, r0\n"
"\tbge _0800786C\n"
"\tb _080076D4\n"
"_0800786C:\n"
"\tldr r7, [sp]\n"
"\tmovs r1, 0x6\n"
"\tldrsh r0, [r7, r1]\n"
"\tldr r2, _080078A0\n"
"\tmovs r3, 0\n"
"\tldrsh r1, [r2, r3]\n"
"\tadds r0, r1\n"
"\tadd sp, 0x28\n"
"\tpop {r3-r5}\n"
"\tmov r8, r3\n"
"\tmov r9, r4\n"
"\tmov r10, r5\n"
"\tpop {r4-r7}\n"
"\tpop {r1}\n"
"\tbx r1\n"
"\t.align 2, 0\n"
"_0800788C: .4byte gUnknown_80B85DC\n"
"_08007890: .4byte gUnknown_202B028\n"
"_08007894: .4byte gCurrentCharmap\n"
"_08007898: .4byte 0x11111111\n"
"_0800789C: .4byte gUnknown_202B030\n"
"_080078A0: .4byte gCharacterSpacing");
}