mirror of
https://github.com/pret/pmd-red.git
synced 2024-11-23 05:00:12 +00:00
more labeling
This commit is contained in:
parent
c9a338ee1a
commit
8d7e774e81
@ -2089,71 +2089,4 @@ _0803C10C:
|
||||
bx r1
|
||||
thumb_func_end sub_803C0DC
|
||||
|
||||
thumb_func_start sub_803C110
|
||||
sub_803C110:
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
asrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl sub_8098134
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0803C180
|
||||
adds r0, r4, 0
|
||||
bl GetBaseSpecies
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r4, r0
|
||||
bne _0803C180
|
||||
adds r0, r4, 0
|
||||
bl sub_803C0DC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0803C180
|
||||
movs r0, 0x6
|
||||
bl sub_80023E4
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _0803C188
|
||||
ldr r1, _0803C184
|
||||
movs r2, 0
|
||||
ldrsh r0, [r1, r2]
|
||||
cmp r0, 0
|
||||
beq _0803C168
|
||||
adds r2, r1, 0
|
||||
_0803C154:
|
||||
movs r3, 0
|
||||
ldrsh r0, [r2, r3]
|
||||
cmp r0, r4
|
||||
beq _0803C180
|
||||
adds r1, 0x2
|
||||
adds r2, 0x2
|
||||
movs r3, 0
|
||||
ldrsh r0, [r1, r3]
|
||||
cmp r0, 0
|
||||
bne _0803C154
|
||||
_0803C168:
|
||||
bl GetPlayerPokemonStruct
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r0, r4
|
||||
beq _0803C180
|
||||
bl sub_808D378
|
||||
movs r2, 0x8
|
||||
ldrsh r0, [r0, r2]
|
||||
cmp r0, r4
|
||||
bne _0803C188
|
||||
_0803C180:
|
||||
movs r0, 0
|
||||
b _0803C18A
|
||||
.align 2, 0
|
||||
_0803C184: .4byte gUnknown_80E8126
|
||||
_0803C188:
|
||||
movs r0, 0x1
|
||||
_0803C18A:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_803C110
|
||||
|
||||
.align 2,0
|
||||
|
@ -488,7 +488,7 @@ _080988E4:
|
||||
movs r1, 0
|
||||
bl GroundMap_ExecuteEvent
|
||||
movs r0, 0x1E
|
||||
bl sub_8098F44
|
||||
bl GroundMainGameCancelRequest
|
||||
movs r0, 0x1E
|
||||
bl FadeOutAllMusic
|
||||
_080988F8:
|
||||
|
@ -6485,7 +6485,7 @@ sub_809C39C:
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
movs r1, 0
|
||||
bl sub_8098D1C
|
||||
bl GroundMainGroundRequest
|
||||
_0809C3CC:
|
||||
bl sub_801D1E0
|
||||
pop {r0}
|
||||
@ -6515,7 +6515,7 @@ sub_809C3D8:
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
movs r1, 0
|
||||
bl sub_8098D1C
|
||||
bl GroundMainGroundRequest
|
||||
_0809C408:
|
||||
bl sub_801D1E0
|
||||
pop {r0}
|
||||
@ -6545,7 +6545,7 @@ sub_809C414:
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
movs r1, 0
|
||||
bl sub_8098D1C
|
||||
bl GroundMainGroundRequest
|
||||
b _0809C458
|
||||
.align 2, 0
|
||||
_0809C444: .4byte gUnknown_3001B64
|
||||
|
@ -937,7 +937,7 @@ _0809E390:
|
||||
movs r3, 0x2
|
||||
ldrsh r2, [r1, r3]
|
||||
movs r1, 0
|
||||
bl sub_8098D1C
|
||||
bl GroundMainGroundRequest
|
||||
_0809E3BA:
|
||||
ldr r1, [r4]
|
||||
adds r0, r7, 0
|
||||
@ -2175,7 +2175,7 @@ _0809EF26:
|
||||
ldrsh r2, [r0, r1]
|
||||
adds r0, r6, 0
|
||||
adds r1, r5, 0
|
||||
bl sub_8098D1C
|
||||
bl GroundMainGroundRequest
|
||||
b _0809EAE0
|
||||
.align 2, 0
|
||||
_0809EF38: .4byte gUnknown_81165D4
|
||||
@ -2210,7 +2210,7 @@ _0809EF70:
|
||||
movs r2, 0x2
|
||||
ldrsh r1, [r0, r2]
|
||||
adds r0, r4, 0
|
||||
bl sub_8098E18
|
||||
bl GroundMainRescueRequest
|
||||
mov r0, r9
|
||||
movs r1, 0x1
|
||||
bl sub_80A2460
|
||||
@ -3072,7 +3072,7 @@ _0809F68E:
|
||||
_0809F6C6:
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl sub_8098E18
|
||||
bl GroundMainRescueRequest
|
||||
bl _0809EAE0
|
||||
.align 2, 0
|
||||
_0809F6D4: .4byte gUnknown_8116684
|
||||
@ -3083,7 +3083,7 @@ _0809F6DC:
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
adds r0, r4, 0
|
||||
bl sub_8098E18
|
||||
bl GroundMainRescueRequest
|
||||
bl _0809EAE0
|
||||
_0809F6EA:
|
||||
mov r1, r9
|
||||
@ -8339,7 +8339,7 @@ _080A2298:
|
||||
bl sub_8011C28
|
||||
_080A229E:
|
||||
adds r0, r5, 0
|
||||
bl sub_8098F00
|
||||
bl GroundMainGameEndRequest
|
||||
lsls r0, r5, 16
|
||||
lsrs r0, 16
|
||||
bl FadeOutAllMusic
|
||||
|
@ -6,7 +6,7 @@ struct unkStruct_80A2608
|
||||
/* 0x6 */ u16 unk6;
|
||||
/* 0x8 */ u16 unk8;
|
||||
/* 0xA */ u16 unkA;
|
||||
/* 0xC */ u8 unkC;
|
||||
/* 0xC */ u8 dungeonIndex;
|
||||
/* 0xD */ u8 unkD;
|
||||
/* 0xE */ s16 unkE;
|
||||
/* 0x10 */ u8 unk10;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#define NUM_DUNGEON_MAZE (NUM_DUNGEONS - DUNGEON_NORMAL_MAZE_2)
|
||||
|
||||
enum Dungeon
|
||||
enum DungeonIndex
|
||||
{
|
||||
DUNGEON_TINY_WOODS = 0,
|
||||
DUNGEON_THUNDERWAVE_CAVE = 1,
|
||||
|
@ -10,11 +10,11 @@ struct unkStruct_203B2BC
|
||||
u16 unkA;
|
||||
u32 itemIndex;
|
||||
struct HeldItem itemToGive;
|
||||
struct HeldItem unk14;
|
||||
struct HeldItem item2;
|
||||
struct PokemonStruct *unk18;
|
||||
u8 unk1C;
|
||||
u32 unk20;
|
||||
u16 unk24;
|
||||
u16 moveID;
|
||||
struct PokemonMove unk28[8];
|
||||
u32 unk68;
|
||||
u32 unk6C;
|
||||
|
@ -1,7 +1,7 @@
|
||||
struct GroundScript_ExecutePP_3
|
||||
{
|
||||
// size: 0xC
|
||||
u32 unk0;
|
||||
u8 *scriptPointer;
|
||||
s16 scriptType;
|
||||
s16 unk6;
|
||||
u8 unk8;
|
||||
@ -12,8 +12,8 @@ struct GroundScript_ExecutePP_1_sub
|
||||
// size: 0x60
|
||||
/* 0x0 */ s16 scriptType;
|
||||
/* 0x2 */ s16 unk2;
|
||||
/* 0x4 */ u32 unk4;
|
||||
/* 0x8 */ u32 unk8;
|
||||
/* 0x4 */ u8 *scriptPointer1;
|
||||
/* 0x8 */ u8 *scriptPointer2;
|
||||
/* 0xC */ u16 unkC;
|
||||
/* 0xE */ u8 unkE;
|
||||
/* 0xF */ u8 fillF;
|
||||
@ -38,8 +38,9 @@ struct GroundScript_ExecutePP_1
|
||||
u32 unk4;
|
||||
u32 fill8;
|
||||
u32 unkC;
|
||||
u32 fill10;
|
||||
u8 fill18[0x24 - 0x14];
|
||||
u16 unk10;
|
||||
u8 unk12;
|
||||
u8 fill18[0x24 - 0x13];
|
||||
struct GroundScript_ExecutePP_1_sub unk24;
|
||||
struct GroundScript_ExecutePP_1_sub unk84;
|
||||
u16 unkE4;
|
||||
|
@ -31,7 +31,7 @@ struct PokemonStruct
|
||||
/* 0x0 */ u16 unk0; // recruited??
|
||||
/* 0x1 */ bool8 isLeader;
|
||||
/* 0x3 */ u8 unkHasNextStage; // set to a random value?
|
||||
/* 0x4 */ struct DungeonLocation unk4;
|
||||
/* 0x4 */ struct DungeonLocation dungeonLocation;
|
||||
/* 0x8 */ s16 speciesNum; // species #
|
||||
/* 0xC */ struct unkPokeSubStruct_C unkC[2];
|
||||
/* 0x14 */ s16 IQ;
|
||||
@ -69,27 +69,27 @@ struct unkStruct_8094184
|
||||
struct PokemonStruct2
|
||||
{
|
||||
// size 0x68
|
||||
u16 unk0; // corresponds to unk0 inPokemonStruct
|
||||
bool8 isLeader; // unk2
|
||||
u8 unkHasNextStage; // unk3
|
||||
struct DungeonLocation unk4; // unk4
|
||||
u16 IQ; // IQ (other offset)
|
||||
u16 unkA;
|
||||
u16 unkC;
|
||||
s16 speciesNum; // speciesNum (other offset)
|
||||
u16 unk10; // pokeHP
|
||||
u16 unk12; // pokeHP
|
||||
struct Offense offense; // offense (other offset)
|
||||
u32 unk18; // unk1C
|
||||
struct unkStruct_8094184 moves;
|
||||
/* 40 */ struct ItemSlot itemSlot; // heldItem
|
||||
u32 unk44; // some struct
|
||||
u32 unk48; // some struct (same type as 44)
|
||||
u32 IQSkills; // unk20
|
||||
u8 unk50; // unk24
|
||||
u8 fill51[3];
|
||||
struct unkStruct_808E6F4 unk54;
|
||||
u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
|
||||
/* 0x0 */ u16 unk0; // corresponds to unk0 inPokemonStruct
|
||||
/* 0x2 */ bool8 isLeader; // unk2
|
||||
/* 0x3 */ u8 unkHasNextStage; // unk3
|
||||
/* 0x4 */ struct DungeonLocation dungeonLocation; // unk4
|
||||
/* 0x8 */ u16 IQ; // IQ (other offset)
|
||||
/* 0xA */ u16 unkA;
|
||||
/* 0xC */ u16 unkC;
|
||||
/* 0xE */ s16 speciesNum; // speciesNum (other offset)
|
||||
/* 0x10 */ u16 unk10; // pokeHP
|
||||
/* 0x12 */ u16 unk12; // pokeHP
|
||||
/* 0x14 */ struct Offense offense; // offense (other offset)
|
||||
/* 0x18 */ u32 unk18; // unk1C
|
||||
/* 0x1C */ struct unkStruct_8094184 moves;
|
||||
/* 0x40 */ struct ItemSlot itemSlot; // heldItem
|
||||
/* 0x44 */ u32 unk44; // some struct
|
||||
/* 0x48 */ u32 unk48; // some struct (same type as 44)
|
||||
/* 0x4C */ u32 IQSkills; // unk20
|
||||
/* 0x50 */ u8 unk50; // unk24
|
||||
/* 0x51 */ u8 fill51[3];
|
||||
/* 0x54 */ struct unkStruct_808E6F4 unk54;
|
||||
/* 0x58 */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
|
||||
};
|
||||
|
||||
struct unkStruct_203B45C
|
||||
|
@ -17,7 +17,7 @@ struct RescueTeamData
|
||||
{
|
||||
u8 teamName[TEAM_NAME_LENGTH];
|
||||
s32 teamRankPts;
|
||||
u8 unk10;
|
||||
bool8 isTeamRenamed;
|
||||
};
|
||||
|
||||
extern struct RescueTeamData *gRescueTeamInfoRef;
|
||||
@ -34,7 +34,7 @@ void SetTeamRankPoints(s32 newPts);
|
||||
void AddToTeamRankPts(s32 newPts);
|
||||
u8 GetRescueTeamRank(void);
|
||||
const u8 *GetTeamRankString(u8 index);
|
||||
u8 sub_80921B8(void);
|
||||
u8 GetIsTeamRenamed(void);
|
||||
u32 SaveRescueTeamInfo(u8 *param_1,u32 param_2);
|
||||
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2);
|
||||
|
||||
|
@ -181,6 +181,7 @@ SECTIONS {
|
||||
asm/debug_menu_2.o(.text);
|
||||
src/debug_menu_1.o(.text);
|
||||
asm/code_803B050.o(.text);
|
||||
src/code_803B050.o(.text);
|
||||
src/pokemon_mail.o(.text);
|
||||
src/code_803C1B4.o(.text);
|
||||
asm/code_803C1D0.o(.text);
|
||||
@ -326,7 +327,7 @@ SECTIONS {
|
||||
src/exclusive_pokemon_1.o(.text);
|
||||
src/position_util.o(.text);
|
||||
asm/code_8098468.o(.text);
|
||||
src/code_8098BDC.o(.text);
|
||||
src/ground_main.o(.text);
|
||||
asm/code_8098BDC.o(.text);
|
||||
src/code_809D148.o(.text);
|
||||
asm/code_809D148.o(.text);
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
void xxx_call_stop_bgm(void);
|
||||
|
||||
extern u8 sub_80023E4(u8);
|
||||
extern bool8 sub_80023E4(u8);
|
||||
extern void xxx_call_stop_fanfare_se(u16 r0);
|
||||
|
||||
struct UnkSaveStruct1
|
||||
@ -87,15 +87,15 @@ void sub_801169C(void)
|
||||
|
||||
void sub_8011760(void)
|
||||
{
|
||||
if(sub_80023E4(0xD) != 0)
|
||||
if(sub_80023E4(0xD))
|
||||
StartNewBGM(MUS_WORLD_CALAMITY);
|
||||
else if(sub_80023E4(0xC) != 0)
|
||||
else if(sub_80023E4(0xC))
|
||||
StartNewBGM(MUS_POKEMON_SQUARE);
|
||||
}
|
||||
|
||||
void sub_801178C(void)
|
||||
{
|
||||
if(sub_80023E4(0xD) != 0)
|
||||
if(sub_80023E4(0xD))
|
||||
StartNewBGM(MUS_WORLD_CALAMITY);
|
||||
else
|
||||
StartNewBGM(MUS_POKEMON_SQUARE);
|
||||
@ -103,7 +103,7 @@ void sub_801178C(void)
|
||||
|
||||
void sub_80117AC(void)
|
||||
{
|
||||
if(sub_80023E4(0xD) == 0)
|
||||
if(!sub_80023E4(0xD))
|
||||
FadeOutBGM(0x1E);
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,8 @@ extern struct UnkTextStruct2 gUnknown_80DC9B0;
|
||||
extern struct UnkTextStruct2 gUnknown_80DC9C8;
|
||||
|
||||
extern void sub_8013818(void *, u32, u32, u32);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern void sub_808FF20(u32 *, struct PokemonStruct *, u8);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern void sub_808FF20(u32 *, struct PokemonStruct *, bool8);
|
||||
extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32);
|
||||
extern s32 GetKeyPress(void *);
|
||||
extern bool8 sub_8013938(void *);
|
||||
@ -153,5 +153,5 @@ void sub_8024604(void)
|
||||
sub_8013818(gUnknown_203B2AC,3,1,gUnknown_203B2AC->unkE0);
|
||||
iVar3 = &gUnknown_203B2AC->unk4C;
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2AC->unk48];
|
||||
sub_808FF20(iVar3,pokeStruct,sub_80023E4(7));
|
||||
sub_808FF20(iVar3,pokeStruct, sub_80023E4(7));
|
||||
}
|
||||
|
42
src/code_803B050.c
Normal file
42
src/code_803B050.c
Normal file
@ -0,0 +1,42 @@
|
||||
#include "global.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
extern s16 gUnknown_80E8126[];
|
||||
|
||||
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
|
||||
extern struct PokemonStruct *sub_808D378(void);
|
||||
|
||||
extern bool8 sub_803C0DC(s16);
|
||||
extern bool8 sub_8098134(s16);
|
||||
extern s16 GetBaseSpecies(s16);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
|
||||
bool8 sub_803C110(s16 index)
|
||||
{
|
||||
struct PokemonStruct *pokeStruct;
|
||||
s16 *psVar5;
|
||||
s16 *psVar6;
|
||||
s32 species_s32;
|
||||
|
||||
species_s32 = (s32)index;
|
||||
if ((!sub_8098134(index)) || (index != GetBaseSpecies(index)) || (!sub_803C0DC(index))) {
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
if (!sub_80023E4(6)) {
|
||||
psVar5 = &gUnknown_80E8126[0];
|
||||
if (*psVar5 != 0) {
|
||||
psVar6 = &gUnknown_80E8126[0];
|
||||
do {
|
||||
if (*psVar6 == species_s32) return FALSE;
|
||||
psVar5++;
|
||||
psVar6++;
|
||||
} while (*psVar5 != SPECIES_NONE);
|
||||
}
|
||||
pokeStruct = GetPlayerPokemonStruct();
|
||||
if ((pokeStruct->speciesNum == species_s32) ||
|
||||
(pokeStruct = sub_808D378(), pokeStruct->speciesNum == species_s32)) return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ u32 sub_80954CC(u8 *a, u32 b)
|
||||
RestoreIntegerBits(&backup, &temp->unk0, 2);
|
||||
RestoreIntegerBits(&backup, &temp->isLeader, 1);
|
||||
RestoreIntegerBits(&backup, &temp->unkHasNextStage, 7);
|
||||
RestoreDungeonLocation(&backup, &temp->unk4);
|
||||
RestoreDungeonLocation(&backup, &temp->dungeonLocation);
|
||||
RestoreIntegerBits(&backup, &temp->speciesNum, 9);
|
||||
xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[0]);
|
||||
xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[1]);
|
||||
@ -84,7 +84,7 @@ u32 sub_8095624(u8 *a, u32 b)
|
||||
SaveIntegerBits(&backup, &temp->unk0, 2);
|
||||
SaveIntegerBits(&backup, &temp->isLeader, 1);
|
||||
SaveIntegerBits(&backup, &temp->unkHasNextStage, 7);
|
||||
SaveDungeonLocation(&backup, &temp->unk4);
|
||||
SaveDungeonLocation(&backup, &temp->dungeonLocation);
|
||||
SaveIntegerBits(&backup, &temp->speciesNum, 9);
|
||||
xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[0]);
|
||||
xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[1]);
|
||||
|
@ -18,7 +18,7 @@ extern u8 sub_803C1D0(struct DungeonLocation *, u8);
|
||||
extern bool8 IsNotMoneyOrUsedTMItem(u8);
|
||||
extern u8 xxx_bit_lut_lookup_8091E50(u8 ,u8 );
|
||||
extern u32 GetMaxItemCount(u8);
|
||||
extern u8 sub_803C0DC(s16);
|
||||
extern bool8 sub_803C0DC(s16);
|
||||
extern void sub_8096040(u8);
|
||||
extern void sub_80965B8(u8);
|
||||
extern void sub_8096C3C(u8);
|
||||
@ -109,14 +109,14 @@ bool8 ValidateWonderMail(struct WonderMail *data)
|
||||
return FALSE;
|
||||
if(data->clientSpecies != GetBaseSpecies(data->clientSpecies))
|
||||
return FALSE;
|
||||
if(sub_803C0DC(data->clientSpecies) == 0)
|
||||
if(!sub_803C0DC(data->clientSpecies))
|
||||
return FALSE;
|
||||
|
||||
if(data->targetSpecies > SPECIES_RAYQUAZA_CUTSCENE)
|
||||
return FALSE;
|
||||
if(data->targetSpecies != GetBaseSpecies(data->targetSpecies))
|
||||
return FALSE;
|
||||
if(sub_803C0DC(data->targetSpecies) == 0)
|
||||
if(!sub_803C0DC(data->targetSpecies))
|
||||
return FALSE;
|
||||
|
||||
// Item Delivery/Finding
|
||||
|
@ -21,40 +21,40 @@ extern const char gAvoidCaptureText[];
|
||||
extern u8 sub_80A270C();
|
||||
extern void sub_80015C0(u8, u8);
|
||||
extern u8 sub_80A2728(s16);
|
||||
extern u8 sub_8001D08(u32, u32 ,s32);
|
||||
extern bool8 sub_8001D08(u32, u32 ,s32);
|
||||
extern u32 sub_8001784(u32, u32, u16);
|
||||
extern void sub_800199C(u32, u32, u32, u32);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
|
||||
const u8 *sub_809747C(s16 r0)
|
||||
const u8 *sub_809747C(s16 index)
|
||||
{
|
||||
if(r0 == 0xD)
|
||||
if(index == 0xD)
|
||||
{
|
||||
return gDummyScenarioText;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDungeonName1(sub_80A270C(r0));
|
||||
return GetDungeonName1(sub_80A270C(index));
|
||||
}
|
||||
}
|
||||
|
||||
const u8 *sub_80974A0(s16 r0)
|
||||
const u8 *sub_80974A0(s16 index)
|
||||
{
|
||||
if(r0 == 0xD)
|
||||
if(index == 0xD)
|
||||
{
|
||||
return gDummyScenarioText;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDungeonName1(sub_80A270C(r0));
|
||||
return GetDungeonName1(sub_80A270C(index));
|
||||
}
|
||||
}
|
||||
|
||||
const u8 *GetCurrentMissionText(s16 r0)
|
||||
const u8 *GetCurrentMissionText(s16 index)
|
||||
{
|
||||
if(r0 < 0x1F)
|
||||
if(index < 0x1F)
|
||||
{
|
||||
struct MissionText *mt = &gStoryMissionText[r0];
|
||||
struct MissionText *mt = &gStoryMissionText[index];
|
||||
return mt->text;
|
||||
}
|
||||
else
|
||||
@ -124,7 +124,7 @@ bool8 sub_8097504(s16 mazeIndex)
|
||||
uVar3 = 6;
|
||||
}
|
||||
|
||||
if (sub_80023E4(uVar3) == 0) {
|
||||
if (!sub_80023E4(uVar3)) {
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
@ -150,9 +150,9 @@ void sub_80975A8(s16 param_1,u8 param_2)
|
||||
sub_800199C(0,0x2e,param_1_u16,param_2);
|
||||
}
|
||||
|
||||
const u8 *sub_80975C4(s16 r0)
|
||||
const u8 *sub_80975C4(s16 index)
|
||||
{
|
||||
return GetDungeonName1(sub_80A2728(r0));
|
||||
return GetDungeonName1(sub_80A2728(index));
|
||||
}
|
||||
|
||||
const char *sub_80975DC(u32 r0)
|
||||
@ -160,7 +160,7 @@ const char *sub_80975DC(u32 r0)
|
||||
// TODO: slight hack but matches
|
||||
r0 <<= 16;
|
||||
if((0xffe90000 + r0) >> 16 < 2)
|
||||
if(sub_8001D08(0x3, 0xE, -1) != 0)
|
||||
if(sub_8001D08(0x3, 0xE, -1))
|
||||
return gMeetNinetalesText;
|
||||
else
|
||||
return gAvoidCaptureText;
|
||||
@ -170,24 +170,24 @@ const char *sub_80975DC(u32 r0)
|
||||
|
||||
bool8 HasCompletedAllMazes(void)
|
||||
{
|
||||
s32 iVar2;
|
||||
for(iVar2 = 0; iVar2 < 17; iVar2++)
|
||||
s32 index;
|
||||
for(index = 0; index < 17; index++)
|
||||
{
|
||||
if(!(bool8)IsMazeCompleted(iVar2))
|
||||
if(!(bool8)IsMazeCompleted(index))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_8097640(void)
|
||||
bool8 sub_8097640(void)
|
||||
{
|
||||
if(sub_8001784(0, 0x2E, 0x1F) == 0 && HasCompletedAllMazes())
|
||||
{
|
||||
sub_800199C(0, 0x2E, 0x1F, 1);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "code_80A26CC.h"
|
||||
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern u8 sub_80973F4(s16);
|
||||
extern u8 sub_8097384(s16);
|
||||
s16 sub_80A26B8(s16);
|
||||
@ -40,10 +40,10 @@ u32 sub_80A25AC(u16 param_1)
|
||||
if (param_1 == 0x32) {
|
||||
return 0x32;
|
||||
}
|
||||
else if (sub_80023E4(0xc) == 0) {
|
||||
else if (!sub_80023E4(0xc)) {
|
||||
return 999;
|
||||
}
|
||||
else if (sub_80023E4(0xd) != 0) {
|
||||
else if (sub_80023E4(0xd)) {
|
||||
return 0x13;
|
||||
}
|
||||
else if (param_1 != 1) {
|
||||
@ -57,27 +57,27 @@ u32 sub_80A25AC(u16 param_1)
|
||||
}
|
||||
}
|
||||
|
||||
struct unkStruct_80A2608 *sub_80A2608(s16 r0)
|
||||
struct unkStruct_80A2608 *sub_80A2608(s16 index)
|
||||
{
|
||||
return &gUnknown_81168A8[r0];
|
||||
return &gUnknown_81168A8[index];
|
||||
}
|
||||
|
||||
struct unkStruct_80A2608 *sub_80A2620(s16 r0)
|
||||
struct unkStruct_80A2608 *sub_80A2620(s16 index)
|
||||
{
|
||||
u32 temp;
|
||||
temp = sub_80A26B8(r0);
|
||||
temp = sub_80A26B8(index);
|
||||
return &gUnknown_81168A8[temp];
|
||||
}
|
||||
|
||||
s16 sub_80A2644(u32 r0)
|
||||
s16 sub_80A2644(u32 index)
|
||||
{
|
||||
return gUnknown_8116F24[r0];
|
||||
return gUnknown_8116F24[index];
|
||||
}
|
||||
|
||||
s16 sub_80A2654(s16 r0)
|
||||
s16 sub_80A2654(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
temp = sub_80A2608(r0);
|
||||
temp = sub_80A2608(index);
|
||||
return temp->unkE;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ s16 sub_80A26CC(s16 r0)
|
||||
}
|
||||
|
||||
|
||||
s32 sub_80A26D8(u8 r0)
|
||||
s32 sub_80A26D8(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
s32 counter2;
|
||||
@ -141,7 +141,7 @@ s32 sub_80A26D8(u8 r0)
|
||||
temp = sub_80A2608(counter2);
|
||||
if(temp->unk11 != 0)
|
||||
{
|
||||
if(temp->unkC == r0)
|
||||
if(temp->dungeonIndex == index)
|
||||
{
|
||||
return counter2;
|
||||
}
|
||||
@ -150,29 +150,29 @@ s32 sub_80A26D8(u8 r0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
u8 sub_80A270C(s16 r0)
|
||||
u8 sub_80A270C(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
s32 temp_number;
|
||||
s32 index_s32;
|
||||
|
||||
temp_number = r0; // forcing a shift before addressing
|
||||
temp = sub_80A2608(gUnknown_8116F9A[temp_number]);
|
||||
return temp->unkC;
|
||||
index_s32 = index; // forcing a shift before addressing
|
||||
temp = sub_80A2608(gUnknown_8116F9A[index_s32]);
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
u8 sub_80A2728(s16 r0)
|
||||
u8 sub_80A2728(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
s16 temp_number = (0xDC >> 2) + r0;
|
||||
s16 temp_number = (0xDC >> 2) + index;
|
||||
temp = sub_80A2608(temp_number);
|
||||
return temp->unkC;
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
u8 sub_80A2740(s32 r0)
|
||||
u8 sub_80A2740(s32 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
temp = sub_80A2608(r0);
|
||||
return temp->unkC;
|
||||
temp = sub_80A2608(index);
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
s16 sub_80A2750(s16 r0)
|
||||
@ -199,16 +199,16 @@ s16 sub_80A2750(s16 r0)
|
||||
temp = sub_80A2608(temp_2);
|
||||
if(temp->unkE == -1)
|
||||
return 1;
|
||||
if(sub_80023E4(5) != 0)
|
||||
if(sub_80023E4(5))
|
||||
return 1;
|
||||
if(sub_80973F4(temp->unkE) == 0)
|
||||
return 1;
|
||||
if(sub_80023E4(1) == 0)
|
||||
if(!sub_80023E4(1))
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
u8 sub_80A27CC(s16 r0)
|
||||
bool8 sub_80A27CC(s16 r0)
|
||||
{
|
||||
s32 temp;
|
||||
s32 temp2;
|
||||
@ -220,38 +220,38 @@ u8 sub_80A27CC(s16 r0)
|
||||
|
||||
return_var = sub_80A2620(r0);
|
||||
if(return_var->unk0 == -1)
|
||||
return 0;
|
||||
if(sub_80023E4(5) != 0)
|
||||
return 0;
|
||||
return FALSE;
|
||||
if(sub_80023E4(5))
|
||||
return FALSE;
|
||||
if(sub_8097384(r0) != 0)
|
||||
return 1;
|
||||
if(sub_80023E4(1) == 0)
|
||||
return 0;
|
||||
return TRUE;
|
||||
if(!sub_80023E4(1))
|
||||
return FALSE;
|
||||
if(sub_80973F4(temp) == 0)
|
||||
return 0;
|
||||
return 1;
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 sub_80A2824(u8 r0)
|
||||
bool8 sub_80A2824(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
struct unkStruct_80A2608 *temp;
|
||||
|
||||
if(sub_80023E4(5) != 0)
|
||||
return 0;
|
||||
if(sub_80023E4(1) != 0)
|
||||
if(sub_80023E4(5))
|
||||
return FALSE;
|
||||
if(sub_80023E4(1))
|
||||
{
|
||||
for(counter = 0; counter <= 0x2D; counter++)
|
||||
{
|
||||
temp = sub_80A2620(counter);
|
||||
if(temp->unk11 != 0)
|
||||
{
|
||||
if(temp->unkC == r0)
|
||||
if(temp->dungeonIndex == index)
|
||||
{
|
||||
if(sub_8097384(counter) != 0)
|
||||
return 1;
|
||||
return TRUE;
|
||||
if(sub_80973F4(counter) != 0)
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -262,16 +262,16 @@ u8 sub_80A2824(u8 r0)
|
||||
{
|
||||
temp = sub_80A2620(counter);
|
||||
if(temp->unk11 != 0)
|
||||
if(temp->unkC == r0)
|
||||
if(temp->dungeonIndex == index)
|
||||
if(sub_8097384(counter) != 0)
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
u32 sub_80A28B4(s16 r0)
|
||||
bool8 sub_80A28B4(s16 r0)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
|
||||
@ -279,14 +279,14 @@ u32 sub_80A28B4(s16 r0)
|
||||
if(temp->unk0 != -1)
|
||||
{
|
||||
if(sub_8097384(r0) == 0 && sub_80973F4(r0) == 0)
|
||||
return 0;
|
||||
return FALSE;
|
||||
else
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 sub_80A28F0(u8 r0)
|
||||
bool8 sub_80A28F0(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
struct unkStruct_80A2608 *temp;
|
||||
@ -296,16 +296,16 @@ u32 sub_80A28F0(u8 r0)
|
||||
temp = sub_80A2620(counter);
|
||||
if(temp->unk11 != 0)
|
||||
{
|
||||
if(temp->unkC == r0)
|
||||
if(temp->dungeonIndex == index)
|
||||
{
|
||||
if(sub_8097384(counter) != 0)
|
||||
return 1;
|
||||
return TRUE;
|
||||
if(sub_80973F4(counter) != 0)
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 sub_80A293C(u8 *param_1)
|
||||
@ -332,7 +332,7 @@ s32 sub_80A293C(u8 *param_1)
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) &&
|
||||
(sub_8097384(index) != 0)) {
|
||||
local_68[iVar3->unkC] = 1;
|
||||
local_68[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -373,13 +373,13 @@ s32 sub_80A29B0(u8 *param_1)
|
||||
} while ((int)pcVar2 >= (int)local_68);
|
||||
|
||||
|
||||
if (sub_80023E4(1) != 0) {
|
||||
if (sub_80023E4(1)) {
|
||||
for(index = 0; index < 0x2E; index++)
|
||||
{
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) &&
|
||||
(sub_80973F4(index) != 0)) {
|
||||
local_68[iVar3->unkC] = 1;
|
||||
local_68[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -416,13 +416,13 @@ s32 sub_80A2A5C(u8 *param_1)
|
||||
pcVar2--;
|
||||
} while ((s32)pcVar2 >= (s32)local_58);
|
||||
|
||||
if (sub_80023E4(1) != 0) {
|
||||
if (sub_80023E4(1)) {
|
||||
for(index = 0; index < 0x2E; index++)
|
||||
{
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) && ((sub_8097384(index) != 0) || (sub_80973F4(index) != 0)))
|
||||
{
|
||||
local_58[iVar3->unkC] = 1;
|
||||
local_58[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -432,7 +432,7 @@ s32 sub_80A2A5C(u8 *param_1)
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) && (sub_8097384(index) != 0))
|
||||
{
|
||||
local_58[iVar3->unkC] = 1;
|
||||
local_58[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ void sub_8001D88(void)
|
||||
sub_80018D8(0,0x28,2);
|
||||
}
|
||||
else {
|
||||
if ((sub_8001D08(4,0,0)) && (sub_8001D44(3,0xf,3) != 0)) {
|
||||
if ((sub_8001D08(4,0,0)) && (sub_8001D44(3,0xf,3))) {
|
||||
ScenarioCalc(4,0x1d,1);
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ void sub_8001D88(void)
|
||||
ScenarioCalc(9,0x2e,1);
|
||||
}
|
||||
}
|
||||
if (sub_8001CC4(9,0x30,0) == 0) {
|
||||
if (!sub_8001CC4(9,0x30,0)) {
|
||||
if ((sub_8001D08(5,0x22,0)) && HasRecruitedMon(SPECIES_ARTICUNO) && HasRecruitedMon(SPECIES_ZAPDOS) && HasRecruitedMon(SPECIES_MOLTRES)) {
|
||||
ScenarioCalc(5,0x22,1);
|
||||
}
|
||||
@ -314,12 +314,12 @@ void sub_8001D88(void)
|
||||
sub_80973A8(0x29,1);
|
||||
}
|
||||
}
|
||||
if (sub_8001CC4(5,0x22,0) == 0) {
|
||||
if (!sub_8001CC4(5,0x22,0)) {
|
||||
if (sub_8001D08(10,0,0)) {
|
||||
ScenarioCalc(10,0x31,1);
|
||||
sub_809733C(0x1b,1);
|
||||
}
|
||||
if ((sub_8001D08(0xc,0,0)) && (sub_8001CC4(0xb,0x34,0) == 0)) {
|
||||
if ((sub_8001D08(0xc,0,0)) && (!sub_8001CC4(0xb,0x34,0))) {
|
||||
ScenarioCalc(0xc,0x35,1);
|
||||
}
|
||||
}
|
||||
@ -333,9 +333,9 @@ void sub_8001D88(void)
|
||||
}
|
||||
}
|
||||
|
||||
u32 _FlagCalc(s32 param_1, s32 param_2, u32 param_3)
|
||||
u32 _FlagCalc(s32 param_1, s32 param_2, u32 operation)
|
||||
{
|
||||
switch(param_3) {
|
||||
switch(operation) {
|
||||
case 0:
|
||||
return param_2;
|
||||
case 1:
|
||||
@ -361,13 +361,13 @@ u32 _FlagCalc(s32 param_1, s32 param_2, u32 param_3)
|
||||
case 0xb:
|
||||
return OtherRandomCapped(param_2);
|
||||
default:
|
||||
FatalError(&gUnknown_80B7318,gUnknown_80B7324, param_3); // event flag expansion error %d
|
||||
FatalError(&gUnknown_80B7318,gUnknown_80B7324, operation); // event flag expansion error %d
|
||||
}
|
||||
}
|
||||
|
||||
u8 _FlagJudge(u32 param_1, u32 param_2, u32 param_3)
|
||||
u8 _FlagJudge(u32 param_1, u32 param_2, u32 operation)
|
||||
{
|
||||
switch(param_3) {
|
||||
switch(operation) {
|
||||
case 0:
|
||||
return 1;
|
||||
case 1:
|
||||
@ -391,16 +391,16 @@ u8 _FlagJudge(u32 param_1, u32 param_2, u32 param_3)
|
||||
case 10:
|
||||
return (int)param_1 >> (param_2) & 1;
|
||||
default:
|
||||
FatalError(&gUnknown_80B7350,gUnknown_80B735C, param_3); // event flag rule error %d
|
||||
FatalError(&gUnknown_80B7350,gUnknown_80B735C, operation); // event flag rule error %d
|
||||
}
|
||||
}
|
||||
|
||||
u32 FlagCalc(u32 r0, u32 r1, u32 r2)
|
||||
u32 FlagCalc(u32 r0, u32 r1, u32 operation)
|
||||
{
|
||||
return _FlagCalc(r0, r1, r2);
|
||||
return _FlagCalc(r0, r1, operation);
|
||||
}
|
||||
|
||||
void sub_800226C(u32 param_1, s16 param_2, s32 param_3, u32 param_4)
|
||||
void sub_800226C(u32 param_1, s16 param_2, s32 param_3, u32 operation)
|
||||
{
|
||||
u32 uVar1;
|
||||
u32 uVar3;
|
||||
@ -408,12 +408,12 @@ void sub_800226C(u32 param_1, s16 param_2, s32 param_3, u32 param_4)
|
||||
s32 param_2_s32 = param_2;
|
||||
|
||||
|
||||
uVar1 = sub_8001658(param_1,param_2_s32 );
|
||||
uVar3 = _FlagCalc(uVar1,param_3,param_4);
|
||||
uVar1 = sub_8001658(param_1,param_2_s32);
|
||||
uVar3 = _FlagCalc(uVar1,param_3,operation);
|
||||
sub_80018D8(param_1,param_2_s32,uVar3);
|
||||
}
|
||||
|
||||
void sub_80022A0(u32 param_1, s16 param_2, s16 param_3, u32 param_4)
|
||||
void sub_80022A0(u32 param_1, s16 param_2, s16 param_3, u32 operation)
|
||||
{
|
||||
u32 uVar1;
|
||||
u32 uVar2;
|
||||
@ -425,24 +425,24 @@ void sub_80022A0(u32 param_1, s16 param_2, s16 param_3, u32 param_4)
|
||||
|
||||
uVar1 = sub_8001658(param_1,param_2_s32);
|
||||
uVar2 = sub_8001658(param_1,param_3_s32);
|
||||
uVar3 = _FlagCalc(uVar1,uVar2,param_4);
|
||||
uVar3 = _FlagCalc(uVar1,uVar2,operation);
|
||||
sub_80018D8(param_1,param_2_s32,uVar3);
|
||||
}
|
||||
|
||||
u8 FlagJudge(u32 r0, u32 r1, u32 r2)
|
||||
u8 FlagJudge(u32 r0, u32 r1, u32 operation)
|
||||
{
|
||||
return _FlagJudge(r0, r1, r2);
|
||||
return _FlagJudge(r0, r1, operation);
|
||||
}
|
||||
|
||||
u8 sub_80022F8(u32 param_1, s16 param_2, s32 param_3, u32 param_4)
|
||||
u8 sub_80022F8(u32 param_1, s16 param_2, s32 param_3, u32 operation)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = sub_8001658(param_1, param_2);
|
||||
return _FlagJudge(uVar1,param_3,param_4);
|
||||
return _FlagJudge(uVar1,param_3,operation);
|
||||
}
|
||||
|
||||
u8 sub_8002318(u32 param_1, s16 param_2, s16 param_3, u32 param_4)
|
||||
u8 sub_8002318(u32 param_1, s16 param_2, s16 param_3, u32 operation)
|
||||
{
|
||||
u32 uVar1;
|
||||
u32 uVar2;
|
||||
@ -452,7 +452,7 @@ u8 sub_8002318(u32 param_1, s16 param_2, s16 param_3, u32 param_4)
|
||||
|
||||
uVar1 = sub_8001658(param_1,param_2_s32);
|
||||
uVar2 = sub_8001658(param_1,param_3_s32);
|
||||
return _FlagJudge(uVar1,uVar2,param_4);
|
||||
return _FlagJudge(uVar1,uVar2,operation);
|
||||
}
|
||||
|
||||
s32 sub_8002354(u32 param_1)
|
||||
@ -500,7 +500,7 @@ u8 *sub_80023C4(u32 param_1)
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_80023E4(u32 param_1)
|
||||
bool8 sub_80023E4(u32 param_1)
|
||||
{
|
||||
switch(param_1) {
|
||||
case 0:
|
||||
@ -564,6 +564,6 @@ u8 sub_80023E4(u32 param_1)
|
||||
case 0x1d:
|
||||
return HasCompletedAllMazes();
|
||||
default:
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ void sub_8027274(void)
|
||||
sub_8023B7C(1);
|
||||
break;
|
||||
case 3:
|
||||
sub_8027D40(3,&gUnknown_203B2BC->unk14);
|
||||
sub_8027D40(3,&gUnknown_203B2BC->item2);
|
||||
sub_8023DA4();
|
||||
sub_8012D60(&gUnknown_203B2BC->unk7C,gUnknown_203B2BC->menuItems,0,&gUnknown_203B2BC->unk16C,gUnknown_203B2BC->unk70,2);
|
||||
break;
|
||||
|
@ -28,7 +28,7 @@ extern u32 sub_801A6E8(u32);
|
||||
extern s32 sub_80144A4(s32 *);
|
||||
extern void sub_8027EB8();
|
||||
extern void sub_808D31C(struct PokemonStruct *);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern struct PokemonStruct *sub_808D3F8(void);
|
||||
extern struct PokemonStruct *sub_808D3BC(void);
|
||||
extern u32 sub_801F890(void);
|
||||
@ -58,7 +58,7 @@ extern void sub_8023C60(void);
|
||||
|
||||
void sub_80277FC(void)
|
||||
{
|
||||
struct PokemonStruct *iVar4;
|
||||
struct PokemonStruct *pokeStruct;
|
||||
|
||||
switch(sub_8023A94(1)) {
|
||||
case 0:
|
||||
@ -66,18 +66,18 @@ void sub_80277FC(void)
|
||||
break;
|
||||
case 3:
|
||||
gUnknown_203B2BC->targetPoke = sub_8023B44();
|
||||
iVar4 = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
gUnknown_203B2BC->unk18 = iVar4;
|
||||
gUnknown_203B2BC->unk1C = iVar4->isLeader;
|
||||
PeekPokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->unk14);
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
gUnknown_203B2BC->unk18 = pokeStruct;
|
||||
gUnknown_203B2BC->unk1C = pokeStruct->isLeader;
|
||||
PeekPokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->item2);
|
||||
SetFriendAreaActionMenuState(3);
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B2BC->targetPoke = sub_8023B44();
|
||||
iVar4 = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
gUnknown_203B2BC->unk18 = iVar4;
|
||||
gUnknown_203B2BC->unk1C = iVar4->isLeader;
|
||||
PeekPokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->unk14);
|
||||
pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
gUnknown_203B2BC->unk18 = pokeStruct;
|
||||
gUnknown_203B2BC->unk1C = pokeStruct->isLeader;
|
||||
PeekPokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->item2);
|
||||
SetFriendAreaActionMenuState(4);
|
||||
break;
|
||||
case 2:
|
||||
@ -90,27 +90,27 @@ void sub_80277FC(void)
|
||||
void sub_80278B4(void)
|
||||
{
|
||||
struct PokemonStruct *playerStruct;
|
||||
struct PokemonStruct *puVar3;
|
||||
struct PokemonStruct *iVar4;
|
||||
struct PokemonStruct *pokeStruct1;
|
||||
struct PokemonStruct *pokeStruct2;
|
||||
int local_c;
|
||||
|
||||
local_c = 0;
|
||||
sub_8023A94(0);
|
||||
if ((sub_8012FD8(&gUnknown_203B2BC->unk7C) == '\0') && (sub_8013114(&gUnknown_203B2BC->unk7C,&local_c), local_c != 1)) {
|
||||
if ((sub_8012FD8(&gUnknown_203B2BC->unk7C) == 0) && (sub_8013114(&gUnknown_203B2BC->unk7C,&local_c), local_c != 1)) {
|
||||
gUnknown_203B2BC->unk70 = local_c;
|
||||
}
|
||||
switch(local_c) {
|
||||
case 6:
|
||||
if (sub_808D750(gUnknown_203B2BC->targetPoke) != '\0') {
|
||||
if (sub_808D750(gUnknown_203B2BC->targetPoke)) {
|
||||
#ifdef NONMATCHING
|
||||
puVar3 = &gRecruiedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
pokeStruct1 = &gRecruiedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
#else
|
||||
register size_t offset asm("r1") = offsetof(struct unkStruct_203B45C, pokemon[gUnknown_203B2BC->targetPoke]);
|
||||
struct PokemonStruct* p = gRecruitedPokemonRef->pokemon;
|
||||
size_t addr = offset + (size_t)p;
|
||||
puVar3 = (struct PokemonStruct*)addr;
|
||||
pokeStruct1 = (struct PokemonStruct*)addr;
|
||||
#endif
|
||||
puVar3->unk0 |= 2;
|
||||
pokeStruct1->unk0 |= 2;
|
||||
nullsub_104();
|
||||
}
|
||||
sub_808ED00();
|
||||
@ -123,11 +123,11 @@ void sub_80278B4(void)
|
||||
SetFriendAreaActionMenuState(2);
|
||||
break;
|
||||
case 8:
|
||||
iVar4 = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
pokeStruct2 = &gRecruitedPokemonRef->pokemon[gUnknown_203B2BC->targetPoke];
|
||||
playerStruct = GetPlayerPokemonStruct();
|
||||
if (!iVar4->isLeader) {
|
||||
if (!pokeStruct2->isLeader) {
|
||||
playerStruct->isLeader = FALSE;
|
||||
iVar4->isLeader = TRUE;
|
||||
pokeStruct2->isLeader = TRUE;
|
||||
nullsub_104();
|
||||
}
|
||||
sub_808ED00();
|
||||
@ -144,13 +144,13 @@ void sub_80278B4(void)
|
||||
break;
|
||||
case 0xb:
|
||||
PlaySound(0x14d);
|
||||
if (gUnknown_203B2BC->unk14.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->unk14);
|
||||
if (gUnknown_203B2BC->item2.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->item2);
|
||||
}
|
||||
FillInventoryGaps();
|
||||
gUnknown_203B2BC->unk14.itemIndex = 0;
|
||||
gUnknown_203B2BC->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->unk14);
|
||||
gUnknown_203B2BC->item2.itemIndex = ITEM_ID_NOTHING;
|
||||
gUnknown_203B2BC->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->item2);
|
||||
nullsub_104();
|
||||
SetFriendAreaActionMenuState(2);
|
||||
break;
|
||||
@ -197,7 +197,7 @@ void sub_8027A5C(void)
|
||||
}
|
||||
|
||||
static inline bool8 sub_8027A78_sub(void) {
|
||||
if (gUnknown_203B2BC->unk18->unk4.dungeonIndex == 0x44 || gUnknown_203B2BC->unk18->unk4.dungeonIndex == 0x45)
|
||||
if (gUnknown_203B2BC->unk18->dungeonLocation.dungeonIndex == 0x44 || gUnknown_203B2BC->unk18->dungeonLocation.dungeonIndex == 0x45)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@ -288,8 +288,8 @@ void sub_8027BD8(void)
|
||||
PlaySound(0x14d);
|
||||
ShiftItemsDownFrom(gUnknown_203B2BC->itemIndex);
|
||||
FillInventoryGaps();
|
||||
if (gUnknown_203B2BC->unk14.itemIndex != 0) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->unk14);
|
||||
if (gUnknown_203B2BC->item2.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->item2);
|
||||
}
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke,&gUnknown_203B2BC->itemToGive);
|
||||
sub_801A928();
|
||||
@ -327,7 +327,7 @@ void sub_8027CA0(void)
|
||||
case 3:
|
||||
case 4:
|
||||
gUnknown_203B2BC->unk20 = sub_801F194();
|
||||
gUnknown_203B2BC->unk24 = gUnknown_203B2BC->unk28[gUnknown_203B2BC->unk20].moveID;
|
||||
gUnknown_203B2BC->moveID = gUnknown_203B2BC->unk28[gUnknown_203B2BC->unk20].moveID;
|
||||
SetFriendAreaActionMenuState(0x10);
|
||||
break;
|
||||
case 2:
|
||||
@ -382,79 +382,79 @@ void sub_8027D40(u32 r0, struct HeldItem *heldItem)
|
||||
sub_80073E0(r0);
|
||||
}
|
||||
|
||||
u32 sub_8027D9C(struct PokemonStruct *r0)
|
||||
bool8 sub_8027D9C(struct PokemonStruct *pokeStruct)
|
||||
{
|
||||
u32 var1;
|
||||
if(r0->isLeader == 0)
|
||||
if(!pokeStruct->isLeader)
|
||||
{
|
||||
var1 = 0;
|
||||
if(r0->unk4.dungeonIndex == 0x41)
|
||||
if(pokeStruct->dungeonLocation.dungeonIndex == 0x41)
|
||||
var1 = 1;
|
||||
if(var1 != 0)
|
||||
{
|
||||
if(sub_80023E4(8) == 0)
|
||||
return 0;
|
||||
}
|
||||
if(var1 != 0)
|
||||
{
|
||||
if(!sub_80023E4(8))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
return 1;
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_8027DCC(struct PokemonStruct *r0)
|
||||
bool8 sub_8027DCC(struct PokemonStruct *pokeStruct)
|
||||
{
|
||||
u32 var1;
|
||||
if(sub_808D3BC() != r0)
|
||||
if(sub_808D3F8() != r0)
|
||||
if(r0->isLeader == 0)
|
||||
if(sub_808D3BC() != pokeStruct)
|
||||
if(sub_808D3F8() != pokeStruct)
|
||||
if(!pokeStruct->isLeader)
|
||||
{
|
||||
var1 = 0;
|
||||
if(r0->unk4.dungeonIndex == 0x41)
|
||||
if(pokeStruct->dungeonLocation.dungeonIndex == 0x41)
|
||||
var1 = 1;
|
||||
if(var1 != 0)
|
||||
{
|
||||
if(sub_80023E4(8) != 0)
|
||||
if(sub_80023E4(8))
|
||||
goto check;
|
||||
}
|
||||
else
|
||||
{
|
||||
check:
|
||||
if(sub_8027E18(r0) != 3)
|
||||
return 1;
|
||||
if(sub_8027E18(pokeStruct) != 3)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 sub_8027E18(struct PokemonStruct *r0)
|
||||
u32 sub_8027E18(struct PokemonStruct *pokeStruct)
|
||||
{
|
||||
if(r0->heldItem.itemIndex == 0)
|
||||
if(pokeStruct->heldItem.itemIndex == ITEM_ID_NOTHING)
|
||||
return 0;
|
||||
else if(GetNumberOfFilledInventorySlots() < INVENTORY_SIZE)
|
||||
return 1;
|
||||
else if(sub_8027E4C(r0))
|
||||
else if(sub_8027E4C(pokeStruct))
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
|
||||
u8 sub_8027E4C(struct PokemonStruct *r0)
|
||||
bool8 sub_8027E4C(struct PokemonStruct *pokeStruct)
|
||||
{
|
||||
if(!IsNotMoneyOrUsedTMItem(r0->heldItem.itemIndex))
|
||||
return 0;
|
||||
if(!IsNotMoneyOrUsedTMItem(pokeStruct->heldItem.itemIndex))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
if(IsThrowableItem(r0->heldItem.itemIndex))
|
||||
if(IsThrowableItem(pokeStruct->heldItem.itemIndex))
|
||||
{
|
||||
if(gTeamInventory_203B460->teamStorage[r0->heldItem.itemIndex] + r0->heldItem.numItems > 0x3e7)
|
||||
return 0;
|
||||
if(gTeamInventory_203B460->teamStorage[pokeStruct->heldItem.itemIndex] + pokeStruct->heldItem.numItems > 0x3e7)
|
||||
return FALSE;
|
||||
}
|
||||
else if(gTeamInventory_203B460->teamStorage[r0->heldItem.itemIndex] > 0x3e6)
|
||||
else if(gTeamInventory_203B460->teamStorage[pokeStruct->heldItem.itemIndex] > 0x3e6)
|
||||
{
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8027EB8(void)
|
||||
@ -463,22 +463,22 @@ void sub_8027EB8(void)
|
||||
{
|
||||
case 1:
|
||||
PlaySound(0x14d);
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->unk14);
|
||||
AddHeldItemToInventory(&gUnknown_203B2BC->item2);
|
||||
FillInventoryGaps();
|
||||
gUnknown_203B2BC->unk14.itemIndex = 0;
|
||||
gUnknown_203B2BC->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke, &gUnknown_203B2BC->unk14);
|
||||
gUnknown_203B2BC->item2.itemIndex = ITEM_ID_NOTHING;
|
||||
gUnknown_203B2BC->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke, &gUnknown_203B2BC->item2);
|
||||
SetFriendAreaActionMenuState(6);
|
||||
break;
|
||||
case 2:
|
||||
PlaySound(0x14d);
|
||||
if(IsThrowableItem(gUnknown_203B2BC->unk14.itemIndex))
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2BC->unk14.itemIndex] += gUnknown_203B2BC->unk14.numItems;
|
||||
if(IsThrowableItem(gUnknown_203B2BC->item2.itemIndex))
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2BC->item2.itemIndex] += gUnknown_203B2BC->item2.numItems;
|
||||
else
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2BC->unk14.itemIndex] += 1;
|
||||
gUnknown_203B2BC->unk14.itemIndex = 0;
|
||||
gUnknown_203B2BC->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke, &gUnknown_203B2BC->unk14);
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2BC->item2.itemIndex] += 1;
|
||||
gUnknown_203B2BC->item2.itemIndex = ITEM_ID_NOTHING;
|
||||
gUnknown_203B2BC->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2BC->targetPoke, &gUnknown_203B2BC->item2);
|
||||
SetFriendAreaActionMenuState(7);
|
||||
break;
|
||||
case 0:
|
||||
|
@ -12,14 +12,14 @@ struct unkStruct_203B2B8
|
||||
u32 state;
|
||||
u32 unk4;
|
||||
u8 unk8;
|
||||
s16 pokeSpecies;
|
||||
/* 0xA */ s16 pokeSpecies;
|
||||
u32 unkC;
|
||||
struct HeldItem unk10;
|
||||
struct HeldItem unk14;
|
||||
/* 0x10 */ struct HeldItem item1;
|
||||
/* 0x14 */ struct HeldItem item2;
|
||||
struct PokemonStruct *unk18;
|
||||
u8 fill1C[0x4];
|
||||
u32 unk20;
|
||||
u16 unk24;
|
||||
/* 0x24 */ u16 moveID;
|
||||
struct PokemonMove unk28[4];
|
||||
u8 fill48[0x70 - 0x48];
|
||||
u32 unk70;
|
||||
@ -41,7 +41,7 @@ extern u32 sub_8026F04(struct PokemonStruct *);
|
||||
extern void sub_8026074(u32);
|
||||
extern void PlaySound(u32);
|
||||
bool8 sub_8026F38(struct PokemonStruct *r0);
|
||||
extern u8 sub_80023E4(u8);
|
||||
extern bool8 sub_80023E4(u8);
|
||||
extern struct PokemonStruct *sub_808D3F8(void);
|
||||
extern struct PokemonStruct *sub_808D3BC(void);
|
||||
extern void sub_801F214(void);
|
||||
@ -145,13 +145,13 @@ void sub_80268CC(void)
|
||||
break;
|
||||
case 0xc:
|
||||
PlaySound(0x14d);
|
||||
if (gUnknown_203B2B8->unk14.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->unk14);
|
||||
if (gUnknown_203B2B8->item2.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->item2);
|
||||
}
|
||||
FillInventoryGaps();
|
||||
gUnknown_203B2B8->unk14.itemIndex = ITEM_ID_NOTHING;
|
||||
gUnknown_203B2B8->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies,&gUnknown_203B2B8->unk14);
|
||||
gUnknown_203B2B8->item2.itemIndex = ITEM_ID_NOTHING;
|
||||
gUnknown_203B2B8->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies,&gUnknown_203B2B8->item2);
|
||||
nullsub_104();
|
||||
sub_8026074(0x11);
|
||||
break;
|
||||
@ -200,7 +200,7 @@ void sub_8026A94(void)
|
||||
|
||||
|
||||
static inline bool8 sub_8026AB0_sub(void) {
|
||||
if (gUnknown_203B2B8->unk18->unk4.dungeonIndex == 0x44 || gUnknown_203B2B8->unk18->unk4.dungeonIndex == 0x45)
|
||||
if (gUnknown_203B2B8->unk18->dungeonLocation.dungeonIndex == 0x44 || gUnknown_203B2B8->unk18->dungeonLocation.dungeonIndex == 0x45)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@ -268,14 +268,14 @@ void sub_8026B64(void)
|
||||
{
|
||||
case 3:
|
||||
gUnknown_203B2B8->unkC = sub_801A8AC();
|
||||
gUnknown_203B2B8->unk10.itemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].itemIndex;
|
||||
gUnknown_203B2B8->unk10.numItems = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].numItems;
|
||||
gUnknown_203B2B8->item1.itemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].itemIndex;
|
||||
gUnknown_203B2B8->item1.numItems = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].numItems;
|
||||
sub_8026074(0x14);
|
||||
break;
|
||||
case 4:
|
||||
gUnknown_203B2B8->unkC = sub_801A8AC();
|
||||
gUnknown_203B2B8->unk10.itemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].itemIndex;
|
||||
gUnknown_203B2B8->unk10.numItems = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].numItems;
|
||||
gUnknown_203B2B8->item1.itemIndex = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].itemIndex;
|
||||
gUnknown_203B2B8->item1.numItems = gTeamInventory_203B460->teamItems[gUnknown_203B2B8->unkC].numItems;
|
||||
sub_8099690(0);
|
||||
sub_8026074(0x15);
|
||||
break;
|
||||
@ -308,17 +308,17 @@ void sub_8026C14(void)
|
||||
PlaySound(0x14d);
|
||||
ShiftItemsDownFrom(gUnknown_203B2B8->unkC);
|
||||
FillInventoryGaps();
|
||||
if (gUnknown_203B2B8->unk14.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->unk14);
|
||||
if (gUnknown_203B2B8->item2.itemIndex != ITEM_ID_NOTHING) {
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->item2);
|
||||
nextState = 0x10;
|
||||
}
|
||||
HeldItemToSlot(&slot,&gUnknown_203B2B8->unk10);
|
||||
HeldItemToSlot(&slot,&gUnknown_203B2B8->item1);
|
||||
temp.unk0 = 0;
|
||||
temp.unk4 = 0;
|
||||
temp.unk8 = 1;
|
||||
slot.itemFlags = ITEM_FLAG_EXISTS;
|
||||
sub_8090E14(gUnknown_202DEA8,&slot,&temp);
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies,&gUnknown_203B2B8->unk10);
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies,&gUnknown_203B2B8->item1);
|
||||
sub_801A928();
|
||||
nullsub_104();
|
||||
sub_8026074(nextState);
|
||||
@ -359,7 +359,7 @@ void sub_8026D0C(void)
|
||||
case 3:
|
||||
case 4:
|
||||
gUnknown_203B2B8->unk20 = sub_801F194();
|
||||
gUnknown_203B2B8->unk24 = gUnknown_203B2B8->unk28[gUnknown_203B2B8->unk20].moveID;
|
||||
gUnknown_203B2B8->moveID = gUnknown_203B2B8->unk28[gUnknown_203B2B8->unk20].moveID;
|
||||
sub_8026074(0x18);
|
||||
break;
|
||||
case 2:
|
||||
@ -431,9 +431,9 @@ u32 sub_8026E88(struct PokemonStruct *r0)
|
||||
u8 iVar3;
|
||||
if(r0->isLeader == 0)
|
||||
{
|
||||
iVar3 = (r0->unk4.dungeonIndex == 0x41);
|
||||
iVar3 = (r0->dungeonLocation.dungeonIndex == 0x41);
|
||||
if(iVar3 != 0)
|
||||
if(sub_80023E4(0x8) == 0)
|
||||
if(!sub_80023E4(0x8))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@ -448,10 +448,10 @@ u32 sub_8026EB8(struct PokemonStruct *r0)
|
||||
if(sub_808D3F8() != r0)
|
||||
if(!r0->isLeader)
|
||||
{
|
||||
iVar3 = (r0->unk4.dungeonIndex == 0x41);
|
||||
iVar3 = (r0->dungeonLocation.dungeonIndex == 0x41);
|
||||
if(iVar3 != 0)
|
||||
{
|
||||
if(sub_80023E4(0x8) != 0)
|
||||
if(sub_80023E4(0x8))
|
||||
goto check;
|
||||
}
|
||||
else
|
||||
@ -501,27 +501,27 @@ void sub_8026FA4(void)
|
||||
{
|
||||
case 1:
|
||||
PlaySound(0x14d);
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->unk14);
|
||||
AddHeldItemToInventory(&gUnknown_203B2B8->item2);
|
||||
FillInventoryGaps();
|
||||
gUnknown_203B2B8->unk14.itemIndex = 0;
|
||||
gUnknown_203B2B8->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies, &gUnknown_203B2B8->unk14);
|
||||
gUnknown_203B2B8->item2.itemIndex = 0;
|
||||
gUnknown_203B2B8->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies, &gUnknown_203B2B8->item2);
|
||||
sub_8026074(0xA);
|
||||
break;
|
||||
case 2:
|
||||
PlaySound(0x14d);
|
||||
if(IsThrowableItem(gUnknown_203B2B8->unk14.itemIndex))
|
||||
if(IsThrowableItem(gUnknown_203B2B8->item2.itemIndex))
|
||||
{
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2B8->unk14.itemIndex] += gUnknown_203B2B8->unk14.numItems;
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2B8->item2.itemIndex] += gUnknown_203B2B8->item2.numItems;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2B8->unk14.itemIndex] += 1;
|
||||
gTeamInventory_203B460->teamStorage[gUnknown_203B2B8->item2.itemIndex] += 1;
|
||||
}
|
||||
|
||||
gUnknown_203B2B8->unk14.itemIndex = 0;
|
||||
gUnknown_203B2B8->unk14.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies, &gUnknown_203B2B8->unk14);
|
||||
gUnknown_203B2B8->item2.itemIndex = 0;
|
||||
gUnknown_203B2B8->item2.numItems = 0;
|
||||
GivePokemonItem(gUnknown_203B2B8->pokeSpecies, &gUnknown_203B2B8->item2);
|
||||
sub_8026074(0xB);
|
||||
break;
|
||||
case 0:
|
||||
|
@ -71,9 +71,9 @@ extern void sub_809674C();
|
||||
extern void sub_80961B4();
|
||||
extern void ClearAllItems_8091FB4();
|
||||
extern const char *sub_80A2B18(s16);
|
||||
extern u8 sub_8001CC4(u8, u8, u8);
|
||||
extern bool8 sub_8001CC4(u8, u8, u8);
|
||||
extern void ChooseKecleonShopInventory(u32);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern void FadeOutAllMusic(u16);
|
||||
extern u8 sub_809C730();
|
||||
extern s16 sub_80A2750(s16);
|
||||
@ -161,15 +161,15 @@ void sub_8098C58(void)
|
||||
void sub_8098CC8(void)
|
||||
{
|
||||
u32 temp;
|
||||
if(sub_8001CC4(0x3, 0xB, 0) != 0)
|
||||
if(sub_8001CC4(0x3, 0xB, 0))
|
||||
{
|
||||
temp = 0;
|
||||
}
|
||||
else if(sub_8001CC4(0x3, 0xF, 0) != 0)
|
||||
else if(sub_8001CC4(0x3, 0xF, 0))
|
||||
{
|
||||
temp = 1;
|
||||
}
|
||||
else if(sub_8001CC4(0x3, 0x12, 0) != 0)
|
||||
else if(sub_8001CC4(0x3, 0x12, 0))
|
||||
{
|
||||
temp = 2;
|
||||
}
|
||||
@ -183,7 +183,7 @@ void sub_8098CC8(void)
|
||||
ClearAllItems_8091FB4();
|
||||
}
|
||||
|
||||
bool8 sub_8098D1C(s16 r0, u32 r1, u32 r2)
|
||||
bool8 GroundMainGroundRequest(s16 r0, u32 r1, u32 r2)
|
||||
{
|
||||
s32 temp;
|
||||
temp = r0; // force a asr shift
|
||||
@ -201,41 +201,41 @@ bool8 sub_8098D1C(s16 r0, u32 r1, u32 r2)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8098D80(u32 r0)
|
||||
bool8 sub_8098D80(u32 speed)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
gUnknown_20398A8 = 3;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r0;
|
||||
gUnknown_20398B0 = speed;
|
||||
sub_809C730();
|
||||
if(sub_80023E4(0xD) == 0)
|
||||
if(!sub_80023E4(0xD))
|
||||
{
|
||||
FadeOutAllMusic(r0);
|
||||
FadeOutAllMusic(speed);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8098DCC(u32 r0)
|
||||
bool8 sub_8098DCC(u32 speed)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
gUnknown_20398A8 = 4;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r0;
|
||||
gUnknown_20398B0 = speed;
|
||||
sub_809C730();
|
||||
if(sub_80023E4(0xD) == 0)
|
||||
if(!sub_80023E4(0xD))
|
||||
{
|
||||
FadeOutAllMusic(r0);
|
||||
FadeOutAllMusic(speed);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8098E18(s16 r0, u32 r1)
|
||||
bool8 GroundMainRescueRequest(s16 r0, u32 r1)
|
||||
{
|
||||
s32 r2 = r0, r5 = r2;
|
||||
if(gUnknown_20398A8 == 0)
|
||||
@ -267,7 +267,7 @@ bool8 sub_8098E18(s16 r0, u32 r1)
|
||||
}
|
||||
|
||||
// Unused
|
||||
u32 sub_8098EB0(u32 r0)
|
||||
u32 GroundMainUserRescueRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
@ -284,7 +284,7 @@ u32 sub_8098EB0(u32 r0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sub_8098F00(u32 r0)
|
||||
u32 GroundMainGameEndRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
@ -298,7 +298,7 @@ u32 sub_8098F00(u32 r0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sub_8098F44(u32 r0)
|
||||
u32 GroundMainGameCancelRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
@ -361,7 +361,7 @@ s32 sub_8098FCC(u32 unused)
|
||||
case 0x11:
|
||||
case 0x14:
|
||||
case 0x17:
|
||||
if (sub_80023E4(5) == 0) return 0xC;
|
||||
if (!sub_80023E4(5)) return 0xC;
|
||||
break;
|
||||
default:
|
||||
break;
|
@ -51,7 +51,7 @@ extern void sub_8095240(u32);
|
||||
|
||||
extern void sub_80920D8(u8 *);
|
||||
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern u8 *sub_8098FB4();
|
||||
extern u8 *GetDungeonLocationInfo(void);
|
||||
extern u32 GetNumAdventures(void);
|
||||
@ -295,7 +295,7 @@ void DrawLoadScreenText(void)
|
||||
xxx_call_draw_string(8,60,gHelperHeadingText,0,0); // Helper:
|
||||
|
||||
// Draw Team Name
|
||||
if (sub_80023E4(0) != '\0') {
|
||||
if (sub_80023E4(0)) {
|
||||
sub_80920D8(teamNameBuffer);
|
||||
r2 = teamNameBuffer;
|
||||
}
|
||||
@ -406,7 +406,7 @@ void sub_80397B4(void)
|
||||
// Draw the 12 legendary icons
|
||||
for(iVar3 = 0; iVar3 < 12; iVar3++)
|
||||
{
|
||||
if (sub_80023E4(gUnknown_203B3B8[iVar3]) != 0) {
|
||||
if (sub_80023E4(gUnknown_203B3B8[iVar3])) {
|
||||
sub_8007E20(0,iVar4,other_arg,0x10,0x10,*(int *)(clmkFile->data) + iVar3 * 0x80,
|
||||
gUnknown_203B388[iVar3]);
|
||||
iVar4 += 16;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "constants/colors.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "code_800D090.h"
|
||||
#include "dungeon.h"
|
||||
#include "text.h"
|
||||
@ -7,7 +8,7 @@
|
||||
struct unkStruct_203B31C
|
||||
{
|
||||
// Size: 0xD0
|
||||
s16 unk0[0x17];
|
||||
s16 unk0[NUM_DUNGEON_MAZE];
|
||||
u32 unk30;
|
||||
u8 fill34[0x48 - 0x34];
|
||||
s16 unk48;
|
||||
@ -85,7 +86,7 @@ s32 sub_8030668(void)
|
||||
|
||||
counter = 0;
|
||||
|
||||
for(index = 0; index < 0x17; index++)
|
||||
for(index = 0; index < NUM_DUNGEON_MAZE; index++)
|
||||
{
|
||||
if (sub_8097504(index)) {
|
||||
gUnknown_203B31C->unk0[counter] = sub_80A26CC(index);
|
||||
|
@ -755,7 +755,7 @@ void SavePokemonStruct(struct unkStruct_8094924* a1, struct PokemonStruct* pokem
|
||||
{
|
||||
SaveIntegerBits(a1, &pokemon->unkHasNextStage, 7);
|
||||
SaveIntegerBits(a1, &pokemon->speciesNum, 9);
|
||||
SaveDungeonLocation(a1, &pokemon->unk4);
|
||||
SaveDungeonLocation(a1, &pokemon->dungeonLocation);
|
||||
xxx_save_poke_sub_c_808F41C(a1, &pokemon->unkC[0]);
|
||||
xxx_save_poke_sub_c_808F41C(a1, &pokemon->unkC[1]);
|
||||
SaveIntegerBits(a1, &pokemon->IQ, 10);
|
||||
@ -782,7 +782,7 @@ void RestorePokemonStruct(struct unkStruct_8094924* a1, struct PokemonStruct* po
|
||||
pokemon->unk0 |= 1;
|
||||
}
|
||||
RestoreIntegerBits(a1, &pokemon->speciesNum, 9);
|
||||
RestoreDungeonLocation(a1, &pokemon->unk4);
|
||||
RestoreDungeonLocation(a1, &pokemon->dungeonLocation);
|
||||
xxx_restore_poke_sub_c_808F410(a1, &pokemon->unkC[0]);
|
||||
xxx_restore_poke_sub_c_808F410(a1, &pokemon->unkC[1]);
|
||||
RestoreIntegerBits(a1, &pokemon->IQ, 10);
|
||||
@ -817,7 +817,7 @@ s32 SavePokemonStruct2(u8* a1, s32 size)
|
||||
SaveIntegerBits(&backup, pokemon2->isLeader ? &data_u8_neg1 : &data_u8_zero, 1);
|
||||
SaveIntegerBits(&backup, &pokemon2->unkHasNextStage, 7);
|
||||
|
||||
SaveDungeonLocation(&backup, &pokemon2->unk4);
|
||||
SaveDungeonLocation(&backup, &pokemon2->dungeonLocation);
|
||||
SaveIntegerBits(&backup, &pokemon2->IQ, 10);
|
||||
SaveIntegerBits(&backup, &pokemon2->unkA, 16);
|
||||
SaveIntegerBits(&backup, &pokemon2->unkC, 16);
|
||||
@ -865,7 +865,7 @@ s32 RestorePokemonStruct2(u8* a1, s32 size)
|
||||
}
|
||||
RestoreIntegerBits(&backup, &pokemon2->unkHasNextStage, 7);
|
||||
|
||||
RestoreDungeonLocation(&backup, &pokemon2->unk4);
|
||||
RestoreDungeonLocation(&backup, &pokemon2->dungeonLocation);
|
||||
RestoreIntegerBits(&backup, &pokemon2->IQ, 10);
|
||||
RestoreIntegerBits(&backup, &pokemon2->unkA, 16);
|
||||
RestoreIntegerBits(&backup, &pokemon2->unkC, 16);
|
||||
|
@ -528,7 +528,7 @@ void xxx_pokemonstruct_to_pokemon2_808DE50(struct PokemonStruct2 * a1, struct Po
|
||||
a1->IQ = pokemon->IQ;
|
||||
a1->IQSkills = pokemon->IQSkills;
|
||||
sub_808E6F4(&a1->unk54);
|
||||
a1->unk4 = pokemon->unk4;
|
||||
a1->dungeonLocation = pokemon->dungeonLocation;
|
||||
a1->isLeader = pokemon->isLeader;
|
||||
a1->unkA = a3;
|
||||
a1->speciesNum = pokemon->speciesNum;
|
||||
@ -581,7 +581,7 @@ void xxx_pokemon2_to_pokemonstruct_808DF44(struct PokemonStruct* pokemon, struct
|
||||
pokemon->unkHasNextStage = a2->unkHasNextStage;
|
||||
pokemon->IQ = a2->IQ;
|
||||
pokemon->IQSkills = a2->IQSkills;
|
||||
pokemon->unk4 = a2->unk4;
|
||||
pokemon->dungeonLocation = a2->dungeonLocation;
|
||||
pokemon->isLeader = a2->isLeader;
|
||||
pokemon->speciesNum = a2->speciesNum;
|
||||
pokemon->unk24 = a2->unk50;
|
||||
|
@ -5,7 +5,7 @@
|
||||
extern struct RescueTeamData *gRescueTeamInfoRef;
|
||||
EWRAM_DATA struct RescueTeamData gRescueTeamInfo;
|
||||
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern void sub_80922B4(u8 *buffer, u8 *string, s32 size);
|
||||
extern void BoundedCopyStringtoBuffer(u8 *buffer, u8 *string, s32 size);
|
||||
|
||||
@ -27,7 +27,7 @@ void InitializeRescueTeamInfo(void)
|
||||
{
|
||||
BoundedCopyStringtoBuffer(gRescueTeamInfoRef->teamName, gTeamNamePlaceholder, TEAM_NAME_LENGTH);
|
||||
gRescueTeamInfoRef->teamRankPts = 0;
|
||||
gRescueTeamInfoRef->unk10 = 0;
|
||||
gRescueTeamInfoRef->isTeamRenamed = FALSE;
|
||||
}
|
||||
|
||||
void sub_80920B8(u8 *buffer)
|
||||
@ -104,9 +104,9 @@ const u8 *GetTeamRankString(u8 index)
|
||||
}
|
||||
|
||||
// Unused
|
||||
u8 sub_80921B8(void)
|
||||
bool8 GetIsTeamRenamed(void)
|
||||
{
|
||||
return gRescueTeamInfoRef->unk10;
|
||||
return gRescueTeamInfoRef->isTeamRenamed;
|
||||
}
|
||||
|
||||
u32 SaveRescueTeamInfo(u8 *param_1, u32 size)
|
||||
@ -123,9 +123,9 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 size)
|
||||
xxx_init_struct_8094924_save_809486C(&auStack36, param_1, size);
|
||||
SaveIntegerBits(&auStack36, gRescueTeamInfoRef->teamName, 0x58);
|
||||
SaveIntegerBits(&auStack36, (u8 *)&gRescueTeamInfoRef->teamRankPts, 0x20);
|
||||
gRescueTeamInfoRef->unk10 = sub_80023E4(0);
|
||||
gRescueTeamInfoRef->isTeamRenamed = sub_80023E4(0);
|
||||
|
||||
if (gRescueTeamInfoRef->unk10 != 0)
|
||||
if (gRescueTeamInfoRef->isTeamRenamed)
|
||||
{
|
||||
puVar2 = &neg1;
|
||||
}
|
||||
@ -147,7 +147,7 @@ u32 ReadRescueTeamInfo(u8 *param_1, u32 size)
|
||||
RestoreIntegerBits(&auStack32, gRescueTeamInfoRef->teamName, 0x58);
|
||||
RestoreIntegerBits(&auStack32, &gRescueTeamInfoRef->teamRankPts, 0x20);
|
||||
RestoreIntegerBits(&auStack32, byteArray, 1);
|
||||
gRescueTeamInfoRef->unk10 = byteArray[0] & 1;
|
||||
gRescueTeamInfoRef->isTeamRenamed = byteArray[0] & 1;
|
||||
nullsub_102(&auStack32);
|
||||
return auStack32.unk8;
|
||||
}
|
||||
|
@ -779,9 +779,9 @@ void sub_8028348(void)
|
||||
}
|
||||
|
||||
|
||||
void sub_8028B04(u32 r0)
|
||||
void sub_8028B04(u32 state)
|
||||
{
|
||||
gUnknown_203B2C0->state = r0;
|
||||
gUnknown_203B2C0->state = state;
|
||||
nullsub_130();
|
||||
sub_8028348();
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ extern void sub_802F204(struct unkStruct_802F204 *, u32);
|
||||
extern void sub_803C37C(struct DungeonLocation *, u32, u8 *);
|
||||
extern u32 GetDungeonTeamRankPts(struct DungeonLocation *, u32);
|
||||
extern void sub_80141B4(const char *r0, u32, struct OpenedFile **r1, u32);
|
||||
extern u8 sub_80023E4(u32);
|
||||
extern bool8 sub_80023E4(u32);
|
||||
extern void nullsub_131(void);
|
||||
extern void sub_802ABF8(void);
|
||||
|
||||
@ -365,7 +365,7 @@ void sub_802B3E0(void)
|
||||
|
||||
switch(gUnknown_203B2C8->currState) {
|
||||
case 0:
|
||||
if (sub_80023E4(0) != '\0') {
|
||||
if (sub_80023E4(0)) {
|
||||
// Copy Team Name to buffer
|
||||
sub_80920D8(teamNameBuffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user