mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-22 22:24:16 -04:00
Implement & link ac_npc_sendo
This commit is contained in:
@@ -584,6 +584,11 @@ ac_npc_rtc.c:
|
||||
.text: [0x80573044, 0x80574134]
|
||||
.rodata: [0x80649A08, 0x80649A40]
|
||||
.data: [0x806BF648,0x806BF788]
|
||||
ac_npc_sendo.c:
|
||||
.text: [0x80574134, 0x80576468]
|
||||
.rodata: [0x80649A40, 0x80649A58]
|
||||
.data: [0x806BF788, 0x806BFA80]
|
||||
.bss: [0x8131B258, 0x8131B298]
|
||||
ac_ev_majin.c:
|
||||
.text: [0x80592A40, 0x80593158]
|
||||
.rodata: [0x80649D98,0x80649DA0]
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aBTD_LOADER_SIZE 0xC83C
|
||||
#define aBTD_PROGRAM_SIZE 0x15244
|
||||
|
||||
enum {
|
||||
aBTD_ACTION_SENDO_BIRTH_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_ON_START_WAIT,
|
||||
|
||||
+6
-3
@@ -159,7 +159,11 @@ typedef struct npc_draw_info_s {
|
||||
/* 0x548 */ u8 _548[0x580 - 0x548];
|
||||
/* 0x580 */ int animation_id;
|
||||
/* 0x584 */ int texture_bank_idx;
|
||||
/* 0x588 */ u8 _588[0x5BD - 0x588];
|
||||
/* 0x588 */ u8 _588[0x5B9 - 0x588];
|
||||
/* 0x5B9 */ u8 _5B9;
|
||||
/* 0x5BA */ u8 _5BA;
|
||||
/* 0x5BB */ u8 _5BB;
|
||||
/* 0x5BC */ u8 _5BC;
|
||||
/* 0x5BD */ u8 _5BD;
|
||||
/* 0x5BE */ u8 _5BE;
|
||||
/* 0x5BE */ u8 _5BF[0x630 - 0x5BF];
|
||||
@@ -386,8 +390,7 @@ typedef void (*aNPC_SUB_PROC)(NPC_ACTOR* npc_actorx, GAME_PLAY* play);
|
||||
|
||||
struct npc_actor_s {
|
||||
ACTOR actor_class;
|
||||
int _174;
|
||||
int _178;
|
||||
s_xyz _174;
|
||||
NpcActorInfo_c npc_info;
|
||||
aNPC_draw_info_c draw;
|
||||
aNPC_think_info_c think;
|
||||
|
||||
+12
-1
@@ -11,9 +11,20 @@ extern "C" {
|
||||
|
||||
typedef struct npc_sendo_s NPC_SENDO_ACTOR;
|
||||
|
||||
typedef void (*aSEN_PROC)(NPC_SENDO_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct npc_sendo_s {
|
||||
NPC_ACTOR npc_class;
|
||||
// TODO
|
||||
u8 action;
|
||||
u8 next_action;
|
||||
u8 use_island_data_in_ram;
|
||||
u8 agb_trans_se;
|
||||
aSEN_PROC action_proc;
|
||||
int talk_action;
|
||||
aSEN_PROC talk_proc;
|
||||
u16 kappa_counter;
|
||||
f32 anime_progress; // only loaded, never set?
|
||||
int gba_comm_tries;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Npc_Sendo_Profile;
|
||||
|
||||
+34
-1
@@ -31,6 +31,39 @@ enum {
|
||||
mISL_ISLAND_BLOCK_NUM
|
||||
};
|
||||
|
||||
#define mISL_PLAYER_ACTION_DIG_SCOOP (1 << 0)
|
||||
#define mISL_PLAYER_ACTION_PLANT_FLOWER (1 << 1)
|
||||
#define mISL_PLAYER_ACTION_CHANGE_FLAG (1 << 2)
|
||||
#define mISL_PLAYER_ACTION_SHAKE_TREE (1 << 3)
|
||||
#define mISL_PLAYER_ACTION_TRAMPLE_FLOWER (1 << 4)
|
||||
#define mISL_PLAYER_ACTION_TRAMPLE_ALL_FLOWERS (1 << 5) // seems to be incorrectly? set when only a single flower was trampled
|
||||
#define mISL_PLAYER_ACTION_CHOP_PALM_TREE (1 << 6)
|
||||
#define mISL_PLAYER_ACTION_CHOP_TREE (1 << 7)
|
||||
#define mISL_PLAYER_ACTION_PLANT_TREE (1 << 8)
|
||||
#define mISL_PLAYER_ACTION_UZAI_PUSHED (1 << 9)
|
||||
#define mISL_PLAYER_ACTION_UZAI_HIT (1 << 10)
|
||||
#define mISL_PLAYER_ACTION_BEST_FRIEND (1 << 11) // seemingly unused but based on intention from dialogue
|
||||
#define mISL_PLAYER_ACTION_UZAI_HIT_NET (1 << 12) // set at the same time as "UZAI_HIT"
|
||||
#define mISL_PLAYER_ACTION_FALL_PITFALL (1 << 13)
|
||||
#define mISL_PLAYER_ACTION_PLANT_APPLE_TREE (1 << 14)
|
||||
#define mISL_PLAYER_ACTION_PLANT_PEACH_TREE (1 << 15)
|
||||
#define mISL_PLAYER_ACTION_PLANT_CHERRY_TREE (1 << 16)
|
||||
#define mISL_PLAYER_ACTION_PLANT_PEAR_TREE (1 << 17)
|
||||
#define mISL_PLAYER_ACTION_PLANT_ORANGE_TREE (1 << 18)
|
||||
#define mISL_PLAYER_ACTION_PLANT_COCONUT_TREE (1 << 19)
|
||||
#define mISL_PLAYER_ACTION_PICKUP_COCONUT (1 << 20)
|
||||
#define mISL_PLAYER_ACTION_EAT_COCONUT (1 << 21)
|
||||
#define mISL_PLAYER_ACTION_TUMBLE (1 << 22)
|
||||
#define mISL_PLAYER_ACTION_DESTINY_POPULAR (1 << 23)
|
||||
#define mISL_PLAYER_ACTION_DESTINY_UNPOPULAR (1 << 24)
|
||||
#define mISL_PLAYER_ACTION_DESTINY_BAD_LUCK (1 << 25)
|
||||
#define mISL_PLAYER_ACTION_DESTINY_MONEY_LUCK (1 << 26)
|
||||
#define mISL_PLAYER_ACTION_DESTINY_GOODS_LUCK (1 << 27)
|
||||
#define mISL_PLAYER_ACTION_SEX_MALE (1 << 28)
|
||||
#define mISL_PLAYER_ACTION_SEX_FEMALE (1 << 29)
|
||||
#define mISL_PLAYER_ACTION_TRADE_CLOTH (1 << 30)
|
||||
#define mISL_PLAYER_ACTION_NOTICE_FISHING_ROD (1 << 31)
|
||||
|
||||
/* sizeof(Island_c) == 0x1900 */
|
||||
typedef struct island_s {
|
||||
/* 0x0000 */ u8 name[mISL_ISLAND_NAME_LEN]; /* island name */
|
||||
@@ -162,7 +195,7 @@ typedef struct island_agb_s {
|
||||
/* 0x0008 */ u8 name[mISL_ISLAND_NAME_LEN]; /* island name */
|
||||
/* 0x0010 */ u8 grass_tex_type; /* grass type */
|
||||
/* 0x0011 */ u8 _0011[2];
|
||||
/* 0x0013 */ u8 _0013;
|
||||
/* 0x0013 */ u8 in_use; /* Set on the GBA when the island has been transferred already */
|
||||
/* 0x0014 */ mISL_landinfo_agb_c landinfo; /* land info for town */
|
||||
/* 0x0020 */ u8 _0020[4];
|
||||
/* 0x0024 */ mFM_fg_c fgblock[mISL_FG_BLOCK_Z_NUM][mISL_FG_BLOCK_X_NUM]; /* island item actor data */
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef M_LEDIT_OVL_H
|
||||
#define M_LEDIT_OVL_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
mLE_TYPE_PLAYER_NAME,
|
||||
mLE_TYPE_COUNTRY_NAME,
|
||||
mLE_TYPE_EPHRASE,
|
||||
mLE_TYPE_RESET,
|
||||
mLE_TYPE_REQUEST,
|
||||
mLE_TYPE_MYORIGINAL_NAME,
|
||||
mLE_TYPE_ISLAND_NAME,
|
||||
|
||||
mLE_TYPE_NUM
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -150,7 +150,7 @@ struct submenu_s {
|
||||
/* 0x034 */ SUBMENU_GAME_PROC draw_proc;
|
||||
|
||||
/* 0x038 */ Mail_c mail; /* selected mail */
|
||||
/* 0x162 */ u8 flag; // only set to 0 or 1, checked at least once in aQMgr_actor_move_talk_sub_hand_item_wait
|
||||
/* 0x162 */ u8 open_flag; // only set to 0 or 1, checked at least once in aQMgr_actor_move_talk_sub_hand_item_wait
|
||||
/* 0x163 */ u8 after_mode; /* relates to code which runs after the submenu process */
|
||||
/* 0x164 */ u8 unk_164; // only set to 0 in mSM_move_LINKWait in AC
|
||||
/* 0x165 */ u8 disable_start_btn_flag; /* when set to TRUE, the START button input will be ignored */
|
||||
|
||||
@@ -384,7 +384,7 @@ static void aHNW_menu_end_wait(ACTOR* actor, GAME* game) {
|
||||
Submenu* submenu = &play->submenu;
|
||||
Submenu_Item_c* item;
|
||||
|
||||
if (submenu->flag == FALSE) {
|
||||
if (submenu->open_flag == FALSE) {
|
||||
if (mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == TRUE) {
|
||||
aHNW_setupAction(actor, game, aHNW_ACTION_TALK_WITH_MASTER);
|
||||
switch (haniwa->submenu_type) {
|
||||
@@ -458,7 +458,7 @@ static void aHNW_menu_end_wait_for_guest(ACTOR* actor, GAME* game) {
|
||||
HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (play->submenu.flag == FALSE && mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == TRUE) {
|
||||
if (play->submenu.open_flag == FALSE && mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == TRUE) {
|
||||
aHNW_setupAction(actor, game, aHNW_ACTION_TALK_END_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ static void aCR_msg_win_close_wait(NPC_CURATOR_ACTOR* curator, GAME_PLAY* play)
|
||||
static void aCR_menu_close_wait(NPC_CURATOR_ACTOR* curator, GAME_PLAY* play) {
|
||||
int talk_act;
|
||||
|
||||
if (play->submenu.flag == FALSE) {
|
||||
if (play->submenu.open_flag == FALSE) {
|
||||
talk_act = aCR_TALK_GET_DEMO_START_WAIT;
|
||||
|
||||
if (play->submenu.item_p->item == EMPTY_NO) {
|
||||
|
||||
@@ -48,7 +48,7 @@ void aNRTC_timer_open_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play){
|
||||
|
||||
|
||||
void aNRTC_timer_close_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
if (play->submenu.flag == 0) {
|
||||
if (play->submenu.open_flag == FALSE) {
|
||||
if (mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == 1) {
|
||||
mMsg_Set_ForceNext(mMsg_Get_base_window_p());
|
||||
rtc->unk9A8 = 2;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
#include "ac_npc_sendo.h"
|
||||
|
||||
#include "m_common_data.h"
|
||||
#include "ac_boat_demo.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_msg.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "GBA2/gba2.h"
|
||||
#include "m_ledit_ovl.h"
|
||||
|
||||
static void aSEN_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aSEN_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aSEN_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aSEN_actor_move(ACTOR* actorx, GAME* game);
|
||||
static void aSEN_actor_draw(ACTOR* actorx, GAME* game);
|
||||
static void aSEN_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Npc_Sendo_Profile = {
|
||||
mAc_PROFILE_NPC_SENDO,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
SP_NPC_SENDO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_SENDO_ACTOR),
|
||||
&aSEN_actor_ct,
|
||||
&aSEN_actor_dt,
|
||||
&aSEN_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aSEN_actor_save
|
||||
};
|
||||
|
||||
static int aSEN_talk_init(ACTOR*, GAME*);
|
||||
static int aSEN_talk_end_chk(ACTOR*, GAME*);
|
||||
|
||||
static void aSEN_schedule_proc(NPC_ACTOR*, GAME_PLAY*, int);
|
||||
static void aSEN_setup_think_proc(NPC_SENDO_ACTOR*, GAME_PLAY*, u8);
|
||||
|
||||
static MtxF aSEN_matrix;
|
||||
|
||||
static void aSEN_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aSEN_actor_move,
|
||||
&aSEN_actor_draw,
|
||||
5,
|
||||
(aNPC_TALK_REQUEST_PROC)&none_proc1,
|
||||
&aSEN_talk_init,
|
||||
&aSEN_talk_end_chk,
|
||||
0
|
||||
};
|
||||
|
||||
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
|
||||
NPC_ACTOR* npc_actor = (NPC_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
npc_actor->schedule.schedule_proc = &aSEN_schedule_proc;
|
||||
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void aSEN_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aSEN_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
NPC_SENDO_ACTOR* sendo = (NPC_SENDO_ACTOR*)actorx;
|
||||
BOAT_DEMO_ACTOR* boat_demo;
|
||||
|
||||
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
|
||||
|
||||
boat_demo = (BOAT_DEMO_ACTOR*)actorx->parent_actor;
|
||||
if (boat_demo != NULL && boat_demo->npc_sendo_actor == sendo) {
|
||||
boat_demo->npc_sendo_actor = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void aSEN_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aSEN_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
Matrix_put(&aSEN_matrix);
|
||||
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
|
||||
}
|
||||
|
||||
#include "../src/ac_npc_sendo_move.c_inc"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -275,7 +275,7 @@ static void aSHR_talk_gomen(SHRINE_ACTOR* shrine, GAME_PLAY* play) {
|
||||
{
|
||||
u8 item_name[mIN_ITEM_NAME_LEN];
|
||||
Submenu_Item_c* sm_item;
|
||||
if (submenu->flag) {
|
||||
if (submenu->open_flag) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -741,7 +741,7 @@ extern void mISL_gc_to_agb(Island_agb_c* agb, Island_c* gc) {
|
||||
|
||||
if (agb != NULL) {
|
||||
bcopy(gc->name, agb->name, mISL_ISLAND_NAME_LEN);
|
||||
agb->_0013 = 0;
|
||||
agb->in_use = FALSE;
|
||||
mISL_gc_to_agb_iandinfo(&agb->landinfo, &gc->landinfo);
|
||||
mISL_gc_to_agb_fgblock(agb->fgblock[0], gc->fgblock[0]);
|
||||
mISL_gc_to_agb_cottage(&agb->cottage, &gc->cottage);
|
||||
|
||||
+2
-2
@@ -353,7 +353,7 @@ static void mSM_move_LINKWait(Submenu* submenu) {
|
||||
submenu->move_proc = (SUBMENU_PROC)mSM_ovlptr_dllcnv(&mSM_menu_ovl_init, submenu, mSM_DLF_SUBMENU_OVL);
|
||||
submenu->draw_proc = (SUBMENU_GAME_PROC)&none_proc1;
|
||||
submenu->process_status = mSM_PROCESS_PLAY;
|
||||
submenu->flag = TRUE;
|
||||
submenu->open_flag = TRUE;
|
||||
submenu->after_mode = 7;
|
||||
submenu->unk_164 = 0;
|
||||
mMl_clear_mail(&submenu->mail);
|
||||
@@ -395,7 +395,7 @@ static void mSM_move_End(Submenu* submenu) {
|
||||
submenu->process_status = mSM_PROCESS_WAIT;
|
||||
submenu->menu_type = mSM_OVL_NONE;
|
||||
submenu->wait_timer = 2;
|
||||
submenu->flag = FALSE;
|
||||
submenu->open_flag = FALSE;
|
||||
SetGameFrame(1);
|
||||
|
||||
if (submenu->mode != 4) {
|
||||
|
||||
Reference in New Issue
Block a user