parent
5f32f2a1c5
commit
9de7f45844
|
|
@ -24,7 +24,8 @@ typedef struct {
|
|||
extern AbilityData ABILITY_DATA[];
|
||||
|
||||
extern char *ability_get_name(u8 index);
|
||||
extern Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4);
|
||||
|
||||
extern u8 ability_get_field_0x4(u8 index);
|
||||
extern Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3,
|
||||
u16 arg4);
|
||||
|
||||
#endif // __ABILITY_H__
|
||||
|
|
@ -35,9 +35,6 @@ typedef u8 bool;
|
|||
#define ARRAY_LENGTH(x) ((sizeof(x)) / (sizeof(x[0])))
|
||||
|
||||
#include "character.h"
|
||||
#include "equipment.h"
|
||||
#include "ability.h"
|
||||
#include "class.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 field_0x0;
|
||||
|
|
@ -475,7 +472,6 @@ extern void *__virtual_mem_alloc(u32);
|
|||
extern void *__MusIntMemMalloc(s32 size);
|
||||
extern ALHeap D_800B1A70;
|
||||
|
||||
|
||||
extern void __character_initialise(CharacterSlot *arg0, u8 level);
|
||||
extern u16 character_get_item(CharacterSlot* character, u8 slot);
|
||||
extern void __character_handle_levelup(CharacterSlot *slot);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,14 @@
|
|||
|
||||
#define INCLUDE_ASM(TYPE, FOLDER, NAME, ARGS...) INCLUDE_ASM_INTERNAL(TYPE, "nonmatchings", FOLDER, NAME, ARGS)
|
||||
#define INCLUDE_ASM_SHIFT(TYPE, FOLDER, NAME, ARGS...) INCLUDE_ASM_INTERNAL(TYPE, "shiftable", FOLDER, NAME, ARGS)
|
||||
|
||||
#define INCLUDE_RODATA(FOLDER, NAME) \
|
||||
__asm__( \
|
||||
".section .rodata\n" \
|
||||
"\t.include \""FOLDER"/"#NAME".s\"\n" \
|
||||
".section .text" \
|
||||
)
|
||||
|
||||
#endif
|
||||
__asm__(".include \"include/macro.inc\"\n");
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -440,6 +440,7 @@ segments:
|
|||
- [0x42C30, c]
|
||||
- [0x42C90, asm]
|
||||
- [0x43100, c, "class"]
|
||||
- [0x44340, c, "ability"]
|
||||
- [0x45480, c, "equipment"]
|
||||
- [0x45AE0, c]
|
||||
- [0x45CB0, asm]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
#include "ability.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "equipment.h"
|
||||
#include "class.h"
|
||||
|
||||
/* 44340 8016E440 */
|
||||
char* ability_get_name(u8 index) {
|
||||
return ABILITY_DATA[index].name;
|
||||
}
|
||||
|
||||
/* 44358 8016E458 */
|
||||
u8 ability_get_field_0x4(u8 index) {
|
||||
return ABILITY_DATA[index].field_0x4;
|
||||
}
|
||||
|
||||
/* 44370 8016E470 */
|
||||
Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) {
|
||||
u16 item_index;
|
||||
|
||||
if (ABILITY_DATA[index].element != ELEMENT_INVALID && ABILITY_DATA[index].element != 0xF)
|
||||
return ABILITY_DATA[index].element;
|
||||
|
||||
if (ABILITY_DATA[index].field_0x4 == 3) {
|
||||
item_index = equipment_get_first_spellbook(arg1, arg2, arg3, arg4);
|
||||
} else {
|
||||
item_index = equipment_get_first_weapon(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
if (item_index == 0)
|
||||
return ELEMENT_PHYSICAL;
|
||||
|
||||
return equipment_get_element(item_index);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016E50C);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016EA34);
|
||||
|
||||
/* 449EC 8016EAEC */
|
||||
u16 character_get_item(CharacterSlot* character, u8 slot) {
|
||||
u16 item_id;
|
||||
|
||||
item_id = 0;
|
||||
switch(slot) {
|
||||
case 0:
|
||||
item_id = character->item_upper_left;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
item_id = character->item_upper_right;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
item_id = character->item_lower_left;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
item_id = character->item_lower_right;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_id == 0) {
|
||||
item_id = FP_CLASS_GET_ITEM[slot](character->portrait, character->class);
|
||||
}
|
||||
return item_id;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", __character_handle_levelup);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", __character_initialise);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016F4E0);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016F500);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016F520);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016F540);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016F560);
|
||||
83
src/class.c
83
src/class.c
|
|
@ -1,6 +1,7 @@
|
|||
#include "class.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "element.h"
|
||||
#include "equipment.h"
|
||||
#include "ability.h"
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D200);
|
||||
|
||||
|
|
@ -262,81 +263,3 @@ u8 class_get_ability_hitcount(u8 portrait, u8 class, u8 row) {
|
|||
return CLASS_DATA[portrait].ability_back_hitcount != 0xFF ? CLASS_DATA[portrait].ability_back_hitcount : CLASS_DATA[class].ability_back_hitcount;
|
||||
}
|
||||
}
|
||||
|
||||
/* 44340 8016E440 */
|
||||
char* ability_get_name(u8 index) {
|
||||
return ABILITY_DATA[index].name;
|
||||
}
|
||||
|
||||
/* 44358 8016E458 */
|
||||
u8 ability_get_field_0x4(u8 index) {
|
||||
return ABILITY_DATA[index].field_0x4;
|
||||
}
|
||||
|
||||
/* 44370 8016E470 */
|
||||
Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) {
|
||||
u16 item_index;
|
||||
|
||||
if (ABILITY_DATA[index].element != ELEMENT_INVALID && ABILITY_DATA[index].element != 0xF)
|
||||
return ABILITY_DATA[index].element;
|
||||
|
||||
if (ABILITY_DATA[index].field_0x4 == 3) {
|
||||
item_index = equipment_get_first_spellbook(arg1, arg2, arg3, arg4);
|
||||
} else {
|
||||
item_index = equipment_get_first_weapon(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
if (item_index == 0)
|
||||
return ELEMENT_PHYSICAL;
|
||||
|
||||
return equipment_get_element(item_index);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016E50C);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016EA34);
|
||||
|
||||
/* 449EC 8016EAEC */
|
||||
u16 character_get_item(CharacterSlot* character, u8 slot) {
|
||||
u16 item_id;
|
||||
|
||||
item_id = 0;
|
||||
switch(slot) {
|
||||
case 0:
|
||||
item_id = character->item_upper_left;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
item_id = character->item_upper_right;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
item_id = character->item_lower_left;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
item_id = character->item_lower_right;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_id == 0) {
|
||||
item_id = FP_CLASS_GET_ITEM[slot](character->portrait, character->class);
|
||||
}
|
||||
return item_id;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "class", __character_handle_levelup);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", __character_initialise);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016F4E0);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016F500);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016F520);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016F540);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016F560);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "equipment.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "element.h"
|
||||
#include "equipment.h"
|
||||
|
||||
/* 45480 8016F580 */
|
||||
u8 equipment_get_field_0x1b(EquipmentId index) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue