help_system_812B1E0: sub_812B780

This commit is contained in:
PikalaxALT
2019-06-12 15:51:45 -04:00
parent 12c62c656b
commit 5f41304d75
2 changed files with 213 additions and 365 deletions
-364
View File
@@ -5,370 +5,6 @@
.text
thumb_func_start sub_812B780
sub_812B780: @ 812B780
push {r4,r5,lr}
lsls r0, 24
lsrs r1, r0, 24
adds r5, r1, 0
movs r4, 0
ldr r0, _0812B7A8 @ =gUnknown_3005E9C
ldrb r0, [r0, 0x1]
cmp r0, 0
beq _0812B794
b _0812B8AC
_0812B794:
subs r0, r1, 0x1
cmp r0, 0x2B
bls _0812B79C
b _0812BB04
_0812B79C:
lsls r0, 2
ldr r1, _0812B7AC @ =_0812B7B0
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0812B7A8: .4byte gUnknown_3005E9C
_0812B7AC: .4byte _0812B7B0
.align 2, 0
_0812B7B0:
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B860
.4byte _0812BB08
.4byte _0812B868
.4byte _0812B870
.4byte _0812BB08
.4byte _0812B880
.4byte _0812B868
.4byte _0812B878
.4byte _0812B890
.4byte _0812B880
.4byte _0812B880
.4byte _0812B880
.4byte _0812B868
.4byte _0812B880
.4byte _0812B880
.4byte _0812B868
.4byte _0812B880
.4byte _0812B888
.4byte _0812B868
.4byte _0812B888
.4byte _0812B878
.4byte _0812B890
.4byte _0812B880
.4byte _0812B890
.4byte _0812B896
.4byte _0812B880
.4byte _0812B890
.4byte _0812B880
.4byte _0812B890
.4byte _0812B890
.4byte _0812BB08
.4byte _0812B868
.4byte _0812B868
.4byte _0812B880
.4byte _0812BB08
.4byte _0812B89C
.4byte _0812B896
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B8A4
_0812B860:
ldr r0, _0812B864 @ =0x000002cf
b _0812BAF2
.align 2, 0
_0812B864: .4byte 0x000002cf
_0812B868:
ldr r0, _0812B86C @ =0x00000891
b _0812BAF2
.align 2, 0
_0812B86C: .4byte 0x00000891
_0812B870:
ldr r0, _0812B874 @ =0x00000895
b _0812BAF2
.align 2, 0
_0812B874: .4byte 0x00000895
_0812B878:
ldr r0, _0812B87C @ =0x000008a4
b _0812BAF2
.align 2, 0
_0812B87C: .4byte 0x000008a4
_0812B880:
ldr r0, _0812B884 @ =0x00000828
b _0812BAF2
.align 2, 0
_0812B884: .4byte 0x00000828
_0812B888:
ldr r0, _0812B88C @ =0x00000829
b _0812BAF2
.align 2, 0
_0812B88C: .4byte 0x00000829
_0812B890:
movs r0, 0x82
lsls r0, 4
b _0812BAF2
_0812B896:
bl sub_812BB10
b _0812BAF6
_0812B89C:
ldr r0, _0812B8A0 @ =0x0000029b
b _0812BAF2
.align 2, 0
_0812B8A0: .4byte 0x0000029b
_0812B8A4:
ldr r0, _0812B8A8 @ =0x00000892
b _0812BAF2
.align 2, 0
_0812B8A8: .4byte 0x00000892
_0812B8AC:
cmp r0, 0x1
beq _0812B8B2
b _0812B9D8
_0812B8B2:
subs r0, r1, 0x1
cmp r0, 0x2F
bls _0812B8BA
b _0812BB04
_0812B8BA:
lsls r0, 2
ldr r1, _0812B8C4 @ =_0812B8C8
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0812B8C4: .4byte _0812B8C8
.align 2, 0
_0812B8C8:
.4byte _0812B988
.4byte _0812B9A0
.4byte _0812B9A0
.4byte _0812B9A8
.4byte _0812B9A0
.4byte _0812BB08
.4byte _0812B9A0
.4byte _0812B9A0
.4byte _0812B9A0
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B9A0
.4byte _0812B990
.4byte _0812B9BA
.4byte _0812B9C0
.4byte _0812B9C0
.4byte _0812B9C6
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B988
.4byte _0812BB08
.4byte _0812B9A0
.4byte _0812B9A0
.4byte _0812B9A8
.4byte _0812B9A0
.4byte _0812BB08
.4byte _0812B988
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B9A0
.4byte _0812B9A0
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812B9D0
_0812B988:
ldr r0, _0812B98C @ =0x00000829
b _0812BAF2
.align 2, 0
_0812B98C: .4byte 0x00000829
_0812B990:
ldr r0, _0812B99C @ =0x00000169
movs r1, 0x1
bl CheckBagHasItem
b _0812BAF6
.align 2, 0
_0812B99C: .4byte 0x00000169
_0812B9A0:
ldr r0, _0812B9A4 @ =0x00000828
b _0812BAF2
.align 2, 0
_0812B9A4: .4byte 0x00000828
_0812B9A8:
movs r0, 0x1
bl sub_8088EDC
lsls r0, 16
lsrs r0, 16
cmp r0, 0x1
bls _0812B9B8
b _0812BB08
_0812B9B8:
b _0812BB04
_0812B9BA:
movs r0, 0x82
lsls r0, 4
b _0812BAF2
_0812B9C0:
bl sub_812BB10
b _0812BAF6
_0812B9C6:
ldr r0, _0812B9CC @ =0x00000271
b _0812BAF2
.align 2, 0
_0812B9CC: .4byte 0x00000271
_0812B9D0:
ldr r0, _0812B9D4 @ =0x0000082c
b _0812BAF2
.align 2, 0
_0812B9D4: .4byte 0x0000082c
_0812B9D8:
cmp r0, 0x2
beq _0812B9DE
b _0812BADC
_0812B9DE:
bl sub_812B754
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _0812BA0E
ldr r0, _0812BA20 @ =gUnknown_845B9BE
ldrb r1, [r0]
adds r2, r0, 0
cmp r1, 0xFF
beq _0812BA0E
adds r1, r2, 0
_0812B9F6:
adds r0, r4, r1
ldrb r0, [r0]
cmp r0, r5
bne _0812BA00
b _0812BB04
_0812BA00:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, r2
ldrb r0, [r0]
cmp r0, 0xFF
bne _0812B9F6
_0812BA0E:
subs r0, r5, 0x1
cmp r0, 0x26
bls _0812BA16
b _0812BB08
_0812BA16:
lsls r0, 2
ldr r1, _0812BA24 @ =_0812BA28
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0812BA20: .4byte gUnknown_845B9BE
_0812BA24: .4byte _0812BA28
.align 2, 0
_0812BA28:
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAD2
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BB08
.4byte _0812BAD2
.4byte _0812BAC4
.4byte _0812BB08
.4byte _0812BAD2
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BAC4
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BB08
.4byte _0812BACC
.4byte _0812BACC
.4byte _0812BB08
.4byte _0812BAD2
_0812BAC4:
ldr r0, _0812BAC8 @ =0x00000828
b _0812BAF2
.align 2, 0
_0812BAC8: .4byte 0x00000828
_0812BACC:
bl sub_812BB10
b _0812BAF6
_0812BAD2:
ldr r0, _0812BAD8 @ =0x000008a4
b _0812BAF2
.align 2, 0
_0812BAD8: .4byte 0x000008a4
_0812BADC:
cmp r0, 0x3
bne _0812BB00
cmp r5, 0x5
beq _0812BAEA
cmp r5, 0x6
beq _0812BAF0
b _0812BB08
_0812BAEA:
movs r0, 0x82
lsls r0, 4
b _0812BAF2
_0812BAF0:
ldr r0, _0812BAFC @ =0x00000821
_0812BAF2:
bl FlagGet
_0812BAF6:
lsls r0, 24
lsrs r0, 24
b _0812BB0A
.align 2, 0
_0812BAFC: .4byte 0x00000821
_0812BB00:
cmp r0, 0x4
beq _0812BB08
_0812BB04:
movs r0, 0
b _0812BB0A
_0812BB08:
movs r0, 0x1
_0812BB0A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_812B780
thumb_func_start sub_812BB10
sub_812BB10: @ 812BB10
push {lr}
+213 -1
View File
@@ -3,12 +3,15 @@
#include "event_scripts.h"
#include "field_player_avatar.h"
#include "help_system.h"
#include "item.h"
#include "link.h"
#include "overworld.h"
#include "pokedex.h"
#include "quest_log.h"
#include "save.h"
#include "save_location.h"
#include "strings.h"
#include "constants/items.h"
#include "constants/maps.h"
EWRAM_DATA u16 gUnknown_203B0EC = 0;
@@ -23,10 +26,10 @@ void sub_812B520(struct HelpSystemStruct_203F190 * a0, struct ListMenuItem * a1)
void sub_812B614(struct HelpSystemStruct_203F190 * a0, struct ListMenuItem * a1);
bool8 sub_812B754(void);
bool8 sub_812B780(u8);
bool8 sub_812BB10(void);
void sub_812BF9C(struct HelpSystemStruct_203F190 * a0, struct ListMenuItem * a1);
void sub_812BF74(const u8 *);
// this file
const u8 *const gUnknown_845B080[] = {
gUnknown_81B2DF8,
gUnknown_81B2E1C,
@@ -1122,3 +1125,212 @@ bool8 sub_812B754(void)
return TRUE;
return FALSE;
}
bool8 sub_812B780(u8 id)
{
u8 i = 0;
if (gUnknown_3005E9C[1] == 0)
{
switch (id)
{
case 1:
case 2:
case 3:
case 5:
case 8:
case 34:
case 38:
case 41:
case 42:
case 43:
return TRUE;
case 4:
return FlagGet(FLAG_0x2CF);
case 6:
case 10:
case 16:
case 19:
case 22:
case 35:
case 36:
return FlagGet(FLAG_WORLD_MAP_VIRIDIAN_CITY);
case 7:
return FlagGet(FLAG_WORLD_MAP_VERMILION_CITY);
case 11:
case 24:
return FlagGet(FLAG_0x8A4);
case 9:
case 13:
case 14:
case 15:
case 17:
case 18:
case 20:
case 26:
case 29:
case 31:
case 37:
return FlagGet(FLAG_0x828);
case 21:
case 23:
return FlagGet(FLAG_0x829);
case 12:
case 25:
case 27:
case 30:
case 32:
case 33:
return FlagGet(FLAG_UNK820);
case 28:
case 40:
return sub_812BB10();
case 39:
return FlagGet(FLAG_0x29B);
case 44:
return FlagGet(FLAG_WORLD_MAP_PEWTER_CITY);
}
return FALSE;
}
if (gUnknown_3005E9C[1] == 1)
{
switch (id)
{
case 06:
case 10:
case 11:
case 12:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 31:
case 36:
case 38:
case 39:
case 40:
case 41:
case 42:
case 45:
case 46:
case 47:
return TRUE;
case 1:
case 30:
case 37:
return FlagGet(FLAG_0x829);
case 14:
return CheckBagHasItem(ITEM_TOWN_MAP, 1);
case 2:
case 3:
case 5:
case 7:
case 8:
case 9:
case 13:
case 32:
case 33:
case 35:
case 43:
case 44:
return FlagGet(FLAG_0x828);
case 4:
case 34:
if (sub_8088EDC(1) > 1)
return TRUE;
return FALSE;
case 15:
return FlagGet(FLAG_UNK820);
case 16:
case 17:
return sub_812BB10();
case 18:
return FlagGet(FLAG_0x271);
case 48:
return FlagGet(FLAG_0x82C);
}
return FALSE;
}
if (gUnknown_3005E9C[1] == 2)
{
if (sub_812B754() == TRUE)
{
for (i = 0; gUnknown_845B9BE[i] != 0xFF; i++)
{
if (gUnknown_845B9BE[i] == id)
return FALSE;
}
}
switch (id)
{
case 14:
case 17:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 38:
return TRUE;
case 1:
case 2:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 16:
case 19:
case 20:
case 21:
return FlagGet(FLAG_0x828);
case 36:
case 37:
return sub_812BB10();
case 3:
case 15:
case 18:
case 39:
return FlagGet(FLAG_0x8A4);
}
return TRUE;
}
if (gUnknown_3005E9C[1] == 3)
{
switch (id)
{
case 5:
return FlagGet(FLAG_UNK820);
case 6:
return FlagGet(FLAG_0x821);
}
return TRUE;
}
if (gUnknown_3005E9C[1] == 4)
{
return TRUE;
}
return FALSE;
}