Skip to content

Commit

Permalink
Split+data pokemon_news
Browse files Browse the repository at this point in the history
  • Loading branch information
Kermalis committed Sep 23, 2023
1 parent 3a40d3f commit 9e3106a
Show file tree
Hide file tree
Showing 37 changed files with 1,126 additions and 1,137 deletions.
1 change: 1 addition & 0 deletions include/code_80130A8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "structs/str_text.h"

// code_80130A8.s
extern void sub_8013E54(void);
extern void sub_8013F84(void);
extern void sub_80140B4(UnkTextStruct2 *);
extern void sub_80140DC(void);
Expand Down
4 changes: 4 additions & 0 deletions include/code_803B050.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ typedef struct unkStruct_80E9F8C
} unkStruct_80E9F8C;

void CreateRescueDescription(unkStruct_802C39C *);
void CreateRescueTitle(unkStruct_802C39C *);

void sub_803B6B0(s32 x, s32 y, u8 index, u32);

// code_803B050.s
extern void sub_803B35C(WonderMail *, unkStruct_802C39C *);

#endif // GUARD_CODE_803B050_H
5 changes: 5 additions & 0 deletions include/code_80958E8_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ struct unkStruct_8096AF8

s32 CountJobsinDungeon(u8 dungeon);
WonderMail *GetJobSlotInfo(u8 index);
bool8 IsMailinJobSlot(WonderMail *mail);

void sub_8096AF8(struct unkStruct_8096AF8 *, u8 slotIndex, u8 dungeon);

// code_80958E8_1.s
extern WonderMail *GetPelipperBoardSlotInfo(u8);
extern bool8 IsPelipperBoardSlotEmpty(u8);

#endif // GUARD_CODE_80958E8_1_H
1 change: 1 addition & 0 deletions include/code_8096AF8.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define GUARD_CODE_8096AF8_H

// code_8096AF8.s
extern u8 CheckPKMNNewsSlot(u8);
extern bool8 sub_8096E2C(void);
extern void sub_8096EEC(void);

Expand Down
10 changes: 10 additions & 0 deletions include/mailbox_8095F8C.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef GUARD_MAILBOX_8095F8C_H
#define GUARD_MAILBOX_8095F8C_H

#include "wonder_mail.h"

WonderMail *GetMailboxSlotInfo(u8 index);
bool8 IsMailSlotEmpty(u8 index);
void ResetMailboxSlot(u8 index);

#endif // GUARD_MAILBOX_8095F8C_H
1 change: 1 addition & 0 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon);
extern PokemonStruct1 *GetPlayerPokemonStruct(void);
extern void sub_808CFD0(u8 *, s16, u8 *, u8, u32 *, u16 *);
extern u32 sub_808D1DC(u8 *);
extern PokemonStruct1 *sub_808D3BC(void);
extern PokemonStruct1 *sub_808D3F8(void);
extern s32 sub_808D544(u32);
extern s32 sub_808D580(s32 *);
Expand Down
8 changes: 4 additions & 4 deletions include/pokemon_mail.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

struct PokemonMail
{
const char *headline;
const char *text;
const u8 *headline;
const u8 *text;
};

#define NUM_POKEMON_MAIL 56

const char *GetPokemonMailHeadline(u8 index);
const char *GetPokemonMailText(u8 index);
const u8 *GetPokemonMailHeadline(u8 index);
const u8 *GetPokemonMailText(u8 index);

#endif // POKEMON_MAIL_H
26 changes: 26 additions & 0 deletions include/pokemon_news1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef GUARD_POKEMON_NEWS1_H
#define GUARD_POKEMON_NEWS1_H

#include "constants/wonder_mail.h"
#include "input.h"
#include "structs/str_text.h"

// size: 0xD4;
struct unkStruct_203B2CC
{
/* 0x0 */ u8 receivedNewsletters[NUM_POKEMON_NEWS];
/* 0x38 */ MenuInputStruct input;
u32 unk6C;
UnkTextStruct2 *unk70;
UnkTextStruct2 unk74[4];
};

