Merge pull request #34 from Cuyler36/ac_set_ovl_gyoei

Implement & link ac_set_ovl_gyoei
This commit is contained in:
Prakxo
2023-05-19 21:39:44 +02:00
committed by GitHub
14 changed files with 2473 additions and 10 deletions
+5
View File
@@ -100,6 +100,11 @@ ac_set_manager.c:
.text: [0x80496AB8, 0x80496F50]
.rodata: [0x80644DB8, 0x80644DC8]
.data: [0x8068BBE0, 0x8068BC18]
ac_set_ovl_gyoei.c:
.text: [0x804995D4, 0x8049A9E4]
.rodata: [0x80644DD0, 0x80644E00]
.data: [0x8068BCF0, 0x8068CDE8]
.bss: [0x812FCD00, 0x812FD048]
m_huusui_room_ovl.c:
.text: [0x804D1BBC, 0x804D2164]
.rodata: [0x80646558, 0x806465C8]
+42
View File
@@ -0,0 +1,42 @@
#ifndef AC_GYOEI_H_H
#define AC_GYOEI_H_H
#include "types.h"
#include "game.h"
#include "m_lib.h"
#ifdef __cplusplus
extern "C" {
#endif
/* sizeof(aGYO_Init_c) == 0x18 */
typedef struct gyoei_init_s {
/* 0x00 */ int fish_type;
/* 0x04 */ xyz_t position;
/* 0x10 */ int extra_data;
/* 0x14 */ GAME* game;
} aGYO_Init_c;
typedef int (*aGYO_make_proc)(aGYO_Init_c*);
typedef void (*aGYO_dt_proc)(ACTOR*, GAME*);
typedef void (*aGYO_ballcheck_proc)(xyz_t*, s16);
typedef void (*aGYO_hitcheck_proc)(xyz_t*, s16);
typedef int (*aGYO_chk_live_proc)(int, int, GAME*);
typedef int (*aGYO_search_near_proc)(f32, f32);
/* sizeof(aGYO_Clip_c) == 0x1C */
typedef struct ac_gyoei_clip_s {
/* 0x00 */ aGYO_make_proc make_gyoei_proc;
/* 0x04 */ int unused_04; // unused clip proc in AC
/* 0x08 */ aGYO_dt_proc dt_gyoei_proc;
/* 0x0C */ aGYO_ballcheck_proc ballcheck_gyoei_proc;
/* 0x10 */ aGYO_hitcheck_proc hitcheck_gyoei_proc;
/* 0x14 */ aGYO_chk_live_proc chk_live_gyoei_proc;
/* 0x18 */ aGYO_search_near_proc search_near_gyoei_proc;
} aGYO_Clip_c;
#ifdef __cplusplus
}
#endif
#endif
+18 -3
View File
@@ -16,7 +16,21 @@ typedef struct actor_set_manager_s SET_MANAGER;
#define aSetMgr_WAIT_TIME 5 // wait time between aSetMgr_move_check_wait -> aSetMgr_move_set
typedef void (*aSetMgr_ovl_proc)(SET_MANAGER*, GAME_PLAY*);
#define aSetMgr_GYOEI_NUM 40
/* sizeof(aSOG_gyoei_spawn_info_weight_f_c) == 8 */
typedef struct gyoei_spawn_info_weight_f_s {
/* 0x00 */ s16 type;
/* 0x02 */ u8 spawn_area;
/* 0x04 */ f32 spawn_weight;
} aSOG_gyoei_spawn_info_weight_f_c;
typedef struct gyoei_keep_s {
/* 0x000 */ aSOG_gyoei_spawn_info_weight_f_c spawn_weights[aSetMgr_GYOEI_NUM];
/* 0x140 */ int possible_gyoei_num;
} aSOG_gyoei_keep_c;
typedef int (*aSetMgr_ovl_proc)(SET_MANAGER*, GAME_PLAY*);
enum set_overlay_type {
aSetMgr_OVERLAY_BEGIN = 0,
@@ -37,7 +51,8 @@ enum set_manager_move_proc_type {
/* sizeof(aSetMgr_keep_c) == 0x354 */
typedef struct actor_set_manager_keep_s {
/* 0x000 */ u8 unk[aSetMgr_KEEP_SIZE];
/* 0x000 */ u8 unk[0x210];
/* 0x210 */ aSOG_gyoei_keep_c gyoei_keep;
} aSetMgr_keep_c;
/* sizeof(aSetMgr_set_ovl_c) == 0x4004 */
@@ -48,7 +63,7 @@ typedef struct actor_set_manager_ovl_s {
/* sizeof(aSetMgr_player_pos) == 0x18 */
typedef struct actor_set_manager_player_pos_s {
/* 0x00 */ int next_bx, next_bz;
/* 0x00 */ int next_bx, next_bz; // TODO: there's a good chance these are structs
/* 0x08 */ int now_bx, now_bz;
/* 0x10 */ int last_bx, last_bz;
} aSetMgr_player_pos_c;
+105 -1
View File
@@ -8,7 +8,111 @@
extern "C" {
#endif
extern void aSOG_gyoei_set(SET_MANAGER* set_manager, GAME_PLAY* play);
#define aSOG_TERM_TRANSITION_MAX_DAYS 5
enum fish_spawn_area {
aSOG_SPAWN_AREA_POOL, /* river pool */
aSOG_SPAWN_AREA_WATERFALL,
aSOG_SPAWN_AREA_RIVER_MOUTH,
aSOG_SPAWN_AREA_OFFING, /* aka 'deep sea' */
aSOG_SPAWN_AREA_SEA,
aSOG_SPAWN_AREA_RIVER,
aSOG_SPAWN_AREA_POND,
aSOG_SPAWN_AREA_NUM
};
#define aSOG_FISH_TYPE_INVALID -1
/* TODO: should we use the internal names for fish? */
enum fish_type {
aSOG_FISH_TYPE_CRUCIAN_CARP,
aSOG_FISH_TYPE_BROOK_TROUT,
aSOG_FISH_TYPE_CARP,
aSOG_FISH_TYPE_KOI,
aSOG_FISH_TYPE_CATFISH,
aSOG_FISH_TYPE_SMALL_BASS,
aSOG_FISH_TYPE_BASS,
aSOG_FISH_TYPE_LARGE_BASS,
aSOG_FISH_TYPE_BLUEGILL,
aSOG_FISH_TYPE_GIANT_CATFISH,
aSOG_FISH_TYPE_GIANT_SNAKEHEAD,
aSOG_FISH_TYPE_BARBEL_STEED,
aSOG_FISH_TYPE_DACE,
aSOG_FISH_TYPE_PALE_CHUB,
aSOG_FISH_TYPE_BITTERLING,
aSOG_FISH_TYPE_LOACH,
aSOG_FISH_TYPE_POND_SMELT,
aSOG_FISH_TYPE_SWEETFISH,
aSOG_FISH_TYPE_CHERRY_SALMON,
aSOG_FISH_TYPE_LARGE_CHAR,
aSOG_FISH_TYPE_RAINBOW_TROUT,
aSOG_FISH_TYPE_STRINGFISH,
aSOG_FISH_TYPE_SALMON,
aSOG_FISH_TYPE_GOLDFISH,
aSOG_FISH_TYPE_PIRANHA,
aSOG_FISH_TYPE_AROWANA,
aSOG_FISH_TYPE_EEL,
aSOG_FISH_TYPE_FRESHWATER_GOBY,
aSOG_FISH_TYPE_ANGELFISH,
aSOG_FISH_TYPE_GUPPY,
aSOG_FISH_TYPE_POPEYED_GOLDFISH,
aSOG_FISH_TYPE_COELACANTH,
aSOG_FISH_TYPE_CRAWFISH,
aSOG_FISH_TYPE_FROG,
aSOG_FISH_TYPE_KILLIFISH,
aSOG_FISH_TYPE_JELLYFISH,
aSOG_FISH_TYPE_SEA_BASS,
aSOG_FISH_TYPE_RED_SNAPPER,
aSOG_FISH_TYPE_BARRED_KNIFEJAW,
aSOG_FISH_TYPE_ARAPAIMA,
aSOG_FISH_TYPE_NUM,
/* non-fish fish */
aSOG_FISH_TYPE_WHALE = aSOG_FISH_TYPE_NUM,
aSOG_FISH_TYPE_EMPTY_CAN,
aSOG_FISH_TYPE_BOOT,
aSOG_FISH_TYPE_OLD_TIRE,
aSOG_FISH_TYPE_SALMON2,
aSOG_FISH_TYPE_EXTENDED_NUM
};
#define aSOG_TIME_NO_0_END 3 /* 9pm-3:59am */
#define aSOG_TIME_NO_1_END 8 /* 4am-8:59am */
#define aSOG_TIME_NO_2_END 12 + 3 /* 9am-3:59pm */
#define aSOG_TIME_NO_3_END 12 + 8 /* 4pm-8:59pm */
/* number of terms in a given month */
enum fish_term {
aSOG_TERM_0,
aSOG_TERM_1,
aSOG_TERM_NUM
};
enum time_no {
aSOG_TIME_0,
aSOG_TIME_1,
aSOG_TIME_2,
aSOG_TIME_3,
aSOG_TIME_NUM
};
enum range_proc {
aSOG_RANGE_PROC_RIVER,
aSOG_RANGE_PROC_SEA,
aSOG_RANGE_PROC_OFFING,
aSOG_RANGE_PROC_POOL,
aSOG_RANGE_PROC_FISHING_EVENT,
aSOG_RANGE_PROC_ISLAND,
aSOG_RANGE_PROC_NUM
};
extern int aSOG_gyoei_set(SET_MANAGER* set_manager, GAME_PLAY* play);
#ifdef __cplusplus
}
+1 -1
View File
@@ -7,7 +7,7 @@
extern "C" {
#endif
extern void aSOI_insect_set(SET_MANAGER* set_manager, GAME_PLAY* play);
extern int aSOI_insect_set(SET_MANAGER* set_manager, GAME_PLAY* play);
#ifdef __cplusplus
}
+22
View File
@@ -0,0 +1,22 @@
#ifndef M_CLIP_H
#define M_CLIP_H
#include "types.h"
#include "ac_gyoei_h.h"
#ifdef __cplusplus
extern "C" {
#endif
/* sizeof(Clip_c) == 0x104 */
typedef struct clip_s {
/* 0x000 */ void* _000[(0x0AC - 0x000) / sizeof(void*)];
/* 0x0AC */ aGYO_Clip_c* gyo_clip;
/* 0x0B0 */ void* _0B0[(0x104 - 0x0B0) / sizeof(void*)];
} Clip_c;
#ifdef __cplusplus
}
#endif
#endif
+50
View File
@@ -0,0 +1,50 @@
#ifndef M_COLLISION_BG_H
#define M_COLLISION_BG_H
#include "types.h"
#include "m_lib.h"
#ifdef __cplusplus
extern "C" {
#endif
enum background_attribute {
/* TODO: finish */
mCoBG_ATTRIBUTE_WAVE = 11,
mCoBG_ATTRIBUTE_WATERFALL = 13,
mCoBG_ATTRIBUTE_SEA = 24
};
/* sizeof(mCoBG_CollisionData_c) == 4*/
typedef struct collision_bg_data_s {
/* 1------- -------- -------- -------- */ u32 shape:1; /* collision shape */
/* -11111-- -------- -------- -------- */ u32 center:5;
/* ------11 111----- -------- -------- */ u32 top_left:5;
/* -------- ---11111 -------- -------- */ u32 bot_left:5;
/* -------- -------- 11111--- -------- */ u32 top_right:5;
/* -------- -------- -----111 11------ */ u32 bot_right:5;
/* -------- -------- -------- --111111 */ u32 unit_attribute:6; /* background_attribute type */
} mCoBG_CollisionData_c;
/* sizeof (mCoBG_Collision_u) == 4 */
typedef union collision_bg_u {
u32 raw;
mCoBG_CollisionData_c data;
} mCoBG_Collision_u;
extern u32 mCoBG_Wpos2BgAttribute_Original(xyz_t wpos);
extern u32 mCoBG_Wpos2Attribute(xyz_t wpos, char* is_diggable);
extern int mCoBG_CheckWaterAttribute(u32 attribute);
extern f32 mCoBG_GetBgY_AngleS_FromWpos(s_xyz* angle_to_ground, xyz_t wpos, f32 offset);
extern int mCoBG_CheckWaterAttribute_OutOfSea(u32 attribute);
extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line);
#define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__)
extern int mCoBG_CheckSandUt_ForFish(xyz_t* wpos);
#ifdef __cplusplus
}
#endif
#endif
+7 -2
View File
@@ -23,6 +23,7 @@
#include "m_lib.h"
#include "m_field_assessment.h"
#include "m_mushroom.h"
#include "m_clip.h"
#ifdef __cplusplus
extern "C" {
@@ -119,7 +120,11 @@ typedef struct Save_s {
/* 0x022540 */ Island_c island; /* island data */
/* 0x023E40 */ u8 _tmp9[0x320];
/* 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[0x24178 - 0x2416C];
/* 0x02416C */ u8 _tmp10[0x24174 - 0x2416C];
/* 0x024174 */ u8 insect_term; /* current insect term idx */
/* 0x024175 */ u8 insect_term_transition_offset; /* days offset from end of term to begin transition */
/* 0x024176 */ u8 gyoei_term; /* current fish term idx */
/* 0x024177 */ u8 gyoei_term_transition_offset; /* days offset from end of term to begin transition */
/* 0x024178 */ mFAs_GoodField_c good_field; /* field assessment last info */
/* 0x024184 */ u8 _tmp11[0x241A0 - 0x24184];
/* 0x0241A0 */ lbRTC_time_c saved_auto_nwrite_time; /* save data notice time used for fishing tourney results? */
@@ -140,7 +145,7 @@ typedef struct common_data_s {
/* 0x026003 */ u8 player_no;
/* 0x026004 */ int last_scene_no;
/* 0x026008 */ int player_data_mode;
/* 0x02600C */ u8 _clip[0x104]; /* Temporary, clip is a struct with size 0x104 */
/* 0x02600C */ Clip_c clip;
/* 0x026110 */ Time_c time;
/* 0x02613C */ Private_c* now_private;
/* 0x026140 */ mHm_hs_c* now_home;
+3 -1
View File
@@ -109,7 +109,9 @@ enum week_type {
};
enum event_table {
mEv_EVENT_MUSHROOM_SEASON = 47
mEv_EVENT_FISHING_TOURNEY_1 = 29,
mEv_EVENT_MUSHROOM_SEASON = 47,
mEv_EVENT_FISHING_TOURNEY_2 = 54,
};
#define mEv_STATUS_ACTIVE (1 << 0) /* event is active */
+6
View File
@@ -47,6 +47,12 @@ typedef struct good_field_s {
/* 0x08 */ int perfect_day_streak; /* number of days in a row the town is "perfect" */
} mFAs_GoodField_c;
extern void mFAs_ClearGoodField();
extern int mFAs_CheckGoodField();
extern int mFAs_GetFieldRank_Condition(int* rank, int* block_x, int* block_z);
extern void mFAs_SetFieldRank();
extern int mFAs_GetFieldRank();
extern void mFAs_PrintFieldAssessment(gfxprint_t* gfxprint);
#ifdef __cplusplus
+12
View File
@@ -4,12 +4,20 @@
#include "types.h"
#include "libu64/gfxprint.h"
#include "m_lib.h"
#include "m_collision_bg.h"
#ifdef __cplusplus
extern "C" {
#endif
/* acre unit world size */
#define mFI_UT_WORLDSIZE_X 40
#define mFI_UT_WORLDSIZE_Z 40
#define mFI_UT_WORLDSIZE_X_F ((f32)mFI_UT_WORLDSIZE_X)
#define mFI_UT_WORLDSIZE_Z_F ((f32)mFI_UT_WORLDSIZE_Z)
#define mFI_ROW_TO_CHARSTR(row) ((row) + 'A')
#define mFI_COL_TO_CHARSTR(col) ((col) + '0')
@@ -85,6 +93,10 @@ extern void mFI_SetFGUpData();
extern int mFI_ClearBlockItemRandom_common(mActor_name_t item_no, int count, mActor_name_t* fg_items, u16* deposit, int include_deposited);
extern int mFI_Wpos2BlockNum(int* block_x, int* block_z, xyz_t world_pos);
extern int mFI_CheckPlayerWade(int wade_state);
extern void mFI_BkandUtNum2Wpos(xyz_t* wpos_p, int block_x, int block_z, int ut_x, int ut_z);
extern void mFI_BkandUtNum2CenterWpos(xyz_t* wpos_p, int block_x, int block_z, int ut_x, int ut_z);
extern mCoBG_Collision_u* mFI_GetBkNum2ColTop(int block_x, int block_z);
extern u32 mFI_BkNum2BlockKind(int block_x, int block_z);
extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint);
extern void mFI_PrintFgAttr(gfxprint_t* gfxprint);
+26
View File
@@ -0,0 +1,26 @@
#ifndef M_KANKYO_H
#define M_KANKYO_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
enum weather {
mEv_WEATHER_CLEAR,
mEv_WEATHER_RAIN,
mEv_WEATHER_SNOW,
mEv_WEATHER_SAKURA,
mEv_WEATHER_LEAVES,
mEv_WEATHER_NUM
};
extern int mEnv_NowWeather();
#ifdef __cplusplus
}
#endif
#endif
+2 -2
View File
@@ -19,7 +19,7 @@ extern "C" {
#define mRF_BLOCKKIND_WATERFALL (1 << 8)
#define mRF_BLOCKKIND_BRIDGE (1 << 9)
#define mRF_BLOCKKIND_RAILROAD (1 << 10)
#define mRF_BLOCKKIND_BEACH (1 << 11)
#define mRF_BLOCKKIND_MARINE (1 << 11)
#define mRF_BLOCKKIND_BORDER (1 << 12)
#define mRF_BLOCKKIND_TUNNEL (1 << 13)
#define mRF_BLOCKKIND_SLOPE (1 << 14)
@@ -29,7 +29,7 @@ extern "C" {
#define mRF_BLOCKKIND_18 (1 << 18)
#define mRF_BLOCKKIND_TAILORS (1 << 19)
#define mRF_BLOCKKIND_OCEAN (1 << 20)
#define mRF_BLOCKKIND_ISLAND_RIGHT (1 << 21)
#define mRF_BLOCKKIND_ISLAND (1 << 21)
#define mRF_BLOCKKIND_OFFING (1 << 22)
#define mRF_BLOCKKIND_23 (1 << 23)
#define mRF_BLOCKKIND_24 (1 << 24)
File diff suppressed because it is too large Load Diff