Implement & link m_trademark.c

This commit is contained in:
Cuyler36
2023-05-27 13:12:34 -04:00
parent aca2369e01
commit f939e0669d
30 changed files with 645 additions and 15 deletions
+4
View File
@@ -53,7 +53,11 @@ do { \
GAME_NEXT_GAME(t_game, init_name, class_name); \
} while (0)
extern void SetGameFrame(int frame);
extern void game_get_controller(GAME* game);
extern void game_debug_draw_last(GAME* game, GRAPH* graph);
extern void game_draw_last(GRAPH* graph);
extern GAME* gamePT;
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef MATH_H
#define MATH_H
#ifndef LIB_C_MATH_H
#define LIB_C_MATH_H
#include "types.h"
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_BG_ITEM_H
#define M_BG_ITEM_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void mBI_ct();
#ifdef __cplusplus
}
#endif
#endif
+2
View File
@@ -8,6 +8,8 @@ extern "C" {
#endif
extern void mBGM_reset();
extern void mBGMPsComp_make_ps_lost_fanfare(u8 bgm_no, u16 unk);
extern void mBGMPsComp_scene_mode(int scene_mode);
#ifdef __cplusplus
}
+1
View File
@@ -9,6 +9,7 @@ extern "C" {
#endif
extern void mCD_PrintErrInfo(gfxprint_t* gfxprint);
extern void mCD_InitAll();
#ifdef __cplusplus
}
+22 -4
View File
@@ -24,6 +24,7 @@
#include "m_field_assessment.h"
#include "m_mushroom.h"
#include "m_clip.h"
#include "m_scene.h"
#ifdef __cplusplus
extern "C" {
@@ -152,20 +153,35 @@ typedef struct common_data_s {
/* 0x026144 */ u8 tmp0[0x2614D - 0x26144];
/* 0x02614D */ u8 transFadeDuration;
/* 0x02614E */ u8 transWipeSpeed;
/* 0x02614F */ u8 tmp34[0x2666C - 0x2614F];
/* 0x02614F */ u8 wipeType; /* maybe unused? */
/* 0x02614F */ u8 _26150[0x26164 - 0x26150];
/* 0x026164 */ mNpc_NpcList_c npclist[ANIMAL_NUM_MAX];
/* 0x0264AC */ mNpc_NpcList_c unk_264AC; // fits exact size of npc list struct, seems unused
/* 0x0264E4 */ mNpc_NpcList_c island_npclist[1]; // TODO: define for island npc count
/* 0x02651C */ mActor_name_t house_owner_name;
/* 0x02651E */ mActor_name_t last_field_id;
/* 0x026520 */ u8 in_initial_block; /* when TRUE, the player is in the acre which they exited a building. FALSE otherwise. */
/* 0x026521 */ u8 submenu_disabled; /* when set, submenus cannot be accessed from start button */
/* 0x026522 */ u8 _26522[0x2666C - 0x26522];
/* 0x02666C */ s16 weather;
/* 0x02666E */ s16 weather_intensity;
/* 0x026670 */ lbRTC_time_c weather_time;
/* 0x026678 */ u8 _26678[0x2852C - 0x26678];
/* 0x026678 */ u8 _26678[0x266A4 - 0x26678];
/* 0x0266A4 */ int scene_from_title_demo; /* next scene to be loaded when title demo finishes */
/* 0x0266A8 */ u8 _266A8[0x2852C - 0x266A8];
/* 0x02852C */ s16 money_power;
/* 0x02852E */ s16 goods_power;
/* 0x028530 */ u8 tmp1[0x28879 - 0x28530];
/* 0x028530 */ Door_data_c door_data; /* misc door data */
/* 0x028544 */ Door_data_c structure_exit_door_data; /* door data for when exiting a building */
/* 0x028558 */ u8 tmp1[0x28879 - 0x28558];
/* 0x028879 */ u8 auto_nwrite_count;
/* 0x02887A */ lbRTC_year_t auto_nwrite_year;
/* 0x02887C */ u8 save_error_type; /* set to one of the mFRm_ERROR_* states when save is invalid */
/* 0x02887D */ u8 train_coming_flag; /* set when the train is coming */
/* 0x02887E */ u8 buried_treasure_flag; /* when set, treasure cannot be buried */
/* 0x02887F */ u8 tmp2[0x2DB40 - 0x2887F];
/* 0x02887F */ u8 tmp2[0x288A0 - 0x2887F];
/* 0x0288A0 */ u8 pad_connected; /* is gamepad 0 connected? */
/* 0x0288A1 */ u8 _288a1[0x02DB40 - 0x0288A1];
/* 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. */
/* 0x02DB41 */ u8 tmp3[0x2DBB0 - 0x2DB41];
/* 0x02DBB0 */ s16 can_look_goki_count;
@@ -192,6 +208,8 @@ extern common_data_t common_data;
#define Save_GetPointer(name) (Common_GetPointer(save.save.name))
#define Save_Set(name, value) (Common_Set(save.save.name, value))
extern void common_data_reinit();
#ifdef __cplusplus
}
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_CPAK_H
#define M_CPAK_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern int mCPk_InitPak(int pak_idx);
#ifdef __cplusplus
}
#endif
#endif
+4
View File
@@ -143,6 +143,10 @@ extern int mEv_check_status(int event, s16 status);
extern s8* mEv_get_common_area(int type, s8 id);
extern int mEv_weekday2day(lbRTC_month_t month, int week_type, lbRTC_weekday_t weekday);
extern void mEv_ClearEventInfo();
extern int mEv_CheckTitleDemo();
extern void mEv_SetTitleDemo(int titledemo_no);
extern void mEv_debug_print4f(gfxprint_t* gfxprint);
extern void mEv_sp_debug_print4f(gfxprint_t* gfxprint);
+1
View File
@@ -84,6 +84,7 @@ typedef struct location_info_s {
extern int mFI_CheckFieldData();
extern mActor_name_t mFI_GetFieldId();
extern int mFI_GetClimate();
extern void mFI_SetClimate(int climate);
extern mActor_name_t* mFI_BkNumtoUtFGTop(int block_x, int block_z);
extern void mFI_ClearDeposit(int block_x, int block_z);
extern int mFI_GetLineDeposit(u16* deposit, int ut_x);
+2
View File
@@ -43,6 +43,8 @@ typedef struct island_s {
/* 0x18E3 */ u8 unused_18E3[29]; /* unused */
} Island_c;
extern void mISL_ClearKeepIsland();
#ifdef __cplusplus
}
#endif
+13
View File
@@ -4,6 +4,7 @@
#include "types.h"
#include "m_play.h"
#include "m_actor_type.h"
#include "MSL_C/math.h"
#ifdef __cplusplus
extern "C" {
@@ -14,6 +15,18 @@ extern "C" {
#define ABS(x) (((x) >= 0) ? (x) : -(x))
#define SQ(x) ((x)*(x))
/* radians -> short angle */
#define RAD2SHORT_ANGLE(rad) ((s16)(int)((rad) * (65536.0f / (2.0f * F_PI))))
/* short angle -> radians */
#define SHORT2RAD_ANGLE(s) ((((f32)(s)) / (65536.0f / (2.0f * F_PI))))
/* degrees -> short angle */
#define DEG2SHORT_ANGLE(deg) ((s16)((deg) * (65536.0f / 360.0f)))
/* short angle -> degrees */
#define SHORT2DEG_ANGLE(s) ((((f32)(s)) / (65536.0f / 360.0f)))
typedef struct xy_s {
f32 x, y;
} xy_t;
+2
View File
@@ -19,6 +19,8 @@ extern void mMsg_Set_free_str(M_MSG_WINDOW* msg, int free_str_no, u8* str, size_
extern void mMsg_debug_draw(gfxprint_t* gfxprint);
extern void mMsg_aram_init();
#ifdef __cplusplus
}
#endif
+17
View File
@@ -369,6 +369,23 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define EXIT_DOOR 0x4080
#define NPC_START 0xE000
#define NPC_BOB NPC_START
// TODO: Finish
#define NPC_JOEY 0xE048
#define NPC_PAOLO 0xE04C
#define NPC_JANE 0xE061
#define NPC_CARRIE 0xE06F
#define NPC_SAMSON 0xE07D
#define NPC_BUZZ 0xE08C
#define NPC_CUBE 0xE093
#define NPC_RASHER 0xE09B
#define NPC_TANK 0xE0AA
#define NPC_VESTA 0xE0AD
#define NPC_TYBALT 0xE0B6
#define NPC_LOBO 0xE0B9
#define NPC_BIFF 0xE0C2
#define RSV_DOOR 0xFE1B
#define RSV_WALL_NO 0xFFFE /* interior wall item, no collision */
#define RSV_NO 0xFFFF /* reserved space, can't interact but no collision */
+39
View File
@@ -10,6 +10,7 @@
#include "lb_rtc.h"
#include "m_personal_id.h"
#include "m_quest.h"
#include "m_lib.h"
#ifdef __cplusplus
extern "C" {
@@ -145,9 +146,47 @@ typedef struct animal_return_s {
/* 0x04 */ lbRTC_time_c renew_time; /* time that this struct was updated */
} Anmret_c;
typedef struct demo_npc_s {
mActor_name_t npc_name; /* villager id, E0XX */
u32 block_x, block_z; /* spawn acre */
u32 ut_x, ut_z; /* spawn unit in acre */
} mNpc_demo_npc_c;
typedef struct {
u8 type;
u8 palette;
u8 wall_id;
u8 floor_id;
mActor_name_t main_layer_id;
mActor_name_t secondary_layer_id;
} mNpc_NpcHouseData_c;
typedef struct npc_conversation_s {
u8 beesting:1; // talk to player about their beesting
u8 unk:7;
} mNpc_NpcConversation_c;
typedef struct npc_list_s {
mActor_name_t name;
mActor_name_t field_name;
xyz_t house_position;
xyz_t position;
u8 appear_flag;
mNpc_NpcConversation_c conversation_flags;
mQst_base_c quest_info;
mNpc_NpcHouseData_c house_data;
mActor_name_t reward_furniture;
} mNpc_NpcList_c;
/* anm_id could also just be a Animal_c pointer */
extern void mNpc_GetNpcWorldNameAnm(u8* name, AnmPersonalID_c* anm_id);
extern int mNpc_CheckFreeAnimalPersonalID(AnmPersonalID_c* anm_id);
extern void mNpc_SetAnimalTitleDemo(mNpc_demo_npc_c* demo_npc, Animal_c* animal, GAME* game);
extern void mNpc_SetNpcList(mNpc_NpcList_c* npc_list, Animal_c* animal, int max, int unused);
extern void mNpc_ClearCacheName();
extern void mNpc_ClearInAnimal();
extern void mNpc_FirstClearGoodbyMail();
extern void mNpc_ClearIslandNpcRoomData();
extern void mNpc_PrintRemoveInfo(gfxprint_t* gfxprint);
extern void mNpc_PrintFriendship_fdebug(gfxprint_t* gfxprint);
+4 -3
View File
@@ -14,9 +14,10 @@ typedef struct game_play_s {
/* 0x0000 */ GAME game;
// TODO: finish
/* 0x00E0 */ u8 d[0x1CC0];
/* 0x1DA0*/ int isPause;
/* 0x1DA4*/ u8 _temp[0x268];
/* 0x200C*/ MtxF matrix;
/* 0x1DA0 */ int isPause;
/* 0x1DA4 */ u8 _temp[0x268];
/* 0x200C */ MtxF matrix;
/* 0x204C */ u8 _204C[0x2600-0x204C];
} GAME_PLAY;
extern void play_init(GAME_PLAY* play);
+2
View File
@@ -176,6 +176,8 @@ extern int mPr_NullCheckPersonalID(PersonalID_c* pid);
extern int mPr_CheckCmpPersonalID(PersonalID_c* pid_a, PersonalID_c* pid_b);
extern void mPr_ClearPersonalID(PersonalID_c* pid);
extern void mPr_CopyPersonalID(PersonalID_c* dst, PersonalID_c* src);
extern void mPr_ClearPrivateInfo(Private_c* private);
extern void mPr_RandomSetPlayerData_title_demo();
#ifdef __cplusplus
}
+1
View File
@@ -114,6 +114,7 @@ typedef struct quest_errand_s {
} mQst_errand_c;
extern void mQst_PrintQuestInfo(gfxprint_t* gfxprint);
extern void mQst_ClearGrabItemInfo();
#ifdef __cplusplus
}
+3
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "PR/mbi.h"
#include "game.h"
#ifdef __cplusplus
extern "C" {
@@ -12,6 +13,8 @@ extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lr
extern Gfx* gfx_gDPFillRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
extern Gfx* gfx_gDPFillRectangleF(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
extern Gfx* gfx_tex_scroll2(Gfx** gfxpp, u32 x, u32 y, int width, int height);
extern void DisplayList_initialize(GRAPH* graph, u32 clear_r, u32 clear_g, u32 clear_b, GAME* game);
extern void fade_black_draw(Gfx** gfxpp, u32 alpha);
#ifdef __cplusplus
}
-1
View File
@@ -32,7 +32,6 @@ typedef struct room_type_place_info_s {
// TEMPORARY. Should be generated with .decl files
#define ITEM0_NO_START 0x0000
#define NULL_NO ITEM0_NO_START
#define ITEM0_1_NO_START ITEM0_NO_START + 0x800
#define FTR0_NO_START 0x1000
+27
View File
@@ -0,0 +1,27 @@
#ifndef M_SCENE_H
#define M_SCENE_H
#include "types.h"
#include "m_scene_table.h"
#include "m_lib.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct door_data_s {
int next_scene_id;
u8 exit_orientation;
u8 exit_type; // 0 = normal, 1 = restart game?
u16 extra_data;
s_xyz exit_position;
mActor_name_t door_actor_name;
u8 wipe_type;
u8 pad[3]; // possibly necessary due to struct copy
} Door_data_c;
#ifdef __cplusplus
}
#endif
#endif
+1
View File
@@ -15,6 +15,7 @@ extern "C" {
enum scene_table {
/* TODO: finish */
SCENE_FG = 0x07, /* outdoors/FG */
SCENE_TITLE_DEMO = 0x21, /* title screen demo */
SCENE_ISLAND_COTTAGE = 0x2F,
/* TODO: finish */
};
+2
View File
@@ -76,6 +76,8 @@ extern const lbRTC_time_c mTM_rtcTime_default_code;
#define mTM_IsTimeCleared(time) (lbRTC_IsEqualTime((time), &mTM_rtcTime_clear_code, lbRTC_CHECK_ALL) == TRUE)
#define mTM_AreTimesEqual(t0, t1) (lbRTC_IsEqualTime(t0, t1, lbRTC_CHECK_ALL))
extern void mTM_set_season();
#ifdef __cplusplus
}
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef M_TITLEDEMO_H
#define M_TITLEDEMO_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mTD_TITLE_DEMO_NUM 5
extern int mTD_get_titledemo_no();
extern int mTD_demono_get();
#ifdef __cplusplus
}
#endif
#endif
+22 -4
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "game.h"
#include "m_view.h"
#ifdef __cplusplus
extern "C" {
@@ -11,12 +12,29 @@ extern "C" {
/* sizeof(struct game_trademark_s) == 0x25A70 */
typedef struct game_trademark_s {
/* 0x000000 */ GAME game;
// TODO: finish
/* 0x0000E0 */ u8 _temp[0x25990];
/* 0x0000E0 */ View view;
/* 0x000200 */ xyz_t unused_200; // n64
/* 0x00020C */ f32 unused_20c; // n64
/* 0x000210 */ u32 unused_210; // n64
/* 0x000214 */ int unused_214; // n64
/* 0x000218 */ int unused_218[15]; // n64
/* 0x000254 */ int unused_254; // n64
/* 0x000258 */ int unused_258[38400]; // n64 texture
/* 0x025A58 */ u32 alpha;
/* 0x025A5C */ s16 logo_timer;
/* 0x025A5E */ u16 alpha2;
/* 0x025A60 */ s16 move_timer;
/* 0x025A62 */ s16 unused_25a62; // n64
/* 0x025A64 */ s16 unused_25a64; // n64
/* 0x025A66 */ u8 stage;
/* 0x025A67 */ u8 unused_25a67; // n64
/* 0x025A68 */ u8 cancel;
/* 0x025A69 */ u8 check;
/* 0x025A6C */ int unused_25a6c; // n64
} GAME_TRADEMARK;
extern void trademark_init(GAME_TRADEMARK* trademark);
extern void trademark_cleanup(GAME_TRADEMARK* trademark);
extern void trademark_init(GAME* game);
extern void trademark_cleanup(GAME* game);
#ifdef __cplusplus
}
+1
View File
@@ -8,6 +8,7 @@ extern "C" {
#endif
extern void mVibctl_reset();
extern void mVibctl_init0();
#ifdef __cplusplus
}
+2
View File
@@ -43,6 +43,8 @@ typedef struct view_s {
int _unused_pad0;
} View;
extern void initView(View* view, GRAPH* graph);
#ifdef __cplusplus
}
#endif
+1
View File
@@ -16,6 +16,7 @@ extern void Matrix_push();
extern void Matrix_pull();
extern void Matrix_get(MtxF* m);
extern void Matrix_put(MtxF* m);
extern void new_Matrix(GAME* game);
#ifdef __cplusplus
}