Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ venv/
*.bin
.ninja_*
build.ninja
CMakeLists.txt
romc
2 changes: 2 additions & 0 deletions lib/libpm-jp.a
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pm_gPopupState = 0x8010D800;
pm_gPartnerStatus = 0x8010ED70;
pm_gUiStatus = 0x8010F118;
pm_gPlayerStatus = 0x8010F188;
pm_gPlayerSpinState = 0x8010F410;
pm_gPlayerData = 0x8010F450;
pm_gHudElementSizes = 0x8015406C;
pm_MusicCurrentVolume = 0x8015EA66;
pm_gActionCommandStatus = 0x8029FED0;
Expand Down
2 changes: 2 additions & 0 deletions lib/libpm-us.a
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pm_gPopupState = 0x8010D640;
pm_gPartnerStatus = 0x8010EBB0;
pm_gUiStatus = 0x8010EF58;
pm_gPlayerStatus = 0x8010EFC8;
pm_gPlayerSpinState = 0x8010F250;
pm_gPlayerData = 0x8010F290;
pm_gHudElementSizes = 0x8014EFCC;
pm_MusicCurrentVolume = 0x80159AE6;
pm_gActionCommandStatus = 0x8029FBE0;
Expand Down
106 changes: 106 additions & 0 deletions src/enums.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
#ifndef ENUMS_H
#define ENUMS_H

enum Abilities {
ABILITY_DODGE_MASTER = 0x00000000,
ABILITY_UNUSED = 0x00000001,
ABILITY_SPIKE_SHIELD = 0x00000002,
ABILITY_FIRST_ATTACK = 0x00000003,
ABILITY_HP_PLUS = 0x00000004,
ABILITY_DOUBLE_DIP = 0x00000005,
ABILITY_MYSTERY_SCROLL = 0x00000006,
ABILITY_FIRE_SHIELD = 0x00000007,
ABILITY_PRETTY_LUCKY = 0x00000008,
ABILITY_HP_DRAIN = 0x00000009,
ABILITY_ALL_OR_NOTHING = 0x0000000A,
ABILITY_SLOW_GO = 0x0000000B,
ABILITY_FP_PLUS = 0x0000000C,
ABILITY_ICE_POWER = 0x0000000D,
ABILITY_FEELING_FINE = 0x0000000E,
ABILITY_ATTACK_FX = 0x0000000F,
ABILITY_MONEY_MONEY = 0x00000010,
ABILITY_CHILL_OUT = 0x00000011,
ABILITY_HAPPY_HEART = 0x00000012,
ABILITY_ZAP_TAP = 0x00000013,
ABILITY_MEGA_RUSH = 0x00000014,
ABILITY_BERSERKER = 0x00000015,
ABILITY_RIGHT_ON = 0x00000016,
ABILITY_RUNAWAY_PAY = 0x00000017,
ABILITY_FLOWER_SAVER = 0x00000018,
ABILITY_PAY_OFF = 0x00000019,
ABILITY_QUICK_CHANGE = 0x0000001A,
ABILITY_DEFEND_PLUS = 0x0000001B,
ABILITY_POWER_PLUS = 0x0000001C,
ABILITY_REFUND = 0x0000001D,
ABILITY_POWER_RUSH = 0x0000001E,
ABILITY_CRAZY_HEART = 0x0000001F,
ABILITY_LAST_STAND = 0x00000020,
ABILITY_CLOSE_CALL = 0x00000021,
ABILITY_P_UP_D_DOWN = 0x00000022,
ABILITY_LUCKY_DAY = 0x00000023,
ABILITY_MEGA_HP_DRAIN = 0x00000024,
ABILITY_P_DOWN_D_UP = 0x00000025,
ABILITY_FLOWER_FANATIC = 0x00000026,
ABILITY_SPEEDY_SPIN = 0x00000027,
ABILITY_SPIN_ATTACK = 0x00000028,
ABILITY_I_SPY = 0x00000029,
ABILITY_BUMP_ATTACK = 0x0000002A,
ABILITY_HEART_FINDER = 0x0000002B,
ABILITY_FLOWER_FINDER = 0x0000002C,
ABILITY_DIZZY_ATTACK = 0x0000002D,
ABILITY_FINAL_GOOMPA = 0x0000002E,
ABILITY_FINAL_BOBOMB = 0x0000002F,
ABILITY_DEEP_FOCUS = 0x00000030,
ABILITY_SUPER_FOCUS = 0x00000031,
ABILITY_KAIDEN = 0x00000032,
ABILITY_DAMAGE_DODGE = 0x00000033,
ABILITY_HAPPY_FLOWER = 0x00000034,
ABILITY_GROUP_FOCUS = 0x00000035,
ABILITY_PEEKABOO = 0x00000036,
ABILITY_HEALTHY_HEALTHY = 0x00000037,
};

