summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremilybrooks <emilybrooksemilybrooks@gmail.com>2023-11-26 14:13:44 -0700
committerGitHub <noreply@github.com>2023-11-26 14:13:44 -0700
commit18b20e709c278f791f137518e0262ffd104e1243 (patch)
treebada6c8d4f729b76dd60f145d676cf6ecf9c45f9
parente1fcb33cef0b8e58ce3cecc2977921e685f129ba (diff)
m_start_data_init cleanup (#120)
* initial commit * missed some stuff * review * made unk names consistent
-rw-r--r--include/m_collision_bg.h21
-rw-r--r--include/m_home.h69
-rw-r--r--include/m_lib.h2
-rw-r--r--include/m_private_internals.h2
-rw-r--r--include/m_start_data_init.h22
-rw-r--r--src/code/m_lib.c6
-rw-r--r--src/code/m_start_data_init.c194
-rw-r--r--src/overlays/actors/ovl_Toudai/ac_toudai.c12
-rw-r--r--yamls/jp/code.yaml2
9 files changed, 165 insertions, 165 deletions
diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h
index 7f03174..a55f16f 100644
--- a/include/m_collision_bg.h
+++ b/include/m_collision_bg.h
@@ -8,15 +8,16 @@
struct Actor;
struct PosRot;
-typedef struct mCoBG_OffsetTable {
- /* 0x00 */ u8 unitAttribute;
- /* 0x01 */ s8 crOffset;
- /* 0x02 */ s8 luOffset;
- /* 0x03 */ s8 ldOffset;
- /* 0x04 */ s8 rdOffset;
- /* 0x05 */ s8 ruOffset;
- /* 0x06 */ s8 slateSwitch;
-} mCoBG_OffsetTable; // size = 0x7
+// offset table
+typedef struct mCoBG_unkStruct2 {
+ /* 0x00 */ u8 unk0;
+ /* 0x01 */ s8 unk1;
+ /* 0x02 */ s8 unk2;
+ /* 0x03 */ s8 unk3;
+ /* 0x04 */ s8 unk4;
+ /* 0x05 */ s8 unk5;
+ /* 0x06 */ s8 unk6;
+} mCoBG_unkStruct2; // size = 0x7
// collision bg data
typedef struct mCoBG_unkStruct {
@@ -245,7 +246,7 @@ s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, xyz_t arg1, s16 arg4, f32 arg5,
// void func_800739FC_jp();
// void func_80073C38_jp();
// void func_80073CC0_jp();
-void mCoBG_SetPluss5PointOffset_file(xyz_t pos, mCoBG_OffsetTable offsetData, char* file, s32 line);
+void mCoBG_SetPluss5PointOffset_file(xyz_t pos, mCoBG_unkStruct2 arg1, char* file, s32 line);
// void func_80074090_jp();
// void func_80074174_jp();
// void func_800741DC_jp();
diff --git a/include/m_home.h b/include/m_home.h
index 0fb873d..5d3fe55 100644
--- a/include/m_home.h
+++ b/include/m_home.h
@@ -11,64 +11,63 @@
#define HANIWA_ITEM_HOLD_NUM 4
#define HANIWA_MESSAGE_LEN 64
-typedef enum mHm_ROOM{
- /* 0 */ mHm_ROOM_MAIN,
- /* 1 */ mHm_ROOM_UPPER,
- /* 2 */ mHm_ROOM_BASEMENT,
+typedef enum Room {
+ /* 0 */ ROOM_MAIN,
+ /* 1 */ ROOM_UPPER,
+ /* 2 */ ROOM_BASEMENT,
+ /* 3 */ ROOM_NUM
+} Room;
- /* 3 */ mHm_ROOM_NUM
-} mHm_ROOM;
+typedef enum RoomType {
+ /* 0 */ ROOMTYPE_SMALL,
+ /* 1 */ ROOMTYPE_MEDIUM,
+ /* 2 */ ROOMTYPE_LARGE,
+ /* 3 */ ROOMTYPE_COTTAGE,
+ /* 4 */ ROOMTYPE_NUM
+} RoomType;
-typedef enum mHm_ROOMTYPE {
- /* 0 */ mHm_ROOMTYPE_SMALL,
- /* 1 */ mHm_ROOMTYPE_MEDIUM,
- /* 2 */ mHm_ROOMTYPE_LARGE,
- /* 3 */ mHm_ROOMTYPE_COTTAGE,
-
- /* 4 */ mHm_ROOMTYPE_NUM
-} mHm_ROOMTYPE;
-
-typedef enum mHm_HOMESIZE {
- /* 0 */ mHm_HOMESIZE_SMALL, /* initial size */
- /* 1 */ mHm_HOMESIZE_MEDIUM, /* paid off first debt */
- /* 2 */ mHm_HOMESIZE_LARGE, /* paid off second debt (excluding basement) */
- /* 3 */ mHm_HOMESIZE_UPPER, /* paid off third debt & basement */
- /* 4 */ mHm_HOMESIZE_STATUE, /* paid off final debt */
-
- /* 5 */ mHm_HOMESIZE_NUM
-}mHm_HOMESIZE;
+typedef enum HomeSize {
+ /* 0 */ HOMESIZE_SMALL, // initial size
+ /* 1 */ HOMESIZE_MEDIUM, // paid off first debt
+ /* 2 */ HOMESIZE_LARGE, // paid off second debt (excluding basement)
+ /* 3 */ HOMESIZE_UPPER, // paid off third debt & basement
+ /* 4 */ HOMESIZE_STATUE, // paid off final debt
+ /* 5 */ HOMESIZE_NUM
+} HomeSize;
+// original name, taken from m_flashrom
typedef struct Haniwa_Item_c {
- /* 0x00 */ u16 item; /* held item */
- /* 0x02 */ s16 exchange_type; /* type of exchange (sale, free, trade) */
- /* 0x04 */ u16 extra_data; /* trade related data */
+ /* 0x00 */ u16 item; // held item
+ /* 0x02 */ s16 exchangeType; // type of exchange (sale, free, trade)
+ /* 0x04 */ u16 extraData; // trade related data
} Haniwa_Item_c; // size = 0x6
+// original name, taken from m_flashrom
typedef struct Haniwa_c {
- /* 0x00 */ Haniwa_Item_c items[HANIWA_ITEM_HOLD_NUM]; /* held items */
- /* 0x18 */ u8 message[HANIWA_MESSAGE_LEN]; /* message for visitors */
- /* 0x58 */ u32 bells; /* held bells from selling items */
+ /* 0x00 */ Haniwa_Item_c items[HANIWA_ITEM_HOLD_NUM]; // held items
+ /* 0x18 */ u8 message[HANIWA_MESSAGE_LEN]; // message for visitors
+ /* 0x58 */ u32 bells; // held bells from selling items
} Haniwa_c; // size = 0x5C
-// Original name is mHm_goki_c
+// Original name, taken from m_flashrom
typedef struct mHm_goki_c {
/* 0x00 */ lbRTC_ymd_t time;
/* 0x04 */ u8 num;
/* 0x05 */ u8 pad;
} mHm_goki_c; // size = 0x6
+// Original name, taken from m_flashrom
typedef struct mHm_hs_c {
/* 0x000 */ PersonalID_c ownerID;
/* 0x010 */ UNK_TYPE1 unk_010[0x12];
/* 0x022 */ u8 unk_022;
- /* 0x023 */ UNK_TYPE1 unk023[0x1];
+ /* 0x023 */ UNK_TYPE1 unk_023[0x1];
/* 0x024 */ u8 unk_024;
- /* 0x025 */ UNK_TYPE1 unk025[0x453];
+ /* 0x025 */ UNK_TYPE1 unk_025[0x453];
/* 0x478 */ Mail_c mailbox[HOME_MAILBOX_SIZE];
/* 0xAE0 */ Haniwa_c haniwa;
/* 0xB3C */ mHm_goki_c goki;
- /* 0xB42 */ UNK_TYPE1 unkB42[0x6];
+ /* 0xB42 */ UNK_TYPE1 unk_B42[0x6];
} mHm_hs_c; // size = 0xB48
-
#endif
diff --git a/include/m_lib.h b/include/m_lib.h
index d411a96..3c706d8 100644
--- a/include/m_lib.h
+++ b/include/m_lib.h
@@ -35,7 +35,7 @@ s32 chase_s3(s16* pValue, s16 target, s16 step);
s32 chase_f2(f32* pValue, f32 limit, f32 step);
s32 chase_f3(f32* pValue, f32 target, f32 incrStep, f32 decrStep);
void inter_float(f32* pValue, f32 arg1, s32 stepCount);
-void stick_ratio_set(f32* radius, s16* angle, Input* input);
+void stick_ratio_set(f32* magnitude, s16* angle, Input* input);
s16 get_random_timer(s16 base, s16 range);
s16 get_random_pattern_timer(s16 base, s16 stride, s16 range);
void xyz_t_move(xyz_t* dest, xyz_t* src);
diff --git a/include/m_private_internals.h b/include/m_private_internals.h
index 84c6b3c..914f857 100644
--- a/include/m_private_internals.h
+++ b/include/m_private_internals.h
@@ -27,7 +27,7 @@ typedef struct Private_Sub_A86 {
} Private_Sub_A86; // size >= 0xA
typedef struct mPr_map_info_c {
- /* 0x00 */ char unk00[0x8];
+ /* 0x00 */ char unk00[0x8];
} mPr_map_info_c; // size = 0x8
typedef struct PrivateMotherMail {
diff --git a/include/m_start_data_init.h b/include/m_start_data_init.h
index e7d2a28..ca738ea 100644
--- a/include/m_start_data_init.h
+++ b/include/m_start_data_init.h
@@ -24,20 +24,20 @@ typedef enum mSDI_MALLOC_FLAG {
void famicom_emu_initial_common_data(void);
void decide_fruit(u16* fruit);
-void decide_fish_location(u8* fish_location);
+void decide_fish_location(u8* fishLocation);
void title_game_haniwa_data_init(void);
void mSDI_ClearMoneyPlayerHomeStationBlock(void);
-void mSDI_PullTreeUT(u16* item_p);
-void mSDI_PullTreeBlock(u16* items_p, s32 ut);
+void mSDI_PullTreeUT(u16* itemP);
+void mSDI_PullTreeBlock(u16* itemsP, s32 ut);
void mSDI_PullTree(void);
void mSDI_PullTreeUnderPlayerBlock(void);
-s32 mSDI_StartInitNew(Game* game2, s32 player_no, s32 malloc_flag);
-s32 mSDI_StartInitFrom(Game* game2, s32 player_no, s32 malloc_flag);
-s32 mSDI_StartInitNewPlayer(Game* game, s32 player_no, s32 malloc_flag);
-s32 mSDI_StartInitPak(Game* game2, s32 player_no, s32 malloc_flag);
-s32 mSDI_StartInitErr(Game* game, s32 player_no, s32 malloc_flag);
-void mSDI_StartInitAfter(Game* game, s32 renewal_reserve_flag, s32 malloc_flag);
-s32 mSDI_StartInitBefore(Game* game, s32 player_no, s32 init_mode, s32 malloc_flag);
-s32 mSDI_StartDataInit(Game* game, s32 player_no, s32 init_mode);
+s32 mSDI_StartInitNew(Game* game2, s32 playerNumber, s32 mallocFlag);
+s32 mSDI_StartInitFrom(Game* game2, s32 playerNumber, s32 mallocFlag);
+s32 mSDI_StartInitNewPlayer(Game* game, s32 playerNumber, s32 mallocFlag);
+s32 mSDI_StartInitPak(Game* game2, s32 playerNumber, s32 mallocFlag);
+s32 mSDI_StartInitErr(Game* game, s32 playerNumber, s32 mallocFlag);
+void mSDI_StartInitAfter(Game* game, s32 renewalReserveFlag, s32 mallocFlag);
+s32 mSDI_StartInitBefore(Game* game, s32 playerNumber, s32 initMode, s32 mallocFlag);
+s32 mSDI_StartDataInit(Game* game, s32 playerNumber, s32 initMode);
#endif
diff --git a/src/code/m_lib.c b/src/code/m_lib.c
index 3c7d927..f39845d 100644
--- a/src/code/m_lib.c
+++ b/src/code/m_lib.c
@@ -203,12 +203,12 @@ void inter_float(f32* pValue, f32 arg1, s32 stepCount) {
}
}
-void stick_ratio_set(f32* radius, s16* angle, Input* input) {
+void stick_ratio_set(f32* magnitude, s16* angle, Input* input) {
f32 relX = input->rel.stick_x;
f32 relY = input->rel.stick_y;
- *radius = sqrtf(SQ(relX) + SQ(relY));
- *radius = (*radius > 60.0f) ? 60.0f : *radius;
+ *magnitude = sqrtf(SQ(relX) + SQ(relY));
+ *magnitude = (*magnitude > 60.0f) ? 60.0f : *magnitude;
*angle = atans_table(relY, -relX);
}
diff --git a/src/code/m_start_data_init.c b/src/code/m_start_data_init.c
index f920741..cfedc6e 100644
--- a/src/code/m_start_data_init.c
+++ b/src/code/m_start_data_init.c
@@ -68,22 +68,22 @@ void decide_fruit(u16* fruit) {
*fruit = ITM_FOOD_START | (u16)RANDOM_F(n);
}
-void decide_fish_location(u8* fish_location) {
- *fish_location = RANDOM_F(3);
+void decide_fish_location(u8* fishLocation) {
+ *fishLocation = RANDOM_F(3);
}
void title_game_haniwa_data_init(void) {
s32 i;
- char haniwa_buf[HANIWA_MESSAGE_LEN];
+ char haniwaBuf[HANIWA_MESSAGE_LEN];
s32 j;
Haniwa_c* haniwa;
- mString_Load_StringFromRom(haniwa_buf, HANIWA_MESSAGE_LEN, 0x55C);
+ mString_Load_StringFromRom(haniwaBuf, HANIWA_MESSAGE_LEN, 0x55C);
for (i = 0; i < mHS_HOUSE_NUM; i++) {
haniwa = &common_data.homes[i].haniwa;
- mem_copy(common_data.homes[i].haniwa.message, (u8*)haniwa_buf, HANIWA_MESSAGE_LEN);
+ mem_copy(common_data.homes[i].haniwa.message, (u8*)haniwaBuf, HANIWA_MESSAGE_LEN);
for (j = 0; j < HANIWA_ITEM_HOLD_NUM; j++) {
haniwa->items[j].item = EMPTY_NO;
@@ -94,29 +94,29 @@ void title_game_haniwa_data_init(void) {
void mSDI_ClearMoneyPlayerHomeStationBlock(void) {
static s32 block_num[2][2] = {
- { 2, 1 }, /* Player home */
- { 2, 0 } /* Station */
+ { 2, 1 }, // Player home
+ { 2, 0 } // Station
};
- s32 block_z;
- s32 block_x;
+ s32 blockZ;
+ s32 blockX;
u16* items;
- s32 ut_x;
- s32 ut_z;
+ s32 utX;
+ s32 utZ;
u16 item;
s32 i;
s32 depositOffset;
for (i = 0; i < 2; i++) {
- block_z = block_num[i][1];
- block_x = block_num[i][0];
+ blockZ = block_num[i][1];
+ blockX = block_num[i][0];
- depositOffset = block_num[i][1] * FG_BLOCK_X_NUM + block_x;
- items = common_data.foreground[block_z][block_x].items[0];
+ depositOffset = block_num[i][1] * FG_BLOCK_X_NUM + blockX;
+ items = common_data.foreground[blockZ][blockX].items[0];
if (items != NULL) {
- for (ut_z = 0; ut_z < UT_Z_NUM; ut_z++) {
- for (ut_x = 0; ut_x < UT_X_NUM; ut_x++) {
+ for (utZ = 0; utZ < UT_Z_NUM; utZ++) {
+ for (utX = 0; utX < UT_X_NUM; utX++) {
item = *items;
if (item >= ITM_MONEY_START && item <= ITM_MONEY_END) {
@@ -126,7 +126,7 @@ void mSDI_ClearMoneyPlayerHomeStationBlock(void) {
*items = EMPTY_NO;
if (deposit != NULL) {
- mFI_BlockDepositOFF(deposit, ut_x, ut_z);
+ mFI_BlockDepositOFF(deposit, utX, utZ);
}
}
@@ -137,33 +137,33 @@ void mSDI_ClearMoneyPlayerHomeStationBlock(void) {
}
}
-void mSDI_PullTreeUT(u16* item_p) {
- if ((*item_p >= TREE_SAPLING && *item_p <= TREE_30000BELLS) ||
- (*item_p >= TREE_100BELLS_SAPLING && *item_p <= TREE_100BELLS)) {
- *item_p = EMPTY_NO;
+void mSDI_PullTreeUT(u16* itemP) {
+ if ((*itemP >= TREE_SAPLING && *itemP <= TREE_30000BELLS) ||
+ (*itemP >= TREE_100BELLS_SAPLING && *itemP <= TREE_100BELLS)) {
+ *itemP = EMPTY_NO;
}
}
-void mSDI_PullTreeBlock(u16* items_p, s32 ut) {
+void mSDI_PullTreeBlock(u16* itemsP, s32 ut) {
s32 i;
for (i = ut; i < UT_TOTAL_NUM; i += UT_X_NUM) {
- mSDI_PullTreeUT(&items_p[i]);
+ mSDI_PullTreeUT(&itemsP[i]);
}
}
void mSDI_PullTree(void) {
- Foreground* fg_block;
- s32 block_z;
-
- for (block_z = 0; block_z < FG_BLOCK_Z_NUM; block_z++) {
- /* Clear trees against the cliffs on the left and right town cliff borders */
- fg_block = &common_data.foreground[block_z][0];
- mSDI_PullTreeBlock(fg_block->items[0], 0);
- mSDI_PullTreeBlock((fg_block + FG_BLOCK_X_NUM - 1)->items[0], UT_X_NUM - 1);
+ Foreground* fgBlock;
+ s32 blockZ;
+
+ for (blockZ = 0; blockZ < FG_BLOCK_Z_NUM; blockZ++) {
+ // Clear trees against the cliffs on the left and right town cliff borders
+ fgBlock = &common_data.foreground[blockZ][0];
+ mSDI_PullTreeBlock(fgBlock->items[0], 0);
+ mSDI_PullTreeBlock((fgBlock + FG_BLOCK_X_NUM - 1)->items[0], UT_X_NUM - 1);
}
- if (fg_block) {}
+ if (fgBlock) {}
}
void mSDI_PullTreeUnderPlayerBlock(void) {
@@ -184,10 +184,10 @@ void mSDI_PullTreeUnderPlayerBlock(void) {
mSDI_PullTreeUT(&items[16 + 8]);
}
-s32 mSDI_StartInitNew(Game* game2, s32 player_no, s32 malloc_flag) {
+s32 mSDI_StartInitNew(Game* game2, s32 playerNumber, s32 mallocFlag) {
Game_Play* game_play = (Game_Play*)game2;
- PrivateInfo* priv;
- PrivateInfo* priv_p;
+ PrivateInfo* privateInfo;
+ PrivateInfo* privateInfoPointer;
Game* game = NULL;
s32 i;
UNUSED s32 pad[2];
@@ -195,14 +195,14 @@ s32 mSDI_StartInitNew(Game* game2, s32 player_no, s32 malloc_flag) {
common_data.sceneFromTitleDemo = SCENE_START_DEMO;
lbRTC_GetTime(&common_data.time.rtcTime);
- priv = &common_data.saveFilePrivateInfo[player_no];
- common_data.privateInfo = priv;
- common_data.playerNumber = player_no;
+ privateInfo = &common_data.saveFilePrivateInfo[playerNumber];
+ common_data.privateInfo = privateInfo;
+ common_data.playerNumber = playerNumber;
common_data.privateInfo->gender = mPr_SEX_MALE;
decide_fruit(&common_data.fruit);
- if (malloc_flag == 0) {
+ if (mallocFlag == 0) {
game = game2;
}
@@ -214,22 +214,22 @@ s32 mSDI_StartInitNew(Game* game2, s32 player_no, s32 malloc_flag) {
mFM_SetBlockKindLoadCombi(game);
mAGrw_ChangeTree2FruitTree();
- priv_p = &common_data.saveFilePrivateInfo[0];
+ privateInfoPointer = &common_data.saveFilePrivateInfo[0];
mMld_SetDefaultMelody();
mLd_LandDataInit();
mEv_ClearEventSaveInfo(&common_data.eventSaveInfo);
mEv_init(&game_play->event);
- mNpc_InitNpcAllInfo(malloc_flag);
+ mNpc_InitNpcAllInfo(mallocFlag);
for (i = 0; i < PLAYER_NUM; i++) {
- mPr_ClearPrivateInfo(priv_p);
- priv_p++;
+ mPr_ClearPrivateInfo(privateInfoPointer);
+ privateInfoPointer++;
}
- priv_p += player_no;
- priv_p -= PLAYER_NUM;
- mPr_InitPrivateInfo(priv_p);
+ privateInfoPointer += playerNumber;
+ privateInfoPointer -= PLAYER_NUM;
+ mPr_InitPrivateInfo(privateInfoPointer);
mNpc_SetRemoveAnimalNo(common_data.animals);
title_game_haniwa_data_init();
mPB_police_box_init(game);
@@ -260,13 +260,13 @@ s32 mSDI_StartInitNew(Game* game2, s32 player_no, s32 malloc_flag) {
return TRUE;
}
-s32 mSDI_StartInitFrom(Game* game2, s32 player_no, s32 malloc_flag) {
+s32 mSDI_StartInitFrom(Game* game2, s32 playerNumber, s32 mallocFlag) {
Game_Play* game_play = (Game_Play*)game2;
- PrivateInfo* priv;
+ PrivateInfo* privateInfo;
Game* game = game2;
s32 res = FALSE;
- if (malloc_flag != 0) {
+ if (mallocFlag != 0) {
game = NULL;
}
@@ -274,37 +274,37 @@ s32 mSDI_StartInitFrom(Game* game2, s32 player_no, s32 malloc_flag) {
lbRTC_GetTime(&common_data.time.rtcTime);
if (mFRm_CheckSaveData() == TRUE) {
- priv = &common_data.saveFilePrivateInfo[player_no];
- if (mPr_CheckPrivate(priv) == TRUE) {
- if (priv->exists == TRUE) {
- common_data.privateInfo = priv;
- common_data.playerNumber = player_no;
+ privateInfo = &common_data.saveFilePrivateInfo[playerNumber];
+ if (mPr_CheckPrivate(privateInfo) == TRUE) {
+ if (privateInfo->exists == TRUE) {
+ common_data.privateInfo = privateInfo;
+ common_data.playerNumber = playerNumber;
mFM_SetBlockKindLoadCombi(game);
mEv_init_force(&game_play->event);
- mHsRm_GetHuusuiRoom(game, player_no);
+ mHsRm_GetHuusuiRoom(game, playerNumber);
mSP_ExchangeLineUp_InGame(game);
mNpc_SetRemoveAnimalNo(common_data.animals);
- mCkRh_DecideNowGokiFamilyCount(player_no);
+ mCkRh_DecideNowGokiFamilyCount(playerNumber);
mMkRm_MarkRoom(game);
res = TRUE;
} else {
common_data.player_decoy_flag = TRUE;
- priv->exists = TRUE;
- common_data.privateInfo = priv;
- common_data.playerNumber = player_no;
+ privateInfo->exists = TRUE;
+ common_data.privateInfo = privateInfo;
+ common_data.playerNumber = playerNumber;
mFM_SetBlockKindLoadCombi(game);
- mHsRm_GetHuusuiRoom(game, player_no);
+ mHsRm_GetHuusuiRoom(game, playerNumber);
mSP_ExchangeLineUp_InGame(game);
mNpc_SetRemoveAnimalNo(common_data.animals);
- bzero(priv->inventory.pockets, sizeof(priv->inventory.pockets));
- priv->inventory.lotto_ticket_expiry_month = 0;
- priv->inventory.lotto_ticket_mail_storage = 0;
- priv->inventory.item_conditions = 0;
- priv->inventory.wallet = 0;
- mQst_ClearDelivery(priv->deliveries, mPr_DELIVERY_QUEST_NUM);
- mQst_ClearErrand(priv->errands, mPr_ERRAND_QUEST_NUM);
- mCkRh_DecideNowGokiFamilyCount(player_no);
+ bzero(privateInfo->inventory.pockets, sizeof(privateInfo->inventory.pockets));
+ privateInfo->inventory.lotto_ticket_expiry_month = 0;
+ privateInfo->inventory.lotto_ticket_mail_storage = 0;
+ privateInfo->inventory.item_conditions = 0;
+ privateInfo->inventory.wallet = 0;
+ mQst_ClearDelivery(privateInfo->deliveries, mPr_DELIVERY_QUEST_NUM);
+ mQst_ClearErrand(privateInfo->errands, mPr_ERRAND_QUEST_NUM);
+ mCkRh_DecideNowGokiFamilyCount(playerNumber);
mMkRm_MarkRoom(game);
res = TRUE;
}
@@ -313,24 +313,24 @@ s32 mSDI_StartInitFrom(Game* game2, s32 player_no, s32 malloc_flag) {
return res;
}
-s32 mSDI_StartInitNewPlayer(Game* game, s32 player_no, s32 malloc_flag) {
+s32 mSDI_StartInitNewPlayer(Game* game, s32 playerNumber, s32 mallocFlag) {
Game_Play* game_play = (Game_Play*)game;
- PrivateInfo* priv;
+ PrivateInfo* privateInfo;
s32 res = FALSE;
UNUSED s32 pad;
common_data.sceneFromTitleDemo = SCENE_START_DEMO2;
lbRTC_GetTime(&common_data.time.rtcTime);
- priv = &common_data.saveFilePrivateInfo[player_no];
+ privateInfo = &common_data.saveFilePrivateInfo[playerNumber];
if (mFRm_CheckSaveData() == TRUE) {
- if (mPr_CheckPrivate(priv) != TRUE) {
- mPr_InitPrivateInfo(priv);
- common_data.privateInfo = priv;
+ if (mPr_CheckPrivate(privateInfo) != TRUE) {
+ mPr_InitPrivateInfo(privateInfo);
+ common_data.privateInfo = privateInfo;
mPr_SetPossessionItem(common_data.privateInfo, 0, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
- common_data.playerNumber = player_no;
+ common_data.playerNumber = playerNumber;
common_data.privateInfo->gender = mPr_SEX_MALE;
- if (malloc_flag == 0) {
+ if (mallocFlag == 0) {
mFM_SetBlockKindLoadCombi(game);
mEv_init_force(&game_play->event);
mSP_ExchangeLineUp_InGame(game);
@@ -347,32 +347,32 @@ s32 mSDI_StartInitNewPlayer(Game* game, s32 player_no, s32 malloc_flag) {
return res;
}
-s32 mSDI_StartInitPak(Game* game2, s32 player_no, s32 malloc_flag) {
+s32 mSDI_StartInitPak(Game* game2, s32 playerNumber, s32 mallocFlag) {
Game* game = game2;
Game_Play* game_play = (Game_Play*)game;
UNUSED s32 pad;
s32 res = FALSE;
s32 sp1C;
- if (malloc_flag == 1) {
+ if (mallocFlag == 1) {
game = NULL;
}
- if (player_no < 5) {
+ if (playerNumber < 5) {
common_data.sceneFromTitleDemo = SCENE_FG;
}
if (mFRm_CheckSaveData() == TRUE) {
sp1C = mCPk_get_pkinfo();
- if ((func_80078E90_jp(sp1C, 0) == TRUE) && (func_800B8D64_jp(player_no, sp1C) == TRUE)) {
+ if ((func_80078E90_jp(sp1C, 0) == TRUE) && (func_800B8D64_jp(playerNumber, sp1C) == TRUE)) {
mFM_SetBlockKindLoadCombi(game);
mEv_init_force(&game_play->event);
- mHsRm_GetHuusuiRoom(game, player_no);
+ mHsRm_GetHuusuiRoom(game, playerNumber);
mSP_ExchangeLineUp_InGame(game);
mNpc_SetRemoveAnimalNo(common_data.animals);
mNpc_SetReturnAnimal(mNpc_GetInAnimalP());
mNpc_SendRegisteredGoodbyMail();
- mCkRh_DecideNowGokiFamilyCount(player_no);
+ mCkRh_DecideNowGokiFamilyCount(playerNumber);
mMkRm_MarkRoom(game);
mEv_SetGateway();
res = TRUE;
@@ -381,11 +381,11 @@ s32 mSDI_StartInitPak(Game* game2, s32 player_no, s32 malloc_flag) {
return res;
}
-s32 mSDI_StartInitErr(UNUSED Game* game, UNUSED s32 player_no, UNUSED s32 malloc_flag) {
+s32 mSDI_StartInitErr(UNUSED Game* game, UNUSED s32 playerNumber, UNUSED s32 mallocFlag) {
return TRUE;
}
-void mSDI_StartInitAfter(Game* game, s32 renewal_reserve_flag, s32 malloc_flag) {
+void mSDI_StartInitAfter(Game* game, s32 renewalReserveFlag, s32 mallocFlag) {
Game_Play* game_play = (Game_Play*)game;
common_data.houseOwnerName = -1;
@@ -404,9 +404,9 @@ void mSDI_StartInitAfter(Game* game, s32 renewal_reserve_flag, s32 malloc_flag)
func_80096B64_jp();
mNpc_InitNpcData();
mNpc_InitNpcList();
- mNpc_SetNpcList(common_data.npclist, common_data.animals, ANIMAL_NUM_MAX, malloc_flag);
+ mNpc_SetNpcList(common_data.npclist, common_data.animals, ANIMAL_NUM_MAX, mallocFlag);
mNpc_ClearTalkInfo();
- if (renewal_reserve_flag == 1) {
+ if (renewalReserveFlag == 1) {
mFM_RenewalReserve();
}
mQst_ClearNotSaveQuest(&common_data.quest);
@@ -428,30 +428,30 @@ void mSDI_StartInitAfter(Game* game, s32 renewal_reserve_flag, s32 malloc_flag)
mPr_RenewalMapInfo(common_data.privateInfo->maps, mPr_FOREIGN_MAP_COUNT, &common_data.landInfo);
}
-typedef s32 (*mSDI_INIT_PROC)(Game*, s32, s32);
+typedef s32 (*StartDataInitProcess)(Game*, s32, s32);
-s32 mSDI_StartInitBefore(Game* game, s32 player_no, s32 init_mode, s32 malloc_flag) {
- static mSDI_INIT_PROC init_proc[mSDI_INIT_MODE_NUM] = {
+s32 mSDI_StartInitBefore(Game* game, s32 playerNumber, s32 initMode, s32 mallocFlag) {
+ static StartDataInitProcess init_proc[] = {
mSDI_StartInitNew, mSDI_StartInitNewPlayer, mSDI_StartInitFrom, mSDI_StartInitPak, mSDI_StartInitErr,
};
mEv_UnSetGateway();
- return init_proc[init_mode](game, player_no, malloc_flag);
+ return init_proc[initMode](game, playerNumber, mallocFlag);
}
-s32 mSDI_StartDataInit(Game* game, s32 player_no, s32 init_mode) {
- static int renew_reserve_mode_table[mSDI_INIT_MODE_NUM] = {
+s32 mSDI_StartDataInit(Game* game, s32 playerNumber, s32 initMode) {
+ static int renew_reserve_mode_table[] = {
TRUE, FALSE, FALSE, FALSE, FALSE,
};
s32 res;
- if ((init_mode < mSDI_INIT_MODE_NEW) || (init_mode >= mSDI_INIT_MODE_NUM)) {
- init_mode = mSDI_INIT_MODE_NEW;
+ if ((initMode < mSDI_INIT_MODE_NEW) || (initMode >= mSDI_INIT_MODE_NUM)) {
+ initMode = mSDI_INIT_MODE_NEW;
}
- res = mSDI_StartInitBefore(game, player_no, init_mode, mSDI_MALLOC_FLAG_ZELDA);
+ res = mSDI_StartInitBefore(game, playerNumber, initMode, mSDI_MALLOC_FLAG_ZELDA);
if (res == TRUE) {
- mSDI_StartInitAfter(game, renew_reserve_mode_table[init_mode], mSDI_MALLOC_FLAG_ZELDA);
+ mSDI_StartInitAfter(game, renew_reserve_mode_table[initMode], mSDI_MALLOC_FLAG_ZELDA);
}
return res;
diff --git a/src/overlays/actors/ovl_Toudai/ac_toudai.c b/src/overlays/actors/ovl_Toudai/ac_toudai.c
index 4da1093..280dfa6 100644
--- a/src/overlays/actors/ovl_Toudai/ac_toudai.c
+++ b/src/overlays/actors/ovl_Toudai/ac_toudai.c
@@ -73,18 +73,18 @@ void aTOU_actor_dt(Actor* thisx, Game_Play* game_play UNUSED) {
thisx->world.pos.z += 20.0f;
}
-mCoBG_OffsetTable height_table_ct_360[] = { { 0x64, 16, 16, 16, 16, 16, 0 },
- { 0x64, 16, 16, 16, 16, 16, 0 },
- { 0x64, 16, 16, 16, 16, 16, 0 },
- { 0x64, 16, 16, 16, 16, 16, 0 } };
-mCoBG_OffsetTable* height_table_361[] = { height_table_ct_360, height_table_ct_360 };
+mCoBG_unkStruct2 height_table_ct_360[] = { { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 } };
+mCoBG_unkStruct2* height_table_361[] = { height_table_ct_360, height_table_ct_360 };
f32 addX_362[] = { -40.0f, 0.0f };
f32 addZ_363[] = { -40.0f, 0.0f };
void aTOU_set_bgOffset(Toudai* this, s32 heightTableIndex) {
s32 i;
xyz_t pos;
- mCoBG_OffsetTable* offsetTable = height_table_361[heightTableIndex];
+ mCoBG_unkStruct2* offsetTable = height_table_361[heightTableIndex];
for (i = 0; i < 2; i++) {
pos.z = addZ_363[i] + this->actor.home.pos.z;
diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml
index cc160a9..0d083bb 100644
--- a/yamls/jp/code.yaml
+++ b/yamls/jp/code.yaml
@@ -66,7 +66,7 @@
- [0x6D4E00, asm, code/m_player_lib]
- [0x6D9D80, asm, code/6D9D80]
- [0x6DA460, asm, code/6DA460]
- - [0x6DB420, asm, code/6DB420]
+ - [0x6DB420, asm, code/m_private]
- [0x6DE300, asm, code/6DE300]
- [0x6E08E0, asm, code/m_random_field]
- [0x6E0F50, asm, code/m_rcp]