Merge pull request #301 from camthesaxman/decompile_party_menu

fix up party_menu.c and decompile some more functions
This commit is contained in:
yenatch
2017-05-21 15:47:07 -04:00
committed by GitHub
10 changed files with 1425 additions and 3882 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -158,7 +158,7 @@ bool8 pokemon_has_move(struct Pokemon *, u16);
void sub_806FA18(u8 taskId);
// src/party_menu.o
void sub_806E834();
u8 sub_806E834(const u8 *message, u8 arg1);
// src/rom_8077ABC.o
u8 battle_side_get_owner(u8);

View File

@@ -0,0 +1,36 @@
#ifndef GUARD_BATTLE_INTERFACE_H
#define GUARD_BATTLE_INTERFACE_H
struct BattleInterfaceStruct1
{
s32 unk0;
s32 unk4;
s32 unk8;
u32 unkC_0:5;
u32 unk10;
};
struct BattleInterfaceStruct2
{
u16 unk0;
u32 unk4;
};
u8 battle_make_oam_normal_battle(u8);
u8 battle_make_oam_safari_battle(void);
void sub_8043D84(u8, u8, u32, u32, u32);
void sub_8043DB0(u8);
void sub_8043DFC(u8);
void nullsub_11();
void sub_8043EB4(u8);
void sub_8043F44(u8);
void sub_804454C(void);
u8 sub_8044804(u8, const struct BattleInterfaceStruct2 *, u8, u8);
void sub_8044CA0(u8);
void sub_8045A5C(u8, struct Pokemon *, u8);
s32 sub_8045C78(u8, u8, u8, u8);
s16 sub_80460C8(struct BattleInterfaceStruct1 *, int *, void *, int);
u8 GetScaledHPFraction(s16, s16, u8);
int GetHPBarLevel(s16, s16);
#endif // GUARD_BATTLE_INTERFACE_H

View File

@@ -49,7 +49,7 @@ void PrintMenuItemsReordered(u8, u8, u8, const struct MenuAction[], u8*);
void InitYesNoMenu(u8, u8, u8);
void DisplayYesNoMenu(u8, u8, u32);
s8 ProcessMenuInputNoWrap_(void);
u8 MenuPrint_PixelCoords(u8 *, u8, u16, u8);
u8 MenuPrint_PixelCoords(const u8 *, u8, u16, u8);
u8 sub_8072A18(u8 *, u8, u16, u8, u32);
u8 unref_sub_8072A5C(u8 *, u8 *, u8, u16, u8, u32);
int sub_8072AB0(u8 *, u8, u16, u8, u8, u32);

View File

@@ -120,7 +120,7 @@ enum
/*0x72*/ SE_TB_START,
/*0x73*/ SE_TB_KON,
/*0x74*/ SE_TB_KARA,
SE_BIDORO,
/*0x75*/ SE_BIDORO,
SE_W085,
SE_W085B,
SE_W231,
@@ -269,7 +269,7 @@ enum
BGM_GIM,
BGM_NAMINORI,
BGM_DAN01,
BGM_FANFA1,
/*0x16F*/ BGM_FANFA1,
BGM_ME_ASA,
BGM_ME_BACHI,
BGM_FANFA4,

View File

