through sub_81C9F28

This commit is contained in:
PikalaxALT 2019-05-02 16:43:32 -04:00
parent 518865d8d9
commit a14162eb9f
4 changed files with 248 additions and 432 deletions

View file

@ -5,437 +5,6 @@
@ File centered around AllocSubstruct(2)
thumb_func_start sub_81C9C6C
sub_81C9C6C: @ 81C9C6C
push {lr}
cmp r0, 0
beq _081C9C78
cmp r0, 0x1
beq _081C9C8E
b _081C9CA2
_081C9C78:
bl sub_81CAA3C
bl sub_81CA278
bl sub_81CA714
movs r0, 0x5
bl PlaySE
movs r0, 0
b _081C9CA4
_081C9C8E:
bl sub_81CA324
cmp r0, 0
bne _081C9C9E
bl sub_81CA7C4
cmp r0, 0
beq _081C9CA2
_081C9C9E:
movs r0, 0x2
b _081C9CA4
_081C9CA2:
movs r0, 0x4
_081C9CA4:
pop {r1}
bx r1
thumb_func_end sub_81C9C6C
thumb_func_start sub_81C9CA8
sub_81C9CA8: @ 81C9CA8
push {lr}
cmp r0, 0x1
beq _081C9CDC
cmp r0, 0x1
bgt _081C9CB8
cmp r0, 0
beq _081C9CC2
b _081C9D3C
_081C9CB8:
cmp r0, 0x2
beq _081C9CFA
cmp r0, 0x3
beq _081C9D14
b _081C9D3C
_081C9CC2:
bl sub_81CA9C8
bl sub_81CA2DC
movs r0, 0
movs r1, 0
bl sub_81C7FC4
movs r0, 0x5
bl PlaySE
movs r0, 0
b _081C9D3E
_081C9CDC:
bl sub_81CA324
cmp r0, 0
bne _081C9D34
bl sub_81C8010
cmp r0, 0
bne _081C9D34
bl sub_81CA0C8
movs r0, 0x1
bl LoadLeftHeaderGfxForIndex
movs r0, 0
b _081C9D3E
_081C9CFA:
bl sub_81CA20C
movs r0, 0x1
movs r1, 0
movs r2, 0
bl sub_81C7FA0
bl sub_81CA818
bl sub_81CA714
movs r0, 0
b _081C9D3E
_081C9D14:
bl sub_81CA324
cmp r0, 0
bne _081C9D34
bl sub_81C8010
cmp r0, 0
bne _081C9D34
bl sub_81CA89C
cmp r0, 0
bne _081C9D34
bl sub_81CA7C4
cmp r0, 0
beq _081C9D38
_081C9D34:
movs r0, 0x2
b _081C9D3E
_081C9D38:
bl sub_81CA9D8
_081C9D3C:
movs r0, 0x4
_081C9D3E:
pop {r1}
bx r1
thumb_func_end sub_81C9CA8
thumb_func_start sub_81C9D44
sub_81C9D44: @ 81C9D44
push {lr}
cmp r0, 0x1
beq _081C9D72
cmp r0, 0x1
bgt _081C9D54
cmp r0, 0
beq _081C9D5E
b _081C9DD2
_081C9D54:
cmp r0, 0x2
beq _081C9D90
cmp r0, 0x3
beq _081C9DAA
b _081C9DD2
_081C9D5E:
bl sub_81CA9C8
bl sub_81CA2DC
movs r0, 0x1
movs r1, 0
bl sub_81C7FC4
movs r0, 0
b _081C9DD4
_081C9D72:
bl sub_81CA324
cmp r0, 0
bne _081C9DCA
bl sub_81C8010
cmp r0, 0
bne _081C9DCA
bl sub_81CA0C8
movs r0, 0
bl LoadLeftHeaderGfxForIndex
movs r0, 0
b _081C9DD4
_081C9D90:
bl sub_81CA20C
movs r0, 0
movs r1, 0
movs r2, 0
bl sub_81C7FA0
bl sub_81CA864
bl sub_81CA714
movs r0, 0
b _081C9DD4
_081C9DAA:
bl sub_81CA324
cmp r0, 0
bne _081C9DCA
bl sub_81C8010
cmp r0, 0
bne _081C9DCA
bl sub_81CA89C
cmp r0, 0
bne _081C9DCA
bl sub_81CA7C4
cmp r0, 0
beq _081C9DCE
_081C9DCA:
movs r0, 0x2
b _081C9DD4
_081C9DCE:
bl sub_81CA9D8
_081C9DD2:
movs r0, 0x4
_081C9DD4:
pop {r1}
bx r1
thumb_func_end sub_81C9D44
thumb_func_start sub_81C9DD8
sub_81C9DD8: @ 81C9DD8
push {lr}
cmp r0, 0x1
beq _081C9E04
cmp r0, 0x1
bgt _081C9DE8
cmp r0, 0
beq _081C9DF2
b _081C9E50
_081C9DE8:
cmp r0, 0x2
beq _081C9E1A
cmp r0, 0x3
beq _081C9E30
b _081C9E50
_081C9DF2:
bl sub_81CA9C8
bl sub_81CA2DC
movs r0, 0x5
bl PlaySE
movs r0, 0
b _081C9E52
_081C9E04:
bl sub_81CA324
cmp r0, 0
bne _081C9E48
movs r0, 0x7
bl LoadLeftHeaderGfxForIndex
bl sub_81CA0C8
movs r0, 0
b _081C9E52
_081C9E1A:
bl sub_81CA20C
movs r0, 0x7
movs r1, 0
movs r2, 0
bl sub_81C7FA0
bl sub_81CA714
movs r0, 0
b _081C9E52
_081C9E30:
bl sub_81CA324
cmp r0, 0
bne _081C9E48
bl sub_81C8010
cmp r0, 0
bne _081C9E48
bl sub_81CA89C
cmp r0, 0
beq _081C9E4C
_081C9E48:
movs r0, 0x2
b _081C9E52
_081C9E4C:
bl sub_81CA9D8
_081C9E50:
movs r0, 0x4
_081C9E52:
pop {r1}
bx r1
thumb_func_end sub_81C9DD8
thumb_func_start sub_81C9E58
sub_81C9E58: @ 81C9E58
push {lr}
cmp r0, 0x1
beq _081C9E86
cmp r0, 0x1
bgt _081C9E68
cmp r0, 0
beq _081C9E72
b _081C9EC2
_081C9E68:
cmp r0, 0x2
beq _081C9E9E
cmp r0, 0x3
beq _081C9EAA
b _081C9EC2
_081C9E72:
bl sub_81CA9C8
bl sub_81CA2DC
movs r0, 0x7
movs r1, 0
bl sub_81C7FC4
movs r0, 0
b _081C9EC4
_081C9E86:
bl sub_81CA324
cmp r0, 0
bne _081C9EBA
bl sub_81C8010
cmp r0, 0
bne _081C9EBA
bl sub_81CA0C8
movs r0, 0
b _081C9EC4
_081C9E9E:
bl sub_81CA20C
bl sub_81CA714
movs r0, 0
b _081C9EC4
_081C9EAA:
bl sub_81CA324
cmp r0, 0
bne _081C9EBA
bl sub_81CA89C
cmp r0, 0
beq _081C9EBE
_081C9EBA:
movs r0, 0x2
b _081C9EC4
_081C9EBE:
bl sub_81CA9D8
_081C9EC2:
movs r0, 0x4
_081C9EC4:
pop {r1}
bx r1
thumb_func_end sub_81C9E58
thumb_func_start sub_81C9EC8
sub_81C9EC8: @ 81C9EC8
push {lr}
cmp r0, 0
beq _081C9ED4
cmp r0, 0x1
beq _081C9EE2
b _081C9EF0
_081C9ED4:
movs r0, 0x20
bl PlaySE
bl sub_81CA770
movs r0, 0
b _081C9EF2
_081C9EE2:
bl IsDma3ManagerBusyWithBgCopy
lsls r0, 24
cmp r0, 0
beq _081C9EF0
movs r0, 0x2
b _081C9EF2
_081C9EF0:
movs r0, 0x4
_081C9EF2:
pop {r1}
bx r1
thumb_func_end sub_81C9EC8
thumb_func_start sub_81C9EF8
sub_81C9EF8: @ 81C9EF8
push {lr}
cmp r0, 0
beq _081C9F04
cmp r0, 0x1
beq _081C9F12
b _081C9F20
_081C9F04:
movs r0, 0x5
bl PlaySE
bl sub_81CA714
movs r0, 0
b _081C9F22
_081C9F12:
bl IsDma3ManagerBusyWithBgCopy
lsls r0, 24
cmp r0, 0
beq _081C9F20
movs r0, 0x2
b _081C9F22
_081C9F20:
movs r0, 0x4
_081C9F22:
pop {r1}
bx r1
thumb_func_end sub_81C9EF8
thumb_func_start sub_81C9F28
sub_81C9F28: @ 81C9F28
push {lr}
cmp r0, 0x1
beq _081C9F52
cmp r0, 0x1
bgt _081C9F38
cmp r0, 0
beq _081C9F42
b _081C9FBC
_081C9F38:
cmp r0, 0x2
beq _081C9F96
cmp r0, 0x3
beq _081C9FB0
b _081C9FBC
_081C9F42:
bl sub_81C98C4
lsls r0, 16
lsrs r0, 16
bl sub_81C7BA4
movs r0, 0
b _081C9FBE
_081C9F52:
bl IsDma3ManagerBusyWithBgCopy_
cmp r0, 0
bne _081C9FB8
bl sub_81C7880
bl sub_81CA9C8
bl sub_81CA2DC
bl sub_81C9894
cmp r0, 0x3
beq _081C9F7A
cmp r0, 0x4
bne _081C9F84
movs r0, 0x7
movs r1, 0
bl sub_81C7FC4
_081C9F7A:
movs r0, 0x1
movs r1, 0
bl sub_81C7FC4
b _081C9F8C
_081C9F84:
movs r0, 0
movs r1, 0
bl sub_81C7FC4
_081C9F8C:
movs r0, 0x5
bl PlaySE
movs r0, 0
b _081C9FBE
_081C9F96:
bl sub_81CA324
cmp r0, 0
bne _081C9FB8
bl sub_81C8010
cmp r0, 0
bne _081C9FB8
movs r0, 0
bl sub_81C7AC0
movs r0, 0
b _081C9FBE
_081C9FB0:
bl IsPaletteFadeActive
cmp r0, 0
beq _081C9FBC
_081C9FB8:
movs r0, 0x2
b _081C9FBE
_081C9FBC:
movs r0, 0x4
_081C9FBE:
pop {r1}
bx r1
thumb_func_end sub_81C9F28
thumb_func_start sub_81C9FC4
sub_81C9FC4: @ 81C9FC4
push {r4,r5,lr}

