mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-09 12:37:22 -04:00
Implement & link ac_npc_p_sel2
This commit is contained in:
+22
-1
@@ -3,11 +3,33 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct npc_p_sel2_s NPC_P_SEL2_ACTOR;
|
||||
|
||||
typedef void (*aNPS2_TALK_PROC)(NPC_P_SEL2_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct npc_p_sel2_s {
|
||||
NPC_ACTOR npc_class;
|
||||
int talk_idx;
|
||||
aNPS2_TALK_PROC talk_proc;
|
||||
int talk_end_flag;
|
||||
int player_sum;
|
||||
int player_no;
|
||||
int card_file_idx;
|
||||
int base_message;
|
||||
int base_message2;
|
||||
int card_player_num;
|
||||
int card_player_idx;
|
||||
int card_player_next_choice_idx;
|
||||
int passport_slot;
|
||||
u8 start_flag;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Npc_P_Sel2_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,4 +37,3 @@ extern ACTOR_PROFILE Npc_P_Sel2_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+199
-1
@@ -6,11 +6,41 @@
|
||||
#include "m_personal_id.h"
|
||||
#include "m_land_h.h"
|
||||
#include "m_private.h"
|
||||
#include "m_diary.h"
|
||||
#include "dolphin/card.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define mCD_LAND_SAVE_SIZE 0x72000
|
||||
#define mCD_ORIGINAL_SAVE_SIZE 0xE000
|
||||
#define mCD_MAIL_SAVE_SIZE 0xC000
|
||||
#define mCD_DIARY_SAVE_SIZE 0xC000
|
||||
#define mCD_PRESENT_SAVE_SIZE 0x2000
|
||||
#define mCD_PLAYER_SAVE_SIZE 0x6000
|
||||
/* Offset to start of save data when loading from card.
|
||||
Skips the comment, banner, & icon data. */
|
||||
#define mCD_SAVE_DATA_OFS 0x1440
|
||||
#define mCD_LAND_PROTECT_CODE_MAGIC0 0x3C1C
|
||||
|
||||
enum {
|
||||
mCD_SLOT_A,
|
||||
mCD_SLOT_B,
|
||||
|
||||
mCD_SLOT_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mCD_START_COND_0,
|
||||
mCD_START_COND_1,
|
||||
mCD_START_COND_2,
|
||||
mCD_START_COND_INCOMING_FOREIGNER,
|
||||
mCD_START_COND_OUTGOING_FOREIGNER,
|
||||
|
||||
mCD_START_COND_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mCD_ERROR_NOT_ENABLED, // N [not enabled?]
|
||||
mCD_ERROR_AREA, // A [area?]
|
||||
@@ -30,22 +60,187 @@ enum {
|
||||
mCD_SPACE_BG_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mCD_ARAM_DATA_ORIGINAL,
|
||||
mCD_ARAM_DATA_MAIL,
|
||||
mCD_ARAM_DATA_DIARY,
|
||||
|
||||
mCD_ARAM_DATA_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mCD_FILE_SAVE_MISC,
|
||||
mCD_FILE_SAVE_MAIN,
|
||||
mCD_FILE_SAVE_MAIN_BAK,
|
||||
mCD_FILE_SAVE_MAIL,
|
||||
mCD_FILE_SAVE_ORIGINAL,
|
||||
mCD_FILE_SAVE_DIARY,
|
||||
mCD_FILE_PRESENT,
|
||||
mCD_FILE_PLAYER,
|
||||
|
||||
mCD_FILE_NUM
|
||||
};
|
||||
|
||||
/* This is also a priority table where lower = higher priority */
|
||||
enum {
|
||||
mCD_TRANS_ERR_NONE,
|
||||
mCD_TRANS_ERR_1,
|
||||
mCD_TRANS_ERR_IOERROR,
|
||||
mCD_TRANS_ERR_3,
|
||||
mCD_TRANS_ERR_BROKEN_WRONGENCODING,
|
||||
mCD_TRANS_ERR_5,
|
||||
mCD_TRANS_ERR_NOT_MEMCARD,
|
||||
mCD_TRANS_ERR_WRONG_LAND,
|
||||
mCD_TRANS_ERR_INVALID_NOLAND_CODE,
|
||||
mCD_TRANS_ERR_LAND_EXIST,
|
||||
mCD_TRANS_ERR_PASSPORT_EXIST,
|
||||
mCD_TRANS_ERR_NO_FILES,
|
||||
mCD_TRANS_ERR_NO_SPACE,
|
||||
mCD_TRANS_ERR_TOWN_INVALID,
|
||||
mCD_TRANS_ERR_OTHER_TOWN,
|
||||
mCD_TRANS_ERR_15,
|
||||
mCD_TRANS_ERR_16,
|
||||
mCD_TRANS_ERR_17,
|
||||
mCD_TRANS_ERR_18,
|
||||
mCD_TRANS_ERR_19,
|
||||
mCD_TRANS_ERR_20,
|
||||
mCD_TRANS_ERR_WRONGDEVICE,
|
||||
mCD_TRANS_ERR_NOCARD,
|
||||
mCD_TRANS_ERR_23,
|
||||
mCD_TRANS_ERR_GENERIC,
|
||||
mCD_TRANS_ERR_BUSY,
|
||||
|
||||
mCD_TRANS_ERR_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mCD_HOME_SFX_NORMAL,
|
||||
mCD_HOME_SFX_DELETE,
|
||||
|
||||
mCD_HOME_SFX_NUM
|
||||
};
|
||||
|
||||
#define mCD_RESULT_ERROR -1
|
||||
#define mCD_RESULT_BUSY 0
|
||||
#define mCD_RESULT_SUCCESS 1
|
||||
|
||||
#define mCD_MEMCARD_SECTORSIZE 0x2000
|
||||
#define mCD_ALIGN_SECTORSIZE(s) ALIGN_NEXT(s, mCD_MEMCARD_SECTORSIZE)
|
||||
|
||||
typedef struct {
|
||||
mLd_land_info_c land;
|
||||
PersonalID_c pid[PLAYER_NUM];
|
||||
} mCD_persistent_data_c;
|
||||
|
||||
#define mCD_KEEP_ORIGINAL_PAGE_COUNT 8
|
||||
#define mCD_KEEP_ORIGINAL_COUNT 12
|
||||
|
||||
typedef struct {
|
||||
int count;
|
||||
u8 _0004[mCD_KEEP_ORIGINAL_PAGE_COUNT][12];
|
||||
mNW_original_design_c original[mCD_KEEP_ORIGINAL_PAGE_COUNT][mCD_KEEP_ORIGINAL_COUNT];
|
||||
int _CC80; // force size to 0xCCA0
|
||||
} mCD_keep_original_c ATTRIBUTE_ALIGN(32);
|
||||
|
||||
#define mCD_KEEP_MAIL_PAGE_COUNT 8
|
||||
#define mCD_KEEP_MAIL_COUNT 20
|
||||
|
||||
typedef struct {
|
||||
int count;
|
||||
u8 _0004[mCD_KEEP_MAIL_PAGE_COUNT][12];
|
||||
Mail_c mail[mCD_KEEP_MAIL_PAGE_COUNT][mCD_KEEP_MAIL_COUNT];
|
||||
} mCD_keep_mail_c ATTRIBUTE_ALIGN(32);
|
||||
|
||||
#define mCD_KEEP_DIARY_COUNT PLAYER_NUM
|
||||
#define mCD_KEEP_DIARY_ENTRY_COUNT lbRTC_MONTHS_MAX
|
||||
|
||||
typedef struct {
|
||||
u16 checksum;
|
||||
mDi_entry_c entries[mCD_KEEP_DIARY_COUNT][mCD_KEEP_DIARY_ENTRY_COUNT];
|
||||
} mCD_keep_diary_c ATTRIBUTE_ALIGN(32);
|
||||
|
||||
typedef struct {
|
||||
CARDStat stat;
|
||||
s32 fileNo;
|
||||
s32 freeBlocks;
|
||||
s32 result;
|
||||
s32 game_result;
|
||||
void* workArea;
|
||||
u8 _80[0x94 - 0x80];
|
||||
} mCD_memMgr_card_info_c;
|
||||
|
||||
typedef struct {
|
||||
int proc;
|
||||
int _04;
|
||||
s32 fileNo;
|
||||
s32 chan;
|
||||
int _10;
|
||||
int _14;
|
||||
s32 game_result;
|
||||
int _1C;
|
||||
} mCD_memMgr_fileInfo_c;
|
||||
|
||||
typedef struct {
|
||||
s32 chan;
|
||||
int loaded_file_type;
|
||||
u32 workArea_size;
|
||||
void* workArea;
|
||||
int _0010;
|
||||
int load_proc;
|
||||
u8 _0018[0x0054 - 0x0018];
|
||||
mCD_memMgr_card_info_c cards[CARD_NUM_CHANS];
|
||||
int _017C;
|
||||
int land_saved;
|
||||
int copy_protect;
|
||||
int _0188;
|
||||
int _018C;
|
||||
int _0190;
|
||||
int _0194;
|
||||
int _0198;
|
||||
int _019C;
|
||||
int _01A0;
|
||||
int broken_file_idx;
|
||||
u8 _01A8[0x11BC - 0x01A8];
|
||||
char filename[32];
|
||||
} mCD_memMgr_c;
|
||||
|
||||
/* Bonus letter */
|
||||
#define mCD_PRESENT_MAX 9
|
||||
|
||||
typedef struct present_save_s {
|
||||
u16 checksum;
|
||||
u16 present_count;
|
||||
Mail_c letters[mCD_PRESENT_MAX];
|
||||
} PresentSave_c;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
char comment[CARD_COMMENT_SIZE];
|
||||
u8 banner[0xE00];
|
||||
u8 icon[0x600];
|
||||
PresentSave_c save;
|
||||
};
|
||||
u8 __align_sector[mCD_MEMCARD_SECTORSIZE];
|
||||
} PresentSaveFile_c ATTRIBUTE_ALIGN(32);
|
||||
|
||||
enum {
|
||||
mCD_PRESENT_TYPE_BONUS,
|
||||
mCD_PRESENT_TYPE_GIFT,
|
||||
|
||||
mCD_PRESENT_TYPE_NUM
|
||||
};
|
||||
|
||||
extern s32 mCD_GetThisLandSlotNo_code(int* player_no, s32* slot_card_results);
|
||||
extern int mCD_GetThisLandSlotNo(void);
|
||||
extern void mCD_save_data_aram_malloc();
|
||||
extern void mCD_set_aram_save_data();
|
||||
extern void mCD_init_card();
|
||||
extern s32 mCD_InitGameStart_bg(int chan, int file_no, int sound_mode, s32* mounted_chan);
|
||||
extern s32 mCD_InitGameStart_bg(int player_no, int card_private_idx, int start_cond, s32* mounted_chan);
|
||||
extern int mCD_GetCardPrivateNameCopy(u8* name, int idx);
|
||||
extern int mCD_CheckCardPlayerNative(int idx);
|
||||
extern int mCD_CheckPassportFile(void);
|
||||
extern int mCD_CheckBrokenPassportFile(int slot);
|
||||
extern int mCD_GetPlayerNum(void);
|
||||
|
||||
extern void mCD_PrintErrInfo(gfxprint_t* gfxprint);
|
||||
extern void mCD_InitAll();
|
||||
@@ -53,6 +248,9 @@ extern void mCD_LoadLand();
|
||||
extern void mCD_toNextLand();
|
||||
|
||||
extern int mCD_EraseBrokenLand_bg(void*);
|
||||
extern int mCD_EraseLand_bg(int* slot);
|
||||
extern int mCD_ErasePassportFile_bg(int slot);
|
||||
extern int mCD_SaveErasePlayer_bg(int* slot);
|
||||
extern int mCD_card_format_bg(u8);
|
||||
extern void mCD_ReCheckLoadLand(GAME_PLAY* play);
|
||||
|
||||
|
||||
@@ -166,14 +166,15 @@ typedef struct Save_s {
|
||||
/* 0x024188 */ u8 _24188;
|
||||
/* 0x024189 */ u8 _24189;
|
||||
/* 0x02418A */ u8 town_day;
|
||||
/* 0x02418B */ u8 _2418B[0x241A0 - 0x2418B];
|
||||
/* 0x02418B */ u8 _2418B[0x24198 - 0x2418B];
|
||||
/* 0x024198 */ OSTime travel_hard_time;
|
||||
/* 0x0241A0 */ lbRTC_time_c saved_auto_nwrite_time; /* save data notice time used for fishing tourney results? */
|
||||
/* 0x0241A8 */ u8 _241A8[0x26000 - 0x241A8];
|
||||
/* 0x0241A8 */ u8 _241A8[0x242A0 - 0x241A8];
|
||||
} Save_t;
|
||||
|
||||
typedef union save_u {
|
||||
Save_t save;
|
||||
// u8 raw[0x26000]; /* Temp to force length */
|
||||
u8 __force_sector_align[mCD_ALIGN_SECTORSIZE(sizeof(Save_t))]; /* memcard sector-size aligned */
|
||||
} Save;
|
||||
|
||||
typedef struct transition_s {
|
||||
@@ -239,7 +240,7 @@ typedef struct common_data_s {
|
||||
/* 0x028590 */ u8 remove_cut_tree_info_bitfield; /* resets the cut tree states for trees in a visible acre */
|
||||
/* 0x028591 */ s8 floor_idx;
|
||||
/* 0x028592 */ s16 demo_profiles[2]; /* demo_profiles[0] is for demo_clip, demo_profiles[1] is for demo_clip2 */
|
||||
/* 0x028596 */ u16 copy_protect_code;
|
||||
/* 0x028596 */ u16 copy_protect;
|
||||
/* 0x028598 */ int event_keep_flags[4];
|
||||
/* 0x0285A8 */ u8 _285A8[0x0285BD - 0x0285A8];
|
||||
/* 0x0285BD */ s8 player_warp_request;
|
||||
|
||||
@@ -10,6 +10,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#define mFRm_SAVE_ID ('GAFE')
|
||||
#define mFRm_VERSION 6
|
||||
|
||||
#define mFRm_ERROR_INFO_NUM 10
|
||||
#define mFRm_NO_ERROR_NO 7
|
||||
|
||||
@@ -13,7 +13,10 @@ extern "C" {
|
||||
#define mSC_RADIO_DAYS 13
|
||||
#define mSC_LIGHTHOUSE_DAYS 17
|
||||
|
||||
#define mSC_TROPHY_GOLDEN_NET 28
|
||||
#define mSC_TROPHY_GOLDEN_AXE 29
|
||||
#define mSC_TROPHY_GOLDEN_SCOOP 30 // assumed
|
||||
#define mSC_TROPHY_GOLDEN_ROD 31
|
||||
|
||||
enum {
|
||||
mSC_EVENT_NEW_YEARS_DAY,
|
||||
|
||||
Reference in New Issue
Block a user