Merge with master

This commit is contained in:
DizzyEggg 2019-04-08 09:37:41 +02:00
commit 0e02c28927
33 changed files with 20506 additions and 22376 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

864
asm/pokenav_unk_1.s Normal file
View File

@ -0,0 +1,864 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
@ File centered around AllocSubstruct(1)
thumb_func_start sub_81C9268
sub_81C9268: @ 81C9268
push {r4,lr}
movs r4, 0
movs r0, 0x98
lsls r0, 1
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _081C928A
movs r4, 0x1
ldr r0, =0x0000089b
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _081C928A
movs r4, 0x2
_081C928A:
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
.pool
thumb_func_end sub_81C9268
thumb_func_start sub_81C9298
sub_81C9298: @ 81C9298
push {r4,lr}
movs r0, 0x1
movs r1, 0x10
bl AllocSubstruct
adds r4, r0, 0
cmp r4, 0
beq _081C92C4
bl sub_81C9268
lsls r0, 24
lsrs r0, 24
movs r1, 0
strh r0, [r4]
strh r1, [r4, 0x2]
strh r1, [r4, 0x4]
strh r1, [r4, 0x6]
adds r0, r4, 0
bl sub_81C939C
movs r0, 0x1
b _081C92C6
_081C92C4:
movs r0, 0
_081C92C6:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C9298
thumb_func_start sub_81C92CC
sub_81C92CC: @ 81C92CC
push {r4,lr}
movs r0, 0x1
movs r1, 0x10
bl AllocSubstruct
adds r4, r0, 0
cmp r4, 0
beq _081C92FA
bl sub_81C9268
lsls r0, 24
lsrs r0, 24
movs r1, 0
strh r0, [r4]
movs r0, 0x2
strh r0, [r4, 0x2]
strh r0, [r4, 0x4]
strh r1, [r4, 0x6]
adds r0, r4, 0
bl sub_81C939C
movs r0, 0x1
b _081C92FC
_081C92FA:
movs r0, 0
_081C92FC:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C92CC
thumb_func_start sub_81C9304
sub_81C9304: @ 81C9304
push {r4,lr}
movs r0, 0x1
movs r1, 0x10
bl AllocSubstruct
adds r4, r0, 0
cmp r4, 0
beq _081C932E
bl sub_81C9268
lsls r0, 24
lsrs r0, 24
strh r0, [r4]
movs r0, 0x3
strh r0, [r4, 0x2]
strh r0, [r4, 0x4]
adds r0, r4, 0
bl sub_81C939C
movs r0, 0x1
b _081C9330
_081C932E:
movs r0, 0
_081C9330:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C9304
thumb_func_start sub_81C9338
sub_81C9338: @ 81C9338
push {lr}
movs r0, 0x1
movs r1, 0x10
bl AllocSubstruct
adds r2, r0, 0
cmp r2, 0
beq _081C9360
movs r0, 0
movs r1, 0x3
strh r1, [r2]
strh r0, [r2, 0x2]
movs r1, 0x5
strh r1, [r2, 0x4]
strh r0, [r2, 0x6]
adds r0, r2, 0
bl sub_81C939C
movs r0, 0x1
b _081C9362
_081C9360:
movs r0, 0
_081C9362:
pop {r1}
bx r1
thumb_func_end sub_81C9338
thumb_func_start sub_81C9368
sub_81C9368: @ 81C9368
push {r4,r5,lr}
movs r0, 0x1
movs r1, 0x10
bl AllocSubstruct
adds r5, r0, 0
cmp r5, 0
beq _081C9394
movs r4, 0
movs r0, 0x4
strh r0, [r5]
bl sub_81C76AC
strh r0, [r5, 0x2]
adds r0, 0x8
strh r0, [r5, 0x4]
strh r4, [r5, 0x6]
adds r0, r5, 0
bl sub_81C939C
movs r0, 0x1
b _081C9396
_081C9394:
movs r0, 0
_081C9396:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_81C9368
thumb_func_start sub_81C939C
sub_81C939C: @ 81C939C
push {r4,lr}
adds r4, r0, 0
ldrh r0, [r4]
cmp r0, 0x4
bhi _081C93E0
lsls r0, 2
ldr r1, =_081C93B4
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081C93B4:
.4byte _081C93C8
.4byte _081C93CE
.4byte _081C93CE
.4byte _081C93D4
.4byte _081C93DC
_081C93C8:
movs r0, 0
bl SetPokenavMode
_081C93CE:
bl sub_81C93EC
b _081C93DE
_081C93D4:
ldr r0, =sub_81C963C
b _081C93DE
.pool
_081C93DC:
ldr r0, =sub_81C96FC
_081C93DE:
str r0, [r4, 0xC]
_081C93E0:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C939C
thumb_func_start sub_81C93EC
sub_81C93EC: @ 81C93EC
push {lr}
bl GetPokenavMode
cmp r0, 0x1
beq _081C9408
cmp r0, 0x1
bcc _081C93FE
cmp r0, 0x2
beq _081C9410
_081C93FE:
ldr r0, =sub_81C943C
b _081C9412
.pool
_081C9408:
ldr r0, =sub_81C9520
b _081C9412
.pool
_081C9410:
ldr r0, =c2_pre_battle_1
_081C9412:
pop {r1}
bx r1
.pool
thumb_func_end sub_81C93EC
thumb_func_start sub_81C941C
sub_81C941C: @ 81C941C
push {lr}
movs r0, 0x1
bl GetSubstructPtr
ldr r1, [r0, 0xC]
bl _call_via_r1
pop {r1}
bx r1
thumb_func_end sub_81C941C
thumb_func_start sub_81C9430
sub_81C9430: @ 81C9430
push {lr}
movs r0, 0x1
bl FreePokenavSubstruct
pop {r0}
bx r0
thumb_func_end sub_81C9430
thumb_func_start sub_81C943C
sub_81C943C: @ 81C943C
push {r4,r5,lr}
adds r4, r0, 0
bl sub_81C9814
cmp r0, 0
beq _081C944C
movs r0, 0x1
b _081C951A
_081C944C:
ldr r2, =gMain
ldrh r1, [r2, 0x2E]
movs r0, 0x1
ands r0, r1
adds r5, r2, 0
cmp r0, 0
beq _081C9508
ldr r3, =gUnknown_0861FC59
movs r0, 0x2
ldrsh r1, [r4, r0]
ldrh r2, [r4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 1
adds r1, r0
adds r1, r3
ldrb r0, [r1]
cmp r0, 0x4
bhi _081C9508
lsls r0, 2
ldr r1, =_081C9488
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081C9488:
.4byte _081C949C
.4byte _081C94BC
.4byte _081C94D4
.4byte _081C94E0
.4byte _081C9516
_081C949C:
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r1, [r0, 0x15]
movs r0, 0x8
ands r0, r1
movs r1, 0x1
cmp r0, 0
beq _081C94AE
movs r1, 0x2
_081C94AE:
strh r1, [r4, 0x6]
ldr r1, =0x000186a6
b _081C94EE
.pool
_081C94BC:
movs r1, 0
movs r0, 0x3
strh r0, [r4]
strh r1, [r4, 0x2]
ldrb r0, [r3, 0x12]
strh r0, [r4, 0x4]
ldr r0, =sub_81C963C
str r0, [r4, 0xC]
movs r0, 0x2
b _081C951A
.pool
_081C94D4:
movs r0, 0x6
strh r0, [r4, 0x6]
ldr r1, =0x000186ab
b _081C94EE
.pool
_081C94E0:
bl CanViewRibbonsMenu
cmp r0, 0
beq _081C94FC
movs r0, 0x9
strh r0, [r4, 0x6]
ldr r1, =0x000186ac
_081C94EE:
adds r0, r4, 0
bl sub_81C97B0
movs r0, 0x8
b _081C951A
.pool
_081C94FC:
ldr r0, =sub_81C9600
str r0, [r4, 0xC]
movs r0, 0x6
b _081C951A
.pool
_081C9508:
ldrh r1, [r5, 0x2E]
movs r0, 0x2
ands r0, r1
cmp r0, 0
bne _081C9516
movs r0, 0
b _081C951A
_081C9516:
movs r0, 0x1
negs r0, r0
_081C951A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_81C943C
thumb_func_start sub_81C9520
sub_81C9520: @ 81C9520
push {r4,lr}
adds r4, r0, 0
bl sub_81C9814
cmp r0, 0
beq _081C9530
movs r0, 0x1
b _081C9580
_081C9530:
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _081C9570
ldr r3, =gUnknown_0861FC59
movs r0, 0x2
ldrsh r1, [r4, r0]
ldrh r2, [r4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 1
adds r1, r0
adds r1, r3
ldrb r0, [r1]
cmp r0, 0x2
bne _081C9578
movs r0, 0x6
strh r0, [r4, 0x6]
ldr r1, =0x000186ab
adds r0, r4, 0
bl sub_81C97B0
movs r0, 0x8
b _081C9580
.pool
_081C9570:
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _081C957E
_081C9578:
movs r0, 0x20
bl PlaySE
_081C957E:
movs r0, 0
_081C9580:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C9520
thumb_func_start c2_pre_battle_1
c2_pre_battle_1: @ 81C9588
push {r4,lr}
adds r4, r0, 0
bl sub_81C9814
cmp r0, 0
beq _081C9598
movs r0, 0x1
b _081C95F8
_081C9598:
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _081C95E8
ldr r3, =gUnknown_0861FC59
movs r0, 0x2
ldrsh r1, [r4, r0]
ldrh r2, [r4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 1
adds r1, r0
adds r1, r3
ldrb r0, [r1]
cmp r0, 0x2
beq _081C95D4
cmp r0, 0x4
beq _081C95F4
movs r0, 0x20
bl PlaySE
movs r0, 0
b _081C95F8
.pool
_081C95D4:
movs r0, 0x6
strh r0, [r4, 0x6]
ldr r1, =0x000186ab
adds r0, r4, 0
bl sub_81C97B0
movs r0, 0x8
b _081C95F8
.pool
_081C95E8:
movs r0, 0x2
ands r0, r1
cmp r0, 0
bne _081C95F4
movs r0, 0
b _081C95F8
_081C95F4:
movs r0, 0x1
negs r0, r0
_081C95F8:
pop {r4}
pop {r1}
bx r1
thumb_func_end c2_pre_battle_1
thumb_func_start sub_81C9600
sub_81C9600: @ 81C9600
push {r4,lr}
adds r4, r0, 0
bl sub_81C9814
cmp r0, 0
beq _081C9616
bl sub_81C93EC
str r0, [r4, 0xC]
movs r0, 0x1
b _081C9634
_081C9616:
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x3
ands r0, r1
cmp r0, 0
bne _081C962C
movs r0, 0
b _081C9634
.pool
_081C962C:
bl sub_81C93EC
str r0, [r4, 0xC]
movs r0, 0x7
_081C9634:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C9600
thumb_func_start sub_81C963C
sub_81C963C: @ 81C963C
push {r4-r6,lr}
adds r4, r0, 0
bl sub_81C9814
adds r3, r0, 0
cmp r3, 0
beq _081C964E
movs r0, 0x1
b _081C96F6
_081C964E:
ldr r2, =gMain
ldrh r1, [r2, 0x2E]
movs r0, 0x1
ands r0, r1
adds r6, r2, 0
cmp r0, 0
beq _081C96B8
ldr r5, =gUnknown_0861FC59
movs r1, 0x2
ldrsh r0, [r4, r1]
ldrh r2, [r4]
lsls r1, r2, 1
adds r1, r2
lsls r1, 1
adds r0, r1
adds r0, r5
ldrb r0, [r0]
cmp r0, 0x6
beq _081C968E
cmp r0, 0x6
bgt _081C9688
cmp r0, 0x5
beq _081C96A4
b _081C96B8
.pool
_081C9688:
cmp r0, 0x7
beq _081C96E4
b _081C96B8
_081C968E:
movs r0, 0x4
strh r0, [r4]
strh r3, [r4, 0x2]
ldrb r0, [r5, 0x18]
strh r0, [r4, 0x4]
ldr r0, =sub_81C96FC
str r0, [r4, 0xC]
movs r0, 0x4
b _081C96F6
.pool
_081C96A4:
strh r3, [r4, 0x6]
ldr r1, =0x000186a7
adds r0, r4, 0
bl sub_81C97B0
movs r0, 0x8
b _081C96F6
.pool
_081C96B8:
ldrh r1, [r6, 0x2E]
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _081C96F4
movs r0, 0x2
ldrsh r2, [r4, r0]
ldr r1, =gUnknown_0861FC54
ldrh r0, [r4]
adds r0, r1
ldrb r0, [r0]
cmp r2, r0
beq _081C96E4
strh r0, [r4, 0x2]
ldr r0, =sub_81C9798
str r0, [r4, 0xC]
movs r0, 0x1
b _081C96F6
.pool
_081C96E4:
movs r0, 0x5
bl PlaySE
adds r0, r4, 0
bl sub_81C97C0
movs r0, 0x3
b _081C96F6
_081C96F4:
movs r0, 0
_081C96F6:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_81C963C
thumb_func_start sub_81C96FC
sub_81C96FC: @ 81C96FC
push {r4,lr}
adds r4, r0, 0
bl sub_81C9814
cmp r0, 0
beq _081C970C
movs r0, 0x1
b _081C9792
_081C970C:
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _081C9754
ldr r3, =gUnknown_0861FC59
movs r0, 0x2
ldrsh r1, [r4, r0]
ldrh r2, [r4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 1
adds r1, r0
adds r1, r3
ldrb r0, [r1]
cmp r0, 0xD
beq _081C9780
subs r0, 0x8
bl sub_81C7694
ldr r1, =0x000186a8
adds r0, r4, 0
bl sub_81C97B0
movs r0, 0x3
strh r0, [r4, 0x6]
movs r0, 0x8
b _081C9792
.pool
_081C9754:
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _081C9790
movs r0, 0x2
ldrsh r2, [r4, r0]
ldr r1, =gUnknown_0861FC54
ldrh r0, [r4]
adds r0, r1
ldrb r0, [r0]
cmp r2, r0
beq _081C9780
strh r0, [r4, 0x2]
ldr r0, =sub_81C97A4
str r0, [r4, 0xC]
movs r0, 0x1
b _081C9792
.pool
_081C9780:
movs r0, 0x5
bl PlaySE
adds r0, r4, 0
bl sub_81C97F8
movs r0, 0x5
b _081C9792
_081C9790:
movs r0, 0
_081C9792:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81C96FC
thumb_func_start sub_81C9798
sub_81C9798: @ 81C9798
push {lr}
bl sub_81C97C0
movs r0, 0x3
pop {r1}
bx r1
thumb_func_end sub_81C9798
thumb_func_start sub_81C97A4
sub_81C97A4: @ 81C97A4
push {lr}
bl sub_81C97F8
movs r0, 0x5
pop {r1}
bx r1
thumb_func_end sub_81C97A4
thumb_func_start sub_81C97B0
sub_81C97B0: @ 81C97B0
str r1, [r0, 0x8]
ldr r1, =sub_81C97BC
str r1, [r0, 0xC]
bx lr
.pool
thumb_func_end sub_81C97B0
thumb_func_start sub_81C97BC
sub_81C97BC: @ 81C97BC
ldr r0, [r0, 0x8]
bx lr
thumb_func_end sub_81C97BC
thumb_func_start sub_81C97C0
sub_81C97C0: @ 81C97C0
push {r4,lr}
adds r4, r0, 0
bl sub_81C9268
lsls r0, 24
lsrs r0, 24
strh r0, [r4]
movs r0, 0x1
strh r0, [r4, 0x2]
ldr r2, =gUnknown_0861FC59
ldrh r1, [r4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 1
adds r0, 0x1
adds r0, r2
ldrb r0, [r0]
strh r0, [r4, 0x4]
ldr r0, =sub_81C943C
str r0, [r4, 0xC]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C97C0
thumb_func_start sub_81C97F8
sub_81C97F8: @ 81C97F8
movs r1, 0x3
strh r1, [r0]
movs r1, 0x1
strh r1, [r0, 0x2]
ldr r1, =gUnknown_0861FC59
ldrb r1, [r1, 0x13]
strh r1, [r0, 0x4]
ldr r1, =sub_81C963C
str r1, [r0, 0xC]
bx lr
.pool
thumb_func_end sub_81C97F8
thumb_func_start sub_81C9814
sub_81C9814: @ 81C9814
push {r4,r5,lr}
adds r4, r0, 0
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x40
ands r0, r1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, 0
beq _081C9848
ldrh r0, [r4, 0x2]
subs r0, 0x1
strh r0, [r4, 0x2]
lsls r0, 16
ldrh r3, [r4]
cmp r0, 0
bge _081C986A
ldr r0, =gUnknown_0861FC54
adds r0, r3, r0
ldrb r0, [r0]
strh r0, [r4, 0x2]
b _081C986A
.pool
_081C9848:
movs r0, 0x80
ands r0, r1
cmp r0, 0
beq _081C988C
ldrh r0, [r4, 0x2]
adds r0, 0x1
strh r0, [r4, 0x2]
movs r0, 0x2
ldrsh r2, [r4, r0]
ldr r0, =gUnknown_0861FC54
ldrh r1, [r4]
adds r0, r1, r0
adds r3, r1, 0
ldrb r0, [r0]
cmp r2, r0
ble _081C986A
strh r5, [r4, 0x2]
_081C986A:
ldr r2, =gUnknown_0861FC59
movs r0, 0x2
ldrsh r1, [r4, r0]
lsls r0, r3, 1
adds r0, r3
lsls r0, 1
adds r1, r0
adds r1, r2
ldrb r0, [r1]
strh r0, [r4, 0x4]
movs r0, 0x1
b _081C988E
.pool
_081C988C:
movs r0, 0
_081C988E:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_81C9814
thumb_func_start sub_81C9894
sub_81C9894: @ 81C9894
push {lr}
movs r0, 0x1
bl GetSubstructPtr
ldrh r0, [r0]
pop {r1}
bx r1
thumb_func_end sub_81C9894
thumb_func_start sub_81C98A4
sub_81C98A4: @ 81C98A4
push {lr}
movs r0, 0x1
bl GetSubstructPtr
movs r1, 0x2
ldrsh r0, [r0, r1]
pop {r1}
bx r1
thumb_func_end sub_81C98A4
thumb_func_start sub_81C98B4
sub_81C98B4: @ 81C98B4
push {lr}
movs r0, 0x1
bl GetSubstructPtr
ldrh r0, [r0, 0x4]
pop {r1}
bx r1
thumb_func_end sub_81C98B4
thumb_func_start sub_81C98C4
sub_81C98C4: @ 81C98C4
push {lr}
movs r0, 0x1
bl GetSubstructPtr
ldrh r0, [r0, 0x6]
pop {r1}
bx r1
thumb_func_end sub_81C98C4
.align 2, 0 @ Don't pad with nop.

2185
asm/pokenav_unk_10.s Normal file

File diff suppressed because it is too large Load Diff

2277
asm/pokenav_unk_2.s Normal file

File diff suppressed because it is too large Load Diff

1036
asm/pokenav_unk_3.s Normal file

File diff suppressed because it is too large Load Diff

2347
asm/pokenav_unk_4.s Normal file

File diff suppressed because it is too large Load Diff

1396
asm/pokenav_unk_5.s Normal file

File diff suppressed because it is too large Load Diff

1752
asm/pokenav_unk_6.s Normal file

File diff suppressed because it is too large Load Diff

2001
asm/pokenav_unk_7.s Normal file

File diff suppressed because it is too large Load Diff

1377
asm/pokenav_unk_8.s Normal file

File diff suppressed because it is too large Load Diff

1393
asm/pokenav_unk_9.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,133 +4,6 @@
.section .rodata
.align 2
gPkmnJumpSpecies:: @ 82FB464
.2byte SPECIES_BULBASAUR, 0x0002
.2byte SPECIES_CHARMANDER, 0x0001
.2byte SPECIES_SQUIRTLE, 0x0000
.2byte SPECIES_CATERPIE, 0x0001
.2byte SPECIES_METAPOD, 0x0001
.2byte SPECIES_WEEDLE, 0x0001
.2byte SPECIES_KAKUNA, 0x0001
.2byte SPECIES_RATTATA, 0x0001
.2byte SPECIES_RATICATE, 0x0001
.2byte SPECIES_PIKACHU, 0x0000
.2byte SPECIES_SANDSHREW, 0x0000
.2byte SPECIES_NIDORAN_F, 0x0000
.2byte SPECIES_NIDORAN_M, 0x0000
.2byte SPECIES_CLEFAIRY, 0x0000
.2byte SPECIES_VULPIX, 0x0000
.2byte SPECIES_JIGGLYPUFF, 0x0002
.2byte SPECIES_ODDISH, 0x0002
.2byte SPECIES_PARAS, 0x0001
.2byte SPECIES_MEOWTH, 0x0000
.2byte SPECIES_PSYDUCK, 0x0002
.2byte SPECIES_MANKEY, 0x0001
.2byte SPECIES_GROWLITHE, 0x0001
.2byte SPECIES_POLIWAG, 0x0002
.2byte SPECIES_BELLSPROUT, 0x0002
.2byte SPECIES_SHELLDER, 0x0001
.2byte SPECIES_KRABBY, 0x0001
.2byte SPECIES_EXEGGCUTE, 0x0002
.2byte SPECIES_CUBONE, 0x0000
.2byte SPECIES_DITTO, 0x0002
.2byte SPECIES_EEVEE, 0x0000
.2byte SPECIES_OMANYTE, 0x0001
.2byte SPECIES_KABUTO, 0x0001
.2byte SPECIES_CHIKORITA, 0x0002
.2byte SPECIES_CYNDAQUIL, 0x0001
.2byte SPECIES_TOTODILE, 0x0000
.2byte SPECIES_SPINARAK, 0x0001
.2byte SPECIES_PICHU, 0x0000
.2byte SPECIES_CLEFFA, 0x0000
.2byte SPECIES_IGGLYBUFF, 0x0002
.2byte SPECIES_TOGEPI, 0x0002
.2byte SPECIES_MAREEP, 0x0000
.2byte SPECIES_BELLOSSOM, 0x0002
.2byte SPECIES_MARILL, 0x0002
.2byte SPECIES_SUNKERN, 0x0002
.2byte SPECIES_WOOPER, 0x0002
.2byte SPECIES_PINECO, 0x0002
.2byte SPECIES_SNUBBULL, 0x0000
.2byte SPECIES_SHUCKLE, 0x0002
.2byte SPECIES_TEDDIURSA, 0x0000
.2byte SPECIES_SLUGMA, 0x0002
.2byte SPECIES_SWINUB, 0x0000
.2byte SPECIES_HOUNDOUR, 0x0001
.2byte SPECIES_PHANPY, 0x0000
.2byte SPECIES_PORYGON2, 0x0000
.2byte SPECIES_TYROGUE, 0x0001
.2byte SPECIES_SMOOCHUM, 0x0002
.2byte SPECIES_ELEKID, 0x0001
.2byte SPECIES_MAGBY, 0x0001
.2byte SPECIES_LARVITAR, 0x0001
.2byte SPECIES_TREECKO, 0x0001
.2byte SPECIES_TORCHIC, 0x0002
.2byte SPECIES_MUDKIP, 0x0000
.2byte SPECIES_MARSHTOMP, 0x0000
.2byte SPECIES_POOCHYENA, 0x0001
.2byte SPECIES_ZIGZAGOON, 0x0000
.2byte SPECIES_LINOONE, 0x0000
.2byte SPECIES_WURMPLE, 0x0001
.2byte SPECIES_SILCOON, 0x0002
.2byte SPECIES_CASCOON, 0x0002
.2byte SPECIES_LOTAD, 0x0002
.2byte SPECIES_SEEDOT, 0x0001
.2byte SPECIES_RALTS, 0x0000
.2byte SPECIES_KIRLIA, 0x0000
.2byte SPECIES_SURSKIT, 0x0002
.2byte SPECIES_SHROOMISH, 0x0002
.2byte SPECIES_NINCADA, 0x0001
.2byte SPECIES_WHISMUR, 0x0000
.2byte SPECIES_AZURILL, 0x0002
.2byte SPECIES_SKITTY, 0x0000
.2byte SPECIES_SABLEYE, 0x0000
.2byte SPECIES_MAWILE, 0x0000
.2byte SPECIES_ARON, 0x0001
.2byte SPECIES_MEDITITE, 0x0002
.2byte SPECIES_ELECTRIKE, 0x0001
.2byte SPECIES_PLUSLE, 0x0001
.2byte SPECIES_MINUN, 0x0001
.2byte SPECIES_VOLBEAT, 0x0000
.2byte SPECIES_ILLUMISE, 0x0000
.2byte SPECIES_ROSELIA, 0x0002
.2byte SPECIES_GULPIN, 0x0002
.2byte SPECIES_NUMEL, 0x0002
.2byte SPECIES_TORKOAL, 0x0002
.2byte SPECIES_SPOINK, 0x0000
.2byte SPECIES_TRAPINCH, 0x0002
.2byte SPECIES_CACNEA, 0x0002
.2byte SPECIES_ANORITH, 0x0001
.2byte SPECIES_WYNAUT, 0x0000
.2byte SPECIES_SNORUNT, 0x0000
.2byte SPECIES_CLAMPERL, 0x0001
.2byte SPECIES_BAGON, 0x0001
.align 2
gUnknown_082FB5F4:: @ 82FB5F4
.4byte sub_802B248
.4byte sub_802B2D4
.4byte sub_802B368
.4byte sub_802B3D4
.4byte sub_802B4CC
.4byte sub_802B5C8
.4byte sub_802B664
.4byte sub_802B6B8
.4byte sub_802B720
.align 2
gUnknown_082FB618:: @ 82FB618
.4byte sub_802B29C
.4byte sub_802B31C
.4byte sub_802B3B4
.4byte sub_802B470
.4byte sub_802B568
.4byte sub_802B628
.4byte sub_802B664
.4byte sub_802B704
.4byte sub_802B720
.align 2
gUnknown_082FB63C:: @ 82FB63C
.2byte 0x001a, 0x001f, 0x0024, 0x0029, 0x002e, 0x0033, 0x0038, 0x003d

View File

@ -3,118 +3,7 @@
.section .rodata
gUnknown_0861FA6C:: @ 861FA6C
obj_tiles gPokenavLeftHeaderMainMenu_Gfx, 0x20, 3
obj_tiles gPokenavLeftHeaderCondition_Gfx, 0x20, 1
obj_tiles gPokenavLeftHeaderRibbons_Gfx, 0x20, 2
obj_tiles gPokenavLeftHeaderMatchCall_Gfx, 0x20, 4
obj_tiles gPokenavLeftHeaderHoennMap_Gfx, 0x20, 0
obj_tiles gPokenavLeftHeaderHoennMap_Gfx, 0x40, 0
gUnknown_0861FA9C:: @ 861FA9C
.4byte gPokenavLeftHeaderParty_Gfx, 1
.4byte gPokenavLeftHeaderSearch_Gfx, 1
.4byte gPokenavLeftHeaderCool_Gfx, 4
.4byte gPokenavLeftHeaderBeauty_Gfx, 1
.4byte gPokenavLeftHeaderCute_Gfx, 2
.4byte gPokenavLeftHeaderSmart_Gfx, 0
.4byte gPokenavLeftHeaderTough_Gfx, 0
gUnknown_0861FAD4:: @ 861FAD4
.2byte 0x0
.2byte 0x8000
.2byte 0x0
.2byte 0x0
gUnknown_0861FADC::
obj_image_anim_frame 0, 8
obj_image_anim_frame 16, 8
obj_image_anim_frame 32, 8
obj_image_anim_frame 48, 8
obj_image_anim_frame 64, 8
obj_image_anim_frame 80, 8
obj_image_anim_frame 96, 8
obj_image_anim_frame 112, 8
obj_image_anim_jump 0
gUnknown_0861FB00::
.4byte gUnknown_0861FADC
gUnknown_0861FB04:: @ 861FB04
spr_template 0, 0, gUnknown_0861FAD4, gUnknown_0861FB00, NULL, gDummySpriteAffineAnimTable, sub_81C7CB4
gUnknown_0861FB1C::
.2byte 0x4000
.2byte 0xC000
.2byte 0x400
.2byte 0x0
gUnknown_0861FB24::
.2byte 0x4000
.2byte 0x8000
.2byte 0x400
.2byte 0x0
gUnknown_0861FB2C:: @ 861FB2C
spr_template 2, 1, gUnknown_0861FB1C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_0861FB44:: @ 861FB44
spr_template 2, 2, gUnknown_0861FB24, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_0861FB5C:: @ 861FB5C
.incbin "graphics/pokenav/arrows_matchcall.gbapal"
gUnknown_0861FB7C:: @ 861FB7C
.incbin "graphics/pokenav/arrows_matchcall.4bpp.lz"
gUnknown_0861FBE4:: @ 861FBE4
.byte 0x0
.byte 0x2
.byte 0x5
.byte 0x0
gUnknown_0861FBE8:: @ 861FBE8
.4byte gUnknown_085EBEA8
.4byte gUnknown_085EBEB1
.4byte gUnknown_085EBEC3
gUnknown_0861FBF4:: @ 861FBF4
.byte 0x1
.byte 0x4
.byte 0x5
gUnknown_0861FBF7:: @ 861FBF7
.byte 0x2
.byte 0x4
.byte 0x6
.byte 0x7
.byte 0x0
gUnknown_0861FBFC:: @ 861FBFC
.4byte gUnknown_0861FB7C
.2byte 0xC0
.2byte 0xA
gUnknown_0861FC04:: @ 861FC04
.4byte gUnknown_0861FB5C
.4byte 0x14
.4byte 0x0
.4byte 0x0
gUnknown_0861FC14:: @ 861FC14
.4byte 0x8000
.4byte 0x800
gUnknown_0861FC1C:: @ 861FC1C
spr_template 10, 20, gUnknown_0861FC14, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81C9080
gUnknown_0861FC34:: @ 861FC34
.4byte 0x4000
.4byte 0x800
gUnknown_0861FC3C:: @ 861FC3C
spr_template 10, 20, gUnknown_0861FC34, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
// pokenav_unk_1.s
gUnknown_0861FC54:: @ 861FC54
.byte 2
.byte 3
@ -125,6 +14,7 @@ gUnknown_0861FC54:: @ 861FC54
gUnknown_0861FC59:: @ 861FC59
.byte 0, 1, 4, 4, 4, 4, 0, 1, 2, 4, 4, 4, 0, 1, 2, 3, 4, 4, 5, 6, 7, 4, 4, 4, 8, 9, 10, 11, 12, 13, 0
// pokenav_unk_2.s
gUnknown_0861FC78:: @ 861FC78
.incbin "graphics/pokenav/bg.gbapal"
@ -314,6 +204,7 @@ gUnknown_08620384:: @ 8620384
.4byte 0xa2600001
.byte 1, 0, 0, 0
// pokenav_unk_3.s
gUnknown_08620390:: @ 8620390
.string "Becalm fighting emotions.$"
@ -1339,6 +1230,7 @@ gUnknown_08622508:: @ 8622508
gUnknown_0862250A:: @ 862250A
.byte 0, 1, 2, 0, 0, 0
// pokenav_unk_4.s
gUnknown_08622510:: @ 8622510
.incbin "graphics/pokenav/ui_matchcall.gbapal"
@ -1371,7 +1263,7 @@ gUnknown_0862278C:: @ 862278C
.4byte 0x20206A
gUnknown_08622794:: @ 8622794
.4byte 0x3077
.4byte 0x00003077
gUnknown_08622798:: @ 8622798
.4byte NULL
@ -1435,6 +1327,7 @@ gUnknown_08622848:: @ 8622848
gUnknown_08622850:: @ 8622850
spr_template 8, 13, gUnknown_08622848, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
// pokenav_unk_5.s
gUnknown_08622868:: @ 8622868
.incbin "graphics/pokenav/8622868.gbapal"
@ -1568,6 +1461,10 @@ gUnknown_086231C8:: @ 86231C8
gUnknown_086231D0:: @ 86231D0
spr_template 6, 11, gUnknown_086231C8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81CCEF4
// pokenav_unk_6.s
// <none>
// pokenav_unk_7.s
gUnknown_086231E8:: @ 86231E8
.incbin "graphics/pokenav/86231E8.gbapal"
@ -1600,6 +1497,7 @@ gUnknown_08623374:: @ 8623374
gUnknown_0862337C:: @ 862337C
window_template 1, 13, 0x1C, 3, 2, 15, 0x44
// pokenav_unk_8.s
gUnknown_08623384:: @ 8623384
.4byte NULL
.4byte sub_81CE37C
@ -1660,6 +1558,7 @@ gUnknown_086235D4:: @ 86235D4
.string "{UNK_SPACER}$"
.align 2
// pokenav_unk_9.s
gUnknown_086235D8:: @ 86235D8
.4byte sub_81CFB8C
.4byte sub_81CFC2C
@ -1707,6 +1606,7 @@ gUnknown_086237F4:: @ 86237F4
.string "{UNK_SPACER}$"
.align 2
// pokenav_unk_10.s
gUnknown_086237F8:: @ 86237F8
.byte 1, 1, 0, 0
.byte 3, 4, 1, 0

View File

@ -463,7 +463,7 @@
#define MUS_RG_SOUSA 535 // Starting Tutorial
#define MUS_RG_SEKAIKAN 536 // Starting Tutorial 2
#define MUS_RG_SEIBETU 537 // Starting Tutorial 3
#define MUS_RG_JUMP 538 // Jumping Minigame
#define MUS_RG_JUMP 538 // Pokemon Jump Minigame
#define MUS_RG_UNION 539 // Union Room
#define MUS_RG_NETWORK 540 // Network Center
#define MUS_RG_OKURIMONO 541 // Mystery Gift

View File

@ -4283,6 +4283,13 @@ extern const u32 gPokenavLeftHeaderMainMenu_Gfx[];
extern const u32 gPokenavLeftHeaderCondition_Gfx[];
extern const u32 gPokenavLeftHeaderRibbons_Gfx[];
extern const u32 gPokenavLeftHeaderMatchCall_Gfx[];
extern const u32 gPokenavLeftHeaderParty_Gfx[];
extern const u32 gPokenavLeftHeaderSearch_Gfx[];
extern const u32 gPokenavLeftHeaderCool_Gfx[];
extern const u32 gPokenavLeftHeaderBeauty_Gfx[];
extern const u32 gPokenavLeftHeaderCute_Gfx[];
extern const u32 gPokenavLeftHeaderSmart_Gfx[];
extern const u32 gPokenavLeftHeaderTough_Gfx[];
extern const u32 gPageInfoTilemap[];
extern const u32 gUnknown_08D98CC8[];

View File

@ -99,6 +99,7 @@ void sub_8199CBC(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile);
void sub_8198314(void);
void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram);
void ResetBgPositions(void);
void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed);
void sub_8198C78(void);
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs);

10
include/pokemon_jump.h Executable file
View File

@ -0,0 +1,10 @@
#ifndef GUARD_POKEMON_JUMP_H
#define GUARD_POKEMON_JUMP_H
#include "main.h"
void sub_802A9A8(u16 monId, MainCallback callback);
#endif // GUARD_POKEMON_JUMP_H

View File

@ -1,6 +1,28 @@
#ifndef GUARD_POKENAV_H
#define GUARD_POKENAV_H
typedef u32 (*LoopedTask)(s32 state);
// Return values of LoopedTask functions.
#define LT_INC_AND_PAUSE 0
#define LT_INC_AND_CONTINUE 1
#define LT_PAUSE 2
#define LT_CONTINUE 3
#define LT_FINISH 4
#define LT_SET_STATE(newState) (newState + 5)
// pokenav.c
extern u32 sub_81C99D4(void);
void CB2_InitPokeNav(void);
u32 CreateLoopedTask(LoopedTask loopedTask, u32 priority);
bool32 FuncIsActiveLoopedTask(LoopedTask func);
void *GetSubstructPtr(u32 index);
void FreePokenavSubstruct(u32 index);
void *AllocSubstruct(u32 index, u32 size);
void Pokenav_AllocAndLoadPalettes(const struct SpritePalette *palettes);
bool32 IsLoopedTaskActive(u32 taskId);
// pokenav_match_call_ui.c
#endif //GUARD_POKENAV_H

View File

@ -1008,18 +1008,21 @@ extern const u8 gText_SomeonesPC[];
extern const u8 gText_PlayersPC[];
extern const u8 gText_WhichPCShouldBeAccessed[];
extern const u8 gText_Navgear_ClearButtonList[];
extern const u8 gText_NavgearMap_ZoomedOutButtons[];
extern const u8 gText_NavgearMap_ZoomedInButtons[];
extern const u8 gText_NavgearCondition_MonListButtons[];
extern const u8 gText_NavgearCondition_MonStatusButtons[];
extern const u8 gText_NavgearCondition_MarkingButtons[];
extern const u8 gText_NavgearMatchCall_TrainerListButtons[];
extern const u8 gText_NavgearMatchCall_CallMenuButtons[];
extern const u8 gText_NavgearMatchCall_CheckTrainerButtons[];
extern const u8 gText_NavgearRibbons_MonListButtons[];
extern const u8 gText_NavgearRibbons_RibbonListButtons[];
extern const u8 gText_NavgearRibbons_RibbonCheckButtons[];
extern const u8 gText_PokenavMatchCall_Strategy[];
extern const u8 gText_PokenavMatchCall_TrainerPokemon[];
extern const u8 gText_PokenavMatchCall_SelfIntroduction[];
extern const u8 gText_Pokenav_ClearButtonList[];
extern const u8 gText_PokenavMap_ZoomedOutButtons[];
extern const u8 gText_PokenavMap_ZoomedInButtons[];
extern const u8 gText_PokenavCondition_MonListButtons[];
extern const u8 gText_PokenavCondition_MonStatusButtons[];
extern const u8 gText_PokenavCondition_MarkingButtons[];
extern const u8 gText_PokenavMatchCall_TrainerListButtons[];
extern const u8 gText_PokenavMatchCall_CallMenuButtons[];
extern const u8 gText_PokenavMatchCall_CheckTrainerButtons[];
extern const u8 gText_PokenavRibbons_MonListButtons[];
extern const u8 gText_PokenavRibbons_RibbonListButtons[];
extern const u8 gText_PokenavRibbons_RibbonCheckButtons[];
extern const u8 gUnknown_085EAD37[];
extern const u8 gUnknown_085EAD41[];

View File

@ -69,6 +69,7 @@ SECTIONS {
asm/berry_crush.o(.text);
src/berry_powder.o(.text);
asm/dodrio_berry_picking.o(.text);
src/pokemon_jump.o(.text);
asm/pokemon_jump.o(.text);
src/rtc.o(.text);
src/main_menu.o(.text);
@ -300,8 +301,19 @@ SECTIONS {
src/unk_pokedex_area_screen_helper.o(.text);
src/battle_pyramid_bag.o(.text);
src/pokenav.o(.text);
asm/pokenav.o(.text);
src/pokenav_match_call.o(.text);
src/pokenav_main_menu.o(.text);
src/pokenav_match_call_ui.o(.text);
asm/pokenav_unk_1.o(.text);
asm/pokenav_unk_2.o(.text);
asm/pokenav_unk_3.o(.text);
asm/pokenav_unk_4.o(.text);
asm/pokenav_unk_5.o(.text);
asm/pokenav_unk_6.o(.text);
asm/pokenav_unk_7.o(.text);
asm/pokenav_unk_8.o(.text);
asm/pokenav_unk_9.o(.text);
asm/pokenav_unk_10.o(.text);
src/pokenav_match_call_data.o(.text);
src/menu_specialized.o(.text);
src/ereader_helpers.o(.text);
src/faraway_island.o(.text);
@ -423,6 +435,7 @@ SECTIONS {
data/berry_crush.o(.rodata);
data/berry_powder.o(.rodata);
data/dodrio_berry_picking.o(.rodata);
src/pokemon_jump.o(.rodata);
data/pokemon_jump.o(.rodata);
src/rtc.o(.rodata);
src/main_menu.o(.rodata);
@ -618,8 +631,10 @@ SECTIONS {
src/unk_pokedex_area_screen_helper.o(.rodata);
src/battle_pyramid_bag.o(.rodata);
src/pokenav.o(.rodata);
src/pokenav_main_menu.o(.rodata);
src/pokenav_match_call_ui.o(.rodata);
data/pokenav.o(.rodata);
src/pokenav_match_call.o(.rodata);
src/pokenav_match_call_data.o(.rodata);
src/menu_specialized.o(.rodata);
data/ereader_helpers.o(.rodata);
src/faraway_island.o(.rodata);

View File

@ -178,12 +178,12 @@ void InitHeap(void *heapStart, u32 heapSize)
void *Alloc(u32 size)
{
AllocInternal(sHeapStart, size);
return AllocInternal(sHeapStart, size);
}
void *AllocZeroed(u32 size)
{
AllocZeroedInternal(sHeapStart, size);
return AllocZeroedInternal(sHeapStart, size);
}
void Free(void *pointer)

View File

@ -1132,7 +1132,7 @@ static void sub_80B0318(u8 taskId)
data[0] = 1;
break;
case 1:
sub_8199DF0(0, 17, 0, 1);
sub_8199DF0(0, PIXEL_FILL(1), 0, 1);
sub_80B028C(data[1]);
sub_80B003C(data[2], data[3], 1, 160, 1, 2);
data[0] = 2;
@ -1179,7 +1179,7 @@ static void sub_80B0318(u8 taskId)
if (sub_80B02C8(data[5]) == TRUE)
{
data[0] = 5;
sub_8199DF0(0, 0, 0, 1);
sub_8199DF0(0, PIXEL_FILL(0), 0, 1);
}
}
break;

View File

@ -1375,7 +1375,7 @@ const u16 gPokenavMessageBox_Pal[] = INCBIN_U16("graphics/pokenav/message.gbapal
const u32 gPokenavMessageBox_Gfx[] = INCBIN_U32("graphics/pokenav/message.4bpp.lz");
const u32 gPokenavMessageBox_Tilemap[] = INCBIN_U32("graphics/pokenav/message.bin.lz");
const u16 gHoennMapZoomIcons_Pal[] = INCBIN_U16("graphics/pokenav/zoom.gbapal");
const u16 gHoennMapZoomIcons_Pal[] = INCBIN_U16("graphics/pokenav/zoom_tiles.gbapal");
const u32 gHoennMapZoomIcons_Gfx[] = INCBIN_U32("graphics/pokenav/zoom.4bpp.lz");
const u16 gPokenavConditionCancel_Pal[] = INCBIN_U16("graphics/pokenav/cancel.gbapal");

View File

@ -1919,7 +1919,7 @@ void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP)
}
}
void sub_8199D98(void)
void ResetBgPositions(void)
{
ChangeBgX(0, 0, 0);
ChangeBgX(1, 0, 0);

1466
src/pokemon_jump.c Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

982
src/pokenav_main_menu.c Normal file
View File

@ -0,0 +1,982 @@
#include "global.h"
#include "pokenav.h"
#include "constants/songs.h"
#include "sound.h"
#include "constants/rgb.h"
#include "palette.h"
#include "bg.h"
#include "window.h"
#include "strings.h"
#include "graphics.h"
#include "decompress.h"
#include "gpu_regs.h"
#include "menu.h"
#include "dma3.h"
enum
{
POKENAV_GFX_MAIN_MENU,
POKENAV_GFX_CONDITION_MENU,
POKENAV_GFX_RIBBONS_MENU,
POKENAV_GFX_MATCH_CALL_MENU,
// One of these is for the zoomed-in map, and the other is for the
// zoomed-out map. Don't know which is which yet.
POKENAV_GFX_MAP_MENU_UNK0,
POKENAV_GFX_MAP_MENU_UNK1,
POKENAV_GFX_PARTY_MENU,
POKENAV_GFX_SEARCH_MENU,
POKENAV_GFX_COOL_MENU,
POKENAV_GFX_BEAUTY_MENU,
POKENAV_GFX_CUTE_MENU,
POKENAV_GFX_SMART_MENU,
POKENAV_GFX_TOUGH_MENU,
POKENAV_GFX_MENUS_END
};
#define POKENAV_GFX_SUBMENUS_START POKENAV_GFX_PARTY_MENU
struct PokenavMainMenuResources
{
void (*unk0)(u32);
u32 (*unk4)(void);
u32 unk8;
u32 currentTaskId;
u32 unk10;
u32 unk14;
struct Sprite *spinningPokenav;
struct Sprite *leftHeaderSprites[2];
struct Sprite *submenuLeftHeaderSprites[2];
u8 tilemapBuffer[0x800];
};
// This struct uses a 32bit tag, and doesn't have a size field.
// Needed to match LoadLeftHeaderGfxForSubMenu.
struct CompressedSpriteSheetNoSize
{
const u32 *data; // LZ77 compressed palette data
u32 tag;
};
extern void sub_81CAADC(void);
void CleanupPokenavMainMenuResources(void);
void LoadLeftHeaderGfxForSubMenu(u32 arg0);
void LoadLeftHeaderGfxForMenu(u32 arg0);
void HideLeftHeaderSubmenuSprites(bool32 arg0);
void HideLeftHeaderSprites(bool32 arg0);
void ShowLeftHeaderSprites(u32 arg0, bool32 arg1);
void ShowLeftHeaderSubmenuSprites(u32 arg0, bool32 arg1);
void MoveLeftHeader(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3);
void SpriteCB_MoveLeftHeader(struct Sprite *sprite);
void InitPokenavMainMenuResources(void);
void InitHoennMapHeaderSprites(void);
void sub_81C7B74(void);
void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 a1, u32 a2);
u32 LoopedTask_ScrollMenuHeaderDown(s32 a0);
u32 LoopedTask_ScrollMenuHeaderUp(s32 a0);
void sub_81C7BF8(u32 a0);
void SpriteCB_SpinningPokenav(struct Sprite* sprite);
u32 LoopedTask_InitPokenavMenu(s32 a0);
const u16 gSpinningPokenavPaletteData[] = INCBIN_U16("graphics/pokenav/icon2.gbapal");
const u32 gSpinningPokenavGfx[] = INCBIN_U32("graphics/pokenav/icon2.4bpp.lz");
const u32 gUnused_SpinningPokenavGfx2[] = INCBIN_U32("graphics/pokenav/icon2_unused.4bpp.lz");
const struct BgTemplate gPokenavMainMenuBgTemplates[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 5,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0,
}
};
const struct WindowTemplate gUnknown_0861FA08[2] =
{
{
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 22,
.width = 16,
.height = 2,
.paletteNum = 0,
.baseBlock = 0x36,
},
{
.bg = 0xFF,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 0,
.height = 0,
.paletteNum = 0,
.baseBlock = 0,
},
};
const u8 *const sMenuButtonReminders[12] =
{
gText_Pokenav_ClearButtonList,
gText_PokenavMap_ZoomedOutButtons,
gText_PokenavMap_ZoomedInButtons,
gText_PokenavCondition_MonListButtons,
gText_PokenavCondition_MonStatusButtons,
gText_PokenavCondition_MarkingButtons,
gText_PokenavMatchCall_TrainerListButtons,
gText_PokenavMatchCall_CallMenuButtons,
gText_PokenavMatchCall_CheckTrainerButtons,
gText_PokenavRibbons_MonListButtons,
gText_PokenavRibbons_RibbonListButtons,
gText_PokenavRibbons_RibbonCheckButtons,
};
const u8 gMenuButtonReminderColor[3] =
{
4, 1, 2
};
static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
{
{
.data = gSpinningPokenavGfx,
.size = 0x1000,
.tag = 0,
}
};
static const struct SpritePalette gSpinningNavgearPalettes[] =
{
{
.data = gSpinningPokenavPaletteData,
.tag = 0,
},
{}
};
static const struct CompressedSpriteSheet sPokenavHoennMapLeftHeaderSpriteSheet =
{
.data = gPokenavLeftHeaderHoennMap_Gfx,
.size = 0xC00,
.tag = 2
};
static const struct CompressedSpriteSheet sPokenavMenuLeftHeaderSpriteSheets[] =
{
[POKENAV_GFX_MAIN_MENU] = {
.data = gPokenavLeftHeaderMainMenu_Gfx,
.size = 0x20,
.tag = 3
},
[POKENAV_GFX_CONDITION_MENU] = {
.data = gPokenavLeftHeaderCondition_Gfx,
.size = 0x20,
.tag = 1
},
[POKENAV_GFX_RIBBONS_MENU] = {
.data = gPokenavLeftHeaderRibbons_Gfx,
.size = 0x20,
.tag = 2
},
[POKENAV_GFX_MATCH_CALL_MENU] = {
.data = gPokenavLeftHeaderMatchCall_Gfx,
.size = 0x20,
.tag = 4
},
[POKENAV_GFX_MAP_MENU_UNK0] = {
.data = gPokenavLeftHeaderHoennMap_Gfx,
.size = 0x20,
.tag = 0
},
[POKENAV_GFX_MAP_MENU_UNK1] = {
.data = gPokenavLeftHeaderHoennMap_Gfx,
.size = 0x40,
.tag = 0
}
};
static const struct CompressedSpriteSheetNoSize sPokenavSubMenuLeftHeaderSpriteSheets[] =
{
[POKENAV_GFX_PARTY_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderParty_Gfx,
.tag = 1
},
[POKENAV_GFX_SEARCH_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderSearch_Gfx,
.tag = 1
},
[POKENAV_GFX_COOL_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderCool_Gfx,
.tag = 4
},
[POKENAV_GFX_BEAUTY_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderBeauty_Gfx,
.tag = 1
},
[POKENAV_GFX_CUTE_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderCute_Gfx,
.tag = 2
},
[POKENAV_GFX_SMART_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderSmart_Gfx,
.tag = 0
},
[POKENAV_GFX_TOUGH_MENU - POKENAV_GFX_SUBMENUS_START] = {
.data = gPokenavLeftHeaderTough_Gfx,
.tag = 0
}
};
static const struct OamData sSpinningPokenavSpriteOam =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
};
static const union AnimCmd sSpinningPokenavAnims[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(16, 8),
ANIMCMD_FRAME(32, 8),
ANIMCMD_FRAME(48, 8),
ANIMCMD_FRAME(64, 8),
ANIMCMD_FRAME(80, 8),
ANIMCMD_FRAME(96, 8),
ANIMCMD_FRAME(112, 8),
ANIMCMD_JUMP(0)
};
static const union AnimCmd *const sSpinningPokenavAnimTable[] =
{
sSpinningPokenavAnims
};
static const struct SpriteTemplate sSpinningPokenavSpriteTemplate =
{
.tileTag = 0,
.paletteTag = 0,
.oam = &sSpinningPokenavSpriteOam,
.anims = sSpinningPokenavAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_SpinningPokenav
};
static const struct OamData sPokenavLeftHeaderHoennMapSpriteOam =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.size = SPRITE_SIZE(64x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
};
static const struct OamData sUnknown_0861FB24 =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = 0,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(32x16),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
};
static const struct SpriteTemplate sPokenavLeftHeaderHoennMapSpriteTemplate =
{
.tileTag = 2,
.paletteTag = 1,
.oam = &sPokenavLeftHeaderHoennMapSpriteOam,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate sUnknown_0861FB44 =
{
.tileTag = 2,
.paletteTag = 2,
.oam = &sUnknown_0861FB24,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
bool32 InitPokenavMainMenu(void)
{
struct PokenavMainMenuResources *structPtr;
structPtr = AllocSubstruct(0, sizeof(struct PokenavMainMenuResources));
if (structPtr == NULL)
return FALSE;
ResetSpriteData();
FreeAllSpritePalettes();
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_InitPokenavMenu, 1);
return TRUE;
}
u32 PokenavMainMenuLoopedTaskIsActive(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
return IsLoopedTaskActive(structPtr->currentTaskId);
}
void ShutdownPokenav(void)
{
PlaySE(SE_PN_OFF);
sub_81CAADC();
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK);
}
bool32 WaitForPokenavShutdownFade(void)
{
if (!gPaletteFade.active)
{
sub_81C99D4();
CleanupPokenavMainMenuResources();
FreeAllWindowBuffers();
return FALSE;
}
return TRUE;
}
u32 LoopedTask_InitPokenavMenu(s32 a0)
{
struct PokenavMainMenuResources *structPtr;
switch (a0)
{
case 0:
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
FreeAllWindowBuffers();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, gPokenavMainMenuBgTemplates, ARRAY_COUNT(gPokenavMainMenuBgTemplates));
ResetBgPositions();
reset_temp_tile_data_buffers();
return LT_INC_AND_CONTINUE;
case 1:
structPtr = GetSubstructPtr(0);
decompress_and_copy_tile_data_to_vram(0, &gPokenavHeader_Gfx, 0, 0, 0);
SetBgTilemapBuffer(0, structPtr->tilemapBuffer);
CopyToBgTilemapBuffer(0, &gPokenavHeader_Tilemap, 0, 0);
CopyPaletteIntoBufferUnfaded(gPokenavHeader_Pal, 0, 0x20);
CopyBgTilemapBufferToVram(0);
return LT_INC_AND_PAUSE;
case 2:
if (free_temp_tile_data_buffers_if_possible())
return LT_PAUSE;
sub_81C7B74();
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
return LT_PAUSE;
InitPokenavMainMenuResources();
InitHoennMapHeaderSprites();
ShowBg(0);
return LT_FINISH;
default:
return LT_FINISH;
}
}
void sub_81C7834(void *func1, void *func2) // Fix types later.
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->unk0 = func1;
structPtr->unk4 = func2;
structPtr->unk8 = 0;
}
void sub_81C7850(u32 a0)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->unk8 = 0;
structPtr->unk0(a0);
}
u32 sub_81C786C(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
return structPtr->unk4();
}
void sub_81C7880(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_ScrollMenuHeaderDown, 4);
}
void sub_81C78A0(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->currentTaskId = CreateLoopedTask(LoopedTask_ScrollMenuHeaderUp, 4);
}
bool32 MainMenuLoopedTaskIsBusy(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
return IsLoopedTaskActive(structPtr->currentTaskId);
}
u32 LoopedTask_ScrollMenuHeaderDown(s32 a0)
{
switch (a0)
{
default:
return LT_FINISH;
case 1:
return LT_INC_AND_PAUSE;
case 0:
return LT_INC_AND_PAUSE;
case 2:
if (ChangeBgY(0, 384, 1) >= 0x2000u)
{
ChangeBgY(0, 0x2000, 0);
return LT_FINISH;
}
return LT_PAUSE;
}
}
u32 LoopedTask_ScrollMenuHeaderUp(s32 a0)
{
if (ChangeBgY(0, 384, 2) <= 0)
{
ChangeBgY(0, 0, 0);
return 4;
}
return 2;
}
void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size)
{
CpuCopy16(palette, gPlttBufferUnfaded + bufferOffset, size);
}
void Pokenav_AllocAndLoadPalettes(const struct SpritePalette *palettes)
{
const struct SpritePalette *current;
u32 index;
for (current = palettes; current->data != NULL; current++)
{
index = AllocSpritePalette(current->tag);
if (index == 0xFF)
{
break;
}
else
{
index = (index * 16) + 0x100;
CopyPaletteIntoBufferUnfaded(current->data, index, 0x20);
}
}
}
void sub_81C7990(u32 a0, u16 a1)
{
CpuFill16(a1, gPlttBufferFaded + 0x100 + (a0 * 16), 16 * sizeof(u16));
}
__attribute__((naked))
void sub_81C79BC(u16 *a0, u16 *a1, u32 a2, u32 a3, u32 a4, u32 a5)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0xC\n\
str r0, [sp]\n\
str r1, [sp, 0x4]\n\
mov r10, r2\n\
str r3, [sp, 0x8]\n\
ldr r0, [sp, 0x2C]\n\
cmp r0, 0\n\
bne _081C79E4\n\
ldr r2, =0x001fffff\n\
mov r1, r10\n\
ands r2, r1\n\
ldr r0, [sp]\n\
b _081C79F4\n\
.pool\n\
_081C79E4:\n\
ldr r2, [sp, 0x2C]\n\
ldr r0, [sp, 0x8]\n\
cmp r2, r0\n\
blt _081C7A00\n\
ldr r2, =0x001fffff\n\
mov r1, r10\n\
ands r2, r1\n\
ldr r0, [sp, 0x4]\n\
_081C79F4:\n\
ldr r1, [sp, 0x30]\n\
bl CpuSet\n\
b _081C7AAE\n\
.pool\n\
_081C7A00:\n\
movs r2, 0x1\n\
negs r2, r2\n\
add r10, r2\n\
b _081C7AA6\n\
_081C7A08:\n\
ldr r1, [sp]\n\
ldrh r0, [r1]\n\
movs r2, 0x1F\n\
mov r9, r2\n\
mov r1, r9\n\
ands r1, r0\n\
mov r9, r1\n\
lsls r0, 16\n\
lsrs r2, r0, 21\n\
movs r1, 0x1F\n\
ands r1, r2\n\
mov r8, r1\n\
lsrs r7, r0, 26\n\
movs r2, 0x1F\n\
ands r7, r2\n\
ldr r0, [sp, 0x4]\n\
ldrh r4, [r0]\n\
movs r0, 0x1F\n\
ands r0, r4\n\
mov r1, r9\n\
subs r0, r1\n\
lsls r0, 8\n\
ldr r1, [sp, 0x8]\n\
bl __divsi3\n\
ldr r2, [sp, 0x2C]\n\
adds r6, r0, 0\n\
muls r6, r2\n\
asrs r6, 8\n\
lsls r4, 16\n\
lsrs r0, r4, 21\n\
movs r1, 0x1F\n\
ands r0, r1\n\
mov r2, r8\n\
subs r0, r2\n\
lsls r0, 8\n\
ldr r1, [sp, 0x8]\n\
bl __divsi3\n\
ldr r1, [sp, 0x2C]\n\
adds r5, r0, 0\n\
muls r5, r1\n\
asrs r5, 8\n\
lsrs r4, 26\n\
movs r2, 0x1F\n\
ands r4, r2\n\
subs r4, r7\n\
lsls r4, 8\n\
adds r0, r4, 0\n\
ldr r1, [sp, 0x8]\n\
bl __divsi3\n\
ldr r1, [sp, 0x2C]\n\
muls r0, r1\n\
asrs r0, 8\n\
add r6, r9\n\
movs r2, 0x1F\n\
ands r6, r2\n\
add r5, r8\n\
ands r5, r2\n\
adds r0, r7, r0\n\
ands r0, r2\n\
lsls r0, 10\n\
lsls r5, 5\n\
orrs r0, r5\n\
orrs r0, r6\n\
ldr r1, [sp, 0x30]\n\
strh r0, [r1]\n\
ldr r2, [sp]\n\
adds r2, 0x2\n\
str r2, [sp]\n\
ldr r0, [sp, 0x4]\n\
adds r0, 0x2\n\
str r0, [sp, 0x4]\n\
adds r1, 0x2\n\
str r1, [sp, 0x30]\n\
movs r1, 0x1\n\
negs r1, r1\n\
add r10, r1\n\
_081C7AA6:\n\
movs r0, 0x1\n\
negs r0, r0\n\
cmp r10, r0\n\
bne _081C7A08\n\
_081C7AAE:\n\
add sp, 0xC\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided");
}
void sub_81C7AC0(s32 a0)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
switch (a0)
{
case 0:
BeginNormalPaletteFade(structPtr->unk14, -2, 0, 16, RGB_BLACK);
break;
case 1:
BeginNormalPaletteFade(structPtr->unk14, -2, 16, 0, RGB_BLACK);
break;
case 2:
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK);
break;
case 3:
BeginNormalPaletteFade(0xFFFFFFFF, -2, 16, 0, RGB_BLACK);
break;
}
}
bool32 IsPaletteFadeActive(void)
{
return gPaletteFade.active;
}
void sub_81C7B40(void)
{
BlendPalettes(0xFFFEFFFE, 16, RGB_BLACK);
}
void InitBgTemplates(const struct BgTemplate *templates, s32 count)
{
s32 i;
for (i = 0; i < count; i++)
InitBgFromTemplate(templates++);
}
void sub_81C7B74(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
InitWindows(&gUnknown_0861FA08[0]);
structPtr->unk10 = 0;
sub_81C7BF8(structPtr->unk10);
PutWindowTilemap(structPtr->unk10);
CopyWindowToVram(structPtr->unk10, 3); // TODO: Use a defined constant here.
}
void sub_81C7BA4(u32 a0)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
sub_81C7BF8(structPtr->unk10);
AddTextPrinterParameterized3(structPtr->unk10, 1, 0, 1, gMenuButtonReminderColor, 0, sMenuButtonReminders[a0]);
}
bool32 IsDma3ManagerBusyWithBgCopy_(void)
{
return IsDma3ManagerBusyWithBgCopy();
}
void sub_81C7BF8(u32 windowId)
{
FillWindowPixelBuffer(windowId, PIXEL_FILL(4));
FillWindowPixelRect(windowId, PIXEL_FILL(5), 0, 0, 0x80, 1);
}
void InitPokenavMainMenuResources(void)
{
s32 i;
u8 spriteId;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++)
LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]);
Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes);
structPtr->unk14 = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0));
spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0);
structPtr->spinningPokenav = &gSprites[spriteId];
}
void CleanupPokenavMainMenuResources(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
DestroySprite(structPtr->spinningPokenav);
FreeSpriteTilesByTag(0);
FreeSpritePaletteByTag(0);
}
void SpriteCB_SpinningPokenav(struct Sprite *sprite)
{
// If the background starts scrolling, follow it.
sprite->pos2.y = (GetBgY(0) / 256u) * -1;
}
struct Sprite *PauseSpinningPokenavSprite(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->spinningPokenav->callback = SpriteCallbackDummy;
return structPtr->spinningPokenav;
}
void ResumeSpinningPokenavSprite(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
structPtr->spinningPokenav->pos1.x = 220;
structPtr->spinningPokenav->pos1.y = 12;
structPtr->spinningPokenav->callback = SpriteCB_SpinningPokenav;
structPtr->spinningPokenav->invisible = FALSE;
structPtr->spinningPokenav->oam.priority = 0;
structPtr->spinningPokenav->subpriority = 0;
}
void InitHoennMapHeaderSprites(void)
{
s32 i, spriteId;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
LoadCompressedSpriteSheet(&sPokenavHoennMapLeftHeaderSpriteSheet);
AllocSpritePalette(1);
AllocSpritePalette(2);
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
spriteId = CreateSprite(&sPokenavLeftHeaderHoennMapSpriteTemplate, 0, 0, 1);
structPtr->leftHeaderSprites[i] = &gSprites[spriteId];
structPtr->leftHeaderSprites[i]->invisible = TRUE;
structPtr->leftHeaderSprites[i]->pos2.x = i * 64;
spriteId = CreateSprite(&sUnknown_0861FB44, 0, 0, 2);
structPtr->submenuLeftHeaderSprites[i] = &gSprites[spriteId];
structPtr->submenuLeftHeaderSprites[i]->invisible = TRUE;
structPtr->submenuLeftHeaderSprites[i]->pos2.x = i * 32;
structPtr->submenuLeftHeaderSprites[i]->pos2.y = 18;
structPtr->submenuLeftHeaderSprites[i]->oam.tileNum += (i * 8) + 64;
}
}
void LoadLeftHeaderGfxForIndex(u32 arg0)
{
if (arg0 < POKENAV_GFX_SUBMENUS_START)
LoadLeftHeaderGfxForMenu(arg0);
else
LoadLeftHeaderGfxForSubMenu(arg0 - POKENAV_GFX_SUBMENUS_START);
}
void sub_81C7E14(u32 arg0)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (arg0 == 4)
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 32;
else
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 64;
}
void LoadLeftHeaderGfxForMenu(u32 index)
{
struct PokenavMainMenuResources *structPtr;
u32 size, tag;
if (index >= POKENAV_GFX_SUBMENUS_START)
return;
structPtr = GetSubstructPtr(0);
tag = sPokenavMenuLeftHeaderSpriteSheets[index].tag;
size = GetDecompressedDataSize(sPokenavMenuLeftHeaderSpriteSheets[index].data);
LoadPalette(&gPokenavLeftHeader_Pal[tag * 16], (IndexOfSpritePaletteTag(1) * 16) + 0x100, 0x20);
LZ77UnCompWram(sPokenavMenuLeftHeaderSpriteSheets[index].data, gDecompressionBuffer);
RequestDma3Copy(gDecompressionBuffer, (void *)VRAM + 0x10000 + (GetSpriteTileStartByTag(2) * 32), size, 1);
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + sPokenavMenuLeftHeaderSpriteSheets[index].size;
if (index == POKENAV_GFX_MAP_MENU_UNK0 || index == POKENAV_GFX_MAP_MENU_UNK1)
structPtr->leftHeaderSprites[1]->pos2.x = 56;
else
structPtr->leftHeaderSprites[1]->pos2.x = 64;
}
void LoadLeftHeaderGfxForSubMenu(u32 arg0)
{
u32 size, tag;
if (arg0 >= POKENAV_GFX_MENUS_END - POKENAV_GFX_SUBMENUS_START)
return;
tag = sPokenavSubMenuLeftHeaderSpriteSheets[arg0].tag;
size = GetDecompressedDataSize(sPokenavSubMenuLeftHeaderSpriteSheets[arg0].data);
LoadPalette(&gPokenavLeftHeader_Pal[tag * 16], (IndexOfSpritePaletteTag(2) * 16) + 0x100, 0x20);
LZ77UnCompWram(sPokenavSubMenuLeftHeaderSpriteSheets[arg0].data, &gDecompressionBuffer[0x1000]);
RequestDma3Copy(&gDecompressionBuffer[0x1000], (void *)VRAM + 0x10800 + (GetSpriteTileStartByTag(2) * 32), size, 1);
}
void sub_81C7FA0(u32 arg0, bool32 arg1, bool32 arg2)
{
u32 var;
if (!arg1)
var = 0x30;
else
var = 0x10;
if (arg0 < 6)
ShowLeftHeaderSprites(var, arg2);
else
ShowLeftHeaderSubmenuSprites(var, arg2);
}
void sub_81C7FC4(u32 arg0, bool32 arg1)
{
if (arg0 < 6)
HideLeftHeaderSprites(arg1);
else
HideLeftHeaderSubmenuSprites(arg1);
}
void sub_81C7FDC(void)
{
s32 i;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
structPtr->leftHeaderSprites[i]->invisible = TRUE;
structPtr->submenuLeftHeaderSprites[i]->invisible = TRUE;
}
}
bool32 sub_81C8010(void)
{
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (structPtr->leftHeaderSprites[0]->callback == SpriteCallbackDummy && structPtr->submenuLeftHeaderSprites[0]->callback == SpriteCallbackDummy)
return FALSE;
else
return TRUE;
}
void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide)
{
s32 start, end, i;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (!isOnRightSide)
start = -96, end = 32;
else
start = 256, end = 160;
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
structPtr->leftHeaderSprites[i]->pos1.y = startY;
MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12);
}
}
void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide)
{
s32 start, end, i;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (!isOnRightSide)
start = -96, end = 16;
else
start = 256, end = 192;
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++)
{
structPtr->submenuLeftHeaderSprites[i]->pos1.y = startY;
MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12);
}
}
void HideLeftHeaderSprites(bool32 isOnRightSide)
{
s32 start, end, i;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (!isOnRightSide)
start = 32, end = -96;
else
start = 192, end = 256;
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12);
}
}
void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide)
{
s32 start, end, i;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
if (!isOnRightSide)
start = 16, end = -96;
else
start = 192, end = 256;
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++)
{
MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12);
}
}
void MoveLeftHeader(struct Sprite *sprite, s32 startX, s32 endX, s32 duration)
{
sprite->pos1.x = startX;
sprite->data[0] = startX * 16;
sprite->data[1] = (endX - startX) * 16 / duration;
sprite->data[2] = duration;
sprite->data[7] = endX;
sprite->callback = SpriteCB_MoveLeftHeader;
}
void SpriteCB_MoveLeftHeader(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 < -16 || sprite->pos1.x > 256)
sprite->invisible = TRUE;
else
sprite->invisible = FALSE;
}
else
{
sprite->pos1.x = sprite->data[7];
sprite->callback = SpriteCallbackDummy;
}
}