View file

@ -125,6 +125,8 @@ void sub_81C7B40(void);
struct Sprite *PauseSpinningPokenavSprite(void);
void ResumeSpinningPokenavSprite(void);
void sub_81C7E14(u32 arg0);
void sub_81C7FC4(u32 arg0, bool32 arg1);
void sub_81C7880(void);
// pokenav_unk_1.c
bool32 sub_81C9298(void);
@ -136,6 +138,7 @@ u32 sub_81C941C(void);
void sub_81C9430(void);
int sub_81C9894(void);
const u8 *sub_81CAF78(int index, u8 *arg1);
u16 sub_81C98C4(void);
// pokenav_unk_2.c
void sub_81C99D4(void);

View file

@ -459,7 +459,7 @@ int sub_81C98B4(void)
return state->descriptionId;
}
int sub_81C98C4(void)
u16 sub_81C98C4(void)
{
struct Pokenav1Struct *state = GetSubstructPtr(1);
return state->helpBarIndex;

View file

@ -40,16 +40,25 @@ void sub_81C9FEC(void);
void sub_81CA02C(void);
void sub_81CA0C8(void);
void sub_81CA20C(void);
void sub_81CA278(void);
void sub_81CA2DC(void);
bool32 sub_81CA324(void);
void sub_81CA640(void);
void sub_81CA6E0(void);
void sub_81CA714(void);
void sub_81CA770(void);
bool32 sub_81CA7C4(void);
void sub_81CA7D4(void);
void sub_81CA7F4(void);
void sub_81CA818(void);
void sub_81CA850(void);
void sub_81CA864(void);
bool32 sub_81CA89C(void);
void titlescreen_0(void);
void sub_81CA994(void);
void sub_81CA9C8(void);
void sub_81CA9D8(void);
void sub_81CAA3C(void);
const u16 gUnknown_0861FC78[] = INCBIN_U16("graphics/pokenav/bg.gbapal");
const u32 gUnknown_0861FC98[] = INCBIN_U32("graphics/pokenav/bg.4bpp.lz");
@ -291,3 +300,238 @@ u32 sub_81C9A10(int state)
}
return 4;
}
u32 sub_81C9C6C(int state)
{
switch (state)
{
case 0:
sub_81CAA3C();
sub_81CA278();
sub_81CA714();
PlaySE(SE_SELECT);
return 0;
case 1:
if (sub_81CA324())
return 2;
if (sub_81CA7C4())
return 2;
break;
}
return 4;
}
u32 sub_81C9CA8(int state)
{
switch (state)
{
case 0:
sub_81CA9C8();
sub_81CA2DC();
sub_81C7FC4(0, 0);
PlaySE(SE_SELECT);
return 0;
case 1:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
sub_81CA0C8();
LoadLeftHeaderGfxForIndex(1);
return 0;
case 2:
sub_81CA20C();
sub_81C7FA0(1, FALSE, FALSE);
sub_81CA818();
sub_81CA714();
return 0;
case 3:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
if (sub_81CA89C())
return 2;
if (sub_81CA7C4())
return 2;
sub_81CA9D8();
break;
}
return 4;
}
u32 sub_81C9D44(int state)
{
switch (state)
{
case 0:
sub_81CA9C8();
sub_81CA2DC();
sub_81C7FC4(1, 0);
return 0;
case 1:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
sub_81CA0C8();
LoadLeftHeaderGfxForIndex(0);
return 0;
case 2:
sub_81CA20C();
sub_81C7FA0(0, FALSE, FALSE);
sub_81CA864();
sub_81CA714();
return 0;
case 3:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
if (sub_81CA89C())
return 2;
if (sub_81CA7C4())
return 2;
sub_81CA9D8();
break;
}
return 4;
}
u32 sub_81C9DD8(int state)
{
switch (state)
{
case 0:
sub_81CA9C8();
sub_81CA2DC();
PlaySE(SE_SELECT);
return 0;
case 1:
if (sub_81CA324())
return 2;
LoadLeftHeaderGfxForIndex(7);
sub_81CA0C8();
return 0;
case 2:
sub_81CA20C();
sub_81C7FA0(7, FALSE, FALSE);
sub_81CA714();
return 0;
case 3:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
if (sub_81CA89C())
return 2;
sub_81CA9D8();
break;
}
return 4;
}
u32 sub_81C9E58(int state)
{
switch (state)
{
case 0:
sub_81CA9C8();
sub_81CA2DC();
sub_81C7FC4(7, 0);
return 0;
case 1:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
sub_81CA0C8();
return 0;
case 2:
sub_81CA20C();
sub_81CA714();
return 0;
case 3:
if (sub_81CA324())
return 2;
if (sub_81CA89C())
return 2;
sub_81CA9D8();
break;
}
return 4;
}
u32 sub_81C9EC8(int state)
{
switch (state)
{
case 0:
PlaySE(SE_HAZURE);
sub_81CA770();
return 0;
case 1:
if (IsDma3ManagerBusyWithBgCopy())
return 2;
break;
}
return 4;
}
u32 sub_81C9EF8(int state)
{
switch (state)
{
case 0:
PlaySE(SE_SELECT);
sub_81CA714();
return 0;
case 1:
if (IsDma3ManagerBusyWithBgCopy())
return 2;
break;
}
return 4;
}
u32 sub_81C9F28(int state)
{
switch (state)
{
case 0:
sub_81C7BA4(sub_81C98C4());
return 0;
case 1:
if (IsDma3ManagerBusyWithBgCopy_())
return 2;
sub_81C7880();
sub_81CA9C8();
sub_81CA2DC();
switch (sub_81C9894())
{
case 4:
sub_81C7FC4(7, FALSE);
// fallthrough
case 3:
sub_81C7FC4(1, FALSE);
break;
default:
sub_81C7FC4(0, FALSE);
break;
}
PlaySE(SE_SELECT);
return 0;
case 2:
if (sub_81CA324())
return 2;
if (sub_81C8010())
return 2;
sub_81C7AC0(0);
return 0;
case 3:
if (IsPaletteFadeActive())
return 2;
break;
}
return 4;
}