mirror of
https://github.com/pret/pmd-red.git
synced 2024-11-23 13:09:56 +00:00
sub_8009408
This commit is contained in:
parent
7220a18265
commit
c579df2588
456
asm/text.s
456
asm/text.s
@ -7,462 +7,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
thumb_func_start sub_800915C
|
||||
sub_800915C:
|
||||
push {r4,lr}
|
||||
adds r3, r0, 0
|
||||
movs r2, 0
|
||||
_08009162:
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0x2E
|
||||
beq _08009184
|
||||
subs r0, 0x30
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x9
|
||||
bhi _08009186
|
||||
lsls r0, r2, 2
|
||||
adds r0, r2
|
||||
lsls r2, r0, 1
|
||||
adds r0, r2, 0
|
||||
subs r0, 0x30
|
||||
ldrb r4, [r1]
|
||||
adds r2, r0, r4
|
||||
adds r1, 0x1
|
||||
b _08009162
|
||||
_08009184:
|
||||
adds r1, 0x1
|
||||
_08009186:
|
||||
strh r2, [r3]
|
||||
adds r0, r1, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_800915C
|
||||
|
||||
thumb_func_start xxx_handle_format_global
|
||||
xxx_handle_format_global:
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
adds r2, r1, 0
|
||||
ldr r0, _080091A4
|
||||
adds r1, r3, 0
|
||||
bl HandleTextFormat
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_080091A4: .4byte gUnknown_2027370
|
||||
thumb_func_end xxx_handle_format_global
|
||||
|
||||
thumb_func_start sub_80091A8
|
||||
sub_80091A8:
|
||||
adds r0, 0x1
|
||||
bx lr
|
||||
thumb_func_end sub_80091A8
|
||||
|
||||
thumb_func_start HandleTextFormat
|
||||
HandleTextFormat:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
mov r8, r0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
movs r0, 0
|
||||
mov r9, r0
|
||||
movs r7, 0x1
|
||||
_080091C0:
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0x23
|
||||
beq _080091C8
|
||||
b _0800937A
|
||||
_080091C8:
|
||||
ldrb r0, [r4, 0x1]
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0x5B
|
||||
bne _08009216
|
||||
adds r2, r4, 0
|
||||
adds r4, 0x2
|
||||
adds r0, r5, 0
|
||||
adds r0, 0x21
|
||||
mov r1, r9
|
||||
strb r1, [r0]
|
||||
ldrb r1, [r4]
|
||||
adds r6, r0, 0
|
||||
cmp r1, 0
|
||||
beq _080091F6
|
||||
cmp r1, 0x5D
|
||||
beq _080091F4
|
||||
_080091E8:
|
||||
adds r4, 0x1
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _080091F6
|
||||
cmp r0, 0x5D
|
||||
bne _080091E8
|
||||
_080091F4:
|
||||
adds r4, 0x1
|
||||
_080091F6:
|
||||
ldr r3, [r5, 0x24]
|
||||
cmp r3, 0
|
||||
beq _0800920C
|
||||
adds r0, r2, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl _call_via_r3
|
||||
cmp r0, 0
|
||||
beq _0800920C
|
||||
adds r4, r0, 0
|
||||
_0800920C:
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _08009214
|
||||
b _0800937A
|
||||
_08009214:
|
||||
b _080091C0
|
||||
_08009216:
|
||||
cmp r1, 0x3D
|
||||
bne _08009220
|
||||
ldrb r0, [r4, 0x2]
|
||||
strh r0, [r5]
|
||||
b _080092BA
|
||||
_08009220:
|
||||
cmp r1, 0x79
|
||||
bne _0800922A
|
||||
ldrb r0, [r4, 0x2]
|
||||
strh r0, [r5, 0x2]
|
||||
b _080092BA
|
||||
_0800922A:
|
||||
cmp r1, 0x3E
|
||||
bne _0800923A
|
||||
adds r1, r4, 0x2
|
||||
adds r0, r5, 0
|
||||
bl sub_800915C
|
||||
adds r4, r0, 0
|
||||
b _080091C0
|
||||
_0800923A:
|
||||
cmp r1, 0x2E
|
||||
bne _08009246
|
||||
ldrh r0, [r5]
|
||||
ldrb r2, [r4, 0x2]
|
||||
adds r0, r2
|
||||
b _0800926E
|
||||
_08009246:
|
||||
cmp r1, 0x6E
|
||||
bne _08009258
|
||||
ldr r0, [r5, 0xC]
|
||||
strh r0, [r5]
|
||||
ldrh r0, [r5, 0x2]
|
||||
adds r0, 0xB
|
||||
strh r0, [r5, 0x2]
|
||||
adds r4, 0x2
|
||||
b _080091C0
|
||||
_08009258:
|
||||
cmp r1, 0x3A
|
||||
bne _08009264
|
||||
ldrh r0, [r5]
|
||||
strh r0, [r5, 0x4]
|
||||
adds r4, 0x2
|
||||
b _080091C0
|
||||
_08009264:
|
||||
cmp r1, 0x3B
|
||||
bne _08009274
|
||||
ldrh r0, [r5, 0x4]
|
||||
ldrb r3, [r4, 0x2]
|
||||
adds r0, r3
|
||||
_0800926E:
|
||||
strh r0, [r5]
|
||||
adds r4, 0x3
|
||||
b _080091C0
|
||||
_08009274:
|
||||
cmp r1, 0x2B
|
||||
bne _0800929A
|
||||
adds r4, 0x2
|
||||
adds r0, r4, 0
|
||||
bl sub_8008ED0
|
||||
mov r2, r8
|
||||
movs r3, 0x4
|
||||
ldrsh r1, [r2, r3]
|
||||
lsls r1, 3
|
||||
subs r1, r0
|
||||
strh r1, [r5]
|
||||
movs r1, 0
|
||||
ldrsh r0, [r5, r1]
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
strh r0, [r5]
|
||||
b _080091C0
|
||||
_0800929A:
|
||||
cmp r1, 0x43
|
||||
bne _080092A4
|
||||
ldr r0, [r5, 0x10]
|
||||
str r0, [r5, 0x14]
|
||||
b _080092DC
|
||||
_080092A4:
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x5F
|
||||
bne _080092CC
|
||||
ldr r0, [r5, 0x10]
|
||||
str r0, [r5, 0x14]
|
||||
ldr r1, _080092C8
|
||||
ldrb r0, [r4, 0x2]
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
str r0, [r5, 0x10]
|
||||
_080092BA:
|
||||
adds r4, 0x3
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0x2E
|
||||
beq _080092C4
|
||||
b _080091C0
|
||||
_080092C4:
|
||||
adds r4, 0x1
|
||||
b _080091C0
|
||||
.align 2, 0
|
||||
_080092C8: .4byte gUnknown_202749A
|
||||
_080092CC:
|
||||
cmp r0, 0x52
|
||||
bne _080092D4
|
||||
ldr r0, [r5, 0x14]
|
||||
b _080092EE
|
||||
_080092D4:
|
||||
cmp r0, 0x63
|
||||
bne _080092E8
|
||||
ldr r0, [r5, 0x10]
|
||||
str r0, [r5, 0x18]
|
||||
_080092DC:
|
||||
ldrb r0, [r4, 0x2]
|
||||
bl InterpretColorChar
|
||||
str r0, [r5, 0x10]
|
||||
adds r4, 0x3
|
||||
b _080091C0
|
||||
_080092E8:
|
||||
cmp r0, 0x72
|
||||
bne _080092F4
|
||||
ldr r0, [r5, 0x18]
|
||||
_080092EE:
|
||||
str r0, [r5, 0x10]
|
||||
adds r4, 0x2
|
||||
b _080091C0
|
||||
_080092F4:
|
||||
cmp r0, 0x53
|
||||
bne _08009314
|
||||
ldr r3, _08009310
|
||||
ldrb r2, [r4, 0x2]
|
||||
movs r0, 0x7F
|
||||
adds r1, r0, 0
|
||||
ands r1, r2
|
||||
adds r1, r3
|
||||
ldrb r2, [r4, 0x3]
|
||||
ands r0, r2
|
||||
strb r0, [r1]
|
||||
adds r4, 0x4
|
||||
b _080091C0
|
||||
.align 2, 0
|
||||
_08009310: .4byte gUnknown_20274A6
|
||||
_08009314:
|
||||
cmp r0, 0x57
|
||||
bne _0800933A
|
||||
adds r4, 0x2
|
||||
mov r2, r8
|
||||
movs r3, 0
|
||||
ldrsh r0, [r2, r3]
|
||||
lsls r0, 3
|
||||
ldrh r1, [r5]
|
||||
adds r0, r1
|
||||
subs r0, 0x2
|
||||
strh r0, [r5, 0x8]
|
||||
movs r3, 0x2
|
||||
ldrsh r0, [r2, r3]
|
||||
lsls r0, 3
|
||||
ldrh r1, [r5, 0x2]
|
||||
adds r0, r1
|
||||
adds r0, 0x3
|
||||
strh r0, [r5, 0xA]
|
||||
b _0800935C
|
||||
_0800933A:
|
||||
cmp r0, 0x50
|
||||
bne _08009350
|
||||
adds r4, 0x2
|
||||
ldr r0, _0800934C
|
||||
strh r0, [r5, 0x2]
|
||||
mov r2, r9
|
||||
str r2, [r5, 0x1C]
|
||||
b _0800935C
|
||||
.align 2, 0
|
||||
_0800934C: .4byte 0x0000270f
|
||||
_08009350:
|
||||
cmp r0, 0x70
|
||||
bne _08009368
|
||||
adds r4, 0x2
|
||||
ldr r0, _08009364
|
||||
strh r0, [r5, 0x2]
|
||||
str r7, [r5, 0x1C]
|
||||
_0800935C:
|
||||
adds r0, r5, 0
|
||||
adds r0, 0x20
|
||||
strb r7, [r0]
|
||||
b _0800937A
|
||||
.align 2, 0
|
||||
_08009364: .4byte 0x0000270f
|
||||
_08009368:
|
||||
cmp r0, 0x7E
|
||||
bne _0800937A
|
||||
ldrb r0, [r4, 0x2]
|
||||
str r0, [r5, 0x2C]
|
||||
adds r0, r5, 0
|
||||
adds r0, 0x21
|
||||
strb r7, [r0]
|
||||
adds r4, 0x3
|
||||
b _080091C0
|
||||
_0800937A:
|
||||
adds r0, r4, 0
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end HandleTextFormat
|
||||
|
||||
thumb_func_start sub_8009388
|
||||
sub_8009388:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
ldr r2, _080093F4
|
||||
ldr r6, _080093F8
|
||||
strh r6, [r2]
|
||||
movs r0, 0x80
|
||||
lsls r0, 4
|
||||
adds r5, r2, r0
|
||||
ldr r4, _080093FC
|
||||
strh r4, [r5]
|
||||
ldr r0, _08009400
|
||||
ldr r3, [r0]
|
||||
ldr r0, _08009404
|
||||
ldr r1, [r0]
|
||||
mov r9, r0
|
||||
cmp r3, r1
|
||||
bge _080093E6
|
||||
mov r8, r2
|
||||
mov r12, r6
|
||||
adds r6, r5, 0
|
||||
movs r5, 0
|
||||
adds r7, r6, 0
|
||||
_080093B8:
|
||||
lsls r0, r3, 6
|
||||
mov r1, r8
|
||||
adds r2, r0, r1
|
||||
mov r1, r12
|
||||
strh r1, [r2]
|
||||
adds r1, r0, r6
|
||||
strh r4, [r1]
|
||||
adds r3, 0x1
|
||||
adds r0, r7
|
||||
adds r0, 0x2
|
||||
adds r2, 0x2
|
||||
movs r1, 0x1E
|
||||
_080093D0:
|
||||
strh r5, [r2]
|
||||
strh r4, [r0]
|
||||
adds r0, 0x2
|
||||
adds r2, 0x2
|
||||
subs r1, 0x1
|
||||
cmp r1, 0
|
||||
bge _080093D0
|
||||
mov r1, r9
|
||||
ldr r0, [r1]
|
||||
cmp r3, r0
|
||||
blt _080093B8
|
||||
_080093E6:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080093F4: .4byte gUnknown_202B038
|
||||
_080093F8: .4byte 0x0000f279
|
||||
_080093FC: .4byte 0x0000f27a
|
||||
_08009400: .4byte gUnknown_202B020
|
||||
_08009404: .4byte gUnknown_202B024
|
||||
thumb_func_end sub_8009388
|
||||
|
||||
thumb_func_start sub_8009408
|
||||
sub_8009408:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
adds r5, r1, 0
|
||||
ldr r1, _08009478
|
||||
ldr r6, _0800947C
|
||||
strh r6, [r1]
|
||||
movs r2, 0x80
|
||||
lsls r2, 4
|
||||
adds r4, r1, r2
|
||||
ldr r2, _08009480
|
||||
strh r2, [r4]
|
||||
adds r3, r0, 0
|
||||
ldr r0, _08009484
|
||||
mov r10, r0
|
||||
cmp r3, r5
|
||||
bge _08009464
|
||||
mov r9, r1
|
||||
mov r8, r6
|
||||
adds r7, r4, 0
|
||||
adds r4, r2, 0
|
||||
movs r6, 0
|
||||
mov r12, r7
|
||||
_0800943A:
|
||||
lsls r0, r3, 6
|
||||
mov r1, r9
|
||||
adds r2, r0, r1
|
||||
mov r1, r8
|
||||
strh r1, [r2]
|
||||
adds r1, r0, r7
|
||||
strh r4, [r1]
|
||||
adds r3, 0x1
|
||||
add r0, r12
|
||||
adds r0, 0x2
|
||||
adds r2, 0x2
|
||||
movs r1, 0x1E
|
||||
_08009452:
|
||||
strh r6, [r2]
|
||||
strh r4, [r0]
|
||||
adds r0, 0x2
|
||||
adds r2, 0x2
|
||||
subs r1, 0x1
|
||||
cmp r1, 0
|
||||
bge _08009452
|
||||
cmp r3, r5
|
||||
blt _0800943A
|
||||
_08009464:
|
||||
movs r0, 0x1
|
||||
mov r2, r10
|
||||
strb r0, [r2]
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08009478: .4byte gUnknown_202B038
|
||||
_0800947C: .4byte 0x0000f279
|
||||
_08009480: .4byte 0x0000f27a
|
||||
_08009484: .4byte gUnknown_20274A5
|
||||
thumb_func_end sub_8009408
|
||||
|
||||
thumb_func_start sub_8009488
|
||||
sub_8009488:
|
||||
push {r4-r7,lr}
|
||||
|
526
src/text2.c
526
src/text2.c
@ -3410,18 +3410,36 @@ UNUSED void sub_8008FF0(s32 x, u32 y, const u8 *str, u32 windowId, u32 a4)
|
||||
|
||||
UNUSED void nullsub_171(void) {}
|
||||
|
||||
struct UnkDrawStringStruct;
|
||||
|
||||
struct UnkDrawStringStruct
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s16 unk8;
|
||||
s16 unkA;
|
||||
s32 unkC;
|
||||
u32 unk10;
|
||||
u32 unk14;
|
||||
u32 unk18;
|
||||
void *unk24;
|
||||
u32 unk1C;
|
||||
u8 unk20;
|
||||
u8 unk21;
|
||||
u8 fill22;
|
||||
u8 fill23;
|
||||
const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*);
|
||||
u8 fill28;
|
||||
u8 fill29;
|
||||
u8 fill2A;
|
||||
u8 fill2B;
|
||||
u32 unk2C;
|
||||
u8 fill[24];
|
||||
u32 unk3C;
|
||||
u8 fill30;
|
||||
u8 fill31;
|
||||
u8 fill32;
|
||||
u8 fill33;
|
||||
u32 unk34;
|
||||
};
|
||||
|
||||
const u8 *HandleTextFormat(UnkTextStruct1 *strArr, const u8 *str, struct UnkDrawStringStruct *sp);
|
||||
@ -3432,46 +3450,518 @@ void xxx_draw_string(UnkTextStruct1 *strArr, s32 x, s32 y, const u8 *str, u32 wi
|
||||
|
||||
sp.unk0 = x;
|
||||
sp.unk2 = y;
|
||||
sp.unk14 = x;
|
||||
sp.unk18 = 7;
|
||||
sp.unkC = x;
|
||||
sp.unk10 = 7;
|
||||
while (1) {
|
||||
str = HandleTextFormat(strArr, str, &sp);
|
||||
str = xxx_get_next_char_from_string(str, &sp.unk3C);
|
||||
if (sp.unk3C == '\0' || sp.unk3C == a5)
|
||||
str = xxx_get_next_char_from_string(str, &sp.unk34);
|
||||
if (sp.unk34 == '\0' || sp.unk34 == a5)
|
||||
break;
|
||||
|
||||
if (sp.unk3C == 0x82A0) {
|
||||
if (sp.unk34 == 0x82A0) {
|
||||
gCurrentCharmap = 0;
|
||||
}
|
||||
else if (sp.unk3C == 0x82A2) {
|
||||
else if (sp.unk34 == 0x82A2) {
|
||||
gCurrentCharmap = 1;
|
||||
}
|
||||
else if (sp.unk3C == 0x1B) {
|
||||
else if (sp.unk34 == 0x1B) {
|
||||
break;
|
||||
}
|
||||
else if (sp.unk3C == 0xD || sp.unk3C == 0xA) {
|
||||
sp.unk0 = sp.unk14;
|
||||
else if (sp.unk34 == 0xD || sp.unk34 == 0xA) {
|
||||
sp.unk0 = sp.unkC;
|
||||
sp.unk2 += a7;
|
||||
}
|
||||
else if (sp.unk3C == 0x1D) {
|
||||
sp.unk0 = sp.unk14;
|
||||
else if (sp.unk34 == 0x1D) {
|
||||
sp.unk0 = sp.unkC;
|
||||
sp.unk2 += 5;
|
||||
}
|
||||
else if (sp.unk3C == 0x60) {
|
||||
else if (sp.unk34 == 0x60) {
|
||||
sp.unk0 += 6;
|
||||
}
|
||||
else if (a6 == 0) {
|
||||
sp.unk0 += xxx_draw_char(strArr, sp.unk0, sp.unk2, sp.unk3C, sp.unk18, windowId);
|
||||
sp.unk0 += xxx_draw_char(strArr, sp.unk0, sp.unk2, sp.unk34, sp.unk10, windowId);
|
||||
}
|
||||
else {
|
||||
const struct unkChar *chrPtr = GetCharacter(sp.unk3C);
|
||||
const struct unkChar *chrPtr = GetCharacter(sp.unk34);
|
||||
if (chrPtr != NULL) {
|
||||
s32 x = sp.unk0;
|
||||
s32 x2 = gCharacterSpacing + 10;
|
||||
x +=((x2 - chrPtr->unk6) / 2);
|
||||
xxx_draw_char(strArr, x, sp.unk2, sp.unk3C, sp.unk18, windowId);
|
||||
xxx_draw_char(strArr, x, sp.unk2, sp.unk34, sp.unk10, windowId);
|
||||
sp.unk0 += a6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const u8 *sub_800915C(s16 *a0, const u8 *str)
|
||||
{
|
||||
s32 a = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (*str == 0x2E) {
|
||||
str++;
|
||||
break;
|
||||
}
|
||||
else if (*str >= '0' && *str <= '9') {
|
||||
a *= 10;
|
||||
a += (*str - '0');
|
||||
str++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*a0 = a;
|
||||
return str;
|
||||
}
|
||||
|
||||
const u8 *xxx_handle_format_global(const u8 *str, struct UnkDrawStringStruct *unkStrPtr)
|
||||
{
|
||||
return HandleTextFormat(gUnknown_2027370, str, unkStrPtr);
|
||||
}
|
||||
|
||||
UNUSED s32 sub_80091A8(s32 a0)
|
||||
{
|
||||
return a0 + 1;
|
||||
}
|
||||
|
||||
extern u8 gUnknown_202749A[];
|
||||
extern u8 gUnknown_20274A6[];
|
||||
|
||||
s32 InterpretColorChar(s32 a0);
|
||||
|
||||
#ifdef NONMATCHING
|
||||
// https://decomp.me/scratch/AJ2km
|
||||
const u8 *HandleTextFormat(UnkTextStruct1 *strArr, const u8 *str, struct UnkDrawStringStruct *sp)
|
||||
{
|
||||
while (*str == 0x23) {
|
||||
if (str[1] == 0x5B) {
|
||||
const u8 *strBefore = str;
|
||||
str += 2;
|
||||
sp->unk21 = 0;
|
||||
while (*str != '\0') {
|
||||
if (*str == 0x5D) {
|
||||
str++;
|
||||
break;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
if (sp->unk24 != NULL) {
|
||||
const u8 *strNew = sp->unk24(strBefore, str, sp);
|
||||
if (strNew != NULL) {
|
||||
str = strNew;
|
||||
}
|
||||
}
|
||||
|
||||
if (sp->unk21 != 0)
|
||||
break;
|
||||
}
|
||||
else if (str[1] == 0x3D) {
|
||||
sp->unk0 = str[2];
|
||||
str += 3;
|
||||
if (*str == 0x2E)
|
||||
str++;
|
||||
}
|
||||
else if (str[1] == 0x79) {
|
||||
sp->unk2 = str[2];
|
||||
str += 3;
|
||||
if (*str == 0x2E)
|
||||
str++;
|
||||
}
|
||||
else if (str[1] == 0x3E) {
|
||||
str = sub_800915C(&sp->unk0, str + 2);
|
||||
}
|
||||
else if (str[1] == 0x2E) {
|
||||
sp->unk0 += str[2];
|
||||
str += 3;
|
||||
}
|
||||
else if (str[1] == 0x6E) {
|
||||
sp->unk0 = sp->unkC;
|
||||
sp->unk2 += 11;
|
||||
str += 2;
|
||||
}
|
||||
else if (str[1] == 0x3A) {
|
||||
sp->unk0 = sp->unk4;
|
||||
str += 2;
|
||||
}
|
||||
else if (str[1] == 0x3B) {
|
||||
sp->unk0 = sp->unk4 + str[2];
|
||||
str += 3;
|
||||
}
|
||||
else if (str[1] == 0x2B) {
|
||||
str += 2;
|
||||
sp->unk0 = (strArr[0].unk4 * 8) - sub_8008ED0(str);
|
||||
sp->unk0 /= 2;
|
||||
}
|
||||
else if (str[1] == 0x43) {
|
||||
sp->unk14 = sp->unk10;
|
||||
sp->unk10 = InterpretColorChar(str[2]);
|
||||
str += 3;
|
||||
}
|
||||
else if (str[1] == 0x5F) {
|
||||
sp->unk14 = sp->unk10;
|
||||
sp->unk10 = gUnknown_202749A[str[2]];
|
||||
str += 3;
|
||||
if (*str == 0x2E)
|
||||
str++;
|
||||
}
|
||||
else if (str[1] == 0x52) {
|
||||
sp->unk10 = sp->unk14;
|
||||
str += 2;
|
||||
}
|
||||
else if (str[1] == 0x63) {
|
||||
sp->unk18 = sp->unk10;
|
||||
sp->unk10 = InterpretColorChar(str[2]);
|
||||
str += 3;
|
||||
}
|
||||
else if (str[1] == 0x72) {
|
||||
sp->unk10 = sp->unk18;
|
||||
str += 2;
|
||||
}
|
||||
else if (str[1] == 0x53) {
|
||||
gUnknown_20274A6[str[2] & 0x7F] = str[3] & 0x7F;
|
||||
str += 4;
|
||||
}
|
||||
else if (str[1] == 0x57) {
|
||||
str += 2;
|
||||
sp->unk8 = ((strArr[0].unk0 * 8) + sp->unk0) - 2;
|
||||
sp->unkA = ((strArr[0].unk2 * 8) + sp->unk2) + 3;
|
||||
sp->unk20 = 1;
|
||||
break;
|
||||
}
|
||||
else if (str[1] == 0x50) {
|
||||
str += 2;
|
||||
sp->unk2 = 9999;
|
||||
sp->unk1C = 0;
|
||||
sp->unk20 = 1;
|
||||
break;
|
||||
}
|
||||
else if (str[1] == 0x70) {
|
||||
str += 2;
|
||||
sp->unk2 = 9999;
|
||||
sp->unk1C = 1;
|
||||
sp->unk20 = 1;
|
||||
break;
|
||||
}
|
||||
else if (str[1] == 0x7E) {
|
||||
sp->unk2C = str[2];
|
||||
sp->unk21 = 1;
|
||||
str += 3;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
#else
|
||||
NAKED const u8 *HandleTextFormat(UnkTextStruct1 *strArr, const u8 *str, struct UnkDrawStringStruct *sp)
|
||||
{
|
||||
asm_unified("push {r4-r7,lr}\n"
|
||||
" mov r7, r9\n"
|
||||
" mov r6, r8\n"
|
||||
" push {r6,r7}\n"
|
||||
" mov r8, r0\n"
|
||||
" adds r4, r1, 0\n"
|
||||
" adds r5, r2, 0\n"
|
||||
" movs r0, 0\n"
|
||||
" mov r9, r0\n"
|
||||
" movs r7, 0x1\n"
|
||||
"_080091C0:\n"
|
||||
" ldrb r0, [r4]\n"
|
||||
" cmp r0, 0x23\n"
|
||||
" beq _080091C8\n"
|
||||
" b _0800937A\n"
|
||||
"_080091C8:\n"
|
||||
" ldrb r0, [r4, 0x1]\n"
|
||||
" adds r1, r0, 0\n"
|
||||
" cmp r1, 0x5B\n"
|
||||
" bne _08009216\n"
|
||||
" adds r2, r4, 0\n"
|
||||
" adds r4, 0x2\n"
|
||||
" adds r0, r5, 0\n"
|
||||
" adds r0, 0x21\n"
|
||||
" mov r1, r9\n"
|
||||
" strb r1, [r0]\n"
|
||||
" ldrb r1, [r4]\n"
|
||||
" adds r6, r0, 0\n"
|
||||
" cmp r1, 0\n"
|
||||
" beq _080091F6\n"
|
||||
" cmp r1, 0x5D\n"
|
||||
" beq _080091F4\n"
|
||||
"_080091E8:\n"
|
||||
" adds r4, 0x1\n"
|
||||
" ldrb r0, [r4]\n"
|
||||
" cmp r0, 0\n"
|
||||
" beq _080091F6\n"
|
||||
" cmp r0, 0x5D\n"
|
||||
" bne _080091E8\n"
|
||||
"_080091F4:\n"
|
||||
" adds r4, 0x1\n"
|
||||
"_080091F6:\n"
|
||||
" ldr r3, [r5, 0x24]\n"
|
||||
" cmp r3, 0\n"
|
||||
" beq _0800920C\n"
|
||||
" adds r0, r2, 0\n"
|
||||
" adds r1, r4, 0\n"
|
||||
" adds r2, r5, 0\n"
|
||||
" bl _call_via_r3\n"
|
||||
" cmp r0, 0\n"
|
||||
" beq _0800920C\n"
|
||||
" adds r4, r0, 0\n"
|
||||
"_0800920C:\n"
|
||||
" ldrb r0, [r6]\n"
|
||||
" cmp r0, 0\n"
|
||||
" beq _08009214\n"
|
||||
" b _0800937A\n"
|
||||
"_08009214:\n"
|
||||
" b _080091C0\n"
|
||||
"_08009216:\n"
|
||||
" cmp r1, 0x3D\n"
|
||||
" bne _08009220\n"
|
||||
" ldrb r0, [r4, 0x2]\n"
|
||||
" strh r0, [r5]\n"
|
||||
" b _080092BA\n"
|
||||
"_08009220:\n"
|
||||
" cmp r1, 0x79\n"
|
||||
" bne _0800922A\n"
|
||||
" ldrb r0, [r4, 0x2]\n"
|
||||
" strh r0, [r5, 0x2]\n"
|
||||
" b _080092BA\n"
|
||||
"_0800922A:\n"
|
||||
" cmp r1, 0x3E\n"
|
||||
" bne _0800923A\n"
|
||||
" adds r1, r4, 0x2\n"
|
||||
" adds r0, r5, 0\n"
|
||||
" bl sub_800915C\n"
|
||||
" adds r4, r0, 0\n"
|
||||
" b _080091C0\n"
|
||||
"_0800923A:\n"
|
||||
" cmp r1, 0x2E\n"
|
||||
" bne _08009246\n"
|
||||
" ldrh r0, [r5]\n"
|
||||
" ldrb r2, [r4, 0x2]\n"
|
||||
" adds r0, r2\n"
|
||||
" b _0800926E\n"
|
||||
"_08009246:\n"
|
||||
" cmp r1, 0x6E\n"
|
||||
" bne _08009258\n"
|
||||
" ldr r0, [r5, 0xC]\n"
|
||||
" strh r0, [r5]\n"
|
||||
" ldrh r0, [r5, 0x2]\n"
|
||||
" adds r0, 0xB\n"
|
||||
" strh r0, [r5, 0x2]\n"
|
||||
" adds r4, 0x2\n"
|
||||
" b _080091C0\n"
|
||||
"_08009258:\n"
|
||||
" cmp r1, 0x3A\n"
|
||||
" bne _08009264\n"
|
||||
" ldrh r0, [r5]\n"
|
||||
" strh r0, [r5, 0x4]\n"
|
||||
" adds r4, 0x2\n"
|
||||
" b _080091C0\n"
|
||||
"_08009264:\n"
|
||||
" cmp r1, 0x3B\n"
|
||||
" bne _08009274\n"
|
||||
" ldrh r0, [r5, 0x4]\n"
|
||||
" ldrb r3, [r4, 0x2]\n"
|
||||
" adds r0, r3\n"
|
||||
"_0800926E:\n"
|
||||
" strh r0, [r5]\n"
|
||||
" adds r4, 0x3\n"
|
||||
" b _080091C0\n"
|
||||
"_08009274:\n"
|
||||
" cmp r1, 0x2B\n"
|
||||
" bne _0800929A\n"
|
||||
" adds r4, 0x2\n"
|
||||
" adds r0, r4, 0\n"
|
||||
" bl sub_8008ED0\n"
|
||||
" mov r2, r8\n"
|
||||
" movs r3, 0x4\n"
|
||||
" ldrsh r1, [r2, r3]\n"
|
||||
" lsls r1, 3\n"
|
||||
" subs r1, r0\n"
|
||||
" strh r1, [r5]\n"
|
||||
" movs r1, 0\n"
|
||||
" ldrsh r0, [r5, r1]\n"
|
||||
" lsrs r1, r0, 31\n"
|
||||
" adds r0, r1\n"
|
||||
" asrs r0, 1\n"
|
||||
" strh r0, [r5]\n"
|
||||
" b _080091C0\n"
|
||||
"_0800929A:\n"
|
||||
" cmp r1, 0x43\n"
|
||||
" bne _080092A4\n"
|
||||
" ldr r0, [r5, 0x10]\n"
|
||||
" str r0, [r5, 0x14]\n"
|
||||
" b _080092DC\n"
|
||||
"_080092A4:\n"
|
||||
" lsls r0, 24\n"
|
||||
" lsrs r0, 24\n"
|
||||
" cmp r0, 0x5F\n"
|
||||
" bne _080092CC\n"
|
||||
" ldr r0, [r5, 0x10]\n"
|
||||
" str r0, [r5, 0x14]\n"
|
||||
" ldr r1, _080092C8\n"
|
||||
" ldrb r0, [r4, 0x2]\n"
|
||||
" adds r0, r1\n"
|
||||
" ldrb r0, [r0]\n"
|
||||
" str r0, [r5, 0x10]\n"
|
||||
"_080092BA:\n"
|
||||
" adds r4, 0x3\n"
|
||||
" ldrb r0, [r4]\n"
|
||||
" cmp r0, 0x2E\n"
|
||||
" beq _080092C4\n"
|
||||
" b _080091C0\n"
|
||||
"_080092C4:\n"
|
||||
" adds r4, 0x1\n"
|
||||
" b _080091C0\n"
|
||||
" .align 2, 0\n"
|
||||
"_080092C8: .4byte gUnknown_202749A\n"
|
||||
"_080092CC:\n"
|
||||
" cmp r0, 0x52\n"
|
||||
" bne _080092D4\n"
|
||||
" ldr r0, [r5, 0x14]\n"
|
||||
" b _080092EE\n"
|
||||
"_080092D4:\n"
|
||||
" cmp r0, 0x63\n"
|
||||
" bne _080092E8\n"
|
||||
" ldr r0, [r5, 0x10]\n"
|
||||
" str r0, [r5, 0x18]\n"
|
||||
"_080092DC:\n"
|
||||
" ldrb r0, [r4, 0x2]\n"
|
||||
" bl InterpretColorChar\n"
|
||||
" str r0, [r5, 0x10]\n"
|
||||
" adds r4, 0x3\n"
|
||||
" b _080091C0\n"
|
||||
"_080092E8:\n"
|
||||
" cmp r0, 0x72\n"
|
||||
" bne _080092F4\n"
|
||||
" ldr r0, [r5, 0x18]\n"
|
||||
"_080092EE:\n"
|
||||
" str r0, [r5, 0x10]\n"
|
||||
" adds r4, 0x2\n"
|
||||
" b _080091C0\n"
|
||||
"_080092F4:\n"
|
||||
" cmp r0, 0x53\n"
|
||||
" bne _08009314\n"
|
||||
" ldr r3, _08009310\n"
|
||||
" ldrb r2, [r4, 0x2]\n"
|
||||
" movs r0, 0x7F\n"
|
||||
" adds r1, r0, 0\n"
|
||||
" ands r1, r2\n"
|
||||
" adds r1, r3\n"
|
||||
" ldrb r2, [r4, 0x3]\n"
|
||||
" ands r0, r2\n"
|
||||
" strb r0, [r1]\n"
|
||||
" adds r4, 0x4\n"
|
||||
" b _080091C0\n"
|
||||
" .align 2, 0\n"
|
||||
"_08009310: .4byte gUnknown_20274A6\n"
|
||||
"_08009314:\n"
|
||||
" cmp r0, 0x57\n"
|
||||
" bne _0800933A\n"
|
||||
" adds r4, 0x2\n"
|
||||
" mov r2, r8\n"
|
||||
" movs r3, 0\n"
|
||||
" ldrsh r0, [r2, r3]\n"
|
||||
" lsls r0, 3\n"
|
||||
" ldrh r1, [r5]\n"
|
||||
" adds r0, r1\n"
|
||||
" subs r0, 0x2\n"
|
||||
" strh r0, [r5, 0x8]\n"
|
||||
" movs r3, 0x2\n"
|
||||
" ldrsh r0, [r2, r3]\n"
|
||||
" lsls r0, 3\n"
|
||||
" ldrh r1, [r5, 0x2]\n"
|
||||
" adds r0, r1\n"
|
||||
" adds r0, 0x3\n"
|
||||
" strh r0, [r5, 0xA]\n"
|
||||
" b _0800935C\n"
|
||||
"_0800933A:\n"
|
||||
" cmp r0, 0x50\n"
|
||||
" bne _08009350\n"
|
||||
" adds r4, 0x2\n"
|
||||
" ldr r0, _0800934C\n"
|
||||
" strh r0, [r5, 0x2]\n"
|
||||
" mov r2, r9\n"
|
||||
" str r2, [r5, 0x1C]\n"
|
||||
" b _0800935C\n"
|
||||
" .align 2, 0\n"
|
||||
"_0800934C: .4byte 0x0000270f\n"
|
||||
"_08009350:\n"
|
||||
" cmp r0, 0x70\n"
|
||||
" bne _08009368\n"
|
||||
" adds r4, 0x2\n"
|
||||
" ldr r0, _08009364\n"
|
||||
" strh r0, [r5, 0x2]\n"
|
||||
" str r7, [r5, 0x1C]\n"
|
||||
"_0800935C:\n"
|
||||
" adds r0, r5, 0\n"
|
||||
" adds r0, 0x20\n"
|
||||
" strb r7, [r0]\n"
|
||||
" b _0800937A\n"
|
||||
" .align 2, 0\n"
|
||||
"_08009364: .4byte 0x0000270f\n"
|
||||
"_08009368:\n"
|
||||
" cmp r0, 0x7E\n"
|
||||
" bne _0800937A\n"
|
||||
" ldrb r0, [r4, 0x2]\n"
|
||||
" str r0, [r5, 0x2C]\n"
|
||||
" adds r0, r5, 0\n"
|
||||
" adds r0, 0x21\n"
|
||||
" strb r7, [r0]\n"
|
||||
" adds r4, 0x3\n"
|
||||
" b _080091C0\n"
|
||||
"_0800937A:\n"
|
||||
" adds r0, r4, 0\n"
|
||||
" pop {r3,r4}\n"
|
||||
" mov r8, r3\n"
|
||||
" mov r9, r4\n"
|
||||
" pop {r4-r7}\n"
|
||||
" pop {r1}\n"
|
||||
" bx r1\n");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
extern s32 gUnknown_202B020;
|
||||
extern s32 gUnknown_202B024;
|
||||
|
||||
void sub_8009388(void)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
gUnknown_202B038[0][0][0] = 0xF279;
|
||||
gUnknown_202B038[1][0][0] = 0xF27A;
|
||||
for (i = gUnknown_202B020; i < gUnknown_202B024; i++) {
|
||||
gUnknown_202B038[0][i][0] = 0xF279;
|
||||
gUnknown_202B038[1][i][0] = 0xF27A;
|
||||
for (j = 1; j < 32; j++) {
|
||||
gUnknown_202B038[0][i][j] = 0;
|
||||
gUnknown_202B038[1][i][j] = 0xF27A;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8009408(s32 from, s32 to)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
gUnknown_202B038[0][0][0] = 0xF279;
|
||||
gUnknown_202B038[1][0][0] = 0xF27A;
|
||||
for (i = from; i < to; i++) {
|
||||
gUnknown_202B038[0][i][0] = 0xF279;
|
||||
gUnknown_202B038[1][i][0] = 0xF27A;
|
||||
for (j = 1; j < 32; j++) {
|
||||
gUnknown_202B038[0][i][j] = 0;
|
||||
gUnknown_202B038[1][i][j] = 0xF27A;
|
||||
}
|
||||
}
|
||||
gUnknown_20274A5 = 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user