View File

@ -422,7 +422,7 @@ static const match_call_text_data_t sMayTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
static const struct MatchCallStruct4 sMayMatchCallHeader =
static const struct MatchCallStruct4 sBrendanMatchCallHeader =
{
.type = 4,
.gender = MALE,
@ -451,7 +451,7 @@ static const match_call_text_data_t sBrendanTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
static const struct MatchCallStruct4 sBrendanMatchCallHeader =
static const struct MatchCallStruct4 sMayMatchCallHeader =
{
.type = 4,
.gender = FEMALE,
@ -728,8 +728,8 @@ static const struct MatchCallStruct5 sWallaceMatchCallHeader =
static const match_call_t sMatchCallHeaders[] = {
{.type0 = &sMrStoneMatchCallHeader},
{.type3 = &sProfBirchMatchCallHeader},
{.type4 = &sBrendanMatchCallHeader},
{.type4 = &sMayMatchCallHeader},
{.type4 = &sBrendanMatchCallHeader},
{.type2 = &sWallyMatchCallHeader},
{.type5 = &sNormanMatchCallHeader},
{.type0 = &sMomMatchCallHeader},

1185
src/pokenav_match_call_ui.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -962,21 +962,21 @@ const u8 gUnknown_085EBE7D[] = _("DETAIL");
const u8 gUnknown_085EBE84[] = _("CALL");
const u8 gUnknown_085EBE89[] = _("EXIT");
const u8 gUnknown_085EBE8E[] = _("Can't call opponent here.");
const u8 gUnknown_085EBEA8[] = _("STRATEGY");
const u8 gUnknown_085EBEB1[] = _("TRAINER'S POKéMON");
const u8 gUnknown_085EBEC3[] = _("SELF-INTRODUCTION");
const u8 gText_Navgear_ClearButtonList[] = _("{CLEAR 0x80}");
const u8 gText_NavgearMap_ZoomedOutButtons[] = _("{A_BUTTON}ZOOM {B_BUTTON}CANCEL");
const u8 gText_NavgearMap_ZoomedInButtons[] = _("{A_BUTTON}FULL {B_BUTTON}CANCEL");
const u8 gText_NavgearCondition_MonListButtons[] = _("{A_BUTTON}CONDITION {B_BUTTON}CANCEL");
const u8 gText_NavgearCondition_MonStatusButtons[] = _("{A_BUTTON}MARKINGS {B_BUTTON}CANCEL");
const u8 gText_NavgearCondition_MarkingButtons[] = _("{A_BUTTON}SELECT MARK {B_BUTTON}CANCEL");
const u8 gText_NavgearMatchCall_TrainerListButtons[] = _("{A_BUTTON}MENU {B_BUTTON}CANCEL");
const u8 gText_NavgearMatchCall_CallMenuButtons[] = _("{A_BUTTON}OK {B_BUTTON}CANCEL");
const u8 gText_NavgearMatchCall_CheckTrainerButtons[] = _("{B_BUTTON}CANCEL");
const u8 gText_NavgearRibbons_MonListButtons[] = _("{A_BUTTON}RIBBONS {B_BUTTON}CANCEL");
const u8 gText_NavgearRibbons_RibbonListButtons[] = _("{A_BUTTON}CHECK {B_BUTTON}CANCEL");
const u8 gText_NavgearRibbons_RibbonCheckButtons[] = _("{B_BUTTON}CANCEL");
const u8 gText_PokenavMatchCall_Strategy[] = _("STRATEGY");
const u8 gText_PokenavMatchCall_TrainerPokemon[] = _("TRAINER'S POKéMON");
const u8 gText_PokenavMatchCall_SelfIntroduction[] = _("SELF-INTRODUCTION");
const u8 gText_Pokenav_ClearButtonList[] = _("{CLEAR 0x80}");
const u8 gText_PokenavMap_ZoomedOutButtons[] = _("{A_BUTTON}ZOOM {B_BUTTON}CANCEL");
const u8 gText_PokenavMap_ZoomedInButtons[] = _("{A_BUTTON}FULL {B_BUTTON}CANCEL");
const u8 gText_PokenavCondition_MonListButtons[] = _("{A_BUTTON}CONDITION {B_BUTTON}CANCEL");
const u8 gText_PokenavCondition_MonStatusButtons[] = _("{A_BUTTON}MARKINGS {B_BUTTON}CANCEL");
const u8 gText_PokenavCondition_MarkingButtons[] = _("{A_BUTTON}SELECT MARK {B_BUTTON}CANCEL");
const u8 gText_PokenavMatchCall_TrainerListButtons[] = _("{A_BUTTON}MENU {B_BUTTON}CANCEL");
const u8 gText_PokenavMatchCall_CallMenuButtons[] = _("{A_BUTTON}OK {B_BUTTON}CANCEL");
const u8 gText_PokenavMatchCall_CheckTrainerButtons[] = _("{B_BUTTON}CANCEL");
const u8 gText_PokenavRibbons_MonListButtons[] = _("{A_BUTTON}RIBBONS {B_BUTTON}CANCEL");
const u8 gText_PokenavRibbons_RibbonListButtons[] = _("{A_BUTTON}CHECK {B_BUTTON}CANCEL");
const u8 gText_PokenavRibbons_RibbonCheckButtons[] = _("{B_BUTTON}CANCEL");
const u8 gText_NatureSlash[] = _("NATURE/");
const u8 gText_TrainerCloseBy[] = _("That TRAINER is close by.\nTalk to the TRAINER in person!");
const u8 gText_InParty[] = _("IN PARTY");

View File

@ -47,6 +47,7 @@
#include "berry_crush.h"
#include "mystery_gift.h"
#include "union_room_player_avatar.h"
#include "pokemon_jump.h"
EWRAM_DATA u8 gUnknown_02022C20[12] = {};
EWRAM_DATA u8 gUnknown_02022C2C = 0;
@ -97,7 +98,6 @@ bool32 sub_8017678(struct UnkStruct_Shared *arg0, struct UnkStruct_Shared *arg1)
u32 sub_8018120(struct TradeUnkStruct *arg0, u8 multiplayerId);
void sub_801807C(struct TradeUnkStruct *arg0);
void sub_801AC54(void);
void sub_802A9A8(u8 monId, MainCallback callback);
void sub_802493C(u8 monId, MainCallback callback);
void sub_80149D8(void);
void MG_DrawTextBorder(u8 windowId);

View File

@ -168,17 +168,8 @@ gUnknown_02022D00: @ 2022D00
.include "src/pokemon_summary_screen.o"
.include "src/unk_pokedex_area_screen_helper.o"
.include "src/battle_pyramid_bag.o"
@ pokenav
gUnknown_0203CF3C: @ 203CF3C
.space 0x4
gUnknown_0203CF40: @ 203CF40
.space 0x4
gUnknown_0203CF44: @ 203CF44
.space 0x4
.include "src/pokenav.o"
.include "src/pokenav_match_call_ui.o"
.include "src/menu_specialized.o"
.include "src/faraway_island.o"
.include "src/trainer_hill.o"