Mostly decompile text.s

This commit is contained in:
Diegoisawesome 2017-03-27 19:30:49 -05:00
parent 1d95689766
commit 5a8eeb353d
27 changed files with 2795 additions and 3869 deletions

View File

@ -2883,7 +2883,7 @@ _0814FA36:
_0814FAC6: _0814FAC6:
cmp r7, 0x16 cmp r7, 0x16
bne _0814FAE0 bne _0814FAE0
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r2, [r0] ldrb r2, [r0]
movs r1, 0x3 movs r1, 0x3
negs r1, r1 negs r1, r1
@ -2891,7 +2891,7 @@ _0814FAC6:
b _0814FAE8 b _0814FAE8
.pool .pool
_0814FAE0: _0814FAE0:
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r2, 0x2 movs r2, 0x2
orrs r1, r2 orrs r1, r2
@ -2949,7 +2949,7 @@ _0814FB54:
lsls r0, 24 lsls r0, 24
lsrs r6, r0, 24 lsrs r6, r0, 24
_0814FB5C: _0814FB5C:
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r2, 0x1 movs r2, 0x1
orrs r1, r2 orrs r1, r2

View File

@ -166,7 +166,7 @@ sub_80D77E4: @ 80D77E4
ands r0, r1 ands r0, r1
cmp r0, 0 cmp r0, 0
beq _080D7818 beq _080D7818
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x2 movs r0, 0x2
negs r0, r0 negs r0, r0
@ -175,7 +175,7 @@ sub_80D77E4: @ 80D77E4
b _080D7822 b _080D7822
.pool .pool
_080D7818: _080D7818:
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r2, 0x1 movs r2, 0x1
orrs r1, r2 orrs r1, r2

View File

@ -2893,7 +2893,7 @@ sub_807109C: @ 807109C
adds r0, r2, 0 adds r0, r2, 0
ands r0, r1 ands r0, r1
strb r0, [r3, 0xC] strb r0, [r3, 0xC]
ldr r3, =gUnknown_03003014 ldr r3, =gTextFlags
ldrb r1, [r3] ldrb r1, [r3]
movs r0, 0x3 movs r0, 0x3
negs r0, r0 negs r0, r0

View File

@ -960,7 +960,7 @@ sub_813E1D4: @ 813E1D4
strh r0, [r1] strh r0, [r1]
ldr r0, =gUnknown_02022E22 ldr r0, =gUnknown_02022E22
strh r4, [r0] strh r4, [r0]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x2 movs r1, 0x2
orrs r0, r1 orrs r0, r1
@ -2939,7 +2939,7 @@ _0813F634:
ldr r0, [r4] ldr r0, [r4]
bl Free bl Free
str r5, [r4] str r5, [r4]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x3 movs r0, 0x3
negs r0, r0 negs r0, r0

View File

@ -10,7 +10,7 @@ sub_8098128: @ 8098128
ldr r1, =gUnknown_020375BC ldr r1, =gUnknown_020375BC
movs r0, 0 movs r0, 0
strb r0, [r1] strb r0, [r1]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x2 movs r0, 0x2
negs r0, r0 negs r0, r0

View File

@ -26532,7 +26532,7 @@ sub_80173E0: @ 80173E0
negs r0, r0 negs r0, r0
ands r0, r1 ands r0, r1
strb r0, [r2, 0xC] strb r0, [r2, 0xC]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x3 movs r0, 0x3
negs r0, r0 negs r0, r0
@ -45458,7 +45458,7 @@ _08020C26:
ldr r0, =c2_exit_to_overworld_2_switch ldr r0, =c2_exit_to_overworld_2_switch
cmp r4, r0 cmp r4, r0
bne _08020C5A bne _08020C5A
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x4 movs r1, 0x4
orrs r0, r1 orrs r0, r1
@ -45585,7 +45585,7 @@ _08020D10:
bl CreateTask bl CreateTask
ldr r1, [r6] ldr r1, [r6]
strb r0, [r1, 0xA] strb r0, [r1, 0xA]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x5 movs r0, 0x5
negs r0, r0 negs r0, r0

View File

@ -139,7 +139,7 @@ DisplayMessageAndContinueTask: @ 8121E7C
ldr r1, [sp, 0x30] ldr r1, [sp, 0x30]
bl StringExpandPlaceholders bl StringExpandPlaceholders
_08121EC0: _08121EC0:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x1 movs r1, 0x1
orrs r0, r1 orrs r0, r1

View File

@ -899,7 +899,7 @@ _080E3586:
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
bl sub_81973C4 bl sub_81973C4
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x1 movs r1, 0x1
orrs r0, r1 orrs r0, r1

View File