u8 GetPokemonNewsIndex(void);
bool8 HasNoPKMNNews(void);

bool8 sub_802B640(u32, UnkTextStruct2_sub *, u32);
u32 sub_802B720(bool8);
void sub_802B7D0(bool8 cursorSprite);
void sub_802B81C(void);

#endif // GUARD_POKEMON_NEWS1_H
26 changes: 26 additions & 0 deletions include/pokemon_news2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef GUARD_POKEMON_NEWS2_H
#define GUARD_POKEMON_NEWS2_H

#include "input.h"
#include "structs/str_text.h"

// size: 0x94
struct unkStruct_203B2D4
{
/* 0x0 */ s32 state;
/* 0x4 */ u8 currMailIndex;
s32 unk8;
s32 unkC;
const u8 *unk10[4];
u32 unk20;
u32 unk24;
UnkTextStruct2 unk28[4];
MenuInputStructSub unk88;
};

bool8 sub_802B9FC(u8 mailIndex);
u32 sub_802BA8C(void);
void sub_802BACC(void);
void sub_802BC7C(void);

#endif // GUARD_POKEMON_NEWS2_H
27 changes: 27 additions & 0 deletions include/pokemon_news3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef GUARD_POKEMON_NEWS3_H
#define GUARD_POKEMON_NEWS3_H

#include "input.h"
#include "structs/str_text.h"

// size: 0xA4
struct unkStruct_203B2D8
{
u8 unk0[4];
/* 0x4 */ MenuInputStruct input;
u32 unk38;
UnkTextStruct2 *unk3C;
UnkTextStruct2 unk40[4];
u8 unkA0[4];
};

void CreateMailMenu(void);
bool8 HasNoMailinMailbox(void);

bool8 sub_802BD14(s32, UnkTextStruct2_sub *, u32);
u32 sub_802BDEC(bool8);
u8 sub_802BE74(void);
void sub_802BE94(bool8 cursorSprite);
void sub_802BEDC(void);

#endif // GUARD_POKEMON_NEWS3_H
2 changes: 1 addition & 1 deletion include/structs/str_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef struct UnkTextStruct2
s16 unkE;
s16 unk10;
s16 unk12;
const u8 *unk14;
const u8 *unk14; // Pointer to 4 bytes which may be x-coord related
} UnkTextStruct2;

#endif // GUARD_STR_TEXT_H
28 changes: 28 additions & 0 deletions include/wonder_mail_802C10C.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef GUARD_WONDER_MAIL_802C10C_H
#define GUARD_WONDER_MAIL_802C10C_H

#include "constants/mailbox.h"
#include "input.h"
#include "structs/str_text.h"

// size: 0xA8
struct unkStruct_203B2E0
{
u8 pelipperBoardSlots[MAX_ACCEPTED_JOBS];
/* 0x8 */ MenuInputStruct input;
s32 unk3C;
UnkTextStruct2 *unk40;
UnkTextStruct2 unk44[4];
u8 unkA4[4];
};

void DrawPelipperBoardJobMenu(void);
bool8 HasNoPelipperBoardJobs(void);

bool8 sub_802C10C(s32, UnkTextStruct2_sub *, s32);
u32 sub_802C1E4(bool8);
u8 sub_802C26C(void);
void sub_802C28C(bool8 cursorSprite);
void sub_802C2D4(void);

