diff options
| -rw-r--r-- | include/6C92D0.h | 13 | ||||
| -rw-r--r-- | include/m_name_table.h | 18 | ||||
| -rw-r--r-- | linker_scripts/jp/symbol_addrs_code.txt | 22 | ||||
| -rw-r--r-- | relocs/reloc_addrs.jp.txt | 6 | ||||
| -rw-r--r-- | src/code/m_name_table.c | 318 | ||||
| -rw-r--r-- | yamls/jp/code.yaml | 4 |
6 files changed, 356 insertions, 25 deletions
diff --git a/include/6C92D0.h b/include/6C92D0.h deleted file mode 100644 index d4b1bcb..0000000 --- a/include/6C92D0.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef C_6C92D0_H -#define C_6C92D0_H - -#include "ultra64.h" - -// void func_800A5630_jp(); -// void func_800A56CC_jp(); -// void func_800A56F0_jp(); -// void func_800A5970_jp(); -// void func_800A5A0C_jp(); -// void func_800A5AC8_jp(); - -#endif diff --git a/include/m_name_table.h b/include/m_name_table.h index 141a16e..7269003 100644 --- a/include/m_name_table.h +++ b/include/m_name_table.h @@ -2,10 +2,28 @@ #define M_NAME_TABLE_H #include "ultra64.h" +#include "m_collision_bg.h" +typedef struct NameTableOffsetTable { + s32 type; + mCoBG_unkStruct2 unk4; +} NameTableOffsetTable; + +extern s16 move_obj_profile_table[]; +extern s16 actor_profile_table[]; +extern s16 props_profile_table[]; extern u8 npc_looks_table[]; +s32 mNT_get_itemTableNo(u16 item); +u16 mNT_FishIdx2FishItemNo(s32 idx); +u16 bg_item_fg_sub(u16 item, s16 flag); +u16 bg_item_fg_sub_tree_grow(u16 item, s32 pastDays, s32 checkPlant); +u16 bg_item_fg_sub_dig2take_conv(u16 item); +NameTableOffsetTable* obj_hight_table_item0_nogrow(u16 item); + #define GET_NAME_ITEM_CATEGORY(f) (((f) & 0x0F00) >> 8) +#define GET_NAME_ITEM_TYPE(n) (((n) & 0xF000) >> 12) +#define GET_NAME_ITEM_INDEX(n) ((u16)(n) & 0xFF) #define EMPTY_NO 0x0000 diff --git a/linker_scripts/jp/symbol_addrs_code.txt b/linker_scripts/jp/symbol_addrs_code.txt index fc13d95..0975771 100644 --- a/linker_scripts/jp/symbol_addrs_code.txt +++ b/linker_scripts/jp/symbol_addrs_code.txt @@ -2223,12 +2223,12 @@ func_800A50AC_jp = 0x800A50AC; // type:func func_800A518C_jp = 0x800A518C; // type:func func_800A524C_jp = 0x800A524C; // type:func func_800A5460_jp = 0x800A5460; // type:func -func_800A5630_jp = 0x800A5630; // type:func -func_800A56CC_jp = 0x800A56CC; // type:func -func_800A56F0_jp = 0x800A56F0; // type:func -func_800A5970_jp = 0x800A5970; // type:func -func_800A5A0C_jp = 0x800A5A0C; // type:func -func_800A5AC8_jp = 0x800A5AC8; // type:func +mNT_get_itemTableNo = 0x800A5630; // type:func +mNT_FishIdx2FishItemNo = 0x800A56CC; // type:func +bg_item_fg_sub = 0x800A56F0; // type:func +bg_item_fg_sub_tree_grow = 0x800A5970; // type:func +bg_item_fg_sub_dig2take_conv = 0x800A5A0C; // type:func +obj_hight_table_item0_nogrow = 0x800A5AC8; // type:func func_800A5B50_jp = 0x800A5B50; // type:func func_800A5BC4_jp = 0x800A5BC4; // type:func func_800A5CB0_jp = 0x800A5CB0; // type:func @@ -4719,21 +4719,21 @@ D_8010AEC0_jp = 0x8010AEC0; // D_8010AEC8_jp = 0x8010AEC8; // type:u8 D_8010AECC_jp = 0x8010AECC; // D_8010AEE0_jp = 0x8010AEE0; // -D_8010AEF4_jp = 0x8010AEF4; // -D_8010AF00_jp = 0x8010AF00; // type:s16 -D_8010AF30_jp = 0x8010AF30; // type:s16 +move_obj_profile_table = 0x8010AF00; // type:s16 +actor_profile_table = 0x8010AF2C; // type:s16 +props_profile_table = 0x8010AF30; // type:s16 npc_looks_table = 0x8010AF58; // type:u8 D_8010B034_jp = 0x8010B034; // D_8010B074_jp = 0x8010B074; // D_8010B078_jp = 0x8010B078; // D_8010B09C_jp = 0x8010B09C; // -D_8010B0BC_jp = 0x8010B0BC; // +D_8010B0BC_jp = 0x8010B0BC; // type:s16 D_8010B1BC_jp = 0x8010B1BC; // D_8010B1DC_jp = 0x8010B1DC; // D_8010B21C_jp = 0x8010B21C; // D_8010B25C_jp = 0x8010B25C; // D_8010B264_jp = 0x8010B264; // -D_8010B270_jp = 0x8010B270; // +D_8010B270_jp = 0x8010B270; // type:s16 D_8010B2A8_jp = 0x8010B2A8; // D_8010B2AC_jp = 0x8010B2AC; // D_8010B30C_jp = 0x8010B30C; // diff --git a/relocs/reloc_addrs.jp.txt b/relocs/reloc_addrs.jp.txt index 6073000..df42fc3 100644 --- a/relocs/reloc_addrs.jp.txt +++ b/relocs/reloc_addrs.jp.txt @@ -42,6 +42,12 @@ rom:0x001240 symbol:code_BSS_END reloc:MIPS_LO16 // code +rom:0x6C8C80 symbol:D_8010AEE0_jp reloc:MIPS_HI16 addend:0x14 +rom:0x6C8C88 symbol:D_8010AEE0_jp reloc:MIPS_LO16 addend:0x14 + +rom:0x6C8CE0 symbol:D_8010AEE0_jp reloc:MIPS_HI16 addend:0x14 +rom:0x6C8CE4 symbol:D_8010AEE0_jp reloc:MIPS_LO16 addend:0x14 + rom:0x6F657C symbol:segment_13D9A0_ROM_START reloc:MIPS_HI16 rom:0x6F6580 symbol:segment_13D9A0_ROM_START reloc:MIPS_LO16 diff --git a/src/code/m_name_table.c b/src/code/m_name_table.c new file mode 100644 index 0000000..53e63c7 --- /dev/null +++ b/src/code/m_name_table.c @@ -0,0 +1,318 @@ +#include "m_common_data.h" +#include "m_name_table.h" +#include "m_npc_base.h" +#include "sys_math.h" +#include "m_actor_dlftbls.h" + +s16 move_obj_profile_table[] = { + ACTOR_AIRPLANE, ACTOR_BALL, ACTOR_MY_ROOM, ACTOR_MBG, + ACTOR_BOX_MANAGER, ACTOR_BOX_TRICK_01, ACTOR_ARRANGE_ROOM, ACTOR_ARRANGE_FURNITURE, + ACTOR_EFFECT_CONTROL, ACTOR_SHOP_DESIGN, ACTOR_SHOP_MANEKIN, ACTOR_SHOP_INDOOR, + ACTOR_SHOP_GOODS, ACTOR_SNOWMAN, ACTOR_SNOWMAN, ACTOR_BROKER_DESIGN, + ACTOR_MY_INDOOR, ACTOR_TRAIN_WINDOW, ACTOR_UKI, ACTOR_SHOP_UMBRELLA, + ACTOR_KAMAKURA_INDOOR, ACTOR_HOUSE_CLOCK, +}; + +s16 actor_profile_table[] = { + ACTOR_SAMPLE, +}; + +s16 props_profile_table[] = { + ACTOR_MAIL_BOX, ACTOR_MAIL_BOX, ACTOR_MAIL_BOX, ACTOR_MAIL_BOX, ACTOR_HANIWA, ACTOR_HANIWA, ACTOR_HANIWA, + ACTOR_HANIWA, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, + ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_PSNOWMAN, ACTOR_TRAIN_DOOR, ACTOR_NAMEPLATE, +}; + +u8 npc_looks_table[] = { + NPC_LOOKS_BOY, NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_GIRL, NPC_LOOKS_GIRL, NPC_LOOKS_KO_GIRL, + NPC_LOOKS_GRIM_MAN, NPC_LOOKS_KO_GIRL, NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_SPORT_MAN, NPC_LOOKS_NANIWA_LADY, + NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_GRIM_MAN, NPC_LOOKS_KO_GIRL, NPC_LOOKS_GIRL, NPC_LOOKS_GIRL, + NPC_LOOKS_KO_GIRL, NPC_LOOKS_GRIM_MAN, NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_SPORT_MAN, NPC_LOOKS_GRIM_MAN, + NPC_LOOKS_BOY, NPC_LOOKS_BOY, NPC_LOOKS_GRIM_MAN, NPC_LOOKS_KO_GIRL, NPC_LOOKS_NANIWA_LADY, + NPC_LOOKS_GRIM_MAN, NPC_LOOKS_KO_GIRL, NPC_LOOKS_SPORT_MAN, NPC_LOOKS_KO_GIRL, NPC_LOOKS_B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L, NPC_LOOKS_NANIWA_LADY, + NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_KO_GIRL, NPC_LOOKS_GIRL, NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_GRIM_MAN, + NPC_LOOKS_GIRL, NPC_LOOKS_KO_GIRL, NPC_LOOKS_GIRL, NPC_LOOKS_NANIWA_LADY, NPC_LOOKS_SPORT_MAN, + NPC_LOOKS_KO_GIRL, NPC_LOOKS_KO_GIRL, NPC_LOOKS_KO_GIRL, +}; + +u8 item1_0_tableNo[] = { + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +}; + +u8 item1_1_tableNo[] = { + 9, + 9, + 9, + 9, +}; + +u8 item1_2_tableNo[] = { + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +}; + +u8 item1_3_tableNo[] = { + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, +}; + +u8 item1_4_tableNo[] = { + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +}; + +u8 item1_5_tableNo[] = { + 22, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 21, + 21, 21, 20, 23, 22, 25, 24, 24, 24, 25, 25, 24, 26, 14, 11, +}; + +u8 item1_6_tableNo[] = { + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +}; + +u8 item1_7_tableNo[] = { + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +}; + +u8 item1_8_tableNo[] = { + 1, 5, 4, 3, 2, 6, 17, +}; + +u8 item1_9_tableNo[] = { + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +}; + +u8 item1_A_tableNo[] = { + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +}; + +u8 item1_B_tableNo[] = { + 21, +}; + +u8 item1_C_tableNo[] = { + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, +}; + +u8 item1_D_tableNo[] = { + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, +}; + +u8 item1_E_tableNo[] = { + 17, + 17, +}; + +u8 item1_F_tableNo[] = { + 7, + 7, + 7, + 7, +}; + +s32 mNT_get_itemTableNo(u16 item) { + static u8* item1_tableNo[] = { + item1_0_tableNo, item1_1_tableNo, item1_2_tableNo, item1_3_tableNo, item1_4_tableNo, item1_5_tableNo, + item1_6_tableNo, item1_7_tableNo, item1_8_tableNo, item1_9_tableNo, item1_A_tableNo, item1_B_tableNo, + item1_C_tableNo, item1_D_tableNo, item1_E_tableNo, item1_F_tableNo, + }; + s32 ret; + + s32 type = GET_NAME_ITEM_TYPE(item); + s32 category; + s32 idx; + + switch (type) { + case 1: + if ((item >= 0x1E3C) && (item < 0x1EA0)) { + ret = 0x14; + } else if ((item >= 0x15B0) && (item < 0x17AC)) { + ret = 0x10; + } else { + ret = 0xA; + } + break; + + case 2: + category = GET_NAME_ITEM_CATEGORY((u16)item); + idx = GET_NAME_ITEM_INDEX((u16)item); + + ret = item1_tableNo[category][idx]; + break; + + default: + ret = 0; + break; + } + + return ret; +} + +u16 mNT_FishIdx2FishItemNo(s32 idx) { + if (idx >= 0 && idx <= (0x1E + 1)) { + return 0x2300 + idx; + } + + return EMPTY_NO; +} + +u16 bg_item_fg_sub(u16 item, s16 flag) { + u16 stump = item; + + if (flag == 0) { + if ((item == 0x804) || (item == 0x80C) || (item == 0x814) || (item == 0x81C) || (item == 0x824) || + (item == 0x82C) || (item == 0x831) || (item == 0x836) || (item == 0x83B) || (item == 0x853) || + (item == 0x809) || (item == 0x811) || (item == 0x819) || (item == 0x821) || (item == 0x829) || + (item == 0x80A) || (item == 0x812) || (item == 0x81A) || (item == 0x822) || (item == 0x82A) || + (item == 0x80B) || (item == 0x813) || (item == 0x81B) || (item == 0x823) || (item == 0x82B) || + (item == 0x5E) || (item == 0x5F) || (item == 0x60) || (item == 0x61) || (item == 0x69)) { + stump = 4; + } else if ((item == 0x803) || (item == 0x808) || (item == 0x810) || (item == 0x818) || (item == 0x820) || + (item == 0x828) || (item == 0x830) || (item == 0x835) || (item == 0x83A) || (item == 0x830) || + (item == 0x835) || (item == 0x83A) || (item == 0x852)) { + stump = 3; + } else if ((item == 0x802) || (item == 0x807) || (item == 0x80F) || (item == 0x817) || (item == 0x81F) || + (item == 0x827) || (item == 0x82F) || (item == 0x834) || (item == 0x839) || (item == 0x82F) || + (item == 0x834) || (item == 0x839) || (item == 0x851)) { + stump = 2; + } else if ((item == 0x801) || (item == 0x806) || (item == 0x80E) || (item == 0x816) || (item == 0x81E) || + (item == 0x826) || (item == 0x82E) || (item == 0x833) || (item == 0x838) || (item == 0x82E) || + (item == 0x833) || (item == 0x838) || (item == 0x850)) { + stump = 1; + } + } + + return stump; +} + +u16 bg_item_fg_sub_tree_grow(u16 item, s32 pastDays, s32 checkPlant) { + static s16 grow_check[][2] = { + { -1, 0 }, { -1, 1 }, { -1, 2 }, { -1, 3 }, { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, { -4, 3 }, { -1, 4 }, + { -1, 4 }, { -1, 4 }, { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, { -4, 3 }, { -1, 4 }, { -1, 4 }, { -1, 4 }, + { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, { -4, 3 }, { -1, 4 }, { -1, 4 }, { -1, 4 }, { 0, 4 }, { -1, 0 }, + { -1, 1 }, { -1, 2 }, { -4, 3 }, { -1, 4 }, { -1, 4 }, { -1, 4 }, { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, + { -4, 3 }, { -1, 4 }, { -1, 4 }, { -1, 4 }, { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, { -1, 3 }, { 0, 4 }, + { -1, 0 }, { -1, 1 }, { -1, 2 }, { -1, 3 }, { 0, 4 }, { -1, 0 }, { -1, 1 }, { -1, 2 }, { -1, 3 }, { 0, 4 }, + { -1, 0 }, { -1, 1 }, { -1, 2 }, { -1, 3 }, { 0, 4 }, + }; + + s32 idx; + s32 diff; + + if ((item >= 0x800 && item <= 0x83B) || (item >= 0x84F && item <= 0x853)) { + if (item >= 0x84F) { + idx = item - 0x0813; + } else { + idx = item - 0x0800; + } + + for (; pastDays >= 0; item += diff) { + diff = -grow_check[idx][0]; + + if (grow_check[idx + diff][1] > checkPlant) { + break; + } + idx += diff; + pastDays--; + } + } + + return item; +} + +u16 bg_item_fg_sub_dig2take_conv(u16 item) { + u16 digItem; + + digItem = item; + if ((item >= 0x2A) && (item <= 0x42)) { + digItem = 0x2512; + } + + if (item == 0x5C) { + { + if (common_data.privateInfo->destiny.type == 4) { + digItem = 0x2102; + } else { + s32 selectedRand = RANDOM(35); + if (selectedRand == 0) { + digItem = 0x2102; + } else if ((selectedRand > 0) && (selectedRand < 4)) { + digItem = 0x2101; + } else { + digItem = 0x2100; + } + } + } + } + return digItem; +} + +NameTableOffsetTable height_table[3] = { + { 0, { 100, 0, 0, 0, 0, 0, 0 } }, + { 0, { 23, 4, 4, 4, 4, 4, 0 } }, + { 0, { 23, 7, 7, 7, 7, 7, 0 } }, +}; + +NameTableOffsetTable* obj_hight_table_item0_nogrow(u16 item) { + NameTableOffsetTable* table = &height_table[0]; + + if ((item == 5) || (item == 6) || (item == 7) || (item == 0xB) || (item == 0x10)) { + table = &height_table[1]; + } else if ((item == 0xC) || (item == 0xD) || (item == 0xE) || (item == 0xF)) { + table = &height_table[2]; + } + + return table; +} diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml index bec6a8f..c50a1e2 100644 --- a/yamls/jp/code.yaml +++ b/yamls/jp/code.yaml @@ -53,7 +53,7 @@ - [0x6C05A0, asm, code/6C05A0] - [0x6C0690, asm, code/6C0690] - [0x6C0E90, asm, code/m_msg_main] - - [0x6C92D0, asm, code/6C92D0] + - [0x6C92D0, c, code/m_name_table] - [0x6C97F0, asm, code/6C97F0] - [0x6CA4B0, c, code/m_npc] - [0x6D2720, c, code/m_npc_schedule] @@ -150,6 +150,8 @@ - [0x72B7A0, .data, code/m_lib] - [0x72B7D0, .data, code/m_lights] - [0x72B7F0, data, code/72B7F0] + - [0x72EBA0, .data, code/m_name_table] + - [0x72F140, data, code/72F140] - [0x72F1B0, .data, code/m_npc] - [0x72F610, .data, code/m_npc_schedule] - [0x72F7D0, .data, code/m_npc_walk] |
