mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-26 22:40:33 +00:00
Decompile DRA DrawRichterHudSubweapon (#1013)
This one was tricky and required some restructuring of an area of memory, but it matches now, so that's cool! No big comments from me but this one has a lot of random stuff so let me know if I missed some enum or something!
This commit is contained in:
parent
7ffc733cd8
commit
4c4c570ef0
@ -348,7 +348,7 @@ g_ServantPrevious = 0x80137530;
|
||||
D_80137960 = 0x80137534;
|
||||
D_80137964 = 0x80137538;
|
||||
D_80137968 = 0x8013753C;
|
||||
g_DisplayHP = 0x80137540;
|
||||
g_PlayerHud = 0x80137540;
|
||||
D_80137970 = 0x80137544;
|
||||
D_80137974 = 0x80137548;
|
||||
D_80137978 = 0x8013754C;
|
||||
|
@ -55,11 +55,9 @@ AddToInventory = 0x800FD874;
|
||||
GetStatusAilmentTimer = 0x800FDB18;
|
||||
CastSpell = 0x800FDC94;
|
||||
IsRelicActive = 0x800FE3A8;
|
||||
DrawRichterHudSubweapon = 0x80100B50;
|
||||
HandleSaveMenu = 0x80103238;
|
||||
DestroyEntity = 0x80106590;
|
||||
DestroyEntitiesFromIndex = 0x801065F4;
|
||||
SetPrimRect = 0x80107330;
|
||||
SetTexturedPrimRect = 0x80107360;
|
||||
EntityAlucard = 0x8010A5BC;
|
||||
SetPlayerStep = 0x8010D584;
|
||||
@ -129,7 +127,7 @@ g_NewAttackLeftHand = 0x80137930;
|
||||
g_NewDefenseEquip = 0x80137934;
|
||||
g_NewPlayerStatsTotal = 0x80137938;
|
||||
g_ServantPrevious = 0x8013795C;
|
||||
g_DisplayHP = 0x8013796C;
|
||||
g_PlayerHud = 0x8013796C;
|
||||
g_HealingMailTimer = 0x80137998;
|
||||
g_MemCardRetryCount = 0x80137E50;
|
||||
g_MemCardRStep = 0x80137E64;
|
||||
|
@ -28,10 +28,6 @@ typedef struct {
|
||||
/* 0x08 */ char pad8[0xC];
|
||||
} Unkstruct_80138094; // size = 0x14
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 unk0;
|
||||
} Unkstruct_80137990;
|
||||
|
||||
#define MAKE_PAL_OP(kind, freq) ((kind) | ((freq) << 0x10))
|
||||
#define GET_PAL_OP_KIND(x) (LOH(x))
|
||||
#define GET_PAL_OP_FREQ(x) (HIH(x))
|
||||
|
353
src/dra/5D5BC.c
353
src/dra/5D5BC.c
@ -1515,19 +1515,19 @@ void InitStatsAndGear(bool isDeathTakingItems) {
|
||||
void DrawRichterHud(void) {
|
||||
Primitive* prim;
|
||||
|
||||
D_80137978 = 400;
|
||||
D_8013797C = 400;
|
||||
g_PlayerHud.unk0C = 400;
|
||||
g_PlayerHud.unk10 = 400;
|
||||
D_801397FC = 0;
|
||||
D_80139008 = 0;
|
||||
D_80137994 = 0;
|
||||
g_PlayerHud.unk28 = 0;
|
||||
D_8003C744 = 0;
|
||||
D_80137980 = 48;
|
||||
D_80137984 = 0;
|
||||
D_80137990.unk0 = 0;
|
||||
D_8013798C = 40000 / D_80137978;
|
||||
D_80137988 = 40000 / D_8013797C;
|
||||
D_80137970 = func_800EDD9C(PRIM_GT4, 9);
|
||||
prim = &g_PrimBuf[D_80137970];
|
||||
g_PlayerHud.unk14 = 48;
|
||||
g_PlayerHud.unk18 = 0;
|
||||
g_PlayerHud.unk24 = 0;
|
||||
g_PlayerHud.unk20 = 40000 / (u32)g_PlayerHud.unk0C;
|
||||
g_PlayerHud.unk1C = 40000 / g_PlayerHud.unk10;
|
||||
g_PlayerHud.primIndex1 = func_800EDD9C(PRIM_GT4, 9);
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex1];
|
||||
|
||||
SetTexturedPrimRect(prim, 2, 22, 32, 96, 0, 0);
|
||||
prim->tpage = 0x1B;
|
||||
@ -1536,7 +1536,7 @@ void DrawRichterHud(void) {
|
||||
prim->drawMode = DRAW_ABSPOS;
|
||||
prim = prim->next;
|
||||
|
||||
SetTexturedPrimRect(prim, D_80137980 + 216, 22, 32, 96, 32, 0);
|
||||
SetTexturedPrimRect(prim, g_PlayerHud.unk14 + 216, 22, 32, 96, 32, 0);
|
||||
prim->tpage = 0x1B;
|
||||
prim->clut = 0x100;
|
||||
prim->priority = 0x1EF;
|
||||
@ -1550,7 +1550,7 @@ void DrawRichterHud(void) {
|
||||
prim->drawMode = DRAW_ABSPOS;
|
||||
prim = prim->next;
|
||||
|
||||
SetTexturedPrimRect(prim, D_80137980 + 228, 112, 9, 3, 64, 89);
|
||||
SetTexturedPrimRect(prim, g_PlayerHud.unk14 + 228, 112, 9, 3, 64, 89);
|
||||
prim->tpage = 0x1B;
|
||||
prim->clut = 0x103;
|
||||
prim->priority = 0x1F0;
|
||||
@ -1559,7 +1559,7 @@ void DrawRichterHud(void) {
|
||||
prim->p2 = 6;
|
||||
prim = prim->next;
|
||||
|
||||
SetTexturedPrimRect(prim, D_80137980 + 236, 112, 9, 3, 64, 89);
|
||||
SetTexturedPrimRect(prim, g_PlayerHud.unk14 + 236, 112, 9, 3, 64, 89);
|
||||
prim->tpage = 0x1B;
|
||||
prim->clut = 0x103;
|
||||
prim->priority = 0x1F0;
|
||||
@ -1593,8 +1593,8 @@ void DrawRichterHud(void) {
|
||||
prim->priority = 0x1EF;
|
||||
prim->drawMode = DRAW_ABSPOS;
|
||||
|
||||
D_80137974 = func_800EDD9C(4, 16);
|
||||
prim = &g_PrimBuf[D_80137974];
|
||||
g_PlayerHud.primIndex2 = func_800EDD9C(4, 16);
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex2];
|
||||
if (prim != 0) {
|
||||
s32 u = 32;
|
||||
s32 x = 216;
|
||||
@ -1614,30 +1614,287 @@ void DrawRichterHud(void) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 D_800A3014[] = {
|
||||
0x9, 0x00F, 0x018, 0x010, 0x0A8, 0x0C0, 0x01E, 0x17F, 0x009, 0x007, 0x018,
|
||||
0x018, 0x080, 0x0C0, 0x01E, 0x17F, 0x00C, 0x00D, 0x010, 0x010, 0x028, 0x070,
|
||||
0x01B, 0x102, 0x008, 0x00C, 0x018, 0x018, 0x038, 0x068, 0x01B, 0x102, 0x00C,
|
||||
0x007, 0x010, 0x018, 0x098, 0x0D8, 0x01E, 0x17F, 0x00C, 0x007, 0x010, 0x018,
|
||||
0x098, 0x0C0, 0x01E, 0x17F, 0x00F, 0x013, 0x008, 0x008, 0x0C0, 0x0D0, 0x01E,
|
||||
0x163, 0x008, 0x00D, 0x018, 0x010, 0x0A8, 0x0D0, 0x01E, 0x17F, 0x008, 0x006,
|
||||
0x018, 0x018, 0x080, 0x0D8, 0x01E, 0x17F,
|
||||
};
|
||||
RicSubwpnIconParams g_ricSubwpnIcons[] = {
|
||||
{0x9, 0x00F, 0x018, 0x010, 0x0A8, 0x0C0, 0x01E, 0x17F},
|
||||
{0x009, 0x007, 0x018, 0x018, 0x080, 0x0C0, 0x01E, 0x17F},
|
||||
{0x00C, 0x00D, 0x010, 0x010, 0x028, 0x070, 0x01B, 0x102},
|
||||
{0x008, 0x00C, 0x018, 0x018, 0x038, 0x068, 0x01B, 0x102},
|
||||
{0x00C, 0x007, 0x010, 0x018, 0x098, 0x0D8, 0x01E, 0x17F},
|
||||
{0x00C, 0x007, 0x010, 0x018, 0x098, 0x0C0, 0x01E, 0x17F},
|
||||
{0x00F, 0x013, 0x008, 0x008, 0x0C0, 0x0D0, 0x01E, 0x163},
|
||||
{0x008, 0x00D, 0x018, 0x010, 0x0A8, 0x0D0, 0x01E, 0x17F},
|
||||
{0x008, 0x006, 0x018, 0x018, 0x080, 0x0D8, 0x01E, 0x17F}};
|
||||
|
||||
INCLUDE_ASM("dra/nonmatchings/5D5BC", DrawRichterHudSubweapon);
|
||||
void DrawRichterHudSubweapon(void) {
|
||||
Primitive* prim;
|
||||
Primitive* altPrim;
|
||||
s32 temp_subweapon;
|
||||
s32 temp_a0;
|
||||
s32 temp_s2;
|
||||
u8 temp_r0;
|
||||
u8 temp_p2;
|
||||
RicSubwpnIconParams* temp_s0;
|
||||
|
||||
extern Unkstruct_80137990 D_80137990;
|
||||
if (D_8003C744 == 5) {
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex1];
|
||||
while (prim != NULL) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex2];
|
||||
while (prim != NULL) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((D_8003C744 == 1) && (g_PlayerHud.unk28 == 0)) {
|
||||
g_PlayerHud.unk20 = 100;
|
||||
g_PlayerHud.unk28 = D_8003C744;
|
||||
g_PlayerHud.unk10 = g_Entities[80].hitPoints;
|
||||
g_PlayerHud.unk0C = g_Entities[80].hitPoints;
|
||||
D_80139008 = g_Status.hearts;
|
||||
// Not really sure what the point of this is.
|
||||
g_PlayerHud.unk1C =
|
||||
(g_Entities[80].hitPoints * 100) / (u32)g_Entities[80].hitPoints;
|
||||
}
|
||||
if ((D_8003C744 == 2) && (g_PlayerHud.unk28 == 1)) {
|
||||
g_PlayerHud.unk28 = D_8003C744;
|
||||
g_PlayerHud.unk10 = g_Entities[85].hitPoints;
|
||||
g_PlayerHud.unk0C = g_Entities[85].hitPoints;
|
||||
}
|
||||
if (g_PlayerHud.unk28 != 100) {
|
||||
if (D_8003C744 == 1) {
|
||||
g_PlayerHud.unk0C = g_Entities[80].hitPoints;
|
||||
}
|
||||
if ((D_8003C744 - 2) < 2U) {
|
||||
g_PlayerHud.unk0C = g_Entities[85].hitPoints;
|
||||
}
|
||||
if (g_PlayerHud.unk0C < 0) {
|
||||
g_PlayerHud.unk0C = 0;
|
||||
}
|
||||
}
|
||||
if (g_PlayerHud.displayHP < g_Status.hp) {
|
||||
g_PlayerHud.displayHP++;
|
||||
D_801397FC = 1;
|
||||
}
|
||||
if (g_Status.hp < g_PlayerHud.displayHP) {
|
||||
g_PlayerHud.displayHP--;
|
||||
}
|
||||
if (D_8003C744 == 1) {
|
||||
if (g_PlayerHud.unk1C <
|
||||
((g_PlayerHud.unk0C * 100) / g_PlayerHud.unk10)) {
|
||||
g_PlayerHud.unk1C++;
|
||||
}
|
||||
if (((g_PlayerHud.unk0C * 100) / g_PlayerHud.unk10) <
|
||||
g_PlayerHud.unk1C) {
|
||||
g_PlayerHud.unk1C--;
|
||||
}
|
||||
}
|
||||
if ((D_8003C744 - 2) < 2U) {
|
||||
if (g_PlayerHud.unk1C != 0) {
|
||||
g_PlayerHud.unk1C -= 1;
|
||||
}
|
||||
if (g_PlayerHud.unk20 <
|
||||
((g_PlayerHud.unk0C * 100) / g_PlayerHud.unk10)) {
|
||||
g_PlayerHud.unk20++;
|
||||
}
|
||||
if (((g_PlayerHud.unk0C * 100) / g_PlayerHud.unk10) <
|
||||
g_PlayerHud.unk20) {
|
||||
g_PlayerHud.unk20--;
|
||||
}
|
||||
}
|
||||
if ((D_8003C744 != 0) && (g_PlayerHud.unk14 != 0)) {
|
||||
g_PlayerHud.unk14--;
|
||||
}
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex1];
|
||||
prim = prim->next;
|
||||
SetPrimRect(prim, g_PlayerHud.unk14 + 0xD8, 0x16, 0x20, 0x60);
|
||||
if ((D_8003C744 == 3) && (g_PlayerHud.unk20 == 0) &&
|
||||
((g_PlayerHud.unk24 == 0) || (g_PlayerHud.unk24 >= 0x33U))) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
|
||||
for (altPrim = &g_PrimBuf[g_PlayerHud.primIndex2]; altPrim != NULL;
|
||||
altPrim = altPrim->next) {
|
||||
if (altPrim->p2 != 0) {
|
||||
continue;
|
||||
}
|
||||
altPrim->drawMode = 0x2004;
|
||||
if (altPrim->p1 != 0) {
|
||||
altPrim->p1--;
|
||||
continue;
|
||||
}
|
||||
temp_a0 = rand() & 1;
|
||||
altPrim->y0 += temp_a0;
|
||||
altPrim->y1 += temp_a0;
|
||||
temp_a0 = (rand() & 3) + 1;
|
||||
altPrim->drawMode = 0x2004;
|
||||
altPrim->y2 += temp_a0;
|
||||
altPrim->y3 += temp_a0;
|
||||
if (altPrim->r2 >= 3) {
|
||||
temp_s2 = altPrim->r2 - 3;
|
||||
func_801071CC(altPrim, temp_s2, 2);
|
||||
func_801071CC(altPrim, temp_s2, 3);
|
||||
}
|
||||
if (altPrim->y2 >= 0x100) {
|
||||
altPrim->drawMode = 0x2015;
|
||||
if (altPrim->r0 != 0) {
|
||||
temp_r0 = altPrim->r0;
|
||||
temp_s2 = temp_r0 & 0xFF;
|
||||
altPrim->r0 = temp_r0 + 0xFF;
|
||||
func_801071CC(altPrim, temp_s2, 0);
|
||||
func_801071CC(altPrim, temp_s2, 1);
|
||||
}
|
||||
if (altPrim->y2 >= 0x180) {
|
||||
altPrim->drawMode = 0x2075;
|
||||
}
|
||||
}
|
||||
if (altPrim->y2 >= 0x200) {
|
||||
altPrim->drawMode = DRAW_HIDE;
|
||||
altPrim->p2 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prim = prim->next;
|
||||
temp_a0 = (g_PlayerHud.displayHP * 0x5B) / g_Status.hpMax;
|
||||
prim->y0 = prim->y1 = prim->y2 - temp_a0;
|
||||
prim = prim->next;
|
||||
SetPrimRect(prim, g_PlayerHud.unk14 + 0xE4, 0x70, 9, 3);
|
||||
temp_a0 = (g_PlayerHud.unk1C * 0x5B) / 100;
|
||||
if (temp_a0 < 0) {
|
||||
temp_a0 = 0;
|
||||
}
|
||||
temp_p2 = prim->p2;
|
||||
prim->y0 = prim->y1 = prim->y2 - temp_a0;
|
||||
prim->p2 = temp_p2 + 0xFF;
|
||||
if (temp_p2 == 0) {
|
||||
prim->p1++;
|
||||
if (prim->p1 == 9) {
|
||||
prim->p1 = 0;
|
||||
}
|
||||
if (D_8003C744 == 2) {
|
||||
prim->p2 = 1;
|
||||
} else {
|
||||
prim->p2 = 4;
|
||||
}
|
||||
prim->clut = prim->p1 + 0x103;
|
||||
}
|
||||
temp_s2 = prim->clut;
|
||||
prim = prim->next;
|
||||
SetPrimRect(prim, g_PlayerHud.unk14 + 0xEC, 0x70, 9, 3);
|
||||
temp_a0 = (g_PlayerHud.unk20 * 0x5B) / 100;
|
||||
if (temp_a0 >= 0x5C) {
|
||||
temp_a0 = 0x5B;
|
||||
}
|
||||
prim->clut = temp_s2;
|
||||
prim->y0 = prim->y1 = prim->y2 - temp_a0;
|
||||
prim = prim->next;
|
||||
|
||||
prim->u0 = (g_Status.hearts / 10) * 8;
|
||||
prim->v0 = 0x60;
|
||||
prim->u1 = ((g_Status.hearts / 10) * 8) + 8;
|
||||
prim->v1 = 0x60;
|
||||
prim->u2 = (g_Status.hearts / 10) * 8;
|
||||
prim->v2 = 0x68;
|
||||
prim->u3 = ((g_Status.hearts / 10) * 8) + 8;
|
||||
prim->v3 = 0x68;
|
||||
// Perhaps flashes the heart numbers when you have enough for a crash
|
||||
if ((g_Player.unk0C & 0x200000) && !(g_Timer & 2)) {
|
||||
prim->clut = 0x100;
|
||||
} else {
|
||||
prim->clut = 0x103;
|
||||
}
|
||||
altPrim = prim;
|
||||
prim = prim->next;
|
||||
prim->u0 = (g_Status.hearts % 10) * 8;
|
||||
prim->v0 = 0x60;
|
||||
prim->u1 = ((g_Status.hearts % 10) * 8) + 8;
|
||||
prim->v1 = 0x60;
|
||||
prim->u2 = (g_Status.hearts % 10) * 8;
|
||||
prim->v2 = 0x68;
|
||||
prim->u3 = ((g_Status.hearts % 10) * 8) + 8;
|
||||
prim->v3 = 0x68;
|
||||
|
||||
prim->clut = altPrim->clut;
|
||||
prim->drawMode = altPrim->drawMode;
|
||||
prim = prim->next;
|
||||
temp_subweapon = g_Status.subWeapon;
|
||||
if (temp_subweapon == 0) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
} else {
|
||||
// Convert from system where 0 is "no subweapon" to "first subweapon"
|
||||
temp_subweapon--;
|
||||
temp_s0 = &g_ricSubwpnIcons[temp_subweapon];
|
||||
SetTexturedPrimRect(prim, temp_s0->x + 2, temp_s0->y + 0x16, temp_s0->w,
|
||||
temp_s0->h, temp_s0->u, temp_s0->v);
|
||||
prim->tpage = temp_s0->tpage;
|
||||
prim->clut = temp_s0->clut;
|
||||
prim->drawMode = 0x2000;
|
||||
|
||||
if (prim->clut == 0x17F) {
|
||||
prim->drawMode = 0x2011;
|
||||
}
|
||||
}
|
||||
prim = prim->next;
|
||||
// This should be a switch, but that doesn't work.
|
||||
if (g_PlayerHud.unk24 == 0) {
|
||||
} else if (g_PlayerHud.unk24 < 9) {
|
||||
prim->clut = g_PlayerHud.unk24 + 0x102;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 9) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x18, 0x40, 0x10, 0x40, 0);
|
||||
prim->clut = 0x103;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 10) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x1C, 0x40, 8, 0x40, 0x10);
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 11) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x18, 0x40, 0x10, 0x40, 0x18);
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 12) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x14, 0x40, 0x18, 0x40, 0x40);
|
||||
prim->clut = 0x112;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (13 <= g_PlayerHud.unk24 && g_PlayerHud.unk24 <= 20) {
|
||||
prim->clut = 0x11F - g_PlayerHud.unk24;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 21) {
|
||||
} else if (51 <= g_PlayerHud.unk24 && g_PlayerHud.unk24 <= 58) {
|
||||
prim->clut = g_PlayerHud.unk24 + 0xD8;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 59) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x18, 0x40, 0x10, 0x40, 0x18);
|
||||
prim->clut = 0x103;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 60) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x1C, 0x40, 8, 0x40, 0x10);
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 61) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x18, 0x40, 0x10, 0x40, 0);
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 62) {
|
||||
SetTexturedPrimRect(prim, 0x21, 0x14, 0x40, 0x18, 0x40, 0x28);
|
||||
prim->clut = 0x10A;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (63 <= g_PlayerHud.unk24 && g_PlayerHud.unk24 <= 70) {
|
||||
prim->clut = 0x149 - g_PlayerHud.unk24;
|
||||
g_PlayerHud.unk24++;
|
||||
} else if (g_PlayerHud.unk24 == 71) {
|
||||
g_PlayerHud.unk24 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool func_8010183C(s32 arg0) {
|
||||
if (arg0 == 0) {
|
||||
if (D_80137990.unk0 == 0) {
|
||||
D_80137990.unk0 = 1;
|
||||
if (g_PlayerHud.unk24 == 0) {
|
||||
g_PlayerHud.unk24 = 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else if (arg0 == 1) {
|
||||
if (D_80137990.unk0 == 0x15) {
|
||||
D_80137990.unk0 = 0x33;
|
||||
if (g_PlayerHud.unk24 == 0x15) {
|
||||
g_PlayerHud.unk24 = 0x33;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -1651,15 +1908,15 @@ void DrawHud(void) {
|
||||
|
||||
D_8013B5E8 = 0;
|
||||
g_HealingMailTimer[0] = 0;
|
||||
g_DisplayHP[0] = g_Status.hp;
|
||||
g_PlayerHud.displayHP = g_Status.hp;
|
||||
|
||||
if ((g_StageId == STAGE_ST0) || (g_PlayableCharacter != PLAYER_ALUCARD)) {
|
||||
DrawRichterHud();
|
||||
return;
|
||||
}
|
||||
|
||||
D_80137970 = func_800EDD9C(PRIM_GT4, HUD_NUM_SPRITES);
|
||||
prim = &g_PrimBuf[D_80137970];
|
||||
g_PlayerHud.primIndex1 = func_800EDD9C(PRIM_GT4, HUD_NUM_SPRITES);
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex1];
|
||||
if (!prim) {
|
||||
return;
|
||||
}
|
||||
@ -1709,7 +1966,7 @@ void DrawHudSubweapon() {
|
||||
return;
|
||||
}
|
||||
func_800EB4F8(D_800C52F8[g_Status.subWeapon], 0, 0x3C0, 0x120);
|
||||
prim = &g_PrimBuf[D_80137970];
|
||||
prim = &g_PrimBuf[g_PlayerHud.primIndex1];
|
||||
if (g_Status.subWeapon != 0) {
|
||||
// This is 0x2031. Since drawMode is probably bits, write it this way.
|
||||
prim->drawMode = DRAW_ABSPOS | 0x0020 | DRAW_TPAGE | DRAW_TRANSP;
|
||||
@ -1799,44 +2056,44 @@ void DrawHudSubweapon() {
|
||||
prim->clut = mpFillSteps == 50 ? 0x162 : 0x174;
|
||||
|
||||
if (D_8013B5E8 == 0) {
|
||||
hpdiff = g_Status.hp - g_DisplayHP[0];
|
||||
hpdiff = g_Status.hp - g_PlayerHud.displayHP;
|
||||
if (hpdiff > 0) {
|
||||
if (hpdiff >= 11) {
|
||||
g_DisplayHP[0] += (hpdiff) / 10;
|
||||
g_PlayerHud.displayHP += (hpdiff) / 10;
|
||||
} else {
|
||||
g_DisplayHP[0]++;
|
||||
g_PlayerHud.displayHP++;
|
||||
}
|
||||
}
|
||||
if (hpdiff < 0) {
|
||||
if (hpdiff < -10) {
|
||||
g_DisplayHP[0] += (hpdiff) / 10;
|
||||
g_PlayerHud.displayHP += (hpdiff) / 10;
|
||||
} else {
|
||||
g_DisplayHP[0]--;
|
||||
g_PlayerHud.displayHP--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
D_8013B5E8--;
|
||||
}
|
||||
if (g_DisplayHP[0] == g_Status.hpMax) {
|
||||
if (g_PlayerHud.displayHP == g_Status.hpMax) {
|
||||
func_800EA5E4(2); // Likely related to HP showing bold when full
|
||||
} else if (g_DisplayHP[0] <= g_Status.hpMax >> 2) {
|
||||
} else if (g_PlayerHud.displayHP <= g_Status.hpMax >> 2) {
|
||||
func_800EA5E4(3); // Show yellow if under 1/4 health
|
||||
} else {
|
||||
func_800EA5E4(1); // Normal health display
|
||||
}
|
||||
|
||||
if (g_DisplayHP[0] >= 1000) {
|
||||
if (g_PlayerHud.displayHP >= 1000) {
|
||||
leading_zeros = 0;
|
||||
digitSpacing = 6;
|
||||
statXPos = 3;
|
||||
} else if (g_DisplayHP[0] >= 100) {
|
||||
} else if (g_PlayerHud.displayHP >= 100) {
|
||||
leading_zeros = 1;
|
||||
digitSpacing = 6;
|
||||
statXPos = 0;
|
||||
} else {
|
||||
digitSpacing = 7;
|
||||
statXPos = -6;
|
||||
if (g_DisplayHP[0] >= 10) {
|
||||
if (g_PlayerHud.displayHP >= 10) {
|
||||
leading_zeros = 2;
|
||||
} else {
|
||||
leading_zeros = 3;
|
||||
@ -1844,7 +2101,7 @@ void DrawHudSubweapon() {
|
||||
}
|
||||
// Thousands digit of HP
|
||||
prim = prim->next;
|
||||
prim->u2 = prim->u0 = ((g_DisplayHP[0] / 1000) * 8) + 0x20;
|
||||
prim->u2 = prim->u0 = ((g_PlayerHud.displayHP / 1000) * 8) + 0x20;
|
||||
prim->u3 = prim->u1 = prim->u0 + 8;
|
||||
prim->x0 = prim->x2 = statXPos;
|
||||
prim->x1 = prim->x3 = statXPos + 8;
|
||||
@ -1856,7 +2113,7 @@ void DrawHudSubweapon() {
|
||||
}
|
||||
// Hundreds digit of HP
|
||||
prim = prim->next;
|
||||
prim->u2 = prim->u0 = (((g_DisplayHP[0] / 100) % 10) * 8) + 0x20;
|
||||
prim->u2 = prim->u0 = (((g_PlayerHud.displayHP / 100) % 10) * 8) + 0x20;
|
||||
prim->u3 = prim->u1 = prim->u0 + 8;
|
||||
prim->x0 = prim->x2 = statXPos + digitSpacing;
|
||||
prim->x1 = prim->x3 = statXPos + digitSpacing + 8;
|
||||
@ -1867,7 +2124,7 @@ void DrawHudSubweapon() {
|
||||
}
|
||||
// Tens digit of HP
|
||||
prim = prim->next;
|
||||
prim->u2 = prim->u0 = (((g_DisplayHP[0] / 10) % 10) * 8) + 0x20;
|
||||
prim->u2 = prim->u0 = (((g_PlayerHud.displayHP / 10) % 10) * 8) + 0x20;
|
||||
prim->u3 = prim->u1 = prim->u0 + 8;
|
||||
prim->x0 = prim->x2 = statXPos + (digitSpacing * 2);
|
||||
prim->x1 = prim->x3 = statXPos + (digitSpacing * 2) + 8;
|
||||
@ -1878,7 +2135,7 @@ void DrawHudSubweapon() {
|
||||
}
|
||||
// Ones digit of HP
|
||||
prim = prim->next;
|
||||
prim->u2 = prim->u0 = ((g_DisplayHP[0] % 10) * 8) + 0x20;
|
||||
prim->u2 = prim->u0 = ((g_PlayerHud.displayHP % 10) * 8) + 0x20;
|
||||
prim->u3 = prim->u1 = prim->u0 + 8;
|
||||
prim->x0 = prim->x2 = statXPos + (digitSpacing * 3);
|
||||
prim->x1 = prim->x3 = statXPos + (digitSpacing * 3) + 8;
|
||||
|
@ -304,6 +304,31 @@ typedef struct {
|
||||
/* 8013761C */ MenuContext menus[NUM_MENU]; // 761C, 763A, 7658, 7676
|
||||
} MenuData;
|
||||
|
||||
typedef struct {
|
||||
s32 x;
|
||||
s32 y;
|
||||
s32 w;
|
||||
s32 h;
|
||||
s32 u;
|
||||
s32 v;
|
||||
s32 tpage;
|
||||
s32 clut;
|
||||
} RicSubwpnIconParams;
|
||||
|
||||
typedef struct {
|
||||
u32 displayHP;
|
||||
s32 primIndex1;
|
||||
s32 primIndex2;
|
||||
s32 unk0C;
|
||||
u32 unk10;
|
||||
s32 unk14;
|
||||
u32 unk18;
|
||||
u32 unk1C;
|
||||
u32 unk20;
|
||||
u32 unk24;
|
||||
s32 unk28;
|
||||
} PlayerHud;
|
||||
|
||||
// All the Joseph's Cloak color fields are in RGB555 format
|
||||
typedef struct {
|
||||
u16 liningDark;
|
||||
@ -598,18 +623,7 @@ extern s32 g_ServantPrevious;
|
||||
extern s32 D_80137960;
|
||||
extern s32 D_80137964;
|
||||
extern s32 D_80137968;
|
||||
// not actually an array, likely a struct member
|
||||
extern u32 g_DisplayHP[];
|
||||
extern s32 D_80137970;
|
||||
extern s32 D_80137974;
|
||||
extern u32 D_80137978;
|
||||
extern u32 D_8013797C;
|
||||
extern s32 D_80137980;
|
||||
extern s32 D_80137984;
|
||||
extern u32 D_80137988;
|
||||
extern u32 D_8013798C;
|
||||
extern Unkstruct_80137990 D_80137990;
|
||||
extern s32 D_80137994;
|
||||
extern PlayerHud g_PlayerHud;
|
||||
// not actually an array, likely a struct member
|
||||
extern s32 g_HealingMailTimer[];
|
||||
extern u32 D_8013799C;
|
||||
|
@ -387,19 +387,10 @@ u16 D_801374B8[0x20];
|
||||
u16 D_801374F8[0x20];
|
||||
u16 D_80137538[0x20];
|
||||
u32 g_DisplayHP[1];
|
||||
s32 D_80137970;
|
||||
s32 D_80137974;
|
||||
u32 D_80137978;
|
||||
u32 D_8013797C;
|
||||
s32 D_80137980;
|
||||
s32 D_80137984;
|
||||
u32 D_80137988;
|
||||
u32 D_8013798C;
|
||||
Unkstruct_80137990 D_80137990;
|
||||
PlayerHud g_PlayerHud;
|
||||
s32 D_8013B5E8;
|
||||
s32 g_HealingMailTimer[1] = {0};
|
||||
s32 D_8013B5E8;
|
||||
s32 D_80137994;
|
||||
s32 D_80139008;
|
||||
s32 D_801397FC;
|
||||
SimFile* g_SimFile;
|
||||
@ -635,8 +626,6 @@ int CdInit(void) {
|
||||
|
||||
void func_801083BC(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DrawRichterHudSubweapon(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800F24F4(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_8011A4D0(void) { NOT_IMPLEMENTED; }
|
||||
|
Loading…
Reference in New Issue
Block a user