@ -735,7 +735,7 @@ _0817A260:
ldr r1, =gUnknown_085E93A9 ldr r1, =gUnknown_085E93A9
bl StringExpandPlaceholders bl StringExpandPlaceholders
_0817A268: _0817A268:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x1 movs r1, 0x1
orrs r0, r1 orrs r0, r1

View File

@ -32554,7 +32554,7 @@ sub_81965D8: @ 81965D8
movs r0, 0xE0 movs r0, 0xE0
orrs r1, r0 orrs r1, r0
strb r1, [r2, 0xD] strb r1, [r2, 0xD]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x3 movs r0, 0x3
negs r0, r0 negs r0, r0
@ -32583,7 +32583,7 @@ sub_8196648: @ 8196648
ands r0, r1 ands r0, r1
cmp r0, 0 cmp r0, 0
beq _0819666C beq _0819666C
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r2, 0x1 movs r2, 0x1
orrs r1, r2 orrs r1, r2
@ -32591,7 +32591,7 @@ sub_8196648: @ 8196648
b _08196678 b _08196678
.pool .pool
_0819666C: _0819666C:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x2 movs r0, 0x2
negs r0, r0 negs r0, r0
@ -34182,7 +34182,7 @@ AddTextPrinterParametrized: @ 8197238
ands r1, r4 ands r1, r4
orrs r1, r6 orrs r1, r6
strb r1, [r0, 0xD] strb r1, [r0, 0xD]
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x3 movs r0, 0x3
negs r0, r0 negs r0, r0
@ -34211,7 +34211,7 @@ AddTextPrinterForMessage: @ 81972C4
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r5, 0 movs r5, 0
ldr r3, =gUnknown_03003014 ldr r3, =gTextFlags
movs r4, 0x1 movs r4, 0x1
ands r0, r4 ands r0, r4
ldrb r2, [r3] ldrb r2, [r3]
@ -34248,7 +34248,7 @@ AddTextPrinterForMessage_2: @ 8197310
sub sp, 0x10 sub sp, 0x10
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r3, =gUnknown_03003014 ldr r3, =gTextFlags
movs r4, 0x1 movs r4, 0x1
ands r0, r4 ands r0, r4
ldrb r2, [r3] ldrb r2, [r3]
@ -34289,7 +34289,7 @@ AddTextPrinterWithCustomSpeedForMessage: @ 819735C
lsrs r0, 24 lsrs r0, 24
lsls r3, 24 lsls r3, 24
lsrs r3, 24 lsrs r3, 24
ldr r4, =gUnknown_03003014 ldr r4, =gTextFlags
movs r5, 0x1 movs r5, 0x1
ands r0, r5 ands r0, r5
ldrb r2, [r4] ldrb r2, [r4]
@ -35036,7 +35036,7 @@ sub_8197948: @ 8197948
thumb_func_start sub_8197964 thumb_func_start sub_8197964
sub_8197964: @ 8197964 sub_8197964: @ 8197964
push {lr} push {lr}
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r0, 0x8 movs r0, 0x8
ands r0, r1 ands r0, r1
@ -35218,7 +35218,7 @@ AddTextPrinterWithCallbackForMessage: @ 8197A9C
adds r5, r1, 0 adds r5, r1, 0
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r3, =gUnknown_03003014 ldr r3, =gTextFlags
movs r4, 0x1 movs r4, 0x1
ands r0, r4 ands r0, r4
ldrb r2, [r3] ldrb r2, [r3]
@ -82275,7 +82275,7 @@ _081B017A:
movs r0, 0 movs r0, 0
strb r0, [r6, 0x9] strb r0, [r6, 0x9]
_081B017E: _081B017E:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x5 movs r0, 0x5
negs r0, r0 negs r0, r0
@ -88278,7 +88278,7 @@ sub_81B3300: @ 81B3300
movs r2, 0x4F movs r2, 0x4F
movs r3, 0xD movs r3, 0xD
bl SetWindowBorderStyle bl SetWindowBorderStyle
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x1 movs r1, 0x1
orrs r0, r1 orrs r0, r1
@ -101186,7 +101186,7 @@ _081BA2A6:
beq _081BA2E8 beq _081BA2E8
subs r0, r1, 0x1 subs r0, r1, 0x1
strb r0, [r6, 0x1E] strb r0, [r6, 0x1E]
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r0, 0x1 movs r0, 0x1
ands r0, r1 ands r0, r1
@ -101210,7 +101210,7 @@ _081BA2D0:
b _081BA50E b _081BA50E
.pool .pool
_081BA2E8: _081BA2E8:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x4 movs r0, 0x4
ands r0, r1 ands r0, r1

View File

