Skip to content

Commit f02fe26

Browse files
Decomped GetBagCapacitySpecialEpisode
1 parent dcddd82 commit f02fe26

File tree

10 files changed

+16
-21
lines changed

10 files changed

+16
-21
lines changed

asm/include/main_020517E4.inc renamed to asm/include/main_020517F4.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.public ARM9_UNKNOWN_PTR__NA_20A2C84
33
.public ArrayCopy32
44
.public ArrayFill32
5-
.public BAG_CAPACITY_TABLE_SPECIAL_EPISODES
65
.public DecompressAtNormalVeneer
76
.public GetAtSize
87
.public GetBaseForm

asm/main_020517E4.s renamed to asm/main_020517F4.s

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
.include "asm/macros.inc"
2-
.include "main_020517E4.inc"
2+
.include "main_020517F4.inc"
33

44
.text
55

6-
arm_func_start GetBagCapacitySpecialEpisode
7-
GetBagCapacitySpecialEpisode: ; 0x020517E4
8-
ldr r1, _020517F0 ; =BAG_CAPACITY_TABLE_SPECIAL_EPISODES
9-
ldr r0, [r1, r0, lsl #2]
10-
bx lr
11-
.align 2, 0
12-
_020517F0: .word BAG_CAPACITY_TABLE_SPECIAL_EPISODES
13-
arm_func_end GetBagCapacitySpecialEpisode
14-
156
arm_func_start GetRankUpEntry
167
GetRankUpEntry: ; 0x020517F4
178
ldr r1, _02051800 ; =RANK_UP_TABLE

asm/main_rodata_020A1BB0.s

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,3 @@ GUMMI_BELLY_RESTORE_TABLE:
219219
.byte 0x0A, 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x0F, 0x00
220220
.byte 0x0A, 0x00, 0x0F, 0x00, 0x0A, 0x00, 0x14, 0x00, 0x05, 0x00, 0x14, 0x00, 0x0A, 0x00, 0x0A, 0x00
221221
.byte 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x1E, 0x00
222-
.global BAG_CAPACITY_TABLE_SPECIAL_EPISODES
223-
BAG_CAPACITY_TABLE_SPECIAL_EPISODES:
224-
.byte 0x18, 0x00, 0x00, 0x00
225-
.byte 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00

include/enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,6 +3418,7 @@ enum script_var_id {
34183418
};
34193419

34203420
enum special_episode_type {
3421+
EPISODE_NONE = -1,
34213422
EPISODE_BIDOOFS_WISH = 0,
34223423
EPISODE_IGGLYBUFF_THE_PRODIGY = 1,
34233424
EPISODE_TODAYS_OH_MY_GOSH = 2,

include/main_020517D4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33

44
// Returns the player's bag capacity for a given point in the game.
55
u32 GetBagCapacity(s32 scenario_balance);
6+
u32 GetBagCapacitySpecialEpisode(s32 se_type);
67

78
#endif //PMDSKY_MAIN_020517D4_H

main.lsf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Static main
103103
Object src/secondary_terrain_types.o
104104
Object asm/main_rodata_020A1BB0.o
105105
Object src/main_020517D4.o
106-
Object asm/main_020517E4.o
106+
Object asm/main_020517F4.o
107107
Object src/main_020526EC.o
108108
Object asm/get_category_string.o
109109
Object src/main_020527A8.o

src/dungeon_ai_movement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "dungeon_util_1.h"
1414
#include "dungeon_util_static.h"
1515
#include "dungeon_visibility.h"
16+
#include "main_0200EDC0.h"
1617
#include "main_0208655C.h"
1718
#include "math.h"
1819
#include "number_util.h"
@@ -47,7 +48,6 @@ const s32 FACING_DIRECTION_INCREMENTS[] = {0, 1, -1, 2, -2, 3, -3, 4};
4748

4849
extern bool8 CanTargetEntity(struct entity *user, struct entity *target);
4950
extern bool8 CanTargetPosition(struct entity *monster, struct position *position);
50-
extern bool8 IsBagFull();
5151
extern bool8 ShouldMonsterFollowLeader(struct entity *monster);
5252
extern bool8 IsPositionWithinTwoTiles(struct position *origin, struct position *target);
5353
extern s32 ov29_022FBE04(struct monster*);

src/main_0200EDC0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
#include "main_0204C938.h"
44
#include "main_0204CB94.h"
55
#include "main_020517D4.h"
6+
#include "scripting.h"
67

78
extern struct bag_items *BAG_ITEMS_PTR_MIRROR;
89

9-
extern s32 GetBagCapacitySpecialEpisode(s32 se_type);
1010
extern bool8 GetPerformanceFlagWithChecks(s32 flag_id);
1111

1212
s32 GetCurrentBagCapacity()
1313
{
1414
s32 special_episode_type = GetExecuteSpecialEpisodeType();
15-
if (special_episode_type == -1)
15+
if (special_episode_type == EPISODE_NONE)
1616
{
1717
if (GetPerformanceFlagWithChecks(2) == 0)
1818
return 1;

src/main_0204CB94.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
u8 GetScenarioBalance()
55
{
66
s32 special_episode_type = LoadScriptVariableValue(0, VAR_EXECUTE_SPECIAL_EPISODE_TYPE);
7-
if (special_episode_type == -1)
7+
if (special_episode_type == EPISODE_NONE)
88
{
99
s32 scenario_balance = LoadScriptVariableValue(0, VAR_SCENARIO_BALANCE_DEBUG);
1010
if (scenario_balance < 0)

src/main_020517D4.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#include "main_020517D4.h"
22

3-
const u32 BAG_CAPACITY_TABLE[8] = { 16, 24, 32, 40, 40, 40, 48, 48 };
3+
// Array of 4-byte integers containing the bag capacity for each bag level.
4+
const u32 BAG_CAPACITY_TABLE[] = { 16, 24, 32, 40, 40, 40, 48, 48 };
5+
const u32 BAG_CAPACITY_TABLE_SPECIAL_EPISODES[] = { 24, 48, 48, 48, 48 };
46

57
u32 GetBagCapacity(s32 scenario_balance)
68
{
79
return BAG_CAPACITY_TABLE[scenario_balance];
810
}
11+
12+
u32 GetBagCapacitySpecialEpisode(s32 se_type)
13+
{
14+
return BAG_CAPACITY_TABLE_SPECIAL_EPISODES[se_type];
15+
}

0 commit comments

Comments
 (0)