#endif // GUARD_WONDER_MAIL_802C10C_H
11 changes: 8 additions & 3 deletions ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ SECTIONS {
src/wonder_mail.o(.text);
src/thank_you_wonder_mail.o(.text);
src/wonder_mail_2.o(.text);
src/pokemon_news.o(.text);
src/wonder_mail_2_mid.o(.text);
src/pokemon_news1.o(.text);
src/pokemon_news2.o(.text);
src/pokemon_news3.o(.text);
src/wonder_mail_802C10C.o(.text);
src/wonder_mail_2_1.o(.text);
src/wonder_mail_3.o(.text);
src/code_802DB28.o(.text);
Expand Down Expand Up @@ -453,7 +455,10 @@ SECTIONS {
src/wonder_mail.o(.rodata);
src/thank_you_wonder_mail.o(.rodata);
src/wonder_mail_2.o(.rodata);
src/pokemon_news.o(.rodata);
src/pokemon_news1.o(.rodata);
src/pokemon_news2.o(.rodata);
src/pokemon_news3.o(.rodata);
src/wonder_mail_802C10C.o(.rodata);
src/wonder_mail_2_1.o(.rodata);
src/wonder_mail_3.o(.rodata);
src/code_802DB28.o(.rodata);
Expand Down
2 changes: 1 addition & 1 deletion src/code_80958E8.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "pokemon.h"
#include "pokemon_3.h"
#include "code_8094F88.h"
#include "mailbox_8095F8C.h"

extern bool8 sub_809017C(DungeonLocation *);
extern u8 sub_803C1D0(DungeonLocation *, u8);
extern bool8 sub_803C0DC(s16);
extern void ResetMailboxSlot(u8);
extern void ResetPelipperBoardSlot(u8);
extern void ResetJobSlot(u8);
extern bool8 ValidateWonderMail(WonderMail *);
Expand Down
1 change: 0 additions & 1 deletion src/code_80958E8_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern void sub_8096C80(void);
extern void sub_8096D24(void);
extern void sub_80965F4();
extern void SortPelipperJobs();
extern WonderMail *GetPelipperBoardSlotInfo(u8);
u8 sub_8097318(s16 param_1);
extern bool8 GenerateMailJobInfo(WonderMail *);

Expand Down
22 changes: 22 additions & 0 deletions src/data/pokemon_news1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");

static const UnkTextStruct2 sUnknown_80DFBD0 = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};

static const u8 sUnknown_80DFBE8[] = {1, 0, 12, 0};
static const UnkTextStruct2 sUnknown_80DFBEC = {
0, 0, 0, 0,
6,
2, 2,
24, 14,
14, 0,
sUnknown_80DFBE8
};

ALIGNED(4) static const u8 sNewsList[] = _("News List");
23 changes: 23 additions & 0 deletions src/data/pokemon_news2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");

static const UnkTextStruct2 sUnknown_80DFC18 = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};

static const u8 sUnknown_80DFC30[] = {1, 0, 22, 0};
static const UnkTextStruct2 sUnknown_80DFC34 = {
0, 0, 0, 0,
6,
2, 2,
26, 16,
16, 0,
sUnknown_80DFC30
};

ALIGNED(4) static const u8 sShe[] = _("She");
ALIGNED(4) static const u8 sHe[] = _("He");
21 changes: 21 additions & 0 deletions src/data/pokemon_news3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");

static const UnkTextStruct2 sUnknown_80DFC5C = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};

static const UnkTextStruct2 sUnknown_80DFC74 = {
0, 0, 0, 0,
6,
2, 2,
24, 14,
14, 0,
NULL
};

ALIGNED(4) static const u8 sMailbox[] = _("Mailbox");
21 changes: 21 additions & 0 deletions src/data/wonder_mail_802C10C.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ALIGNED(4) static const u8 sFill[] = _("pksdir0");

static const UnkTextStruct2 sUnknown_80DFC9C = {
0, 0, 0, 0,
3,
0, 0,
0, 0,
0, 0,
NULL
};

static const UnkTextStruct2 sUnknown_80DFCB4 = {
0, 0, 0, 0,
6,
2, 2,
24, 14,
14, 0,
NULL
};

ALIGNED(4) static const u8 sBulletinBoard[] = _("Bulletin Board");
1 change: 0 additions & 1 deletion src/friend_area_action_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ extern void SetFriendAreaActionMenuState(u32);
extern void PlaySound(u32);

extern void sub_808D31C(PokemonStruct1 *);
extern PokemonStruct1 *sub_808D3BC(void);
extern u8 gUnknown_202DE58[];
extern bool8 sub_808D750(s16 index_);
extern void sub_808ED00(void);
Expand Down
Loading

0 comments on commit 9e3106a

Please sign in to comment.