enum ActionStates {
ACTION_STATE_IDLE,
ACTION_STATE_WALK,
Expand Down Expand Up @@ -881,4 +940,51 @@ enum PlayerStatusFlags {
PS_FLAG_ACTION_STATE_CHANGED = 0x80000000,
};

enum PlayerStatusAnimFlags {
/* Whether Mario is in the process of using Watt (but isn't necessarily holding them yet) */
PA_FLAG_USING_WATT = 0x00000001,
/* Whether Watt is actually in Mario's hands at the moment */
PA_FLAG_WATT_IN_HANDS = 0x00000002,
PA_FLAG_INTERRUPT_USE_PARTNER =
0x00000004, ///< forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
PA_FLAG_FORCE_USE_PARTNER = 0x00000008, ///< triggers partner use when set
PA_FLAG_INTERACT_PROMPT_AVAILABLE = 0x00000010, ///< ! prompt
PA_FLAG_SPEECH_PROMPT_AVAILABLE = 0x00000020, ///< (...) prompt
PA_FLAG_PULSE_STONE_VISIBLE = 0x00000040, ///< The pulse stone icon is being shown
PA_FLAG_USING_PULSE_STONE = 0x00000080,
PA_FLAG_ISPY_VISIBLE = 0x00000100, ///< The I Spy icon is being shown
PA_FLAG_RAISED_ARMS = 0x00000200, ///< Sets action state to ACTION_STATE_RAISE_ARMS on idle
PA_FLAG_SHIVERING = 0x00000400,
PA_FLAG_OPENED_HIDDEN_PANEL = 0x00000800,
PA_FLAG_USING_PEACH_PHYSICS = 0x00001000,
PA_FLAG_INVISIBLE = 0x00002000,
PA_FLAG_8BIT_MARIO = 0x00004000,
PA_FLAG_NPC_COLLIDED = 0x00008000,
PA_FLAG_SPINNING = 0x00010000,
/* Began an encounter by spinning into an enemy with the Dizzy Attack badge on */
PA_FLAG_DIZZY_ATTACK_ENCOUNTER = 0x00020000,
PA_FLAG_INTERRUPT_SPIN = 0x00040000,
/* When Mario is in a transition to a new map, either through a loading zone or pipe */
PA_FLAG_CHANGING_MAP = 0x00100000,
/* Occurs after PA_FLAG_FORCE_USE_PARTNER. Some partners - namely Bow and Lakilester, unset this immediately.
Not sure why - seems like it might contribute to being unable to *stop* using your partner during a cutscene. */
PA_FLAG_PARTNER_USAGE_FORCED = 0x00200000,
PA_FLAG_RIDING_PARTNER = 0x00400000,
PA_FLAG_ABORT_PUSHING_BLOCK = 0x00800000,
/* Changes how Mario is rendered. Seems to be intended to make Mario's depth render properly when using Bow behind a
* switch (two translucent objects on top of eachother), but it doesn't actually work. */
PA_FLAG_MAP_HAS_SWITCH = 0x01000000,
/* Usually, if Mario falls for too long, he eventually gets reset to his last safe position. This prevents that.
* Used by some scripts. */
PA_FLAG_NO_OOB_RESPAWN = 0x10000000,
/* This allows dismounting from Lakilester, even if in a precarious situation (like over spikes, lava, or water). */
PA_FLAG_DISMOUNTING_ALLOWED = 0x20000000,
/* This flag is set when partner usage was interrupted by a script, and it prevents menu sounds (like the error
* sound) from playing for script-initiated player actions */
PA_FLAG_FORCED_PARTNER_ABILITY_END = 0x40000000,
/* This one's really weird. Seems to have something to do with the direction Mario is facing, but I'm not sure what
* it's actually supposed to be achieving. */
PA_FLAG_80000000 = 0x80000000,
};

#endif
18 changes: 11 additions & 7 deletions src/fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,26 @@ void fpDrawTimer(struct GfxFont *font, s32 cellWidth, s32 cellHeight, u8 menuAlp
void fpUpdateCheats(void) {
pm_gGameStatus.debugEnemyContact = settings->cheatEnemyContact;
if (CHEAT_ACTIVE(CHEAT_HP)) {
pm_gPlayerStatus.playerData.curHP = pm_gPlayerStatus.playerData.curMaxHP;
pm_gPlayerData.curHP = pm_gPlayerData.curMaxHP;
}
if (CHEAT_ACTIVE(CHEAT_FP)) {
pm_gPlayerStatus.playerData.curFP = pm_gPlayerStatus.playerData.curMaxFP;
pm_gPlayerData.curFP = pm_gPlayerData.curMaxFP;
}
if (CHEAT_ACTIVE(CHEAT_ATTACK)) {
pm_gBattleStatus.merleeAttackBoost = 127;
}
if (CHEAT_ACTIVE(CHEAT_COINS)) {
pm_gPlayerStatus.playerData.coins = 999;
pm_gPlayerData.coins = 999;
}
if (CHEAT_ACTIVE(CHEAT_STAR_POWER)) {
pm_gPlayerStatus.playerData.starPowerFullBars = pm_gPlayerStatus.playerData.maxStarPower;
pm_gPlayerStatus.playerData.starPowerPartialBars = 0;
pm_gPlayerData.starPowerFullBars = pm_gPlayerData.maxStarPower;
pm_gPlayerData.starPowerPartialBars = 0;
}
if (CHEAT_ACTIVE(CHEAT_STAR_PIECES)) {
pm_gPlayerStatus.playerData.starPieces = 160;
pm_gPlayerData.starPieces = 160;
}
if (CHEAT_ACTIVE(CHEAT_PERIL)) {
pm_gPlayerStatus.playerData.curHP = 1;
pm_gPlayerData.curHP = 1;
}
if (CHEAT_ACTIVE(CHEAT_AUTO_MASH)) {
if (pm_gGameStatus.isBattle == 1) {
Expand Down Expand Up @@ -559,6 +559,10 @@ void fpDraw(void) {
trainerDrawPinned(settings->trainerX, settings->trainerY, font, cellWidth, cellHeight, 0xC0C0C0, menuAlpha);
}

if (fp.spinTrainerMoving || (settings->trainerSpinBarEnabled && !fp.menuActive && pm_gGameStatus.isBattle == 0)) {
trainerDrawSpinBar(settings->trainerSpinX, settings->trainerSpinY, font, 0xC0C0C0, menuAlpha);
}

if (!fp.versionShown) {
fpDrawVersion(font, cellWidth, cellHeight, menuAlpha);
}
Expand Down
1 change: 1 addition & 0 deletions src/fp.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ typedef struct {
s32 cpuCounterFreq;
bool timerMoving;
bool trainerMoving;
bool spinTrainerMoving;
bool menuActive;
struct LogEntry log[SETTINGS_LOG_MAX];
Vec3f savedPos;
Expand Down
61 changes: 28 additions & 33 deletions src/fp/player/fp_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ static struct GfxTexture **getItemTextureList(void) {
}

static s32 maxHpProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
s8 *curMaxHP = &pm_gPlayerStatus.playerData.curMaxHP;
s8 *hardMaxHP = &pm_gPlayerStatus.playerData.hardMaxHP;
s8 *curMaxHP = &pm_gPlayerData.curMaxHP;
s8 *hardMaxHP = &pm_gPlayerData.hardMaxHP;
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
if (menuIntinputGet(item) != *curMaxHP) {
menuIntinputSet(item, *curMaxHP);
Expand All @@ -69,8 +69,8 @@ static s32 maxHpProc(struct MenuItem *item, enum MenuCallbackReason reason, void
}

static s32 maxFpProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
s8 *curMaxFP = &pm_gPlayerStatus.playerData.curMaxFP;
s8 *hardMaxFP = &pm_gPlayerStatus.playerData.hardMaxFP;
s8 *curMaxFP = &pm_gPlayerData.curMaxFP;
s8 *hardMaxFP = &pm_gPlayerData.hardMaxFP;
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
if (menuIntinputGet(item) != *curMaxFP) {
menuIntinputSet(item, *curMaxFP);
Expand All @@ -89,16 +89,16 @@ static s32 maxFpProc(struct MenuItem *item, enum MenuCallbackReason reason, void

static s32 currentPartnerProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
if (reason == MENU_CALLBACK_THINK_INACTIVE) {
menuOptionSet(item, partnerOrder[pm_gPlayerStatus.playerData.currentPartner]);
menuOptionSet(item, partnerOrder[pm_gPlayerData.currentPartner]);
} else if (reason == MENU_CALLBACK_DEACTIVATE) {
pm_gPlayerStatus.playerData.currentPartner = partnerOrder[menuOptionGet(item)];
pm_gPlayerData.currentPartner = partnerOrder[menuOptionGet(item)];
}
return 0;
}

static s32 bootsProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
u32 trackedLevel = (u32)data;
s8 *bootsUpgrade = &pm_gPlayerStatus.playerData.bootsLevel;
s8 *bootsUpgrade = &pm_gPlayerData.bootsLevel;
if (reason == MENU_CALLBACK_SWITCH_ON) {
*bootsUpgrade = trackedLevel;
} else if (reason == MENU_CALLBACK_THINK) {
Expand All @@ -109,7 +109,7 @@ static s32 bootsProc(struct MenuItem *item, enum MenuCallbackReason reason, void

static s32 hammerProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
u32 trackedLevel = (u32)data;
s8 *hammerUpgrade = &pm_gPlayerStatus.playerData.hammerLevel;
s8 *hammerUpgrade = &pm_gPlayerData.hammerLevel;
if (reason == MENU_CALLBACK_SWITCH_ON) {
*hammerUpgrade = trackedLevel;
} else if (reason == MENU_CALLBACK_SWITCH_OFF) {
Expand Down Expand Up @@ -149,8 +149,8 @@ static s32 ultraRankProc(struct MenuItem *item, enum MenuCallbackReason reason,
}

static s32 starSpiritSwitchProc(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
s8 *ssSaved = &pm_gPlayerStatus.playerData.maxStarPower;
s16 *starPower = &pm_gPlayerStatus.playerData.starPower;
s8 *ssSaved = &pm_gPlayerData.maxStarPower;
s16 *starPower = &pm_gPlayerData.starPower;
s32 ssIndex = (u32)data;
if (reason == MENU_CALLBACK_SWITCH_ON) {
*ssSaved = ssIndex;
Expand Down Expand Up @@ -252,7 +252,7 @@ static void createStatsMenu(struct Menu *menu) {
s32 hpX = 1;
s32 hpY = 2;
menuAddStaticIcon(menu, hpX, hpY, texHeart, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, hpX + 2, hpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.curHP);
item = menuAddIntinput(menu, hpX + 2, hpY, 10, 2, menuByteModProc, &pm_gPlayerData.curHP);
item->tooltip = strHp;
menuAddStatic(menu, hpX + 4, hpY, "/", 0xC0C0C0);
item = menuAddIntinput(menu, hpX + 5, hpY, 10, 2, maxHpProc, NULL);
Expand All @@ -261,7 +261,7 @@ static void createStatsMenu(struct Menu *menu) {
s32 fpX = 1;
s32 fpY = 4;
menuAddStaticIcon(menu, fpX, fpY, texFlower, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, fpX + 2, fpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.curFP);
item = menuAddIntinput(menu, fpX + 2, fpY, 10, 2, menuByteModProc, &pm_gPlayerData.curFP);
item->tooltip = strFp;
menuAddStatic(menu, fpX + 4, fpY, "/", 0xC0C0C0);
item = menuAddIntinput(menu, fpX + 5, fpY, 10, 2, maxFpProc, NULL);
Expand All @@ -270,40 +270,37 @@ static void createStatsMenu(struct Menu *menu) {
s32 bpX = 1;
s32 bpY = 6;
menuAddStaticIcon(menu, bpX, bpY, texBpIcon, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, bpX + 2, bpY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.maxBP);
item = menuAddIntinput(menu, bpX + 2, bpY, 10, 2, menuByteModProc, &pm_gPlayerData.maxBP);
item->tooltip = strBp;

s32 coinX = 10;
s32 coinY = 2;
menuAddStaticIcon(menu, coinX, coinY, texCoin, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, coinX + 2, coinY, 10, 3, menuHalfwordModProc, &pm_gPlayerStatus.playerData.coins);
item = menuAddIntinput(menu, coinX + 2, coinY, 10, 3, menuHalfwordModProc, &pm_gPlayerData.coins);
item->tooltip = strCoins;

s32 starPieceX = 10;
s32 starPieceY = 4;
menuAddStaticIcon(menu, starPieceX, starPieceY, texStarPiece, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, starPieceX + 2, starPieceY, 10, 3, menuByteModProc,
&pm_gPlayerStatus.playerData.starPieces);
item = menuAddIntinput(menu, starPieceX + 2, starPieceY, 10, 3, menuByteModProc, &pm_gPlayerData.starPieces);
item->tooltip = strStarPieces;

s32 levelX = 17;
s32 levelY = 2;
menuAddStaticIcon(menu, levelX, levelY, texMarioHead, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, levelX + 2, levelY, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.level);
item = menuAddIntinput(menu, levelX + 2, levelY, 10, 2, menuByteModProc, &pm_gPlayerData.level);
item->tooltip = strLevel;

s32 starPointX = 17;
s32 starPointY = 4;
menuAddStaticIcon(menu, starPointX, starPointY, texStarPoint, 0, 0xFFFFFF, 1.0f);
item = menuAddIntinput(menu, starPointX + 2, starPointY, 10, 2, menuByteModProc,
&pm_gPlayerStatus.playerData.starPoints);
item = menuAddIntinput(menu, starPointX + 2, starPointY, 10, 2, menuByteModProc, &pm_gPlayerData.starPoints);
item->tooltip = strStarPoints;

s32 actionCommandX = 23;
s32 actionCommandY = 2;
item =
menuAddSwitch(menu, actionCommandX, actionCommandY, texLuckyStar, 0, 0, 0xFFFFFF, texLuckyStar, 0, 1, 0xFFFFFF,
0.7f, FALSE, menuByteSwitchToggleProc, &pm_gPlayerStatus.playerData.hasActionCommands);
item = menuAddSwitch(menu, actionCommandX, actionCommandY, texLuckyStar, 0, 0, 0xFFFFFF, texLuckyStar, 0, 1,
0xFFFFFF, 0.7f, FALSE, menuByteSwitchToggleProc, &pm_gPlayerData.hasActionCommands);
item->tooltip = strActionCommands;
}

Expand Down Expand Up @@ -348,19 +345,17 @@ static void createPartyMenu(struct Menu *menu) {

partners[i] = menuAddSwitch(menu, partnerX, partnerY, texPartner, i + 1, 0, 0xFFFFFF, texPartner, i + 1, 1,
0xFFFFFF, scale, FALSE, menuByteSwitchToggleProc,
&pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]].enabled);
&pm_gPlayerData.partners[partnerOrder[i + 1]].enabled);
partners[i]->tooltip = strPartnerNames[i];

// super tex
superRanks[i] =
menuAddSwitch(menu, partnerX + 2, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF, scale, FALSE,
superRankProc, &pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]]);
superRanks[i] = menuAddSwitch(menu, partnerX + 2, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF,
scale, FALSE, superRankProc, &pm_gPlayerData.partners[partnerOrder[i + 1]]);
superRanks[i]->tooltip = strSuperRank;

// ultra tex
ultraRanks[i] =
menuAddSwitch(menu, partnerX + 3, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF, scale, FALSE,
ultraRankProc, &pm_gPlayerStatus.playerData.partners[partnerOrder[i + 1]]);
ultraRanks[i] = menuAddSwitch(menu, partnerX + 3, partnerY, texRank, 0, 0, 0xFFFFFF, texRank, 0, 1, 0xFFFFFF,
scale, FALSE, ultraRankProc, &pm_gPlayerData.partners[partnerOrder[i + 1]]);
ultraRanks[i]->tooltip = strUltraRank;
}
menuItemAddChainLink(activeItem, partners[0], MENU_NAVIGATE_DOWN);
Expand Down Expand Up @@ -399,7 +394,7 @@ static void createStarSpiritMenu(struct Menu *menu) {
s8 beamPalettes[] = {1, 0, 0};
u32 beamColors[] = {0xFFFFFF, 0xFFFFFF, 0xFFFFFF};
struct MenuItem *item = menuAddCycle(menu, ssX, ssY, 3, beamTextures, beamTiles, beamPalettes, beamColors, scale,
FALSE, menuByteCycleProc, &pm_gPlayerStatus.playerData.starBeamLevel);
FALSE, menuByteCycleProc, &pm_gPlayerData.starBeamLevel);
item->tooltip = strStarPeachBeam;
menuItemCreateChain(starSpirits, 8, MENU_NAVIGATE_RIGHT, FALSE, FALSE);
menuItemCreateChain(starSpirits, 8, MENU_NAVIGATE_LEFT, FALSE, TRUE);
Expand Down Expand Up @@ -438,13 +433,13 @@ static void createMerleeMenu(struct Menu *menu) {
"+3 DEF\0"
"EXP x2\0"
"Coins x2\0",
menuByteOptionmodProc, &pm_gPlayerStatus.playerData.merleeSpellType);
menuByteOptionmodProc, &pm_gPlayerData.merleeSpellType);

menuAddStatic(menu, 0, yValue, "casts remaining", 0xC0C0C0);
menuAddIntinput(menu, 16, yValue++, 10, 2, menuByteModProc, &pm_gPlayerStatus.playerData.merleeCastsRemaining);
menuAddIntinput(menu, 16, yValue++, 10, 2, menuByteModProc, &pm_gPlayerData.merleeCastsRemaining);

menuAddStatic(menu, 0, yValue, "turns remaining", 0xC0C0C0);
menuAddIntinput(menu, 16, yValue++, 10, 3, menuHalfwordModProc, &pm_gPlayerStatus.playerData.merleeTurnCount);
menuAddIntinput(menu, 16, yValue++, 10, 3, menuHalfwordModProc, &pm_gPlayerData.merleeTurnCount);
}

struct Menu *createPlayerMenu(void) {
Expand Down
6 changes: 3 additions & 3 deletions src/fp/player/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static s16 *itemSlotToUpdate;

static s32 badgeProcSwitch(struct MenuItem *item, enum MenuCallbackReason reason, void *data) {
u32 badgeId = (u32)data;
s16 *badgeList = pm_gPlayerStatus.playerData.badges;
s16 *badgeList = pm_gPlayerData.badges;
if (reason == MENU_CALLBACK_SWITCH_ON) {
for (u16 i = 0; i < 128; i++) {
if (badgeList[i] == 0) {
Expand All @@ -457,8 +457,8 @@ static s32 badgeProcSwitch(struct MenuItem *item, enum MenuCallbackReason reason
}
}
for (u16 i = 0; i < 64; i++) {
if (pm_gPlayerStatus.playerData.equippedBadges[i] == badgeId) {
pm_gPlayerStatus.playerData.equippedBadges[i] = 0;
if (pm_gPlayerData.equippedBadges[i] == badgeId) {
pm_gPlayerData.equippedBadges[i] = 0;
}
}
} else if (reason == MENU_CALLBACK_THINK) {
Expand Down
Loading