@ -32680,7 +32680,7 @@ sub_81CC194: @ 81CC194
ands r0, r1 ands r0, r1
cmp r0, 0 cmp r0, 0
beq _081CC1B8 beq _081CC1B8
ldr r0, =gUnknown_03003014 ldr r0, =gTextFlags
ldrb r1, [r0] ldrb r1, [r0]
movs r2, 0x1 movs r2, 0x1
orrs r1, r2 orrs r1, r2
@ -32688,7 +32688,7 @@ sub_81CC194: @ 81CC194
b _081CC1C4 b _081CC1C4
.pool .pool
_081CC1B8: _081CC1B8:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r1, [r2] ldrb r1, [r2]
movs r0, 0x2 movs r0, 0x2
negs r0, r0 negs r0, r0
@ -46190,7 +46190,7 @@ sub_81D2BF4: @ 81D2BF4
movs r0, 0x3 movs r0, 0x3
movs r1, 0x11 movs r1, 0x11
bl FillWindowPixelBuffer bl FillWindowPixelBuffer
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x1 movs r1, 0x1
orrs r0, r1 orrs r0, r1
@ -63097,7 +63097,7 @@ sub_81DB620: @ 81DB620
lsls r4, r0, 1 lsls r4, r0, 1
adds r4, r0 adds r4, r0
lsls r4, 2 lsls r4, 2
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
adds r4, r0 adds r4, r0
lsls r7, r3, 5 lsls r7, r3, 5
ldrb r0, [r4, 0x3] ldrb r0, [r4, 0x3]

View File

@ -3300,7 +3300,7 @@ s9B_unknown: @ 809AC0C
bne _0809AC1C bne _0809AC1C
ldr r3, [r4, 0x64] ldr r3, [r4, 0x64]
_0809AC1C: _0809AC1C:
ldr r2, =gUnknown_03003014 ldr r2, =gTextFlags
ldrb r0, [r2] ldrb r0, [r2]
movs r1, 0x4 movs r1, 0x4
orrs r0, r1 orrs r0, r1

