Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up Debug Menu #6070

Draft
wants to merge 6 commits into
base: upcoming
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/battle_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst);
extern struct BattleMsgData *gBattleMsgDataPtr;

extern const u8 *const gBattleStringsTable[];
extern const u8 *const gStatNamesTable[];
extern const u8 *const gStatNamesTable[NUM_BATTLE_STATS];
extern const u8 *const gPokeblockWasTooXStringTable[];
extern const u8 *const gRefereeStringsTable[];
extern const u8 *const gRoundsStringTable[];
Expand Down
2 changes: 2 additions & 0 deletions include/event_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ extern u16 gSpecialVar_MonBoxId;
extern u16 gSpecialVar_MonBoxPos;
extern u16 gSpecialVar_Unused_0x8014;

extern const u16 gBadgeFlags[NUM_BADGES];

#endif // GUARD_EVENT_DATA_H
11 changes: 8 additions & 3 deletions src/battle_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ static const u8 sText_Evasiveness[] = _("evasiveness");

const u8 *const gStatNamesTable[NUM_BATTLE_STATS] =
{
sText_HP, sText_Attack, sText_Defense,
sText_Speed, sText_SpAttack, sText_SpDefense,
sText_Accuracy, sText_Evasiveness
[STAT_HP] = sText_HP,
[STAT_ATK] = sText_Attack,
[STAT_DEF] = sText_Defense,
[STAT_SPEED] = sText_Speed,
[STAT_SPATK] = sText_SpAttack,
[STAT_SPDEF] = sText_SpDefense,
[STAT_ACC] = sText_Accuracy,
[STAT_EVASION] = sText_Evasiveness,
};
const u8 *const gPokeblockWasTooXStringTable[FLAVOR_COUNT] =
{
Expand Down
9 changes: 2 additions & 7 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@ static const u16 sTrappingMoves[NUM_TRAPPING_MOVES] =
MOVE_THUNDER_CAGE
};

static const u16 sBadgeFlags[8] = {
FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET,
FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET,
};

static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 };

#define STAT_CHANGE_WORKED 0
Expand Down Expand Up @@ -8319,9 +8314,9 @@ static void Cmd_getmoneyreward(void)
sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
}
}
for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++)
for (count = 0, i = 0; i < ARRAY_COUNT(gBadgeFlags); i++)
{
if (FlagGet(sBadgeFlags[i]) == TRUE)
if (FlagGet(gBadgeFlags[i]) == TRUE)
++count;
}
money = sWhiteOutBadgeMoney[count] * sPartyLevel;
Expand Down
10 changes: 2 additions & 8 deletions src/battle_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,6 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] =
[REMATCH_WALLACE] = REMATCH(TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, EVER_GRANDE_CITY),
};

static const u16 sBadgeFlags[NUM_BADGES] =
{
FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET,
FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET,
};

#define tState data[0]
#define tTransition data[1]

Expand Down Expand Up @@ -1920,9 +1914,9 @@ static bool32 HasAtLeastFiveBadges(void)
{
s32 i, count;

for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++)
for (count = 0, i = 0; i < ARRAY_COUNT(gBadgeFlags); i++)
{
if (FlagGet(sBadgeFlags[i]) == TRUE)
if (FlagGet(gBadgeFlags[i]) == TRUE)
{
if (++count >= 5)
return TRUE;
Expand Down
1,079 changes: 309 additions & 770 deletions src/debug.c

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/event_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0};

extern u16 *const gSpecialVars[];

const u16 gBadgeFlags[NUM_BADGES] =
{
FLAG_BADGE01_GET,
FLAG_BADGE02_GET,
FLAG_BADGE03_GET,
FLAG_BADGE04_GET,
FLAG_BADGE05_GET,
FLAG_BADGE06_GET,
FLAG_BADGE07_GET,
FLAG_BADGE08_GET,
};

void InitEventData(void)
{
memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags));
Expand Down
14 changes: 1 addition & 13 deletions src/match_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,25 +1839,13 @@ static void PopulateBattleFrontierStreak(int matchCallId, u8 *destStr)
ConvertIntToDecimalStringN(destStr, sBattleFrontierStreakInfo.streak, STR_CONV_MODE_LEFT_ALIGN, i);
}

static const u16 sBadgeFlags[NUM_BADGES] =
{
FLAG_BADGE01_GET,
FLAG_BADGE02_GET,
FLAG_BADGE03_GET,
FLAG_BADGE04_GET,
FLAG_BADGE05_GET,
FLAG_BADGE06_GET,
FLAG_BADGE07_GET,
FLAG_BADGE08_GET,
};

static int GetNumOwnedBadges(void)
{
u32 i;

for (i = 0; i < NUM_BADGES; i++)
{
if (!FlagGet(sBadgeFlags[i]))
if (!FlagGet(gBadgeFlags[i]))
break;
}

Expand Down
Loading