Add `Gender` enum

This commit is contained in:
gijs 2024-05-24 11:22:32 +02:00
parent d745065d67
commit 9088c3c2b6
4 changed files with 26 additions and 3 deletions

View File

@ -5,6 +5,7 @@
#include "assert.h"
#include "element.h"
#include "gender.h"
typedef struct {
// Possible data still undiscovered:
@ -16,7 +17,7 @@ typedef struct {
/* 0x11 */ u8 portrait;
/* 0x12 */ u8 class;
/* 0x13 */ u8 level;
/* 0x14 */ u8 gender;
/* 0x14 */ Gender gender;
/* 0x15 */ u8 field_0x15;
/* 0x16 */ u16 max_hp;
/* 0x18 */ u16 cur_hp;

View File

@ -5,11 +5,12 @@
#include "assert.h"
#include "equipment.h"
#include "gender.h"
typedef struct {
/* 0x00 */ char* name;
/* 0x04 */ u8 field_0x4;
/* 0x05 */ u8 gender;
/* 0x05 */ Gender gender;
/* 0x06 */ u8 leadership_rank;
/* 0x07 */ u8 field_0x7;

20
include/gender.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef __GENDER_H__
#define __GENDER_H__
#include <ultra64.h>
#include "assert.h"
typedef u8 Gender;
enum {
/* 00 */ GENDER_MALE,
/* 01 */ GENDER_FEMALE,
// The gender is based on the gender of the leader.
/* 02 */ GENDER_LEADER,
};
ASSERT_SIZE(Gender, 1);
#endif // __GENDER_H__

View File

@ -2,6 +2,7 @@
#include "class.h"
#include "ability.h"
#include "gender.h"
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016D200);
@ -132,7 +133,7 @@ u8 class_get_field_0x4(u8 portrait, u8 class) {
}
/* 43D70 8016DE70 */
u8 obClassGetGender(u8 portrait, u8 class) {
Gender obClassGetGender(u8 portrait, u8 class) {
if (obClassData[portrait].field_0x45 == class)
return obClassData[portrait].gender;