Implement & link ac_set_manager

This commit is contained in:
Cuyler36
2023-05-16 21:13:49 -04:00
parent ccf81c3c8d
commit 2af13706e7
9 changed files with 469 additions and 1 deletions
+75
View File
@@ -0,0 +1,75 @@
#ifndef AC_SET_MANAGER_H
#define AC_SET_MANAGER_H
#include "types.h"
#include "m_actor.h"
#include "m_play.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct actor_set_manager_s SET_MANAGER;
#define aSetMgr_SET_OVERLAY_BUF_SIZE 0x4000
#define aSetMgr_KEEP_SIZE 0x354
#define aSetMgr_WAIT_TIME 5 // wait time between aSetMgr_move_check_wait -> aSetMgr_move_set
typedef void (*aSetMgr_ovl_proc)(SET_MANAGER*, GAME_PLAY*);
enum set_overlay_type {
aSetMgr_OVERLAY_BEGIN = 0,
aSetMgr_OVERLAY_INSECT = aSetMgr_OVERLAY_BEGIN,
aSetMgr_OVERLAY_GYOEI,
aSetMgr_OVERLAY_NUM
};
enum set_manager_move_proc_type {
aSetMgr_MOVE_move_check_set,
aSetMgr_MOVE_move_check_wait,
aSetMgr_MOVE_move_set,
aSetMgr_MOVE_PROC_NUM
};
/* sizeof(aSetMgr_keep_c) == 0x354 */
typedef struct actor_set_manager_keep_s {
/* 0x000 */ u8 unk[aSetMgr_KEEP_SIZE];
} aSetMgr_keep_c;
/* sizeof(aSetMgr_set_ovl_c) == 0x4004 */
typedef struct actor_set_manager_ovl_s {
/* 0x0000 */ u8 buf[aSetMgr_SET_OVERLAY_BUF_SIZE];
/* 0x4000 */ aSetMgr_ovl_proc ovl_proc;
} aSetMgr_set_ovl_c;
/* sizeof(aSetMgr_player_pos) == 0x18 */
typedef struct actor_set_manager_player_pos_s {
/* 0x00 */ int next_bx, next_bz;
/* 0x08 */ int now_bx, now_bz;
/* 0x10 */ int last_bx, last_bz;
} aSetMgr_player_pos_c;
/* sizeof(SET_MANAGER) == 0x44F0 */
struct actor_set_manager_s {
/* 0x0000 */ ACTOR actor_class;
/* 0x0174 */ u8 move_proc;
/* 0x0175 */ u8 next_move_proc;
/* 0x0176 */ u8 set_ovl_type;
/* 0x0178 */ aSetMgr_set_ovl_c set_overlay;
/* 0x417C */ int unk_417C;
/* 0x4180 */ aSetMgr_player_pos_c player_pos;
/* 0x4198 */ aSetMgr_keep_c keep;
/* 0x44EC */ s16 wait_timer;
};
extern ACTOR_PROFILE Set_Manager_Profile;
#ifdef __cplusplus
}
#endif
#endif
+17
View File
@@ -0,0 +1,17 @@
#ifndef AC_SET_OVL_GYOEI_H
#define AC_SET_OVL_GYOEI_H
#include "types.h"
#include "ac_set_manager.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void aSOG_gyoei_set(SET_MANAGER* set_manager, GAME_PLAY* play);
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef AC_SET_OVL_INSECT_H
#define AC_SET_OVL_INSECT_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void aSOI_insect_set(SET_MANAGER* set_manager, GAME_PLAY* play);
#ifdef __cplusplus
}
#endif
#endif
+22
View File
@@ -12,6 +12,26 @@ extern "C" {
typedef void (*mActor_proc)(ACTOR*, GAME*);
#define ACTOR_STATE_NO_MOVE_WHILE_CULLED (1 << 4)
#define ACTOR_STATE_NO_DRAW_WHILE_CULLED (1 << 5)
#define ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES (1 << 29)
#define ACTOR_OBJ_BANK_NONE 0
#define ACTOR_OBJ_BANK_3 3 /* TODO: rename, also likely an enum */
enum actor_part {
ACTOR_PART_FG,
ACTOR_PART_ITEM,
ACTOR_PART_PLAYER,
ACTOR_PART_NPC,
ACTOR_PART_4, /* TODO: figure this one out */
ACTOR_PART_BG,
ACTOR_PART_EFFECT,
ACTOR_PART_CONTROL,
ACTOR_PART_NUM
};
/* sizeof(ACTOR_PROFILE) == 0x24 */
typedef struct actor_profile_s {
/* 0x00 */ s16 id; /* unique actor type ID */
@@ -105,6 +125,8 @@ struct actor_s {
/* 0x170 */ void* dlftbl; /* display list function table */
};
#define mActor_NONE_PROC1 ((mActor_proc)none_proc1)
#ifdef __cplusplus
}
#endif
+10 -1
View File
@@ -45,6 +45,14 @@ enum field_room {
((field_id) == mFI_FIELD_PLAYER0_ROOM || (field_id) == mFI_FIELD_PLAYER1_ROOM || \
(field_id) == mFI_FIELD_PLAYER2_ROOM || (field_id) == mFI_FIELD_PLAYER3_ROOM)
/* "wade" between acres (acre transition) */
enum player_wade_state {
mFI_WADE_NONE,
mFI_WADE_START,
mFI_WADE_INPROGRESS,
mFI_WADE_END
};
/* Not sure about these other than the island one */
enum {
mFI_CLIMATE_0,
@@ -75,7 +83,8 @@ extern void mFI_GetSpecialBlockNum(int* block_pos_tbl, u32* kind_list, int kind_
extern int mFI_SetTreasure(int* block_x, int* block_z, mActor_name_t item_no);
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 void mFI_Wpos2BlockNum(int* block_x, int* block_z, xyz_t world_pos);
extern int mFI_Wpos2BlockNum(int* block_x, int* block_z, xyz_t world_pos);
extern int mFI_CheckPlayerWade(int wade_state);
extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint);
extern void mFI_PrintFgAttr(gfxprint_t* gfxprint);
+27
View File
@@ -0,0 +1,27 @@
#ifndef M_PLAYER_H
#define M_PLAYER_H
#include "types.h"
#include "m_actor.h"
#include "m_lib.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct player_actor_s PLAYER_ACTOR;
/* sizeof(struct player_actor_s) == 0x13A8 */
struct player_actor_s {
/* 0x0000 */ ACTOR actor_class;
/* 0x0174 */ u8 tmp0174[0x1318 - 0x0174];
/* 0x1318 */ int (*Get_WadeEndPos_proc)(GAME*, xyz_t*);
/* 0x131C */ u8 tmp131C[0x13A8 - 0x131C];
/* TODO: finish */
};
#ifdef __cplusplus
}
#endif
#endif
+17
View File
@@ -0,0 +1,17 @@
#ifndef M_PLAYER_LIB_H
#define M_PLAYER_LIB_H
#include "types.h"
#include "m_player.h"
#ifdef __cplusplus
extern "C" {
#endif
extern PLAYER_ACTOR* get_player_actor_withoutCheck(GAME_PLAY* play);
#ifdef __cplusplus
}
#endif
#endif