3592
asm/text.s

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ _080031E4:
ldr r0, =gDummyWindowTemplate ldr r0, =gDummyWindowTemplate
ldr r2, [r0] ldr r2, [r0]
ldr r3, [r0, 0x4] ldr r3, [r0, 0x4]
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
movs r0, 0 movs r0, 0
movs r4, 0x1F movs r4, 0x1F
mov r8, r4 mov r8, r4
@ -165,7 +165,7 @@ _080032CA:
b _08003250 b _08003250
.pool .pool
_0800330C: _0800330C:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
adds r0, r1, 0 adds r0, r1, 0
adds r0, 0x8 adds r0, 0x8
ldr r2, [sp, 0x4] ldr r2, [sp, 0x4]
@ -233,7 +233,7 @@ AddWindow: @ 8003380
sub sp, 0x4 sub sp, 0x4
mov r8, r0 mov r8, r0
movs r6, 0 movs r6, 0
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
ldrb r0, [r1] ldrb r0, [r1]
cmp r0, 0xFF cmp r0, 0xFF
beq _080033B0 beq _080033B0
@ -346,7 +346,7 @@ _0800346A:
b _080034C0 b _080034C0
.pool .pool
_08003484: _08003484:
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r6, 1 lsls r1, r6, 1
adds r1, r6 adds r1, r6
lsls r1, 2 lsls r1, 2
@ -394,7 +394,7 @@ AddWindowWithoutTileMap: @ 80034D8
push {r4-r6,lr} push {r4-r6,lr}
adds r5, r0, 0 adds r5, r0, 0
movs r4, 0 movs r4, 0
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
ldrb r0, [r1] ldrb r0, [r1]
cmp r0, 0xFF cmp r0, 0xFF
beq _080034FE beq _080034FE
@ -437,7 +437,7 @@ _08003528:
b _08003564 b _08003564
.pool .pool
_08003534: _08003534:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r4, 1 lsls r0, r4, 1
adds r0, r4 adds r0, r4
lsls r0, 2 lsls r0, 2
@ -474,7 +474,7 @@ RemoveWindow: @ 8003574
push {r4-r7,lr} push {r4-r7,lr}
lsls r0, 24 lsls r0, 24
lsrs r6, r0, 24 lsrs r6, r0, 24
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r6, 1 lsls r0, r6, 1
adds r0, r6 adds r0, r6
lsls r0, 2 lsls r0, 2
@ -515,7 +515,7 @@ _080035A0:
bl Free bl Free
str r5, [r4] str r5, [r4]
_080035CE: _080035CE:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r6, 1 lsls r0, r6, 1
adds r0, r6 adds r0, r6
lsls r0, 2 lsls r0, 2
@ -556,7 +556,7 @@ _08003620:
subs r5, 0x1 subs r5, 0x1
cmp r5, 0 cmp r5, 0
bge _0800360A bge _0800360A
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
adds r4, r0, 0 adds r4, r0, 0
adds r4, 0x8 adds r4, 0x8
movs r6, 0 movs r6, 0
@ -588,7 +588,7 @@ CopyWindowToVram: @ 8003658
lsls r1, 24 lsls r1, 24
lsrs r3, r1, 24 lsrs r3, r1, 24
adds r5, r3, 0 adds r5, r3, 0
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -661,7 +661,7 @@ CopyWindowRectToVram: @ 80036D8
beq _08003782 beq _08003782
cmp r3, 0 cmp r3, 0
beq _08003782 beq _08003782
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r0, r6, 1 lsls r0, r6, 1
adds r0, r6 adds r0, r6
lsls r0, 2 lsls r0, 2
@ -747,7 +747,7 @@ PutWindowTilemap: @ 800378C
sub sp, 0x1C sub sp, 0x1C
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -818,7 +818,7 @@ PutWindowRectTilemapOverridePalette: @ 80037EC
lsls r5, 24 lsls r5, 24
lsrs r5, 24 lsrs r5, 24
str r5, [sp, 0x20] str r5, [sp, 0x20]
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -892,7 +892,7 @@ ClearWindowTilemap: @ 80038A4
sub sp, 0x18 sub sp, 0x18
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -949,7 +949,7 @@ PutWindowRectTilemap: @ 80038F4
lsls r4, 24 lsls r4, 24
lsrs r4, 24 lsrs r4, 24
mov r8, r4 mov r8, r4
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -1097,7 +1097,7 @@ BlitBitmapRectToWindow: @ 80039DC
lsrs r4, 16 lsrs r4, 16
orrs r4, r5 orrs r4, r5
str r4, [sp, 0x18] str r4, [sp, 0x18]
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r5, r0, 1 lsls r5, r0, 1
adds r5, r0 adds r5, r0
lsls r5, 2 lsls r5, 2
@ -1194,7 +1194,7 @@ BlitBitmapRectToWindowWithColorKey: @ 8003A9C
lsrs r4, 16 lsrs r4, 16
orrs r4, r5 orrs r4, r5
str r4, [sp, 0x18] str r4, [sp, 0x18]
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r5, r0, 1 lsls r5, r0, 1
adds r5, r0 adds r5, r0
lsls r5, 2 lsls r5, 2
@ -1268,7 +1268,7 @@ FillWindowPixelRect: @ 8003B64
lsls r4, 16 lsls r4, 16
lsrs r4, 16 lsrs r4, 16
mov r8, r4 mov r8, r4
ldr r5, =gUnknown_02020004 ldr r5, =gWindows
lsls r4, r0, 1 lsls r4, r0, 1
adds r4, r0 adds r4, r0
lsls r4, 2 lsls r4, 2
@ -1320,7 +1320,7 @@ CopyToWindowPixelBuffer: @ 8003BF0
lsrs r2, r3, 16 lsrs r2, r3, 16
cmp r5, 0 cmp r5, 0
beq _08003C24 beq _08003C24
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r4, 1 lsls r0, r4, 1
adds r0, r4 adds r0, r4
lsls r0, 2 lsls r0, 2
@ -1335,7 +1335,7 @@ CopyToWindowPixelBuffer: @ 8003BF0
b _08003C3C b _08003C3C
.pool .pool
_08003C24: _08003C24:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r4, 1 lsls r0, r4, 1
adds r0, r4 adds r0, r4
lsls r0, 2 lsls r0, 2
@ -1362,7 +1362,7 @@ FillWindowPixelBuffer: @ 8003C48
lsrs r0, 24 lsrs r0, 24
lsls r1, 24 lsls r1, 24
lsrs r1, 24 lsrs r1, 24
ldr r5, =gUnknown_02020004 ldr r5, =gWindows
lsls r4, r0, 1 lsls r4, r0, 1
adds r4, r0 adds r4, r0
lsls r4, 2 lsls r4, 2
@ -1412,7 +1412,7 @@ ScrollWindow: @ 8003C94
str r2, [sp] str r2, [sp]
lsls r3, 24 lsls r3, 24
lsrs r3, 24 lsrs r3, 24
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -1929,7 +1929,7 @@ CallWindowFunction: @ 8004058
mov r8, r1 mov r8, r1
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -1988,7 +1988,7 @@ _080040C4:
.4byte _08004120 .4byte _08004120
.4byte _08004134 .4byte _08004134
_080040E4: _080040E4:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r3, 1 lsls r0, r3, 1
adds r0, r3 adds r0, r3
lsls r0, 2 lsls r0, 2
@ -1998,7 +1998,7 @@ _080040E4:
b _08004144 b _08004144
.pool .pool
_080040F8: _080040F8:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r3, 1 lsls r0, r3, 1
adds r0, r3 adds r0, r3
lsls r0, 2 lsls r0, 2
@ -2008,7 +2008,7 @@ _080040F8:
b _08004144 b _08004144
.pool .pool
_0800410C: _0800410C:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r3, 1 lsls r0, r3, 1
adds r0, r3 adds r0, r3
lsls r0, 2 lsls r0, 2
@ -2018,7 +2018,7 @@ _0800410C:
b _08004144 b _08004144
.pool .pool
_08004120: _08004120:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r3, 1 lsls r0, r3, 1
adds r0, r3 adds r0, r3
lsls r0, 2 lsls r0, 2
@ -2028,7 +2028,7 @@ _08004120:
b _08004144 b _08004144
.pool .pool
_08004134: _08004134:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r0, r3, 1 lsls r0, r3, 1
adds r0, r3 adds r0, r3
lsls r0, 2 lsls r0, 2
@ -2070,7 +2070,7 @@ _08004168:
.4byte _08004200 .4byte _08004200
.4byte _08004214 .4byte _08004214
_08004188: _08004188:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2079,7 +2079,7 @@ _08004188:
b _0800422A b _0800422A
.pool .pool
_0800419C: _0800419C:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2088,7 +2088,7 @@ _0800419C:
b _0800422A b _0800422A
.pool .pool
_080041B0: _080041B0:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2097,7 +2097,7 @@ _080041B0:
b _0800422A b _0800422A
.pool .pool
_080041C4: _080041C4:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2106,7 +2106,7 @@ _080041C4:
b _0800422A b _0800422A
.pool .pool
_080041D8: _080041D8:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2115,7 +2115,7 @@ _080041D8:
b _0800422A b _0800422A
.pool .pool
_080041EC: _080041EC:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2124,7 +2124,7 @@ _080041EC:
b _0800422A b _0800422A
.pool .pool
_08004200: _08004200:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2133,7 +2133,7 @@ _08004200:
b _0800422A b _0800422A
.pool .pool
_08004214: _08004214:
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
lsls r1, r2, 1 lsls r1, r2, 1
adds r1, r2 adds r1, r2
lsls r1, 2 lsls r1, 2
@ -2156,7 +2156,7 @@ GetNumActiveWindowsOnBg: @ 8004230
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
movs r3, 0 movs r3, 0
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
movs r1, 0x1F movs r1, 0x1F
_0800423C: _0800423C:
ldrb r0, [r2] ldrb r0, [r2]
@ -2192,7 +2192,7 @@ AddWindow8Bit: @ 8004260
push {r5-r7} push {r5-r7}
mov r9, r0 mov r9, r0
movs r6, 0 movs r6, 0
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
ldrb r0, [r1] ldrb r0, [r1]
cmp r0, 0xFF cmp r0, 0xFF
beq _0800428E beq _0800428E
@ -2286,7 +2286,7 @@ _08004322:
b _08004356 b _08004356
.pool .pool
_08004338: _08004338:
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r2, r6, 1 lsls r2, r6, 1
adds r2, r6 adds r2, r6
lsls r2, 2 lsls r2, 2
@ -2320,7 +2320,7 @@ FillWindowPixelBuffer8Bit: @ 8004368
lsrs r0, 24 lsrs r0, 24
lsls r1, 24 lsls r1, 24
lsrs r5, r1, 24 lsrs r5, r1, 24
ldr r6, =gUnknown_02020004 ldr r6, =gWindows
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r4, r1, 2 lsls r4, r1, 2
@ -2378,7 +2378,7 @@ FillWindowPixelRect8Bit: @ 80043A8
lsls r4, 16 lsls r4, 16
lsrs r4, 16 lsrs r4, 16
mov r8, r4 mov r8, r4
ldr r5, =gUnknown_02020004 ldr r5, =gWindows
lsls r4, r0, 1 lsls r4, r0, 1
adds r4, r0 adds r4, r0
lsls r4, 2 lsls r4, 2
@ -2470,7 +2470,7 @@ BlitBitmapRectToWindow4BitTo8Bit: @ 8004434
lsrs r4, 16 lsrs r4, 16
orrs r4, r5 orrs r4, r5
str r4, [sp, 0x1C] str r4, [sp, 0x1C]
ldr r1, =gUnknown_02020004 ldr r1, =gWindows
lsls r5, r0, 1 lsls r5, r0, 1
adds r5, r0 adds r5, r0
lsls r5, 2 lsls r5, 2
@ -2531,7 +2531,7 @@ CopyWindowToVram8Bit: @ 8004500
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
ldr r0, =gUnknown_02020004 ldr r0, =gWindows
adds r3, r1, r0 adds r3, r1, r0
str r3, [r6] str r3, [r6]
ldr r4, =gUnknown_02020188 ldr r4, =gUnknown_02020188
@ -2585,7 +2585,7 @@ GetNumActiveWindowsOnBg8Bit: @ 8004578
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
movs r3, 0 movs r3, 0
ldr r2, =gUnknown_02020004 ldr r2, =gWindows
movs r1, 0x1F movs r1, 0x1F
_08004584: _08004584:
ldrb r0, [r2] ldrb r0, [r2]

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

