mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
Some pokenav work
This commit is contained in:
parent
818e1909ff
commit
f64c1dfabf
@ -1305,881 +1305,5 @@ _081D0E5A:
|
||||
bx r1
|
||||
thumb_func_end sub_81D0E00
|
||||
|
||||
thumb_func_start sub_81D0E60
|
||||
sub_81D0E60: @ 81D0E60
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_08624BB8
|
||||
bl AddWindow
|
||||
strh r0, [r4, 0xA]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl PutWindowTilemap
|
||||
adds r0, r4, 0
|
||||
bl sub_81D0E84
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D0E60
|
||||
|
||||
thumb_func_start sub_81D0E84
|
||||
sub_81D0E84: @ 81D0E84
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x10
|
||||
adds r5, r0, 0
|
||||
ldr r1, =gUnknown_08624BC0
|
||||
add r0, sp, 0xC
|
||||
movs r2, 0x3
|
||||
bl memcpy
|
||||
ldr r4, =gStringVar1
|
||||
bl sub_81D07D8
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x2
|
||||
bl ConvertIntToDecimalStringN
|
||||
bl DynamicPlaceholderTextUtil_Reset
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
bl DynamicPlaceholderTextUtil_SetPlaceholderPtr
|
||||
ldr r4, =gStringVar4
|
||||
ldr r1, =gText_RibbonsF700
|
||||
adds r0, r4, 0
|
||||
bl DynamicPlaceholderTextUtil_ExpandPlaceholders
|
||||
ldrb r0, [r5, 0xA]
|
||||
movs r1, 0x44
|
||||
bl FillWindowPixelBuffer
|
||||
ldrb r0, [r5, 0xA]
|
||||
add r1, sp, 0xC
|
||||
str r1, [sp]
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
str r1, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0x1
|
||||
bl AddTextPrinterParameterized3
|
||||
ldrb r0, [r5, 0xA]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
add sp, 0x10
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D0E84
|
||||
|
||||
thumb_func_start sub_81D0EFC
|
||||
sub_81D0EFC: @ 81D0EFC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x10
|
||||
adds r7, r0, 0
|
||||
bl sub_81D0954
|
||||
adds r5, r0, 0
|
||||
ldr r1, =gUnknown_08624BC0
|
||||
add r0, sp, 0xC
|
||||
movs r2, 0x3
|
||||
bl memcpy
|
||||
ldrb r0, [r7, 0xA]
|
||||
movs r1, 0x44
|
||||
bl FillWindowPixelBuffer
|
||||
cmp r5, 0x18
|
||||
bhi _081D0F60
|
||||
lsls r1, r5, 3
|
||||
ldr r0, =gRibbonDescriptionPointers
|
||||
adds r6, r1, r0
|
||||
movs r5, 0x80
|
||||
lsls r5, 17
|
||||
movs r4, 0x1
|
||||
_081D0F2E:
|
||||
ldrb r0, [r7, 0xA]
|
||||
lsrs r3, r5, 24
|
||||
add r1, sp, 0xC
|
||||
str r1, [sp]
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
str r1, [sp, 0x4]
|
||||
ldm r6!, {r1}
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
bl AddTextPrinterParameterized3
|
||||
movs r0, 0x80
|
||||
lsls r0, 21
|
||||
adds r5, r0
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bge _081D0F2E
|
||||
b _081D0FAA
|
||||
.pool
|
||||
_081D0F60:
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
adds r0, r5
|
||||
ldr r1, =0x0000318f
|
||||
adds r0, r1
|
||||
ldrb r5, [r0]
|
||||
cmp r5, 0
|
||||
beq _081D0FB2
|
||||
subs r5, 0x1
|
||||
movs r4, 0
|
||||
ldr r0, =gGiftRibbonDescriptionPointers
|
||||
mov r8, r0
|
||||
movs r6, 0x80
|
||||
lsls r6, 17
|
||||
_081D0F7C:
|
||||
ldrb r0, [r7, 0xA]
|
||||
lsrs r3, r6, 24
|
||||
add r1, sp, 0xC
|
||||
str r1, [sp]
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
str r1, [sp, 0x4]
|
||||
lsls r1, r4, 2
|
||||
lsls r2, r5, 3
|
||||
adds r1, r2
|
||||
add r1, r8
|
||||
ldr r1, [r1]
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
bl AddTextPrinterParameterized3
|
||||
movs r0, 0x80
|
||||
lsls r0, 21
|
||||
adds r6, r0
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x1
|
||||
ble _081D0F7C
|
||||
_081D0FAA:
|
||||
ldrb r0, [r7, 0xA]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
_081D0FB2:
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D0EFC
|
||||
|
||||
thumb_func_start sub_81D0FCC
|
||||
sub_81D0FCC: @ 81D0FCC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_08624BC4
|
||||
bl AddWindow
|
||||
strh r0, [r4, 0x8]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl PutWindowTilemap
|
||||
adds r0, r4, 0
|
||||
bl sub_81D0FF0
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D0FCC
|
||||
|
||||
thumb_func_start sub_81D0FF0
|
||||
sub_81D0FF0: @ 81D0FF0
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x10
|
||||
ldrh r7, [r0, 0x8]
|
||||
ldrb r5, [r0, 0x8]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r4, =gStringVar3
|
||||
mov r6, sp
|
||||
adds r6, 0xD
|
||||
adds r0, r4, 0
|
||||
add r1, sp, 0xC
|
||||
adds r2, r6, 0
|
||||
bl sub_81D06E4
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0xFF
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r4, 0
|
||||
movs r3, 0
|
||||
bl AddTextPrinterParameterized
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _081D1040
|
||||
cmp r0, 0xFE
|
||||
beq _081D1048
|
||||
ldr r1, =gUnknown_08624BE4
|
||||
b _081D104A
|
||||
.pool
|
||||
_081D1040:
|
||||
ldr r1, =gUnknown_08624BCC
|
||||
b _081D104A
|
||||
.pool
|
||||
_081D1048:
|
||||
ldr r1, =gUnknown_08624BD8
|
||||
_081D104A:
|
||||
ldr r5, =gStringVar1
|
||||
adds r0, r5, 0
|
||||
bl StringCopy
|
||||
movs r1, 0xBA
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
movs r1, 0xF9
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
movs r1, 0x5
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
add r1, sp, 0xC
|
||||
ldrb r1, [r1]
|
||||
movs r2, 0
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
lsls r4, r7, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0xFF
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0x3C
|
||||
bl AddTextPrinterParameterized
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
add sp, 0x10
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D0FF0
|
||||
|
||||
thumb_func_start sub_81D10A4
|
||||
sub_81D10A4: @ 81D10A4
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_08624BE8
|
||||
bl AddWindow
|
||||
strh r0, [r4, 0xC]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
ldrb r0, [r4, 0xC]
|
||||
bl PutWindowTilemap
|
||||
adds r0, r4, 0
|
||||
bl sub_81D10D0
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D10A4
|
||||
|
||||
thumb_func_start sub_81D10D0
|
||||
sub_81D10D0: @ 81D10D0
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0xC
|
||||
mov r8, r0
|
||||
bl sub_81D06C4
|
||||
adds r4, r0, 0
|
||||
adds r4, 0x1
|
||||
bl sub_81D06D4
|
||||
adds r6, r0, 0
|
||||
ldr r5, =gStringVar1
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
movs r1, 0xBA
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
adds r1, r6, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
movs r0, 0x1
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x38
|
||||
bl GetStringCenterAlignXOffset
|
||||
adds r3, r0, 0
|
||||
mov r1, r8
|
||||
ldrb r0, [r1, 0xC]
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r1, 0x1
|
||||
str r1, [sp]
|
||||
movs r1, 0xFF
|
||||
str r1, [sp, 0x4]
|
||||
movs r1, 0
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
bl AddTextPrinterParameterized
|
||||
mov r1, r8
|
||||
ldrb r0, [r1, 0xC]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
add sp, 0xC
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D10D0
|
||||
|
||||
thumb_func_start sub_81D1148
|
||||
sub_81D1148: @ 81D1148
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
adds r4, r0, 0
|
||||
add r1, sp, 0x4
|
||||
add r2, sp, 0x8
|
||||
mov r0, sp
|
||||
bl sub_81D0760
|
||||
bl ResetAllPicSprites
|
||||
movs r0, 0x28
|
||||
movs r1, 0x68
|
||||
bl sub_81D1184
|
||||
strh r0, [r4, 0x10]
|
||||
movs r0, 0xF
|
||||
movs r1, 0
|
||||
bl sub_81C7990
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D1148
|
||||
|
||||
thumb_func_start sub_81D1178
|
||||
sub_81D1178: @ 81D1178
|
||||
push {lr}
|
||||
ldrh r0, [r0, 0x10]
|
||||
bl FreeAndDestroyMonPicSprite
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D1178
|
||||
|
||||
thumb_func_start sub_81D1184
|
||||
sub_81D1184: @ 81D1184
|
||||
push {lr}
|
||||
sub sp, 0x1C
|
||||
add r1, sp, 0x14
|
||||
add r2, sp, 0x18
|
||||
add r0, sp, 0x10
|
||||
bl sub_81D0760
|
||||
add r0, sp, 0x10
|
||||
ldrh r0, [r0]
|
||||
ldr r1, [sp, 0x18]
|
||||
ldr r2, [sp, 0x14]
|
||||
movs r3, 0x28
|
||||
str r3, [sp]
|
||||
movs r3, 0x68
|
||||
str r3, [sp, 0x4]
|
||||
movs r3, 0xF
|
||||
str r3, [sp, 0x8]
|
||||
ldr r3, =0x0000ffff
|
||||
str r3, [sp, 0xC]
|
||||
movs r3, 0x1
|
||||
bl CreateMonPicSprite_HandleDeoxys
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =gSprites
|
||||
lsls r2, r0, 4
|
||||
adds r2, r0
|
||||
lsls r2, 2
|
||||
adds r2, r1
|
||||
ldrb r3, [r2, 0x5]
|
||||
movs r1, 0xD
|
||||
negs r1, r1
|
||||
ands r1, r3
|
||||
strb r1, [r2, 0x5]
|
||||
add sp, 0x1C
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81D1184
|
||||
|
||||
thumb_func_start sub_81D11D8
|
||||
sub_81D11D8: @ 81D11D8
|
||||
push {lr}
|
||||
ldrh r1, [r0, 0x10]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r0, r1
|
||||
movs r2, 0x20
|
||||
negs r2, r2
|
||||
movs r1, 0x28
|
||||
movs r3, 0x6
|
||||
bl sub_81D1258
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D11D8
|
||||
|
||||
thumb_func_start sub_81D11FC
|
||||
sub_81D11FC: @ 81D11FC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
ldrh r0, [r4, 0x10]
|
||||
bl FreeAndDestroyMonPicSprite
|
||||
movs r5, 0x20
|
||||
negs r5, r5
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x68
|
||||
bl sub_81D1184
|
||||
strh r0, [r4, 0x10]
|
||||
ldrh r1, [r4, 0x10]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r0, r1
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x28
|
||||
movs r3, 0x6
|
||||
bl sub_81D1258
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D11FC
|
||||
|
||||
thumb_func_start sub_81D1234
|
||||
sub_81D1234: @ 81D1234
|
||||
ldr r2, =gSprites
|
||||
ldrh r1, [r0, 0x10]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r2, 0x1C
|
||||
adds r0, r2
|
||||
ldr r1, [r0]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
eors r1, r0
|
||||
negs r0, r1
|
||||
orrs r0, r1
|
||||
lsrs r0, 31
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81D1234
|
||||
|
||||
thumb_func_start sub_81D1258
|
||||
sub_81D1258: @ 81D1258
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
adds r6, r2, 0
|
||||
adds r5, r3, 0
|
||||
subs r0, r6, r1
|
||||
strh r1, [r4, 0x20]
|
||||
lsls r1, 4
|
||||
strh r1, [r4, 0x2E]
|
||||
lsls r0, 4
|
||||
adds r1, r5, 0
|
||||
bl __udivsi3
|
||||
strh r0, [r4, 0x30]
|
||||
strh r5, [r4, 0x32]
|
||||
strh r6, [r4, 0x34]
|
||||
ldr r0, =sub_81D1284
|
||||
str r0, [r4, 0x1C]
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D1258
|
||||
|
||||
thumb_func_start sub_81D1284
|
||||
sub_81D1284: @ 81D1284
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldrh r1, [r2, 0x32]
|
||||
movs r3, 0x32
|
||||
ldrsh r0, [r2, r3]
|
||||
cmp r0, 0
|
||||
beq _081D12C8
|
||||
subs r0, r1, 0x1
|
||||
strh r0, [r2, 0x32]
|
||||
ldrh r0, [r2, 0x30]
|
||||
ldrh r1, [r2, 0x2E]
|
||||
adds r0, r1
|
||||
strh r0, [r2, 0x2E]
|
||||
lsls r0, 16
|
||||
asrs r0, 20
|
||||
strh r0, [r2, 0x20]
|
||||
movs r1, 0x20
|
||||
negs r1, r1
|
||||
cmp r0, r1
|
||||
bgt _081D12BA
|
||||
adds r0, r2, 0
|
||||
adds r0, 0x3E
|
||||
ldrb r1, [r0]
|
||||
movs r2, 0x4
|
||||
orrs r1, r2
|
||||
strb r1, [r0]
|
||||
b _081D12D0
|
||||
_081D12BA:
|
||||
adds r2, 0x3E
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x5
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
b _081D12D0
|
||||
_081D12C8:
|
||||
ldrh r0, [r2, 0x34]
|
||||
strh r0, [r2, 0x20]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r2, 0x1C]
|
||||
_081D12D0:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D1284
|
||||
|
||||
thumb_func_start sub_81D12D8
|
||||
sub_81D12D8: @ 81D12D8
|
||||
push {r4-r6,lr}
|
||||
bl sub_81D1350
|
||||
ldr r5, =gUnknown_030012C0
|
||||
adds r0, r5, 0
|
||||
bl sub_81D0914
|
||||
adds r6, r0, 0
|
||||
ldr r2, =gUnknown_030012C4
|
||||
movs r1, 0
|
||||
str r1, [r2]
|
||||
ldr r0, [r5]
|
||||
cmp r1, r0
|
||||
bcs _081D130A
|
||||
adds r4, r2, 0
|
||||
_081D12F6:
|
||||
ldr r0, [r4]
|
||||
ldm r6!, {r1}
|
||||
bl sub_81D1370
|
||||
ldr r1, [r4]
|
||||
adds r1, 0x1
|
||||
str r1, [r4]
|
||||
ldr r0, [r5]
|
||||
cmp r1, r0
|
||||
bcc _081D12F6
|
||||
_081D130A:
|
||||
ldr r4, =gUnknown_030012C0
|
||||
adds r0, r4, 0
|
||||
bl sub_81D092C
|
||||
adds r6, r0, 0
|
||||
ldr r2, =gUnknown_030012C4
|
||||
movs r1, 0
|
||||
str r1, [r2]
|
||||
ldr r0, [r4]
|
||||
cmp r1, r0
|
||||
bcs _081D133A
|
||||
adds r4, r2, 0
|
||||
_081D1322:
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x1B
|
||||
ldm r6!, {r1}
|
||||
bl sub_81D1370
|
||||
ldr r1, [r4]
|
||||
adds r1, 0x1
|
||||
str r1, [r4]
|
||||
ldr r0, =gUnknown_030012C0
|
||||
ldr r0, [r0]
|
||||
cmp r1, r0
|
||||
bcc _081D1322
|
||||
_081D133A:
|
||||
movs r0, 0x1
|
||||
bl CopyBgTilemapBufferToVram
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D12D8
|
||||
|
||||
thumb_func_start sub_81D1350
|
||||
sub_81D1350: @ 81D1350
|
||||
push {lr}
|
||||
sub sp, 0x8
|
||||
movs r0, 0x20
|
||||
str r0, [sp]
|
||||
movs r0, 0x14
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl FillBgTilemapBufferRect_Palette0
|
||||
add sp, 0x8
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D1350
|
||||
|
||||
thumb_func_start sub_81D1370
|
||||
sub_81D1370: @ 81D1370
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x10
|
||||
adds r4, r0, 0
|
||||
adds r6, r1, 0
|
||||
movs r1, 0x9
|
||||
bl __umodsi3
|
||||
adds r5, r0, 0
|
||||
lsls r5, 1
|
||||
adds r5, 0xB
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x9
|
||||
bl __udivsi3
|
||||
adds r4, r0, 0
|
||||
lsls r4, 1
|
||||
adds r4, 0x4
|
||||
add r0, sp, 0x8
|
||||
adds r1, r6, 0
|
||||
bl sub_81D13BC
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x2
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x1
|
||||
add r1, sp, 0x8
|
||||
adds r2, r5, 0
|
||||
adds r3, r4, 0
|
||||
bl CopyToBgTilemapBufferRect
|
||||
add sp, 0x10
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D1370
|
||||
|
||||
thumb_func_start sub_81D13BC
|
||||
sub_81D13BC: @ 81D13BC
|
||||
push {r4,r5,lr}
|
||||
ldr r2, =gUnknown_08624BF8
|
||||
lsls r1, 2
|
||||
adds r1, r2
|
||||
ldrh r3, [r1, 0x2]
|
||||
adds r3, 0x2
|
||||
lsls r3, 16
|
||||
ldrh r1, [r1]
|
||||
lsls r1, 1
|
||||
adds r1, 0x1
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
lsrs r3, 4
|
||||
adds r2, r1, 0
|
||||
orrs r2, r3
|
||||
strh r2, [r0]
|
||||
movs r5, 0x80
|
||||
lsls r5, 3
|
||||
adds r4, r5, 0
|
||||
orrs r2, r4
|
||||
strh r2, [r0, 0x2]
|
||||
adds r1, 0x1
|
||||
orrs r1, r3
|
||||
strh r1, [r0, 0x4]
|
||||
orrs r1, r4
|
||||
strh r1, [r0, 0x6]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D13BC
|
||||
|
||||
thumb_func_start sub_81D13FC
|
||||
sub_81D13FC: @ 81D13FC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_08624C78
|
||||
bl LoadCompressedSpriteSheet
|
||||
ldr r0, =gUnknown_08624C80
|
||||
bl Pokenav_AllocAndLoadPalettes
|
||||
ldr r0, =gUnknown_08624D04
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
ldr r0, =gSprites
|
||||
adds r1, r0
|
||||
str r1, [r4, 0x14]
|
||||
adds r1, 0x3E
|
||||
ldrb r0, [r1]
|
||||
movs r2, 0x4
|
||||
orrs r0, r2
|
||||
strb r0, [r1]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D13FC
|
||||
|
||||
thumb_func_start sub_81D1448
|
||||
sub_81D1448: @ 81D1448
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
adds r6, r0, 0
|
||||
bl sub_81D0944
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x9
|
||||
bl __modsi3
|
||||
adds r5, r0, 0
|
||||
lsls r5, 4
|
||||
adds r5, 0x60
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x9
|
||||
bl __divsi3
|
||||
lsls r0, 4
|
||||
adds r0, 0x28
|
||||
ldr r1, [r6, 0x14]
|
||||
movs r2, 0
|
||||
mov r8, r2
|
||||
strh r5, [r1, 0x20]
|
||||
ldr r1, [r6, 0x14]
|
||||
strh r0, [r1, 0x22]
|
||||
bl sub_81D0954
|
||||
adds r4, r0, 0
|
||||
movs r0, 0x9
|
||||
bl GetSpriteTileStartByTag
|
||||
ldr r3, [r6, 0x14]
|
||||
ldr r1, =gUnknown_08624BF8
|
||||
lsls r4, 2
|
||||
adds r4, r1
|
||||
ldrh r1, [r4]
|
||||
lsls r1, 4
|
||||
adds r0, r1
|
||||
ldr r2, =0x000003ff
|
||||
adds r1, r2, 0
|
||||
ands r0, r1
|
||||
ldrh r2, [r3, 0x4]
|
||||
ldr r1, =0xfffffc00
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strh r1, [r3, 0x4]
|
||||
ldrh r0, [r4, 0x2]
|
||||
adds r0, 0xF
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl IndexOfSpritePaletteTag
|
||||
ldr r3, [r6, 0x14]
|
||||
lsls r0, 4
|
||||
ldrb r2, [r3, 0x5]
|
||||
movs r1, 0xF
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strb r1, [r3, 0x5]
|
||||
ldr r0, [r6, 0x14]
|
||||
movs r1, 0x1
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r1, [r6, 0x14]
|
||||
adds r1, 0x3E
|
||||
ldrb r2, [r1]
|
||||
movs r0, 0x5
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
strb r0, [r1]
|
||||
ldr r0, [r6, 0x14]
|
||||
mov r1, r8
|
||||
strh r1, [r0, 0x2E]
|
||||
ldr r1, [r6, 0x14]
|
||||
ldr r0, =sub_81D1538
|
||||
str r0, [r1, 0x1C]
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D1448
|
||||
|
||||
thumb_func_start sub_81D1500
|
||||
sub_81D1500: @ 81D1500
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r1, [r4, 0x14]
|
||||
movs r0, 0x1
|
||||
strh r0, [r1, 0x2E]
|
||||
ldr r0, [r4, 0x14]
|
||||
movs r1, 0x2
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r1, [r4, 0x14]
|
||||
ldr r0, =sub_81D1538
|
||||
str r0, [r1, 0x1C]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D1500
|
||||
|
||||
thumb_func_start sub_81D1524
|
||||
sub_81D1524: @ 81D1524
|
||||
ldr r0, [r0, 0x14]
|
||||
ldr r1, [r0, 0x1C]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
eors r1, r0
|
||||
negs r0, r1
|
||||
orrs r0, r1
|
||||
lsrs r0, 31
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81D1524
|
||||
|
||||
thumb_func_start sub_81D1538
|
||||
sub_81D1538: @ 81D1538
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081D156A
|
||||
movs r0, 0x3E
|
||||
adds r0, r3
|
||||
mov r12, r0
|
||||
movs r0, 0x1
|
||||
ldrh r1, [r3, 0x2E]
|
||||
ands r1, r0
|
||||
lsls r1, 2
|
||||
mov r0, r12
|
||||
ldrb r2, [r0]
|
||||
movs r0, 0x5
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
mov r1, r12
|
||||
strb r0, [r1]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r3, 0x1C]
|
||||
_081D156A:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D1538
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
|
@ -5,44 +5,6 @@
|
||||
|
||||
@ File centered around AllocSubstruct(2)
|
||||
|
||||
thumb_func_start sub_81C98D4
|
||||
sub_81C98D4: @ 81C98D4
|
||||
push {r4,lr}
|
||||
movs r4, 0
|
||||
_081C98D8:
|
||||
adds r0, r4, 0
|
||||
bl sub_81CB0C8
|
||||
ldr r1, =gMapHeader
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldrb r1, [r1, 0x14]
|
||||
cmp r0, r1
|
||||
bne _081C9914
|
||||
adds r0, r4, 0
|
||||
bl sub_81CAE08
|
||||
cmp r0, 0
|
||||
beq _081C9914
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x000009ca
|
||||
adds r0, r1
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _081C9914
|
||||
movs r0, 0x1
|
||||
b _081C991C
|
||||
.pool
|
||||
_081C9914:
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x4D
|
||||
ble _081C98D8
|
||||
movs r0, 0
|
||||
_081C991C:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C98D4
|
||||
|
||||
thumb_func_start sub_81C9924
|
||||
sub_81C9924: @ 81C9924
|
||||
|
107
data/pokenav.s
107
data/pokenav.s
@ -1656,110 +1656,3 @@ gUnknown_08624BA0:: @ 8624BA0
|
||||
.4byte sub_81D0D8C
|
||||
.4byte sub_81D0E00
|
||||
.4byte sub_81D0C54
|
||||
|
||||
gUnknown_08624BB8:: @ 8624BB8
|
||||
window_template 2, 12, 13, 16, 4, 1, 20
|
||||
|
||||
gUnknown_08624BC0:: @ 8624BC0
|
||||
.byte 4, 2, 3, 0
|
||||
|
||||
gUnknown_08624BC4:: @ 8624BC4
|
||||
window_template 2, 14, 1, 13, 2, 10, 0x54
|
||||
|
||||
gUnknown_08624BCC:: @ 8624BCC
|
||||
.string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$"
|
||||
.align 2
|
||||
|
||||
gUnknown_08624BD8:: @ 8624BD8
|
||||
.string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$"
|
||||
.align 2
|
||||
|
||||
gUnknown_08624BE4:: @ 8624BE4
|
||||
.string "{UNK_SPACER}$"
|
||||
.align 2
|
||||
|
||||
gUnknown_08624BE8:: @ 8624BE8
|
||||
window_template 2, 1, 5, 7, 2, 1, 0x6E
|
||||
.4byte NULL
|
||||
.4byte NULL
|
||||
|
||||
gUnknown_08624BF8:: @ 8624BF8
|
||||
.2byte 0, 0, 1, 0
|
||||
.2byte 2, 0, 3, 0
|
||||
.2byte 4, 0, 1, 1
|
||||
.2byte 2, 1, 3, 1
|
||||
.2byte 4, 1, 1, 2
|
||||
.2byte 2, 2, 3, 2
|
||||
.2byte 4, 2, 1, 3
|
||||
.2byte 2, 3, 3, 3
|
||||
.2byte 4, 3, 1, 4
|
||||
.2byte 2, 4, 3, 4
|
||||
.2byte 4, 4, 5, 0
|
||||
.2byte 6, 0, 7, 1
|
||||
.2byte 8, 2, 9, 1
|
||||
.2byte 9, 3, 9, 4
|
||||
.2byte 10, 3, 10, 4
|
||||
.2byte 11, 0, 11, 1
|
||||
|
||||
gUnknown_08624C78:: @ 8624C78
|
||||
obj_tiles gUnknown_08624280, 0x1800, 9
|
||||
|
||||
gUnknown_08624C80:: @ 8624C80
|
||||
obj_pal gUnknown_08623FF8, 15
|
||||
obj_pal gUnknown_08624018, 16
|
||||
obj_pal gUnknown_08624038, 17
|
||||
obj_pal gUnknown_08624058, 18
|
||||
obj_pal gUnknown_08624078, 19
|
||||
null_obj_pal
|
||||
|
||||
gUnknown_08624CB0:: @ 8624CB0
|
||||
.2byte 0x100
|
||||
.2byte 0x8000
|
||||
.2byte 0x400
|
||||
.2byte 0x0
|
||||
|
||||
gUnknown_08624CB8:: @ 8624CB8
|
||||
.2byte 0x80
|
||||
.2byte 0x80
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0x7FFF
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
|
||||
gUnknown_08624CC8:: @ 8624CC8
|
||||
.2byte 0x80
|
||||
.2byte 0x80
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0x20
|
||||
.2byte 0x20
|
||||
.2byte 0x400
|
||||
.2byte 0
|
||||
.2byte 0x7FFF
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
|
||||
gUnknown_08624CE0:: @ 8624CE0
|
||||
.2byte 0x100
|
||||
.2byte 0x100
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0xFFE0
|
||||
.2byte 0xFFE0
|
||||
.2byte 0x400
|
||||
.2byte 0
|
||||
.2byte 0x7FFF
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
.2byte 0
|
||||
|
||||
gUnknown_08624CF8:: @ 8624CF8
|
||||
.4byte gUnknown_08624CB8
|
||||
.4byte gUnknown_08624CC8
|
||||
.4byte gUnknown_08624CE0
|
||||
|
||||
gUnknown_08624D04:: @ 8624D04
|
||||
spr_template 9, 15, gUnknown_08624CB0, gDummySpriteAnimTable, NULL, gUnknown_08624CF8, SpriteCallbackDummy
|
||||
|
@ -125,6 +125,7 @@ void sub_81C7B40(void);
|
||||
struct Sprite *PauseSpinningPokenavSprite(void);
|
||||
void ResumeSpinningPokenavSprite(void);
|
||||
void sub_81C7E14(u32 arg0);
|
||||
void sub_81C7990(u32 a0, u16 a1);
|
||||
|
||||
// pokenav_unk_1.c
|
||||
bool32 sub_81C9298(void);
|
||||
@ -162,7 +163,7 @@ const u8 *sub_81CAFD8(int index, int textType);
|
||||
u16 sub_81CB01C(void);
|
||||
u16 sub_81CB02C(int arg0);
|
||||
void sub_81CB050(u32 arg0, u8 *str);
|
||||
int sub_81CB0C8(int rematchIndex);
|
||||
u8 sub_81CB0C8(int rematchIndex);
|
||||
int sub_81CB0E4(int index);
|
||||
bool32 sub_81CAE08(int);
|
||||
int sub_81CB128(int index);
|
||||
|
@ -305,6 +305,7 @@ SECTIONS {
|
||||
src/pokenav_main_menu.o(.text);
|
||||
src/pokenav_match_call_ui.o(.text);
|
||||
src/pokenav_unk_1.o(.text);
|
||||
src/pokenav_unk_2.o(.text);
|
||||
asm/pokenav_unk_2.o(.text);
|
||||
src/pokenav_unk_3.o(.text);
|
||||
src/pokenav_unk_4.o(.text);
|
||||
@ -314,6 +315,7 @@ SECTIONS {
|
||||
asm/pokenav_unk_8.o(.text);
|
||||
asm/pokenav_unk_9.o(.text);
|
||||
asm/pokenav_unk_10.o(.text);
|
||||
src/pokenav_unk_10.o(.text);
|
||||
src/pokenav_match_call_data.o(.text);
|
||||
src/menu_specialized.o(.text);
|
||||
src/ereader_helpers.o(.text);
|
||||
@ -636,6 +638,7 @@ SECTIONS {
|
||||
src/pokenav_match_call_ui.o(.rodata);
|
||||
src/pokenav_unk_1.o(.rodata);
|
||||
data/pokenav.o(.rodata);
|
||||
src/pokenav_unk_10.o(.rodata);
|
||||
src/pokenav_match_call_data.o(.rodata);
|
||||
src/menu_specialized.o(.rodata);
|
||||
data/ereader_helpers.o(.rodata);
|
||||
|
493
src/pokenav_unk_10.c
Normal file
493
src/pokenav_unk_10.c
Normal file
@ -0,0 +1,493 @@
|
||||
#include "global.h"
|
||||
#include "decompress.h"
|
||||
#include "dynamic_placeholder_text_util.h"
|
||||
#include "international_string_util.h"
|
||||
#include "pokenav.h"
|
||||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
#include "text.h"
|
||||
#include "trainer_pokemon_sprites.h"
|
||||
#include "window.h"
|
||||
|
||||
struct Pokenav10Struct
|
||||
{
|
||||
u32 field_0[5];
|
||||
struct Sprite *field_14;
|
||||
};
|
||||
|
||||
struct Pokenav10Struct2
|
||||
{
|
||||
u32 filler0[2];
|
||||
u16 field_8;
|
||||
u16 field_A;
|
||||
u16 field_C;
|
||||
u8 filler[2];
|
||||
u16 field_10;
|
||||
};
|
||||
|
||||
// To do: move to C.
|
||||
extern const u16 gUnknown_08623FF8[];
|
||||
extern const u16 gUnknown_08624038[];
|
||||
extern const u16 gUnknown_08624018[];
|
||||
extern const u16 gUnknown_08624078[];
|
||||
extern const u16 gUnknown_08624058[];
|
||||
extern const u32 gUnknown_08624280[];
|
||||
extern const u8 gText_RibbonsF700[];
|
||||
extern const u8 *const gRibbonDescriptionPointers[][2];
|
||||
extern const u8 *const gGiftRibbonDescriptionPointers[][2];
|
||||
|
||||
extern u32 gUnknown_030012C0;
|
||||
extern u32 gUnknown_030012C4;
|
||||
|
||||
void sub_81D0E84(struct Pokenav10Struct2 *structPtr);
|
||||
void sub_81D0FF0(struct Pokenav10Struct2 *structPtr);
|
||||
void sub_81D10D0(struct Pokenav10Struct2 *structPtr);
|
||||
u32 sub_81D06C4(void);
|
||||
u32 sub_81D07D8(void);
|
||||
u32 sub_81D06D4(void);
|
||||
void sub_81D06E4(u8 *nick, u8 *level, u8 *gender);
|
||||
void sub_81D0760(u16 *species, u32 *personality, u32 *otId);
|
||||
u16 sub_81D1184(s32 unused0, s32 unused1);
|
||||
void sub_81D1258(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3);
|
||||
void sub_81D1284(struct Sprite *sprite);
|
||||
u32 *sub_81D0914(u32 *arg0);
|
||||
u32 *sub_81D092C(u32 *arg0);
|
||||
void sub_81D1350(void);
|
||||
void sub_81D13BC(u16 *dst, u32 id);
|
||||
void sub_81D1370(u32 arg0, u32 id);
|
||||
u16 sub_81D0944(void);
|
||||
u32 sub_81D0954(void);
|
||||
void sub_81D1500(struct Pokenav10Struct *structPtr);
|
||||
bool32 sub_81D1524(struct Pokenav10Struct *structPtr);
|
||||
void sub_81D1538(struct Sprite *sprite);
|
||||
|
||||
// code
|
||||
static const struct WindowTemplate gUnknown_08624BB8 =
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 12,
|
||||
.tilemapTop = 13,
|
||||
.width = 16,
|
||||
.height = 4,
|
||||
.paletteNum = 1,
|
||||
.baseBlock = 0x14,
|
||||
};
|
||||
|
||||
void sub_81D0E60(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
structPtr->field_A = AddWindow(&gUnknown_08624BB8);
|
||||
PutWindowTilemap(structPtr->field_A);
|
||||
sub_81D0E84(structPtr);
|
||||
}
|
||||
|
||||
void sub_81D0E84(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
u8 color[] = {4, 2, 3};
|
||||
|
||||
ConvertIntToDecimalStringN(gStringVar1, sub_81D07D8(), STR_CONV_MODE_LEFT_ALIGN, 2);
|
||||
DynamicPlaceholderTextUtil_Reset();
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
|
||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700);
|
||||
FillWindowPixelBuffer(structPtr->field_A, PIXEL_FILL(4));
|
||||
AddTextPrinterParameterized3(structPtr->field_A, 1, 0, 1, color, -1, gStringVar4);
|
||||
CopyWindowToVram(structPtr->field_A, 2);
|
||||
}
|
||||
|
||||
void sub_81D0EFC(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
s32 i;
|
||||
u32 ribbonId = sub_81D0954();
|
||||
u8 color[] = {4, 2, 3};
|
||||
|
||||
FillWindowPixelBuffer(structPtr->field_A, PIXEL_FILL(4));
|
||||
if (ribbonId < 25)
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
AddTextPrinterParameterized3(structPtr->field_A, 1, 0, (i * 16) + 1, color, -1, gRibbonDescriptionPointers[ribbonId][i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ribbonId = gSaveBlock1Ptr->giftRibbons[ribbonId - 25];
|
||||
if (ribbonId == 0)
|
||||
return;
|
||||
|
||||
ribbonId--;
|
||||
for (i = 0; i < 2; i++)
|
||||
AddTextPrinterParameterized3(structPtr->field_A, 1, 0, (i * 16) + 1, color, -1, gGiftRibbonDescriptionPointers[ribbonId][i]);
|
||||
}
|
||||
|
||||
CopyWindowToVram(structPtr->field_A, 2);
|
||||
}
|
||||
|
||||
static const struct WindowTemplate gUnknown_08624BC4 =
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 14,
|
||||
.tilemapTop = 1,
|
||||
.width = 13,
|
||||
.height = 2,
|
||||
.paletteNum = 10,
|
||||
.baseBlock = 0x54,
|
||||
};
|
||||
|
||||
void sub_81D0FCC(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
structPtr->field_8 = AddWindow(&gUnknown_08624BC4);
|
||||
PutWindowTilemap(structPtr->field_8);
|
||||
sub_81D0FF0(structPtr);
|
||||
}
|
||||
|
||||
static const u8 sMaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
|
||||
static const u8 sFemaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
|
||||
static const u8 sGenderlessIconString[] = _("{UNK_SPACER}");
|
||||
|
||||
void sub_81D0FF0(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
const u8 *genderTxt;
|
||||
u8 *txtPtr;
|
||||
u8 level, gender;
|
||||
u16 windowId = structPtr->field_8;
|
||||
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
||||
sub_81D06E4(gStringVar3, &level, &gender);
|
||||
AddTextPrinterParameterized(windowId, 1, gStringVar3, 0, 1, TEXT_SPEED_FF, NULL);
|
||||
switch (gender)
|
||||
{
|
||||
case MON_MALE:
|
||||
genderTxt = sMaleIconString;
|
||||
break;
|
||||
case MON_FEMALE:
|
||||
genderTxt = sFemaleIconString;
|
||||
break;
|
||||
default:
|
||||
genderTxt = sGenderlessIconString;
|
||||
break;
|
||||
}
|
||||
|
||||
txtPtr = StringCopy(gStringVar1, genderTxt);
|
||||
*(txtPtr++) = CHAR_SLASH;
|
||||
*(txtPtr++) = CHAR_SPECIAL_F9;
|
||||
*(txtPtr++) = 5;
|
||||
ConvertIntToDecimalStringN(txtPtr, level, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
AddTextPrinterParameterized(windowId, 1, gStringVar1, 60, 1, TEXT_SPEED_FF, NULL);
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
static const struct WindowTemplate gUnknown_08624BE8[] =
|
||||
{
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 5,
|
||||
.width = 7,
|
||||
.height = 2,
|
||||
.paletteNum = 1,
|
||||
.baseBlock = 0x6E,
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
void sub_81D10A4(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
structPtr->field_C = AddWindow(gUnknown_08624BE8);
|
||||
FillWindowPixelBuffer(structPtr->field_C, PIXEL_FILL(1));
|
||||
PutWindowTilemap(structPtr->field_C);
|
||||
sub_81D10D0(structPtr);
|
||||
}
|
||||
|
||||
void sub_81D10D0(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
s32 x;
|
||||
u8 *txtPtr;
|
||||
u32 id = sub_81D06C4() + 1;
|
||||
u32 count = sub_81D06D4();
|
||||
|
||||
txtPtr = ConvertIntToDecimalStringN(gStringVar1, id, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
*(txtPtr++) = CHAR_SLASH;
|
||||
ConvertIntToDecimalStringN(txtPtr, count, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
x = GetStringCenterAlignXOffset(1, gStringVar1, 56);
|
||||
AddTextPrinterParameterized(structPtr->field_C, 1, gStringVar1, x, 1, TEXT_SPEED_FF, NULL);
|
||||
CopyWindowToVram(structPtr->field_C, 2);
|
||||
}
|
||||
|
||||
void sub_81D1148(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
u16 species;
|
||||
u32 personality, otId;
|
||||
|
||||
sub_81D0760(&species, &personality, &otId);
|
||||
ResetAllPicSprites();
|
||||
structPtr->field_10 = sub_81D1184(40, 104);
|
||||
sub_81C7990(15, 0);
|
||||
}
|
||||
|
||||
void sub_81D1178(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(structPtr->field_10);
|
||||
}
|
||||
|
||||
u16 sub_81D1184(s32 unused0, s32 unused1)
|
||||
{
|
||||
u16 species, spriteId;
|
||||
u32 personality, otId;
|
||||
|
||||
sub_81D0760(&species, &personality, &otId);
|
||||
spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 40, 104, 15, 0xFFFF);
|
||||
gSprites[spriteId].oam.priority = 0;
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void sub_81D11D8(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
sub_81D1258(&gSprites[structPtr->field_10], 40, -32, 6);
|
||||
}
|
||||
|
||||
void sub_81D11FC(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
FreeAndDestroyMonPicSprite(structPtr->field_10);
|
||||
structPtr->field_10 = sub_81D1184(-32, 104);
|
||||
sub_81D1258(&gSprites[structPtr->field_10], -32, 40, 6);
|
||||
}
|
||||
|
||||
bool32 sub_81D1234(struct Pokenav10Struct2 *structPtr)
|
||||
{
|
||||
return (gSprites[structPtr->field_10].callback != SpriteCallbackDummy);
|
||||
}
|
||||
|
||||
void sub_81D1258(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3)
|
||||
{
|
||||
u32 var = arg2 - arg1;
|
||||
|
||||
sprite->pos1.x = arg1;
|
||||
sprite->data[0] = arg1 << 4;
|
||||
sprite->data[1] = (var << 4) / arg3;
|
||||
sprite->data[2] = arg3;
|
||||
sprite->data[3] = arg2;
|
||||
|
||||
sprite->callback = sub_81D1284;
|
||||
}
|
||||
|
||||
void sub_81D1284(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[2] != 0)
|
||||
{
|
||||
sprite->data[2]--;
|
||||
sprite->data[0] += sprite->data[1];
|
||||
sprite->pos1.x = sprite->data[0] >> 4;
|
||||
if (sprite->pos1.x <= -32)
|
||||
sprite->invisible = TRUE;
|
||||
else
|
||||
sprite->invisible = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x = sprite->data[3];
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_81D12D8(void)
|
||||
{
|
||||
u32 *ptr;
|
||||
|
||||
sub_81D1350();
|
||||
|
||||
ptr = sub_81D0914(&gUnknown_030012C0);
|
||||
for (gUnknown_030012C4 = 0; gUnknown_030012C4 < gUnknown_030012C0; gUnknown_030012C4++)
|
||||
sub_81D1370(gUnknown_030012C4, *(ptr++));
|
||||
|
||||
ptr = sub_81D092C(&gUnknown_030012C0);
|
||||
for (gUnknown_030012C4 = 0; gUnknown_030012C4 < gUnknown_030012C0; gUnknown_030012C4++)
|
||||
sub_81D1370(gUnknown_030012C4 + 27, *(ptr++));
|
||||
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
}
|
||||
|
||||
void sub_81D1350(void)
|
||||
{
|
||||
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 20);
|
||||
}
|
||||
|
||||
void sub_81D1370(u32 arg0, u32 id)
|
||||
{
|
||||
u16 bgData[4];
|
||||
u32 destX = (arg0 % 9) * 2 + 11;
|
||||
u32 destY = (arg0 / 9) * 2 + 4;
|
||||
|
||||
sub_81D13BC(bgData, id);
|
||||
CopyToBgTilemapBufferRect(1, bgData, destX, destY, 2, 2);
|
||||
}
|
||||
|
||||
struct
|
||||
{
|
||||
u16 var0;
|
||||
u16 var2;
|
||||
} static const gUnknown_08624BF8[] =
|
||||
{
|
||||
{0, 0},
|
||||
{1, 0},
|
||||
{2, 0},
|
||||
{3, 0},
|
||||
{4, 0},
|
||||
{1, 1},
|
||||
{2, 1},
|
||||
{3, 1},
|
||||
{4, 1},
|
||||
{1, 2},
|
||||
{2, 2},
|
||||
{3, 2},
|
||||
{4, 2},
|
||||
{1, 3},
|
||||
{2, 3},
|
||||
{3, 3},
|
||||
{4, 3},
|
||||
{1, 4},
|
||||
{2, 4},
|
||||
{3, 4},
|
||||
{4, 4},
|
||||
{5, 0},
|
||||
{6, 0},
|
||||
{7, 1},
|
||||
{8, 2},
|
||||
{9, 1},
|
||||
{9, 3},
|
||||
{9, 4},
|
||||
{10, 3},
|
||||
{10, 4},
|
||||
{11, 0},
|
||||
{11, 1},
|
||||
};
|
||||
|
||||
void sub_81D13BC(u16 *dst, u32 id)
|
||||
{
|
||||
u16 r3 = gUnknown_08624BF8[id].var2 + 2;
|
||||
u16 r1 = (gUnknown_08624BF8[id].var0 * 2) + 1;
|
||||
|
||||
dst[0] = r1 | (r3 << 12);
|
||||
dst[1] = r1 | (r3 << 12) |0x400;
|
||||
dst[2] = (r1 + 1) | (r3 << 12);
|
||||
dst[3] = (r1 + 1) | (r3 << 12) | 0x400;
|
||||
}
|
||||
|
||||
static const struct CompressedSpriteSheet gUnknown_08624C78 =
|
||||
{
|
||||
gUnknown_08624280, 0x1800, 9
|
||||
};
|
||||
|
||||
static const struct SpritePalette gUnknown_08624C80[] =
|
||||
{
|
||||
{gUnknown_08623FF8, 15},
|
||||
{gUnknown_08624018, 16},
|
||||
{gUnknown_08624038, 17},
|
||||
{gUnknown_08624058, 18},
|
||||
{gUnknown_08624078, 19},
|
||||
{},
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_8624CB0 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 1,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x32),
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sSpriteAffineAnim_8624CB8[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(128, 128, 0, 0),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sSpriteAffineAnim_8624CC8[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(128, 128, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(32, 32, 0, 4),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sSpriteAffineAnim_8624CE0[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(-32, -32, 0, 4),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd *const sSpriteAffineAnimTable_8624CF8[] =
|
||||
{
|
||||
sSpriteAffineAnim_8624CB8,
|
||||
sSpriteAffineAnim_8624CC8,
|
||||
sSpriteAffineAnim_8624CE0
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gUnknown_08624D04 =
|
||||
{
|
||||
.tileTag = 9,
|
||||
.paletteTag = 15,
|
||||
.oam = &sOamData_8624CB0,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = sSpriteAffineAnimTable_8624CF8,
|
||||
.callback = SpriteCallbackDummy,
|
||||
};
|
||||
|
||||
void sub_81D13FC(struct Pokenav10Struct *structPtr)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
LoadCompressedSpriteSheet(&gUnknown_08624C78);
|
||||
Pokenav_AllocAndLoadPalettes(gUnknown_08624C80);
|
||||
|
||||
spriteId = CreateSprite(&gUnknown_08624D04, 0, 0, 0);
|
||||
structPtr->field_14 = &gSprites[spriteId];
|
||||
structPtr->field_14->invisible = TRUE;
|
||||
}
|
||||
|
||||
void sub_81D1448(struct Pokenav10Struct *structPtr)
|
||||
{
|
||||
u32 ribbonId;
|
||||
s32 r4 = sub_81D0944();
|
||||
s32 r5 = (r4 % 9) * 16 + 96;
|
||||
s32 r0 = (r4 / 9) * 16 + 40;
|
||||
|
||||
structPtr->field_14->pos1.x = r5;
|
||||
structPtr->field_14->pos1.y = r0;
|
||||
|
||||
ribbonId = sub_81D0954();
|
||||
structPtr->field_14->oam.tileNum = (gUnknown_08624BF8[ribbonId].var0 * 16) + GetSpriteTileStartByTag(9);
|
||||
structPtr->field_14->oam.paletteNum = IndexOfSpritePaletteTag(gUnknown_08624BF8[ribbonId].var2 + 15);
|
||||
|
||||
StartSpriteAffineAnim(structPtr->field_14, 1);
|
||||
structPtr->field_14->invisible = FALSE;
|
||||
structPtr->field_14->data[0] = 0;
|
||||
structPtr->field_14->callback = sub_81D1538;
|
||||
}
|
||||
|
||||
void sub_81D1500(struct Pokenav10Struct *structPtr)
|
||||
{
|
||||
structPtr->field_14->data[0] = 1;
|
||||
StartSpriteAffineAnim(structPtr->field_14, 2);
|
||||
structPtr->field_14->callback = sub_81D1538;
|
||||
}
|
||||
|
||||
bool32 sub_81D1524(struct Pokenav10Struct *structPtr)
|
||||
{
|
||||
return (structPtr->field_14->callback != SpriteCallbackDummy);
|
||||
}
|
||||
|
||||
void sub_81D1538(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->affineAnimEnded)
|
||||
{
|
||||
sprite->invisible = sprite->data[0];
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
}
|
18
src/pokenav_unk_2.c
Normal file
18
src/pokenav_unk_2.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include "global.h"
|
||||
#include "gym_leader_rematch.h"
|
||||
#include "pokenav.h"
|
||||
|
||||
bool32 sub_81C98D4(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < REMATCH_TABLE_ENTRIES; i++)
|
||||
{
|
||||
if (sub_81CB0C8(i) == gMapHeader.regionMapSectionId
|
||||
&& sub_81CAE08(i)
|
||||
&& gSaveBlock1Ptr->trainerRematches[i])
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
@ -282,7 +282,7 @@ int unref_sub_81CAE6C(int arg0)
|
||||
arg0 += state->unkC;
|
||||
if (arg0 >= state->unkA)
|
||||
return REMATCH_TABLE_ENTRIES;
|
||||
|
||||
|
||||
return state->unk1C[arg0].unk2;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ int sub_81CAF04(int index)
|
||||
index = GetTrainerIdxByRematchIdx(state->unk1C[index].unk2);
|
||||
return gTrainers[index].trainerPic;
|
||||
}
|
||||
|
||||
|
||||
var0 = state->unk1C[index].unk2;
|
||||
index = MatchCall_GetRematchTableIdx(var0);
|
||||
if (index != REMATCH_TABLE_ENTRIES)
|
||||
@ -411,7 +411,7 @@ void sub_81CB050(u32 arg0, u8 *str)
|
||||
}
|
||||
}
|
||||
|
||||
int sub_81CB0C8(int rematchIndex)
|
||||
u8 sub_81CB0C8(int rematchIndex)
|
||||
{
|
||||
int mapGroup = gRematchTable[rematchIndex].mapGroup;
|
||||
int mapNum = gRematchTable[rematchIndex].mapNum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user