mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link m_demo.c
This commit is contained in:
@@ -74,6 +74,11 @@ m_debug_mode.c:
|
||||
.rodata: [0x80641D90, 0x80641DA8]
|
||||
.data: [0x80651358, 0x80651788]
|
||||
.bss: [0x81294010, 0x81294E18]
|
||||
m_demo.c:
|
||||
.text: [0x803984B4, 0x8039A540]
|
||||
.rodata: [0x80641DA8, 0x80641F00]
|
||||
.data: [0x80651788, 0x80651918]
|
||||
.bss: [0x81294E18, 0x81295150]
|
||||
m_eappli.c:
|
||||
.text: [0x8039A5E0, 0x8039A960]
|
||||
.bss: [0x81295150, 0x81295550]
|
||||
|
||||
@@ -11,6 +11,9 @@ extern "C" {
|
||||
#define PI 3.14159265358979323846
|
||||
#define F_PI ((f32)PI)
|
||||
|
||||
#define SQRT2 (1.4142135623730950488016887242097)
|
||||
#define F_SQRT2 ((f32)SQRT2)
|
||||
|
||||
#define SQRTF(f) (__frsqrte(f))
|
||||
|
||||
extern double sin(double deg);
|
||||
|
||||
@@ -33,6 +33,7 @@ typedef void (*mActor_proc)(ACTOR*, GAME*);
|
||||
#define ACTOR_STATE_25 (1 << 25)
|
||||
#define ACTOR_STATE_26 (1 << 26)
|
||||
#define ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES (1 << 29)
|
||||
#define ACTOR_STATE_IN_DEMO (1 << 30)
|
||||
|
||||
|
||||
//TODO: Name the unique ones for their correspondant actor
|
||||
|
||||
@@ -18,6 +18,9 @@ extern void mBGMPsComp_museum_status(int museum_status);
|
||||
extern void mBGMPsComp_make_ps_quietField(u16 stop_type);
|
||||
extern void mBGMPsComp_delete_ps_quietField();
|
||||
extern void mBGMPsComp_make_ps_co_quiet(u16 stop_type, s16 frames);
|
||||
extern void mBGMPsComp_volume_talk_start();
|
||||
extern void mBGMPsComp_volume_talk_end();
|
||||
extern void mBGMForce_inform_end();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "m_all_grow.h"
|
||||
#include "m_fishrecord.h"
|
||||
#include "m_card.h"
|
||||
#include "m_demo.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -223,7 +224,8 @@ typedef struct common_data_s {
|
||||
/* 0x02852E */ s16 goods_power;
|
||||
/* 0x028530 */ Door_data_c door_data; /* misc door data */
|
||||
/* 0x028544 */ Door_data_c structure_exit_door_data; /* door data for when exiting a building */
|
||||
/* 0x028558 */ u8 _28558[0x02857C - 0x028558];
|
||||
/* 0x028558 */ mDemo_Request_c start_demo_request;
|
||||
/* 0x028568 */ Door_data_c event_door_data;
|
||||
/* 0x02857C */ Door_data_c famicom_emu_exit_door_data;
|
||||
/* 0x028590 */ u8 remove_cut_tree_info_bitfield; /* resets the cut tree states for trees in a visible acre */
|
||||
/* 0x028591 */ u8 floor_idx;
|
||||
@@ -234,7 +236,7 @@ typedef struct common_data_s {
|
||||
/* 0x0285C0 */ s8 player_decoy_flag;
|
||||
/* 0x0285C1 */ u8 _285C1;
|
||||
/* 0x0285C2 */ u8 make_npc2_actor;
|
||||
/* 0x0285C3 */ u8 _285C3[0x0285C6 - 0x0285C3];
|
||||
/* 0x0285C4 */ s16 event_id;
|
||||
/* 0x0285C6 */ u8 event_title_flags;
|
||||
/* 0x0285C7 */ u8 event_title_fade_in_progress;
|
||||
/* 0x0285C8 */ mEv_common_data_c event_common;
|
||||
|
||||
+138
-14
@@ -3,11 +3,49 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "m_play_h.h"
|
||||
#include "m_lib.h"
|
||||
#include "m_scene.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define mDemo_ORDER_VALUE_NUM 16
|
||||
#define mDemo_ORDER_VALUE_MAX 10
|
||||
#define mDemo_REQUEST_NUM 32
|
||||
|
||||
#define mDemo_MSG_PRIORITY 5
|
||||
#define mDemo_CAMERA_PRIORITY 6
|
||||
|
||||
#define mDemo_WINDOW_COLOR_R 235
|
||||
#define mDemo_WINDOW_COLOR_G 255
|
||||
#define mDemo_WINDOW_COLOR_B 235
|
||||
#define mDemo_WINDOW_COLOR_A 255
|
||||
|
||||
enum {
|
||||
mDemo_STATE_WAIT,
|
||||
mDemo_STATE_READY,
|
||||
mDemo_STATE_RUN,
|
||||
// ???
|
||||
mDemo_STATE_STOP = 9,
|
||||
|
||||
mDemo_STATE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mDemo_DIRECT_N,
|
||||
mDemo_DIRECT_NE,
|
||||
mDemo_DIRECT_E,
|
||||
mDemo_DIRECT_SE,
|
||||
mDemo_DIRECT_S,
|
||||
mDemo_DIRECT_SW,
|
||||
mDemo_DIRECT_W,
|
||||
mDemo_DIRECT_NW,
|
||||
|
||||
mDemo_DIRECT_NUM
|
||||
};
|
||||
|
||||
enum demo_type {
|
||||
mDemo_TYPE_NONE,
|
||||
mDemo_TYPE_SCROLL,
|
||||
@@ -60,24 +98,110 @@ enum demo_clip_type {
|
||||
mDemo_CLIP_TYPE_NUM
|
||||
};
|
||||
|
||||
extern void mDemo_Init(GAME_PLAY*);
|
||||
extern void mDemo_Main(GAME_PLAY*);
|
||||
extern int mDemo_Request(int type, ACTOR* actor, mDemo_REQUEST_PROC request_proc);
|
||||
extern void mDemo_Set_msg_num(int msg_num);
|
||||
extern int mDemo_Check(int type, ACTOR* actor);
|
||||
extern int mDemo_Check_DiffAngle_forTalk(s16 angle);
|
||||
extern int mDemo_Check_ListenAble();
|
||||
extern void mDemo_Set_ListenAble();
|
||||
typedef struct demo_req_s {
|
||||
ACTOR* actor;
|
||||
int type;
|
||||
mDemo_REQUEST_PROC proc;
|
||||
f32 talk_weight;
|
||||
} mDemo_Request_c;
|
||||
|
||||
typedef struct demo_door_data_s {
|
||||
int type;
|
||||
|
||||
struct {
|
||||
f32 size;
|
||||
int direct;
|
||||
} house_info;
|
||||
} mDemo_door_data_c;
|
||||
|
||||
typedef struct demo_emsg_data_s {
|
||||
int msg_no;
|
||||
rgba_t window_color;
|
||||
int msg_delay_timer;
|
||||
int scene_delay_timer;
|
||||
Door_data_c door_data;
|
||||
u8 _24[4]; // unused?
|
||||
} mDemo_emsg_data_c;
|
||||
|
||||
typedef struct demo_talk_data_s {
|
||||
int msg_no;
|
||||
int turn;
|
||||
int use_zoom_sound;
|
||||
int display_name;
|
||||
int change_player;
|
||||
int return_get_golden_axe_demo;
|
||||
int return_demo_wait;
|
||||
rgba_t window_color;
|
||||
u8 actor_saved_weight;
|
||||
} mDemo_talk_data_c;
|
||||
|
||||
typedef struct demo_data_s {
|
||||
ACTOR* speaker_actor;
|
||||
ACTOR* listen_actor;
|
||||
int speaker_able;
|
||||
int listen_able;
|
||||
u16 order_data[mDemo_ORDER_NUM][mDemo_ORDER_VALUE_MAX];
|
||||
s8 change_player_destiny;
|
||||
int state;
|
||||
mDemo_Request_c current;
|
||||
mDemo_Request_c request[mDemo_REQUEST_NUM];
|
||||
int request_num;
|
||||
int priority_type;
|
||||
int camera_type;
|
||||
int keep_camera_type;
|
||||
|
||||
union {
|
||||
mDemo_door_data_c door;
|
||||
mDemo_emsg_data_c emsg;
|
||||
mDemo_talk_data_c talk;
|
||||
} data;
|
||||
|
||||
mDemo_Request_c request_save;
|
||||
} mDemo_Data_c;
|
||||
|
||||
extern ACTOR* mDemo_Get_talk_actor();
|
||||
extern void mDemo_Set_speaker_actor(ACTOR* actor);
|
||||
extern void mDemo_Set_OrderValue(int type, int idx, u16 value);
|
||||
extern u16 mDemo_Get_OrderValue(int type, int idx);
|
||||
extern void mDemo_Set_talk_return_demo_wait(u8 value);
|
||||
extern void mDemo_Set_talk_turn(u8 value);
|
||||
extern void mDemo_Set_talk_display_name(u8 value);
|
||||
extern void mDemo_Set_camera(u8 value);
|
||||
extern void mDemo_Set_talk_window_color(rgba_t* color);
|
||||
extern int mDemo_CheckDemo();
|
||||
extern void mDemo_Set_msg_num(int msg_num);
|
||||
extern int mDemo_Get_Talk_Actors(ACTOR** speaker, ACTOR** listener);
|
||||
extern void mDemo_Set_change_player_destiny(s8 destiny);
|
||||
extern void mDemo_Set_use_zoom_sound(u8 use_zoom_sound);
|
||||
extern int mDemo_Get_use_zoom_sound();
|
||||
extern void mDemo_Set_talk_display_name(s8 display_name);
|
||||
extern int mDemo_Get_talk_display_name();
|
||||
extern void mDemo_Set_talk_change_player(u8 change_player);
|
||||
extern int mDemo_Get_talk_change_player();
|
||||
extern void mDemo_Set_talk_return_demo_wait(u8 return_demo_wait);
|
||||
extern int mDemo_Get_talk_return_demo_wait();
|
||||
extern void mDemo_Set_talk_return_get_golden_axe_demo(u8 return_get_golden_axe_demo);
|
||||
extern int mDemo_Get_talk_return_get_golden_axe_demo();
|
||||
extern void mDemo_Set_talk_turn(u8 turn);
|
||||
extern int mDemo_Get_talk_turn();
|
||||
extern void mDemo_Set_talk_window_color(rgba_t* window_color);
|
||||
extern rgba_t* mDemo_Get_talk_window_color_p();
|
||||
extern void mDemo_Set_camera(u8 camera_type);
|
||||
extern int mDemo_Get_camera();
|
||||
extern int mDemo_CheckDemoType();
|
||||
extern int mDemo_Set_house_info(f32 size, int direct);
|
||||
extern void mDemo_stock_clear();
|
||||
extern int mDemo_Request(int type, ACTOR* actor, mDemo_REQUEST_PROC req_proc);
|
||||
extern int mDemo_Check(int type, ACTOR* actor);
|
||||
extern int mDemo_Start(ACTOR* actor);
|
||||
extern int mDemo_Check_and_Go(int type, ACTOR* actor);
|
||||
extern int mDemo_End(ACTOR* actor);
|
||||
extern void mDemo_Main(GAME_PLAY* play);
|
||||
extern void mDemo_Init(GAME_PLAY* play);
|
||||
extern int mDemo_CheckDemo();
|
||||
extern int mDemo_CheckDemo4Event();
|
||||
extern void mDemo_Set_SpeakerAble();
|
||||
extern void mDemo_Set_ListenAble();
|
||||
extern void mDemo_Unset_SpeakerAble();
|
||||
extern void mDemo_Unset_ListenAble();
|
||||
extern int mDemo_Check_SpeakerAble();
|
||||
extern int mDemo_Check_ListenAble();
|
||||
extern int mDemo_Check_DiffAngle_forTalk(s16 diff_angle);
|
||||
extern void mDemo_KeepCamera(int camera_type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ enum event_table {
|
||||
mEv_EVENT_SPORTS_FAIR_AEROBICS,
|
||||
mEv_EVENT_SPORTS_FAIR_TUG_OF_WAR,
|
||||
mEv_EVENT_SPORTS_FAIR_FOOT_RACE,
|
||||
mEv_EVENT_SPRING_SPORTS_FAIR,
|
||||
mEv_EVENT_SPORTS_FAIR,
|
||||
mEv_EVENT_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_CHERRY_BLOSSOM_FESTIVAL,
|
||||
|
||||
@@ -13,6 +13,19 @@ extern "C" {
|
||||
#define mMsg_FREE_STRING_LEN 16
|
||||
#define mMsg_MAIL_STRING_LEN 132
|
||||
|
||||
enum {
|
||||
mMsg_INDEX_HIDE,
|
||||
mMsg_INDEX_APPEAR,
|
||||
mMsg_INDEX_NORMAL,
|
||||
mMsg_INDEX_CURSOL,
|
||||
mMsg_INDEX_DISAPPEAR,
|
||||
mMsg_INDEX_APPEAR_WAIT,
|
||||
mMsg_INDEX_WAIT,
|
||||
mMsg_INDEX_DISAPPEAR_WAIT,
|
||||
|
||||
mMsg_INDEX_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mMsg_FREE_STR0,
|
||||
mMsg_FREE_STR1,
|
||||
@@ -243,6 +256,9 @@ extern void mMsg_Get_BodyParam(u32 table_rom_start, u32 data_rom_start, int entr
|
||||
extern void mMsg_Set_LockContinue(mMsg_Window_c* msg_win);
|
||||
extern void mMsg_Unset_LockContinue(mMsg_Window_c* msg_win);
|
||||
extern int mMsg_Get_msg_num(mMsg_Window_c* msg_win);
|
||||
extern int mMsg_Check_main_index(mMsg_Window_c* msg_win, int index);
|
||||
extern int mMsg_request_main_appear(mMsg_Window_c* msg_win, ACTOR* other_actor, int display_name, rgba_t* window_color_p, int msg_no, int request_priority);
|
||||
extern int mMsg_Check_main_hide(mMsg_Window_c* msg_win);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -28,6 +28,20 @@ extern int mPlib_Get_address_able_display();
|
||||
extern int mPlib_get_player_actor_main_index(GAME_PLAY* play);
|
||||
extern int mPlib_check_player_actor_main_index_AllWade(GAME_PLAY* play);
|
||||
extern int mPlib_request_main_demo_wait_type1(GAME_PLAY* play, int param_2, void* param_3);
|
||||
extern int mPlib_request_main_talk_type1(GAME_PLAY* play, ACTOR* other_actor, int turn, int flag);
|
||||
extern int mPlib_request_main_talk_end_type1(GAME_PLAY* play, int return_demo_wait, int return_get_golden_axe_demo);
|
||||
extern int mPlib_request_main_door_type1(GAME* game, const xyz_t* pos, s16 angle_y, int door_type, void* door_label);
|
||||
extern int mPlib_request_main_door_type2(GAME* game, const xyz_t* pos, s16 angle_y, int door_type, void* door_label);
|
||||
extern int mPlib_strength_request_main_door_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_wade_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_demo_wade_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_demo_geton_boat_wade_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_door_type1_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_door_type2_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_outdoor_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_talk_type1_priority(GAME* game);
|
||||
extern int mPlib_check_request_main_speak_type1_priority(GAME* game);
|
||||
extern int mPlib_Check_able_force_speak_label(GAME* game);
|
||||
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerMdl(GAME_PLAY* play);
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerTex(GAME_PLAY* play, int bank_id, int base_idx);
|
||||
|
||||
@@ -192,7 +192,7 @@ static void aTOU_actor_move(ACTOR* actor, GAME* game){
|
||||
pos.x = light->actor_class.world.position.x;
|
||||
pos.y = light->actor_class.world.position.y;
|
||||
pos.z = light->actor_class.world.position.z - 60.0f;
|
||||
mPlib_request_main_door_type1(play, &pos, 0, 1, light);
|
||||
mPlib_request_main_door_type1(game, &pos, 0, 1, light);
|
||||
}
|
||||
}
|
||||
aTOU_color_ctrl(light);
|
||||
|
||||
+1191
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user