forgor to pull lmao

This commit is contained in:
Prakxo
2023-06-18 22:19:38 +02:00
18 changed files with 1243 additions and 13 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef AC_STRUCTURE_H
#define AC_STRUCTURE_H
#include "types.h"
#include "m_actor.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef ACTOR* (*aSTR_SETUP_ACTOR_PROC)(GAME_PLAY*, mActor_name_t, int, f32, f32);
// TODO: finish clip
typedef struct actor_structure_clip_s {
aSTR_SETUP_ACTOR_PROC setup_actor_proc;
} aSTR_Clip_c;
#ifdef __cplusplus
}
#endif
#endif
+3
View File
@@ -22,6 +22,9 @@ extern void sAdo_SysLevStart(u8 id);
extern void sAdo_SysTrgStart(u16 id);
extern void sAdos_KishaStatusLevel(f32 speed, u32 ongenNum1, u16 angle1, f32 distance1, u32 ongenNum2, u16 angle2, f32 distance2);
extern void sAdos_KishaStatusTrg(u8 state);
/* Not sure about the last param name */
extern void sAdo_VoiceSe(u8 num, u8 num2, u8 num3, s16 character_idx, u8 scale, u8 mode);
+4
View File
@@ -7,6 +7,10 @@
extern "C" {
#endif
#define PAD_MOTOR_STOP 0
#define PAD_MOTOR_RUMBLE 1
#define PAD_MOTOR_STOP_HARD 2
#define PAD_BUTTON_LEFT 0x0001
#define PAD_BUTTON_RIGHT 0x0002
#define PAD_BUTTON_DOWN 0x0004
+13
View File
@@ -127,6 +127,19 @@ struct actor_s {
#define mActor_NONE_PROC1 ((mActor_proc)none_proc1)
typedef struct actor_list_s {
int num_actors;
ACTOR* actor;
} Actor_list;
typedef struct actor_info_s {
int total_num;
Actor_list list[ACTOR_PART_NUM];
} Actor_info;
extern void Actor_delete(ACTOR* actor);
extern ACTOR* Actor_info_fgName_search(Actor_info* actor_info, mActor_name_t fg_name, int part);
#ifdef __cplusplus
}
#endif
+4 -1
View File
@@ -4,6 +4,7 @@
#include "types.h"
#include "ac_gyoei_h.h"
#include "ac_insect_h.h"
#include "ac_structure.h"
#ifdef __cplusplus
extern "C" {
@@ -13,7 +14,9 @@ extern "C" {
typedef struct clip_s {
/* 0x000 */ void* _000[(0x07C - 0x000) / sizeof(void*)];
/* 0x07C */ aINS_Clip_c* insect_clip;
/* 0x080 */ void* _080[(0x0AC - 0x080) / sizeof(void*)];
/* 0x080 */ void* _080[(0x08C - 0x080) / sizeof(void*)];
/* 0x08C */ aSTR_Clip_c* structure_clip;
/* 0x090 */ void* _090[(0x0AC - 0x090) / sizeof(void*)];
/* 0x0AC */ aGYO_Clip_c* gyo_clip;
/* 0x0B0 */ void* _0B0[(0x104 - 0x0B0) / sizeof(void*)];
} Clip_c;
+1
View File
@@ -57,6 +57,7 @@ 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 int mCoBG_CheckHole_OrgAttr(u32 attribute);
extern f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t wpos, f32 foot_dist);
extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line);
#define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__)
+21 -3
View File
@@ -162,7 +162,9 @@ typedef struct common_data_s {
/* 0x02651E */ mActor_name_t last_field_id;
/* 0x026520 */ u8 in_initial_block; /* when TRUE, the player is in the acre which they exited a building. FALSE otherwise. */
/* 0x026521 */ u8 submenu_disabled; /* when set, submenus cannot be accessed from start button */
/* 0x026522 */ u8 _26522[0x2666C - 0x26522];
/* 0x026522 */ u8 sunlight_flag;
/* 0x026523 */ u8 train_flag;
/* 0x026522 */ u8 _26524[0x2666C - 0x26524];
/* 0x02666C */ s16 weather;
/* 0x02666E */ s16 weather_intensity;
/* 0x026670 */ lbRTC_time_c weather_time;
@@ -173,11 +175,27 @@ 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 tmp1[0x28879 - 0x28558];
/* 0x028558 */ u8 tmp1[0x02883E - 0x28558];
/* 0x02883E */ u8 train_coming_flag; /* state tracker for when train is going to spawn/has spawned */
/* 0x02883F */ u8 train_exists_flag; /* state tracker for when train exists */
/* 0x028840 */ u8 train_control_state; /* current train state */
/* 0x028841 */ u8 train_last_control_state; /* previous train state */
/* 0x028842 */ u8 train_signal;
/* 0x028843 */ u8 train_day;
/* 0x028844 */ u8 train_action;
/* 0x028845 */ u8 train_timer;
/* 0x028848 */ u32 train_start_timer;
/* 0x02884C */ f32 train_speed;
/* 0x028850 */ xyz_t train_position;
/* 0x02885C */ f32 unused_02885C;
/* 0x028860 */ f32 unused_028860;
/* 0x028864 */ u16 unused_028864;
/* 0x028866 */ u16 unused_028866;
/* 0x028868 */ u8 _028868[0x028879 - 0x028868];
/* 0x028879 */ u8 auto_nwrite_count;
/* 0x02887A */ lbRTC_year_t auto_nwrite_year;
/* 0x02887C */ u8 save_error_type; /* set to one of the mFRm_ERROR_* states when save is invalid */
/* 0x02887D */ u8 train_coming_flag; /* set when the train is coming */
/* 0x02887D */ u8 train_approaching_flag; /* set when the train is coming */
/* 0x02887E */ u8 buried_treasure_flag; /* when set, treasure cannot be buried */
/* 0x02887F */ u8 spnpc_first_talk_flags;
/* 0x028880 */ u8 needlework_first_talk_flags;
+10
View File
@@ -90,6 +90,16 @@ typedef struct location_info_s {
/* 0x10 */ mActor_name_t* block_data;
} mFI_unit_c;
typedef struct block_table_s {
s8 block_x;
s8 block_z;
f32 pos_x;
f32 pos_z;
mActor_name_t* items;
} mFI_block_tbl_c;
extern int mFI_CheckFieldData();
extern mActor_name_t mFI_GetFieldId();
extern int mFI_GetClimate();
+4
View File
@@ -466,6 +466,10 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define EXIT_DOOR 0x4080
#define TRAIN_STATION 0x5809
#define TRAIN0 0x580A
#define TRAIN1 0x580B
#define SP_NPC_START 0xD000
#define SP_NPC_ARTIST (SP_NPC_START + 0) // D000
#define SP_NPC_BROKER (SP_NPC_START + 1) // D001
+6 -2
View File
@@ -8,6 +8,7 @@
#include "m_camera2.h"
#include "m_submenu.h"
#include "m_pause.h"
#include "m_field_info.h"
#include "m_play_h.h"
#ifdef __cplusplus
@@ -18,12 +19,15 @@ extern "C" {
struct game_play_s {
/* 0x0000 */ GAME game;
// TODO: finish
/* 0x00E0 */ u8 _00E0[0x1A68 - 0x00E0];
/* 0x00E0 */ int _00E0;
/* 0x00E4 */ mFI_block_tbl_c block_table;
/* 0x00F4 */ mFI_block_tbl_c last_block_table;
/* 0x0104 */ u8 _0104[0x1A68 - 0x0104];
/* 0x1A68 */ View view;
/* 0x1B88 */ Camera2 camera;
/* 0x1CC0 */ u8 _1CC0[0x1DA0 - 0x1CC0];
/* 0x1DA0 */ pause_t pause;
/* 0x1DA8 */ u8 _1DA8[0x1DEC - 0x1DA8];
/* 0x1DA8 */ Actor_info actor_info;
/* 0x1DEC */ Submenu submenu;
/* 0x1FA4 */ u8 _1FA4[0x200C - 0x1FA4];
/* 0x200C */ MtxF matrix;
+9
View File
@@ -7,6 +7,15 @@
extern "C" {
#endif
enum field_draw_type {
FIELD_DRAW_TYPE_OUTDOORS,
FIELD_DRAW_TYPE_INDOORS,
FIELD_DRAW_TYPE_TRAIN,
FIELD_DRAW_TYPE_PLAYER_SELECT,
FIELD_DRAW_TYPE_NUM
};
/*
TODO: is this right? I assume so based on file names but
there may be a better place for this
+2
View File
@@ -61,6 +61,8 @@ enum {
#define mTM_SECONDS_IN_HALFDAY 12*60*60
#define mTM_SECONDS_IN_DAY 24*60*60
#define mTM_MINUTES_IN_HOUR 60
typedef struct time_calendar_term_s {
lbRTC_month_t month;
lbRTC_day_t day;
+35
View File
@@ -0,0 +1,35 @@
#ifndef M_TRAIN_CONTROL_H
#define M_TRAIN_CONTROL_H
#include "types.h"
#include "m_play_h.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mTRC_SLOW_SPEED 2.0f // speed stopping/starting
#define mTRC_FAST_SPEED 6.0f // speed when farther away from station
enum {
mTRC_ACTION_NONE,
mTRC_ACTION_SPAWN_MOVING,
mTRC_ACTION_BEGIN_SLOWDOWN,
mTRC_ACTION_BEGIN_STOP,
mTRC_ACTION_SIGNAL_STOPPED,
mTRC_ACTION_WAIT_STOPPED,
mTRC_ACTION_SIGNAL_STARTING,
mTRC_ACTION_BEGIN_PULL_OUT,
mTRC_ACTION_SPEED_UP,
mTRC_ACTION_NUM
};
extern void mTRC_init();
extern void mTRC_move(GAME_PLAY* play);
#ifdef __cplusplus
}
#endif
#endif
+76 -1
View File
@@ -7,9 +7,84 @@
extern "C" {
#endif
#define mVibctl_FLAG_FORCE_STOP_NONE 0
#define mVibctl_FLAG_FORCE_STOP0 (1 << 0) // 1
#define mVibctl_FLAG_FORCE_STOP1 (1 << 1) // 2
#define mVibctl_FLAG_FORCE_STOP2 (1 << 2) // 4
#define mVibctl_FLAG_FORCE_STOP3 (1 << 3) // 8
#define mVibctl_FLAG_FORCE_STOP_ALL (mVibctl_FLAG_FORCE_STOP0 | mVibctl_FLAG_FORCE_STOP1 | mVibctl_FLAG_FORCE_STOP2 | mVibctl_FLAG_FORCE_STOP3) // 15
enum {
mVibctl_ELEM_ENTRY_ATTACK, // fade-in program
mVibctl_ELEM_ENTRY_SUSTAIN, // sustain program
mVibctl_ELEM_ENTRY_RELEASE, // fade-out program
mVibctl_ELEM_ENTRY_END, // program has finished
mVibctl_ELEM_ENTRY_NUM = mVibctl_ELEM_ENTRY_END
};
enum {
mVibctl_VIB_PROG_NON, // rumble config attack, shake tree attack
mVibctl_VIB_PROG_FFF, // fish touch bobber, fishing rod cast, rumble config sustain, Mouth of Truth furniture interaction attack & sustain, shovel hits soft object, net swing, axe cut attack & release, trip attack, pick weed sustain & release
mVibctl_VIB_PROG_F, // unused?
mVibctl_VIB_PROG_MF, // unused?
mVibctl_VIB_PROG_MP, // unused?
mVibctl_VIB_PROG_P, // rumble config release, shake tree release
mVibctl_VIB_PROG_FUNBARI, // unused?
mVibctl_VIB_PROG_ANAHORI, // digging with shovel
mVibctl_VIB_PROG_ANAUME, // filling hole with shovel
mVibctl_VIB_PROG_IMPACT, // fish bite bobber, shovel hits hard object
mVibctl_VIB_PROG_KI_GA_TAORERU, // axe cut sustain
mVibctl_VIB_PROG_KI_WO_YUSURU, // shake tree sustain
mVibctl_VIB_PROG_KORONODA, // trip sustain
mVibctl_VIB_PROG_SURPRISE, // Mouth of Truth furniture interaction release
mVibctl_VIB_PROG_DUMMY_B, // unused?
mVibctl_VIB_PROG_SAMPLE, // unused?
mVibctl_VIB_PROG_NUM
};
#define mVibctl_ELEM_NUM 4
typedef struct vibration_element_entry_s {
int type;
int frames;
f32 step;
} mVibInfo_elem_entry_c;
typedef struct vibration_element_s {
mVibInfo_elem_entry_c entries[mVibctl_ELEM_ENTRY_NUM];
f32 step0;
f32 step1;
int now_entry;
int state_idx;
f32 frame_intensity;
int entry_frame;
f32 now_intensity;
int command; // for padmgr, PAD_MOTOR_*
} mVibElem_c;
typedef struct vibration_info_s {
mVibElem_c* target_elem;
mVibElem_c elements[mVibctl_ELEM_NUM];
int num_elements;
int force_stop;
int last_force_stop;
} mVibInfo_c;
typedef struct vibration_work_data_S {
const u8* data;
int count;
} mVibWorkData_c;
extern void mVibctl_ct();
extern void mVibctl_reset();
extern void mVibctl_init0();
extern void mVibctl_init();
extern void mVibctl_reset();
extern void mVibctl_entry(int total_frames, int attack_type, int sustain_type, int release_type, int attack_frames, int sustain_frames, int release_frames, f32 step);
extern void mVibctl_simple_entry(int total_frames, int type, int attack_frames, int sustain_frames, int release_frames, f32 step);
extern void mVibctl_set_force_stop(int force_stop);
extern void mVibctl_clr_force_stop(int force_stop);
#ifdef __cplusplus
}
+9 -6
View File
@@ -22,8 +22,8 @@ enum pads {
};
typedef struct {
u8 last_intensity;
u8 now_intensity;
u8 last_command; // PAD_MOTOR_*
u8 now_command; // PAD_MOTOR_*
u8 frames;
u8 _pad;
} Motor_t;
@@ -64,18 +64,21 @@ typedef struct {
extern padmgr padmgr_class;
extern int padmgr_isConnectedController(int pad);
extern void padmgr_force_stop_ON();
extern void padmgr_force_stop_OFF();
extern void padmgr_RumbleSet(int pad, int intensity);
#define padmgr_setClient(callback, param) \
#define padmgr_setClient(callback_proc, param) \
do { \
padmgr* mgr = &padmgr_class; \
mgr->callback = callback; \
mgr->callback = callback_proc; \
mgr->callback_param = param; \
} while (0)
#define padmgr_removeClient(callback, param) \
#define padmgr_removeClient(callback_proc, param) \
do { \
padmgr* mgr = &padmgr_class; \
if (mgr->callback == (callback) && mgr->callback_param == (param)) { \
if (mgr->callback == (callback_proc) && mgr->callback_param == (param)) { \
mgr->callback = NULL; \
mgr->callback_param = NULL; \
} \