parent
d5f043ed1c
commit
f6d96522a8
|
|
@ -23,13 +23,11 @@ typedef struct {
|
|||
/* 0x1C */ u16 strength;
|
||||
/* 0x1E */ u16 vitality;
|
||||
/* 0x20 */ u16 intelligence;
|
||||
/* 0x22 */ u16 mem;
|
||||
/* 0x22 */ u16 mentality;
|
||||
/* 0x24 */ u16 agility;
|
||||
// DEX affects melee and special attacks, as well as accuracy.
|
||||
/* 0x26 */ u16 dexterity;
|
||||
/* 0x28 */ u8 field_0x28[0x10];
|
||||
} CharacterSlot; // size:0x38
|
||||
|
||||
// const int __size = sizeof(CharacterSlot);
|
||||
|
||||
#endif // __CHARACTER_H__
|
||||
|
|
@ -15,6 +15,7 @@ typedef u8 bool;
|
|||
#define ARRAY_LENGTH(x) ((sizeof(x)) / (sizeof(x[0])))
|
||||
|
||||
#include "character.h"
|
||||
#include "item.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 field_0x0;
|
||||
|
|
@ -295,48 +296,4 @@ extern u8 D_800A872C;
|
|||
|
||||
extern CharacterSlot CHARACTER_SLOT_MAGNUS[];
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x01 */ u8 field_0x1;
|
||||
/* 0x02 */ u8 field_0x2;
|
||||
/* 0x03 */ u8 field_0x3;
|
||||
/* 0x04 */ u8 field_0x4;
|
||||
/* 0x05 */ u8 field_0x5;
|
||||
/* 0x06 */ u8 field_0x6;
|
||||
/* 0x07 */ u8 field_0x7;
|
||||
/* 0x08 */ u8 field_0x8;
|
||||
/* 0x09 */ u8 field_0x9;
|
||||
/* 0x10 */ u8 field_0xa;
|
||||
/* 0x11 */ u8 field_0xb;
|
||||
/* 0x12 */ u8 field_0xc;
|
||||
/* 0x13 */ u8 field_0xd;
|
||||
/* 0x14 */ u8 field_0xe;
|
||||
/* 0x15 */ u8 field_0xf;
|
||||
/* 0x10 */ u8 field_0x10;
|
||||
/* 0x11 */ u8 field_0x11;
|
||||
/* 0x12 */ u8 field_0x12;
|
||||
/* 0x13 */ u8 field_0x13;
|
||||
/* 0x14 */ u8 field_0x14;
|
||||
/* 0x15 */ u8 field_0x15;
|
||||
/* 0x16 */ u8 field_0x16;
|
||||
/* 0x17 */ u8 field_0x17;
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x19 */ u8 field_0x19;
|
||||
/* 0x1a */ u8 field_0x1a;
|
||||
/* 0x1b */ u8 field_0x1b;
|
||||
/* 0x1c */ u8 field_0x1c;
|
||||
/* 0x1d */ u8 field_0x1d;
|
||||
/* 0x1e */ u8 field_0x1e;
|
||||
/* 0x1f */ u8 field_0x1f;
|
||||
} __UnkCharacterStats; // size:0x20
|
||||
|
||||
extern u8 D_8018C410[];
|
||||
extern u8 D_8018C411[];
|
||||
extern u8 D_8018C416[];
|
||||
extern u8 D_8018C417[];
|
||||
extern u8 D_8018C41A[];
|
||||
|
||||
extern s8 __magnus_get_vitality(u16 arg0);
|
||||
extern s8 __magnus_get_intelligence(u16 arg0);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __ELEMENT_H__
|
||||
#define __ELEMENT_H__
|
||||
|
||||
typedef enum {
|
||||
ELEMENT_PHYSICAL,
|
||||
ELEMENT_WIND,
|
||||
ELEMENT_FLAME,
|
||||
ELEMENT_EARTH,
|
||||
ELEMENT_WATER,
|
||||
ELEMENT_VIRTUE,
|
||||
ELEMENT_BANE,
|
||||
|
||||
ELEMENT_UNKNOWN_0x10 = 0x10,
|
||||
|
||||
ELEMENT_INVALID = 0xFF,
|
||||
} __attribute__ ((__packed__)) Element;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
#ifndef __ITEM_H__
|
||||
#define __ITEM_H__
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
#include "element.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x01 */ Element element;
|
||||
/* 0x02 */ u8 field_0x2;
|
||||
/* 0x03 */ u8 field_0x3;
|
||||
/* 0x04 */ u16 field_0x4;
|
||||
/* 0x06 */ s8 strength;
|
||||
/* 0x07 */ s8 intelligence;
|
||||
/* 0x08 */ s8 agility;
|
||||
/* 0x09 */ s8 dexterity;
|
||||
/* 0x10 */ s8 vitality;
|
||||
/* 0x11 */ s8 mentality;
|
||||
/* 0x12 */ s8 field_0xc;
|
||||
/* 0x13 */ s8 res_strike;
|
||||
/* 0x14 */ s8 res_wind;
|
||||
/* 0x15 */ s8 res_fire;
|
||||
/* 0x10 */ s8 res_earth;
|
||||
/* 0x11 */ s8 res_water;
|
||||
/* 0x12 */ s8 res_holy;
|
||||
/* 0x13 */ u8 res_dark;
|
||||
/* 0x14 */ u8 field_0x14;
|
||||
/* 0x15 */ u8 field_0x15;
|
||||
/* 0x16 */ u8 field_0x16;
|
||||
/* 0x17 */ u8 field_0x17;
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x19 */ u8 field_0x19;
|
||||
/* 0x1a */ u8 field_0x1a;
|
||||
/* 0x1b */ u8 field_0x1b;
|
||||
/* 0x1c */ u8 field_0x1c;
|
||||
/* 0x1d */ u8 field_0x1d;
|
||||
/* 0x1e */ u8 field_0x1e;
|
||||
/* 0x1f */ u8 field_0x1f;
|
||||
} ItemData; // size:0x20
|
||||
|
||||
extern ItemData ITEM_DATA[];
|
||||
|
||||
extern u8 item_get_field_0x0(u16 arg0);
|
||||
extern Element item_get_element(u16 arg0);
|
||||
extern u8 item_get_field_0x2(u16 arg0);
|
||||
extern u16 item_get_field_0x4(u16 arg0);
|
||||
extern s8 item_get_field_0xc(u16 arg0);
|
||||
extern s8 item_get_strength(u16 arg0);
|
||||
extern s8 item_get_vitality(u16 arg0);
|
||||
extern s8 item_get_intelligence(u16 arg0);
|
||||
extern s8 item_get_mentality(u16 arg0);
|
||||
extern s8 item_get_agility(u16 arg0);
|
||||
extern s8 item_get_dexterity(u16 arg0);
|
||||
extern s8 item_get_resistance_strike(u16 arg0);
|
||||
extern s8 item_get_resistance_wind(u16 arg0);
|
||||
extern s8 item_get_resistance_fire(u16 arg0);
|
||||
extern s8 item_get_resistance_earth(u16 arg0);
|
||||
extern s8 item_get_resistance_water(u16 arg0);
|
||||
extern s8 item_get_resistance_holy(u16 arg0);
|
||||
extern s8 item_get_resistance_dark(u16 arg0);
|
||||
|
||||
extern u32 item_get_field_0x14_b68(u16 arg0);
|
||||
extern u32 item_get_field_0x14_b46(u16 arg0);
|
||||
extern u32 item_get_field_0x14_b24(u16 arg0);
|
||||
extern u32 item_get_field_0x14_b12(u16 arg0);
|
||||
|
||||
#endif
|
||||
|
|
@ -395,6 +395,7 @@ segments:
|
|||
- [0x5CF00, rodata]
|
||||
- [0x5CF20, rodata]
|
||||
- [0x5CF30, rodata]
|
||||
- [0x613B0, rodata]
|
||||
- [0x647F0, rodata]
|
||||
- [0x650A0, rodata]
|
||||
- [0x650B0, rodata]
|
||||
|
|
|
|||
|
|
@ -135,87 +135,156 @@ INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F598);
|
|||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F5B0);
|
||||
|
||||
/* 454C8 8016F5C8 */
|
||||
u8 func_8016F5C8(u16 arg0) {
|
||||
return D_8018C410[arg0 * 32];
|
||||
u8 item_get_field_0x0(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0x0;
|
||||
}
|
||||
|
||||
/* 454E0 8016F5E0 */
|
||||
u8 func_8016F5E0(u16 arg0) {
|
||||
u8 var_a0;
|
||||
Element item_get_element(u16 arg0) {
|
||||
Element element;
|
||||
|
||||
var_a0 = D_8018C411[arg0 * 32];
|
||||
if (var_a0 == 0x10) {
|
||||
var_a0 = CHARACTER_SLOT_MAGNUS->field_0x1a;
|
||||
element = ITEM_DATA[arg0].element;
|
||||
if (element == ELEMENT_UNKNOWN_0x10) {
|
||||
element = CHARACTER_SLOT_MAGNUS->field_0x1a;
|
||||
}
|
||||
return var_a0;
|
||||
return element;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F614);
|
||||
/* 45514 8016F614 */
|
||||
u8 item_get_field_0x2(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0x2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F62C);
|
||||
/* 4552C 8016F62C */
|
||||
u16 item_get_field_0x4(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0x4;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F644);
|
||||
/* 45544 8016F644 */
|
||||
s8 item_get_field_0xc(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0xc;
|
||||
}
|
||||
|
||||
/* 4555C 8016F65C */
|
||||
s8 __magnus_get_strength(u16 arg0) {
|
||||
s8 item_get_strength(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].strength / 20;
|
||||
} else {
|
||||
ret = D_8018C416[arg0 * 32];
|
||||
ret = ITEM_DATA[arg0].strength;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 455AC 8016F6AC */
|
||||
s8 __magnus_get_vitality(u16 arg0) {
|
||||
s8 item_get_vitality(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].vitality / 20;
|
||||
} else {
|
||||
ret = D_8018C41A[arg0 * 32];
|
||||
ret = ITEM_DATA[arg0].vitality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 455FC 8016F6FC */
|
||||
s8 __magnus_get_intelligence(u16 arg0) {
|
||||
s8 item_get_intelligence(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].intelligence / 20;
|
||||
} else {
|
||||
ret = D_8018C417[arg0 * 32];
|
||||
ret = ITEM_DATA[arg0].intelligence;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", __magnus_get_mem);
|
||||
/* 4564C 8016F74C */
|
||||
s8 item_get_mentality(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].mentality / 20;
|
||||
} else {
|
||||
ret = ITEM_DATA[arg0].mentality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", __magnus_get_agility);
|
||||
/* 4569C 8016F79C */
|
||||
s8 item_get_agility(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].agility / 20;
|
||||
} else {
|
||||
ret = ITEM_DATA[arg0].agility;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", __magnus_get_dexterity);
|
||||
/* 456EC 8016F7EC */
|
||||
s8 item_get_dexterity(u16 arg0) {
|
||||
s8 ret;
|
||||
if (arg0 == 132) {
|
||||
ret = CHARACTER_SLOT_MAGNUS[0].dexterity / 20;
|
||||
} else {
|
||||
ret = ITEM_DATA[arg0].dexterity;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F83C);
|
||||
/* 4573C 8016F83C */
|
||||
s8 item_get_resistance_strike(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_strike;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F854);
|
||||
/* 45754 8016F854 */
|
||||
s8 item_get_resistance_wind(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_wind;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F86C);
|
||||
/* 4576C 8016F86C */
|
||||
s8 item_get_resistance_fire(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_fire;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F884);
|
||||
/* 45784 8016F884 */
|
||||
s8 item_get_resistance_earth(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_earth;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F89C);
|
||||
/* 4579C 8016F89C */
|
||||
s8 item_get_resistance_water(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_water;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F8B4);
|
||||
/* 457B4 8016F8B4 */
|
||||
s8 item_get_resistance_holy(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_holy;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F8CC);
|
||||
/* 457CC 8016F8CC */
|
||||
s8 item_get_resistance_dark(u16 arg0) {
|
||||
return ITEM_DATA[arg0].res_dark;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F8E4);
|
||||
/* 457E4 8016F8E4 */
|
||||
u32 item_get_field_0x14_b68(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0x14 >> 6;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F900);
|
||||
/* 45800 8016F900 */
|
||||
u32 item_get_field_0x14_b46(u16 arg0) {
|
||||
return (ITEM_DATA[arg0].field_0x14 >> 4) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F920);
|
||||
/* 45820 8016F920 */
|
||||
u32 item_get_field_0x14_b24(u16 arg0) {
|
||||
return (ITEM_DATA[arg0].field_0x14 >> 2) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F940);
|
||||
/* 45840 8016F940 */
|
||||
u32 item_get_field_0x14_b12(u16 arg0) {
|
||||
return ITEM_DATA[arg0].field_0x14 & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "overlays/overlay1/43100", func_8016F95C);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,29 @@
|
|||
__magnus_get_vitality = 0x8016F6AC;
|
||||
__magnus_get_strength = 0x8016F65C;
|
||||
__magnus_get_intelligence = 0x8016F6FC;
|
||||
__magnus_get_mem = 0x8016F74C;
|
||||
__magnus_get_agility = 0x8016F79C;
|
||||
__magnus_get_dexterity = 0x8016F7EC;
|
||||
|
||||
|
||||
ITEM_DATA = 0x8018C410; // size:0x20
|
||||
item_get_field_0x0 = 0x8016F5C8;
|
||||
item_get_element = 0x8016F5E0;
|
||||
item_get_field_0x2 = 0x8016F614;
|
||||
item_get_field_0x4 = 0x8016F62C;
|
||||
item_get_field_0xc = 0x8016F644;
|
||||
item_get_strength = 0x8016F65C;
|
||||
item_get_vitality = 0x8016F6AC;
|
||||
item_get_intelligence = 0x8016F6FC;
|
||||
item_get_mentality = 0x8016F74C;
|
||||
item_get_agility = 0x8016F79C;
|
||||
item_get_dexterity = 0x8016F7EC;
|
||||
item_get_resistance_strike = 0x8016F83C;
|
||||
item_get_resistance_wind = 0x8016F854;
|
||||
item_get_resistance_fire = 0x8016F86C;
|
||||
item_get_resistance_earth = 0x8016F884;
|
||||
item_get_resistance_water = 0x8016F89C;
|
||||
item_get_resistance_holy = 0x8016F8B4;
|
||||
item_get_resistance_dark = 0x8016F8CC;
|
||||
item_get_field_0x14_b68 = 0x8016F8E4;
|
||||
item_get_field_0x14_b46 = 0x8016F900;
|
||||
item_get_field_0x14_b24 = 0x8016F920;
|
||||
item_get_field_0x14_b12 = 0x8016F940;
|
||||
|
||||
__setup_overlay5 = 0x8017B5EC;
|
||||
__setup_overlay3 = 0x8017B774;
|
||||
__setup_overlay6 = 0x8017B6B0;
|
||||
|
|
@ -30,11 +48,14 @@ NAME_SHEEN = 0x8018E9FC; // type:asciz size:0x6
|
|||
|
||||
CLASS_NAME_DRAGON_MASTER = 0x80190230; // type:asciz
|
||||
|
||||
ITEM_NAME_SWORD = 0x80212E50; // type:asciz rom:0x163FC0
|
||||
ITEM_NAME_GREAT_SWORD = 0x80212E58; // type:asciz rom:0x163FC8
|
||||
ITEM_NAME_THRUSTING_SWORD = 0x80212E64; // type:asciz rom:0x163FC8
|
||||
ITEM_NAME_1HANDED = 0x80212E74; // type:asciz rom:0x163FE4
|
||||
ITEM_NAME_SHORT_SPEAR = 0x80212EA4; // type:asciz rom:0x164014
|
||||
ITEM_NAME_SWORD = 0x8018B4B0; // rom:0x613B0
|
||||
ITEM_NAME_LAEVATEINN = 0x8018B514; // rom:0x61414
|
||||
|
||||
ITEM_NAME_SWORD_2 = 0x80212E50; // type:asciz rom:0x163FC0
|
||||
ITEM_NAME_GREAT_SWORD_2 = 0x80212E58; // type:asciz rom:0x163FC8
|
||||
ITEM_NAME_THRUSTING_SWORD_2 = 0x80212E64; // type:asciz rom:0x163FC8
|
||||
ITEM_NAME_1HANDED_2 = 0x80212E74; // type:asciz rom:0x163FE4
|
||||
ITEM_NAME_SHORT_SPEAR_2 = 0x80212EA4; // type:asciz rom:0x164014
|
||||
|
||||
__PTR_BIG_STRUCT = 0x80196AF8; // type:u32
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
def read_rom(start, end):
|
||||
chunksize = end - start
|
||||
with open("baserom.z64", "rb") as f:
|
||||
f.seek(start)
|
||||
return f.read(chunksize)
|
||||
|
||||
|
||||
from struct import unpack_from
|
||||
|
||||
def read_item(index):
|
||||
ITEM_SIZE = 0x20
|
||||
ITEM_FORMAT = '>BBBBHbbbbbbbbbbbbbbbbbbbbbbBBBB'
|
||||
|
||||
item_start = 0x62310 + (index * ITEM_SIZE)
|
||||
item_end = item_start + ITEM_SIZE
|
||||
|
||||
return unpack_from(ITEM_FORMAT, read_rom(item_start, item_end))
|
||||
|
||||
ELEMENT_NAMES = {
|
||||
0: "Physical",
|
||||
1: "Wind",
|
||||
2: "Flame",
|
||||
3: "Earth",
|
||||
4: "Water",
|
||||
5: "Virtue",
|
||||
6: "Bane",
|
||||
|
||||
255: "Invalid"
|
||||
}
|
||||
|
||||
for i in range(0, 130):
|
||||
# print(f"Item {i}:")
|
||||
(field_0x0, element, field_0x2, field_0x3, field_0x4,
|
||||
strength, intelligence, agility, dexterity, vitality,
|
||||
mem, *rest) = read_item(i)
|
||||
|
||||
(field_0xc, res_strike, res_wind, res_fire, res_earth, res_water,
|
||||
res_holy, res_dark, *rest) = rest;
|
||||
|
||||
print(f"Element: {ELEMENT_NAMES[element]}")
|
||||
print(f"STR: \t{strength} \tMEN: \t{mem}")
|
||||
print(f"VIT: \t{vitality} \tAGI: \t{agility}")
|
||||
print(f"INT: \t{intelligence} \tDEX: \t{dexterity}")
|
||||
print()
|
||||
print(f"RES STRIKE: \t{res_strike}")
|
||||
print(f"RES WIND: \t{res_wind}")
|
||||
print(f"RES FIRE: \t{res_fire}")
|
||||
print(f"RES EARTH: \t{res_earth}")
|
||||
print(f"RES WATER: \t{res_water}")
|
||||
print(f"RES HOLY: \t{res_holy}")
|
||||
print(f"RES DARK: \t{res_dark}")
|
||||
|
||||
print(field_0xc, rest)
|
||||
|
||||
Loading…
Reference in New Issue