View File

@ -1,94 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
gFontHalfRowOffsets:: @ 82E958C
.byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00
.byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09
.byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12
.byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00
.byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b
.byte 0x24,0x25,0x26,0x24,0x27,0x28,0x29,0x27,0x2a,0x2b,0x2c,0x2a,0x24,0x25,0x26,0x24
.byte 0x2d,0x2e,0x2f,0x2d,0x30,0x31,0x32,0x30,0x33,0x34,0x35,0x33,0x2d,0x2e,0x2f,0x2d
.byte 0x1b,0x1c,0x1d,0x1b,0x1e,0x1f,0x20,0x1e,0x21,0x22,0x23,0x21,0x1b,0x1c,0x1d,0x1b
.byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36
.byte 0x3f,0x40,0x41,0x3f,0x42,0x43,0x44,0x42,0x45,0x46,0x47,0x45,0x3f,0x40,0x41,0x3f
.byte 0x48,0x49,0x4a,0x48,0x4b,0x4c,0x4d,0x4b,0x4e,0x4f,0x50,0x4e,0x48,0x49,0x4a,0x48
.byte 0x36,0x37,0x38,0x36,0x39,0x3a,0x3b,0x39,0x3c,0x3d,0x3e,0x3c,0x36,0x37,0x38,0x36
.byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00
.byte 0x09,0x0a,0x0b,0x09,0x0c,0x0d,0x0e,0x0c,0x0f,0x10,0x11,0x0f,0x09,0x0a,0x0b,0x09
.byte 0x12,0x13,0x14,0x12,0x15,0x16,0x17,0x15,0x18,0x19,0x1a,0x18,0x12,0x13,0x14,0x12
.byte 0x00,0x01,0x02,0x00,0x03,0x04,0x05,0x03,0x06,0x07,0x08,0x06,0x00,0x01,0x02,0x00
gDownArrowTiles:: @ 82E968C
.incbin "baserom.gba", 0x2e968c, 0xc0
gDarkDownArrowTiles:: @ 82E974C
.incbin "baserom.gba", 0x2e974c, 0xc0
@ Seemingly unreferenced data. It contains some kind of arrow graphics.
.incbin "baserom.gba", 0x2e980c, 0x500
gDownArrowYCoords:: @ 82E9D0C
.byte 0, 1, 2, 1
gWindowVerticalScrollSpeeds:: @ 82E9D10
.byte 1, 2, 4, 0
gGlyphWidthFuncs:: @ 82E9D14
glyph_width_func 0, GetGlyphWidthFont0+1
glyph_width_func 1, GetGlyphWidthFont1+1
glyph_width_func 2, GetGlyphWidthFont2+1
glyph_width_func 3, GetGlyphWidthFont2+1
glyph_width_func 4, GetGlyphWidthFont2+1
glyph_width_func 5, GetGlyphWidthFont2+1
glyph_width_func 6, GetGlyphWidthFont6+1
glyph_width_func 7, GetGlyphWidthFont7+1
glyph_width_func 8, GetGlyphWidthFont8+1
gKeypadIcons:: @ 82E9D5C
keypad_icon 0x0, 8, 12
keypad_icon 0x1, 8, 12
keypad_icon 0x2, 16, 12
keypad_icon 0x4, 16, 12
keypad_icon 0x6, 24, 12
keypad_icon 0x9, 24, 12
keypad_icon 0xC, 8, 12
keypad_icon 0xD, 8, 12
keypad_icon 0xE, 8, 12
keypad_icon 0xF, 8, 12
keypad_icon 0x20, 8, 12
keypad_icon 0x21, 8, 12
keypad_icon 0x22, 8, 12
gKeypadIconTiles:: @ 82E9D90
.incbin "baserom.gba", 0x2e9d90, 0x800
gFontInfos:: @ 82EA590
font_info Font0Func+1, 5, 12, 0, 0, 2, 3, 1
font_info Font1Func+1, 6, 16, 0, 0, 2, 3, 1
font_info Font2Func+1, 6, 14, 0, 0, 2, 3, 1
font_info Font3Func+1, 6, 14, 0, 0, 2, 3, 1
font_info Font4Func+1, 6, 14, 0, 0, 2, 3, 1
font_info Font5Func+1, 6, 14, 0, 0, 2, 3, 1
font_info Font6Func+1, 8, 16, 0, 8, 2, 3, 1
font_info Font7Func+1, 5, 16, 0, 0, 2, 3, 1
font_info Font8Func+1, 5, 8, 0, 0, 2, 3, 1
font_info 0, 8, 8, 0, 0, 1, 15, 2
gMenuCursorDimensions:: @ 82EA608
.byte 8, 12
.byte 8, 15
.byte 8, 14
.byte 8, 14
.byte 8, 14
.byte 8, 14
.byte 8, 16
.byte 8, 15
.byte 8, 8
.byte 0, 0
.align 2
gFont9JapaneseGlyphs:: @ 82EA61C
.incbin "data/graphics/fonts/font9.hwjpnfont"

