Implement & link m_all_grow_ovl.c

This commit is contained in:
Cuyler36
2023-08-22 06:30:53 -04:00
parent a029940357
commit 45c89c63e4
13 changed files with 3685 additions and 5 deletions
+5
View File
@@ -282,6 +282,11 @@ m_random_field/mRF_GetRandomStepMode.c:
m_mail_check_ovl.c:
.text: [0x8050F06C, 0x8050F838]
.data: [0x8069F320, 0x8069FA40]
m_all_grow_ovl.c:
.text: [0x8050F848, 0x80515340]
.rodata: [0x80649098, 0x80649110]
.data: [0x8069FA68, 0x8069FD08]
.bss: [0x813013E0, 0x81301820]
ac_douzou.c:
.text: [0x805AD6D8, 0x805AE704]
.rodata: [0x8064A7C0, 0x8064A7E8]
+1
View File
@@ -21028,6 +21028,7 @@ global:
0x8069FB6C: l_magrw_bee_table
0x8069FB74: l_magrw_ftr_table
0x8069FB7C: l_magrw_smn_table
0x8069FC6C: check_fg #check_fg$2016
0x8069FD08: Aprilfool_Control_Profile
0x8069FD88: Groundhog_Control_Profile
0x8069FDD0: Mscore_Control_Profile
+147 -1
View File
@@ -4,6 +4,8 @@
#include "types.h"
#include "m_time.h"
#include "m_field_info.h"
#include "m_field_make.h"
#include "m_private.h"
#ifdef __cplusplus
extern "C" {
@@ -11,9 +13,153 @@ extern "C" {
#define mAGrw_FOSSIL_NUM 5
#define mAGrw_HANIWA_NUM 3
#define mAGrw_FTR_TREE_NUM 2
#define mAGrw_MAX_PAST_DAYS 5
#define mAGrw_GRASS_TABLE_NUM 12
#define mAGrw_MONEY_TREE_NUM 30
#define mAGrw_MAX_TREES_PER_BLOCK 32
#define mAGrw_ISL_TREE_MAX_LINE 3
#define mAGrw_ISL_MAX_TREES_PER_BLOCK 15
#define mAGrw_DUMP_ITEM_NUM 2
#define mAGrw_GRASS_PER_DAY 5
enum {
mAGrw_GROW_FIRST,
mAGrw_GROW,
mAGrw_GROW_FIRST_FORCE, /* Used when you go back in time */
mAGrw_GROW_ISLAND_FIRST,
mAGrw_GROW_ISLAND,
mAGrw_GROW_ISLAND_FIRST_FORCE, /* Used when you go back in time */
mAGrw_GROW_NUM
};
enum {
mAGrw_TREE000,
mAGrw_TREE001,
mAGrw_TREE002,
mAGrw_TREE003,
mAGrw_TREE004,
mAGrw_TREE_STAGE_NUM
};
enum {
mAGrw_AROUND_TOP,
mAGrw_AROUND_BOTTOM,
mAGrw_AROUND_LEFT,
mAGrw_AROUND_RIGHT,
mAGrw_AROUND_NUM
};
enum {
mAGrw_FLOWER_TIME,
mAGrw_NOT_FLOWER_TIME,
mAGrw_FLOWER_TIME_NUM
};
enum {
mAGrw_TREE_TYPE_APPLE,
mAGrw_TREE_TYPE_CHESTNUT, // cherry tree
mAGrw_TREE_TYPE_PEAR,
mAGrw_TREE_TYPE_PEACH,
mAGrw_TREE_TYPE_ORANGE,
mAGrw_TREE_TYPE_NORMAL,
mAGrw_TREE_TYPE_MONEY,
mAGrw_TREE_TYPE_PALM,
mAGrw_TREE_TYPE_CEDAR,
mAGrw_TREE_TYPE_GOLD,
mAGrw_TREE_TYPE_NUM
};
enum {
mAGrw_KILL_PALM_TREE,
mAGrw_KILL_CEDAR_TREE,
mAGrw_KILL_TREE_NUM
};
enum {
mAGrw_CARP_UNCHANGED,
mAGrw_CARP_PLACE,
mAGrw_CARP_REMOVE,
mAGrw_CARP_NUM
};
enum {
mAGrw_CHECK_CANCEL_12,
mAGrw_CHECK_CANCEL_32,
mAGrw_CHECK_CANCEL_22,
mAGrw_CHECK_CANCEL_36,
mAGrw_CHECK_CANCEL_LEFT_45,
mAGrw_CHECK_CANCEL_RIGHT_45,
mAGrw_CHECK_CANCEL_46,
mAGrw_CHECK_CANCEL_23,
mAGrw_CHECK_CANCEL_57,
mAGrw_CHECK_CANCEL_68,
mAGrw_CHECK_CANCEL_77,
mAGrw_CHECK_CANCEL_NUM
};
typedef struct shine_stone_pos_info {
u8 block_x;
u8 block_z;
u8 ut_x;
u8 ut_z;
} mAGrw_SSPosInfo_c;
typedef struct allgrow_s {
mAGrw_SSPosInfo_c shine_pos[TOTAL_PLAYER_NUM];
mAGrw_SSPosInfo_c stone_pos[TOTAL_PLAYER_NUM];
} mAGrw_AllGrow_c;
typedef struct grow_info_s {
mFM_fg_c* around_block[mAGrw_AROUND_NUM];
int check_plant;
int past_days;
int block_height;
int ocean_row;
int flower_time;
int spoil_kabu;
int block_x;
int block_z;
int ut_x;
int ut_z;
int deposited_item;
int money_tree_num;
u8 fossil_record;
int fossil_num;
u8 honeycomb_tree_record;
u8 ftr_tree_record;
u8 money_stone_spawned;
} mAGrw_GrowInfo_c;
typedef struct carp_block_info_s {
u8 signboard_in_block:1;
u8 carp_already_exists:1;
u8 villager_house_in_block:1;
u8 signboard_count:5;
} mAGrw_CarpBlockInfo_c;
typedef struct carp_info_s {
mAGrw_CarpBlockInfo_c block_flags[FG_BLOCK_TOTAL_NUM];
u8 signboard_blocks;
u8 carp_blocks;
u8 villager_house_blocks;
} mAGrw_CarpInfo_c;
extern void mAGrw_RenewalFgItem_ovl(lbRTC_time_c* time, int* haniwa_scheduled);
extern void mAGrw_SearchDump(mFI_unit_c* dump_info);
extern void mAGrw_SetHideUtInfo(u16* hide, mActor_name_t* items);
extern void mAGrw_RenewalFgItem_ovl(lbRTC_time_c* time, int* haniwa_scheduled);
#ifdef __cplusplus
}
+10
View File
@@ -43,6 +43,16 @@ enum background_attribute {
mCoBG_ATTRIBUTE_SEA,
};
enum {
mCoBG_PLANT0 = 0, /* Stay a sapling */
mCoBG_PLANT1 = 1, /* Grow until the first stage of growth */
mCoBG_PLANT2 = 2, /* Grow until the second stage of growth */
mCoBG_PLANT3 = 3, /* Grow until the third stage of growth */
mCoBG_PLANT4 = 4, /* Fully grow */
mCoBG_KILL_PLANT = 7 /* No growth, all plants die on this unit */
};
/* sizeof(mCoBG_CollisionData_c) == 4*/
typedef struct collision_bg_data_s {
/* 1------- -------- -------- -------- */ u32 shape:1; /* collision shape */
+3 -1
View File
@@ -29,6 +29,7 @@
#include "m_npc_walk.h"
#include "m_mask_cat.h"
#include "m_npc_schedule_h.h"
#include "m_all_grow.h"
#ifdef __cplusplus
extern "C" {
@@ -126,7 +127,8 @@ typedef struct Save_s {
/* 0x022500 */ u8 _tmp7[0x22528 - 0x22500];
/* 0x022528 */ OSTime time_delta; /* time delta against GC RTC */
/* 0x022540 */ Island_c island; /* island data */
/* 0x023E40 */ u8 _23E40[0x23F20 - 0x23E40];
/* 0x023E40 */ mAGrw_AllGrow_c allgrow_ss_pos_info;
/* 0x023E68 */ u8 _23E68[0x23F20 - 0x23E68];
/* 0x023F20 */ MaskCat_c mask_cat;
/* 0x024160 */ Anmret_c return_animal; /* information about villager which moved back in to your town after moving to someone else's town */
/* 0x02416C */ u8 _tmp10[0x24174 - 0x2416C];
+1
View File
@@ -154,6 +154,7 @@ extern int mFI_search_unit_around(xyz_t* wpos, mActor_name_t item);
extern void mFI_BlockDepositOFF(u16* deposit, int ut_x, int ut_z);
extern void mFI_PullTanukiPathTrees();
extern int mFI_CheckBlockKind_OR(int block_x, int block_z, u32 kind);
extern void mFI_GetIslandBlockNumX(int* island_block_x_nums);
extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint);
extern void mFI_PrintFgAttr(gfxprint_t* gfxprint);
+1
View File
@@ -93,6 +93,7 @@ extern int* g_block_kind_p;
extern void mFM_DecideBgTexIdx(u8* bg_tex_idx);
extern void mFM_InitFgCombiSaveData(GAME* game);
extern mActor_name_t mFM_GetReserveName(int block_x, int block_z);
#ifdef __cplusplus
}
+1
View File
@@ -16,6 +16,7 @@ extern "C" {
#define HOME_MAILBOX_SIZE 10
#define HANIWA_ITEM_HOLD_NUM 4
#define HANIWA_MESSAGE_LEN 128
#define mHm_LAYER_NUM 4
enum {
mHm_ROOM_MAIN,
+2
View File
@@ -20,6 +20,8 @@ extern "C" {
#define mISL_FG_BLOCK_X_NUM 2
#define mISL_FG_BLOCK_Z_NUM 1
#define mISL_BLOCK_Z 8
enum {
mISL_ISLAND_BLOCK_LEFT,
mISL_ISLAND_BLOCK_RIGHT,
+69 -3
View File
@@ -52,7 +52,18 @@ enum {
ITEM1_CAT_NUM
};
enum {
mNT_TREE_TYPE_NORMAL,
mNT_TREE_TYPE_PALM,
mNT_TREE_TYPE_CEDAR,
mNT_TREE_TYPE_GOLD,
mNT_TREE_TYPE_NUM
};
extern int mNT_check_unknown(mActor_name_t item_no);
extern int FGTreeType_check(mActor_name_t tree);
extern mActor_name_t bg_item_fg_sub_tree_grow(mActor_name_t tree, int past_days, int check_plant);
/* Retrieve the item actor's category */
#define ITEM_NAME_GET_TYPE(n) (((n) & 0xF000) >> 12)
@@ -71,6 +82,21 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define GET_NAME_ITEM1_CATEGORY(f) (((f) & 0x0F00) >> 8)
#define IS_ITEM_FLOWER(item) ((item) >= FLOWER_LEAVES_PANSIES0 && (item) <= FLOWER_TULIP2)
#define IS_ITEM_ALIVE_TREE(item) \
(((item) >= TREE_SAPLING && (item) <= TREE_30000BELLS) || \
((item) >= TREE_100BELLS_SAPLING && (item) <= TREE_PALM_FRUIT) || \
((item) >= CEDAR_TREE_SAPLING && (item) <= CEDAR_TREE) || \
((item) >= GOLD_TREE_SAPLING && (item) <= GOLD_TREE) \
)
#define IS_ITEM_DEAD_SAPLING(item) \
(((item) == DEAD_SAPLING) || \
((item) == DEAD_PALM_SAPLING) || \
((item) == DEAD_CEDAR_SAPLING) || \
((item) == DEAD_GOLD_SAPLING) \
)
/*
#define IS_ITEM_TREE(item) \
(((item) >= TREE_SAPLING && (item) <= TREE_30000BELLS) || \
((item) >= TREE_100BELLS_SAPLING && (item) <= TREE_PALM_FRUIT) || \
@@ -81,6 +107,9 @@ extern int mNT_check_unknown(mActor_name_t item_no);
((item) == DEAD_CEDAR_SAPLING) || \
((item) == DEAD_GOLD_SAPLING) \
)
*/
#define IS_ITEM_TREE(item) (IS_ITEM_ALIVE_TREE(item) || IS_ITEM_DEAD_SAPLING(item))
#define IS_ITEM_GROWN_TREE(item) \
(((item) == TREE) || \
@@ -137,18 +166,30 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define KABU_NUM 4
#define EMPTY_NO 0x0000
#define TREE_STUMP001 (EMPTY_NO + 1)
#define TREE_STUMP002 (EMPTY_NO + 2)
#define TREE_STUMP003 (EMPTY_NO + 3)
#define TREE_STUMP004 (EMPTY_NO + 4)
#define FENCE0 (EMPTY_NO + 5)
#define FENCE1 (EMPTY_NO + 6)
#define MESSAGE_BOARD0 0x0007
#define GRASS_A 0x0008
#define GRASS_B (GRASS_A + 1)
#define GRASS_C (GRASS_B + 1)
#define MESSAGE_BOARD1 0x000B
#define MAP_BOARD0 0x000C
#define MAP_BOARD1 0x000D
#define MUSIC_BOARD0 0x000E
#define MUSIC_BOARD1 0x000F
#define BURIED_PITFALL0 0x002A
#define SHINE_SPOT 0x005C
#define TREE_BEES 0x005E
#define TREE_FTR (TREE_BEES + 1)
#define TREE_LIGHTS (TREE_FTR + 1)
#define TREE_PRESENT (TREE_LIGHTS + 1)
#define TREE_BELLS 0x0069
#define ROCK_A 0x0063
#define ROCK_B (ROCK_A + 1)
@@ -156,10 +197,35 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define ROCK_D (ROCK_C + 1)
#define ROCK_E (ROCK_D + 1)
#define FLOWER_SEED 0x0068
#define TREE_BELLS 0x0069
#define MONEY_ROCK_A 0x006A
#define MONEY_ROCK_B (MONEY_ROCK_A + 1)
#define MONEY_ROCK_C (MONEY_ROCK_B + 1)
#define MONEY_ROCK_D (MONEY_ROCK_C + 1)
#define MONEY_ROCK_E (MONEY_ROCK_D + 1)
#define MONEY_FLOWER_SEED 0x006F
#define TREE_PALM_STUMP001 (EMPTY_NO + 112)
#define TREE_PALM_STUMP002 (EMPTY_NO + 113)
#define TREE_PALM_STUMP003 (EMPTY_NO + 114)
#define TREE_PALM_STUMP004 (EMPTY_NO + 115)
#define CEDAR_TREE_STUMP001 (EMPTY_NO + 116)
#define CEDAR_TREE_STUMP002 (EMPTY_NO + 117)
#define CEDAR_TREE_STUMP003 (EMPTY_NO + 118)
#define CEDAR_TREE_STUMP004 (EMPTY_NO + 119)
#define CEDAR_TREE_BELLS 0x0078
#define CEDAR_TREE_FTR (CEDAR_TREE_BELLS + 1)
#define CEDAR_TREE_BEES (CEDAR_TREE_FTR + 1)
#define GOLD_TREE_STUMP001 (EMPTY_NO + 123)
#define GOLD_TREE_STUMP002 (EMPTY_NO + 124)
#define GOLD_TREE_STUMP003 (EMPTY_NO + 125)
#define GOLD_TREE_STUMP004 (EMPTY_NO + 126)
#define GOLD_TREE_BELLS 0x007F
#define GOLD_TREE_FTR (GOLD_TREE_BELLS + 1)
#define GOLD_TREE_BEES (GOLD_TREE_FTR + 1)
@@ -1036,7 +1102,7 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define WATERFALL_SOUTH (POLICE_STATION + 1)
#define WATERFALL_EAST (WATERFALL_SOUTH + 1)
#define WATERFALL_WEST (WATERFALL_EAST + 1)
#define SIGN00 (WATERFALL_WEST + 1)
#define SIGN00 (STRUCTURE_START + 16)
#define SIGN01 (SIGN00 + 1)
#define SIGN02 (SIGN01 + 1)
#define SIGN03 (SIGN02 + 1)
+1
View File
@@ -130,6 +130,7 @@ extern int mSP_GetShopLevel();
extern u32 mSP_ItemNo2ItemPrice(mActor_name_t item_no);
extern int mSP_SearchItemCategoryPriority(mActor_name_t item_no, int category, int priority, GAME* unused); // not sure if it's actually a GAME*
extern mActor_name_t mSP_RandomOneFossilSelect(int multi_fossil);
extern mActor_name_t mSP_RandomHaniwaSelect(mActor_name_t* item_buf, int num);
extern void mItemDebug_ItemDebugMain();
extern void mItemDebug_ItemDebugDraw(gfxprint_t* gfxprint);
+3
View File
@@ -22,6 +22,9 @@ typedef struct snowman_save_data_s {
/* 0x00 */ mSN_snowman_data_c snowmen_data[mSN_SAVE_COUNT];
} mSN_snowman_save_c;
extern int mSN_MeltSnowman(mActor_name_t* item, int past_days);
extern int mSN_ClearSnowman(mActor_name_t* item);
#ifdef __cplusplus
}
#endif
+3441
View File
File diff suppressed because it is too large Load Diff