Implement & partial match m_map_ovl.c

This commit is contained in:
Cuyler36
2023-06-27 01:13:20 -04:00
parent 0aaa5d3cd4
commit 9632add95f
9 changed files with 1480 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef PRERENDER_H
#define PRERENDER_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct prerender_s {
u16 width;
u16 height;
u16 width_bak;
u16 height_bak;
u8 _08[8];
void* framebuffer;
void* framebuffer_bak;
void* _18;
int _1C;
int _20;
u8 _24[0x24];
} PreRender;
#ifdef __cplusplus
}
#endif
#endif
+10
View File
@@ -8,6 +8,15 @@
extern "C" {
#endif
enum field_layer {
mCoBG_LAYER0,
mCoBG_LAYER1,
mCoBG_LAYER2,
mCoBG_LAYER3,
mCoBG_LAYER_NUM
};
enum background_attribute {
/* TODO: finish */
mCoBG_ATTRIBUTE_GRASS0,
@@ -92,6 +101,7 @@ extern int mCoBG_CheckHole_OrgAttr(u32 attribute);
extern f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t wpos, f32 foot_dist);
extern int mCoBG_Attribute2CheckPlant(u32 attribute, const xyz_t* wpos);
extern void mCoBG_BgCheckControll(xyz_t* reverse_pos, ACTOR* actor, f32 check_range, f32 offset_y, s16 wall_attr_check, s16 no_reverse, s16 check_type);
extern int mCoBG_Height2GetLayer(f32 height);
extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line);
#define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__)
+6
View File
@@ -25,6 +25,9 @@ extern "C" {
#define FGIDX_2_BLOCK_X(idx) ((idx) % FG_BLOCK_X_NUM + 1)
#define FGIDX_2_BLOCK_Z(idx) ((idx) / FG_BLOCK_X_NUM + 1)
#define FGBLOCKXZ_2_FGIDX(x, z) ((z) * FG_BLOCK_X_NUM + (x))
#define BLOCKXZ_2_BLOCKIDX(x, z) ((z) * BLOCK_X_NUM + (x))
/* sizeof(mFM_combination_c) == 2 */
typedef struct block_combination_s {
@@ -44,6 +47,9 @@ typedef struct block_combo_s {
/* 0x05 */ u8 type;
} mFM_combo_info_c;
extern u8* g_block_type_p;
extern int* g_block_kind_p;
#ifdef __cplusplus
}
#endif
+120
View File
@@ -0,0 +1,120 @@
#ifndef M_MAP_OVL_H
#define M_MAP_OVL_H
#include "types.h"
#include "m_map_ovl_h.h"
#include "m_submenu_ovl.h"
#include "m_private.h"
#include "m_collision_bg.h"
#include "m_field_make.h"
#include "PreRender.h"
#include "m_npc.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mMP_RESIDENTS_PER_BLOCK_MAX 4
#define mMP_BLOCKX_MAX 6
#define mMP_BLOCKZ_MAX 7
#define mMP_CURSOR_FRAMES 18
#define mMP_LABEL_WORD_NUM 2
#define mMP_BLOCK_SIZE_F 22.0f
enum label_type {
mMP_LABEL_NPC,
mMP_LABEL_PLAYER,
mMP_LABEL_SHOP,
mMP_LABEL_POLICE,
mMP_LABEL_POST,
mMP_LABEL_SHRINE,
mMP_LABEL_STATION,
mMP_LABEL_JUNK,
mMP_LABEL_MUSEUM,
mMP_LABEL_NEEDLE,
mMP_LABEL_PORT,
mMP_LABEL_NUM
};
typedef struct map_resident_info_s {
u8 name[PLAYER_NAME_LEN];
s8 sex;
u8 house_layer;
u8 house_idx;
} mMP_ResidentInfo_c;
typedef struct map_labelinfo_s {
mMP_ResidentInfo_c* residents[mMP_RESIDENTS_PER_BLOCK_MAX];
s16 label_cnt;
s16 label_no;
} mMP_LabelInfo_c;
typedef struct map_house_pos_entry_s {
u8 ut_x;
u8 ut_z;
u8 idx;
} mMP_HousePos_Entry_c;
typedef struct map_house_pos_s {
mActor_name_t fgblock_name;
mMP_HousePos_Entry_c entries[3];
} mMP_HousePos_c;
typedef struct map_label_word_s {
f32 ofs_x;
f32 ofs_y;
u8* str;
int str_len;
} mMP_LabelWord_c;
typedef struct map_label_s {
f32 ofs_x;
f32 ofs_y;
Gfx* gfx;
mMP_LabelWord_c* words[mMP_LABEL_WORD_NUM];
} mMP_Label_c;
struct map_overlay_s {
u8 sel_bx;
u8 sel_bz;
u8 player_bx;
u8 player_bz;
f32 map_cursor_current_xpos;
f32 map_cursor_current_zpos;
f32 map_cursor_target_xpos;
f32 map_cursor_target_zpos;
int cursor_frame;
int unk_18[2];
u8* map_texture[FG_BLOCK_TOTAL_NUM];
u8 map_pal[FG_BLOCK_TOTAL_NUM];
mFM_combo_info_c* combination_table;
mMP_ResidentInfo_c player_info[PLAYER_NUM];
mMP_ResidentInfo_c animal_info[ANIMAL_NUM_MAX];
mMP_LabelInfo_c label_info[FG_BLOCK_Z_NUM][FG_BLOCK_X_NUM];
int unk_3E8[2];
u8 land_name_str_len;
int unk_3F4;
};
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_MAP_OVL_H_H
#define M_MAP_OVL_H_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct map_overlay_s mMP_Overlay_c;
#ifdef __cplusplus
}
#endif
#endif
+2
View File
@@ -197,6 +197,8 @@ extern int mNpc_SearchAnimalinfo(Animal_c* animal, mActor_name_t npc_name, int c
extern int mNpc_RegistEventNpc(mActor_name_t actor_name, mActor_name_t tex_name, mActor_name_t npc_name, mActor_name_t cloth_name);
extern void mNpc_ClearAnimalInfo(Animal_c* animal_p);
extern Animal_c* mNpc_GetInAnimalP();
extern int mNpc_GetLooks2Sex(int looks);
extern int mNpc_CheckFreeAnimalInfo(Animal_c* animal);
extern void mNpc_PrintRemoveInfo(gfxprint_t* gfxprint);
extern void mNpc_PrintFriendship_fdebug(gfxprint_t* gfxprint);
+37
View File
@@ -24,6 +24,43 @@ enum {
mSM_PROCESS_NUM
};
enum submenu_overlay {
mSM_OVL_NONE,
mSM_OVL_INVENTORY,
mSM_OVL_HBOARD,
mSM_OVL_TIMEIN,
mSM_OVL_LEDIT,
mSM_OVL_MAP,
mSM_OVL_NOTICE,
mSM_OVL_REPAY,
mSM_OVL_MSCORE,
mSM_OVL_BIRTHDAY,
mSM_OVL_EDITOR,
mSM_OVL_MAILBOX,
mSM_OVL_BOARD,
mSM_OVL_ADDRESS,
mSM_OVL_HANIWA,
mSM_OVL_EDITENDCHK,
mSM_OVL_WARNING,
mSM_OVL_CPMAIL,
mSM_OVL_CPWARNING,
mSM_OVL_CPEDIT,
mSM_OVL_CATALOG,
mSM_OVL_MUSIC,
mSM_OVL_BANK,
mSM_OVL_NEEDLEWORK,
mSM_OVL_CPORIGINAL,
mSM_OVL_DESIGN,
mSM_OVL_GBA,
mSM_OVL_DIARY,
mSM_OVL_CALENDAR,
mSM_OVL_PASSWORDMAKE,
mSM_OVL_PASSWORDCHK,
mSM_OVL_NUM
};
typedef struct submenu_item_s {
mActor_name_t item;
u8 slot_no;
+84 -1
View File
@@ -3,16 +3,99 @@
#include "types.h"
#include "m_submenu_ovl_h.h"
#include "m_submenu.h"
#include "graph.h"
#include "m_mail.h"
#include "PR/mbi.h"
#include "m_map_ovl_h.h"
#ifdef __cplusplus
extern "C" {
#endif
// TODO: fill this out
typedef struct submenu_segment_s {
u8 _00[0x54];
} mSM_Segment_c;
typedef struct submenu_menu_info_s {
int menu_type;
int proc_status;
int pre_menu_type;
SUBMENU_PROC pre_move_func;
SUBMENU_GAME_PROC pre_draw_func;
int next_menu_type;
f32 position[2];
f32 speed[2];
char* _28;
int _2C;
int next_proc_status;
s16 move_drt;
u16 _36;
int data0;
int data1;
void* data2;
int data3;
} mSM_MenuInfo_c;
typedef struct submenu_control_s {
SUBMENU_PROC menu_move_func;
SUBMENU_GAME_PROC menu_draw_func;
void* hand_move_func;
void* hand_draw_func;
void* tag_move_func;
void* tag_draw_func;
int stick_release;
u32 trigger;
u32 last_trigger;
s16 repeat_timer;
s16 texture_movement_angle;
f32 texture_pos[2];
int animation_flag;
} mSM_Control_c;
typedef void (*mSM_RETURN_FUNC_PROC)(Submenu*, mSM_MenuInfo_c*);
typedef void (*mSM_MOVE_MOVE_PROC)(Submenu*, mSM_MenuInfo_c*);
typedef void (*mSM_MOVE_END_PROC)(Submenu*, mSM_MenuInfo_c*);
typedef void (*mSM_MOVE_CHG_BASE_PROC)(mSM_MenuInfo_c*, int);
typedef void (*mSM_SET_CHAR_MATRIX_PROC)(GRAPH*);
typedef void (*mSM_CBUF_COPY_PROC)(GRAPH*, PreRender*, int, int, int);
typedef void (*mSM_SET_DRAWMODE_PROC)(GRAPH*, PreRender*, f32, f32, s16);
typedef void (*mSM_DRAW_ITEM_PROC)(GRAPH*, f32, f32, f32, mActor_name_t, int, int, int);
typedef void (*mSM_DRAW_MAIL_PROC)(GRAPH*, f32, f32, f32, Mail_c*, int, int);
typedef void (*mSM_SETUP_VIEW_PROC)(Submenu*, GRAPH*, int);
typedef void (*mSM_CHANGE_VIEW_PROC)(GRAPH*, f32, f32, f32, s16, int, int);
/* sizeof(struct submenu_overlay_s) == 0xA04 */
struct submenu_overlay_s {
/* TODO: finish */
/* 0x000 */ u8 _000[0xA00 - 0x000];
/* 0x000 */ mSM_Segment_c segment;
/* 0x054 */ mSM_MenuInfo_c menu_info[mSM_OVL_NUM];
/* 0x90C */ mSM_Control_c menu_control;
/* 0x940 */ mSM_RETURN_FUNC_PROC return_func_proc;
/* 0x944 */ mSM_MOVE_MOVE_PROC move_Move_proc;
/* 0x948 */ mSM_MOVE_END_PROC move_End_proc;
/* 0x94C */ mSM_MOVE_CHG_BASE_PROC move_chg_base_proc;
/* 0x950 */ mSM_SET_CHAR_MATRIX_PROC set_char_matrix_proc;
/* 0x954 */ mSM_CBUF_COPY_PROC cbuf_copy_proc;
/* 0x958 */ mSM_SET_DRAWMODE_PROC set_drawMode_proc;
/* 0x95C */ mSM_DRAW_ITEM_PROC draw_item_proc;
/* 0x960 */ mSM_DRAW_MAIL_PROC draw_mail_proc;
/* 0x964 */ mSM_SETUP_VIEW_PROC setup_view_proc;
/* 0x968 */ void* unused_func_968;
/* 0x96C */ mSM_CHANGE_VIEW_PROC change_view_proc;
/* 0x970 */ u8 _940[0x9B4 - 0x970];
/* 0x9B4 */ mMP_Overlay_c* map_ovl;
/* 0x9B8 */ u8 _9B8[0xA00 - 0x9B8];
/* 0xA00 */ Mtx* projection_matrix;
};
+1171
View File
File diff suppressed because it is too large Load Diff