Found `item` data

Edited Makefile to handle the new splits
Added `ctx_includes.h`
Build: OK
This commit is contained in:
Ogre 2023-09-15 02:16:33 +02:00
parent 9de7f45844
commit d3dd7a908e
7 changed files with 59 additions and 6 deletions

View File

@ -110,7 +110,7 @@ split:
@touch $(SPLAT_TIMESTAMP)
context:
$(V)$(PYTHON) tools/m2ctx.py include/common.h
$(V)$(PYTHON) tools/m2ctx.py ctx_includes.h
$(BUILD_DIR)/src/boot.c.o: OPTFLAGS = -O0

9
ctx_includes.h Normal file
View File

@ -0,0 +1,9 @@
#include <ultra64.h>
#include "common.h"
#include "ability.h"
#include "character.h"
#include "class.h"
#include "element.h"
#include "equipment.h"
#include "libmus.h"

View File

@ -476,5 +476,23 @@ extern void __character_initialise(CharacterSlot *arg0, u8 level);
extern u16 character_get_item(CharacterSlot* character, u8 slot);
extern void __character_handle_levelup(CharacterSlot *slot);
typedef struct {
/* 0x0 */ char *name;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u16 buy_price;
/* 0x8 */ u8 field_0x8;
/* 0x9 */ u8 field_0x9;
/* 0xa */ u8 field_0xa;
/* 0xb */ u8 field_0xb;
} ItemData; // size:0xc
extern ItemData ITEM_DATA[45];
extern char *item_get_name(u16 arg0);
extern u8 item_get_field_0x4(u16 arg0);
extern u8 item_get_field_0x5(u16 arg0);
extern u8 item_get_field_0x8(u16 arg0);
extern u8 item_get_field_0x9(u16 arg0);
#endif

View File

@ -2135,6 +2135,9 @@ segments:
# Found in DMA log (N64 startup)
- [0x238f7ba, bin]
# Calculated from `__calls_romCopy_8009DAF4` call in `func_8016FBE0`
- [0x238F96A, bin]
- [0x26FF9F0, bin, "viewdata"]
- [0x26FFC28, bin, "viewdata1"]
- [0x26FFD48, bin, "viewdata2"]

View File

@ -72,12 +72,28 @@ INCLUDE_ASM(const s32, "ability", __character_handle_levelup);
INCLUDE_ASM(const s32, "ability", __character_initialise);
INCLUDE_ASM(const s32, "ability", func_8016F4E0);
/* 453E0 8016F4E0 */
char *item_get_name(u16 arg0) {
return ITEM_DATA[arg0].name;
}
INCLUDE_ASM(const s32, "ability", func_8016F500);
/* 45400 8016F500 */
u8 item_get_field_0x4(u16 arg0) {
return ITEM_DATA[arg0].field_0x4;
}
INCLUDE_ASM(const s32, "ability", func_8016F520);
/* 45420 8016F520 */
u8 item_get_field_0x5(u16 arg0) {
return ITEM_DATA[arg0].field_0x5;
}
INCLUDE_ASM(const s32, "ability", func_8016F540);
/* 45440 8016F540 */
u8 item_get_field_0x8(u16 arg0) {
return ITEM_DATA[arg0].field_0x8;
}
/* 45460 8016F560 */
u8 item_get_field_0x9(u16 arg0) {
return ITEM_DATA[arg0].field_0x9;
}
INCLUDE_ASM(const s32, "ability", func_8016F560);

View File

@ -134,6 +134,13 @@ equipment_is_weapon = 0x8016F9F0; // rom:0x458F0
equipment_get_first_weapon = 0x8016FA34; // rom:0x45934
equipment_get_first_spellbook = 0x8016FB50; // rom:0x45A50
ITEM_DATA = 0x8018E6CC; // rom:0x645CC size:0x21C
item_get_name = 0x8016F4E0; // rom:0x453E0
item_get_field_0x4 = 0x8016F500; // rom:0x45400
item_get_field_0x5 = 0x8016F520; // rom:0x45420
item_get_field_0x8 = 0x8016F540; // rom:0x45440
item_get_field_0x9 = 0x8016F560; // rom:0x45460
CHARACTER_NAME_ARRAY_00 = 0x8018EB48;
__setup_overlay_79730 = 0x8017B5EC;

0
tools/item_data.py Normal file
View File