Implement & link m_island.c, link m_land.c

This commit is contained in:
Cuyler36
2023-11-07 22:30:33 -05:00
parent 43427eb5bd
commit a45d97d09e
10 changed files with 1103 additions and 40 deletions
+78 -33
View File
@@ -10,39 +10,84 @@ extern "C" {
#endif
enum resource_index {
/* TODO: finish */
RESOURCE_FGDATA = 0,
RESOURCE_MAIL = 1,
RESOURCE_MAIL_TABLE = 2,
RESOURCE_MAILA = 3,
RESOURCE_MAILA_TABLE = 4,
RESOURCE_MAILB = 5,
RESOURCE_MAILB_TABLE = 6,
RESOURCE_MAILC = 7,
RESOURCE_MAILC_TABLE = 8,
RESOURCE_PALLET_BOY = 9,
RESOURCE_PS = 10,
RESOURCE_PS_TABLE = 11,
RESOURCE_PSZ = 12,
RESOURCE_PSZ_TABLE = 13,
RESOURCE_SELECT = 14,
RESOURCE_SELECT_TABLE = 15,
RESOURCE_STRING = 16,
RESOURCE_STRING_TABLE = 17,
RESOURCE_SUPERZ = 18,
RESOURCE_SUPERZ_TABLE = 19,
RESOURCE_SUPER = 20,
RESOURCE_SUPER_TABLE = 21,
RESOURCE_TEX_BOY = 22,
RESOURCE_FACE_BOY = 23,
RESOURCE_FGNPCDATA = 24,
RESOURCE_MESSAGE = 25,
RESOURCE_MESSAGE_TABLE = 26,
RESOURCE_MY_ORIGINAL = 27,
RESOURCE_NEEDLEWORK_JOYBOOT = 28,
RESOURCE_PLAYER_ROOM_FLOOR = 29,
RESOURCE_PLAYER_ROOM_WALL = 30,
RESOURCE_NPC_NAME_STR_TABLE = 31,
RESOURCE_FGDATA,
RESOURCE_MAIL,
RESOURCE_MAIL_TABLE,
RESOURCE_MAILA,
RESOURCE_MAILA_TABLE,
RESOURCE_MAILB,
RESOURCE_MAILB_TABLE,
RESOURCE_MAILC,
RESOURCE_MAILC_TABLE,
RESOURCE_PALLET_BOY,
RESOURCE_PS,
RESOURCE_PS_TABLE,
RESOURCE_PSZ,
RESOURCE_PSZ_TABLE,
RESOURCE_SELECT,
RESOURCE_SELECT_TABLE,
RESOURCE_STRING,
RESOURCE_STRING_TABLE,
RESOURCE_SUPERZ,
RESOURCE_SUPERZ_TABLE,
RESOURCE_SUPER,
RESOURCE_SUPER_TABLE,
RESOURCE_TEX_BOY,
RESOURCE_FACE_BOY,
RESOURCE_FGNPCDATA,
RESOURCE_MESSAGE,
RESOURCE_MESSAGE_TABLE,
RESOURCE_MY_ORIGINAL,
RESOURCE_NEEDLEWORK_JOYBOOT,
RESOURCE_PLAYER_ROOM_FLOOR,
RESOURCE_PLAYER_ROOM_WALL,
RESOURCE_NPC_NAME_STR_TABLE,
RESOURCE_D_OBJ_NPC_STOCK_SCH,
RESOURCE_D_OBJ_NPC_STOCK_SCL,
RESOURCE_TITLE,
RESOURCE_MURA_SPRING,
RESOURCE_MURA_SUMMER,
RESOURCE_MURA_FALL,
RESOURCE_MURA_WINTER,
RESOURCE_ODEKAKE,
RESOURCE_OMAKE,
RESOURCE_EKI1,
RESOURCE_EKI1_2,
RESOURCE_EKI1_3,
RESOURCE_EKI1_4,
RESOURCE_EKI1_5,
RESOURCE_EKI2,
RESOURCE_EKI2_2,
RESOURCE_EKI2_3,
RESOURCE_EKI2_4,
RESOURCE_EKI2_5,
RESOURCE_EKI3,
RESOURCE_EKI3_2,
RESOURCE_EKI3_3,
RESOURCE_EKI3_4,
RESOURCE_EKI3_5,
RESOURCE_TEGAMI,
RESOURCE_TEGAMI2,
RESOURCE_FAMIKON,
RESOURCE_BOY1,
RESOURCE_BOY2,
RESOURCE_BOY3,
RESOURCE_BOY4,
RESOURCE_BOY5,
RESOURCE_BOY6,
RESOURCE_BOY7,
RESOURCE_BOY8,
RESOURCE_GIRL11,
RESOURCE_GIRL12,
RESOURCE_GIRL13,
RESOURCE_GIRL14,
RESOURCE_GIRL15,
RESOURCE_GIRL16,
RESOURCE_GIRL17,
RESOURCE_GIRL18,
RESOURCE_D_BG_ISLAND_SCH,
RESOURCE_NUM
};
extern void JW_Init();
+3 -1
View File
@@ -285,7 +285,9 @@ typedef struct common_data_s {
/* 0x0288A0 */ u8 pad_connected; /* is gamepad 0 connected? */
/* 0x0288A1 */ u8 unk288A1;
/* 0x0288A2 */ s16 current_sound_effect;
/* 0x0288A4 */ u8 _288a4[0x02DB40 - 0x0288A4];
/* 0x0288A4 */ u8 _288a4[0x0288C0 - 0x0288A4];
/* 0x0288C0 */ Island_c transfer_island; /* used when transferring islands with the GBA */
/* 0x02A1C0 */ Island_agb_c agb_island; /* converted island data sent over to the GBA */
/* 0x02DB40 */ u8 auto_nwrite_set; /* when true, saved nwrite time will be utilized. Seems to be used to keep same date for fishing tourney stuff. */
/* 0x02DB42 */ u16 select_last_select_no;
/* 0x02DB44 */ u16 select_last_top_no;
+136
View File
@@ -50,7 +50,143 @@ typedef struct island_s {
} Island_c;
extern void mISL_ClearKeepIsland();
extern void mISL_KeepIsland(Island_c* island);
extern void mISL_ChangeBG();
extern void mISL_RestoreIsland();
extern void mISL_init(Island_c* island);
extern void mISL_ClearNowPlayerAction();
extern void mISL_SetPlayerAction(PersonalID_c* pid, u32 action);
extern void mISL_SetNowPlayerAction(u32 action);
extern int mISL_CheckPlayerAction(PersonalID_c* pid, u32 action);
extern int mISL_CheckNowPlayerAction(u32 action);
/* NOTE: a lot of these seem to be padded to 4-bytes and should be redone in the future */
typedef struct agb_landinfo_s {
u8 name[LAND_NAME_SIZE];
s8 exists;
u16 id;
} mISL_landinfo_agb_c;
typedef struct agb_floor_s {
/* 0x000 */ mHm_lyr_c layers[mHm_LAYER_NUM];
/* 0x8A0 */ mHm_wf_c wall_floor;
/* 0x8A2 */ u16 pad_8A2;
/* 0x8A4 */ TempoBeat_c tempo_beat;
/* 0x8A8 */ u32 floor_bit_info;
} mISL_flr_agb_c;
typedef struct agb_cottage_s {
/* 0x000 */ mHm_wf_c unused_wall_floor; /* Has wallpaper & flooring bounds checks in sChk_CheckSaveData_Cattage */
/* 0x002 */ u8 pad_2[2];
/* 0x004 */ u8 unk_2[2]; /* struct/array that is two bytes long, maybe another wall floor? */
/* 0x008 */ mISL_flr_agb_c room; /* Cottage room */
/* 0x8B8 */ u8 unk_8B8; // unk_4
/* 0x8B9 */ u8 unk_8B9; // unk_5
/* 0x8BA */ u8 pad_8BA;
/* 0x8BB */ u8 pad_8BB;
/* 0x8BC */ mHm_goki_c goki; /* Cottage cockroaches */
/* 0x8C8 */ u32 pad_8C8;
/* 0x8CC */ u32 music_box[2]; /* Cottage music storage... separate from main home? */
} mISL_cottage_agb_c;
typedef struct agb_anmplayermail_s {
/* 0x000 */ u8 font; /* 'font' to use for letter info */
/* 0x001 */ u8 paper_type;
/* 0x002 */ mActor_name_t present;
/* 0x004 */ u8 header_back_start; /* position for name insertion in header */
/* 0x005 */ u8 pad_5[3]; /* likely pad */
/* 0x008 */ u8 header[MAIL_HEADER_LEN];
/* 0x020 */ u8 body[MAIL_BODY_LEN];
/* 0x0E0 */ u8 footer[MAIL_FOOTER_LEN];
/* 0x100 */ lbRTC_ymd_c date; /* sent date */
} mISL_Anmplmail_agb_c;
typedef struct agb_anmmem_s {
PersonalID_c player_id;
lbRTC_time_c last_speak_time;
memuni_u memuni;
u64 saved_town_tune;
s8 friendship;
u32 letter_info;
mISL_Anmplmail_agb_c letter;
} mISL_Anmmem_agb_c;
typedef struct agb_quest_base_s {
/* 0x00 */ u32 info;
/* 0x04 */ lbRTC_time_c time_limit;
} mISL_quest_base_c;
typedef struct agb_quest_contest_s {
/* 0x00 */ mISL_quest_base_c base; /* quest base struct */
/* 0x0C */ mActor_name_t requested_item; /* item (if any) requested by the villager */
/* 0x0E */ u8 pad_0E[2];
/* 0x10 */ PersonalID_c player_id; /* personal id of the player */
/* 0x24 */ s8 type; /* type of quest, seems to be repeat of data in quest base */
/* 0x25 */ u8 pad_25[3];
/* 0x28 */ mQst_contest_info_u info; /* contest info for flower & letter quests */
} mISL_quest_contest_c;
typedef struct agb_animal_s {
/* 0x000 */ AnmPersonalID_c id; /* this villager's ID */
/* 0x010 */ mISL_Anmmem_agb_c memories[ANIMAL_MEMORY_NUM]; /* memories of players who've spoken to this villager */
/* 0x8D0 */ Anmhome_c home_info; /* home position info */
/* 0x8D5 */ u8 pad_8D5[3];
/* 0x8D8 */ u8 catchphrase[ANIMAL_CATCHPHRASE_LEN]; /* may be called 'word_ending' */
/* 0x8E2 */ u8 pad_8E2[2];
/* 0x8E4 */ mISL_quest_contest_c contest_quest; /* current contest quest information */
/* 0x910 */ u8 parent_name[PLAYER_NAME_LEN]; /* name of the player who 'spawned' the villager in, unsure why this is tracked */
/* 0x918 */ u8 pad_918[4];
/* 0x91C */ anmuni_u anmuni; /* name of the last town the villager lived in or saved island ftr */
/* 0x924 */ u8 pad_924[4]; /* may include last_land_id */
/* 0x928 */ u8 mood; /* probably called 'feel' based on code */
/* 0x929 */ u8 mood_time; /* probably called 'feel_tim' based on code */
/* 0x92A */ mActor_name_t cloth; /* shirt the villager is wearing */
/* 0x92C */ u16 remove_info; /* info about villager moving between towns? kinda stubbed */
/* 0x92D */ u8 is_home; /* TRUE when the villager is home, otherwise FALSE */
/* 0x92E */ u8 moved_in; /* TRUE when the villager moved in after town creation, FALSE if they started out in town */
/* 0x92F */ u8 removing; /* TRUE when the villager is leaving town, FALSE otherwise */
/* 0x930 */ u8 cloth_original_id; /* 0xFF when not wearing an Able Sister's pattern, otherwise 0-3 indicating which pattern */
/* 0x931 */ s8 umbrella_id; /* 0xFF when no umbrella, 0-31 when a standard umbrella, 32-35 when using an Able Sister's pattern
/* 0x932 */ u8 unk_932; /* Exists according to mISL_gc_to_agb_animal, but seems unused in practice */
/* 0x934 */ mActor_name_t present_cloth; /* The most recently received shirt from a letter which the villager may change into */
/* 0x936 */ u8 pad_936[6];
/* 0x93C */ u8 animal_relations[ANIMAL_NUM_MAX]; /* relationships between all villagers in town, starts at 128 which is neutral */
/* 0x94B */ u8 pad_94B[5];
/* 0x950 */ AnmHPMail_c hp_mail[ANIMAL_HP_MAIL_NUM]; /* mail password info storage */
/* 0x9C0 */ u8 _9C0[24]; /* unknown usage/unused */
} mISL_Animal_agb_c;
typedef struct island_agb_s {
/* 0x0000 */ u8 _0000[8];
/* 0x0008 */ u8 name[mISL_ISLAND_NAME_LEN]; /* island name */
/* 0x0010 */ u8 grass_tex_type; /* grass type */
/* 0x0011 */ u8 _0011[2];
/* 0x0013 */ u8 _0013;
/* 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 */
/* 0x0424 */ u8 _0424[4];
/* 0x0428 */ mISL_cottage_agb_c cottage; /* player shared cottage data */
/* 0x0D00 */ mNW_original_design_c flag_design; /* island flag design */
/* 0x0F20 */ mISL_Animal_agb_c animal; /* islander info */
/* 0x18F8 */ u16 deposit[mISL_FG_BLOCK_X_NUM * mISL_FG_BLOCK_Z_NUM][UT_Z_NUM]; /* buried item bitfield */
/* 0x1938 */ u8 bg_data[mISL_ISLAND_BLOCK_NUM]; /* island acre ids */
/* 0x193A */ u8 weather;
/* 0x193C */ lbRTC_time_c renew_time; /* last time island was visited? */
/* 0x1944 */ int npc_idx;
/* 0x1948 */ u32 earth_tex[1024];
/* 0x2948 */ u32 npc_tex[1024];
/* 0x3948 */ u16 npc_pal[16];
/* 0x3968 */ u8 _3968[20];
/* 0x397C */ u8 _397C;
/* 0x397D */ u8 last_song_male; /* last song kapp'n sang for a male character */
/* 0x397E */ u8 last_song_female; /* last song kapp'n sang for a female character */
/* 0x397F */ u8 checksum;
} Island_agb_c;
extern void mISL_gc_to_agb(Island_agb_c* agb, Island_c* gc);
extern void mISL_agb_to_gc(Island_c* gc, Island_agb_c* agb);
#ifdef __cplusplus
}
+21
View File
@@ -1648,6 +1648,27 @@ extern mActor_name_t mNT_FishIdx2FishItemNo(int idx);
#define NPC_TYBALT 0xE0B6
#define NPC_LOBO 0xE0B9
#define NPC_BIFF 0xE0C2
#define NPC_MAELLE (NPC_START + 216)
#define NPC_OHARE (NPC_START + 217)
#define NPC_BLISS (NPC_START + 218)
#define NPC_DRIFT (NPC_START + 219)
#define NPC_BUD (NPC_START + 220)
#define NPC_BOOMER (NPC_START + 221)
#define NPC_ELINA (NPC_START + 222)
#define NPC_FLASH (NPC_START + 223)
#define NPC_DOBIE (NPC_START + 224)
#define NPC_FLOSSIE (NPC_START + 225)
#define NPC_ANNALISE (NPC_START + 226)
#define NPC_PLUCKY (NPC_START + 227)
#define NPC_FAITH (NPC_START + 228)
#define NPC_YODEL (NPC_START + 229)
#define NPC_ROWAN (NPC_START + 230)
#define NPC_JUNE (NPC_START + 231)
#define NPC_CHERI (NPC_START + 232)
#define NPC_PIGLEG (NPC_START + 233)
#define NPC_ANKHA (NPC_START + 234)
#define NPC_PUNCHY (NPC_START + 235)
#define NPC_END (NPC_START + 236)
#define DUMMY_START 0xF000
#define DUMMY_RESERVE 0xF0EE // unsure about this, only true in DnM