mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2025-02-22 06:02:34 +00:00
PSP ST0 title_card (#2036)
US and PSP are almost identical. d1db9d87b17a5f4a70d134c95b95dcc1235f793e contains all the changes required to match on pspeu.
This commit is contained in:
parent
51537a555e
commit
7f7bf8b67d
@ -369,7 +369,7 @@ set (SOURCE_FILES_STAGE_ST0
|
||||
src/st/st0/cutscene_data.c
|
||||
src/st/st0/2A218.c
|
||||
src/st/st0/2A8DC.c
|
||||
src/st/st0/2B0C8.c
|
||||
src/st/st0/title_card.c
|
||||
src/st/st0/2C564.c
|
||||
src/st/st0/2DAC8.c
|
||||
src/st/st0/30030.c
|
||||
|
@ -91,7 +91,7 @@ $(BUILD_DIR)/dra.elf: $(BUILD_DIR)/dra.ld $(addprefix $(BUILD_DIR)/src/dra/,$(ad
|
||||
$(BUILD_DIR)/tt_%.elf: $(BUILD_DIR)/tt_%.ld $$(call list_o_files_psp,servant/tt_$$*) $(BUILD_DIR)/assets/servant/tt_%/mwo_header.bin.o
|
||||
$(call link_with_deadstrip,tt_$*,$@)
|
||||
|
||||
ST_ST0_MERGE = popup e_room_fg st_common
|
||||
ST_ST0_MERGE = title_card popup e_room_fg st_common
|
||||
$(BUILD_DIR)/stst0.elf: $(BUILD_DIR)/stst0.ld $(addprefix $(BUILD_DIR)/src/st/st0/,$(addsuffix .c.o,$(ST_ST0_MERGE))) $$(call list_o_files_psp,st/st0_psp) $(BUILD_DIR)/assets/st/st0/mwo_header.bin.o
|
||||
$(call link_with_deadstrip,stst0,$@)
|
||||
ST_WRP_MERGE = st_update e_particles e_room_fg st_common st_debug e_breakable popup warp e_red_door
|
||||
|
@ -47,7 +47,7 @@ segments:
|
||||
- [0x1E8, c, st0_psp/30030]
|
||||
- [0x1578, c, st0_psp/cutscene]
|
||||
- [0x3F58, c, st0_psp/2A8DC]
|
||||
- [0x4A30, c, st0_psp/2B0C8]
|
||||
- [0x4A30, c, st0/title_card]
|
||||
- [0x58B8, c, st0_psp/2C564]
|
||||
- [0x8230, c, st0_psp/2DAC8]
|
||||
- [0xB3A0, c, st0_psp/3101C]
|
||||
@ -86,7 +86,7 @@ segments:
|
||||
- [0x423A8, data]
|
||||
- [0x42400, .rodata, st0_psp/30030]
|
||||
- [0x42450, .rodata, st0_psp/cutscene]
|
||||
- [0x424F8, .rodata, st0_psp/2B0C8]
|
||||
- [0x424F8, .rodata, st0/title_card]
|
||||
- [0x42530, .rodata, st0_psp/2C564]
|
||||
- [0x42580, .rodata, st0_psp/2DAC8]
|
||||
- [0x425D8, .rodata, st0_psp/3AB08]
|
||||
|
@ -45,7 +45,7 @@ segments:
|
||||
- [0x828, .data, cutscene] # "Richter, Dracula"
|
||||
- [0x830, .data, 2A218]
|
||||
- [0x89C, .data, 2A8DC]
|
||||
- [0x908, .data, 2B0C8]
|
||||
- [0x908, .data, title_card]
|
||||
- [0x90C, .data, 2C564]
|
||||
- [0xAA4, .data, 2DAC8]
|
||||
- [0x1568, .data, 30030]
|
||||
@ -116,8 +116,8 @@ segments:
|
||||
- [0x27A74, .rodata, 2A218] # EntityCutscene
|
||||
- [0x27AB4, .rodata, 2A8DC] # EntitySecretButton
|
||||
- [0x27ACC, .rodata, 2A8DC] # EntitySecretStairs
|
||||
- [0x27AE0, .rodata, 2B0C8] # EntityStageTitleFadeout
|
||||
- [0x27B00, .rodata, 2B0C8] # EntityStageTitleCard
|
||||
- [0x27AE0, .rodata, title_card] # EntityStageTitleFadeout
|
||||
- [0x27B00, .rodata, title_card] # EntityStageTitleCard
|
||||
- [0x27B18, .rodata, 2C564] # func_801ABBBC
|
||||
- [0x27B40, .rodata, 2C564] # EntityDracula
|
||||
- [0x27B7C, .rodata, 2DAC8] # "charal %x\n"
|
||||
@ -140,7 +140,7 @@ segments:
|
||||
- [0x28984, c, cutscene]
|
||||
- [0x2A218, c]
|
||||
- [0x2A8DC, c]
|
||||
- [0x2B0C8, c]
|
||||
- [0x2B0C8, c, title_card]
|
||||
- [0x2BBBC, c, 2C564] # EntityDracula
|
||||
- [0x2DAC8, c]
|
||||
- [0x30030, c]
|
||||
|
@ -1,3 +1,4 @@
|
||||
g_PauseAllowed = 0x091CE580;
|
||||
SetGameState = 0x09237868;
|
||||
func_801B0058 = 0x092378A0;
|
||||
func_801B0180 = 0x092379F8;
|
||||
@ -140,6 +141,7 @@ explode_startFrame = 0x09279608;
|
||||
explode_lifetime = 0x09279610;
|
||||
g_eDamageDisplayClut = 0x09279978;
|
||||
eRoomForegroundInit = 0x092799B0;
|
||||
D_80180908 = 0x09279DA0;
|
||||
D_80180660 = 0x0927BAD8;
|
||||
g_LayoutObjVertical = 0x0927BAF0;
|
||||
g_LayoutObjHorizontal = 0x0927BAF8;
|
||||
|
@ -1,386 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#include "st0.h"
|
||||
#include "sfx.h"
|
||||
|
||||
static s32 D_80180908 = 0;
|
||||
void EntityStageTitleFadeout(Entity* self) {
|
||||
s16 primIndex;
|
||||
Primitive* prim;
|
||||
s32 temp_a0;
|
||||
s32 temp_a1;
|
||||
s32 posX;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
if (D_80180908 != 0) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
|
||||
InitializeEntity(g_EInit3DObject);
|
||||
primIndex = g_api.AllocPrimitives(PRIM_G4, 5);
|
||||
if (primIndex != -1) {
|
||||
prim = &g_PrimBuf[primIndex];
|
||||
self->primIndex = primIndex;
|
||||
self->ext.stageTitleCard.prim = prim;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
while (prim != NULL) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->priority = 0x1FD;
|
||||
prim->y0 = prim->y1 = prim->x0 = prim->x2 = 0;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
self->ext.stageTitleCard.unk88 = 0x20;
|
||||
} else {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (D_80180908 != 0) {
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->r0 = prim->g0 = prim->b0 = 247;
|
||||
prim->drawMode = DRAW_UNK_40 | DRAW_TPAGE | DRAW_TRANSP;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
self->step++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim = prim->next;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
prim->priority = 0xC0;
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->y0 = prim->y1 = prim->x0 = prim->x2 = 0;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
PLAYER.zPriority = 0xD0;
|
||||
self->step++;
|
||||
|
||||
case 3:
|
||||
PLAYER.zPriority = 0xD0;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->r0 += 248;
|
||||
if (prim->r0 > 248) {
|
||||
prim->r0 = 0;
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
self->step = 5;
|
||||
break;
|
||||
}
|
||||
prim->g0 = prim->b0 = LOW(prim->r0);
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
PLAYER.zPriority = 0xD0;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim = prim->next;
|
||||
prim->r0 += 248;
|
||||
if (prim->r0 > 248) {
|
||||
prim->r0 = 0;
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
PLAYER.zPriority = g_unkGraphicsStruct.g_zEntityCenter;
|
||||
self->step = 1;
|
||||
}
|
||||
prim->g0 = prim->b0 = LOW(prim->r0);
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
while (prim != NULL) {
|
||||
prim->y0 = prim->y1 = 0;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->priority = 0xB0;
|
||||
prim->drawMode =
|
||||
DRAW_UNK_40 | DRAW_TPAGE | DRAW_COLORS | DRAW_TRANSP;
|
||||
prim->r0 = prim->g0 = prim->b0 = 255;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
prim = prim->next;
|
||||
}
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->x0 = prim->x2 = 0;
|
||||
|
||||
prim = prim->next;
|
||||
prim->r0 = prim->g0 = prim->b0 = 255;
|
||||
prim->r1 = prim->g1 = prim->b1 = 0;
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r1);
|
||||
|
||||
prim = prim->next;
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
|
||||
prim = prim->next;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
prim->r1 = prim->g1 = prim->b1 = 255;
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r1);
|
||||
|
||||
posX = PLAYER.posX.i.hi;
|
||||
self->ext.stageTitleCard.unk88 = 32;
|
||||
self->ext.stageTitleCard.unk84 = posX;
|
||||
self->ext.stageTitleCard.unk80 = posX;
|
||||
self->step++;
|
||||
|
||||
case 6:
|
||||
if (self->ext.stageTitleCard.unk88 != 0) {
|
||||
self->ext.stageTitleCard.unk88--;
|
||||
if (self->ext.stageTitleCard.unk88 == 0) {
|
||||
g_Entities[PLAYER_CHARACTER].zPriority =
|
||||
g_unkGraphicsStruct.g_zEntityCenter;
|
||||
}
|
||||
}
|
||||
temp_a0 = self->ext.stageTitleCard.unk80;
|
||||
temp_a1 = self->ext.stageTitleCard.unk84;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
temp_a0 -= 4;
|
||||
temp_a1 += 4;
|
||||
prim->x1 = prim->x3 = temp_a0;
|
||||
|
||||
prim = prim->next;
|
||||
prim->x0 = prim->x2 = temp_a0;
|
||||
prim->x1 = prim->x3 = temp_a0 + 0x40;
|
||||
|
||||
prim = prim->next;
|
||||
prim->x0 = prim->x2 = temp_a1;
|
||||
|
||||
prim = prim->next;
|
||||
prim->x1 = prim->x3 = temp_a1;
|
||||
prim->x0 = prim->x2 = temp_a1 - 0x40;
|
||||
|
||||
if ((temp_a0 < -0x40) && (temp_a1 > 0x140)) {
|
||||
|
||||
for (prim = self->ext.stageTitleCard.prim; prim != NULL;
|
||||
prim = prim->next) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
}
|
||||
PreventEntityFromRespawning(self);
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
self->ext.stageTitleCard.unk80 = temp_a0;
|
||||
self->ext.stageTitleCard.unk84 = temp_a1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityStageTitleCard(Entity* self) {
|
||||
Entity* fakeEntity; // !FAKE
|
||||
s16 primIndex;
|
||||
Primitive* prim;
|
||||
VertexFake* v;
|
||||
s16 temp_unk8E;
|
||||
s32 var_s7;
|
||||
s16 angle;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
if (D_80180908 == 0) {
|
||||
InitializeEntity(g_EInit3DObject);
|
||||
primIndex = g_api.AllocPrimitives(PRIM_GT4, 8);
|
||||
if (primIndex == -1) {
|
||||
D_80180908 = 1;
|
||||
label:
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
prim = &g_PrimBuf[primIndex];
|
||||
self->primIndex = primIndex;
|
||||
self->ext.stageTitleCard.prim = prim;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
prim->type = PRIM_GT3;
|
||||
prim->tpage = 0x1A;
|
||||
prim->clut = 0x15F;
|
||||
prim->v2 = prim->v3 = prim->u1 = prim->u3 = 0x18;
|
||||
prim->r0 = prim->g0 = 8;
|
||||
prim->b0 = 0x60;
|
||||
prim->priority = 0x1FE;
|
||||
prim->v0 = prim->v1 = prim->u0 = prim->u2 = 0x10;
|
||||
prim->drawMode = DRAW_COLORS;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
|
||||
prim = prim->next;
|
||||
prim->u1 = prim->u3 = 0x6F;
|
||||
prim->tpage = 0x11;
|
||||
prim->clut = 0x210;
|
||||
prim->v0 = prim->v1 = prim->u0 = prim->u2 = 0;
|
||||
prim->v2 = prim->v3 = 0xF;
|
||||
prim->x0 = prim->x2 = -0x6F;
|
||||
prim->y0 = prim->y1 = 0x70;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x1 = prim->x3 = 0;
|
||||
prim->y2 = prim->y3 = 0x7F;
|
||||
|
||||
prim = prim->next;
|
||||
prim->u1 = prim->u3 = 0x7F;
|
||||
prim->v2 = prim->v3 = 0x2A;
|
||||
prim->x0 = prim->x2 = 0x100;
|
||||
prim->x1 = prim->x3 = 0x17F;
|
||||
prim->y0 = prim->y1 = 0x80;
|
||||
prim->tpage = 0x11;
|
||||
prim->clut = 0x210;
|
||||
prim->u0 = prim->u2 = 0;
|
||||
prim->v0 = prim->v1 = 0x10;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->y2 = prim->y3 = 0x9A;
|
||||
|
||||
prim = prim->next;
|
||||
while (prim != NULL) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
g_PauseAllowed = false;
|
||||
self->ext.stageTitleCard.unk88 = 0x10;
|
||||
} else {
|
||||
goto label;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (--self->ext.stageTitleCard.unk88 == 0) {
|
||||
self->step++;
|
||||
}
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
self->ext.stageTitleCard.unk8E += 6;
|
||||
if (self->ext.stageTitleCard.unk8E > 0x20) {
|
||||
self->ext.stageTitleCard.unk8E = 0x20;
|
||||
var_s7 = 1;
|
||||
} else {
|
||||
var_s7 = 0;
|
||||
}
|
||||
|
||||
temp_unk8E = self->ext.stageTitleCard.unk8E;
|
||||
angle = self->ext.stageTitleCard.unk8C + 0x400;
|
||||
|
||||
v = (VertexFake*)&prim->x0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
v->x = (temp_unk8E * rcos(angle) >> 0xC) + 0x60;
|
||||
v->y = (temp_unk8E * rsin(angle) >> 0xC) + 0x80;
|
||||
angle += 0x555;
|
||||
v++;
|
||||
}
|
||||
|
||||
prim = prim->next;
|
||||
if (prim->x0 < 0x40) {
|
||||
prim->x0 = prim->x0 + 8;
|
||||
} else {
|
||||
prim->x0 = 0x40;
|
||||
var_s7++;
|
||||
}
|
||||
prim->x2 = prim->x0;
|
||||
prim->x1 = prim->x3 = prim->x0 + 0x6F;
|
||||
|
||||
prim = prim->next;
|
||||
if (prim->x0 > 0x40) {
|
||||
prim->x0 -= 6;
|
||||
} else {
|
||||
prim->x0 = 0x40;
|
||||
var_s7++;
|
||||
}
|
||||
prim->x2 = prim->x0;
|
||||
prim->x1 = prim->x3 = prim->x0 + 0x7F;
|
||||
|
||||
if (var_s7 == 3) {
|
||||
self->step++;
|
||||
}
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->drawMode |= DRAW_TPAGE2 | DRAW_TPAGE | DRAW_TRANSP;
|
||||
|
||||
prim = prim->next;
|
||||
prim->u1 = prim->u3 = 0x7F;
|
||||
prim->v2 = prim->v3 = 0x2A;
|
||||
prim->x0 = prim->x2 = 0x40;
|
||||
prim->x1 = prim->x3 = 0xBF;
|
||||
prim->y0 = prim->y1 = 0x70;
|
||||
prim->y2 = prim->y3 = 0x9A;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0x80;
|
||||
prim->v0 = prim->v1 = prim->u0 = prim->u2 = 0;
|
||||
prim->drawMode = DRAW_TPAGE2 | DRAW_TPAGE | DRAW_COLORS | DRAW_TRANSP;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
|
||||
for (prim = prim->next; prim != NULL; prim = prim->next) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
}
|
||||
self->ext.stageTitleCard.unk88 = 0x20;
|
||||
self->step++;
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (self->ext.stageTitleCard.unk88 == 0x10) {
|
||||
D_80180908 = 1;
|
||||
}
|
||||
if (--self->ext.stageTitleCard.unk88 == 0) {
|
||||
self->step++;
|
||||
}
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
return;
|
||||
|
||||
case 5:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
angle = self->ext.stageTitleCard.unk8C + 0x400;
|
||||
self->ext.stageTitleCard.unk8C -= 4;
|
||||
temp_unk8E = self->ext.stageTitleCard.unk8E;
|
||||
|
||||
fakeEntity = self; // !FAKE
|
||||
|
||||
v = (VertexFake*)&prim->x0;
|
||||
for (j = 0; j < 3; j++) {
|
||||
v->x = (temp_unk8E * rcos(angle) >> 0xC) + 0x60;
|
||||
v->y = (temp_unk8E * rsin(angle) >> 0xC) + 0x80;
|
||||
angle += 0x555;
|
||||
v++;
|
||||
}
|
||||
|
||||
PrimDecreaseBrightness(prim, 4);
|
||||
if (PrimDecreaseBrightness(prim->next, 3) == 0) {
|
||||
PreventEntityFromRespawning(fakeEntity);
|
||||
g_PauseAllowed = true;
|
||||
DestroyEntity(fakeEntity);
|
||||
}
|
||||
default:
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
break;
|
||||
}
|
||||
}
|
416
src/st/st0/title_card.c
Normal file
416
src/st/st0/title_card.c
Normal file
@ -0,0 +1,416 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#include "st0.h"
|
||||
#include "sfx.h"
|
||||
|
||||
#if defined(VERSION_PSP)
|
||||
extern s32 D_80180908;
|
||||
extern int D_pspeu_09253FB0;
|
||||
extern int D_pspeu_09253FF0;
|
||||
extern int D_pspeu_09254300;
|
||||
extern int D_pspeu_092545D8;
|
||||
extern int D_pspeu_092548E8;
|
||||
extern int D_pspeu_09254BD8;
|
||||
extern int D_pspeu_09254E98;
|
||||
extern int D_pspeu_09254EA4;
|
||||
#else
|
||||
static s32 D_80180908 = 0;
|
||||
#endif
|
||||
|
||||
void EntityStageTitleFadeout(Entity* self) {
|
||||
Primitive* prim;
|
||||
s32 var_s2;
|
||||
s32 var_s1;
|
||||
s32 primIndex;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
if (D_80180908) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(g_EInit3DObject);
|
||||
primIndex = g_api.AllocPrimitives(PRIM_G4, 5);
|
||||
if (primIndex == -1) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
self->primIndex = primIndex;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
prim = &g_PrimBuf[primIndex];
|
||||
self->ext.stageTitleCard.prim = prim;
|
||||
while (prim) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->x0 = prim->x2 = 0;
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
prim->y0 = prim->y1 = 0;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
prim->priority = 0x1FD;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
self->ext.stageTitleCard.unk88 = 0x20;
|
||||
case 1:
|
||||
if (D_80180908) {
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->drawMode = DRAW_UNK_40 | DRAW_TPAGE | DRAW_TRANSP;
|
||||
prim->r0 = prim->g0 = prim->b0 = 247;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
self->step++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim = prim->next;
|
||||
prim->priority = 0xC0;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x0 = prim->x2 = 0;
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
prim->y0 = prim->y1 = 0;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
PLAYER.zPriority = 0xD0;
|
||||
self->step++;
|
||||
case 3:
|
||||
PLAYER.zPriority = 0xD0;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->r0 -= 8;
|
||||
if (prim->r0 > 248) {
|
||||
prim->r0 = 0;
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
self->step = 5;
|
||||
break;
|
||||
}
|
||||
prim->g0 = prim->b0 = prim->r0;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
break;
|
||||
case 4:
|
||||
PLAYER.zPriority = 0xD0;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim = prim->next;
|
||||
prim->r0 -= 8;
|
||||
if (prim->r0 > 248) {
|
||||
prim->r0 = 0;
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
PLAYER.zPriority = g_unkGraphicsStruct.g_zEntityCenter;
|
||||
self->step = 1;
|
||||
}
|
||||
prim->g0 = prim->b0 = prim->r0;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
break;
|
||||
case 5:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
while (prim) {
|
||||
prim->y0 = prim->y1 = 0;
|
||||
prim->y2 = prim->y3 = 0xF0;
|
||||
prim->priority = 0xB0;
|
||||
prim->drawMode =
|
||||
DRAW_UNK_40 | DRAW_TPAGE | DRAW_COLORS | DRAW_TRANSP;
|
||||
prim->r0 = prim->g0 = prim->b0 = 255;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
prim = prim->next;
|
||||
}
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->x0 = prim->x2 = 0;
|
||||
prim = prim->next;
|
||||
|
||||
prim->r0 = prim->g0 = prim->b0 = 255;
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
prim->r1 = prim->g1 = prim->b1 = 0;
|
||||
LOW(prim->r3) = LOW(prim->r1);
|
||||
prim = prim->next;
|
||||
|
||||
prim->x1 = prim->x3 = 0x100;
|
||||
prim = prim->next;
|
||||
|
||||
prim->r0 = prim->g0 = prim->b0 = 0;
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
prim->r1 = prim->g1 = prim->b1 = 255;
|
||||
LOW(prim->r3) = LOW(prim->r1);
|
||||
prim = prim->next;
|
||||
|
||||
var_s1 = PLAYER.posX.i.hi;
|
||||
self->ext.stageTitleCard.unk80 = self->ext.stageTitleCard.unk84 =
|
||||
var_s1;
|
||||
self->ext.stageTitleCard.unk88 = 32;
|
||||
self->step++;
|
||||
case 6:
|
||||
if (self->ext.stageTitleCard.unk88) {
|
||||
if (!--self->ext.stageTitleCard.unk88) {
|
||||
g_Entities[PLAYER_CHARACTER].zPriority =
|
||||
g_unkGraphicsStruct.g_zEntityCenter;
|
||||
}
|
||||
}
|
||||
var_s1 = self->ext.stageTitleCard.unk80;
|
||||
var_s2 = self->ext.stageTitleCard.unk84;
|
||||
var_s1 -= 4;
|
||||
var_s2 += 4;
|
||||
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->x1 = prim->x3 = var_s1;
|
||||
prim = prim->next;
|
||||
|
||||
prim->x0 = prim->x2 = var_s1;
|
||||
prim->x1 = prim->x3 = var_s1 + 0x40;
|
||||
prim = prim->next;
|
||||
|
||||
prim->x0 = prim->x2 = var_s2;
|
||||
prim = prim->next;
|
||||
|
||||
prim->x1 = prim->x3 = var_s2;
|
||||
prim->x0 = prim->x2 = var_s2 - 0x40;
|
||||
prim = prim->next;
|
||||
|
||||
if ((var_s1 < -0x40) && (var_s2 > 0x140)) {
|
||||
|
||||
for (prim = self->ext.stageTitleCard.prim; prim != NULL;
|
||||
prim = prim->next) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
}
|
||||
PreventEntityFromRespawning(self);
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
self->ext.stageTitleCard.unk80 = var_s1;
|
||||
self->ext.stageTitleCard.unk84 = var_s2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityStageTitleCard(Entity* self) {
|
||||
#if defined(VERSION_PSP)
|
||||
// on PSP the title card is 8px taller
|
||||
const int TexHeightMod = 8;
|
||||
#else
|
||||
const int TexHeightMod = 0;
|
||||
#endif
|
||||
Primitive* prim; // s0
|
||||
VertexFake* v; // s1
|
||||
s16 angle; // s2
|
||||
s32 i; // s3
|
||||
s32 var_s4; // s4
|
||||
s32 var_s5; // s5
|
||||
s32 primIndex; // s6
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
if (D_80180908) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(g_EInit3DObject);
|
||||
#if defined(VERSION_PSP)
|
||||
D_pspeu_09254EA4 = func_pspeu_092377C8(
|
||||
&D_pspeu_09253FF0, &D_pspeu_09254BD8, &D_pspeu_092545D8,
|
||||
&D_pspeu_092548E8, &D_pspeu_09254300);
|
||||
func_91040A0(&D_pspeu_09254E98);
|
||||
func_892667C(0x8210, &D_pspeu_09253FB0);
|
||||
#endif
|
||||
primIndex = g_api.AllocPrimitives(PRIM_GT4, 8);
|
||||
if (primIndex == -1) {
|
||||
D_80180908 = 1;
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
self->primIndex = primIndex;
|
||||
prim = &g_PrimBuf[primIndex];
|
||||
self->ext.stageTitleCard.prim = prim;
|
||||
prim->type = PRIM_GT3;
|
||||
prim->tpage = 0x1A;
|
||||
prim->clut = 0x15F;
|
||||
prim->u0 = prim->u2 = 0x10;
|
||||
prim->u1 = prim->u3 = 0x18;
|
||||
prim->v0 = prim->v1 = 0x10;
|
||||
prim->v2 = prim->v3 = 0x18;
|
||||
prim->r0 = prim->g0 = 8;
|
||||
prim->b0 = 0x60;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
prim->priority = 0x1FE;
|
||||
prim->drawMode = DRAW_COLORS;
|
||||
prim = prim->next;
|
||||
|
||||
prim->tpage = 0x11;
|
||||
prim->clut = 0x210;
|
||||
prim->u0 = prim->u2 = 0;
|
||||
prim->u1 = prim->u3 = 0x6F;
|
||||
prim->v0 = prim->v1 = 0;
|
||||
prim->v2 = prim->v3 = 0xF + TexHeightMod;
|
||||
#if defined(VERSION_PSP)
|
||||
prim->y0 = prim->y1 = 0x70;
|
||||
prim->y2 = prim->y3 = 0x7F + TexHeightMod;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x0 = prim->x2 = -0x6F;
|
||||
prim->x1 = prim->x3 = 0;
|
||||
#else
|
||||
prim->x0 = prim->x2 = -0x6F;
|
||||
prim->y0 = prim->y1 = 0x70;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x1 = prim->x3 = 0;
|
||||
prim->y2 = prim->y3 = 0x7F + TexHeightMod;
|
||||
#endif
|
||||
prim = prim->next;
|
||||
|
||||
prim->tpage = 0x11;
|
||||
prim->clut = 0x210;
|
||||
prim->u0 = prim->u2 = 0;
|
||||
prim->u1 = prim->u3 = 0x7F;
|
||||
prim->v0 = prim->v1 = 0x10 + TexHeightMod;
|
||||
prim->v2 = prim->v3 = 0x2A;
|
||||
#if defined(VERSION_PSP)
|
||||
prim->y0 = prim->y1 = 0x80 + TexHeightMod;
|
||||
prim->y2 = prim->y3 = 0x9A;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x0 = prim->x2 = 0x100;
|
||||
prim->x1 = prim->x3 = 0x17F;
|
||||
#else
|
||||
prim->x0 = prim->x2 = 0x100;
|
||||
prim->priority = 0x1FF;
|
||||
prim->drawMode = DRAW_DEFAULT;
|
||||
prim->x1 = prim->x3 = 0x17F;
|
||||
prim->y0 = prim->y1 = 0x80 + TexHeightMod;
|
||||
prim->y2 = prim->y3 = 0x9A;
|
||||
#endif
|
||||
prim = prim->next;
|
||||
|
||||
while (prim) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
g_PauseAllowed = false;
|
||||
self->ext.stageTitleCard.unk88 = 0x10;
|
||||
case 1:
|
||||
if (!--self->ext.stageTitleCard.unk88) {
|
||||
self->step++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
var_s5 = 0;
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
self->ext.stageTitleCard.unk8E += 6;
|
||||
if (self->ext.stageTitleCard.unk8E > 0x20) {
|
||||
self->ext.stageTitleCard.unk8E = 0x20;
|
||||
var_s5 += 1;
|
||||
}
|
||||
var_s4 = self->ext.stageTitleCard.unk8E;
|
||||
v = (VertexFake*)&prim->x0;
|
||||
angle = self->ext.stageTitleCard.unk8C + 0x400;
|
||||
for (i = 0; i < 3; i++) {
|
||||
v->x = (var_s4 * rcos(angle) >> 0xC) + 0x60;
|
||||
v->y = (var_s4 * rsin(angle) >> 0xC) + 0x80;
|
||||
v++;
|
||||
angle += 0x555;
|
||||
}
|
||||
prim = prim->next;
|
||||
|
||||
if (prim->x0 < 0x40) {
|
||||
prim->x0 += 8;
|
||||
} else {
|
||||
prim->x0 = 0x40;
|
||||
var_s5++;
|
||||
}
|
||||
prim->x2 = prim->x0;
|
||||
prim->x1 = prim->x3 = prim->x0 + 0x6F;
|
||||
prim = prim->next;
|
||||
|
||||
if (prim->x0 > 0x40) {
|
||||
prim->x0 -= 6;
|
||||
} else {
|
||||
prim->x0 = 0x40;
|
||||
var_s5++;
|
||||
}
|
||||
prim->x2 = prim->x0;
|
||||
prim->x1 = prim->x3 = prim->x0 + 0x7F;
|
||||
prim = prim->next;
|
||||
|
||||
if (var_s5 == 3) {
|
||||
self->step++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
prim->drawMode |= DRAW_TPAGE2 | DRAW_TPAGE | DRAW_TRANSP;
|
||||
prim = prim->next;
|
||||
|
||||
prim->u0 = prim->u2 = 0;
|
||||
prim->u1 = prim->u3 = 0x7F;
|
||||
prim->v0 = prim->v1 = 0;
|
||||
prim->v2 = prim->v3 = 0x2A;
|
||||
prim->x0 = prim->x2 = 0x40;
|
||||
prim->x1 = prim->x3 = 0xBF;
|
||||
prim->y0 = prim->y1 = 0x70;
|
||||
prim->y2 = prim->y3 = 0x9A;
|
||||
prim->r0 = prim->g0 = prim->b0 = 0x80;
|
||||
LOW(prim->r1) = LOW(prim->r0);
|
||||
LOW(prim->r2) = LOW(prim->r0);
|
||||
LOW(prim->r3) = LOW(prim->r0);
|
||||
prim->drawMode = DRAW_TPAGE2 | DRAW_TPAGE | DRAW_COLORS | DRAW_TRANSP;
|
||||
prim = prim->next;
|
||||
|
||||
while (prim) {
|
||||
prim->drawMode = DRAW_HIDE;
|
||||
prim = prim->next;
|
||||
}
|
||||
#if defined(VERSION_PSP)
|
||||
D_80180908 = 1;
|
||||
self->ext.stageTitleCard.unk88 = 0x10;
|
||||
#else
|
||||
self->ext.stageTitleCard.unk88 = 0x20;
|
||||
#endif
|
||||
self->step++;
|
||||
break;
|
||||
case 4:
|
||||
#if defined(VERSION_US)
|
||||
if (self->ext.stageTitleCard.unk88 == 0x10) {
|
||||
D_80180908 = 1;
|
||||
}
|
||||
#endif
|
||||
if (!--self->ext.stageTitleCard.unk88) {
|
||||
self->step++;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
prim = self->ext.stageTitleCard.prim;
|
||||
angle = self->ext.stageTitleCard.unk8C + 0x400;
|
||||
self->ext.stageTitleCard.unk8C -= 4;
|
||||
var_s4 = self->ext.stageTitleCard.unk8E;
|
||||
v = (VertexFake*)&prim->x0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
v->x = (var_s4 * rcos(angle) >> 0xC) + 0x60;
|
||||
v->y = (var_s4 * rsin(angle) >> 0xC) + 0x80;
|
||||
v++;
|
||||
angle += 0x555;
|
||||
}
|
||||
PrimDecreaseBrightness(prim, 4);
|
||||
prim = prim->next;
|
||||
if (PrimDecreaseBrightness(prim, 3) == 0) {
|
||||
PreventEntityFromRespawning(self);
|
||||
g_PauseAllowed = true;
|
||||
DestroyEntity(self);
|
||||
}
|
||||
break;
|
||||
}
|
||||
g_Player.D_80072EFC = 4;
|
||||
g_Player.padSim = 0;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM("st/st0_psp/psp/st0_psp/2B0C8", EntityStageTitleFadeout);
|
||||
|
||||
INCLUDE_ASM("st/st0_psp/psp/st0_psp/2B0C8", EntityStageTitleCard);
|
Loading…
x
Reference in New Issue
Block a user