@@ -108,10 +108,6 @@ SECTIONS {
asm/reset_rtc_screen.o(.text);
asm/party_menu.o(.text);
src/party_menu.o(.text);
asm/party_menu.o(.text_806E884);
src/party_menu.o(.text_b);
asm/party_menu.o(.text_80701DC);
src/party_menu.o(.text_c);
asm/party_menu.o(.text_8070968);
src/start_menu.o(.text);
src/menu.o(.text);

View File

@@ -8,6 +8,7 @@
#include "songs.h"
#include "battle.h"
#include "palette.h"
#include "battle_interface.h"
struct UnknownStruct5
{
@@ -35,15 +36,6 @@ struct UnknownStruct7
u8 filler0[0x180];
};
struct UnknownStruct9
{
s32 unk0;
u32 unk4;
u32 unk8;
u32 unkC_0:5;
u32 unk10;
};
extern u8 ewram[];
#define ewram520 ((struct UnknownStruct7 *)(ewram + 0x00520))
#define ewram16088 (*(u8 *) (ewram + 0x16088))
@@ -109,9 +101,8 @@ extern void load_gfxc_health_bar();
static void sub_8043D5C(struct Sprite *);
static const void *sub_8043CDC(u8);
void sub_8044210(u8, s16, u8);
static void sub_8044210(u8, s16, u8);
static void draw_status_ailment_maybe(u8);
void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c);
extern void sub_8045180(struct Sprite *);
static void sub_8045110(struct Sprite *);
static void sub_8045048(struct Sprite *);
@@ -119,12 +110,11 @@ static void sub_8044F70(u8 taskId);
static void sub_8044E74(u8 taskId);
static void sub_8044ECC(u8 taskId);
static u8 sub_80457E8(u8, u8);
s32 sub_8045C78(u8, u8, u8, u8);
static int sub_8045F58(s32, s32, int, int *, u8, u16);
static u8 GetScaledExpFraction(int, int, int, u8);
static void sub_8045D58(u8, u8);
static u8 sub_804602C(int, int, int, int *, u8 *, u8);
static void sub_8046128(struct UnknownStruct9 *a, int *b, void *c);
static void sub_8046128(struct BattleInterfaceStruct1 *a, int *b, void *c);
static int do_nothing(s16 unused1, s16 unused2, int unused3)
{
@@ -937,7 +927,7 @@ _0804420C: .4byte 0x04000008\n\
}
#endif
void sub_8044210(u8 a, s16 b, u8 c)
static void sub_8044210(u8 a, s16 b, u8 c)
{
u8 str[0x14];
u8 *ptr;
@@ -1377,15 +1367,9 @@ void sub_804454C(void)
}
}
struct UnknownStruct8
{
u16 unk0;
u32 unk4;
};
// This function almost matches except for just two instructions around 0x08044B52 that are swapped.
#ifdef NONMATCHING
u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d)
u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d)
{
u8 r7;
s16 x;
@@ -1594,7 +1578,7 @@ u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d)
}
#else
__attribute__((naked))
u8 sub_8044804(u8 a, const struct UnknownStruct8 *b, u8 c, u8 d)
u8 sub_8044804(u8 a, const struct BattleInterfaceStruct2 *b, u8 c, u8 d)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
@@ -3005,7 +2989,7 @@ static u8 sub_804602C(int a, int b, int c, int *d, u8 *e, u8 f)
return r3;
}
s16 sub_80460C8(struct UnknownStruct9 *a, int *b, void *c, int d)
s16 sub_80460C8(struct BattleInterfaceStruct1 *a, int *b, void *c, int d)
{
u16 r7;
s16 r1;
@@ -3020,7 +3004,7 @@ s16 sub_80460C8(struct UnknownStruct9 *a, int *b, void *c, int d)
return r7;
}
static void sub_8046128(struct UnknownStruct9 *a, int *b, void *c)
static void sub_8046128(struct BattleInterfaceStruct1 *a, int *b, void *c)
{
u8 sp8[6];
u16 sp10[6];

View File

@@ -40,7 +40,6 @@ extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, con
extern void ShowPokemonSummaryScreen(struct Pokemon *, u8, u8, void (*)(u8), int);
extern void sub_806E7D0(u8, const struct PartyPopupMenu *);
extern u8 *sub_8040D08();
extern void sub_806E834();
extern u8 sub_8094C20();
extern void sub_8040B8C(void);
extern u8 pokemon_order_func(u8);

View File

@@ -598,7 +598,7 @@ s8 ProcessMenuInputNoWrap_(void)
return ProcessMenuInputNoWrap();
}
u8 MenuPrint_PixelCoords(u8 *text, u8 left, u16 top, u8 a4)
u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4)
{
return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4);
}

File diff suppressed because it is too large Load Diff