Decomped GetBagCapacitySpecialEpisode

This commit is contained in:
AnonymousRandomPerson 2025-10-23 23:28:19 -04:00
parent dcddd82446
commit f02fe261c8
10 changed files with 16 additions and 21 deletions

View File

@ -2,7 +2,6 @@
.public ARM9_UNKNOWN_PTR__NA_20A2C84
.public ArrayCopy32
.public ArrayFill32
.public BAG_CAPACITY_TABLE_SPECIAL_EPISODES
.public DecompressAtNormalVeneer
.public GetAtSize
.public GetBaseForm

View File

@ -1,17 +1,8 @@
.include "asm/macros.inc"
.include "main_020517E4.inc"
.include "main_020517F4.inc"
.text
arm_func_start GetBagCapacitySpecialEpisode
GetBagCapacitySpecialEpisode: ; 0x020517E4
ldr r1, _020517F0 ; =BAG_CAPACITY_TABLE_SPECIAL_EPISODES
ldr r0, [r1, r0, lsl #2]
bx lr
.align 2, 0
_020517F0: .word BAG_CAPACITY_TABLE_SPECIAL_EPISODES
arm_func_end GetBagCapacitySpecialEpisode
arm_func_start GetRankUpEntry
GetRankUpEntry: ; 0x020517F4
ldr r1, _02051800 ; =RANK_UP_TABLE

View File

@ -219,7 +219,3 @@ GUMMI_BELLY_RESTORE_TABLE:
.byte 0x0A, 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x0F, 0x00
.byte 0x0A, 0x00, 0x0F, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x05, 0x00, 0x14, 0x00, 0x0A, 0x00, 0x0A, 0x00
.byte 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x1E, 0x00
.global BAG_CAPACITY_TABLE_SPECIAL_EPISODES
BAG_CAPACITY_TABLE_SPECIAL_EPISODES:
.byte 0x18, 0x00, 0x00, 0x00
.byte 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00

View File

@ -3418,6 +3418,7 @@ enum script_var_id {
};
enum special_episode_type {
EPISODE_NONE = -1,
EPISODE_BIDOOFS_WISH = 0,
EPISODE_IGGLYBUFF_THE_PRODIGY = 1,
EPISODE_TODAYS_OH_MY_GOSH = 2,

View File

@ -3,5 +3,6 @@
// Returns the player's bag capacity for a given point in the game.
u32 GetBagCapacity(s32 scenario_balance);
u32 GetBagCapacitySpecialEpisode(s32 se_type);
#endif //PMDSKY_MAIN_020517D4_H

View File

@ -103,7 +103,7 @@ Static main
Object src/secondary_terrain_types.o
Object asm/main_rodata_020A1BB0.o
Object src/main_020517D4.o
Object asm/main_020517E4.o
Object asm/main_020517F4.o
Object src/main_020526EC.o
Object asm/get_category_string.o
Object src/main_020527A8.o

View File

@ -13,6 +13,7 @@
#include "dungeon_util_1.h"
#include "dungeon_util_static.h"
#include "dungeon_visibility.h"
#include "main_0200EDC0.h"
#include "main_0208655C.h"
#include "math.h"
#include "number_util.h"
@ -47,7 +48,6 @@ const s32 FACING_DIRECTION_INCREMENTS[] = {0, 1, -1, 2, -2, 3, -3, 4};
extern bool8 CanTargetEntity(struct entity *user, struct entity *target);
extern bool8 CanTargetPosition(struct entity *monster, struct position *position);
extern bool8 IsBagFull();
extern bool8 ShouldMonsterFollowLeader(struct entity *monster);
extern bool8 IsPositionWithinTwoTiles(struct position *origin, struct position *target);
extern s32 ov29_022FBE04(struct monster*);

View File

@ -3,16 +3,16 @@
#include "main_0204C938.h"
#include "main_0204CB94.h"
#include "main_020517D4.h"
#include "scripting.h"
extern struct bag_items *BAG_ITEMS_PTR_MIRROR;
extern s32 GetBagCapacitySpecialEpisode(s32 se_type);
extern bool8 GetPerformanceFlagWithChecks(s32 flag_id);
s32 GetCurrentBagCapacity()
{
s32 special_episode_type = GetExecuteSpecialEpisodeType();
if (special_episode_type == -1)
if (special_episode_type == EPISODE_NONE)
{
if (GetPerformanceFlagWithChecks(2) == 0)
return 1;

View File

@ -4,7 +4,7 @@
u8 GetScenarioBalance()
{
s32 special_episode_type = LoadScriptVariableValue(0, VAR_EXECUTE_SPECIAL_EPISODE_TYPE);
if (special_episode_type == -1)
if (special_episode_type == EPISODE_NONE)
{
s32 scenario_balance = LoadScriptVariableValue(0, VAR_SCENARIO_BALANCE_DEBUG);
if (scenario_balance < 0)

View File

@ -1,8 +1,15 @@
#include "main_020517D4.h"
const u32 BAG_CAPACITY_TABLE[8] = { 16, 24, 32, 40, 40, 40, 48, 48 };
// Array of 4-byte integers containing the bag capacity for each bag level.
const u32 BAG_CAPACITY_TABLE[] = { 16, 24, 32, 40, 40, 40, 48, 48 };
const u32 BAG_CAPACITY_TABLE_SPECIAL_EPISODES[] = { 24, 48, 48, 48, 48 };
u32 GetBagCapacity(s32 scenario_balance)
{
return BAG_CAPACITY_TABLE[scenario_balance];
}
u32 GetBagCapacitySpecialEpisode(s32 se_type)
{
return BAG_CAPACITY_TABLE_SPECIAL_EPISODES[se_type];
}