mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-26 00:15:48 -05:00
Clean post_office_guide
This commit is contained in:
parent
b9afeb7fd6
commit
0909353890
|
|
@ -7280,7 +7280,7 @@ _080561E0:
|
|||
lsls r1, r2, 24
|
||||
lsrs r1, 24
|
||||
movs r2, 0
|
||||
bl sub_8090DC4
|
||||
bl BufferItemName
|
||||
adds r0, r5, 0
|
||||
mov r1, r8
|
||||
bl SendMessage
|
||||
|
|
@ -7650,7 +7650,7 @@ _080564E4:
|
|||
lsls r1, r2, 24
|
||||
lsrs r1, 24
|
||||
movs r2, 0
|
||||
bl sub_8090DC4
|
||||
bl BufferItemName
|
||||
_080564F2:
|
||||
mov r0, r8
|
||||
ldrh r1, [r0, 0x2]
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ _080844A4:
|
|||
adds r1, r6
|
||||
ldrb r1, [r1]
|
||||
movs r2, 0
|
||||
bl sub_8090DC4
|
||||
bl BufferItemName
|
||||
movs r3, 0
|
||||
ldr r0, _0808450C
|
||||
adds r6, r0, 0
|
||||
|
|
|
|||
|
|
@ -6376,7 +6376,7 @@ _0809C2CA:
|
|||
ldr r0, _0809C308
|
||||
adds r1, r4, 0
|
||||
movs r2, 0
|
||||
bl sub_8090DC4
|
||||
bl BufferItemName
|
||||
adds r0, r5, 0
|
||||
bl ShiftItemsDownFrom
|
||||
ldr r0, [r6]
|
||||
|
|
|
|||
23
include/code_803B050.h
Normal file
23
include/code_803B050.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef GUARD_CODE_803B050_H
|
||||
#define GUARD_CODE_803B050_H
|
||||
|
||||
// size: 0x8
|
||||
typedef struct unkStruct_80E9920
|
||||
{
|
||||
/* 0x0 */ s16 unkA;
|
||||
/* 0x2 */ s16 unkB;
|
||||
/* 0x4 */ u8 *text;
|
||||
} unkStruct_80E9920;
|
||||
|
||||
// size: 0xC
|
||||
typedef struct unkStruct_80E9F8C
|
||||
{
|
||||
/* 0x0 */ s16 unkA;
|
||||
/* 0x2 */ s16 unkB;
|
||||
/* 0x4 */ u8 *text1;
|
||||
/* 0x8 */ u8 *text2;
|
||||
} unkStruct_80E9F8C;
|
||||
|
||||
void sub_803B6B0(s32, s32, u8, u32);
|
||||
|
||||
#endif // GUARD_CODE_803B050_H
|
||||
|
|
@ -5,4 +5,4 @@
|
|||
|
||||
void SendMessage(Entity *pokemon, const char message[]);
|
||||
|
||||
#endif
|
||||
#endif // GUARD_CODE_80521D0_H
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef GUARD_CODE_80958E8_H
|
||||
#define GUARD_CODE_80958E8_H
|
||||
|
||||
#include "wonder_mail.h"
|
||||
#include "constants/mailbox.h"
|
||||
|
||||
|
|
@ -24,3 +27,5 @@ struct unkStruct_203B490
|
|||
};
|
||||
|
||||
extern struct unkStruct_203B490 *gUnknown_203B490;
|
||||
|
||||
#endif // GUARD_CODE_80958E8_H
|
||||
9
include/code_80958E8_1.h
Normal file
9
include/code_80958E8_1.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef GUARD_CODE_80958E8_1_H
|
||||
#define GUARD_CODE_80958E8_1_H
|
||||
|
||||
#include "wonder_mail.h"
|
||||
|
||||
s32 CountJobsinDungeon(u8);
|
||||
WonderMail *GetJobSlotInfo(u8);
|
||||
|
||||
#endif // GUARD_CODE_80958E8_1_H
|
||||
22
include/code_80972F4.h
Normal file
22
include/code_80972F4.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef GUARD_CODE_80972F4_H
|
||||
#define GUARD_CODE_80972F4_H
|
||||
|
||||
// size: 0x8
|
||||
struct MissionText
|
||||
{
|
||||
/* 0x0 */ u8 *text;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
};
|
||||
|
||||
const u8 *GetCurrentMissionText(s16);
|
||||
|
||||
const u8 *sub_80975DC(u32);
|
||||
|
||||
// These two are definitely bool8 but can't get them to match with it yet
|
||||
//bool8 sub_8097384(s16);
|
||||
//bool8 sub_80973F4(s16);
|
||||
|
||||
#endif // GUARD_CODE_80972F4_H
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
struct unkStruct_80A2608
|
||||
#ifndef GUARD_CODE_80A26CC_H
|
||||
#define GUARD_CODE_80A26CC_H
|
||||
|
||||
// size: 0x14
|
||||
typedef struct unkStruct_80A2608
|
||||
{
|
||||
/* 0x0 */ s16 unk0;
|
||||
/* 0x2 */ s16 unk2;
|
||||
|
|
@ -11,7 +15,29 @@ struct unkStruct_80A2608
|
|||
/* 0xE */ s16 unkE;
|
||||
/* 0x10 */ u8 unk10;
|
||||
/* 0x11 */ u8 unk11;
|
||||
};
|
||||
} unkStruct_80A2608;
|
||||
|
||||
struct unkStruct_80A2608 *sub_80A2608(s16 r0);
|
||||
struct unkStruct_80A2608 *sub_80A2620(s16 r0);
|
||||
void sub_80A2500(s32, s16 *);
|
||||
void sub_80A252C(s32, s16 *);
|
||||
void sub_80A2558(s32, s16 *);
|
||||
void sub_80A2584(s16, s16);
|
||||
void sub_80A2598(s16, s16);
|
||||
u32 sub_80A25AC(u16);
|
||||
const unkStruct_80A2608 *sub_80A2608(s16);
|
||||
const unkStruct_80A2608 *sub_80A2620(s16);
|
||||
s16 sub_80A2654(s16);
|
||||
s16 sub_80A2668(u32);
|
||||
s16 sub_80A2688(u8);
|
||||
s16 sub_80A26B8(s16);
|
||||
s16 sub_80A26CC(s16);
|
||||
u8 sub_80A270C(s16);
|
||||
u8 sub_80A2728(s16);
|
||||
u8 sub_80A2740(s32);
|
||||
s16 sub_80A2750(s16);
|
||||
bool8 sub_80A27CC(s16);
|
||||
bool8 sub_80A2824(u8);
|
||||
bool8 sub_80A28F0(u8);
|
||||
s32 sub_80A29B0(u8 *);
|
||||
const u8 *sub_80A2B18(s16);
|
||||
|
||||
#endif // GUARD_CODE_80A26CC_H
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef GUARD_EVENT_FLAG_H
|
||||
#define GUARD_EVENT_FLAG_H
|
||||
|
||||
// size: 0x8
|
||||
struct UnkEventStruct
|
||||
{
|
||||
/* 0x0 */ s16 *unk0;
|
||||
/* 0x4 */ u8 *unk4;
|
||||
};
|
||||
|
||||
|
||||
void sub_8001B88(s32 param_1,u32 *param_2,u32 *param_3);
|
||||
void ScenarioCalc(s16 param_1, s32 param_2, s32 param_3);
|
||||
bool8 sub_8001CC4(s16 param_1, u32 param_2, s32 param_3);
|
||||
|
|
@ -32,4 +32,7 @@ bool8 sub_8002718(u8 *r0);
|
|||
void sub_8002758(s32 r0);
|
||||
u8 sub_800276C(void);
|
||||
|
||||
// event_flag.s
|
||||
extern u32 sub_8001658(u32, u32);
|
||||
|
||||
#endif // GUARD_EVENT_FLAG_H
|
||||
|
|
|
|||
16
include/ground_main.h
Normal file
16
include/ground_main.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef GUARD_GROUND_MAIN_H
|
||||
#define GUARD_GROUND_MAIN_H
|
||||
|
||||
// size: 0xC
|
||||
typedef struct unkStruct_811BAF4
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
/* 0x8 */ u8 *text;
|
||||
} unkStruct_811BAF4;
|
||||
|
||||
bool8 sub_8098F88(void);
|
||||
|
||||
#endif // GUARD_GROUND_MAIN_H
|
||||
|
|
@ -1,15 +1,6 @@
|
|||
#ifndef GUARD_GROUND_MAP_1_H
|
||||
#define GUARD_GROUND_MAP_1_H
|
||||
|
||||
typedef struct unkStruct_811BAF4
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
u8 *text;
|
||||
} unkStruct_811BAF4;
|
||||
|
||||
void GroundMap_ExecuteEnter(s16);
|
||||
void GroundMap_ExecuteEvent(s16, u32);
|
||||
void GroundMap_ExecuteStation(s16, s16, s8, u32);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ u32 GetItemActionType(u8 id);
|
|||
u32 GetSpawnAmountRange(u8 id, u32 r1);
|
||||
u8 *GetItemDescription(u8 id);
|
||||
bool8 GetItemAIFlag(u8 id, u32 r1);
|
||||
void sub_8090DC4(void *param_1, u8 id, unkStruct_8090F58 *);
|
||||
void BufferItemName(u8 *, u8, unkStruct_8090F58 *);
|
||||
void sub_8090E14(u8 *ext_buffer, Item *slot, unkStruct_8090F58 *);
|
||||
bool8 AddItemToInventory(const Item* slot);
|
||||
void ConvertMoneyItemToMoney();
|
||||
|
|
@ -117,7 +117,6 @@ u32 GetMoneyValue(Item* slot);
|
|||
u16 GetItemMoveID(u8 index);
|
||||
bool8 CanSellItem(u32 id);
|
||||
bool8 IsGummiItem(u8);
|
||||
void sub_8090F58(void *, u8 *, Item *, unkStruct_8090F58 *);
|
||||
void ShiftItemsDownFrom(s32 start);
|
||||
void ClearItemSlotAt(u32 index);
|
||||
void MoveToStorage(Item *slot);
|
||||
|
|
|
|||
24
include/post_office_guide1.h
Normal file
24
include/post_office_guide1.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef GUARD_POST_OFFICE_GUIDE1_H
|
||||
#define GUARD_POST_OFFICE_GUIDE1_H
|
||||
|
||||
#include "file_system.h"
|
||||
|
||||
// size: 0x18
|
||||
typedef struct PostOfficeWork
|
||||
{
|
||||
/* 0x0 */ u8 state;
|
||||
/* 0x4 */ s32 currMenuChoice;
|
||||
/* 0x8 */ OpenedFile *faceFile;
|
||||
/* 0xC */ u8 *faceData;
|
||||
u16 unk10;
|
||||
u16 unk12;
|
||||
u8 unk14;
|
||||
u8 unk15;
|
||||
u8 unk16;
|
||||
} PostOfficeWork;
|
||||
|
||||
void CleanHelperPelipper(void);
|
||||
bool8 CreateHelperPelipperMenu(s16);
|
||||
u32 HelperPelipperCallback(void);
|
||||
|
||||
#endif // GUARD_POST_OFFICE_GUIDE1_H
|
||||
22
include/post_office_guide2.h
Normal file
22
include/post_office_guide2.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef GUARD_POST_OFFICE_GUIDE2_H
|
||||
#define GUARD_POST_OFFICE_GUIDE2_H
|
||||
|
||||
#include "input.h"
|
||||
#include "text.h"
|
||||
|
||||
// size: 0x78
|
||||
typedef struct unkStruct_203B330
|
||||
{
|
||||
/* 0x0 */ MenuInputStructSub input;
|
||||
u8 unkC;
|
||||
/* 0xD */ u8 dungeonIndex;
|
||||
u32 unk10;
|
||||
UnkTextStruct2 *unk14;
|
||||
UnkTextStruct2 unk18[4];
|
||||
} unkStruct_203B330;
|
||||
|
||||
bool8 sub_80319A4(u8, u8, s32);
|
||||
u32 sub_80319F8(void);
|
||||
void sub_8031A3C(void);
|
||||
|
||||
#endif // GUARD_POST_OFFICE_GUIDE2_H
|
||||
|
|
@ -130,7 +130,8 @@ SECTIONS {
|
|||
src/wonder_mail_4.o(.text);
|
||||
src/wonder_mail_5.o(.text);
|
||||
src/wonder_mail_6.o(.text);
|
||||
src/post_office_guide.o(.text);
|
||||
src/post_office_guide1.o(.text);
|
||||
src/post_office_guide2.o(.text);
|
||||
src/code_8031D70.o(.text);
|
||||
src/adventure_log.o(.text);
|
||||
src/friend_rescue.o(.text);
|
||||
|
|
@ -402,7 +403,8 @@ SECTIONS {
|
|||
src/wonder_mail_4.o(.rodata);
|
||||
src/wonder_mail_5.o(.rodata);
|
||||
src/wonder_mail_6.o(.rodata);
|
||||
src/post_office_guide.o(.rodata);
|
||||
src/post_office_guide1.o(.rodata);
|
||||
src/post_office_guide2.o(.rodata);
|
||||
src/code_8031D70.o(.rodata);
|
||||
src/adventure_log.o(.rodata);
|
||||
data/data_80E2068.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "constants/bg_music.h"
|
||||
#include "cpu.h"
|
||||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "file_system.h"
|
||||
#include "friend_area.h"
|
||||
|
|
@ -36,7 +37,6 @@ extern void sub_800DAAC(void);
|
|||
extern void sub_800135C(void);
|
||||
extern void xxx_script_related_8001334(u32);
|
||||
extern void sub_80015C0(u32, u32);
|
||||
extern u32 sub_8001658(u32, u32);
|
||||
extern void sub_800A8F8(u32);
|
||||
extern void sub_80097B0(void);
|
||||
extern void LoadTitleScreen(void);
|
||||
|
|
|
|||
|
|
@ -956,7 +956,7 @@ void sub_801CCD8(void)
|
|||
gUnknown_203B244->input.unk1E + 1,2,7,gUnknown_203B244->unk4E8);
|
||||
for(index = 0; index < gUnknown_203B244->input.unk1A; index++) {
|
||||
uVar3 = gUnknown_203B244->itemIDs[(gUnknown_203B244->input.unk1E * gUnknown_203B244->input.unk1C) + index];
|
||||
sub_8090DC4(buffer,uVar3,0);
|
||||
BufferItemName(buffer,uVar3,NULL);
|
||||
y = sub_8013800(&gUnknown_203B244->input,index);
|
||||
xxx_call_draw_string(8,y,buffer,gUnknown_203B244->unk4E8,0);
|
||||
y2 = sub_8013800(&gUnknown_203B244->input,index);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "items.h"
|
||||
#include "menu.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
#include "memory.h"
|
||||
#include "input.h"
|
||||
#include "text1.h"
|
||||
|
|
@ -19,6 +18,7 @@
|
|||
#include "code_80118A4.h"
|
||||
#include "wigglytuff_shop.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_main.h"
|
||||
|
||||
struct unkStruct_203B258
|
||||
{
|
||||
|
|
@ -34,16 +34,7 @@ extern struct unkStruct_203B258 *gUnknown_203B258;
|
|||
extern UnkTextStruct2 gUnknown_80DBF88;
|
||||
extern UnkTextStruct2 gUnknown_80DBF70;
|
||||
|
||||
struct unkStruct_811BAF4
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
u8 *text;
|
||||
};
|
||||
|
||||
extern struct unkStruct_811BAF4 gUnknown_811BAF4[10];
|
||||
extern unkStruct_811BAF4 gUnknown_811BAF4[10];
|
||||
|
||||
struct unkStruct_81188F0
|
||||
{
|
||||
|
|
@ -670,7 +661,7 @@ void sub_801DB54(void)
|
|||
|
||||
void sub_801DBD4(void)
|
||||
{
|
||||
struct unkStruct_811BAF4 *temp;
|
||||
unkStruct_811BAF4 *temp;
|
||||
struct unkStruct_81188F0 *temp2;
|
||||
s32 y;
|
||||
#ifndef NONMATCHING
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "global.h"
|
||||
#include "code_803B050.h"
|
||||
#include "constants/colors.h"
|
||||
#include "constants/wonder_mail.h"
|
||||
#include "pokemon.h"
|
||||
|
|
@ -13,21 +14,6 @@
|
|||
#include "menu_input.h"
|
||||
#include "wonder_mail.h"
|
||||
|
||||
struct unkStruct_80E9920
|
||||
{
|
||||
s16 unkA;
|
||||
s16 unkB;
|
||||
u8 *text;
|
||||
};
|
||||
|
||||
struct unkStruct_80E9F8C
|
||||
{
|
||||
s16 unkA;
|
||||
s16 unkB;
|
||||
u8 *text1;
|
||||
u8 *text2;
|
||||
};
|
||||
|
||||
extern s16 gUnknown_80E80E0[];
|
||||
extern s16 gUnknown_80E8126[];
|
||||
extern u8 gUnknown_80E888C[];
|
||||
|
|
@ -79,8 +65,8 @@ extern u8 *gUnknown_80E910C[];
|
|||
extern u8 *gUnknown_80E8C98[];
|
||||
extern u8 gUnknown_80E886C[];
|
||||
extern u8 *gUnknown_80EAE5C[];
|
||||
extern struct unkStruct_80E9F8C gUnknown_80E9F8C[10];
|
||||
extern struct unkStruct_80E9920 gUnknown_80E9920[10];
|
||||
extern unkStruct_80E9F8C gUnknown_80E9F8C[10];
|
||||
extern unkStruct_80E9920 gUnknown_80E9920[10];
|
||||
extern u8 *gUnknown_80E8B94[];
|
||||
|
||||
extern PokemonStruct1 *GetPlayerPokemonStruct(void);
|
||||
|
|
@ -125,12 +111,12 @@ void CreateRescueTitle(unkStruct_802C39C *param_1)
|
|||
xxx_call_draw_string(0x15,param_1->y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
case 12:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E8830,gUnknown_202DE58);
|
||||
xxx_call_draw_string(0x15,param_1->y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
case 11:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E8848,gUnknown_202DE58);
|
||||
xxx_call_draw_string(0x15,param_1->y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
|
|
@ -231,12 +217,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1)
|
|||
xxx_call_draw_string(10,y,gMedichamMissionDescription,param_1->unk0[0],0);
|
||||
break;
|
||||
case 4:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E8968,gUnknown_202DE58);
|
||||
xxx_call_draw_string(10,y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
case 5:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E89B0,gUnknown_202DE58);
|
||||
xxx_call_draw_string(10,y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
|
|
@ -262,7 +248,7 @@ void CreateRescueDescription(unkStruct_802C39C *param_1)
|
|||
case 16: {
|
||||
u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id;
|
||||
u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor;
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80EB3F8[(bVar2 % 0x16)],gUnknown_202DE58);
|
||||
xxx_call_draw_string(10,y,buf_1,param_1->unk0[0],0);
|
||||
y += 0xC;
|
||||
|
|
@ -343,12 +329,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1)
|
|||
xxx_call_draw_string(0x44,y,gUnknown_80E8AEC,param_1->unk0[0],0); // Friend Rescue
|
||||
break;
|
||||
case MISSION_TYPE_DELIVER_ITEM:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E8AFC,gUnknown_202DE58); // Deliver #C4%s#R.
|
||||
xxx_call_draw_string(0x44,y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
case MISSION_TYPE_FIND_ITEM:
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->targetItem,NULL);
|
||||
sprintfStatic(buf_1,gUnknown_80E8B10,gUnknown_202DE58); // Find #C4%s#R.
|
||||
xxx_call_draw_string(0x44,y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
|
|
@ -408,7 +394,7 @@ void CreateRescueDescription(unkStruct_802C39C *param_1)
|
|||
break;
|
||||
case 2: // Item
|
||||
case 3: // Item + ?
|
||||
sub_8090DC4(gUnknown_202DE58,param_1->rewardItem,0);
|
||||
BufferItemName(gUnknown_202DE58,param_1->rewardItem,NULL);
|
||||
sprintfStatic(buf_1,gMissionRewardText[param_1->rewardType],gUnknown_202DE58);
|
||||
xxx_call_draw_string(0x44,y,buf_1,param_1->unk0[0],0);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "constants/wonder_mail.h"
|
||||
#include "items.h"
|
||||
#include "code_80958E8.h"
|
||||
|
||||
#include "code_80958E8_1.h"
|
||||
#include "random.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
|
|
@ -17,7 +17,6 @@ struct unkStruct_8096AF8
|
|||
};
|
||||
|
||||
extern u8 IsJobSlotEmpty(u8);
|
||||
extern WonderMail * GetJobSlotInfo(u8);
|
||||
extern bool8 IsValidWonderMail(WonderMail *WonderMailData);
|
||||
extern u8 sub_8095E38(WonderMail *, u8, u8, bool8);
|
||||
extern void ResetJobSlot(u8);
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
#include "random.h"
|
||||
#include "friend_area.h"
|
||||
#include "code_80958E8.h"
|
||||
#include "code_80A26CC.h"
|
||||
|
||||
bool8 sub_8095E38(WonderMail *mail, u8 dungeon, u32 floor, u8 param_4);
|
||||
extern s32 sub_80A29B0(u8 *param_1);
|
||||
extern s32 GetDungeonFloorCount(u8);
|
||||
extern bool8 sub_809017C(DungeonLocation *);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,24 +6,16 @@
|
|||
#include "dungeon.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "event_flag.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "code_80972F4.h"
|
||||
|
||||
struct MissionText
|
||||
{
|
||||
u8 *text;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
};
|
||||
extern struct MissionText gStoryMissionText[];
|
||||
extern const char gFinalScenarioText[];
|
||||
extern const char gMeetNinetalesText[];
|
||||
extern const char gAvoidCaptureText[];
|
||||
extern const u8 gUnknown_8109CC0[];
|
||||
extern const u8 gDummyScenarioText[];
|
||||
extern u8 sub_80A270C(s16);
|
||||
|
||||
extern u8 sub_80A2728(s16);
|
||||
extern void sub_800199C(u8, u8, u16, s32);
|
||||
|
||||
void SaveWonderMail(struct unkStruct_8094924 *a, WonderMail *b);
|
||||
|
|
@ -34,7 +26,6 @@ extern void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*);
|
|||
extern void sub_80015C0(u8, u8);
|
||||
extern u32 sub_8001784(u32, u32, u16);
|
||||
extern void GeneratePelipperJobs(void);
|
||||
s16 sub_80A26B8(s16);
|
||||
extern void sub_80018D8(u8, u8, u32);
|
||||
|
||||
bool8 sub_8096F50(WonderMail *mail)
|
||||
|
|
@ -45,16 +36,15 @@ bool8 sub_8096F50(WonderMail *mail)
|
|||
|
||||
temp2 = sub_8096EB0(mail);
|
||||
|
||||
|
||||
for(index = 0; index < 0x10; index++)
|
||||
{
|
||||
for (index = 0; index < 0x10; index++) {
|
||||
temp = &gUnknown_203B490->unk230[index];
|
||||
if(temp->dungeon.id == mail->unk4.dungeon.id)
|
||||
if(temp->dungeon.floor == mail->unk4.dungeon.floor)
|
||||
if(temp->seed == mail->unk4.seed)
|
||||
if(temp->unk8 == temp2)
|
||||
if (temp->dungeon.id == mail->unk4.dungeon.id)
|
||||
if (temp->dungeon.floor == mail->unk4.dungeon.floor)
|
||||
if (temp->seed == mail->unk4.seed)
|
||||
if (temp->unk8 == temp2)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -232,18 +222,18 @@ void sub_809733C(short param_1,u32 param_2)
|
|||
|
||||
bool32 sub_8097384(s16 param_1)
|
||||
{
|
||||
bool32 iVar1;
|
||||
|
||||
if (param_1 == 0xd) {
|
||||
iVar1 = FALSE;
|
||||
}
|
||||
else {
|
||||
iVar1 = sub_8001784(0,0x2c,param_1 & 0xffff);
|
||||
if (iVar1 != 0) {
|
||||
iVar1 = TRUE;
|
||||
bool32 val;
|
||||
|
||||
if (param_1 == 13)
|
||||
val = FALSE;
|
||||
else {
|
||||
// May not need the & 0xFFFF if the 3rd param is s16
|
||||
val = sub_8001784(0, 44, param_1 & 0xFFFF);
|
||||
if (val != 0)
|
||||
val = TRUE;
|
||||
}
|
||||
}
|
||||
return iVar1;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void sub_80973A8(s16 param_1,u32 param_2)
|
||||
|
|
@ -264,23 +254,20 @@ void sub_80973A8(s16 param_1,u32 param_2)
|
|||
}
|
||||
}
|
||||
|
||||
s32 sub_80973F4(s32 param_1)
|
||||
bool32 sub_80973F4(s16 param_1)
|
||||
{
|
||||
s32 iVar1;
|
||||
s16 param_1_u16 = param_1;
|
||||
|
||||
if (param_1_u16 == 0xd) {
|
||||
iVar1 = 0;
|
||||
}
|
||||
else {
|
||||
s32 param_1_s32 = param_1_u16;
|
||||
u16 param_1_temp = param_1_s32;
|
||||
iVar1 = sub_8001784(0,0x2d,param_1_temp);
|
||||
if (iVar1 != 0) {
|
||||
iVar1 = 1;
|
||||
bool32 val;
|
||||
|
||||
if (param_1 == 13)
|
||||
val = FALSE;
|
||||
else {
|
||||
// May not need the & 0xFFFF if the 3rd param is s16
|
||||
val = sub_8001784(0, 45, param_1 & 0xFFFF);
|
||||
if (val != 0)
|
||||
val = TRUE;
|
||||
}
|
||||
}
|
||||
return iVar1;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
void sub_8097418(s16 index,u32 param_2)
|
||||
|
|
@ -434,7 +421,7 @@ const u8 *sub_80975C4(s16 index)
|
|||
return GetDungeonName1(sub_80A2728(index));
|
||||
}
|
||||
|
||||
const char *sub_80975DC(u32 r0)
|
||||
const u8 *sub_80975DC(u32 r0)
|
||||
{
|
||||
// TODO: slight hack but matches
|
||||
r0 <<= 16;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,23 @@
|
|||
#include "global.h"
|
||||
#include "code_80972F4.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_main.h"
|
||||
|
||||
extern u8 sub_80973F4(s16);
|
||||
extern u8 sub_8097384(s16);
|
||||
s16 sub_80A26B8(s16);
|
||||
extern struct unkStruct_80A2608 gUnknown_81168A8[];
|
||||
extern u8 sub_8098F88(void);
|
||||
extern u32 sub_8001658(u32, u32);
|
||||
|
||||
extern s16 gUnknown_8116F9A[];
|
||||
extern s16 gUnknown_8116F24[];
|
||||
// data_8115F5C.s
|
||||
extern const unkStruct_80A2608 gUnknown_81168A8[];
|
||||
extern const s16 gUnknown_8116F24[];
|
||||
extern const s16 gUnknown_8116F9A[];
|
||||
extern const u8 *gUnknown_8117000[];
|
||||
|
||||
extern void sub_809AC18(s32, s32);
|
||||
extern void sub_809ABB4(s32, s32);
|
||||
// code_80972F4.h (read comment)
|
||||
extern bool8 sub_8097384(s16);
|
||||
extern bool8 sub_80973F4(s16);
|
||||
|
||||
// code_8098BDC.s
|
||||
extern void sub_809AB4C(s32, s32);
|
||||
extern void sub_809ABB4(s32, s32);
|
||||
extern void sub_809AC18(s32, s32);
|
||||
|
||||
s16 sub_80A8BBC(s16);
|
||||
|
||||
|
|
@ -62,91 +64,77 @@ void sub_80A2598(s16 r0, s16 r1)
|
|||
|
||||
u32 sub_80A25AC(u16 param_1)
|
||||
{
|
||||
if (sub_8098F88() != 0) {
|
||||
if (sub_8098F88())
|
||||
return param_1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (param_1 == 0x32) {
|
||||
return 0x32;
|
||||
}
|
||||
else if (!sub_80023E4(0xc)) {
|
||||
return 999;
|
||||
}
|
||||
else if (sub_80023E4(0xd)) {
|
||||
return 0x13;
|
||||
}
|
||||
else if (param_1 != 1) {
|
||||
return param_1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_8001658(0,0x28);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (param_1 == 50)
|
||||
return 50;
|
||||
if (!sub_80023E4(12))
|
||||
return 999;
|
||||
if (sub_80023E4(13))
|
||||
return 19;
|
||||
if (param_1 != 1)
|
||||
return param_1;
|
||||
sub_8001658(0, 40);
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct unkStruct_80A2608 *sub_80A2608(s16 index)
|
||||
const unkStruct_80A2608 *sub_80A2608(s16 index)
|
||||
{
|
||||
return &gUnknown_81168A8[index];
|
||||
}
|
||||
|
||||
struct unkStruct_80A2608 *sub_80A2620(s16 index)
|
||||
const unkStruct_80A2608 *sub_80A2620(s16 index)
|
||||
{
|
||||
u32 temp;
|
||||
temp = sub_80A26B8(index);
|
||||
return &gUnknown_81168A8[temp];
|
||||
}
|
||||
|
||||
s16 sub_80A2644(u32 index)
|
||||
UNUSED static s16 sub_80A2644(u32 index)
|
||||
{
|
||||
return gUnknown_8116F24[index];
|
||||
}
|
||||
|
||||
s16 sub_80A2654(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
temp = sub_80A2608(index);
|
||||
return temp->unkE;
|
||||
}
|
||||
|
||||
// This is very ugly
|
||||
s32 sub_80A2668(u32 r0)
|
||||
s16 sub_80A2668(u32 r0)
|
||||
{
|
||||
u32 temp;
|
||||
temp = 0xffc90000 + (r0 << 16);
|
||||
if(temp >> 16 < 0x19)
|
||||
{
|
||||
temp = 0xFFC90000 + (r0 << 16);
|
||||
if (temp >> 16 < 0x19)
|
||||
return ((s32)temp >> 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
u32 sub_80A2688(u8 r0)
|
||||
s16 sub_80A2688(u8 r0)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = r0 - 0x4B;
|
||||
uVar1 = r0 - 75;
|
||||
|
||||
// u8 cast is needed for only this compare
|
||||
if ((u8)uVar1 < 0x17)
|
||||
if ((u8)uVar1 < 23)
|
||||
return uVar1;
|
||||
else if(r0 == 0x2F)
|
||||
return 0x17;
|
||||
else if (r0 == 0x30)
|
||||
return 0x18;
|
||||
else
|
||||
return -1;
|
||||
if (r0 == 47)
|
||||
return 23;
|
||||
if (r0 == 48)
|
||||
return 24;
|
||||
return -1;
|
||||
}
|
||||
|
||||
s16 sub_80A26B8(s16 r0)
|
||||
{
|
||||
// Useless cast that forces correct ordering
|
||||
s32 temp;
|
||||
|
||||
temp = r0;
|
||||
|
||||
return gUnknown_8116F9A[r0];
|
||||
|
|
@ -154,27 +142,22 @@ s16 sub_80A26B8(s16 r0)
|
|||
|
||||
s16 sub_80A26CC(s16 r0)
|
||||
{
|
||||
return (0xDC >> 2) + r0;
|
||||
return 55 + r0;
|
||||
}
|
||||
|
||||
|
||||
s32 sub_80A26D8(u8 index)
|
||||
UNUSED static s16 sub_80A26D8(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
s32 counter2;
|
||||
s32 temp2;
|
||||
struct unkStruct_80A2608 *temp;
|
||||
for(counter = 0; counter <= 0x52; counter++)
|
||||
{
|
||||
temp2 = counter << 0x10;
|
||||
counter2 = temp2 >> 0x10;
|
||||
s32 i;
|
||||
s16 counter2;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
for (i = 0; i < 83; i++) {
|
||||
counter2 = i;
|
||||
temp = sub_80A2608(counter2);
|
||||
if(temp->unk11 != 0)
|
||||
{
|
||||
if(temp->dungeonIndex == index)
|
||||
{
|
||||
|
||||
if (temp->unk11 != 0) {
|
||||
if (temp->dungeonIndex == index)
|
||||
return counter2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
@ -182,7 +165,7 @@ s32 sub_80A26D8(u8 index)
|
|||
|
||||
u8 sub_80A270C(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
s32 index_s32;
|
||||
|
||||
index_s32 = index; // forcing a shift before addressing
|
||||
|
|
@ -192,22 +175,24 @@ u8 sub_80A270C(s16 index)
|
|||
|
||||
u8 sub_80A2728(s16 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
s16 temp_number = (0xDC >> 2) + index;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
s16 temp_number = 55 + index;
|
||||
temp = sub_80A2608(temp_number);
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
u8 sub_80A2740(s32 index)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
temp = sub_80A2608(index);
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
s16 sub_80A2750(s16 r0)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
s32 temp_32;
|
||||
s32 temp_2;
|
||||
|
||||
|
|
@ -215,25 +200,25 @@ s16 sub_80A2750(s16 r0)
|
|||
temp_32 = r0;
|
||||
temp_2 = temp_32;
|
||||
|
||||
if(r0 == 0x50)
|
||||
if (r0 == 80)
|
||||
return 3;
|
||||
if(r0 == 0x51)
|
||||
if (r0 == 81)
|
||||
return 2;
|
||||
if(r0 == 0x52)
|
||||
if (r0 == 82)
|
||||
return 4;
|
||||
if((u16)(r0 - 0x28) <= 0xE)
|
||||
if ((u16)(r0 - 40) <= 14)
|
||||
return 2;
|
||||
if((u16)(r0 - 0x37) <= 0x18)
|
||||
if ((u16)(r0 - 55) <= 24)
|
||||
return 4;
|
||||
|
||||
temp = sub_80A2608(temp_2);
|
||||
if(temp->unkE == -1)
|
||||
if (temp->unkE == -1)
|
||||
return 1;
|
||||
if(sub_80023E4(5))
|
||||
if (sub_80023E4(5))
|
||||
return 1;
|
||||
if(sub_80973F4(temp->unkE) == 0)
|
||||
if (!sub_80973F4(temp->unkE))
|
||||
return 1;
|
||||
if(!sub_80023E4(1))
|
||||
if (!sub_80023E4(1))
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
|
@ -242,250 +227,238 @@ bool8 sub_80A27CC(s16 r0)
|
|||
{
|
||||
s32 temp;
|
||||
s32 temp2;
|
||||
struct unkStruct_80A2608 *return_var;
|
||||
const unkStruct_80A2608 *t;
|
||||
|
||||
// Same dumbness as above to get a match
|
||||
temp2 = r0;
|
||||
temp = temp2;
|
||||
|
||||
return_var = sub_80A2620(r0);
|
||||
if(return_var->unk0 == -1)
|
||||
t = sub_80A2620(r0);
|
||||
if (t->unk0 == -1)
|
||||
return FALSE;
|
||||
if(sub_80023E4(5))
|
||||
if (sub_80023E4(5))
|
||||
return FALSE;
|
||||
if(sub_8097384(r0) != 0)
|
||||
if (sub_8097384(r0))
|
||||
return TRUE;
|
||||
if(!sub_80023E4(1))
|
||||
if (!sub_80023E4(1))
|
||||
return FALSE;
|
||||
if(sub_80973F4(temp) == 0)
|
||||
if (!sub_80973F4(temp))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_80A2824(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
struct unkStruct_80A2608 *temp;
|
||||
s32 i;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
if(sub_80023E4(5))
|
||||
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->dungeonIndex == index)
|
||||
{
|
||||
if(sub_8097384(counter) != 0)
|
||||
|
||||
if (sub_80023E4(1)) {
|
||||
for (i = 0; i < 46; i++) {
|
||||
temp = sub_80A2620(i);
|
||||
|
||||
if (temp->unk11 != 0) {
|
||||
if (temp->dungeonIndex == index) {
|
||||
if (sub_8097384(i))
|
||||
return TRUE;
|
||||
if(sub_80973F4(counter) != 0)
|
||||
if (sub_80973F4(i))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(counter = 0; counter <= 0x2D; counter++)
|
||||
{
|
||||
temp = sub_80A2620(counter);
|
||||
if(temp->unk11 != 0)
|
||||
if(temp->dungeonIndex == index)
|
||||
if(sub_8097384(counter) != 0)
|
||||
else {
|
||||
for (i = 0; i < 46; i++) {
|
||||
temp = sub_80A2620(i);
|
||||
|
||||
if (temp->unk11 != 0)
|
||||
if (temp->dungeonIndex == index)
|
||||
if (sub_8097384(i))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80A28B4(s16 r0)
|
||||
UNUSED static bool8 sub_80A28B4(s16 r0)
|
||||
{
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
temp = sub_80A2620(r0);
|
||||
if(temp->unk0 != -1)
|
||||
{
|
||||
if(sub_8097384(r0) == 0 && sub_80973F4(r0) == 0)
|
||||
|
||||
if (temp->unk0 != -1) {
|
||||
if (!sub_8097384(r0) && !sub_80973F4(r0))
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80A28F0(u8 index)
|
||||
{
|
||||
s32 counter;
|
||||
struct unkStruct_80A2608 *temp;
|
||||
const unkStruct_80A2608 *temp;
|
||||
|
||||
for(counter = 0; counter < 0x2E; counter++)
|
||||
{
|
||||
for (counter = 0; counter < 0x2E; counter++) {
|
||||
temp = sub_80A2620(counter);
|
||||
if(temp->unk11 != 0)
|
||||
{
|
||||
if(temp->dungeonIndex == index)
|
||||
{
|
||||
if(sub_8097384(counter) != 0)
|
||||
|
||||
if (temp->unk11 != 0) {
|
||||
if (temp->dungeonIndex == index) {
|
||||
if (sub_8097384(counter))
|
||||
return TRUE;
|
||||
if(sub_80973F4(counter) != 0)
|
||||
if (sub_80973F4(counter))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 sub_80A293C(u8 *param_1)
|
||||
UNUSED static s32 sub_80A293C(u8 *param_1)
|
||||
{
|
||||
u8 *pcVar2;
|
||||
struct unkStruct_80A2608 * iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 local_68 [0x40];
|
||||
u8 zero;
|
||||
u8 *pcVar2;
|
||||
const unkStruct_80A2608 *iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 local_68[64];
|
||||
u8 zero;
|
||||
|
||||
counter = 0;
|
||||
zero = 0;
|
||||
counter = 0;
|
||||
zero = 0;
|
||||
|
||||
pcVar2 = &local_68[0x3e];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2--;
|
||||
} while ((int)pcVar2 >= (int)local_68);
|
||||
pcVar2 = &local_68[62];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2--;
|
||||
} while ((int)pcVar2 >= (int)local_68);
|
||||
|
||||
|
||||
for(index = 0; index < 0x2E; index++)
|
||||
{
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) &&
|
||||
(sub_8097384(index) != 0)) {
|
||||
local_68[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
for (index = 0; index < 46; index++) {
|
||||
iVar3 = sub_80A2620(index);
|
||||
if (iVar3->unk11 != 0 && sub_8097384(index))
|
||||
local_68[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
|
||||
for(index = 0; index < 0x3F; index++)
|
||||
{
|
||||
if (local_68[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
for (index = 0; index < 63; index++) {
|
||||
if (local_68[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
s32 sub_80A29B0(u8 *param_1)
|
||||
{
|
||||
u8 *pcVar2;
|
||||
struct unkStruct_80A2608 * iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 *local1;
|
||||
u8 *local2;
|
||||
u8 *local3;
|
||||
u8 *local4;
|
||||
u8 local_68 [0x40];
|
||||
u8 zero;
|
||||
u8 *pcVar2;
|
||||
const unkStruct_80A2608 *iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 *local1;
|
||||
u8 *local2;
|
||||
u8 *local3;
|
||||
u8 *local4;
|
||||
u8 local_68[0x40];
|
||||
u8 zero;
|
||||
|
||||
counter = 0;
|
||||
local1 = &local_68[0x2B];
|
||||
local2 = &local_68[0x2C];
|
||||
local3 = &local_68[0x2D];
|
||||
local4 = &local_68[0x2E];
|
||||
zero = 0;
|
||||
counter = 0;
|
||||
local1 = &local_68[43];
|
||||
local2 = &local_68[44];
|
||||
local3 = &local_68[45];
|
||||
local4 = &local_68[46];
|
||||
zero = 0;
|
||||
|
||||
pcVar2 = &local_68[0x3e];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2 = pcVar2 + -1;
|
||||
} while ((int)pcVar2 >= (int)local_68);
|
||||
pcVar2 = &local_68[62];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2 = pcVar2 + -1;
|
||||
} while ((int)pcVar2 >= (int)local_68);
|
||||
|
||||
|
||||
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->dungeonIndex] = 1;
|
||||
}
|
||||
if (sub_80023E4(1)) {
|
||||
for (index = 0; index < 46; index++) {
|
||||
iVar3 = sub_80A2620(index);
|
||||
|
||||
if (iVar3->unk11 != 0 && sub_80973F4(index))
|
||||
local_68[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
*local1 = 0;
|
||||
*local2 = 0;
|
||||
*local3 = 0;
|
||||
*local4 = 0;
|
||||
|
||||
for(index = 0; index < 0x3F; index++)
|
||||
{
|
||||
if (local_68[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
*local1 = 0;
|
||||
*local2 = 0;
|
||||
*local3 = 0;
|
||||
*local4 = 0;
|
||||
|
||||
for (index = 0; index < 63; index++) {
|
||||
if (local_68[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
s32 sub_80A2A5C(u8 *param_1)
|
||||
UNUSED static s32 sub_80A2A5C(u8 *param_1)
|
||||
{
|
||||
u8 *pcVar2;
|
||||
struct unkStruct_80A2608 *iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 local_58 [0x40];
|
||||
u8 zero;
|
||||
u8 *pcVar2;
|
||||
const unkStruct_80A2608 *iVar3;
|
||||
s32 index;
|
||||
s32 counter;
|
||||
u8 local_58[0x40];
|
||||
u8 zero;
|
||||
|
||||
counter = 0;
|
||||
zero = 0;
|
||||
|
||||
pcVar2 = &local_58[0x3E];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2--;
|
||||
} while ((s32)pcVar2 >= (s32)local_58);
|
||||
counter = 0;
|
||||
zero = 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->dungeonIndex] = 1;
|
||||
}
|
||||
pcVar2 = &local_58[62];
|
||||
do {
|
||||
*pcVar2 = zero;
|
||||
pcVar2--;
|
||||
} while ((s32)pcVar2 >= (s32)local_58);
|
||||
|
||||
if (sub_80023E4(1)) {
|
||||
for (index = 0; index < 46; index++) {
|
||||
iVar3 = sub_80A2620(index);
|
||||
|
||||
if (iVar3->unk11 != 0 && (sub_8097384(index) || sub_80973F4(index)))
|
||||
local_58[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(index = 0; index < 0x2E; index++)
|
||||
{
|
||||
iVar3 = sub_80A2620(index);
|
||||
if ((iVar3->unk11 != 0) && (sub_8097384(index) != 0))
|
||||
{
|
||||
local_58[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
else {
|
||||
for (index = 0; index < 46; index++) {
|
||||
iVar3 = sub_80A2620(index);
|
||||
|
||||
if (iVar3->unk11 != 0 && sub_8097384(index))
|
||||
local_58[iVar3->dungeonIndex] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(index = 0; index < 0x3F; index++)
|
||||
{
|
||||
if (local_58[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
|
||||
for (index = 0; index < 63; index++) {
|
||||
if (local_58[index] != 0) {
|
||||
param_1[counter] = index;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
// Returns Location string for the pause menu
|
||||
const u8 *sub_80A2B18(s16 param_1)
|
||||
{
|
||||
s32 param_1_s32 = param_1;
|
||||
const u8 **preload = gUnknown_8117000;
|
||||
return preload[param_1_s32];
|
||||
return gUnknown_8117000[param_1_s32];
|
||||
}
|
||||
|
||||
const u8 *sub_80A2B28(u16 r0)
|
||||
UNUSED static const u8 *sub_80A2B28(u16 r0)
|
||||
{
|
||||
return sub_80A2B18(sub_8001658(0, 17));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#include "global.h"
|
||||
#include "event_flag.h"
|
||||
#include "input.h"
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
|
|
@ -39,7 +40,6 @@ extern struct CreditsData* gCreditsTable[27];
|
|||
extern u16 gUnknown_80E5990[];
|
||||
|
||||
extern void sub_80015C0(u32, u32);
|
||||
extern s32 sub_8001658(u32, u32);
|
||||
extern void sub_8099690(u32);
|
||||
extern void sub_8099A5C(u32, u32, u32);
|
||||
extern void sub_8099AFC(u32, u32, u32);
|
||||
|
|
|
|||
|
|
@ -63,4 +63,4 @@ ALIGNED(4) static const u8 sSummary[] = "Summary";
|
|||
ALIGNED(4) static const u8 sMoves[] = "Moves";
|
||||
ALIGNED(4) static const u8 sCheckIQ[] = "Check IQ";
|
||||
ALIGNED(4) static const u8 sItemBuffered[] = _("Item: {COLOR_1 GREEN}{ARG_MOVE_ITEM_0}{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) static const u8 sFill1[] = "pksdir0";
|
||||
ALIGNED(4) static const u8 sFill[] = "pksdir0";
|
||||
7
src/data/ground_main.h
Normal file
7
src/data/ground_main.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
ALIGNED(4) static const u8 sFmtGroundRequest[] = "GroundMain ground request %3d %3d";
|
||||
ALIGNED(4) static const u8 sFmtRescueRequest[] = "GroundMain recue request %3d %3d";
|
||||
ALIGNED(4) static const u8 sFmtUserRescueRequest[] = "GroundMain user rescue request %3d";
|
||||
ALIGNED(4) static const u8 sFmtGameEndRequest[] = "GroundMain game end request %3d";
|
||||
ALIGNED(4) static const u8 sFmtGameCancelRequest[] = "GroundMain game cancel request %3d";
|
||||
UNUSED static const u8 sFill1[] = "pksdir0";
|
||||
UNUSED static const u8 sFill2[] = "pksdir0";
|
||||
|
|
@ -102,4 +102,5 @@ ALIGNED(4) static const u8 sLuminousCaveGiveName[] = _(
|
|||
"{CENTER_ALIGN}the evolved Pokémon. ");
|
||||
|
||||
ALIGNED(4) static const u8 sFill1[] = "pksdir0";
|
||||
// TODO: This may be for the file after, which has no data?
|
||||
ALIGNED(4) static const u8 sFill2[] = "pksdir0";
|
||||
40
src/data/makuhita_dojo.h
Normal file
40
src/data/makuhita_dojo.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
static const UnkTextStruct2 gUnknown_80E0760 = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 gMakuhitaDojoBonslyDoll[] = _(
|
||||
"{CENTER_ALIGN}{COLOR_1 YELLOW_5}$n0{END_COLOR_TEXT_1} received the {COLOR_1 GREEN_2}Bonsly Doll{END_COLOR_TEXT_1}!\n"
|
||||
"{CENTER_ALIGN}It has been placed outside your\n"
|
||||
"{CENTER_ALIGN}rescue team base.");
|
||||
ALIGNED(4) static const u8 gMakuhitaDojoGoTrain[] = "Go Train";
|
||||
ALIGNED(4) static const u8 sFill2[] = "pksdir0";
|
||||
|
||||
// TODO: SPLIT MAKUHITA
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E07EC = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
NULL
|
||||
};
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E0804 = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x06,
|
||||
0x02, 0x02,
|
||||
0x0E, 0x0E,
|
||||
0x0E, 0x00,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 gMakuhitaDojoHeader[] = "Courses";
|
||||
ALIGNED(4) static const u8 gUnknown_80E0824[] = _("{STAR_BULLET}");
|
||||
ALIGNED(4) static const u8 gMakuhitaCoursePlaceholder[] = _("{COLOR_2}%c%s{END_COLOR_TEXT_2}");
|
||||
ALIGNED(4) static const u8 sFill3[] = "pksdir0";
|
||||
|
|
@ -104,4 +104,4 @@ ALIGNED(4) static const u8 sPartyMenuMoves[] = "Moves";
|
|||
ALIGNED(4) static const u8 sPartyMenuCheckIQ[] = "Check IQ";
|
||||
ALIGNED(4) static const u8 sPartyMenuItemPlaceholder[] = _("Item: {COLOR_1 GREEN}{ARG_MOVE_ITEM_0}{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) static const u8 sUnknown_80DD6E0[] = "%s";
|
||||
ALIGNED(4) static const u8 sFill1[] = "pksdir0";
|
||||
ALIGNED(4) static const u8 sFill[] = "pksdir0";
|
||||
|
|
@ -1,8 +1,89 @@
|
|||
ALIGNED(4) const char gWhatdYouWantToKnow[] =
|
||||
static const u8 GetHelp_Text[];
|
||||
static const u8 GoRescue_Text[];
|
||||
static const u8 FriendRescueInfo_Text[];
|
||||
static const u8 FriendRescue_80E0A80[];
|
||||
static const u8 Delivery_Text[];
|
||||
static const u8 BulletinBoard_Text[];
|
||||
static const u8 PostOffice_Text[];
|
||||
|
||||
enum PostOfficeMenuActions
|
||||
{
|
||||
POST_OFFICE,
|
||||
BULLETIN_BOARD,
|
||||
DELIVERY,
|
||||
FRIEND_RESCUE,
|
||||
CANCEL,
|
||||
EXIT,
|
||||
FRIEND_RESCUE_INFO,
|
||||
GO_RESCUE,
|
||||
GET_HELP_MENU,
|
||||
DELETING_MAIL,
|
||||
RESCUE_PROCEDURES,
|
||||
RECEIVE_SOS_MAIL,
|
||||
LEAVE_FOR_RESCUE,
|
||||
SEND_AOK_MAIL,
|
||||
GET_THANK_YOU_MAIL,
|
||||
GETTING_HELP,
|
||||
SEND_SOS_MAIL,
|
||||
RECEIVE_AOK_MAIL,
|
||||
SEND_THANK_YOU_MAIL
|
||||
};
|
||||
|
||||
static const MenuItem gPostOfficeHelpStartMenu[] =
|
||||
{
|
||||
{PostOffice_Text, POST_OFFICE},
|
||||
{BulletinBoard_Text, BULLETIN_BOARD},
|
||||
{Delivery_Text, DELIVERY},
|
||||
{FriendRescue_80E0A80, FRIEND_RESCUE},
|
||||
{"Cancel", CANCEL},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 FriendRescue_80E0A80[] = _("{COLOR_1 YELLOW}Friend Rescue{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) static const u8 Delivery_Text[] = _("Delivery");
|
||||
ALIGNED(4) static const u8 BulletinBoard_Text[] = _("Bulletin Board");
|
||||
ALIGNED(4) static const u8 PostOffice_Text[] = _("Post Office");
|
||||
|
||||
static const MenuItem gPostOfficeHelpFriendRescueMenu[] =
|
||||
{
|
||||
{FriendRescueInfo_Text, FRIEND_RESCUE_INFO},
|
||||
{GoRescue_Text, GO_RESCUE},
|
||||
{GetHelp_Text, GET_HELP_MENU},
|
||||
{"Deleting Mail Info", DELETING_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 GetHelp_Text[] = _("{COLOR_1 YELLOW}Get help{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) static const u8 GoRescue_Text[] = _("{COLOR_1 YELLOW}Go rescue{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) static const u8 FriendRescueInfo_Text[] = _("Friend Rescue Info");
|
||||
|
||||
static const MenuItem gPostOfficeHelpGoRescueMenu[] =
|
||||
{
|
||||
{"Rescue Procedures", RESCUE_PROCEDURES},
|
||||
{"Receive SOS Mail", RECEIVE_SOS_MAIL},
|
||||
{"Leave for Rescue", LEAVE_FOR_RESCUE},
|
||||
{"Send A-OK Mail", SEND_AOK_MAIL},
|
||||
{"Get Thank-You Mail", GET_THANK_YOU_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
static const MenuItem gPostOfficeHelpGetHelpMenu[] =
|
||||
{
|
||||
{"Getting Help", GETTING_HELP},
|
||||
{"Send SOS Mail", SEND_SOS_MAIL},
|
||||
{"Receive A-OK Mail", RECEIVE_AOK_MAIL},
|
||||
{"Send Thank-You Mail", SEND_THANK_YOU_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 gWhatdYouWantToKnow[] =
|
||||
_(" So{COMMA} what{APOSTROPHE}d you want to\n"
|
||||
"know?");
|
||||
|
||||
ALIGNED(4) const char gGettingHelpExplanation[] =
|
||||
ALIGNED(4) static const u8 gGettingHelpExplanation[] =
|
||||
_(" If you need to call for\n"
|
||||
"help{COMMA} first send your friend\n"
|
||||
"an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -16,7 +97,7 @@ ALIGNED(4) const char gGettingHelpExplanation[] =
|
|||
"friend a {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1}.\n"
|
||||
"That{APOSTROPHE}s if you get revived{COMMA} of course.");
|
||||
|
||||
ALIGNED(4) const char gSendSOSMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gSendSOSMailExplanation[] =
|
||||
_(" If your team gets defeated\n"
|
||||
"in a dungeon{COMMA} you can send an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}\n"
|
||||
"to a friend willing to help.{EXTRA_MSG}"
|
||||
|
|
@ -27,7 +108,7 @@ ALIGNED(4) const char gSendSOSMailExplanation[] =
|
|||
"an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}{COMMA} you send it from the\n"
|
||||
"{COLOR_1 LIGHT_BLUE}main menu{END_COLOR_TEXT_1}.");
|
||||
|
||||
ALIGNED(4) const char gReceiveAOKMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gReceiveAOKMailExplanation[] =
|
||||
_(" If your friend manages to\n"
|
||||
"rescue your team{COMMA} you need to receive\n"
|
||||
"an {COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1} from your friend.{EXTRA_MSG}"
|
||||
|
|
@ -44,7 +125,7 @@ ALIGNED(4) const char gReceiveAOKMailExplanation[] =
|
|||
"team-saving {COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1} on the {COLOR_1 LIGHT_BLUE}main menu{END_COLOR_TEXT_1}{COMMA}\n"
|
||||
"all right?");
|
||||
|
||||
ALIGNED(4) const char gSendThankYouMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gSendThankYouMailExplanation[] =
|
||||
_(" If your team gets rescued{COMMA}\n"
|
||||
"be sure to send your friend\n"
|
||||
"a {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -57,7 +138,7 @@ ALIGNED(4) const char gSendThankYouMailExplanation[] =
|
|||
" You don{APOSTROPHE}t want to ever\n"
|
||||
"forget to express your thanks.");
|
||||
|
||||
ALIGNED(4) const char gRescueProceduresExplanation[] =
|
||||
ALIGNED(4) static const u8 gRescueProceduresExplanation[] =
|
||||
_(" If you want to go and\n"
|
||||
"rescue your friend{APOSTROPHE}s KO{APOSTROPHE}d team{COMMA}\n"
|
||||
"you need to receive an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -71,7 +152,7 @@ ALIGNED(4) const char gRescueProceduresExplanation[] =
|
|||
"friend can send back to you\n"
|
||||
"a {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1}.");
|
||||
|
||||
ALIGNED(4) const char gReceiveSOSMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gReceiveSOSMailExplanation[] =
|
||||
_(" To go off on a rescue{COMMA}\n"
|
||||
"you first need to receive your friend{APOSTROPHE}s\n"
|
||||
"{COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -79,7 +160,7 @@ ALIGNED(4) const char gReceiveSOSMailExplanation[] =
|
|||
"the {COLOR_1 LIGHT_BLUE}left counter{END_COLOR_TEXT_1} over there{COMMA}\n"
|
||||
"or by selecting it from the {COLOR_1 LIGHT_BLUE}main menu{END_COLOR_TEXT_1}.");
|
||||
|
||||
ALIGNED(4) const char gSendAOKMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gSendAOKMailExplanation[] =
|
||||
_(" If you succeed in rescuing\n"
|
||||
"that team{COMMA} you send your friend an\n"
|
||||
"{COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -93,7 +174,7 @@ ALIGNED(4) const char gSendAOKMailExplanation[] =
|
|||
"disappear from its Friend Area{COMMA} so\n"
|
||||
"don{APOSTROPHE}t you worry any.");
|
||||
|
||||
ALIGNED(4) const char gLeaveForRescueExplanation[] =
|
||||
ALIGNED(4) static const u8 gLeaveForRescueExplanation[] =
|
||||
_(" If you get an {COLOR_1 LIGHT_BLUE}SOS Mail{END_COLOR_TEXT_1}{COMMA}\n"
|
||||
"you head off on the rescue from\n"
|
||||
"the {COLOR_1 LIGHT_BLUE}left counter{END_COLOR_TEXT_1}.{EXTRA_MSG}"
|
||||
|
|
@ -104,7 +185,7 @@ ALIGNED(4) const char gLeaveForRescueExplanation[] =
|
|||
"there when you go farther in your\n"
|
||||
"adventure{COMMA} so it won{APOSTROPHE}t do to fret.");
|
||||
|
||||
ALIGNED(4) const char gGetThankYouMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gGetThankYouMailExplanation[] =
|
||||
_(" If you send your friend\n"
|
||||
"an {COLOR_1 LIGHT_BLUE}A-OK Mail{END_COLOR_TEXT_1}{COMMA} you can look forward\n"
|
||||
"to getting a {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1} back.{EXTRA_MSG}"
|
||||
|
|
@ -115,16 +196,16 @@ ALIGNED(4) const char gGetThankYouMailExplanation[] =
|
|||
"You {COLOR_1 RED}must not delete the A-OK Mail{END_COLOR_TEXT_1}\n"
|
||||
"before you get the {COLOR_1 LIGHT_BLUE}Thank-You Mail{END_COLOR_TEXT_1} back.");
|
||||
|
||||
ALIGNED(4) const char gImYourGuide[] =
|
||||
ALIGNED(4) static const u8 gImYourGuide[] =
|
||||
_(" I{APOSTROPHE}m your guide to what you\n"
|
||||
"can expect at the Pelipper Post Office.\n"
|
||||
"If you have any questions{COMMA} just ask away!");
|
||||
|
||||
ALIGNED(4) const char gAnythingElse[] =
|
||||
ALIGNED(4) static const u8 gAnythingElse[] =
|
||||
_(" Did you want to ask about\n"
|
||||
"anything else?");
|
||||
|
||||
ALIGNED(4) const char gPostOfficeExplanation[] =
|
||||
ALIGNED(4) static const u8 gPostOfficeExplanation[] =
|
||||
_(" {COLOR_1 LIGHT_BLUE}The Pelipper Post Office{END_COLOR_TEXT_1}\n"
|
||||
"keeps track of information from\n"
|
||||
"around the world.{EXTRA_MSG}"
|
||||
|
|
@ -141,14 +222,14 @@ ALIGNED(4) const char gPostOfficeExplanation[] =
|
|||
"for rescues{COMMA} and the {COLOR_1 LIGHT_BLUE}right counter{END_COLOR_TEXT_1}\n"
|
||||
"is for Thank-You Mail.");
|
||||
|
||||
ALIGNED(4) const char gBulletinBoardExplanation[] =
|
||||
ALIGNED(4) static const u8 gBulletinBoardExplanation[] =
|
||||
_(" The {COLOR_1 LIGHT_BLUE}Bulletin Board{END_COLOR_TEXT_1} outside\n"
|
||||
"here lists rescue requests.{EXTRA_MSG}"
|
||||
" Take on rescue jobs from\n"
|
||||
"the Bulletin Board. Be a hero and handle\n"
|
||||
"the jobs for fellow Pokémon in need!");
|
||||
|
||||
ALIGNED(4) const char gDeliveryExplanation[] =
|
||||
ALIGNED(4) static const u8 gDeliveryExplanation[] =
|
||||
_(" If your rescue team\n"
|
||||
"becomes famous for doing lots of rescues{COMMA}\n"
|
||||
"expect to get rescue requests directly.{EXTRA_MSG}"
|
||||
|
|
@ -156,7 +237,7 @@ ALIGNED(4) const char gDeliveryExplanation[] =
|
|||
"will take those jobs straight to your\n"
|
||||
"{COLOR_1 LIGHT_BLUE}Mailbox{END_COLOR_TEXT_1}.");
|
||||
|
||||
ALIGNED(4) const char gFriendRescueExplanation[] =
|
||||
ALIGNED(4) static const u8 gFriendRescueExplanation[] =
|
||||
_(" Friend Rescue is what we\n"
|
||||
"call rescue missions between friends using\n"
|
||||
"a {COLOR_1 LIGHT_BLUE}Game Link cable{END_COLOR_TEXT_1}{COMMA} {COLOR_1 LIGHT_BLUE}passwords{END_COLOR_TEXT_1}{COMMA} etc.{EXTRA_MSG}"
|
||||
|
|
@ -173,7 +254,7 @@ ALIGNED(4) const char gFriendRescueExplanation[] =
|
|||
"Rescue jobs at the {COLOR_1 LIGHT_BLUE}left counter{END_COLOR_TEXT_1} of\n"
|
||||
"that counter there.");
|
||||
|
||||
ALIGNED(4) const char gDeletingMailExplanation[] =
|
||||
ALIGNED(4) static const u8 gDeletingMailExplanation[] =
|
||||
_(" Deleting mail just means\n"
|
||||
"getting rid of old mail that you don{APOSTROPHE}t\n"
|
||||
"need anymore.{EXTRA_MSG}"
|
||||
|
|
@ -185,3 +266,5 @@ ALIGNED(4) const char gDeletingMailExplanation[] =
|
|||
"That{APOSTROPHE}s why you{APOSTROPHE}ll need to delete old mail.{EXTRA_MSG}"
|
||||
" You can look through old\n"
|
||||
"mail at the {COLOR_1 LIGHT_BLUE}left counter{END_COLOR_TEXT_1} over there.");
|
||||
|
||||
ALIGNED(4) static const u8 sFill[] = _("pksdir0");
|
||||
31
src/data/post_office_guide2.h
Normal file
31
src/data/post_office_guide2.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
static const UnkTextStruct2 sUnknown_80E1EFC =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const u8 sUnknown_80E1F14[] = {1, 0, 8, 0};
|
||||
|
||||
static const UnkTextStruct2 sUnknown_80E1F18 =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
6,
|
||||
2, 2,
|
||||
20, 4,
|
||||
4, 0,
|
||||
sUnknown_80E1F14
|
||||
};
|
||||
|
||||
ALIGNED(4) static const u8 sObjectives[] = "Objectives";
|
||||
ALIGNED(4) static const u8 sFmt1[] = "%dF";
|
||||
ALIGNED(4) static const u8 sFmtRescue[] = _(" Rescue {COLOR_1 YELLOW}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sJustGo[] = "Just go!";
|
||||
ALIGNED(4) static const u8 sFmtBring[] = _(" Bring {COLOR_1 GREEN}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFmtFind[] = _(" Find {COLOR_1 GREEN}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFmtEscort[] = _(" Escort to {COLOR_1 YELLOW}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sRedQuestionMarks[] = _("{COLOR_1 RED_2}???{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 sFill[] = "pksdir0";
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
#include "rescue_team_info.h"
|
||||
#include "other_random.h"
|
||||
#include "friend_area.h"
|
||||
|
||||
#include "code_80972F4.h"
|
||||
#include "code_8097670.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_3.h"
|
||||
|
|
@ -44,18 +44,20 @@ extern u8 gUnknown_80B7378[];
|
|||
extern u8 gUnknown_80B7388[];
|
||||
|
||||
void FatalError(DebugLocation *, const char *, ...) __attribute__((noreturn));
|
||||
extern u8 sub_80973F4(u32);
|
||||
extern bool8 HasCompletedAllMazes(void);
|
||||
extern void sub_8097418(u32, u32);
|
||||
extern void sub_800160C(struct UnkEventStruct *r0, u32 r1, u32 r2);
|
||||
extern u8 sub_8002658(s16);
|
||||
extern u32 sub_8001658(u32, s32);
|
||||
extern void sub_80018D8(u32, u32, u32);
|
||||
extern void sub_809733C(u32, u32);
|
||||
extern void sub_80973A8(u32, u32);
|
||||
extern void sub_800199C(u32, s32, u32, s32);
|
||||
extern s32 sub_8001784(u32, s32, u16);
|
||||
|
||||
|
||||
// code_80972F4.h (read comment)
|
||||
extern bool8 sub_80973F4(s16);
|
||||
|
||||
u8 *sub_8001A74(s16 param_1)
|
||||
{
|
||||
struct UnkEventStruct local_1c;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
#include "global.h"
|
||||
#include "code_800C9CC.h"
|
||||
#include "play_time.h"
|
||||
#include "input.h"
|
||||
#include "debug.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "event_flag.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_main.h"
|
||||
#include "ground_map_2.h"
|
||||
#include "input.h"
|
||||
#include "play_time.h"
|
||||
|
||||
EWRAM_DATA u32 gUnknown_20398A8 = {0};
|
||||
EWRAM_DATA u32 gUnknown_20398AC = {0};
|
||||
EWRAM_DATA u32 gUnknown_20398B0 = {0};
|
||||
EWRAM_DATA u32 gUnknown_20398B4 = {0};
|
||||
EWRAM_DATA u8 gUnknown_20398B8 = {0};
|
||||
EWRAM_DATA u8 gUnknown_20398B9 = {0};
|
||||
EWRAM_DATA bool8 gUnknown_20398B9 = {0};
|
||||
EWRAM_DATA u8 gUnknown_20398BA = {0};
|
||||
EWRAM_DATA UNUSED static u8 gUnknown_20398BB = {0}; // NOTE: Needed for matching but not used
|
||||
EWRAM_DATA UNUSED static u8 gUnknown_20398BB = {0};
|
||||
EWRAM_DATA u16 gUnknown_20398BC = {0};
|
||||
EWRAM_DATA u16 gUnknown_20398BE = {0};
|
||||
EWRAM_DATA u32 gUnknown_20398C0 = {0};
|
||||
|
|
@ -24,24 +25,9 @@ EWRAM_DATA s16 gUnknown_20398C4 = {0};
|
|||
EWRAM_DATA_2 u8 gUnknown_203B49C = {0};
|
||||
EWRAM_DATA_2 u8 gUnknown_203B49D = {0};
|
||||
|
||||
const char gUnknown_8115F5C[] = "GroundMain ground request %3d %3d";
|
||||
const char gUnknown_8115F80[] = "GroundMain recue request %3d %3d";
|
||||
const char gUnknown_8115FA4[] = "GroundMain user rescue request %3d";
|
||||
const char gUnknown_8115FC8[] = "GroundMain game end request %3d";
|
||||
const char gUnknown_8115FE8[] = "GroundMain game cancel request %3d";
|
||||
static const char unused_text[] = "pksdir0";
|
||||
static const char unused_text1[] = "pksdir0";
|
||||
#include "data/ground_main.h"
|
||||
|
||||
struct unkStruct_811BAF4
|
||||
{
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
u8 *text;
|
||||
};
|
||||
|
||||
extern struct unkStruct_811BAF4 gUnknown_811BAF4[10];
|
||||
extern unkStruct_811BAF4 gUnknown_811BAF4[10];
|
||||
|
||||
extern void sub_809B57C();
|
||||
extern void GroundScript_Unlock();
|
||||
|
|
@ -66,7 +52,6 @@ extern void GroundLives_Action();
|
|||
extern void GroundObject_Action();
|
||||
extern void GroundEffect_Action();
|
||||
|
||||
extern s32 sub_8001658(u8, u8);
|
||||
extern s32 sub_8001784(u8, u8, u8);
|
||||
extern void sub_809CB8C();
|
||||
extern void sub_80015C0(u8, u8);
|
||||
|
|
@ -76,10 +61,8 @@ extern void sub_8098CC8();
|
|||
extern void GeneratePelipperJobs();
|
||||
extern void sub_80961B4();
|
||||
extern void ClearAllItems_8091FB4();
|
||||
extern const char *sub_80A2B18(s16);
|
||||
extern void ChooseKecleonShopInventory(u32);
|
||||
extern u8 sub_809C730();
|
||||
extern s16 sub_80A2750(s16);
|
||||
|
||||
void sub_8098BDC(void)
|
||||
{
|
||||
|
|
@ -120,13 +103,12 @@ void sub_8098C58(void)
|
|||
sub_809CB8C();
|
||||
sub_8001D88();
|
||||
|
||||
if(sub_8001658(0, 0x2A) != 0)
|
||||
{
|
||||
if (sub_8001658(0, 0x2A) != 0) {
|
||||
temp = sub_8001658(0, 0x29);
|
||||
temp++;
|
||||
if(temp > 0xF){
|
||||
if (temp > 15)
|
||||
temp = 0;
|
||||
}
|
||||
|
||||
sub_80018D8(0, 0x29, temp);
|
||||
sub_80018D8(0, 0x2A, 0);
|
||||
}
|
||||
|
|
@ -191,7 +173,7 @@ bool8 GroundMainGroundRequest(s16 r0, u32 r1, u32 r2)
|
|||
temp = r0; // force a asr shift
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
Log(0, gUnknown_8115F5C, temp, r2);
|
||||
Log(0, sFmtGroundRequest, temp, r2);
|
||||
gUnknown_20398A8 = 1;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r2;
|
||||
|
|
@ -242,7 +224,7 @@ bool8 GroundMainRescueRequest(s16 r0, u32 r1)
|
|||
s32 r2 = r0, r5 = r2;
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
Log(0, gUnknown_8115F80, r2, r1);
|
||||
Log(0, sFmtRescueRequest, r2, r1);
|
||||
if(gUnknown_203B49D != 0)
|
||||
{
|
||||
gUnknown_20398A8 = 7;
|
||||
|
|
@ -268,53 +250,48 @@ bool8 GroundMainRescueRequest(s16 r0, u32 r1)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// Unused
|
||||
u32 GroundMainUserRescueRequest(u32 r0)
|
||||
UNUSED static bool8 GroundMainUserRescueRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
if(gUnknown_203B49D != 0)
|
||||
{
|
||||
Log(0, gUnknown_8115FA4, r0);
|
||||
if (gUnknown_20398A8 == 0) {
|
||||
if(gUnknown_203B49D != 0) {
|
||||
Log(0, sFmtUserRescueRequest, r0);
|
||||
gUnknown_20398A8 = 7;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r0;
|
||||
sub_809C730();
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 GroundMainGameEndRequest(u32 r0)
|
||||
bool32 GroundMainGameEndRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
Log(0, gUnknown_8115FC8, r0);
|
||||
if (gUnknown_20398A8 == 0) {
|
||||
Log(0, sFmtGameEndRequest, r0);
|
||||
gUnknown_20398A8 = 9;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r0;
|
||||
sub_809C730();
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 GroundMainGameCancelRequest(u32 r0)
|
||||
bool32 GroundMainGameCancelRequest(u32 r0)
|
||||
{
|
||||
if(gUnknown_20398A8 == 0)
|
||||
{
|
||||
Log(0, gUnknown_8115FE8, r0);
|
||||
if (gUnknown_20398A8 == 0) {
|
||||
Log(0, sFmtGameCancelRequest, r0);
|
||||
gUnknown_20398A8 = 10;
|
||||
gUnknown_20398AC = 1;
|
||||
gUnknown_20398B0 = r0;
|
||||
sub_809C730();
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 sub_8098F88(void)
|
||||
bool8 sub_8098F88(void)
|
||||
{
|
||||
return gUnknown_20398B9;
|
||||
}
|
||||
|
|
@ -334,13 +311,12 @@ const char *sub_8098FB4(void)
|
|||
return sub_80A2B18(sub_8001658(0, 0x11));
|
||||
}
|
||||
|
||||
|
||||
s16 sub_8098FCC(u32 unused)
|
||||
{
|
||||
s32 iVar4;
|
||||
s32 iVar5;
|
||||
s32 iVar6;
|
||||
struct unkStruct_80A2608 *iVar3;
|
||||
const unkStruct_80A2608 *iVar3;
|
||||
|
||||
iVar5 = (s16)sub_8001658(0,0x13);
|
||||
iVar6 = iVar5;
|
||||
|
|
@ -383,4 +359,4 @@ const char *sub_80990B8(void)
|
|||
{
|
||||
return sub_8098FB4();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#include "global.h"
|
||||
#include "debug.h"
|
||||
#include "ground_main.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "ground_script.h"
|
||||
|
||||
|
|
|
|||
42
src/items.c
42
src/items.c
|
|
@ -21,7 +21,7 @@ extern const char gUnknown_81097A4[];
|
|||
extern s32 gUnknown_81097B0[];
|
||||
extern u8 gUnknown_81097C4[];
|
||||
extern u16 gGummiStatBoostLUT[];
|
||||
extern u8 gUnknown_202DE58[0x58];
|
||||
extern u8 gUnknown_202DE58[];
|
||||
extern u32 gUnknown_202DE30;
|
||||
extern u8* gPtrTypeText; // ptr to "Type\0"
|
||||
extern u8* gPtrPPD0Text; // ptr to "PP $d0 \0"
|
||||
|
|
@ -44,6 +44,9 @@ extern s32 sub_8091E94(s32 a1, s32 a2, s32 a3);
|
|||
extern void SortKecleonShopInventory();
|
||||
bool8 AddKecleonWareItem(u8);
|
||||
|
||||
|
||||
static void sub_8090F58(u8 *, u8 *, Item *, unkStruct_8090F58 *);
|
||||
|
||||
void LoadItemParameters(void)
|
||||
{
|
||||
gTeamInventoryRef = &gTeamInventory;
|
||||
|
|
@ -293,15 +296,18 @@ bool8 GetItemAIFlag(u8 id, u32 r1)
|
|||
return gItemParametersData[id].aiFlags[r1];
|
||||
}
|
||||
|
||||
void sub_8090DC4(void* param_1,u8 id, struct unkStruct_8090F58* param_3)
|
||||
// a2 is always NULL
|
||||
// This func probably appends the quantity of 1, but I haven't checked
|
||||
// If it appends quantity, we can rename the func
|
||||
void BufferItemName(u8* dest, u8 id, struct unkStruct_8090F58* a2)
|
||||
{
|
||||
char acStack104 [80];
|
||||
Item unkItem;
|
||||
|
||||
strncpy(acStack104,gItemParametersData[id].name,0x50);
|
||||
xxx_init_itemslot_8090A8C(&unkItem,id,0);
|
||||
strncpy(acStack104, gItemParametersData[id].name, 80);
|
||||
xxx_init_itemslot_8090A8C(&unkItem, id, 0);
|
||||
unkItem.quantity = 1;
|
||||
sub_8090F58(param_1,acStack104,&unkItem,param_3);
|
||||
sub_8090F58(dest, acStack104, &unkItem, a2);
|
||||
}
|
||||
|
||||
extern const u8 gUnknown_8109770[];
|
||||
|
|
@ -370,7 +376,7 @@ void sub_8090E14(u8* ext_buffer, Item* slot, struct unkStruct_8090F58* a3) {
|
|||
return;
|
||||
}
|
||||
|
||||
void sub_8090F58(void* a1, u8 *a2, Item *slot, struct unkStruct_8090F58* a4) {
|
||||
static void sub_8090F58(u8* a1, u8 *a2, Item *slot, struct unkStruct_8090F58* a4) {
|
||||
u32 unk0;
|
||||
s32 value;
|
||||
u8 buffer[40];
|
||||
|
|
@ -683,17 +689,17 @@ u32 sub_80913E0(Item* slot, u32 a2, struct subStruct_203B240 ** a3)
|
|||
u8 buffer88[88]; // some struct
|
||||
|
||||
GetItemDescription(slot->id);
|
||||
sub_8090DC4(buffer88, slot->id, 0);
|
||||
BufferItemName(buffer88, slot->id, NULL);
|
||||
if (slot->id == ITEM_TM_USED_TM) {
|
||||
// empty TM
|
||||
sub_8090DC4(&gUnknown_202DE58, (u8)(slot->quantity + 125), 0);
|
||||
BufferItemName(gUnknown_202DE58, (u8)(slot->quantity + 125), NULL);
|
||||
}
|
||||
sub_80073B8(a2);
|
||||
xxx_format_and_draw(16, 0, buffer88, a2, 0);
|
||||
|
||||
xxx_format_and_draw(8, 24, GetItemDescription(slot->id), a2, 0);
|
||||
if (GetItemCategory(slot->id) == CATEGORY_TMS_HMS) {
|
||||
Move *buffer8 = (Move*) (buffer88 + 0x50); // field in struct
|
||||
Move *buffer8 = (Move*) (buffer88 + 80); // field in struct
|
||||
u16 move = GetItemMoveID(slot->id);
|
||||
u8 moves_data;
|
||||
const u8* typestring;
|
||||
|
|
@ -720,16 +726,16 @@ bool8 CanSellItem(u32 id)
|
|||
id = (u8)id;
|
||||
id_ = id;
|
||||
|
||||
if((id != ITEM_NOTHING)
|
||||
&& (id != ITEM_POKE)
|
||||
&& (id != ITEM_ROCK_PART)
|
||||
&& (id != ITEM_ICE_PART)
|
||||
&& (id != ITEM_STEEL_PART)
|
||||
&& (id != ITEM_MUSIC_BOX)
|
||||
&& (GetItemSellPrice(id_))
|
||||
&& (GetItemBuyPrice(id_))) {
|
||||
if (id != ITEM_NOTHING
|
||||
&& id != ITEM_POKE
|
||||
&& id != ITEM_ROCK_PART
|
||||
&& id != ITEM_ICE_PART
|
||||
&& id != ITEM_STEEL_PART
|
||||
&& id != ITEM_MUSIC_BOX
|
||||
&& GetItemSellPrice(id_)
|
||||
&& GetItemBuyPrice(id_))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ extern void sub_80920D8(u8 *);
|
|||
extern PokemonStruct1 *GetPlayerPokemonStruct(void);
|
||||
extern u8 *sub_8098FB4();
|
||||
extern void PrintDungeonLocationtoBuffer(u8 *, DungeonLocation *);
|
||||
extern u32 sub_8001658(u32, u32);
|
||||
|
||||
extern void xxx_format_string(u8 *, u8 *, u8 *, u32);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "constants/colors.h"
|
||||
#include "constants/input.h"
|
||||
#include "dungeon.h"
|
||||
|
|
@ -12,61 +13,19 @@
|
|||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
extern u8 gUnknown_202E1C8[];
|
||||
extern struct unkStruct_203B31C *gUnknown_203B31C;
|
||||
extern struct unkStruct_203B318 *gUnknown_203B318;
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
extern u8 gPlayerName[];
|
||||
|
||||
extern struct unkStruct_203B31C *gUnknown_203B31C;
|
||||
extern struct unkStruct_203B318 *gUnknown_203B318;
|
||||
|
||||
extern const u8 *gMakuhitaDialogue[2][10];
|
||||
extern u8 *gUnknown_80D4934[];
|
||||
extern u8 *gUnknown_80D4970[];
|
||||
|
||||
ALIGNED(4) const u8 gUnknown_80E0744[] = "Dungeons";
|
||||
ALIGNED(4) const u8 gUnknown_80E0750[] = {0x83, 0xC2};
|
||||
ALIGNED(4) const u8 gUnknown_80E0754[] = {0x83, 0xC0};
|
||||
static const u8 makuhita_dojo_fill1[] = "pksdir0";
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E0760 = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
NULL
|
||||
};
|
||||
|
||||
ALIGNED(4) const u8 gMakuhitaDojoBonslyDoll[] = _(
|
||||
"{CENTER_ALIGN}{COLOR_1 YELLOW_5}$n0{END_COLOR_TEXT_1} received the {COLOR_1 GREEN_2}Bonsly Doll{END_COLOR_TEXT_1}!\n"
|
||||
"{CENTER_ALIGN}It has been placed outside your\n"
|
||||
"{CENTER_ALIGN}rescue team base.");
|
||||
|
||||
const u8 gMakuhitaDojoGoTrain[] = "Go Train";
|
||||
|
||||
static const u8 makuhita_dojo_fill2[] = "pksdir0";
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E07EC = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
NULL
|
||||
};
|
||||
const UnkTextStruct2 gUnknown_80E0804 = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x06,
|
||||
0x02, 0x02,
|
||||
0x0E, 0x0E,
|
||||
0x0E, 0x00,
|
||||
NULL
|
||||
};
|
||||
|
||||
const u8 gMakuhitaDojoHeader[] = "Courses";
|
||||
ALIGNED(4) const u8 gUnknown_80E0824[] = _("{STAR_BULLET}");
|
||||
ALIGNED(4) const u8 gMakuhitaCoursePlaceholder[] = _("{COLOR_2}%c%s{END_COLOR_TEXT_2}");
|
||||
static const u8 makuhita_dojo_fill3[] = "pksdir0";
|
||||
#include "data/makuhita_dojo.h"
|
||||
|
||||
extern u32 sub_80095E4(s16, u32);
|
||||
extern u32 sub_801B60C(u32, u8, u8);
|
||||
|
|
@ -74,9 +33,6 @@ extern u32 sub_801B6AC(void);
|
|||
extern void sub_801B72C(void);
|
||||
extern void sub_803053C(void);
|
||||
extern bool8 sub_8097504(s16);
|
||||
extern s16 sub_80A2668(u32 r0);
|
||||
extern s16 sub_80A26CC(s16 r0);
|
||||
extern u8 sub_80A2740(s32 r0);
|
||||
|
||||
extern PokemonStruct1 *GetPlayerPokemonStruct(void);
|
||||
extern bool8 IsMazeCompleted(s32);
|
||||
|
|
@ -164,7 +120,7 @@ u32 MakuhitaDojo_New(u32 mode)
|
|||
gUnknown_203B318->unk60 = 2;
|
||||
gUnknown_203B318->unk62 = 8;
|
||||
MakuhitaDojo_SetState(initialState);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_802FE58(void)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "menu_input.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_803B050.h"
|
||||
|
||||
struct unkStruct_203B2CC
|
||||
{
|
||||
|
|
@ -168,7 +169,6 @@ extern void sub_8013E54(void);
|
|||
extern char gUnknown_202E5D8[0x50];
|
||||
extern char gAvailablePokemonNames[0x50];
|
||||
extern void sub_802BC7C(void);
|
||||
extern void sub_803B6B0(u32, u32, u32, u32);
|
||||
extern PokemonStruct1 *sub_808D3BC(void);
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,676 +0,0 @@
|
|||
#include "global.h"
|
||||
#include "pokemon.h"
|
||||
#include "constants/mailbox.h"
|
||||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "wonder_mail.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_8094F88.h"
|
||||
#include "menu_input.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80118A4.h"
|
||||
|
||||
struct PostOfficeHelper
|
||||
{
|
||||
// size: 0x18
|
||||
u8 state;
|
||||
s32 currMenuChoice;
|
||||
OpenedFile *faceFile;
|
||||
u8 *faceData;
|
||||
u16 unk10;
|
||||
u16 unk12;
|
||||
u8 unk14;
|
||||
u8 unk15;
|
||||
u8 unk16;
|
||||
};
|
||||
|
||||
EWRAM_DATA_2 struct PostOfficeHelper *gPostOfficeHelper = {0};
|
||||
|
||||
|
||||
struct unkStruct_203B330
|
||||
{
|
||||
// size: 0x78
|
||||
MenuInputStructSub input;
|
||||
u8 unkC;
|
||||
u8 dungeonIndex;
|
||||
u8 fillE[2];
|
||||
u32 unk10;
|
||||
UnkTextStruct2 *unk14;
|
||||
UnkTextStruct2 unk18[4];
|
||||
};
|
||||
EWRAM_DATA_2 struct unkStruct_203B330 *gUnknown_203B330 = {0};
|
||||
|
||||
|
||||
extern const char GetHelp_Text[];
|
||||
extern const char GoRescue_Text[];
|
||||
extern const char FriendRescueInfo_Text[];
|
||||
extern const char FriendRescue_80E0A80[];
|
||||
extern const char Delivery_Text[];
|
||||
extern const char BulletinBoard_Text[];
|
||||
extern const char PostOffice_Text[];
|
||||
|
||||
enum PostOfficeStates
|
||||
{
|
||||
EXIT_POST_OFFICE_MENU,
|
||||
IM_GUIDE_START_MENU,
|
||||
ANYTHING_ELSE_START_MENU,
|
||||
RETURN_TO_START_MENU,
|
||||
DISPLAY_FRIEND_RESCUE_MENU,
|
||||
RETURN_TO_FRIEND_RESCUE,
|
||||
DISPLAY_GO_RESCUE_MENU,
|
||||
RETURN_TO_GO_RESCUE,
|
||||
DISPLAY_GET_HELP_MENU,
|
||||
RETURN_TO_GET_HELP,
|
||||
};
|
||||
|
||||
enum PostOfficeMenuActions
|
||||
{
|
||||
POST_OFFICE,
|
||||
BULLETIN_BOARD,
|
||||
DELIVERY,
|
||||
FRIEND_RESCUE,
|
||||
CANCEL,
|
||||
EXIT,
|
||||
FRIEND_RESCUE_INFO,
|
||||
GO_RESCUE,
|
||||
GET_HELP_MENU,
|
||||
DELETING_MAIL,
|
||||
RESCUE_PROCEDURES,
|
||||
RECEIVE_SOS_MAIL,
|
||||
LEAVE_FOR_RESCUE,
|
||||
SEND_AOK_MAIL,
|
||||
GET_THANK_YOU_MAIL,
|
||||
GETTING_HELP,
|
||||
SEND_SOS_MAIL,
|
||||
RECEIVE_AOK_MAIL,
|
||||
SEND_THANK_YOU_MAIL
|
||||
};
|
||||
|
||||
const MenuItem gPostOfficeHelpStartMenu[] =
|
||||
{
|
||||
{PostOffice_Text, POST_OFFICE},
|
||||
{BulletinBoard_Text, BULLETIN_BOARD},
|
||||
{Delivery_Text, DELIVERY},
|
||||
{FriendRescue_80E0A80, FRIEND_RESCUE},
|
||||
{"Cancel", CANCEL},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
ALIGNED(4) const char FriendRescue_80E0A80[] = _("{COLOR_1 YELLOW}Friend Rescue{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) const char Delivery_Text[] = _("Delivery");
|
||||
ALIGNED(4) const char BulletinBoard_Text[] = _("Bulletin Board");
|
||||
ALIGNED(4) const char PostOffice_Text[] = _("Post Office");
|
||||
|
||||
const MenuItem gPostOfficeHelpFriendRescueMenu[] =
|
||||
{
|
||||
{FriendRescueInfo_Text, FRIEND_RESCUE_INFO},
|
||||
{GoRescue_Text, GO_RESCUE},
|
||||
{GetHelp_Text, GET_HELP_MENU},
|
||||
{"Deleting Mail Info", DELETING_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
ALIGNED(4) const char GetHelp_Text[] = _("{COLOR_1 YELLOW}Get help{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) const char GoRescue_Text[] = _("{COLOR_1 YELLOW}Go rescue{END_COLOR_TEXT_1} ");
|
||||
ALIGNED(4) const char FriendRescueInfo_Text[] = _("Friend Rescue Info");
|
||||
|
||||
|
||||
const MenuItem gPostOfficeHelpGoRescueMenu[] =
|
||||
{
|
||||
{"Rescue Procedures", RESCUE_PROCEDURES},
|
||||
{"Receive SOS Mail", RECEIVE_SOS_MAIL},
|
||||
{"Leave for Rescue", LEAVE_FOR_RESCUE},
|
||||
{"Send A-OK Mail", SEND_AOK_MAIL},
|
||||
{"Get Thank-You Mail", GET_THANK_YOU_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
const MenuItem gPostOfficeHelpGetHelpMenu[] =
|
||||
{
|
||||
{"Getting Help", GETTING_HELP},
|
||||
{"Send SOS Mail", SEND_SOS_MAIL},
|
||||
{"Receive A-OK Mail", RECEIVE_AOK_MAIL},
|
||||
{"Send Thank-You Mail", SEND_THANK_YOU_MAIL},
|
||||
{"Exit", EXIT},
|
||||
{NULL, EXIT}
|
||||
};
|
||||
|
||||
#include "data/pelipper_help_guide_dialogue.h"
|
||||
|
||||
ALIGNED(4) const u8 wonder_mail_fill[] = _("pksdir0");
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E1EFC =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
3,
|
||||
0, 0,
|
||||
0, 0,
|
||||
0, 0,
|
||||
NULL
|
||||
};
|
||||
|
||||
const u8 gUnkData_80E1F14[] = {1, 0, 8, 0};
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E1F18 =
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
6,
|
||||
2, 2,
|
||||
0x14, 4,
|
||||
4, 0,
|
||||
gUnkData_80E1F14
|
||||
};
|
||||
|
||||
ALIGNED(4) const u8 gUnknown_80E1F30[] = "Objectives";
|
||||
ALIGNED(4) const u8 gUnknown_80E1F3C[] = "%dF";
|
||||
ALIGNED(4) const u8 gUnknown_80E1F40[] = _(" Rescue {COLOR_1 YELLOW}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) const u8 gUnknown_80E1F54[] = "Just go!";
|
||||
ALIGNED(4) const u8 gUnknown_80E1F60[] = _(" Bring {COLOR_1 GREEN}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) const u8 gUnknown_80E1F70[] = _(" Find {COLOR_1 GREEN}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) const u8 gUnknown_80E1F80[] = _(" Escort to {COLOR_1 YELLOW}%s{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) const u8 gUnknown_80E1F94[] = _("{COLOR_1 RED_2}???{END_COLOR_TEXT_1}");
|
||||
ALIGNED(4) static const u8 post_office_fill[] = "pksdir0";
|
||||
|
||||
extern u8 gUnknown_202DE58[];
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
|
||||
extern void sub_8031A84();
|
||||
extern void DisplayMissionObjectives();
|
||||
extern u8 *GetCurrentMissionText(s16 r0);
|
||||
extern u8 *sub_80975DC(u32 r0);
|
||||
extern u8 sub_8099360(u8 *);
|
||||
extern u8 sub_8099394(volatile u8 *);
|
||||
extern WonderMail *GetJobSlotInfo(u8);
|
||||
extern void sub_803B6B0(u32, u32, u32, u32);
|
||||
extern s16 sub_80A2688(u8 r0);
|
||||
extern u8 sub_80992E0(s16 *, s16 *);
|
||||
|
||||
extern void sub_8031A2C(void);
|
||||
|
||||
void UpdateHelperPelipperState(u8);
|
||||
void HandlePostOfficeHelpStartMenuSelection();
|
||||
void ReturnToPostOfficeStartMenu();
|
||||
extern void HandlePostOfficeHelpFriendRescueMenuSelection();
|
||||
extern void ReturnToFriendRescueMenu();
|
||||
extern void HandlePostOfficeHelpGoRescueMenuSelection();
|
||||
extern void ReturntoGoRescueMenu();
|
||||
extern void HandlePostOfficeHelpGetHelpMenuSelection();
|
||||
extern void ReturnToGetHelpMenu();
|
||||
extern s32 CountJobsinDungeon(u8);
|
||||
|
||||
u32 CreateHelperPelipperMenu(s16 speciesID)
|
||||
{
|
||||
char *monName;
|
||||
OpenedFile *faceFile;
|
||||
int species_32;
|
||||
|
||||
species_32 = speciesID;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
gPostOfficeHelper = MemoryAlloc(sizeof(struct PostOfficeHelper), 8);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, speciesID);
|
||||
monName = GetMonSpecies(speciesID);
|
||||
strcpy(gAvailablePokemonNames, monName);
|
||||
gPostOfficeHelper->faceFile = NULL;
|
||||
gPostOfficeHelper->faceData = NULL;
|
||||
if (speciesID != MONSTER_NONE) {
|
||||
faceFile = GetDialogueSpriteDataPtr(species_32);
|
||||
gPostOfficeHelper->faceFile = faceFile;
|
||||
gPostOfficeHelper->unk14 = 0;
|
||||
gPostOfficeHelper->unk15 = 0;
|
||||
gPostOfficeHelper->unk16 = 0;
|
||||
gPostOfficeHelper->unk10 = 2;
|
||||
gPostOfficeHelper->unk12 = 8;
|
||||
if (gPostOfficeHelper->faceFile != NULL) {
|
||||
gPostOfficeHelper->faceData = gPostOfficeHelper->faceFile->data;
|
||||
}
|
||||
}
|
||||
gPostOfficeHelper->currMenuChoice = 0;
|
||||
UpdateHelperPelipperState(IM_GUIDE_START_MENU);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
u32 HelperPelipperCallback(void)
|
||||
{
|
||||
switch(gPostOfficeHelper->state) {
|
||||
case IM_GUIDE_START_MENU:
|
||||
case ANYTHING_ELSE_START_MENU:
|
||||
HandlePostOfficeHelpStartMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_START_MENU:
|
||||
ReturnToPostOfficeStartMenu();
|
||||
break;
|
||||
case DISPLAY_FRIEND_RESCUE_MENU:
|
||||
HandlePostOfficeHelpFriendRescueMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_FRIEND_RESCUE:
|
||||
ReturnToFriendRescueMenu();
|
||||
break;
|
||||
case DISPLAY_GO_RESCUE_MENU:
|
||||
HandlePostOfficeHelpGoRescueMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_GO_RESCUE:
|
||||
ReturntoGoRescueMenu();
|
||||
break;
|
||||
case EXIT_POST_OFFICE_MENU:
|
||||
return 3;
|
||||
case DISPLAY_GET_HELP_MENU:
|
||||
HandlePostOfficeHelpGetHelpMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_GET_HELP:
|
||||
ReturnToGetHelpMenu();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CleanHelperPelipper(void)
|
||||
{
|
||||
if(gPostOfficeHelper != NULL)
|
||||
{
|
||||
if(gPostOfficeHelper->faceFile != NULL)
|
||||
CloseFile(gPostOfficeHelper->faceFile);
|
||||
MemoryFree(gPostOfficeHelper);
|
||||
gPostOfficeHelper = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_39(void)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateHelperPelipperText(void)
|
||||
{
|
||||
OpenedFile **faceFile;
|
||||
faceFile = NULL;
|
||||
if(gPostOfficeHelper->faceFile != NULL)
|
||||
faceFile = &gPostOfficeHelper->faceFile;
|
||||
|
||||
switch(gPostOfficeHelper->state)
|
||||
{
|
||||
case DISPLAY_GET_HELP_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, gPostOfficeHelper->currMenuChoice, gPostOfficeHelpGetHelpMenu, 0, 4, 0, faceFile, 0xC);
|
||||
break;
|
||||
case RETURN_TO_GET_HELP:
|
||||
switch(gPostOfficeHelper->currMenuChoice)
|
||||
{
|
||||
case GETTING_HELP:
|
||||
sub_80141B4(gGettingHelpExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_SOS_MAIL:
|
||||
sub_80141B4(gSendSOSMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case RECEIVE_AOK_MAIL:
|
||||
sub_80141B4(gReceiveAOKMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_THANK_YOU_MAIL:
|
||||
sub_80141B4(gSendThankYouMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DISPLAY_GO_RESCUE_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, gPostOfficeHelper->currMenuChoice, gPostOfficeHelpGoRescueMenu, 0, 4, 0, faceFile, 0xC);
|
||||
break;
|
||||
case RETURN_TO_GO_RESCUE:
|
||||
switch(gPostOfficeHelper->currMenuChoice)
|
||||
{
|
||||
case RESCUE_PROCEDURES:
|
||||
sub_80141B4(gRescueProceduresExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case RECEIVE_SOS_MAIL:
|
||||
sub_80141B4(gReceiveSOSMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_AOK_MAIL:
|
||||
sub_80141B4(gSendAOKMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case LEAVE_FOR_RESCUE:
|
||||
sub_80141B4(gLeaveForRescueExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case GET_THANK_YOU_MAIL:
|
||||
sub_80141B4(gGetThankYouMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case IM_GUIDE_START_MENU:
|
||||
sub_8014248(gImYourGuide, 0, gPostOfficeHelper->currMenuChoice, gPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 0xC);
|
||||
break;
|
||||
case ANYTHING_ELSE_START_MENU:
|
||||
sub_8014248(gAnythingElse, 0, gPostOfficeHelper->currMenuChoice, gPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 0xC);
|
||||
break;
|
||||
case RETURN_TO_START_MENU:
|
||||
switch(gPostOfficeHelper->currMenuChoice)
|
||||
{
|
||||
case POST_OFFICE:
|
||||
sub_80141B4(gPostOfficeExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case BULLETIN_BOARD:
|
||||
sub_80141B4(gBulletinBoardExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case DELIVERY:
|
||||
sub_80141B4(gDeliveryExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DISPLAY_FRIEND_RESCUE_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, gPostOfficeHelper->currMenuChoice, gPostOfficeHelpFriendRescueMenu, 0, 4, 0, faceFile, 0xC);
|
||||
break;
|
||||
case RETURN_TO_FRIEND_RESCUE:
|
||||
switch(gPostOfficeHelper->currMenuChoice)
|
||||
{
|
||||
case FRIEND_RESCUE_INFO:
|
||||
sub_80141B4(gFriendRescueExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case DELETING_MAIL:
|
||||
sub_80141B4(gDeletingMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateHelperPelipperState(u8 newState)
|
||||
{
|
||||
gPostOfficeHelper->state = newState;
|
||||
nullsub_39();
|
||||
UpdateHelperPelipperText();
|
||||
}
|
||||
|
||||
void HandlePostOfficeHelpStartMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
if(sub_80144A4(&chosenAction) == 0)
|
||||
{
|
||||
switch(chosenAction)
|
||||
{
|
||||
case CANCEL:
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(EXIT_POST_OFFICE_MENU);
|
||||
break;
|
||||
case FRIEND_RESCUE:
|
||||
gPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case POST_OFFICE:
|
||||
case BULLETIN_BOARD:
|
||||
case DELIVERY:
|
||||
gPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_START_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReturnToPostOfficeStartMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
UpdateHelperPelipperState(ANYTHING_ELSE_START_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
void HandlePostOfficeHelpFriendRescueMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
if(sub_80144A4(&chosenAction) == 0)
|
||||
{
|
||||
switch(chosenAction)
|
||||
{
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(ANYTHING_ELSE_START_MENU);
|
||||
break;
|
||||
case GO_RESCUE:
|
||||
UpdateHelperPelipperState(DISPLAY_GO_RESCUE_MENU);
|
||||
break;
|
||||
case GET_HELP_MENU:
|
||||
UpdateHelperPelipperState(DISPLAY_GET_HELP_MENU);
|
||||
break;
|
||||
case FRIEND_RESCUE_INFO:
|
||||
case DELETING_MAIL:
|
||||
gPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_FRIEND_RESCUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReturnToFriendRescueMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
void HandlePostOfficeHelpGoRescueMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
if(sub_80144A4(&chosenAction) == 0)
|
||||
{
|
||||
switch(chosenAction)
|
||||
{
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case RESCUE_PROCEDURES:
|
||||
case RECEIVE_SOS_MAIL:
|
||||
case LEAVE_FOR_RESCUE:
|
||||
case SEND_AOK_MAIL:
|
||||
case GET_THANK_YOU_MAIL:
|
||||
gPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_GO_RESCUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReturntoGoRescueMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
UpdateHelperPelipperState(DISPLAY_GO_RESCUE_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
void HandlePostOfficeHelpGetHelpMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
if(sub_80144A4(&chosenAction) == 0)
|
||||
{
|
||||
switch(chosenAction)
|
||||
{
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case GETTING_HELP:
|
||||
case SEND_SOS_MAIL:
|
||||
case RECEIVE_AOK_MAIL:
|
||||
case SEND_THANK_YOU_MAIL:
|
||||
gPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_GET_HELP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReturnToGetHelpMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
if(sub_80144A4(&temp) == 0)
|
||||
{
|
||||
UpdateHelperPelipperState(DISPLAY_GET_HELP_MENU);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_80319A4(u8 param_1,u8 dungeon,int param_3)
|
||||
{
|
||||
|
||||
gUnknown_203B330 = MemoryAlloc(sizeof(struct unkStruct_203B330),8);
|
||||
gUnknown_203B330->unkC = param_1;
|
||||
gUnknown_203B330->dungeonIndex = dungeon;
|
||||
sub_801317C(&gUnknown_203B330->input);
|
||||
gUnknown_203B330->unk10 = param_3;
|
||||
gUnknown_203B330->unk14 = &gUnknown_203B330->unk18[param_3];
|
||||
sub_8031A2C();
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 sub_80319F8(void)
|
||||
{
|
||||
switch(sub_8012A64(&gUnknown_203B330->input, gUnknown_203B330->unk10))
|
||||
{
|
||||
case 2:
|
||||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case 1:
|
||||
PlayMenuSoundEffect(0);
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8031A2C(void)
|
||||
{
|
||||
sub_8031A84();
|
||||
DisplayMissionObjectives();
|
||||
}
|
||||
|
||||
void sub_8031A3C(void)
|
||||
{
|
||||
if(gUnknown_203B330 != NULL)
|
||||
{
|
||||
gUnknown_203B330->unk18[gUnknown_203B330->unk10] = gUnknown_80E1EFC;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B330->unk18, TRUE, TRUE);
|
||||
MemoryFree(gUnknown_203B330);
|
||||
gUnknown_203B330 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8031A84(void)
|
||||
{
|
||||
s32 jobs;
|
||||
|
||||
sub_8006518(gUnknown_203B330->unk18);
|
||||
gUnknown_203B330->unk18[gUnknown_203B330->unk10] = gUnknown_80E1F18;
|
||||
if (gUnknown_203B330->unkC == 2) {
|
||||
jobs = CountJobsinDungeon(gUnknown_203B330->dungeonIndex);
|
||||
if (jobs == 0) {
|
||||
jobs = 1;
|
||||
}
|
||||
sub_8012D08(gUnknown_203B330->unk14,jobs);
|
||||
}
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(gUnknown_203B330->unk18, TRUE, TRUE);
|
||||
}
|
||||
|
||||
void DisplayMissionObjectives(void)
|
||||
{
|
||||
s32 yCoord;
|
||||
s32 jobSlotIdx;
|
||||
unkStruct_203B480 *mail;
|
||||
WonderMail *jobInfo;
|
||||
u8 buffer [100];
|
||||
volatile u8 local_94;
|
||||
u8 buffer1 [100];
|
||||
s16 auStack44;
|
||||
s16 missionIndex;
|
||||
u8 local_test;
|
||||
|
||||
sub_80073B8(gUnknown_203B330->unk10);
|
||||
// Objectives
|
||||
xxx_call_draw_string(10,0,gUnknown_80E1F30,gUnknown_203B330->unk10,0);
|
||||
switch(gUnknown_203B330->unkC)
|
||||
{
|
||||
case 1:
|
||||
sub_8099394(&local_94);
|
||||
mail = GetMailatIndex(local_94);
|
||||
sub_803B6B0(10,16,3,gUnknown_203B330->unk10);
|
||||
// %dF
|
||||
sprintfStatic(buffer,gUnknown_80E1F3C,mail->unk4.dungeon.floor);
|
||||
xxx_call_draw_string(0x15,16,buffer,gUnknown_203B330->unk10,0);
|
||||
// Rescue #C6%s#R
|
||||
sprintfStatic(buffer,gUnknown_80E1F40,GetMonSpecies(mail->clientSpecies));
|
||||
xxx_call_draw_string(0x28,16,buffer,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
case 2:
|
||||
if (CountJobsinDungeon(gUnknown_203B330->dungeonIndex) == 0) {
|
||||
// Just go!
|
||||
xxx_call_draw_string(10,16,gUnknown_80E1F54,gUnknown_203B330->unk10,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
yCoord = 16;
|
||||
|
||||
// 8 Job Slots... check each of them
|
||||
for(jobSlotIdx = 0; jobSlotIdx < MAX_ACCEPTED_JOBS; jobSlotIdx++)
|
||||
{
|
||||
jobInfo = GetJobSlotInfo(jobSlotIdx);
|
||||
if ((((jobInfo->unk4.dungeon.id == gUnknown_203B330->dungeonIndex) && (jobInfo->mailType != 0)
|
||||
) && (jobInfo->mailType != MAIL_TYPE_SUSPENDED_JOB)) && (jobInfo->mailType != MAIL_TYPE_UNK7)) {
|
||||
sub_803B6B0(10,yCoord,3,gUnknown_203B330->unk10);
|
||||
if (jobInfo->missionType != WONDER_MAIL_MISSION_TYPE_FIND_ITEM) {
|
||||
sprintfStatic(buffer1,gUnknown_80E1F3C,jobInfo->unk4.dungeon.floor);
|
||||
xxx_call_draw_string(21,yCoord,buffer1,gUnknown_203B330->unk10,0);
|
||||
}
|
||||
switch(jobInfo->missionType)
|
||||
{
|
||||
case WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM:
|
||||
// Bring #C4%s#R
|
||||
sub_8090DC4(gUnknown_202DE58,jobInfo->targetItem,0);
|
||||
sprintfStatic(buffer1,gUnknown_80E1F60,gUnknown_202DE58);
|
||||
xxx_call_draw_string(40,yCoord,buffer1,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
case WONDER_MAIL_MISSION_TYPE_FIND_ITEM:
|
||||
// Find #C4%s#R
|
||||
sub_8090DC4(gUnknown_202DE58,jobInfo->targetItem,0);
|
||||
sprintfStatic(buffer1,gUnknown_80E1F70,gUnknown_202DE58);
|
||||
xxx_call_draw_string(40,yCoord,buffer1,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
case WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT:
|
||||
// Escort to #C6$s#R
|
||||
sprintfStatic(buffer1,gUnknown_80E1F80,GetMonSpecies(jobInfo->targetSpecies));
|
||||
xxx_call_draw_string(40,yCoord,buffer1,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
default:
|
||||
// Rescue #C6%s#R
|
||||
sprintfStatic(buffer1,gUnknown_80E1F40,GetMonSpecies(jobInfo->targetSpecies));
|
||||
xxx_call_draw_string(40,yCoord,buffer1,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
}
|
||||
yCoord = yCoord + 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 0:
|
||||
default:
|
||||
if (sub_80992E0(&auStack44,&missionIndex) != 0)
|
||||
xxx_call_draw_string(10,16,GetCurrentMissionText(missionIndex),gUnknown_203B330->unk10,0);
|
||||
else if (sub_8099360(&local_test) != 0)
|
||||
xxx_call_draw_string(10,16,sub_80975DC(sub_80A2688(local_test)),gUnknown_203B330->unk10,0);
|
||||
else
|
||||
xxx_call_draw_string(10,16,gUnknown_80E1F94,gUnknown_203B330->unk10,0);
|
||||
break;
|
||||
}
|
||||
sub_80073E0(gUnknown_203B330->unk10);
|
||||
}
|
||||
346
src/post_office_guide1.c
Normal file
346
src/post_office_guide1.c
Normal file
|
|
@ -0,0 +1,346 @@
|
|||
#include "global.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "memory.h"
|
||||
#include "menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "post_office_guide1.h"
|
||||
#include "text1.h"
|
||||
|
||||
enum PostOfficeStates
|
||||
{
|
||||
EXIT_POST_OFFICE_MENU,
|
||||
IM_GUIDE_START_MENU,
|
||||
ANYTHING_ELSE_START_MENU,
|
||||
RETURN_TO_START_MENU,
|
||||
DISPLAY_FRIEND_RESCUE_MENU,
|
||||
RETURN_TO_FRIEND_RESCUE,
|
||||
DISPLAY_GO_RESCUE_MENU,
|
||||
RETURN_TO_GO_RESCUE,
|
||||
DISPLAY_GET_HELP_MENU,
|
||||
RETURN_TO_GET_HELP,
|
||||
};
|
||||
|
||||
extern u8 gAvailablePokemonNames[]; // 202DF98
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
|
||||
static EWRAM_DATA_2 PostOfficeWork *sPostOfficeHelper = {0};
|
||||
|
||||
#include "data/post_office_guide1.h"
|
||||
|
||||
static void HandlePostOfficeHelpFriendRescueMenuSelection(void);
|
||||
static void HandlePostOfficeHelpGetHelpMenuSelection(void);
|
||||
static void HandlePostOfficeHelpGoRescueMenuSelection(void);
|
||||
static void HandlePostOfficeHelpStartMenuSelection(void);
|
||||
static void ReturnToFriendRescueMenu(void);
|
||||
static void ReturnToGetHelpMenu(void);
|
||||
static void ReturntoGoRescueMenu(void);
|
||||
static void ReturnToPostOfficeStartMenu(void);
|
||||
static void UpdateHelperPelipperState(u8);
|
||||
|
||||
bool8 CreateHelperPelipperMenu(s16 speciesID)
|
||||
{
|
||||
u8 *monName;
|
||||
OpenedFile *faceFile;
|
||||
s32 species_32;
|
||||
|
||||
species_32 = speciesID;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(NULL, TRUE, TRUE);
|
||||
|
||||
sPostOfficeHelper = MemoryAlloc(sizeof(PostOfficeWork), 8);
|
||||
CopyYellowMonsterNametoBuffer(gUnknown_202E5D8, speciesID);
|
||||
monName = GetMonSpecies(speciesID);
|
||||
strcpy(gAvailablePokemonNames, monName);
|
||||
sPostOfficeHelper->faceFile = NULL;
|
||||
sPostOfficeHelper->faceData = NULL;
|
||||
|
||||
if (speciesID != MONSTER_NONE) {
|
||||
faceFile = GetDialogueSpriteDataPtr(species_32);
|
||||
sPostOfficeHelper->faceFile = faceFile;
|
||||
sPostOfficeHelper->unk14 = 0;
|
||||
sPostOfficeHelper->unk15 = 0;
|
||||
sPostOfficeHelper->unk16 = 0;
|
||||
sPostOfficeHelper->unk10 = 2;
|
||||
sPostOfficeHelper->unk12 = 8;
|
||||
|
||||
if (sPostOfficeHelper->faceFile != NULL)
|
||||
sPostOfficeHelper->faceData = sPostOfficeHelper->faceFile->data;
|
||||
}
|
||||
|
||||
sPostOfficeHelper->currMenuChoice = 0;
|
||||
UpdateHelperPelipperState(IM_GUIDE_START_MENU);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 HelperPelipperCallback(void)
|
||||
{
|
||||
switch (sPostOfficeHelper->state) {
|
||||
case IM_GUIDE_START_MENU:
|
||||
case ANYTHING_ELSE_START_MENU:
|
||||
HandlePostOfficeHelpStartMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_START_MENU:
|
||||
ReturnToPostOfficeStartMenu();
|
||||
break;
|
||||
case DISPLAY_FRIEND_RESCUE_MENU:
|
||||
HandlePostOfficeHelpFriendRescueMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_FRIEND_RESCUE:
|
||||
ReturnToFriendRescueMenu();
|
||||
break;
|
||||
case DISPLAY_GO_RESCUE_MENU:
|
||||
HandlePostOfficeHelpGoRescueMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_GO_RESCUE:
|
||||
ReturntoGoRescueMenu();
|
||||
break;
|
||||
case EXIT_POST_OFFICE_MENU:
|
||||
return 3;
|
||||
case DISPLAY_GET_HELP_MENU:
|
||||
HandlePostOfficeHelpGetHelpMenuSelection();
|
||||
break;
|
||||
case RETURN_TO_GET_HELP:
|
||||
ReturnToGetHelpMenu();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CleanHelperPelipper(void)
|
||||
{
|
||||
if (sPostOfficeHelper != NULL) {
|
||||
if (sPostOfficeHelper->faceFile != NULL)
|
||||
CloseFile(sPostOfficeHelper->faceFile);
|
||||
MemoryFree(sPostOfficeHelper);
|
||||
sPostOfficeHelper = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void nullsub_39(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void UpdateHelperPelipperText(void)
|
||||
{
|
||||
OpenedFile **faceFile;
|
||||
faceFile = NULL;
|
||||
|
||||
if (sPostOfficeHelper->faceFile != NULL)
|
||||
faceFile = &sPostOfficeHelper->faceFile;
|
||||
|
||||
switch (sPostOfficeHelper->state) {
|
||||
case DISPLAY_GET_HELP_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpGetHelpMenu, 0, 4, 0, faceFile, 12);
|
||||
break;
|
||||
case RETURN_TO_GET_HELP:
|
||||
switch (sPostOfficeHelper->currMenuChoice) {
|
||||
case GETTING_HELP:
|
||||
sub_80141B4(gGettingHelpExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_SOS_MAIL:
|
||||
sub_80141B4(gSendSOSMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case RECEIVE_AOK_MAIL:
|
||||
sub_80141B4(gReceiveAOKMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_THANK_YOU_MAIL:
|
||||
sub_80141B4(gSendThankYouMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DISPLAY_GO_RESCUE_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpGoRescueMenu, 0, 4, 0, faceFile, 12);
|
||||
break;
|
||||
case RETURN_TO_GO_RESCUE:
|
||||
switch (sPostOfficeHelper->currMenuChoice) {
|
||||
case RESCUE_PROCEDURES:
|
||||
sub_80141B4(gRescueProceduresExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case RECEIVE_SOS_MAIL:
|
||||
sub_80141B4(gReceiveSOSMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case SEND_AOK_MAIL:
|
||||
sub_80141B4(gSendAOKMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case LEAVE_FOR_RESCUE:
|
||||
sub_80141B4(gLeaveForRescueExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case GET_THANK_YOU_MAIL:
|
||||
sub_80141B4(gGetThankYouMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case IM_GUIDE_START_MENU:
|
||||
sub_8014248(gImYourGuide, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 12);
|
||||
break;
|
||||
case ANYTHING_ELSE_START_MENU:
|
||||
sub_8014248(gAnythingElse, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpStartMenu, 0, 4, 0, faceFile, 12);
|
||||
break;
|
||||
case RETURN_TO_START_MENU:
|
||||
switch (sPostOfficeHelper->currMenuChoice) {
|
||||
case POST_OFFICE:
|
||||
sub_80141B4(gPostOfficeExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case BULLETIN_BOARD:
|
||||
sub_80141B4(gBulletinBoardExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case DELIVERY:
|
||||
sub_80141B4(gDeliveryExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DISPLAY_FRIEND_RESCUE_MENU:
|
||||
sub_8014248(gWhatdYouWantToKnow, 0, sPostOfficeHelper->currMenuChoice, gPostOfficeHelpFriendRescueMenu, 0, 4, 0, faceFile, 12);
|
||||
break;
|
||||
case RETURN_TO_FRIEND_RESCUE:
|
||||
switch (sPostOfficeHelper->currMenuChoice) {
|
||||
case FRIEND_RESCUE_INFO:
|
||||
sub_80141B4(gFriendRescueExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
case DELETING_MAIL:
|
||||
sub_80141B4(gDeletingMailExplanation, 0, faceFile, 0x10d);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateHelperPelipperState(u8 newState)
|
||||
{
|
||||
sPostOfficeHelper->state = newState;
|
||||
nullsub_39();
|
||||
UpdateHelperPelipperText();
|
||||
}
|
||||
|
||||
static void HandlePostOfficeHelpStartMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
|
||||
if (sub_80144A4(&chosenAction) == 0) {
|
||||
switch (chosenAction) {
|
||||
case CANCEL:
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(EXIT_POST_OFFICE_MENU);
|
||||
break;
|
||||
case FRIEND_RESCUE:
|
||||
sPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case POST_OFFICE:
|
||||
case BULLETIN_BOARD:
|
||||
case DELIVERY:
|
||||
sPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_START_MENU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ReturnToPostOfficeStartMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
UpdateHelperPelipperState(ANYTHING_ELSE_START_MENU);
|
||||
}
|
||||
|
||||
static void HandlePostOfficeHelpFriendRescueMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
|
||||
if (sub_80144A4(&chosenAction) == 0) {
|
||||
switch (chosenAction) {
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(ANYTHING_ELSE_START_MENU);
|
||||
break;
|
||||
case GO_RESCUE:
|
||||
UpdateHelperPelipperState(DISPLAY_GO_RESCUE_MENU);
|
||||
break;
|
||||
case GET_HELP_MENU:
|
||||
UpdateHelperPelipperState(DISPLAY_GET_HELP_MENU);
|
||||
break;
|
||||
case FRIEND_RESCUE_INFO:
|
||||
case DELETING_MAIL:
|
||||
sPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_FRIEND_RESCUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ReturnToFriendRescueMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
}
|
||||
|
||||
static void HandlePostOfficeHelpGoRescueMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
|
||||
if (sub_80144A4(&chosenAction) != 0)
|
||||
return;
|
||||
|
||||
switch (chosenAction) {
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case RESCUE_PROCEDURES:
|
||||
case RECEIVE_SOS_MAIL:
|
||||
case LEAVE_FOR_RESCUE:
|
||||
case SEND_AOK_MAIL:
|
||||
case GET_THANK_YOU_MAIL:
|
||||
sPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_GO_RESCUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void ReturntoGoRescueMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
UpdateHelperPelipperState(DISPLAY_GO_RESCUE_MENU);
|
||||
}
|
||||
|
||||
static void HandlePostOfficeHelpGetHelpMenuSelection(void)
|
||||
{
|
||||
s32 chosenAction;
|
||||
|
||||
if (sub_80144A4(&chosenAction) != 0)
|
||||
return;
|
||||
|
||||
switch (chosenAction) {
|
||||
case EXIT:
|
||||
UpdateHelperPelipperState(DISPLAY_FRIEND_RESCUE_MENU);
|
||||
break;
|
||||
case GETTING_HELP:
|
||||
case SEND_SOS_MAIL:
|
||||
case RECEIVE_AOK_MAIL:
|
||||
case SEND_THANK_YOU_MAIL:
|
||||
sPostOfficeHelper->currMenuChoice = chosenAction;
|
||||
UpdateHelperPelipperState(RETURN_TO_GET_HELP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void ReturnToGetHelpMenu(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
if (sub_80144A4(&temp) == 0)
|
||||
UpdateHelperPelipperState(DISPLAY_GET_HELP_MENU);
|
||||
}
|
||||
186
src/post_office_guide2.c
Normal file
186
src/post_office_guide2.c
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
#include "global.h"
|
||||
#include "code_800D090.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_803B050.h"
|
||||
#include "code_8094F88.h"
|
||||
#include "code_80958E8_1.h"
|
||||
#include "code_80972F4.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "constants/mailbox.h"
|
||||
#include "constants/wonder_mail.h"
|
||||
#include "items.h"
|
||||
#include "memory.h"
|
||||
#include "menu_input.h"
|
||||
#include "post_office_guide2.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
#include "wonder_mail.h"
|
||||
|
||||
extern u8 gUnknown_202DE58[];
|
||||
|
||||
static EWRAM_DATA_2 unkStruct_203B330 *sUnknown_203B330 = {0};
|
||||
|
||||
#include "data/post_office_guide2.h"
|
||||
|
||||
// code_8098BDC.s
|
||||
extern u8 sub_80992E0(s16 *, s16 *);
|
||||
extern u8 sub_8099360(u8 *);
|
||||
extern u8 sub_8099394(volatile u8 *);
|
||||
|
||||
static void DisplayMissionObjectives(void);
|
||||
|
||||
static void sub_8031A2C(void);
|
||||
static void sub_8031A84(void);
|
||||
|
||||
bool8 sub_80319A4(u8 param_1, u8 dungeon, s32 param_3)
|
||||
{
|
||||
sUnknown_203B330 = MemoryAlloc(sizeof(unkStruct_203B330), 8);
|
||||
sUnknown_203B330->unkC = param_1;
|
||||
sUnknown_203B330->dungeonIndex = dungeon;
|
||||
sub_801317C(&sUnknown_203B330->input);
|
||||
sUnknown_203B330->unk10 = param_3;
|
||||
sUnknown_203B330->unk14 = &sUnknown_203B330->unk18[param_3];
|
||||
sub_8031A2C();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_80319F8(void)
|
||||
{
|
||||
switch (sub_8012A64(&sUnknown_203B330->input, sUnknown_203B330->unk10)) {
|
||||
case 2:
|
||||
PlayMenuSoundEffect(1);
|
||||
return 2;
|
||||
case 1:
|
||||
PlayMenuSoundEffect(0);
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8031A2C(void)
|
||||
{
|
||||
sub_8031A84();
|
||||
DisplayMissionObjectives();
|
||||
}
|
||||
|
||||
void sub_8031A3C(void)
|
||||
{
|
||||
if (sUnknown_203B330 != NULL) {
|
||||
sUnknown_203B330->unk18[sUnknown_203B330->unk10] = sUnknown_80E1EFC;
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(sUnknown_203B330->unk18, TRUE, TRUE);
|
||||
MemoryFree(sUnknown_203B330);
|
||||
sUnknown_203B330 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8031A84(void)
|
||||
{
|
||||
s32 jobs;
|
||||
|
||||
sub_8006518(sUnknown_203B330->unk18);
|
||||
sUnknown_203B330->unk18[sUnknown_203B330->unk10] = sUnknown_80E1F18;
|
||||
|
||||
if (sUnknown_203B330->unkC == 2) {
|
||||
jobs = CountJobsinDungeon(sUnknown_203B330->dungeonIndex);
|
||||
if (jobs == 0)
|
||||
jobs = 1;
|
||||
|
||||
sub_8012D08(sUnknown_203B330->unk14, jobs);
|
||||
}
|
||||
|
||||
ResetUnusedInputStruct();
|
||||
sub_800641C(sUnknown_203B330->unk18, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static void DisplayMissionObjectives(void)
|
||||
{
|
||||
s32 yCoord;
|
||||
s32 jobSlotIdx;
|
||||
unkStruct_203B480 *mail;
|
||||
WonderMail *jobInfo;
|
||||
u8 buffer[100];
|
||||
volatile u8 local_94;
|
||||
u8 buffer1[100];
|
||||
s16 auStack44;
|
||||
s16 missionIndex;
|
||||
u8 local_test;
|
||||
|
||||
sub_80073B8(sUnknown_203B330->unk10);
|
||||
// Objectives
|
||||
xxx_call_draw_string(10, 0, sObjectives, sUnknown_203B330->unk10, 0);
|
||||
|
||||
switch (sUnknown_203B330->unkC) {
|
||||
case 1:
|
||||
sub_8099394(&local_94);
|
||||
mail = GetMailatIndex(local_94);
|
||||
sub_803B6B0(10, 16, 3, sUnknown_203B330->unk10);
|
||||
// %dF
|
||||
sprintfStatic(buffer,sFmt1,mail->unk4.dungeon.floor);
|
||||
xxx_call_draw_string(21,16,buffer,sUnknown_203B330->unk10,0);
|
||||
// Rescue #C6%s#R
|
||||
sprintfStatic(buffer,sFmtRescue,GetMonSpecies(mail->clientSpecies));
|
||||
xxx_call_draw_string(40, 16, buffer, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
case 2:
|
||||
if (CountJobsinDungeon(sUnknown_203B330->dungeonIndex) == 0)
|
||||
xxx_call_draw_string(10, 16, sJustGo, sUnknown_203B330->unk10, 0);
|
||||
else {
|
||||
yCoord = 16;
|
||||
|
||||
// 8 Job Slots... check each of them
|
||||
for (jobSlotIdx = 0; jobSlotIdx < MAX_ACCEPTED_JOBS; jobSlotIdx++) {
|
||||
jobInfo = GetJobSlotInfo(jobSlotIdx);
|
||||
|
||||
if (jobInfo->unk4.dungeon.id == sUnknown_203B330->dungeonIndex
|
||||
&& jobInfo->mailType != 0
|
||||
&& jobInfo->mailType != MAIL_TYPE_SUSPENDED_JOB
|
||||
&& jobInfo->mailType != MAIL_TYPE_UNK7) {
|
||||
sub_803B6B0(10, yCoord, 3, sUnknown_203B330->unk10);
|
||||
|
||||
if (jobInfo->missionType != WONDER_MAIL_MISSION_TYPE_FIND_ITEM) {
|
||||
sprintfStatic(buffer1, sFmt1, jobInfo->unk4.dungeon.floor);
|
||||
xxx_call_draw_string(21, yCoord, buffer1, sUnknown_203B330->unk10, 0);
|
||||
}
|
||||
|
||||
switch (jobInfo->missionType) {
|
||||
case WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM:
|
||||
BufferItemName(gUnknown_202DE58, jobInfo->targetItem, NULL);
|
||||
sprintfStatic(buffer1, sFmtBring, gUnknown_202DE58);
|
||||
xxx_call_draw_string(40, yCoord, buffer1, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
case WONDER_MAIL_MISSION_TYPE_FIND_ITEM:
|
||||
BufferItemName(gUnknown_202DE58, jobInfo->targetItem, NULL);
|
||||
sprintfStatic(buffer1, sFmtFind, gUnknown_202DE58);
|
||||
xxx_call_draw_string(40, yCoord, buffer1, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
case WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT:
|
||||
sprintfStatic(buffer1, sFmtEscort, GetMonSpecies(jobInfo->targetSpecies));
|
||||
xxx_call_draw_string(40, yCoord, buffer1, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
default:
|
||||
sprintfStatic(buffer1, sFmtRescue, GetMonSpecies(jobInfo->targetSpecies));
|
||||
xxx_call_draw_string(40, yCoord, buffer1, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
yCoord += 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 0:
|
||||
default:
|
||||
if (sub_80992E0(&auStack44, &missionIndex) != 0)
|
||||
xxx_call_draw_string(10, 16, GetCurrentMissionText(missionIndex), sUnknown_203B330->unk10, 0);
|
||||
else if (sub_8099360(&local_test) != 0)
|
||||
xxx_call_draw_string(10, 16, sub_80975DC(sub_80A2688(local_test)), sUnknown_203B330->unk10, 0);
|
||||
else
|
||||
xxx_call_draw_string(10, 16, sRedQuestionMarks, sUnknown_203B330->unk10, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
sub_80073E0(sUnknown_203B330->unk10);
|
||||
}
|
||||
|
|
@ -622,7 +622,7 @@ void sub_8036B28(void)
|
|||
break;
|
||||
case TRADE_ITEMS_SEND_ITEM_CONFIRM:
|
||||
gUnknown_202DE30 = gTradeItemsMenu->quantityToSend;
|
||||
sub_8090DC4(gUnknown_202DE58,gTradeItemsMenu->itemToSend.id,0);
|
||||
BufferItemName(gUnknown_202DE58,gTradeItemsMenu->itemToSend.id,NULL);
|
||||
sub_8014248(gUnknown_80E61E4,0,5, gUnknown_80E6154,0,4,0,0,0x101);
|
||||
break;
|
||||
case TRADE_ITEMS_RECEIVE_ITEM:
|
||||
|
|
@ -681,17 +681,17 @@ void sub_8036B28(void)
|
|||
case 0xe:
|
||||
if (gTradeItemsMenu->unk24C.quantity == 0) {
|
||||
gUnknown_202DE30 = gTradeItemsMenu->unk244.quantity;
|
||||
sub_8090DC4(gUnknown_202DE58,gTradeItemsMenu->unk244.itemIdx.id,0);
|
||||
BufferItemName(gUnknown_202DE58,gTradeItemsMenu->unk244.itemIdx.id,NULL);
|
||||
}
|
||||
else {
|
||||
gUnknown_202DE30 = gTradeItemsMenu->unk24C.quantity;
|
||||
sub_8090DC4(gUnknown_202DE58,gTradeItemsMenu->unk24C.itemIdx.id,0);
|
||||
BufferItemName(gUnknown_202DE58,gTradeItemsMenu->unk24C.itemIdx.id,NULL);
|
||||
}
|
||||
sub_80141B4(gUnknown_80E6314,0,0,0x101);
|
||||
break;
|
||||
case 0xd:
|
||||
gUnknown_202DE30 = gTradeItemsMenu->quantityToSend;
|
||||
sub_8090DC4(gUnknown_202DE58,gTradeItemsMenu->itemToSend.id,0);
|
||||
BufferItemName(gUnknown_202DE58,gTradeItemsMenu->itemToSend.id,NULL);
|
||||
sub_80141B4(gUnknown_80E6358,0,0,0x101);
|
||||
break;
|
||||
case 0xB:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "memory.h"
|
||||
#include "text1.h"
|
||||
#include "text2.h"
|
||||
|
||||
#include "code_80A26CC.h"
|
||||
#include "rescue_password_menu.h"
|
||||
#include "menu_input.h"
|
||||
#include "code_8094F88.h"
|
||||
|
|
@ -25,7 +25,6 @@ extern void sub_809927C(u8);
|
|||
extern bool8 HasNoWonderMailType(u32);
|
||||
extern u32 sub_8031050();
|
||||
extern void sub_80310B4();
|
||||
extern bool8 sub_80A2824(u8);
|
||||
|
||||
extern char gUnknown_202E5D8[0x50];
|
||||
extern char gAvailablePokemonNames[0x50];
|
||||
|
|
@ -53,7 +52,6 @@ extern u8 sub_8024108(u32);
|
|||
extern u32 sub_8031DCC();
|
||||
extern void sub_8031E10();
|
||||
extern void sub_8031E00();
|
||||
extern s32 sub_8001658(u32, u32);
|
||||
extern void sub_8099690(u32);
|
||||
extern void sub_8031E10(void);
|
||||
extern void sub_803084C(void);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include "menu_input.h"
|
||||
#include "wonder_mail_2_1.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80958E8_1.h"
|
||||
|
||||
extern struct unkStruct_203B2F0 *gUnknown_203B2F0;
|
||||
extern struct unkStruct_203B2E8* gUnknown_203B2E8;
|
||||
|
|
@ -98,7 +99,6 @@ static const u8 wonder_mail_fill1[] = "pksdir0";
|
|||
|
||||
extern void sub_802CAA4(void);
|
||||
extern u8 IsJobSlotEmpty(u8);
|
||||
extern WonderMail* GetJobSlotInfo(u8);
|
||||
extern void sub_803B35C(WonderMail *, unkStruct_802C39C *);
|
||||
extern void CreateRescueTitle(unkStruct_802C39C *);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "code_802C39C.h"
|
||||
#include "menu_input.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_803B050.h"
|
||||
|
||||
bool8 IsMailSlotEmpty(u8);
|
||||
extern s32 CountPelipperBoardSlots(void);
|
||||
|
|
@ -59,7 +60,6 @@ extern PokemonStruct1 *GetPlayerPokemonStruct(void);
|
|||
extern u8 gMailboxText[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
extern void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
|
||||
extern void sub_803B6B0(u32, u32, u32, u32);
|
||||
|
||||
void CreateMailMenu(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
#include "wonder_mail_2_1.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80A26CC.h"
|
||||
#include "code_80958E8_1.h"
|
||||
|
||||
const UnkTextStruct2 gUnknown_80DFDD4 =
|
||||
{
|
||||
|
|
@ -134,7 +136,6 @@ extern u8 sub_802DADC(void);
|
|||
extern u8 *sub_8096DD8(void);
|
||||
extern u8 sub_8096C08(u8 *);
|
||||
extern void DrawJobListMenu(void);
|
||||
extern WonderMail* GetJobSlotInfo(u8);
|
||||
extern void sub_803B35C(WonderMail *, unkStruct_802C39C*);
|
||||
extern void sub_802DE84(unkStruct_802C39C *);
|
||||
extern void sub_802D73C(void);
|
||||
|
|
@ -174,7 +175,6 @@ extern u8 gUnknown_80DFD70[];
|
|||
extern u8 gUnknown_80DFD7C[];
|
||||
|
||||
extern bool8 sub_809693C(WonderMail *);
|
||||
extern bool8 sub_80A2824(u8);
|
||||
|
||||
void sub_802CAA4(void) {
|
||||
s32 loopMax;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
#include "global.h"
|
||||
#include "code_80A26CC.h"
|
||||
|
||||
u8 sub_80A27CC(s16);
|
||||
|
||||
u8 sub_802FCF0(void)
|
||||
bool8 sub_802FCF0(void)
|
||||
{
|
||||
s32 iVar3;
|
||||
|
||||
for(iVar3 = 0; iVar3 < 0x2E; iVar3++){
|
||||
if (sub_80A27CC(iVar3) != '\0') {
|
||||
return 0;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 0x2E; i++) {
|
||||
if (sub_80A27CC(i))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ enum FriendRewardStates {
|
|||
REWARD_EXIT = 9,
|
||||
};
|
||||
|
||||
extern u8 sub_802FCF0(u32);
|
||||
extern bool8 sub_802FCF0(u32);
|
||||
extern void sub_802F9C0(void);
|
||||
extern void sub_802FA50(void);
|
||||
extern s32 sub_802FBF4(void);
|
||||
|
|
@ -119,6 +119,15 @@ extern u32 sub_801B60C(u32, u8, u8);
|
|||
void HandleMissionReward(void);
|
||||
const u8 *sub_80974A0(s16 index);
|
||||
|
||||
extern u8 gUnknown_202E038[];
|
||||
extern u8 gUnknown_202E088[];
|
||||
extern u8 gUnknown_202E628[];
|
||||
extern u8 gUnknown_202DEA8[];
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
extern u32 gUnknown_202DE30;
|
||||
extern const u8 *gUnknown_80D4970[];
|
||||
|
||||
const UnkTextStruct2 gUnknown_80E03C4 = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x03,
|
||||
|
|
@ -233,17 +242,10 @@ const UnkTextStruct2 gUnknown_80E072C = {
|
|||
NULL
|
||||
};
|
||||
|
||||
extern u8 gUnknown_202E038[];
|
||||
extern u8 gUnknown_202E088[];
|
||||
extern u8 gUnknown_202E628[];
|
||||
extern u8 gUnknown_202DEA8[];
|
||||
extern u8 gUnknown_202E5D8[];
|
||||
extern u8 gAvailablePokemonNames[];
|
||||
extern u32 gUnknown_202DE30;
|
||||
extern const u8 *gUnknown_80D4970[];
|
||||
extern u8 gUnknown_80E0744[];
|
||||
extern u8 gUnknown_80E0754[];
|
||||
extern u8 gUnknown_80E0750[];
|
||||
ALIGNED(4) const u8 gUnknown_80E0744[] = "Dungeons";
|
||||
ALIGNED(4) const u8 gUnknown_80E0750[] = {0x83, 0xC2};
|
||||
ALIGNED(4) const u8 gUnknown_80E0754[] = {0x83, 0xC0};
|
||||
ALIGNED(4) static const u8 sFill1[] = "pksdir0";
|
||||
|
||||
u32 sub_802EF48(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include "text2.h"
|
||||
#include "code_80130A8.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "code_80958E8_1.h"
|
||||
|
||||
struct unkStruct_203B2FC
|
||||
{
|
||||
|
|
@ -108,7 +109,6 @@ extern u32 sub_802F298(void);
|
|||
extern void sub_802F204(unkStruct_802F204*, u32);
|
||||
extern void sub_802DC40(void);
|
||||
extern void sub_802DC9C(void);
|
||||
WonderMail *GetJobSlotInfo(u8);
|
||||
extern void sub_8096AF8(u8 *, u32, u32);
|
||||
extern void sub_8096EEC(void);
|
||||
extern void sub_803C21C(WonderMail *, unkStruct_802F204*);
|
||||
|
|
@ -226,7 +226,7 @@ void sub_802DC9C(void)
|
|||
speciesText = GetMonSpecies(gUnknown_203B2FC->jobInfo->targetSpecies);
|
||||
strcpy(gUnknown_202E1C8 + 0xfffffe20,speciesText);
|
||||
UnlockExclusivePokemon(gUnknown_203B2FC->jobInfo->clientSpecies);
|
||||
sub_8090DC4(gUnknown_202DE58,gUnknown_203B2FC->jobInfo->targetItem,0);
|
||||
BufferItemName(gUnknown_202DE58,gUnknown_203B2FC->jobInfo->targetItem,NULL);
|
||||
gUnknown_203B2FC->fallbackState = 6;
|
||||
switch(gUnknown_203B2FC->jobInfo->missionType) {
|
||||
case WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM:
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ gUnknown_202DE28: /* 202DE28 */
|
|||
gUnknown_202DE30: /* 202DE30 */
|
||||
.space 0x28
|
||||
|
||||
/* Seems to be a general u8 buffer for text, mostly used with item names. Capacity of 80 chars..? */
|
||||
gUnknown_202DE58: /* 202DE58 */
|
||||
.space 0x50
|
||||
|
||||
|
|
|
|||
|
|
@ -344,7 +344,8 @@ gUnknown_203B324: /* 203B324 */
|
|||
gUnknown_203B328: /* 203B328 */
|
||||
.space 0x4
|
||||
|
||||
.include "src/post_office_guide.o"
|
||||
.include "src/post_office_guide1.o"
|
||||
.include "src/post_office_guide2.o"
|
||||
.include "src/code_8031D70.o"
|
||||
.include "src/adventure_log.o"
|
||||
.include "src/friend_rescue.o"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user