View File

@ -266,6 +266,21 @@ $(fontdir)/unused_frlg_male.fwjpnfont: $(fontdir)/unused_japanese_frlg_male_font
$(fontdir)/unused_frlg_female.fwjpnfont: $(fontdir)/unused_japanese_frlg_female_font.png $(fontdir)/unused_frlg_female.fwjpnfont: $(fontdir)/unused_japanese_frlg_female_font.png
$(GFX) $< $@ $(GFX) $< $@
$(fontdir)/down_arrow.4bpp: $(fontdir)/down_arrow.png
$(GFX) $< $@
$(fontdir)/down_arrow_rs.4bpp: $(fontdir)/down_arrow_rs.png
$(GFX) $< $@
$(fontdir)/unused_frlg_blanked_down_arrow.4bpp: $(fontdir)/unused_frlg_blanked_down_arrow.png
$(GFX) $< $@
$(fontdir)/unused_frlg_down_arrow.4bpp: $(fontdir)/unused_frlg_down_arrow.png
$(GFX) $< $@
$(fontdir)/keypad_icons.4bpp: $(fontdir)/keypad_icons.png
$(GFX) $< $@
graphics/title_screen/pokemon_logo.gbapal: graphics/title_screen/pokemon_logo.pal graphics/title_screen/pokemon_logo.gbapal: graphics/title_screen/pokemon_logo.pal
$(GFX) $< $@ -num_colors 224 $(GFX) $< $@ -num_colors 224

