Merge pull request #442 from Cuyler36/m_tag_ovl

This commit is contained in:
Cuyler36
2024-10-21 21:31:27 -04:00
committed by GitHub
50 changed files with 9763 additions and 529 deletions
+5
View File
@@ -1099,6 +1099,11 @@ m_submenu_ovl.c:
.rodata: [0x8064B870, 0x8064B900]
.data: [0x806CE550, 0x806CF928]
.bss: [0x813405C0, 0x81340FC8]
m_tag_ovl.c:
.text: [0x805EF6CC, 0x805FF3C4]
.rodata: [0x8064B900, 0x8064BA00]
.data: [0x806CF928, 0x806D1320]
.bss: [0x81340FC8, 0x81341390]
m_timeIn_ovl.c:
.text: [0x805FF3C4, 0x80600370]
.rodata: [0x8064BA00, 0x8064BA58]
+4
View File
@@ -19,6 +19,10 @@ extern "C" {
#define aMR_NO_FTR_ID 200
#define aMR_NO_FTR_ID2 201
#define aMR_JUDGE_MAX_FTR -1
#define aMR_JUDGE_CANT_PLACE_FTR -2
#define aMR_JUDGE_OTHER_ROOM -3
typedef struct my_room_actor_s MY_ROOM_ACTOR;
enum {
+21 -2
View File
@@ -17,16 +17,19 @@ extern "C" {
#define SE_FLAG_15(id) ((id) | 0x8000)
// TODO: Make the rest of Sound Effects with parameters
#define SE_REGISTER MONO(0x50)
#define SE_REGISTER MONO(NA_SE_REGISTER)
typedef enum audio_sound_effects {
NA_SE_START,
NA_SE_CURSOL,
NA_SE_MENU_EXIT,
NA_SE_3 = 3,
NA_SE_ZOOMUP = 4,
NA_SE_ZOOMDOWN_SHORT,
NA_SE_A = 0xA,
NA_SE_PAGE_OKURI = 0xB,
NA_SE_SENTAKU_OPEN,
@@ -39,8 +42,12 @@ typedef enum audio_sound_effects {
NA_SE_25 = 0x25,
NA_SE_26 = 0x26,
NA_SE_2A = 0x2A,
NA_SE_MENU_PAUSE = 0x30,
NA_SE_31 = 0x31,
NA_SE_32 = 0x32,
NA_SE_33 = 0x33,
NA_SE_DRAWER_SHUT = 0x3A,
@@ -52,6 +59,8 @@ typedef enum audio_sound_effects {
NA_SE_COIN,
NA_SE_TEMOCHI_KAZAGURUMA,
NA_SE_REGISTER = 0x50,
NA_SE_52 = 0x52,
NA_SE_ITEM_HORIDASHI = 0x57,
@@ -60,7 +69,8 @@ typedef enum audio_sound_effects {
NA_SE_TOOL_FURI = 0x5A, // swing?
NA_SE_AMI_HIT = 0x5C,
NA_SE_TOOL_GET,
NA_SE_5E = 0x5E,
NA_SE_5F = 0x5F,
NA_SE_60 = 0x60,
NA_SE_GASAGOSO = 0x69,
@@ -147,6 +157,8 @@ typedef enum audio_sound_effects {
NA_SE_SOFT_CHAIR_STANDUP,
NA_SE_HARD_CHAIR_STANDUP,
NA_SE_426 = 0x426,
NA_SE_BUBU_CHAIR_STANDUP = 0x429,
NA_SE_JUMP,
NA_SE_LANDING,
@@ -158,14 +170,21 @@ typedef enum audio_sound_effects {
NA_SE_UMBRELLA_ROTATE = 0x432,
NA_SE_435 = 0x435,
NA_SE_436 = 0x436,
NA_SE_KARABURI = 0x43A,
NA_SE_ROD_STROKE_SMALL = 0x445,
NA_SE_446 = 0x446,
NA_SE_SCOOP_TREE_HIT = 0x448,
NA_SE_SCOOP_ITEM_HIT,
NA_SE_AXE_BALL_HIT,
NA_SE_45E = 0x45E,
NA_SE_45F = 0x45F,
NA_SE_461 = 0x461,
NA_SE_COIN_GASAGOSO = 0x465,
+1
View File
@@ -14,6 +14,7 @@ extern "C" {
#define mCL_MENU_ITEM_MAX 742
#define mCL_MENU_PAGE_SIZE 7
#define mCL_ITEM_DATA_NUM 2
#define mCL_TAG_STR_SIZE 10
enum {
mCL_MENU_FTR,
+4
View File
@@ -344,6 +344,10 @@ extern void mCoBG_GroundCheckOnly(xyz_t* reverse_pos, ACTOR* actor, f32 check_ra
extern f32 mCoBG_Wpos2BgUtCenterHeight_AddColumn(xyz_t pos);
extern f32 mCoBG_UtNum2UtCenterY_Keep(int ut_x, int ut_z);
extern int mCoBG_RegistDecalCircle(const xyz_t* pos_p, f32 radius_start, f32 radius_end, s16 timer);
extern int mCoBG_CheckAcceptDesignSign(const xyz_t* pos_p);
extern void mCoBG_VirtualBGCheck(xyz_t* rev_pos_p, mCoBG_Check_c* bg_check, const xyz_t* start_pos_p,
const xyz_t* end_pos_p, s16 angle_y, s16 water_flag, s16 ground_flag, f32 range,
f32 ground_dist, s16 attr_wall, s16 rev_type, s16 check_type);
typedef int (*mCoBG_LINECHECK_PROC)(mActor_name_t);
+13
View File
@@ -356,6 +356,19 @@ extern common_data_t common_data;
#define Get_Island() (Save_Get(island))
#define Get_Island_Villager() (Get_Island().animal)
#define GetRoomMusicBox() (Save_Get(scene_no) == SCENE_COTTAGE_MY \
? Save_Get(island).cottage.music_box \
: Save_Get(homes[mHS_get_arrange_idx(Common_Get(player_no))]).music_box)
#define ChkMusicBox(box, n) (((box)[((n) / 32) & 1] >> ((n) & 31)) & 1)
#define SetMusicBox(box, n) ((box)[((n) / 32) & 1] |= (1 << ((n) & 31)))
#define ClrMusicBox(box, n) ((box)[((n) / 32) & 1] &= ~(u32)(1 << ((n) & 31)))
#define ChkRoomMusicBox(n) ChkMusicBox(GetRoomMusicBox(), n)
#define SetRoomMusicBox(n) SetMusicBox(GetRoomMusicBox(), n)
#define ClrRoomMusicBox(n) ClrMusicBox(GetRoomMusicBox(), n)
#define CLIP(n) (Common_Get(clip).n)
#define aMR_CLIP (Common_Get(clip).my_room_clip)
extern void common_data_reinit();
extern void common_data_init();
extern void common_data_clear();
+26
View File
@@ -2,11 +2,37 @@
#define M_CPMAIL_OVL_H
#include "types.h"
#include "m_cpmail_ovl_h.h"
#include "m_submenu.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mCM_PAGE_COUNT 8
#define mCM_MAIL_COUNT 20
#define mCM_FOLDER_NAME_LEN 12
#define mCM_FOLDER_NAME_MAX_WIDTH 120
/* TODO: move this to a better header */
typedef struct card_mail_s {
int count;
u8 folder_names[mCM_PAGE_COUNT][mCM_FOLDER_NAME_LEN];
Mail_c mail[mCM_PAGE_COUNT][mCM_MAIL_COUNT];
} mCD_mail_c;
struct cpmail_ovl_s {
mCD_mail_c* card_mail;
Mail_c player_mail[mPr_INVENTORY_MAIL_COUNT];
u8 page_order[mCM_PAGE_COUNT];
s16 page_move_timer;
u8 next_page_id;
u32 mark_bitfield;
int mark_flag;
u8 _BBC;
u32 mark_bitfield2;
};
extern void mCM_cpmail_ovl_construct(Submenu* submenu);
extern void mCM_cpmail_ovl_destruct(Submenu* submenu);
extern void mCM_cpmail_ovl_set_proc(Submenu* submenu);
+2
View File
@@ -7,6 +7,8 @@
extern "C" {
#endif
typedef struct cpmail_ovl_s mCM_Ovl_c;
#ifdef __cplusplus
}
#endif
+33
View File
@@ -2,14 +2,47 @@
#define M_CPORIGINAL_OVL_H
#include "types.h"
#include "m_cporiginal_ovl_h.h"
#include "m_submenu_ovl.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mCO_PAGE_NUM 8
#define mCO_ORIGINAL_NUM 12
#define mCO_FOLDER_NAME_LEN 12
#define mCO_FOLDER_NAME_MAX_WIDTH 120
/* TODO: find a better place for this */
typedef struct card_original_s {
int count;
u8 folder_names[mCO_PAGE_NUM][mCO_FOLDER_NAME_LEN];
mNW_original_design_c original[mCO_PAGE_NUM][mCO_ORIGINAL_NUM];
int _CC80;
} mCD_original_c;
struct cporiginal_s {
mCD_original_c* card_original;
u8 page_order[mCO_PAGE_NUM];
u8 up_folder;
u8 chang_flg;
int _10;
u16 mark_flg;
u16 hide_flg[mCO_PAGE_NUM];
u8 _26;
u8 cloth_org_no;
u8 cloth_org_idx;
u8 image_order[mCO_PAGE_NUM][mCO_ORIGINAL_NUM + 1];
};
extern void mCO_swap_image(Submenu* submenu, mActor_name_t item0, mActor_name_t item1);
extern void mCO_change_up_folder(Submenu* submenu, int idx);
extern int mCO_top_folder(Submenu* submenu);
extern u8* mCO_get_folder_name(Submenu* submenu, int folder);
extern u8* mCO_get_image_name(Submenu* submenu, int folder, int idx);
extern int mCO_check_mark_flg(Submenu* submenu, int idx);
extern void mCO_clear_mark_flg(Submenu* submenu);
extern int mCO_check_hide_flg(Submenu* submenu, int folder, int idx);
extern void mCO_on_hide_flg(Submenu* submenu, int folder, int idx);
extern void mCO_clear_hide_flg(Submenu* submenu);
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_CPORIGINAL_H_H
#define M_CPORIGINAL_H_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct cporiginal_s mCO_Ovl_c;
#ifdef __cplusplus
}
#endif
#endif
+1 -1
View File
@@ -14,7 +14,7 @@ enum {
mEE_TYPE_BOARD,
mEE_TYPE_NOTICE,
mEE_TYPE_MSCORE,
mEE_TYPE_CPORIGINAL,
mEE_TYPE_CPACK,
mEE_TYPE_ORIGINAL_DESIGN,
mEE_TYPE_NUM
+1 -1
View File
@@ -10,7 +10,7 @@ extern "C" {
extern void mGB_copy_image(Submenu*, mActor_name_t, mActor_name_t);
extern void mGB_draw_gba(Submenu* submenu, GRAPH* graph, f32 pos_x, f32 pos_y, f32 scale, int idx, int color_flag);
extern u8* mGB_get_image_name(Submenu* submenu, int idx);
extern void mGB_gba_ovl_construct(Submenu* submenu);
extern void mGB_gba_ovl_destruct(Submenu* submenu);
extern void mGB_gba_ovl_set_proc(Submenu* submenu);
+19
View File
@@ -2,11 +2,30 @@
#define M_HANIWA_OVL_H
#include "types.h"
#include "m_haniwa_ovl_h.h"
#include "m_tag_ovl.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mHW_OVL_MSG_SIZE 22
typedef void (*mHW_SET_INTERRUPT_MESSAGE_PROC)(Submenu*, mTG_tag_c*, int);
struct haniwa_ovl_s {
int msg_idx;
int msg_interrupt_idx;
int table_idx;
int sub_idx;
int msg_time;
int msg_counter;
u32 msg_price;
u32 price;
u8 msg[mHW_OVL_MSG_SIZE];
mHW_SET_INTERRUPT_MESSAGE_PROC set_interrupt_message_proc;
};
extern void mHW_haniwa_ovl_construct(Submenu* submenu);
extern void mHW_haniwa_ovl_destruct(Submenu* submenu);
extern void mHW_haniwa_ovl_set_proc(Submenu* submenu);
+2
View File
@@ -7,6 +7,8 @@
extern "C" {
#endif
typedef struct haniwa_ovl_s mHW_Ovl_c;
#ifdef __cplusplus
}
#endif
+7 -3
View File
@@ -15,6 +15,10 @@ extern "C" {
#define mIV_ITEM_JOINT_NUM 8
#define mIV_PLAYER_EFFECT_NUM 20
#define mIV_COLLECT_NUM 40
#define mIV_ITEM_COLUMNS 5
#define mIV_ITEM_ROWS 3
#define mIV_MAIL_COLUMNS 2
#define mIV_MAIL_ROWS 5
enum {
mIV_ITEM_SCALE_TYPE_NONE,
@@ -80,7 +84,7 @@ struct inventory_ovl_s {
u16 selectable_mail_bitfield;
u32 disp_money;
int disp_money_change_frames;
int disp_money_chg_step;
xyz_t shovel_pos;
xyz_t release_pos;
@@ -96,8 +100,8 @@ struct inventory_ovl_s {
mIV_pl_eff_c pl_eff[mIV_PLAYER_EFFECT_NUM];
mIV_SET_COLLECT_ITEMNO_PROC set_collect_itemNo_proc;
u16 item_mark_bitfield;
u16 _5E2;
s16 _5E4;
u16 mail_mark_bitfield2;
s16 mail_mark_flag;
u8 _5E6[2];
u16 mail_mark_bitfield;
u8 original_flag;
+51 -46
View File
@@ -22,82 +22,84 @@ extern "C" {
#define mMl_MUSEUM_INFO_MAIL_NO 189 // TODO: enum?
enum {
mMl_NAME_TYPE_PLAYER,
mMl_NAME_TYPE_NPC,
mMl_NAME_TYPE_MUSEUM,
mMl_NAME_TYPE_PLAYER,
mMl_NAME_TYPE_NPC,
mMl_NAME_TYPE_MUSEUM,
mMl_NAME_TYPE_NUM,
mMl_NAME_TYPE_CLEAR = 0xFF
mMl_NAME_TYPE_NUM,
mMl_NAME_TYPE_CLEAR = 0xFF
};
enum {
mMl_FONT_0,
mMl_FONT_SEND,
mMl_FONT_2,
mMl_FONT_3,
mMl_FONT_4,
mMl_FONT_RECV, /* Received letter (with or without a present attached), unread */
mMl_FONT_SEND, /* Player-written letter */
mMl_FONT_RECV_READ, /* Recieved letter, with/without present, and then read it */
mMl_FONT_RECV_PLAYER_PRESENT, /* Recieved letter where present was attached, unread */
mMl_FONT_RECV_PLAYER_PRESENT_READ, /* Recieved letter where present was attached, read */
mMl_FONT_NUM
mMl_FONT_NUM
};
enum {
mMl_DATA,
mMl_DATA2,
mMl_DATA,
mMl_DATA2,
mMl_DATA_NUM
mMl_DATA_NUM
};
enum {
mMl_TYPE_MAIL = 0,
mMl_TYPE_XMAS = 1,
mMl_TYPE_SHOP_SALE_LEAFLET = 2,
mMl_TYPE_BROKER_SALE_LEAFLET = 3,
mMl_TYPE_4 = 4,
mMl_TYPE_5 = 5,
mMl_TYPE_HRA = 6,
mMl_TYPE_MAIL,
mMl_TYPE_XMAS,
mMl_TYPE_SHOP_SALE_LEAFLET,
mMl_TYPE_BROKER_SALE_LEAFLET,
mMl_TYPE_MOTHER,
mMl_TYPE_OMIKUJI,
mMl_TYPE_HRA,
mMl_TYPE_SHOP,
mMl_TYPE_SNOWMAN,
mMl_TYPE_FISHING_CONTENST,
mMl_TYPE_POSTOFFICE,
mMl_TYPE_SPNPC_PASSWORD,
mMl_TYPE_FISHING_CONTENST = 9,
mMl_TYPE_SPNPC_PASSWORD = 11,
mMl_TYPE_12 = 12
mMl_TYPE_NUM
};
/* sizeof(Mail_nm_c) == 0x16 */
typedef struct mail_nm_s {
/* 0x00 */ PersonalID_c personalID;
/* 0x14 */ u8 type;
/* 0x00 */ PersonalID_c personalID;
/* 0x14 */ u8 type;
} Mail_nm_c;
/* sizeof(mail_header_save_s) == 0x3A */
typedef struct mail_header_save_s {
/* 0x00 */ s8 header_back_start;
/* 0x01 */ u8 unknown;
/* 0x02 */ u8 header[MAIL_HEADER_LEN];
/* 0x1A */ u8 footer[MAIL_FOOTER_LEN];
/* 0x00 */ s8 header_back_start;
/* 0x01 */ u8 unknown;
/* 0x02 */ u8 header[MAIL_HEADER_LEN];
/* 0x1A */ u8 footer[MAIL_FOOTER_LEN];
} Mail_hs_c;
/* sizeof(Mail_hdr_c) == 0x2C */
typedef struct mail_header_s {
/* 0x00 */ Mail_nm_c recipient;
/* 0x16 */ Mail_nm_c sender;
/* 0x00 */ Mail_nm_c recipient;
/* 0x16 */ Mail_nm_c sender;
} Mail_hdr_c;
/* sizeof(Mail_ct_c) == 0xFC */
typedef struct mail_content_s {
/* 0x00 */ u8 font;
/* 0x01 */ u8 header_back_start;
/* 0x02 */ u8 mail_type;
/* 0x03 */ u8 paper_type;
/* 0x04 */ u8 header[MAIL_HEADER_LEN];
/* 0x1C */ u8 body[MAIL_BODY_LEN];
/* 0xDC */ u8 footer[MAIL_FOOTER_LEN];
/* 0x00 */ u8 font;
/* 0x01 */ u8 header_back_start;
/* 0x02 */ u8 mail_type;
/* 0x03 */ u8 paper_type;
/* 0x04 */ u8 header[MAIL_HEADER_LEN];
/* 0x1C */ u8 body[MAIL_BODY_LEN];
/* 0xDC */ u8 footer[MAIL_FOOTER_LEN];
} Mail_ct_c;
/* sizeof(Mail_c) == 0x12A */
typedef struct mail_s {
/* 0x000 */ Mail_hdr_c header;
/* 0x02C */ mActor_name_t present;
/* 0x02E */ Mail_ct_c content;
/* 0x000 */ Mail_hdr_c header;
/* 0x02C */ mActor_name_t present;
/* 0x02E */ Mail_ct_c content;
} Mail_c;
extern int mMl_strlen(u8* str, int size, u8 end_char);
@@ -119,9 +121,12 @@ extern int mMl_get_npcinfo_from_mail_name(AnmPersonalID_c* anm_pid, Mail_nm_c* n
extern int mMl_hunt_for_send_address(Mail_c* mail);
extern int mMl_check_send_mail(Mail_c* mail);
extern int mMl_check_set_present_myself(Mail_c* mail);
extern int mMl_send_mail_box(PersonalID_c* recipient_pid, int player_no, Mail_c* mail, mActor_name_t present, mActor_name_t paper, int mail_no, u8* sender_name, u32 proc_type);
extern int mMl_send_mail_postoffice(PersonalID_c* recipient_pid, int player_no, mActor_name_t present, mActor_name_t paper, int mail_no, u8* sender_name, u32 proc_type, u8 mail_type);
extern int mMl_send_mail(PersonalID_c* recipient_pid, int player_no, mActor_name_t present, mActor_name_t paper, int mail_no, u8* sender_name, u32 proc_type);
extern int mMl_send_mail_box(PersonalID_c* recipient_pid, int player_no, Mail_c* mail, mActor_name_t present,
mActor_name_t paper, int mail_no, u8* sender_name, u32 proc_type);
extern int mMl_send_mail_postoffice(PersonalID_c* recipient_pid, int player_no, mActor_name_t present,
mActor_name_t paper, int mail_no, u8* sender_name, u32 proc_type, u8 mail_type);
extern int mMl_send_mail(PersonalID_c* recipient_pid, int player_no, mActor_name_t present, mActor_name_t paper,
int mail_no, u8* sender_name, u32 proc_type);
extern void mMl_start_send_mail();
#ifdef __cplusplus
+16
View File
@@ -2,11 +2,27 @@
#define M_MAILBOX_OVL_H
#include "types.h"
#include "m_mailbox_ovl_h.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mMB_MAIL_COUNT HOME_MAILBOX_SIZE
typedef int (*mMB_GET_LAST_MAIL_IDX_PROC)(void);
struct mailbox_ovl_s {
u8 open_flag;
u8 _01;
u8 display_flag;
u8 _03;
int _04;
u16 mark_bitfield;
int mark_flag;
mMB_GET_LAST_MAIL_IDX_PROC get_last_mail_idx_proc;
};
extern void mMB_mailbox_ovl_construct(Submenu* submenu);
extern void mMB_mailbox_ovl_destruct(Submenu* submenu);
extern void mMB_mailbox_ovl_set_proc(Submenu* submenu);
+2
View File
@@ -7,6 +7,8 @@
extern "C" {
#endif
typedef struct mailbox_ovl_s mMB_Ovl_c;
#ifdef __cplusplus
}
#endif
+6 -1
View File
@@ -9,7 +9,12 @@
extern "C" {
#endif
struct music_ovl_s;
struct music_ovl_s {
u8 title[mIN_ITEM_NAME_LEN];
s16 title_width;
mActor_name_t title_md_item;
u32 mark_flg[2];
};
extern void mMU_music_ovl_set_proc(Submenu* submenu);
extern void mMU_music_ovl_construct(Submenu* submenu);
+1 -1
View File
@@ -7,7 +7,7 @@
extern "C" {
#endif
typedef struct music_ovl_s mMU_Overlay_c;
typedef struct music_ovl_s mMU_Ovl_c;
#ifdef __cplusplus
}
+14
View File
@@ -207,6 +207,11 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define NPC_HOUSE_ID_TO_NPC_ID(house) (house + 0x9000)
#define NPC_ID_TO_NPC_HOUSE_ID(npc) (npc - 0x9000)
#define TICKET_MONTH(n) (1 + (((n) >> 3) & 0xF))
#define TICKET_COUNT(n) (1 + ((n) & 7))
#define WISP_COUNT(n) (ITEM_IS_WISP(n) ? (1 + (n) - ITM_SPIRIT0) : 0)
#define ITEM_IS_INSECT(n) ((n) >= ITM_INSECT_START && (n) < ITM_INSECT_END)
#define ITEM_IS_WISP(n) ((n) >= ITM_SPIRIT0 && (n) <= ITM_SPIRIT4)
#define ITEM_IS_PAPER(n) ((n) >= ITM_PAPER_START && (n) <= (ITM_PAPER_END - 1))
#define ITEM_IS_CLOTH(n) ((n) >= ITM_CLOTH_START && (n) < ITM_CLOTH_END)
@@ -526,6 +531,15 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define ITEM_IS_SIGNBOARD(item) ((item) >= SIGNBOARD_START && (item) <= SIGNBOARD_END)
#define ITEM_IS_FLOWER_BAG(item) ((item) >= ITM_WHITE_PANSY_BAG && (item) <= ITM_YELLOW_TULIP_BAG)
#define ITEM_IS_EXERCISE_CARD(item) ((item) >= ITM_EXCERCISE_CARD00 && (item) <= ITM_EXCERCISE_CARD12)
#define ITEM_IS_BALLOON(item) ((item) >= ITM_BALLOON_START && (item) <= ITM_BUNNY_O_BALLOON)
#define ITEM_IS_UMBRELLA(item) ((item) >= ITM_UMBRELLA_START && (item) <= ITM_UMBRELLA_END)
#define ITEM_IS_UMBRELLA2(item) ((item) >= ITM_UMBRELLA_START && (item) <= ITM_MY_ORG_UMBRELLA7)
#define ITEM_IS_MYUMBRELLA_TOOL(item) ((item) >= ITM_MY_ORG_UMBRELLA0 && (item) <= ITM_MY_ORG_UMBRELLA7)
#define ITEM_IS_SCOOP(item) ((item) >= ITM_SHOVEL && (item) <= ITM_SHOVEL)
#define ITEM_IS_GOLD_SCOOP(item) ((item) >= ITM_GOLDEN_SHOVEL && (item) <= ITM_GOLDEN_SHOVEL)
#define BG_CATEGORY 0
#define ENV_CATEGORY 8
+7
View File
@@ -42,6 +42,13 @@ enum {
mNW_PALETTE_NUM
};
enum {
mNW_TYPE_MANEKIN,
mNW_TYPE_UMBRELLA,
mNW_TYPE_NUM
};
typedef struct original_texture_s {
u8 data[mNW_DESIGN_TEX_SIZE];
} ATTRIBUTE_ALIGN(32) mNW_original_tex_c;
+12
View File
@@ -3,15 +3,27 @@
#include "types.h"
#include "m_submenu.h"
#include "m_needlework_ovl_h.h"
#include "m_needlework.h"
#ifdef __cplusplus
extern "C" {
#endif
struct needlework_ovl_s {
u16 mark_flg;
u16 hide_flg;
mNW_original_design_c my_org[mPr_ORIGINAL_DESIGN_COUNT];
u8 my_org_no_table[mPr_ORIGINAL_DESIGN_COUNT];
};
extern u8 mNW_get_image_no(Submenu* submenu, int slot_no);
extern u8* mNW_get_image_name(Submenu* submenu, int idx);
extern int mNW_check_hide_flg(Submenu* submenu, int idx);
extern int mNW_check_mark_flg(Submenu* submenu, int idx);
extern void mNW_on_hide_flg(Submenu* submenu, int idx);
extern void mNW_clear_hide_flg(Submenu* submenu);
extern void mNW_clear_mark_flg(Submenu* submenu);
extern void mNW_draw_original(Submenu* submenu, GRAPH* graph, f32 pos_x, f32 pos_y, f32 scale, int idx, int color_flag);
extern void mNW_needlework_ovl_construct(Submenu* submenu);
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_NEEDLEWORK_OVL_H_H
#define M_NEEDLEWORK_OVL_H_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct needlework_ovl_s mNW_Ovl_c;
#ifdef __cplusplus
}
#endif
#endif
+6 -6
View File
@@ -291,14 +291,14 @@ extern int mPr_GetPossessionItemIdxItem1CategoryWithCond_cancel(Private_c* priv,
mActor_name_t cancel_item);
extern int mPr_GetPossessionItemIdxKindWithCond(Private_c* priv, mActor_name_t kind_start, mActor_name_t kind_end,
u32 cond);
extern int mPr_GetPossessionItemSum(Private_c* priv, mActor_name_t item);
extern int mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item, u32 cond);
extern int mPr_GetPossessionItemSumFGTypeWithCond_cancel(Private_c* priv, mActor_name_t fg_type, u32 cond,
extern u32 mPr_GetPossessionItemSum(Private_c* priv, mActor_name_t item);
extern u32 mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item, u32 cond);
extern u32 mPr_GetPossessionItemSumFGTypeWithCond_cancel(Private_c* priv, mActor_name_t fg_type, u32 cond,
mActor_name_t cancel_item);
extern int mPr_GetPossessionItemSumItemCategoryWithCond_cancel(Private_c* priv, u8 item1_type, u32 cond,
extern u32 mPr_GetPossessionItemSumItemCategoryWithCond_cancel(Private_c* priv, u8 item1_type, u32 cond,
mActor_name_t cancel_item);
extern int mPr_GetPossessionItemSumItemCategoryWithCond(Private_c* priv, u8 item1_type, u32 cond);
extern int mPr_GetPossessionItemSumKindWithCond(Private_c* priv, mActor_name_t kind_start, mActor_name_t kind_end,
extern u32 mPr_GetPossessionItemSumItemCategoryWithCond(Private_c* priv, u8 item1_type, u32 cond);
extern u32 mPr_GetPossessionItemSumKindWithCond(Private_c* priv, mActor_name_t kind_start, mActor_name_t kind_end,
u32 cond);
extern void mPr_SetItemCollectBit(mActor_name_t item);
extern mActor_name_t mPr_DummyPresentToTruePresent();
+1
View File
@@ -212,6 +212,7 @@ typedef struct shop_s {
/* 0x13C */ int visitor_flag; /* set when a foreign player enters Nook's shop, required for Nookington's */
} Shop_c;
#define mSP_GC_FAMICOM_TABLE_CNT 8 // update this if the # of items in mSP_gc_famicom_table is changed
extern mActor_name_t mSP_gc_famicom_table[];
extern int mSP_CollectCheck(mActor_name_t item);
+1 -1
View File
@@ -105,7 +105,7 @@ enum {
mSM_IV_OPEN_EXCHANGE,
mSM_IV_OPEN_CPMAIL,
mSM_IV_OPEN_CURATOR,
mSM_IV_OPEN_16,
mSM_IV_OPEN_PASSWORD,
mSM_IV_OPEN_NUM
};
+11 -6
View File
@@ -29,6 +29,11 @@
#include "m_hand_ovl_h.h"
#include "m_inventory_ovl_h.h"
#include "m_player.h"
#include "m_cpmail_ovl_h.h"
#include "m_cporiginal_ovl_h.h"
#include "m_haniwa_ovl_h.h"
#include "m_mailbox_ovl_h.h"
#include "m_needlework_ovl_h.h"
#ifdef __cplusplus
extern "C" {
@@ -173,8 +178,8 @@ struct submenu_overlay_s {
/* 0x98C */ mED_Ovl_c* editor_ovl;
/* 0x990 */ mBD_Ovl_c* board_ovl;
/* 0x994 */ mAD_Ovl_c* address_ovl;
/* 0x998 */ void* _998;
/* 0x99C */ void* _99C;
/* 0x998 */ mMB_Ovl_c* mailbox_ovl;
/* 0x99C */ mHW_Ovl_c* haniwa_ovl;
/* 0x9A0 */ mTI_Ovl_c* timeIn_ovl;
/* 0x9A4 */ mEE_Ovl_c* editEndChk_ovl;
/* 0x9A8 */ mWR_Ovl_c* warning_ovl;
@@ -183,14 +188,14 @@ struct submenu_overlay_s {
/* 0x9B4 */ mMP_Overlay_c* map_ovl;
/* 0x9B8 */ mNT_Ovl_c* notice_ovl;
/* 0x9BC */ mBR_Ovl_c* birthday_ovl;
/* 0x9C0 */ void* _9C0;
/* 0x9C0 */ mCM_Ovl_c* cpmail_ovl;
/* 0x9C4 */ void* _9C4;
/* 0x9C8 */ void* _9C8;
/* 0x9CC */ mCL_Ovl_c* catalog_ovl;
/* 0x9D0 */ mMU_Overlay_c* music_ovl;
/* 0x9D0 */ mMU_Ovl_c* music_ovl;
/* 0x9D4 */ mBN_Overlay_c* bank_ovl;
/* 0x9D8 */ void* _9D8;
/* 0x9DC */ void* _9DC;
/* 0x9D8 */ mNW_Ovl_c* needlework_ovl;
/* 0x9DC */ mCO_Ovl_c* cporiginal_ovl;
/* 0x9E0 */ void* _9E0;
/* 0x9E4 */ void* _9E4;
/* 0x9E8 */ mDI_Ovl_c* diary_ovl;
+141 -13
View File
@@ -10,6 +10,57 @@ extern "C" {
#endif
#define mTG_TAG_NUM 4
#define mTG_TAG_STR_LEN 16
#define mTG_TAG_SEL_STRING_LEN 35
#define mTG_TAG_FLAG_EDGE_FOOT_SELECT (1 << 0)
#define mTG_MAIL_FLAG_PRESENT (1 << 0)
#define mTG_MAIL_FLAG_RECV (1 << 1)
enum {
mTG_MARK_CHK,
mTG_MARK_ON,
mTG_MARK_OFF,
mTG_MARK_RVS,
mTG_MARK_CLR,
mTG_MARK_CHK_ALL0,
mTG_MARK_NUM
};
enum {
mTG_MARK_TYPE_NONE,
mTG_MARK_TYPE_INV_FG_ITEM,
mTG_MARK_TYPE_INV_PLAYERROOM_ITEM,
mTG_MARK_TYPE_INV_OTHERROOM_ITEM,
mTG_MARK_TYPE_INV_SELL_ITEM,
mTG_MARK_TYPE_INV_FG_MAIL,
mTG_MARK_TYPE_INV_MAILBOX,
mTG_MARK_TYPE_CPMAIL_MAIL,
mTG_MARK_TYPE_MAILBOX,
mTG_MARK_TYPE_CPMAIL_CPMAIL,
mTG_MARK_TYPE_MUSIC,
mTG_MARK_TYPE_NEEDLEWORK_ORIGINAL,
mTG_MARK_TYPE_CPORIGINAL_ORIGINAL,
mTG_MARK_TYPE_NUM
};
enum {
mTG_CHANGE_ORIGINAL_MARK_NONE,
mTG_CHANGE_ORIGINAL_MARK_DECIDE,
mTG_CHANGE_ORIGINAL_MARK_MOVE,
mTG_CHANGE_ORIGINAL_MARK_NUM
};
enum {
mTG_CHANGE_MAIL_MARK_DECIDE,
mTG_CHANGE_MAIL_MARK_MOVE,
mTG_CHANGE_MAIL_MARK_NUM
};
enum {
mTG_TYPE_NONE,
@@ -121,24 +172,53 @@ enum {
mTG_TABLE_GBA,
mTG_TABLE_GBA_NW,
mTG_TABLE_CARD,
mTG_TABLE_GBA_NW2,
mTG_TABLE_CARD_NW,
mTG_TABLE_NUM
};
enum {
mTG_WIN_ITEM,
mTG_WIN_QITEM,
mTG_WIN_SELECT,
mTG_WIN_NUM
};
enum {
mTG_STR0,
mTG_STR1,
mTG_STR2,
mTG_STR_NUM
};
#define mTG_RETURN_CLOSE 0
#define mTG_RETURN_KEEP 1
#define mTG_MARK_IDX_UNSET 0x7FFF
/* sizeof(mTG_tag_c) == 0xB4 */
typedef struct tag_s {
u8 type;
u8 _01;
u8 _02;
u8 _03;
u8 arrow_dir;
u8 str2_type;
u8 flags;
f32 _04[2];
f32 pos[2];
u8 _14[0x38 - 0x14];
f32 base_pos[2];
f32 body_scale[2];
f32 arrow_scale[2];
f32 body_ofs[2];
f32 text_ofs[2];
f32 _34;
int table;
int _3C;
int _40;
u8 _44[0xB4 - 0x44];
int tag_col;
int tag_row;
f32 scale;
u8 str0[mTG_TAG_SEL_STRING_LEN];
u8 str1[mTG_TAG_SEL_STRING_LEN];
u8 str2[mTG_TAG_SEL_STRING_LEN];
u8 _B1[0xB4 - 0xB1];
} mTG_tag_c;
typedef void (*mTG_INIT_TAG_DATA_ITEM_WIN_PROC)(Submenu*);
@@ -148,7 +228,49 @@ typedef void (*mTG_EXCHANGE_PROC)(Submenu*, mSM_MenuInfo_c*);
typedef Mail_c* (*mTG_GET_MAIL_POINTER_PROC)(Submenu*, mHD_Ovl_c*);
typedef int (*mTG_GET_TABLE_IDX_PROC)(mTG_tag_c*);
/* TODO */
typedef struct tag_cpmail_mark_pos_s {
Mail_c* _00;
f32 pos[2];
} mTG_cpmail_mark_pos_c;
typedef struct tag_cpmail_mark_s {
Mail_c* _00[4];
Mail_c* mail_tbl[4];
f32 _20[2][2];
f32 _30[2][2];
s16 idx_tbl[4];
s16 mode;
s16 _4A;
} mTG_cpmail_mark_c;
enum {
mTG_ORG_TYPE_NW,
mTG_ORG_TYPE_CO,
mTG_ORG_TYPE_NUM
};
typedef struct tag_cporiginal_mark_s {
f32 _00[mTG_ORG_TYPE_NUM][2];
f32 _10[mTG_ORG_TYPE_NUM][2];
s16 idx[mTG_ORG_TYPE_NUM];
} mTG_cporiginal_mark_c;
typedef struct tag_cporiginal_mark_entry_s {
mActor_name_t item;
float pos[2];
} mTG_cporiginal_mark_entry_c;
/* sizeof(mTG_mark_original_c) == 0x34 */
typedef struct tag_mark_original_s {
/* 0x00 */ mTG_cporiginal_mark_c mark[1];
/* 0x24 */ f32 move_percent;
/* 0x28 */ u16 mark_flg[mTG_ORG_TYPE_NUM];
/* 0x2C */ s16 mark_max[mTG_ORG_TYPE_NUM];
/* 0x30 */ s16 mark_mode;
} mTG_mark_original_c;
/* sizeof(mTG_Ovl_c) == 0x3C4 */
struct tag_ovl_s {
/* 0x000 */ int sel_tag_idx;
/* 0x004 */ int ret_tag_idx;
@@ -160,11 +282,17 @@ struct tag_ovl_s {
/* 0x2E8 */ mTG_GET_MAIL_POINTER_PROC get_mail_pointer_proc;
/* 0x2EC */ mTG_GET_TABLE_IDX_PROC get_table_idx_proc;
/* 0x2F0 */ s16 item_name_wait_time;
/* 0x2F2 */ u8 _2F2[0x3C4 - 0x2F2];
/* 0x2F4 */ mTG_cpmail_mark_pos_c _2F4[4];
/* 0x324 */ mTG_cpmail_mark_c cpmail_mark[1];
/* 0x370 */ f32 _370;
/* 0x374 */ u16 nw_gba_flags;
/* 0x376 */ u16 _02;
/* 0x378 */ mTG_cporiginal_mark_entry_c original_entries[mTG_ORG_TYPE_NUM];
/* 0x390 */ mTG_mark_original_c original_mark;
};
extern int mTG_mark_main(Submenu*, mSM_MenuInfo_c*, int, int);
extern int mTG_mark_mainX(Submenu*, mSM_MenuInfo_c*, int, int, int, int);
extern int mTG_mark_main(Submenu*, mSM_MenuInfo_c*, int, int*);
extern int mTG_mark_mainX(Submenu*, mSM_MenuInfo_c*, int, int, int, int*);
extern void mTG_tag_ovl_construct(Submenu* submenu);
extern void mTG_tag_ovl_destruct(Submenu* submenu);
+1 -1
View File
@@ -31,7 +31,7 @@ enum {
mWR_WARNING_5,
mWR_WARNING_6,
mWR_WARNING_7,
mWR_WARNING_8,
mWR_WARNING_SELL_QUEST_ITEM,
mWR_WARNING_PUT_MAX_FURNITURE,
mWR_WARNING_PUT_FURNITURE,
mWR_WARNING_PUT_ITEM,
-1
View File
@@ -37,7 +37,6 @@ enum {
#define aMR_FTR_BANK_NUM 100
#define aMR_FTR_BANK_SIZE 0x800
#define aMR_CLIP (Common_Get(clip).my_room_clip)
#define aMR_BOUNDS_OK(x, z) \
((x) > (aMR_MIN_BOUND - 1) && (x) < (aMR_MAX_BOUND + 1) && (z) > (aMR_MIN_BOUND - 1) && (z) < (aMR_MAX_BOUND + 1))
+7 -7
View File
@@ -1863,14 +1863,14 @@ static int aMR_JudgeBreedNewFurniture(GAME* game, u16 ftr_no, int* ut_x, int* ut
u16 angle;
if (mCoBG_CheckUtFlat(&player_pos) == FALSE) {
return -2;
return aMR_JUDGE_CANT_PLACE_FTR;
}
if (aMR_CLIP != NULL && my_room != NULL && aMR_CheckReserveFlag(my_room, 0) == FALSE) {
*rotation = 0;
*square_offset = 0;
*layer = 0;
return -2;
return aMR_JUDGE_CANT_PLACE_FTR;
}
aMR_Wpos2PlaceNumber(&cur_ut_x, &cur_ut_z, player_pos, 0);
@@ -1907,7 +1907,7 @@ static int aMR_JudgeBreedNewFurniture(GAME* game, u16 ftr_no, int* ut_x, int* ut
for (i = 0; i < 5; i++) {
if (aMR_WeightPossible((ACTOR*)my_room, profile->shape) == FALSE) {
return -1;
return aMR_JUDGE_MAX_FTR;
}
target_ut_x = cur_ut_x;
@@ -1975,7 +1975,7 @@ static int aMR_JudgeBreedNewFurniture(GAME* game, u16 ftr_no, int* ut_x, int* ut
for (i = 0; i < 5; i++) {
angle_idx = (int)angle_idx;
if (aMR_WeightPossible((ACTOR*)my_room, profile->shape) == FALSE) {
return -1;
return aMR_JUDGE_MAX_FTR;
}
target_ut_x = cur_ut_x;
@@ -2084,16 +2084,16 @@ static int aMR_JudgeBreedNewFurniture(GAME* game, u16 ftr_no, int* ut_x, int* ut
}
}
return -2;
return aMR_JUDGE_CANT_PLACE_FTR;
}
}
return -1;
return aMR_JUDGE_MAX_FTR;
} else {
*rotation = 0;
*square_offset = 0;
*layer = 0;
return -3;
return aMR_JUDGE_OTHER_ROOM;
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ static void aSL_SetShopRenewalChirashi_Notice(int shop_level, lbRTC_time_c* time
mHandbill_Load_HandbillFromRom(content->header, &header_back_start, content->footer, content->body,
renewal_chirashi_bunmen[shop_level & 3]);
content->header_back_start = header_back_start;
content->font = mMl_FONT_0;
content->font = mMl_FONT_RECV;
content->paper_type = (u8)ITM_PAPER55;
content->mail_type = mMl_TYPE_SHOP_SALE_LEAFLET;
mPr_CopyPersonalID(&mail.header.recipient.personalID, &Save_Get(private_data[player_no]).player_ID);
+2 -1
View File
@@ -1194,7 +1194,8 @@ static void mBD_set_writing_header(Submenu* submenu, GAME* game, mSM_MenuInfo_c*
mem_copy(tmp_header, mail_content->header, board_ovl->lengths[mBD_FIELD_HEADER]);
len = board_ovl->lengths[mBD_FIELD_HEADER];
} else if (mail_content->mail_type == mMl_TYPE_SHOP_SALE_LEAFLET ||
mail_content->mail_type == mMl_TYPE_BROKER_SALE_LEAFLET || mail_content->mail_type == mMl_TYPE_5) {
mail_content->mail_type == mMl_TYPE_BROKER_SALE_LEAFLET ||
mail_content->mail_type == mMl_TYPE_OMIKUJI) {
mem_copy(tmp_header, mail_content->header, MAIL_HEADER_LEN);
len = MAIL_HEADER_LEN;
} else {
+1 -1
View File
@@ -560,7 +560,7 @@ static void mCL_move_Play(Submenu* submenu, mSM_MenuInfo_c* menu_info) {
submenu->overlay->menu_control.tag_move_func(submenu, menu_info);
if (catalog_ovl->change_flag) {
catalog_ovl->menu_data[catalog_ovl->page_order[0]].y_idx = submenu->overlay->tag_ovl->tags[0]._40;
catalog_ovl->menu_data[catalog_ovl->page_order[0]].y_idx = submenu->overlay->tag_ovl->tags[0].tag_row;
mCL_item_data_set(submenu, catalog_ovl->page_order[0]);
catalog_ovl->change_flag = FALSE;
} else {
+1 -1
View File
@@ -454,7 +454,7 @@ static void mFR_GetFishPresentMail(mFR_record_c* record, Mail_c* mail) {
);
mail->content.header_back_start = header_back_start;
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.mail_type = mMl_TYPE_FISHING_CONTENST;
mail->present = present;
mail->content.paper_type = 15; // deep sea paper
+16 -16
View File
@@ -86,7 +86,7 @@ static void mHD_hand_pos_get(Submenu* submenu, f32* pos, int table_type, int tab
pos[1] += 23.0f;
}
} else if ((table_type == mTG_TABLE_GBA || table_type == mTG_TABLE_GBA_NW || table_type == mTG_TABLE_CARD ||
table_type == mTG_TABLE_GBA_NW2 || table_type == mTG_TABLE_CPORIGINAL ||
table_type == mTG_TABLE_CARD_NW || table_type == mTG_TABLE_CPORIGINAL ||
table_type == mTG_TABLE_CPORIGINAL_NW) &&
item != EMPTY_NO) {
pos[0] += -2.0f;
@@ -178,7 +178,7 @@ static void mHD_drop_item(Submenu* submenu, mTG_tag_c* tag, mActor_name_t* item,
table = tag->table;
}
if (item != NULL && *item != EMPTY_NO && table != mTG_TABLE_GBA_NW2 && table != mTG_TABLE_GBA_NW) {
if (item != NULL && *item != EMPTY_NO && table != mTG_TABLE_CARD_NW && table != mTG_TABLE_GBA_NW) {
now_item = *item;
mTG_mark_mainX(submenu, menu_info, table, table_idx, 2, 0);
@@ -222,11 +222,11 @@ static void mHD_drop_item(Submenu* submenu, mTG_tag_c* tag, mActor_name_t* item,
sAdo_SysTrgStart(NA_SE_41C);
if (mail != NULL) {
if (mail->content.font == mMl_FONT_0) {
mail->content.font = mMl_FONT_3;
if (mail->content.font == mMl_FONT_RECV) {
mail->content.font = mMl_FONT_RECV_PLAYER_PRESENT;
hand_ovl->info.item_cond = mPr_ITEM_COND_PRESENT;
} else if (mail->content.font == mMl_FONT_2) {
mail->content.font = mMl_FONT_4;
} else if (mail->content.font == mMl_FONT_RECV_READ) {
mail->content.font = mMl_FONT_RECV_PLAYER_PRESENT_READ;
hand_ovl->info.item_cond = mPr_ITEM_COND_PRESENT;
}
}
@@ -280,16 +280,16 @@ static void mHD_drop_item(Submenu* submenu, mTG_tag_c* tag, mActor_name_t* item,
mTG_mark_mainX(submenu, menu_info, table, table_idx, 2, 0);
if (table == mTG_TABLE_GBA_NW || table == mTG_TABLE_GBA_NW2) {
if (table == mTG_TABLE_GBA_NW || table == mTG_TABLE_CARD_NW) {
mGB_copy_image(submenu, hand_ovl->info.item, *item);
} else if (item != NULL) {
*item = hand_ovl->info.item;
if (mail != NULL) {
if (mail->content.font == mMl_FONT_0) {
mail->content.font = mMl_FONT_3;
} else if (mail->content.font == mMl_FONT_2) {
mail->content.font = mMl_FONT_4;
if (mail->content.font == mMl_FONT_RECV) {
mail->content.font = mMl_FONT_RECV_PLAYER_PRESENT;
} else if (mail->content.font == mMl_FONT_RECV_READ) {
mail->content.font = mMl_FONT_RECV_PLAYER_PRESENT_READ;
}
}
}
@@ -452,7 +452,7 @@ static void mHD_open_sack(Submenu* submenu) {
hand_ovl->info.next_act = mHD_ACTION_SASU;
hand_ovl->info.wait_timer = 42;
sAdo_SysTrgStart(MONO(NA_SE_52));
submenu->overlay->inventory_ovl->disp_money_change_frames = amount / 42;
submenu->overlay->inventory_ovl->disp_money_chg_step = amount / 42;
}
static void mHD_drop_mail(Submenu* submenu, Mail_c* mail) {
@@ -564,8 +564,8 @@ static void mHD_open_end_proc_item_type6(Submenu* submenu, int idx, int table) {
mHD_drop_item(submenu, tag, &Save_Get(homes[menu_info->data1]).haniwa.items[idx].item, NULL);
if (flag == TRUE) {
submenu->overlay->tag_ovl->item_name_wait_time = 0;
submenu->overlay->tag_ovl->chg_tag_func_proc(submenu, tag->table, mTG_TYPE_HANIWA_PUT_ITEM, 0, tag->pos[0],
tag->pos[1]);
submenu->overlay->tag_ovl->chg_tag_func_proc(submenu, tag->table, mTG_TYPE_HANIWA_PUT_ITEM, 0, tag->base_pos[0],
tag->base_pos[1]);
}
}
@@ -589,7 +589,7 @@ static void mHD_open_end_proc_item_type17(Submenu* submenu, int idx, int table)
}
break;
case mTG_TABLE_GBA_NW:
case mTG_TABLE_GBA_NW2:
case mTG_TABLE_CARD_NW:
tmp_item = RSV_NW_ORIGINAL0 + idx;
break;
case mTG_TABLE_CPORIGINAL:
@@ -664,7 +664,7 @@ static void mHD_open_end_proc_item(Submenu* submenu) {
&mHD_open_end_proc_item_type17, /* mTG_TABLE_GBA */
&mHD_open_end_proc_item_type17, /* mTG_TABLE_GBA_NW */
&mHD_open_end_proc_item_type17, /* mTG_TABLE_CARD */
&mHD_open_end_proc_item_type17, /* mTG_TABLE_GBA_NW2 */
&mHD_open_end_proc_item_type17, /* mTG_TABLE_CARD_NW */
};
mSM_MenuInfo_c* menu_info;
+10 -10
View File
@@ -1259,7 +1259,7 @@ static void mIV_move_Play(Submenu* submenu, mSM_MenuInfo_c* menu_info) {
case mSM_IV_OPEN_MINIDISK:
case mSM_IV_OPEN_SHRINE:
case mSM_IV_OPEN_CURATOR:
case mSM_IV_OPEN_16:
case mSM_IV_OPEN_PASSWORD:
submenu->overlay->tag_ovl->chg_tag_func_proc(submenu, mTG_TABLE_ITEM, mTG_TYPE_NONE, unselected_num,
0.0f, 0.0f);
break;
@@ -1274,7 +1274,7 @@ static void mIV_move_Play(Submenu* submenu, mSM_MenuInfo_c* menu_info) {
0.0f, 0.0f);
tag_ovl->item_name_wait_time = 0;
submenu->overlay->tag_ovl->chg_tag_func_proc(submenu, mTG_TABLE_ITEM, mTG_TYPE_QUEST_ITEM, 0,
tag_ovl->tags[0].pos[0], tag_ovl->tags[0].pos[1]);
tag_ovl->tags[0].base_pos[0], tag_ovl->tags[0].base_pos[1]);
break;
case mSM_IV_OPEN_SEND_MAIL:
submenu->overlay->tag_ovl->chg_tag_func_proc(submenu, mTG_TABLE_MAIL, mTG_TYPE_NONE, unselected_num,
@@ -1708,10 +1708,10 @@ static void mIV_set_mail(Submenu* submenu, mSM_MenuInfo_c* menu_info, GRAPH* gra
int menu_flag;
int mark_flag;
if (inv_ovl->remove_timer > 0 && (tag->table == mTG_TABLE_MAIL || inv_ovl->_5E4 == 1)) {
if (inv_ovl->_5E4 == 1) {
select_mask = inv_ovl->_5E2;
} else if (inv_ovl->_5E4 == 0) {
if (inv_ovl->remove_timer > 0 && (tag->table == mTG_TABLE_MAIL || inv_ovl->mail_mark_flag == TRUE)) {
if (inv_ovl->mail_mark_flag == TRUE) {
select_mask = inv_ovl->mail_mark_bitfield2;
} else if (inv_ovl->mail_mark_flag == FALSE) {
select_mask = 1 << tag_ovl->get_table_idx_proc(tag);
}
}
@@ -1739,7 +1739,7 @@ static void mIV_set_mail(Submenu* submenu, mSM_MenuInfo_c* menu_info, GRAPH* gra
scale = 1.0f;
}
if ((inv_ovl->_5E2 & (1 << i)) != 0 && inv_ovl->_5E4 == 0) {
if ((inv_ovl->mail_mark_bitfield2 & (1 << i)) != 0 && inv_ovl->mail_mark_flag == FALSE) {
mark_flag = TRUE;
} else {
mark_flag = FALSE;
@@ -1992,7 +1992,7 @@ static void mIV_inventory_ovl_init(Submenu* submenu, mSM_MenuInfo_c* menu_info,
break;
}
case mSM_IV_OPEN_16: {
case mSM_IV_OPEN_PASSWORD: {
inv_ovl->selectable_item_bitfield = menu_info->data1;
inv_ovl->selectable_mail_bitfield = 0;
break;
@@ -2079,9 +2079,9 @@ static void mIV_inventory_ovl_init(Submenu* submenu, mSM_MenuInfo_c* menu_info,
inv_ovl->page_order[1] = mIV_PAGE_FISH_COLLECTION;
inv_ovl->page_order[2] = mIV_PAGE_INSECT_COLLECTION;
inv_ovl->page_move_timer = 0;
inv_ovl->_5E4 = 0;
inv_ovl->mail_mark_flag = FALSE;
inv_ovl->item_mark_bitfield = 0;
inv_ovl->_5E2 = 0;
inv_ovl->mail_mark_bitfield2 = 0;
inv_ovl->wc_flag = FALSE;
if (menu_info->data0 == mSM_IV_OPEN_MAILBOX) {
+2 -2
View File
@@ -199,7 +199,7 @@ extern int mMl_check_send_mail(Mail_c* mail) {
extern int mMl_check_set_present_myself(Mail_c* mail) {
u8 font = mail->content.font;
if (font == mMl_FONT_SEND || font == mMl_FONT_3 || font == mMl_FONT_4) {
if (font == mMl_FONT_SEND || font == mMl_FONT_RECV_PLAYER_PRESENT || font == mMl_FONT_RECV_PLAYER_PRESENT_READ) {
return TRUE;
}
@@ -235,7 +235,7 @@ static void mMl_get_mail_to_player_com(Mail_c* mail, PersonalID_c* recipient_pid
mMl_clear_mail(mail);
(*get_proc[proc_type])(mail, mail_no);
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.mail_type = mail_type;
mPr_CopyPersonalID(&mail->header.recipient.personalID, recipient_pid);
+1 -1
View File
@@ -70,7 +70,7 @@ static int mMkRm_NoMarkLetter(int arrange_idx, int handbill_no) {
mMl_clear_mail(&mail);
mHandbill_Load_HandbillFromRom(mail.content.header, &header_back_start, mail.content.footer, mail.content.body, handbill_no);
mail.content.font = mMl_FONT_0;
mail.content.font = mMl_FONT_RECV;
mail.content.header_back_start = header_back_start;
mail.content.mail_type = mMl_TYPE_HRA;
mail.content.paper_type = 51; /* wing paper */
+1 -1
View File
@@ -2932,7 +2932,7 @@ static void mMkRm_SendMarkLetter(mHm_hs_c* house, int points, int room_size, u8*
mMl_clear_mail(&letter);
mHandbill_Load_HandbillFromRom(letter.content.header, &header_back_start, letter.content.footer,
letter.content.body, handbill_no);
letter.content.font = mMl_FONT_0;
letter.content.font = mMl_FONT_RECV;
letter.content.header_back_start = header_back_start;
letter.content.mail_type = mMl_TYPE_HRA;
letter.content.paper_type = 51; /* wing paper */
+3 -3
View File
@@ -1571,7 +1571,7 @@ static void mNpc_GetRemailData(Mail_c* mail, PersonalID_c* pid, AnmPersonalID_c*
int paper_no;
(*get_remail[cond])(mail, pid, anm_id, remail, foreign);
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.mail_type = mMl_TYPE_MAIL;
mPr_CopyPersonalID(&mail->header.recipient.personalID, pid);
mail->header.recipient.type = mMl_NAME_TYPE_PLAYER;
@@ -1680,7 +1680,7 @@ static void mNpc_LoadMailDataCommon2(Mail_c* mail, PersonalID_c* pid, AnmPersona
mem_copy(mail->content.header, super, MAIL_HEADER_LEN);
mem_copy(mail->content.footer, ps, MAIL_FOOTER_LEN);
mail->content.header_back_start = header_back_start;
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.mail_type = mMl_TYPE_MAIL;
mPr_CopyPersonalID(&mail->header.recipient.personalID, pid);
mail->header.recipient.type = mMl_NAME_TYPE_PLAYER;
@@ -1920,7 +1920,7 @@ static void mNpc_GetXmasCardData(Mail_c* mail, PersonalID_c* pid) {
mHandbill_Load_HandbillFromRom(mail->content.header, &header_back_start, mail->content.footer, mail->content.body,
0xD7);
mail->content.header_back_start = header_back_start;
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.mail_type = mMl_TYPE_XMAS;
mPr_CopyPersonalID(&mail->header.recipient.personalID, pid);
mail->header.recipient.type = mMl_NAME_TYPE_PLAYER;
+1 -1
View File
@@ -164,7 +164,7 @@ static void mPO_delivery_mail_with_item(Mail_c* mail, int mail_no, mActor_name_t
mHandbill_Load_HandbillFromRom(mail->content.header, &header_back_start, mail->content.footer, mail->content.body,
mail_no);
mail->content.font = mMl_FONT_0;
mail->content.font = mMl_FONT_RECV;
mail->content.header_back_start = header_back_start;
mail->content.mail_type = 7;
mail->content.paper_type = ITM_PAPER55;
+6 -6
View File
@@ -436,7 +436,7 @@ extern int mPr_GetPossessionItemIdxKindWithCond(Private_c* priv, mActor_name_t k
return idx;
}
extern int mPr_GetPossessionItemSum(Private_c* priv, mActor_name_t item) {
extern u32 mPr_GetPossessionItemSum(Private_c* priv, mActor_name_t item) {
int sum = 0;
if (priv != NULL) {
@@ -454,7 +454,7 @@ extern int mPr_GetPossessionItemSum(Private_c* priv, mActor_name_t item) {
return sum;
}
extern int mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item, u32 cond) {
extern u32 mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item, u32 cond) {
int sum = 0;
if (priv != NULL) {
@@ -472,7 +472,7 @@ extern int mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item,
return sum;
}
extern int mPr_GetPossessionItemSumFGTypeWithCond_cancel(Private_c* priv, mActor_name_t fg_type, u32 cond,
extern u32 mPr_GetPossessionItemSumFGTypeWithCond_cancel(Private_c* priv, mActor_name_t fg_type, u32 cond,
mActor_name_t cancel_item) {
int sum = 0;
@@ -492,7 +492,7 @@ extern int mPr_GetPossessionItemSumFGTypeWithCond_cancel(Private_c* priv, mActor
return sum;
}
extern int mPr_GetPossessionItemSumItemCategoryWithCond_cancel(Private_c* priv, u8 item1_type, u32 cond,
extern u32 mPr_GetPossessionItemSumItemCategoryWithCond_cancel(Private_c* priv, u8 item1_type, u32 cond,
mActor_name_t cancel_item) {
int sum = 0;
@@ -512,7 +512,7 @@ extern int mPr_GetPossessionItemSumItemCategoryWithCond_cancel(Private_c* priv,
return sum;
}
extern int mPr_GetPossessionItemSumItemCategoryWithCond(Private_c* priv, u8 item1_type, u32 cond) {
extern u32 mPr_GetPossessionItemSumItemCategoryWithCond(Private_c* priv, u8 item1_type, u32 cond) {
int sum = 0;
if (priv != NULL) {
@@ -531,7 +531,7 @@ extern int mPr_GetPossessionItemSumItemCategoryWithCond(Private_c* priv, u8 item
return sum;
}
extern int mPr_GetPossessionItemSumKindWithCond(Private_c* priv, mActor_name_t kind_start, mActor_name_t kind_end,
extern u32 mPr_GetPossessionItemSumKindWithCond(Private_c* priv, mActor_name_t kind_start, mActor_name_t kind_end,
u32 cond) {
int sum = 0;
+1 -1
View File
@@ -603,7 +603,7 @@ static void mQst_GetRemailData(Mail_c* letter, PersonalID_c* recipient_id, AnmPe
mem_copy(letter->content.header, header, MAIL_HEADER_LEN);
mem_copy(letter->content.footer, footer, MAIL_FOOTER_LEN);
letter->content.header_back_start = header_back_pos;
letter->content.font = mMl_FONT_0;
letter->content.font = mMl_FONT_RECV;
letter->content.mail_type = 0;
mPr_CopyPersonalID(&letter->header.recipient.personalID, recipient_id);
+2 -2
View File
@@ -1094,7 +1094,7 @@ extern void mSP_ShopItsumoChirashi(int house_no, int shop_level, mActor_name_t i
mMl_clear_mail(&leaflet);
mHandbill_Load_HandbillFromRom(leaflet.content.header, &header_back_start, leaflet.content.footer,
leaflet.content.body, rare_chirashi_bunmen[shop_level][type & 1]);
leaflet.content.font = mMl_FONT_0;
leaflet.content.font = mMl_FONT_RECV;
leaflet.content.header_back_start = header_back_start;
leaflet.content.mail_type = mMl_TYPE_SHOP_SALE_LEAFLET;
leaflet.content.paper_type = ITM_PAPER55; // simple paper
@@ -1226,7 +1226,7 @@ extern void mSP_SetRenewalChiraswhi_AppoDay() {
mMl_clear_mail(&leaflet);
mHandbill_Load_HandbillFromRom(content->header, &header_back_start, content->footer, content->body,
chirashi_idx_appoday[shop_level]);
leaflet.content.font = mMl_FONT_0;
leaflet.content.font = mMl_FONT_RECV;
leaflet.content.header_back_start = header_back_start;
leaflet.content.mail_type = mMl_TYPE_SHOP_SALE_LEAFLET;
leaflet.content.paper_type = ITM_PAPER55; // simple paper
+7 -5
View File
@@ -377,7 +377,9 @@ static mActor_name_t mSC_Radio_have_taisou_card() {
Private_c* priv = Common_Get(now_private);
for (i = 0; i < 13; i++) {
if (mPr_GetPossessionItemSumWithCond(priv, ITM_EXCERCISE_CARD00 + i, mPr_ITEM_COND_NORMAL) > 0) {
int sum = mPr_GetPossessionItemSumWithCond(priv, ITM_EXCERCISE_CARD00 + i, mPr_ITEM_COND_NORMAL);
if (sum > 0) {
return ITM_EXCERCISE_CARD00 + i;
}
}
@@ -550,7 +552,7 @@ extern int mSC_Radio_Set_Talk_Proc(TAISOU_NPC0_ACTOR* taisou_actor) {
msg_no = 0x3423;
}
if ((u32)mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
if (mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
mPr_ITEM_COND_NORMAL) == 0) {
taisou_actor->talk_proc = mSCR_TALK_NEXT;
} else {
@@ -574,7 +576,7 @@ extern int mSC_Radio_Set_Talk_Proc(TAISOU_NPC0_ACTOR* taisou_actor) {
msg_no = 0x342F;
}
if ((u32)mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
if (mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
mPr_ITEM_COND_NORMAL) == 0) {
taisou_actor->talk_proc = mSCR_TALK_NEXT;
} else {
@@ -628,7 +630,7 @@ extern int mSC_Radio_Set_Talk_Proc(TAISOU_NPC0_ACTOR* taisou_actor) {
msg_no = 0x342F;
}
if ((u32)mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
if (mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO,
mPr_ITEM_COND_NORMAL) == 0) {
taisou_actor->talk_proc = mSCR_TALK_NEXT;
} else {
@@ -785,7 +787,7 @@ static void mSCR_talk_before_give(TAISOU_NPC0_ACTOR* taisou_actor, GAME_PLAY* pl
mMsg_Window_c* msg_win = mMsg_Get_base_window_p();
if (mMsg_Check_MainNormalContinue(msg_win)) {
if ((u32)mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO, mPr_ITEM_COND_NORMAL) == 0) {
if (mPr_GetPossessionItemSumWithCond(Common_Get(now_private), EMPTY_NO, mPr_ITEM_COND_NORMAL) == 0) {
mMsg_Set_continue_msg_num(msg_win, mSC_Radio_msg(taisou_actor, 2));
taisou_actor->talk_proc = mSCR_TALK_9;
} else {
+1 -1
View File
@@ -1527,7 +1527,7 @@ static void mSM_draw_mail(GRAPH* graph, f32 pos_x, f32 pos_y, f32 scale, Mail_c*
if (mMl_check_send_mail(mail)) {
type = mSM_MAIL_SEND;
} else if (mail->content.font == mMl_FONT_4 || mail->content.font == mMl_FONT_2) {
} else if (mail->content.font == mMl_FONT_RECV_PLAYER_PRESENT_READ || mail->content.font == mMl_FONT_RECV_READ) {
type = mSM_MAIL_NORMAL2;
} else {
type = mSM_MAIL_NORMAL;
+8880
View File
File diff suppressed because it is too large Load Diff
+379 -386
View File
@@ -2,581 +2,574 @@
#include "m_house.h"
static int sChk_block_num_sub(u32 block_x, u32 block_z) {
int res = FALSE;
int res = FALSE;
if (block_x > FG_BLOCK_X_NUM && block_x != 0xFF) {
mFRm_ERRORLINE(79);
res = TRUE;
}
if (block_x > FG_BLOCK_X_NUM && block_x != 0xFF) {
mFRm_ERRORLINE(79);
res = TRUE;
}
if (block_z > FG_BLOCK_Z_NUM && block_z != 0xFF) {
mFRm_ERRORLINE(90);
res = TRUE;
}
if (block_z > FG_BLOCK_Z_NUM && block_z != 0xFF) {
mFRm_ERRORLINE(90);
res = TRUE;
}
if (block_z == mISL_BLOCK_Z && (block_x == mISL_BLOCK_X0 || block_x == mISL_BLOCK_X1)) {
res = FALSE;
}
if (block_z == mISL_BLOCK_Z && (block_x == mISL_BLOCK_X0 || block_x == mISL_BLOCK_X1)) {
res = FALSE;
}
return res;
return res;
}
static int sChk_ut_num_sub(u32 ut_x, u32 ut_z) {
int res = FALSE;
int res = FALSE;
if (ut_x >= UT_X_NUM && ut_x != 0xFF) {
mFRm_ERRORLINE(140);
res = TRUE;
}
if (ut_x >= UT_X_NUM && ut_x != 0xFF) {
mFRm_ERRORLINE(140);
res = TRUE;
}
if (ut_z >= UT_Z_NUM && ut_z != 0xFF) {
mFRm_ERRORLINE(151);
res = TRUE;
}
if (ut_z >= UT_Z_NUM && ut_z != 0xFF) {
mFRm_ERRORLINE(151);
res = TRUE;
}
return res;
return res;
}
static int sChk_ItemFG_sub(mActor_name_t item) {
int res = FALSE;
int res = FALSE;
if (item != EMPTY_NO && (ITEM_NAME_GET_TYPE(item) >= NAME_TYPE_WARP || ITEM_NAME_GET_TYPE(item) < NAME_TYPE_FTR0)) {
mFRm_ERRORLINE(201);
res = TRUE;
}
if (item != EMPTY_NO && (ITEM_NAME_GET_TYPE(item) >= NAME_TYPE_WARP || ITEM_NAME_GET_TYPE(item) < NAME_TYPE_FTR0)) {
mFRm_ERRORLINE(201);
res = TRUE;
}
return res;
return res;
}
static int sChk_cloth_sub(mActor_name_t item) {
int valid_cloth;
int res = FALSE;
int valid_cloth;
int res = FALSE;
valid_cloth = item == RSV_CLOTH || (item >= ITM_CLOTH_START && item < ITM_CLOTH_END);
valid_cloth = item == RSV_CLOTH || (item >= ITM_CLOTH_START && item < ITM_CLOTH_END);
if (valid_cloth == FALSE && item != EMPTY_NO) {
mFRm_ERRORLINE(247);
res = TRUE;
}
if (valid_cloth == FALSE && item != EMPTY_NO) {
mFRm_ERRORLINE(247);
res = TRUE;
}
return res;
return res;
}
static int sChk_fruit_sub(mActor_name_t item) {
int res = FALSE;
int res = FALSE;
if (item < ITM_FOOD_APPLE || item > ITM_FOOD_ORANGE) {
mFRm_ERRORLINE(288);
res = TRUE;
}
if (item < ITM_FOOD_APPLE || item > ITM_FOOD_ORANGE) {
mFRm_ERRORLINE(288);
res = TRUE;
}
return res;
return res;
}
static int sChk_OSRTCTime_sub(OSRTCTime* time) {
int res = FALSE;
int res = FALSE;
if (time->year < GAME_YEAR_MIN || time->year > GAME_YEAR_MAX) {
res = TRUE;
}
if (time->month == 0 || time->month > lbRTC_MONTHS_MAX) {
res = TRUE;
}
if (time->day == 0 || time->day > 31) {
res = TRUE;
}
if (time->weekday > lbRTC_SATURDAY) {
res = TRUE;
}
if (time->hour > 23) {
res = TRUE;
}
if (time->min > 59) {
res = TRUE;
}
if (time->sec > 59) {
res = TRUE;
}
if (res == TRUE) {
if (time->year == 0 && time->month == 0 && time->day == 0 && time->weekday == 0 && time->hour == 0 && time->min == 0 && time->sec == 0) {
res = FALSE;
if (time->year < GAME_YEAR_MIN || time->year > GAME_YEAR_MAX) {
res = TRUE;
}
else if (mTM_AreTimesEqual(time, &mTM_rtcTime_clear_code) == TRUE) {
res = FALSE;
}
else {
mFRm_ERRORLINE(379);
}
}
return res;
if (time->month == 0 || time->month > lbRTC_MONTHS_MAX) {
res = TRUE;
}
if (time->day == 0 || time->day > 31) {
res = TRUE;
}
if (time->weekday > lbRTC_SATURDAY) {
res = TRUE;
}
if (time->hour > 23) {
res = TRUE;
}
if (time->min > 59) {
res = TRUE;
}
if (time->sec > 59) {
res = TRUE;
}
if (res == TRUE) {
if (time->year == 0 && time->month == 0 && time->day == 0 && time->weekday == 0 && time->hour == 0 &&
time->min == 0 && time->sec == 0) {
res = FALSE;
} else if (mTM_AreTimesEqual(time, &mTM_rtcTime_clear_code) == TRUE) {
res = FALSE;
} else {
mFRm_ERRORLINE(379);
}
}
return res;
}
static int sChk_lbRTC_ymd_c_sub(lbRTC_ymd_c* ymd) {
int res = FALSE;
int res = FALSE;
if (ymd->year < GAME_YEAR_MIN || ymd->year > GAME_YEAR_MAX) {
res = TRUE;
}
if (ymd->month == 0 || ymd->month > lbRTC_MONTHS_MAX) {
res = TRUE;
}
if (ymd->day == 0 || ymd->day > 31) {
res = TRUE;
}
if (res == TRUE) {
if (ymd->year == 0 && ymd->month == 0 && ymd->day == 0) {
res = FALSE;
if (ymd->year < GAME_YEAR_MIN || ymd->year > GAME_YEAR_MAX) {
res = TRUE;
}
else if (ymd->year == mTM_rtcTime_ymd_clear_code.year && ymd->month == mTM_rtcTime_ymd_clear_code.month && ymd->day == mTM_rtcTime_ymd_clear_code.day) {
res = FALSE;
}
else {
mFRm_ERRORLINE(464);
}
}
return res;
if (ymd->month == 0 || ymd->month > lbRTC_MONTHS_MAX) {
res = TRUE;
}
if (ymd->day == 0 || ymd->day > 31) {
res = TRUE;
}
if (res == TRUE) {
if (ymd->year == 0 && ymd->month == 0 && ymd->day == 0) {
res = FALSE;
} else if (ymd->year == mTM_rtcTime_ymd_clear_code.year && ymd->month == mTM_rtcTime_ymd_clear_code.month &&
ymd->day == mTM_rtcTime_ymd_clear_code.day) {
res = FALSE;
} else {
mFRm_ERRORLINE(464);
}
}
return res;
}
static int sChk_Mail_nm_c_sub(Mail_nm_c* mail_name, int depth) {
int res = FALSE;
int res = FALSE;
if (mail_name->type >= mMl_NAME_TYPE_NUM && mail_name->type != mMl_NAME_TYPE_CLEAR) {
mFRm_ERRORLINE(519);
res = TRUE;
}
if (mail_name->type >= mMl_NAME_TYPE_NUM && mail_name->type != mMl_NAME_TYPE_CLEAR) {
mFRm_ERRORLINE(519);
res = TRUE;
}
return res;
return res;
}
static int sChk_Mail_hdr_c_sub(Mail_hdr_c* mail_header, int depth) {
int res = FALSE;
res |= sChk_Mail_nm_c_sub(&mail_header->recipient, depth + 1);
res |= sChk_Mail_nm_c_sub(&mail_header->sender, depth + 1);
return res;
int res = FALSE;
res |= sChk_Mail_nm_c_sub(&mail_header->recipient, depth + 1);
res |= sChk_Mail_nm_c_sub(&mail_header->sender, depth + 1);
return res;
}
static int sChk_font_sub(u8* font_p) {
int font = *font_p;
int res = FALSE;
int font = *font_p;
int res = FALSE;
/* This check seems wrong lol */
if (font != 0xFF && (font >= 0xFF || font >= mMl_FONT_NUM || font < mMl_FONT_0)) {
mFRm_ERRORLINE(612);
res = TRUE;
}
/* This check seems wrong lol */
if (font != 0xFF && (font >= 0xFF || font >= mMl_FONT_NUM || font < mMl_FONT_RECV)) {
mFRm_ERRORLINE(612);
res = TRUE;
}
return res;
return res;
}
static int sChk_header_back_start_sub(u8* header_back_start_p) {
int res = FALSE;
int res = FALSE;
if (*header_back_start_p > MAIL_HEADER_LEN) {
mFRm_ERRORLINE(657);
res = TRUE;
}
if (*header_back_start_p > MAIL_HEADER_LEN) {
mFRm_ERRORLINE(657);
res = TRUE;
}
return res;
return res;
}
static int sChk_paper_type_sub(u8* paper_type) {
int res = FALSE;
int res = FALSE;
if (*paper_type > (ITM_PAPER63 - ITM_PAPER00)) {
mFRm_ERRORLINE(701);
res = TRUE;
}
if (*paper_type > (ITM_PAPER63 - ITM_PAPER00)) {
mFRm_ERRORLINE(701);
res = TRUE;
}
return res;
return res;
}
static int sChk_Mail_ct_c_sub(Mail_ct_c* contents, int depth) {
int res = sChk_font_sub(&contents->font);
res |= sChk_header_back_start_sub(&contents->header_back_start);
int res = sChk_font_sub(&contents->font);
if (contents->mail_type > mMl_TYPE_12) {
mFRm_ERRORLINE(766);
res = TRUE;
}
res |= sChk_header_back_start_sub(&contents->header_back_start);
res |= sChk_paper_type_sub(&contents->paper_type);
if (contents->mail_type > mMl_TYPE_NUM) {
mFRm_ERRORLINE(766);
res = TRUE;
}
return res;
res |= sChk_paper_type_sub(&contents->paper_type);
return res;
}
static int sChk_Mail_c_sub(Mail_c* mail, int depth) {
int res = FALSE;
res |= sChk_Mail_hdr_c_sub(&mail->header, depth + 1);
res |= sChk_ItemFG_sub(mail->present);
res |= sChk_Mail_ct_c_sub(&mail->content, depth + 1);
int res = FALSE;
return res;
res |= sChk_Mail_hdr_c_sub(&mail->header, depth + 1);
res |= sChk_ItemFG_sub(mail->present);
res |= sChk_Mail_ct_c_sub(&mail->content, depth + 1);
return res;
}
static int sChk_mHm_rmsz_c_sub(mHm_rmsz_c* room_size, int depth) {
lbRTC_ymd_c order_date_copy;
int res;
lbRTC_ymd_c order_date_copy;
int res;
order_date_copy.day = room_size->upgrade_order_date.day;
order_date_copy.month = room_size->upgrade_order_date.month;
order_date_copy.year = room_size->upgrade_order_date.year;
order_date_copy.day = room_size->upgrade_order_date.day;
order_date_copy.month = room_size->upgrade_order_date.month;
order_date_copy.year = room_size->upgrade_order_date.year;
res = sChk_lbRTC_ymd_c_sub(&order_date_copy);
res = sChk_lbRTC_ymd_c_sub(&order_date_copy);
if (room_size->size >= mHm_HOMESIZE_NUM) {
mFRm_ERRORLINE(880);
res = TRUE;
}
if (room_size->size >= mHm_HOMESIZE_NUM) {
mFRm_ERRORLINE(880);
res = TRUE;
}
if (room_size->next_size >= mHm_HOMESIZE_NUM) {
mFRm_ERRORLINE(894);
res = TRUE;
}
if (room_size->next_size >= mHm_HOMESIZE_NUM) {
mFRm_ERRORLINE(894);
res = TRUE;
}
return res;
return res;
}
static int sChk_Haniwa_Item_c_sub(Haniwa_Item_c* haniwa_item, int depth) {
int res = sChk_ItemFG_sub(haniwa_item->item);
int res = sChk_ItemFG_sub(haniwa_item->item);
if (haniwa_item->exchange_type > mHm_HANIWA_TRADE_3) {
mFRm_ERRORLINE(947);
res = TRUE;
}
if (haniwa_item->exchange_type > mHm_HANIWA_TRADE_3) {
mFRm_ERRORLINE(947);
res = TRUE;
}
return res;
return res;
}
static int sChk_Haniwa_c_sub(Haniwa_c* haniwa, int depth) {
int i;
int res = FALSE;
int i;
int res = FALSE;
for (i = 0; i < HANIWA_ITEM_HOLD_NUM; i++) {
res |= sChk_Haniwa_Item_c_sub(haniwa->items + i, depth + 1);
}
for (i = 0; i < HANIWA_ITEM_HOLD_NUM; i++) {
res |= sChk_Haniwa_Item_c_sub(haniwa->items + i, depth + 1);
}
return res;
return res;
}
static int sChk_outlook_pal_sub(u8 outlook_pal) {
int res = FALSE;
int res = FALSE;
if (outlook_pal >= mHm_OUTLOOK_PAL_NUM) {
mFRm_ERRORLINE(1035);
res = TRUE;
}
if (outlook_pal >= mHm_OUTLOOK_PAL_NUM) {
mFRm_ERRORLINE(1035);
res = TRUE;
}
return res;
return res;
}
static int sChk_mHm_goki_c_sub(mHm_goki_c* goki, int depth) {
return sChk_OSRTCTime_sub(&goki->time);
return sChk_OSRTCTime_sub(&goki->time);
}
static int sChk_mHm_hs_c_sub(mHm_hs_c* house, int depth) {
int i;
int res = FALSE;
int i;
int res = FALSE;
res |= sChk_lbRTC_ymd_c_sub(&house->hra_mark_time);
res |= sChk_mHm_rmsz_c_sub(&house->size_info, depth + 1);
res |= sChk_outlook_pal_sub(house->outlook_pal);
res |= sChk_outlook_pal_sub(house->ordered_outlook_pal);
res |= sChk_outlook_pal_sub(house->next_outlook_pal);
res |= sChk_lbRTC_ymd_c_sub(&house->hra_mark_time);
res |= sChk_mHm_rmsz_c_sub(&house->size_info, depth + 1);
res |= sChk_outlook_pal_sub(house->outlook_pal);
res |= sChk_outlook_pal_sub(house->ordered_outlook_pal);
res |= sChk_outlook_pal_sub(house->next_outlook_pal);
for (i = 0; i < HOME_MAILBOX_SIZE; i++) {
res |= sChk_Mail_c_sub(house->mailbox + i, depth + 1);
}
for (i = 0; i < HOME_MAILBOX_SIZE; i++) {
res |= sChk_Mail_c_sub(house->mailbox + i, depth + 1);
}
res |= sChk_Haniwa_c_sub(&house->haniwa, depth + 1);
res |= sChk_mHm_goki_c_sub(&house->goki, depth + 1);
res |= sChk_Haniwa_c_sub(&house->haniwa, depth + 1);
res |= sChk_mHm_goki_c_sub(&house->goki, depth + 1);
return res;
return res;
}
static int sChk_AnmPersonalID_c_sub(AnmPersonalID_c* pid, int depth) {
int res = FALSE;
int res = FALSE;
if (ITEM_NAME_GET_TYPE(pid->npc_id) != NAME_TYPE_NPC && pid->npc_id != EMPTY_NO) {
mFRm_ERRORLINE(1200);
res = TRUE;
}
if (ITEM_NAME_GET_TYPE(pid->npc_id) != NAME_TYPE_NPC && pid->npc_id != EMPTY_NO) {
mFRm_ERRORLINE(1200);
res = TRUE;
}
if (pid->looks > mNpc_LOOKS_NUM) {
mFRm_ERRORLINE(1214);
res = TRUE;
}
if (pid->looks > mNpc_LOOKS_NUM) {
mFRm_ERRORLINE(1214);
res = TRUE;
}
return res;
return res;
}
static int sChk_Anmplmail_c_sub(Anmplmail_c* animal_player_mail, int depth) {
int res = FALSE;
int res = FALSE;
res |= sChk_font_sub(&animal_player_mail->font);
res |= sChk_paper_type_sub(&animal_player_mail->paper_type);
res |= sChk_ItemFG_sub(animal_player_mail->present);
res |= sChk_header_back_start_sub(&animal_player_mail->header_back_start);
res |= sChk_lbRTC_ymd_c_sub(&animal_player_mail->date);
res |= sChk_font_sub(&animal_player_mail->font);
res |= sChk_paper_type_sub(&animal_player_mail->paper_type);
res |= sChk_ItemFG_sub(animal_player_mail->present);
res |= sChk_header_back_start_sub(&animal_player_mail->header_back_start);
res |= sChk_lbRTC_ymd_c_sub(&animal_player_mail->date);
return res;
return res;
}
static int sChk_Anmmem_c_sub(Anmmem_c* animal_memory, int depth) {
int res = FALSE;
int res = FALSE;
res |= sChk_OSRTCTime_sub(&animal_memory->last_speak_time);
res |= sChk_Anmplmail_c_sub(&animal_memory->letter, depth + 1);
res |= sChk_OSRTCTime_sub(&animal_memory->last_speak_time);
res |= sChk_Anmplmail_c_sub(&animal_memory->letter, depth + 1);
return res;
return res;
}
static int sChk_Anmhome_c_sub(Anmhome_c* animal_home, int depth) {
int res = FALSE;
int res = FALSE;
if (animal_home->type_unused > 5) {
mFRm_ERRORLINE(1365);
res = TRUE;
}
if (animal_home->type_unused > 5) {
mFRm_ERRORLINE(1365);
res = TRUE;
}
res |= sChk_block_num_sub(animal_home->block_x, animal_home->block_z);
res |= sChk_ut_num_sub(animal_home->ut_x, animal_home->ut_z);
res |= sChk_block_num_sub(animal_home->block_x, animal_home->block_z);
res |= sChk_ut_num_sub(animal_home->ut_x, animal_home->ut_z);
return res;
return res;
}
static int sChk_Animal_c_sub(Animal_c* animal, int depth) {
int i;
int res = FALSE;
int i;
int res = FALSE;
res |= sChk_AnmPersonalID_c_sub(&animal->id, depth + 1);
res |= sChk_AnmPersonalID_c_sub(&animal->id, depth + 1);
for (i = 0; i < ANIMAL_MEMORY_NUM; i++) {
res |= sChk_Anmmem_c_sub(animal->memories + i, depth + 1);
}
for (i = 0; i < ANIMAL_MEMORY_NUM; i++) {
res |= sChk_Anmmem_c_sub(animal->memories + i, depth + 1);
}
res |= sChk_Anmhome_c_sub(&animal->home_info, depth + 1);
res |= sChk_Anmhome_c_sub(&animal->home_info, depth + 1);
if (animal->mood >= mNpc_MOOD_NUM) {
mFRm_ERRORLINE(1458);
res = TRUE;
}
if (animal->mood >= mNpc_MOOD_NUM) {
mFRm_ERRORLINE(1458);
res = TRUE;
}
res |= sChk_cloth_sub(animal->cloth);
res |= sChk_cloth_sub(animal->cloth);
if ((animal->is_home & ~1)) {
mFRm_ERRORLINE(1474);
res = TRUE;
}
if ((animal->is_home & ~1)) {
mFRm_ERRORLINE(1474);
res = TRUE;
}
res |= sChk_cloth_sub(animal->present_cloth);
res |= sChk_cloth_sub(animal->present_cloth);
return res;
return res;
}
static int sChk_Kabu_price_c_sub(Kabu_price_c* kabu_price, int depth) {
int res = FALSE;
int i;
int res = FALSE;
int i;
for (i = 0; i < lbRTC_WEEK; i++) {
if (kabu_price->daily_price[i] < Kabu_PRICE_MIN || kabu_price->daily_price[i] > Kabu_PRICE_MAX) {
mFRm_ERRORLINE(1531);
res = TRUE;
for (i = 0; i < lbRTC_WEEK; i++) {
if (kabu_price->daily_price[i] < Kabu_PRICE_MIN || kabu_price->daily_price[i] > Kabu_PRICE_MAX) {
mFRm_ERRORLINE(1531);
res = TRUE;
break;
break;
}
}
}
if (kabu_price->trade_market >= Kabu_TRADE_MARKET_TYPE_NUM) {
mFRm_ERRORLINE(1554);
res = TRUE;
}
if (kabu_price->trade_market >= Kabu_TRADE_MARKET_TYPE_NUM) {
mFRm_ERRORLINE(1554);
res = TRUE;
}
res |= sChk_OSRTCTime_sub(&kabu_price->update_time);
res |= sChk_OSRTCTime_sub(&kabu_price->update_time);
return res;
return res;
}
static int sChk_PostOffice_c_sub(PostOffice_c* post_office, int depth) {
int i;
int res = FALSE;
int i;
int res = FALSE;
if (post_office->keep_mail_sum_players < 0 || post_office->keep_mail_sum_players > mPO_KEEP_MAIL_PLAYERS_MAX) {
mFRm_ERRORLINE(1617);
res = TRUE;
}
if (post_office->keep_mail_sum_players < 0 || post_office->keep_mail_sum_players > mPO_KEEP_MAIL_PLAYERS_MAX) {
mFRm_ERRORLINE(1617);
res = TRUE;
}
if (post_office->keep_mail_sum_npcs < 0) {
mFRm_ERRORLINE(1632);
res = TRUE;
}
if (post_office->keep_mail_sum_npcs < 0) {
mFRm_ERRORLINE(1632);
res = TRUE;
}
if (post_office->mail_recipient_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1647);
res = TRUE;
}
if (post_office->mail_recipient_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1647);
res = TRUE;
}
for (i = 0; i < mPO_MAIL_STORAGE_SIZE; i++) {
res |= sChk_Mail_c_sub(post_office->mail + i, depth + 1);
}
for (i = 0; i < mPO_MAIL_STORAGE_SIZE; i++) {
res |= sChk_Mail_c_sub(post_office->mail + i, depth + 1);
}
res |= sChk_Mail_c_sub(&post_office->leaflet, depth + 1);
res |= sChk_Mail_c_sub(&post_office->event_leaflet, depth + 1);
res |= sChk_Mail_c_sub(&post_office->leaflet, depth + 1);
res |= sChk_Mail_c_sub(&post_office->event_leaflet, depth + 1);
if (post_office->leaflet_recipient_flags.leaflet_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1668);
res = TRUE;
}
if (post_office->leaflet_recipient_flags.leaflet_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1668);
res = TRUE;
}
if (post_office->leaflet_recipient_flags.event_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1682);
res = TRUE;
}
if (post_office->leaflet_recipient_flags.event_flags & (u16)(~0b1111)) {
mFRm_ERRORLINE(1682);
res = TRUE;
}
res |= sChk_OSRTCTime_sub(&post_office->delivery_time);
res |= sChk_OSRTCTime_sub(&post_office->delivery_time);
return res;
return res;
}
static int sChk_PoliceBox_c_sub(PoliceBox_c* police_box, int depth) {
int i;
int res = FALSE;
int i;
int res = FALSE;
for (i = 0; i < mPB_POLICE_BOX_ITEM_STORAGE_COUNT; i++) {
res |= sChk_ItemFG_sub(police_box->keep_items[i]);
}
for (i = 0; i < mPB_POLICE_BOX_ITEM_STORAGE_COUNT; i++) {
res |= sChk_ItemFG_sub(police_box->keep_items[i]);
}
return res;
return res;
}
static int sChk_Config_c_sub(Config_c* config, int depth) {
int res = FALSE;
int res = FALSE;
if (config->sound_mode > Config_SOUND_MODE_NUM) {
mFRm_ERRORLINE(1775);
res = TRUE;
}
if (config->sound_mode > Config_SOUND_MODE_NUM) {
mFRm_ERRORLINE(1775);
res = TRUE;
}
if (config->voice_mode > Config_VOICE_MODE_NUM) {
mFRm_ERRORLINE(1789);
res = TRUE;
}
if (config->voice_mode > Config_VOICE_MODE_NUM) {
mFRm_ERRORLINE(1789);
res = TRUE;
}
if (config->vibration_enabled & (~1)) {
mFRm_ERRORLINE(1803);
res = TRUE;
}
if (config->vibration_enabled & (~1)) {
mFRm_ERRORLINE(1803);
res = TRUE;
}
return res;
return res;
}
static int sChk_mMsr_time_c_sub(mMsr_time_c* mushroom_time, int depth) {
int res = FALSE;
int res = FALSE;
if (mushroom_time->year < GAME_YEAR_MIN && mushroom_time->year > GAME_YEAR_MAX) {
res = TRUE;
}
if (mushroom_time->month == 0 || mushroom_time->month > lbRTC_DECEMBER) {
res = TRUE;
}
if (mushroom_time->day == 0 || mushroom_time->day > 31) {
res = TRUE;
}
if (mushroom_time->hour > 23) {
res = TRUE;
}
if (res == TRUE) {
if (
mushroom_time->year == 0 &&
mushroom_time->month == 0 &&
mushroom_time->day == 0 &&
mushroom_time->hour == 0 &&
mushroom_time->hour_quarter == 0
) {
res = FALSE;
if (mushroom_time->year < GAME_YEAR_MIN && mushroom_time->year > GAME_YEAR_MAX) {
res = TRUE;
}
else {
mFRm_ERRORLINE(1876);
}
}
return res;
if (mushroom_time->month == 0 || mushroom_time->month > lbRTC_DECEMBER) {
res = TRUE;
}
if (mushroom_time->day == 0 || mushroom_time->day > 31) {
res = TRUE;
}
if (mushroom_time->hour > 23) {
res = TRUE;
}
if (res == TRUE) {
if (mushroom_time->year == 0 && mushroom_time->month == 0 && mushroom_time->day == 0 &&
mushroom_time->hour == 0 && mushroom_time->hour_quarter == 0) {
res = FALSE;
} else {
mFRm_ERRORLINE(1876);
}
}
return res;
}
static int sChk_MaskCat_c_sub(MaskCat_c* mask_cat, int depth) {
int valid_cloth;
int res = FALSE;
int valid_cloth;
int res = FALSE;
if (mask_cat->palette_no >= mNW_PALETTE_NUM) {
mFRm_ERRORLINE(1935);
res = TRUE;
}
if (mask_cat->palette_no >= mNW_PALETTE_NUM) {
mFRm_ERRORLINE(1935);
res = TRUE;
}
/* This is definitely a macro */
valid_cloth = (mActor_name_t)(mask_cat->cloth_no + ITM_CLOTH_START) >= ITM_CLOTH_START && (mActor_name_t)(mask_cat->cloth_no + ITM_CLOTH_START) < ITM_CLOTH_END;
if (valid_cloth == FALSE) {
mFRm_ERRORLINE(1949);
res = TRUE;
}
/* This is definitely a macro */
valid_cloth = (mActor_name_t)(mask_cat->cloth_no + ITM_CLOTH_START) >= ITM_CLOTH_START &&
(mActor_name_t)(mask_cat->cloth_no + ITM_CLOTH_START) < ITM_CLOTH_END;
if (valid_cloth == FALSE) {
mFRm_ERRORLINE(1949);
res = TRUE;
}
if (mask_cat->talk_idx > mMC_TALK_IDX_MAX) {
mFRm_ERRORLINE(1963);
res = TRUE;
}
if (mask_cat->talk_idx > mMC_TALK_IDX_MAX) {
mFRm_ERRORLINE(1963);
res = TRUE;
}
res |= sChk_OSRTCTime_sub(&mask_cat->time);
res |= sChk_OSRTCTime_sub(&mask_cat->time);
return res;
return res;
}
static int sChk_check_save_data() {
int res = FALSE;
Save_t* save = Common_GetPointer(save.save);
int i;
int res = FALSE;
Save_t* save = Common_GetPointer(save.save);
int i;
for (i = 0; i < mHS_HOUSE_NUM; i++) {
res |= sChk_mHm_hs_c_sub(save->homes + i, 1);
}
for (i = 0; i < mHS_HOUSE_NUM; i++) {
res |= sChk_mHm_hs_c_sub(save->homes + i, 1);
}
for (i = 0; i < ANIMAL_NUM_MAX; i++) {
res |= sChk_Animal_c_sub(save->animals + i, 1);
}
for (i = 0; i < ANIMAL_NUM_MAX; i++) {
res |= sChk_Animal_c_sub(save->animals + i, 1);
}
res |= sChk_AnmPersonalID_c_sub(&save->last_removed_animal_id, 1);
res |= sChk_Kabu_price_c_sub(&save->kabu_price_schedule, 1);
res |= sChk_fruit_sub(save->fruit);
res |= sChk_OSRTCTime_sub(&save->all_grow_renew_time);
res |= sChk_PostOffice_c_sub(&save->post_office, 1);
res |= sChk_PoliceBox_c_sub(&save->police_box, 1);
res |= sChk_Config_c_sub(&save->config, 1);
res |= sChk_lbRTC_ymd_c_sub(&save->renew_time);
res |= sChk_OSRTCTime_sub(&save->last_grow_time);
res |= sChk_mMsr_time_c_sub(&save->mushroom_time, 1);
res |= sChk_lbRTC_ymd_c_sub(&save->_021322);
res |= sChk_OSRTCTime_sub(&save->_02136E);
res |= sChk_OSRTCTime_sub(&save->treasure_buried_time);
res |= sChk_OSRTCTime_sub(&save->treasure_checked_time);
res |= sChk_lbRTC_ymd_c_sub(&save->force_remove_date);
res |= sChk_MaskCat_c_sub(&save->mask_cat, 1);
res |= sChk_AnmPersonalID_c_sub(&save->last_removed_animal_id, 1);
res |= sChk_Kabu_price_c_sub(&save->kabu_price_schedule, 1);
res |= sChk_fruit_sub(save->fruit);
res |= sChk_OSRTCTime_sub(&save->all_grow_renew_time);
res |= sChk_PostOffice_c_sub(&save->post_office, 1);
res |= sChk_PoliceBox_c_sub(&save->police_box, 1);
res |= sChk_Config_c_sub(&save->config, 1);
res |= sChk_lbRTC_ymd_c_sub(&save->renew_time);
res |= sChk_OSRTCTime_sub(&save->last_grow_time);
res |= sChk_mMsr_time_c_sub(&save->mushroom_time, 1);
res |= sChk_lbRTC_ymd_c_sub(&save->_021322);
res |= sChk_OSRTCTime_sub(&save->_02136E);
res |= sChk_OSRTCTime_sub(&save->treasure_buried_time);
res |= sChk_OSRTCTime_sub(&save->treasure_checked_time);
res |= sChk_lbRTC_ymd_c_sub(&save->force_remove_date);
res |= sChk_MaskCat_c_sub(&save->mask_cat, 1);
return res;
return res;
}