View File

@ -12,41 +12,56 @@
#define EOS 0xFF // end of string #define EOS 0xFF // end of string
#define NUM_TEXT_PRINTERS 32 #define NUM_TEXT_PRINTERS 32
#define NUM_WINDOWS 20
struct TextWindow { struct Window
u8* current_text_offset; {
u8 windowId; u8 priority;
u8 fontId; u8 tilemapLeft;
u8 x; u8 tilemapTop;
u8 y; u8 width;
u8 currentX; // 0x8 u8 height;
u8 currentY; u8 paletteNum;
u8 letterSpacing; u16 baseBlock;
u8 lineSpacing; u8 *tileData;
u8 fontColor_l:4; // 0xC
u8 fontColor_h:4;
u8 bgColor:4;
u8 shadowColor:4;
}; };
struct TextPrinter struct TextPrinter
{ {
struct TextWindow window; struct TextSubPrinter { // TODO: Better name
u8* current_text_offset;
u8 windowId;
u8 fontId;
u8 x;
u8 y;
u8 currentX; // 0x8
u8 currentY;
u8 letterSpacing;
u8 lineSpacing;
u8 fontColor_l:4; // 0xC
u8 fontColor_h:4;
u8 bgColor:4;
u8 shadowColor:4;
} subPrinter;
void (*callback)(struct TextWindow *, u16); // 0x10 void (*callback)(struct TextSubPrinter *, u16); // 0x10
union { union {
struct struct TextPrinterSubStruct
{ {
u8 field_0; // 0x14 u8 font_type:4; // 0x14
u8 field_1; u8 font_type_upper:4;
u8 field_2; u8 field_1:5;
u8 field_1_upmid:2;
u8 field_1_top:1;
u8 frames_visible_counter;
u8 field_3; u8 field_3;
u8 field_4; // 0x18 u8 field_4; // 0x18
u8 field_5; u8 field_5;
u8 field_6; u8 field_6;
u8 active; u8 active;
} sub; } sub;
u8 sub_fields[8]; u8 sub_fields[8];
} sub_union; } sub_union;
@ -71,4 +86,27 @@ struct FontInfo
u8 shadowColor:4; u8 shadowColor:4;
}; };
struct Bitmap // TODO: Find a better spot for this
{
u8* pixels;
u32 width:16;
u32 height:16;
};
struct GlyphWidthFunc{
u32 font_id;
u32 (*func)(u16 glyphId, bool32 isJapanese);
};
struct KeypadIcon {
u16 tile_offset;
u8 width;
u8 height;
};
extern u8 gStringVar1[];
extern u8 gStringVar2[];
extern u8 gStringVar3[];
extern u8 gStringVar4[];
#endif // GUARD_TEXT_H #endif // GUARD_TEXT_H

View File

@ -49,7 +49,6 @@ SECTIONS {
asm/blit.o(.text); asm/blit.o(.text);
asm/window.o(.text); asm/window.o(.text);
src/text.o(.text); src/text.o(.text);
asm/text.o(.text);
asm/sprite.o(.text); asm/sprite.o(.text);
src/string_util.o(.text); src/string_util.o(.text);
asm/link.o(.text); asm/link.o(.text);
@ -256,7 +255,7 @@ SECTIONS {
src/main.o(.rodata); src/main.o(.rodata);
data/bg.o(.rodata); data/bg.o(.rodata);
data/window.o(.rodata); data/window.o(.rodata);
data/text.o(.rodata); src/text.o(.rodata);
data/sprite.o(.rodata); data/sprite.o(.rodata);
src/string_util.o(.rodata); src/string_util.o(.rodata);
data/data2.o(.rodata); data/data2.o(.rodata);

View File

@ -352,42 +352,42 @@ u8 *StringExpandPlaceholders(u8 *dest, const u8 *src)
switch (c) switch (c)
{ {
case PLACEHOLDER_BEGIN: case PLACEHOLDER_BEGIN:
placeholderId = *src++; placeholderId = *src++;
expandedString = GetExpandedPlaceholder(placeholderId); expandedString = GetExpandedPlaceholder(placeholderId);
dest = StringExpandPlaceholders(dest, expandedString); dest = StringExpandPlaceholders(dest, expandedString);
break;
case EXT_CTRL_CODE_BEGIN:
*dest++ = c;
c = *src++;
*dest++ = c;
switch (c)
{
case 0x07:
case 0x09:
case 0x0F:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
break; break;
case 0x04: case EXT_CTRL_CODE_BEGIN:
*dest++ = *src++; *dest++ = c;
case 0x0B: c = *src++;
*dest++ = *src++; *dest++ = c;
switch (c)
{
case 0x07:
case 0x09:
case 0x0F:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
break;
case 0x04:
*dest++ = *src++;
case 0x0B:
*dest++ = *src++;
default:
*dest++ = *src++;
}
break;
case EOS:
*dest = EOS;
return dest;
case 0xFA:
case 0xFB:
case 0xFE:
default: default:
*dest++ = *src++; *dest++ = c;
}
break;
case EOS:
*dest = EOS;
return dest;
case 0xFA:
case 0xFB:
case 0xFE:
default:
*dest++ = c;
} }
} }
} }
@ -405,16 +405,16 @@ u8 *StringBraille(u8 *dest, const u8 *src)
switch (c) switch (c)
{ {
case EOS: case EOS:
*dest = c; *dest = c;
return dest; return dest;
case 0xFE: case 0xFE:
dest = StringCopy(dest, gotoLine2); dest = StringCopy(dest, gotoLine2);
break; break;
default: default:
*dest++ = c; *dest++ = c;
*dest++ = c + 0x40; *dest++ = c + 0x40;
break; break;
} }
} }
} }

2626
src/text.c

File diff suppressed because it is too large Load Diff

View File

@ -64,9 +64,17 @@ gUnknown_03002FD0: @ 3002FD0
.space 0x20 .space 0x20
gUnknown_03002FF0: @ 3002FF0 gUnknown_03002FF0: @ 3002FF0
.space 0x24 .space 0x20
gUnknown_03003014: @ 3003014 gGlyphWidth: @ 3003010
.space 0x1
gGlyphHeight: @ 3003011
.space 0x1
.align 2
gTextFlags: @ 3003014
.space 0x4 .space 0x4
gUnknown_03003018: @ 3003018 gUnknown_03003018: @ 3003018

View File

@ -1,7 +1,7 @@
gTrainerId: @ 2020000 gTrainerId: @ 2020000
.space 0x4 .space 0x4
gUnknown_02020004: @ 2020004 gWindows: @ 2020004
.space 0x180 .space 0x180
gUnknown_02020184: @ 2020184 gUnknown_02020184: @ 2020184