Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
roeming authored Sep 19, 2024
2 parents 01f65b1 + f2eb670 commit 6cee5a6
Show file tree
Hide file tree
Showing 30 changed files with 107 additions and 342 deletions.
4 changes: 2 additions & 2 deletions config/symbols.pspeu.stwrp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ g_StageOverlay = 0x0924B960;
D_801804E0 = 0x0924B9B8;
g_EntityUnkId12Hitbox = 0x0924B9E0;
g_EntityUnkId12TilemapProps = 0x0924B9E8;
D_80180608_wrp = 0x0924BA58;
g_HeartDropArray_wrp = 0x0924BA58;
WarpRoomCoords = 0x0924BA98;
D_80186E30 = 0x0924BAB0;
D_80186E3C = 0x0924BAC0;
Expand All @@ -127,7 +127,7 @@ g_LayoutObjPosHorizontal = 0x0924BC08;
g_LayoutObjVertical = 0x0924BC10;
g_LayoutObjHorizontal = 0x0924BC18;
g_eBreakableExplosionTypes = 0x0924BCC8;
D_80180608 = 0x0924CCD0;
g_HeartDropArray = 0x0924CCD0;
g_EntityUnkId12Data = 0x0924CCD8;
D_80180648 = 0x0924CCE0;
WarpBackgroundBrightness = 0x0924CCE8;
Expand Down
1 change: 1 addition & 0 deletions config/symbols.stmad.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ g_eBreakableHitboxes = 0x80180664;
g_eBreakableExplosionTypes = 0x8018066C;
g_eBreakableanimSets = 0x80180674;
g_eBreakableDrawModes = 0x80180684;
g_HeartDropArray = 0x80180F5C;
g_eUnk14SpawnRots = 0x80180FAC;
unk14_yVel = 0x80180FE4;
unk14_startFrame = 0x80180FFC;
Expand Down
2 changes: 1 addition & 1 deletion config/symbols.us.bomar.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
D_80180A60 = 0x801803B4;
D_80180608 = 0x80180744;
g_HeartDropArray = 0x80180744;
g_StoneDoorTiles = 0x801812DC;
CutsceneUnk1 = 0x8018AFC4;
CutsceneUnk2 = 0x8018B018;
Expand Down
1 change: 1 addition & 0 deletions config/symbols.us.stdre.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ g_eBreakableHitboxes = 0x80180630;
g_eBreakableExplosionTypes = 0x80180638;
g_eBreakableanimSets = 0x80180640;
g_eBreakableDrawModes = 0x80180650;
g_HeartDropArray = 0x80180660;
g_CloneShootOrder = 0x801807D4;
g_eUnk14SpawnRots = 0x801812D4;
unk15_rot = 0x801812E4;
Expand Down
1 change: 1 addition & 0 deletions config/symbols.us.stno3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ g_eBreakableExplosionTypes = 0x80180E78;
g_eBreakableanimSets = 0x80180E80;
g_eBreakableDrawModes = 0x80180E90;
g_TrapDoorFlag = 0x8018123C;
g_HeartDropArray = 0x80181C8C;
g_eUnk14SpawnRots = 0x80182618;
unk15_rot = 0x80182628;
unk15_yVel = 0x80182638;
Expand Down
1 change: 1 addition & 0 deletions config/symbols.us.stnp3.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
g_GfxBanks = 0x801806DC;
g_TrapDoorFlag = 0x80181104;
g_HeartDropArray = 0x80181618;
g_eUnk14SpawnRots = 0x80181FA4;
unk15_rot = 0x80181FB4;
unk15_yVel = 0x80181FC4;
Expand Down
1 change: 1 addition & 0 deletions config/symbols.us.stnz0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ g_CallElevator = 0x80180EEC;
g_BossFlag = 0x80181010;
g_ElevatorTarget = 0x801813A4;
g_ElevatorTargetPos = 0x801813A8;
g_HeartDropArray = 0x801813B0;
g_eUnk14SpawnRots = 0x80181ECC;
unk15_rot = 0x80181EDC;
unk15_yVel = 0x80181EEC;
Expand Down
5 changes: 1 addition & 4 deletions src/boss/mar/e_misc.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "mar.h"

#ifndef CASTLE_FLAG_BANK
#define CASTLE_FLAG_BANK -0x118
#endif

void EntityUnkId13(Entity* self);
void EntityUnkId14(Entity* self);
void EntityUnkId15(Entity* self);

#define HEART_DROP_CASTLE_FLAG 0
#include "../../st/e_misc.h"
39 changes: 2 additions & 37 deletions src/st/cen/entity_heart_drop.c
Original file line number Diff line number Diff line change
@@ -1,40 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "cen.h"
// Bizarre variable - u16 here, but u8 in EntityHolyGlassesCutscene
extern u16 D_801805D8[];

void EntityHeartDrop(Entity* self) {
u16 index;
u8 value;
PfnEntityUpdate update;

if (!self->step) {
index = self->ext.heartDrop.unkB4 = self->params + 0xC0;
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7);
if (value & 1) {
DestroyEntity(self);
return;
}

index -= 0xC0;
index = D_801805D8[index];
if (index < 128) {
self->ext.heartDrop.update = EntityPrizeDrop;
} else {
self->ext.heartDrop.update = EntityEquipItemDrop;
index -= 128;
}
self->params = index + 0x8000;
} else {
index = self->ext.heartDrop.unkB4;
if (self->step < 5) {
if (self->hitFlags) {
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |=
1 << (index & 7);
self->step = 5;
}
}
}
update = self->ext.heartDrop.update;
update(self);
}
#define HEART_DROP_CASTLE_FLAG 0xC0
#include "../entity_heart_drop.h"
6 changes: 4 additions & 2 deletions src/st/cen/holyglassescutscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ u32 g_CutsceneFlags;
u32 D_8019D428;

// Bizarre variable - u8 here, but u16 in EntityHeartDrop
u8 D_801805D8[] = {0, 64, 0, 0};
// Possible that since EntityHeartDrop is not used in CEN, that data
// is reused here for the holy glasses cutscene? Very unusual.
u8 g_HeartDropArray[] = {0, 64, 0, 0};
static u8 D_801805DC[] = {0, 0, 0, 0};

// clut
Expand Down Expand Up @@ -313,7 +315,7 @@ void EntityHolyGlassesCutscene(Entity* self) {
i = *g_Dialogue.nextCharDialogue++;
nextChar2 = *g_Dialogue.nextCharDialogue++;
prim = g_Dialogue.prim[5];
uCoord = D_801805D8[nextChar2 & 1];
uCoord = g_HeartDropArray[nextChar2 & 1];
vCoord = D_801805DC[nextChar2 & 1];
prim->clut = D_801805E0[i];
prim->tpage = 0x90;
Expand Down
8 changes: 4 additions & 4 deletions src/st/dre/13E18.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
#include "dre.h"
#include "sfx.h"

extern s32 D_80180660;
extern s32 g_HeartDropArray;

void EntityUnkId1C(Entity* self) {
Entity* newEntity;
s32 velX;
s8* hitbox;
s32 i;

if (D_80180660 == 0) {
if (g_HeartDropArray == 0) {
self->flags |= FLAG_DEAD;
}

if (self->flags & FLAG_DEAD) {
if (self->step != 5) {
if (D_80180660 != 0) {
D_80180660--;
if (g_HeartDropArray != 0) {
g_HeartDropArray--;
}
self->hitboxState = 0;
self->flags |= FLAG_DEAD;
Expand Down
38 changes: 2 additions & 36 deletions src/st/dre/entity_heart_drop.c
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "dre.h"

extern u16 D_80180660[];
void EntityHeartDrop(Entity* self) {
u16 index;
u8 value;
PfnEntityUpdate update;

if (!self->step) {
index = self->ext.heartDrop.unkB4 = self->params + 0x118;
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7);
if (value & 1) {
DestroyEntity(self);
return;
}

index -= 0x118;
index = D_80180660[index];
if (index < 128) {
self->ext.heartDrop.update = EntityPrizeDrop;
} else {
self->ext.heartDrop.update = EntityEquipItemDrop;
index -= 128;
}
self->params = index + 0x8000;
} else {
index = self->ext.heartDrop.unkB4;
if (self->step < 5) {
if (self->hitFlags) {
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |=
1 << (index & 7);
self->step = 5;
}
}
}
update = self->ext.heartDrop.update;
update(self);
}
#define HEART_DROP_CASTLE_FLAG 0x118
#include "../entity_heart_drop.h"
20 changes: 10 additions & 10 deletions src/st/dre/succubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ typedef enum {
} SuccubusDyingSubSteps;

// Original name: multiple_count
extern s32 D_80180660; // clones counter
extern s32 g_HeartDropArray; // clones counter

void EntitySuccubus(Entity* self) {
u8* clonesShootOrder;
Expand All @@ -91,7 +91,7 @@ void EntitySuccubus(Entity* self) {
s32 temp;
s32 i;

FntPrint("multiple_count %x\n", D_80180660);
FntPrint("multiple_count %x\n", g_HeartDropArray);

if ((self->hitFlags & 3) && (self->step & SUCCUBUS_CS_1)) {
SetStep(SUCCUBUS_GET_HIT);
Expand Down Expand Up @@ -253,7 +253,7 @@ void EntitySuccubus(Entity* self) {
CreateEntityFromCurrentEntity(
E_SUCCUBUS_CUTSCENE, &g_Entities[200]);
g_Entities[200].params = 1;
D_80180660 = 0;
g_HeartDropArray = 0;
D_80180664 |= 2;
g_api.TimeAttackController(
TIMEATTACK_EVENT_SUCCUBUS_DEFEAT, TIMEATTACK_SET_RECORD);
Expand Down Expand Up @@ -710,7 +710,7 @@ void EntitySuccubus(Entity* self) {
self->params = *clonesShootOrder;
self->ext.succubus.timer = 64;
self->hitboxState = 0;
D_80180660 = 6;
g_HeartDropArray = 6;
PlaySfxPositional(NA_VO_SU_GRUNT_1);
PlaySfxPositional(NA_SE_SU_CREATE_CLONES);
self->step_s++;
Expand Down Expand Up @@ -769,7 +769,7 @@ void EntitySuccubus(Entity* self) {
*/
SetSubStep(SUCCUBUS_CLONE_ATTACK_STOP_SHOOTING);
}
if (D_80180660 == 0) {
if (g_HeartDropArray == 0) {
SetStep(SUCCUBUS_IDLE);
}
break;
Expand Down Expand Up @@ -885,7 +885,7 @@ void EntitySuccubus(Entity* self) {
}

self->ext.succubus.timer = 32;
D_80180660 = 0;
g_HeartDropArray = 0;
if (GetSideToPlayer() & 1) {
self->velocityX = FIX(2);
} else {
Expand Down Expand Up @@ -1041,22 +1041,22 @@ void EntitySuccubusWingOverlay(Entity* entity) {
entity->zPriority = PLAYER.zPriority + 4;
}

extern s32 D_80180660; // clones counter
extern s32 g_HeartDropArray; // clones counter

void EntitySuccubusClone(Entity* self) {
Entity* newEntity;
s8* hitbox;
s32 velX;
s32 i;

if (D_80180660 == 0) {
if (g_HeartDropArray == 0) {
self->flags |= FLAG_DEAD;
}

if (self->flags & FLAG_DEAD) {
if (self->step != 5) {
if (D_80180660 != 0) {
D_80180660--;
if (g_HeartDropArray != 0) {
g_HeartDropArray--;
}
self->hitboxState = 0;
self->flags |= FLAG_DEAD;
Expand Down
43 changes: 1 addition & 42 deletions src/st/e_misc.h
Original file line number Diff line number Diff line change
@@ -1,50 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include <stage.h>

#ifndef CASTLE_FLAG_BANK
#define CASTLE_FLAG_BANK 0
#endif

extern u16 D_80180608[];

#include "entity_relic_orb.h"

void EntityHeartDrop(Entity* self) {
u16 index;
u8 value;
PfnEntityUpdate update;

if (!self->step) {
index = self->ext.heartDrop.unkB4 =
self->params + 0x118 + CASTLE_FLAG_BANK;
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7);
if (value & 1) {
DestroyEntity(self);
return;
}

index -= 0x118 + CASTLE_FLAG_BANK;
index = D_80180608[index];
if (index < 128) {
self->ext.heartDrop.update = EntityPrizeDrop;
} else {
self->ext.heartDrop.update = EntityEquipItemDrop;
index -= 128;
}
self->params = index + 0x8000;
} else {
index = self->ext.heartDrop.unkB4;
if (self->step < 5) {
if (self->hitFlags) {
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |=
1 << (index & 7);
self->step = 5;
}
}
}
update = self->ext.heartDrop.update;
update(self);
}
#include "entity_heart_drop.h"

#include "entity_message_box.h"

Expand Down
39 changes: 39 additions & 0 deletions src/st/entity_heart_drop.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
extern u16 g_HeartDropArray[];

void EntityHeartDrop(Entity* self) {
u16 index;
u8 value;
PfnEntityUpdate update;

if (!self->step) {
index = self->ext.heartDrop.unkB4 =
self->params + HEART_DROP_CASTLE_FLAG;
value = g_CastleFlags[(index >> 3) + HEART_FLAGS_START] >> (index & 7);
if (value & 1) {
DestroyEntity(self);
return;
}

index -= HEART_DROP_CASTLE_FLAG;
index = g_HeartDropArray[index];
if (index < 128) {
self->ext.heartDrop.update = EntityPrizeDrop;
} else {
self->ext.heartDrop.update = EntityEquipItemDrop;
index -= 128;
}
self->params = index + 0x8000;
} else {
index = self->ext.heartDrop.unkB4;
if (self->step < 5) {
if (self->hitFlags) {
g_CastleFlags[(index >> 3) + HEART_FLAGS_START] |=
1 << (index & 7);
self->step = 5;
}
}
}
update = self->ext.heartDrop.update;
update(self);
}
Loading

0 comments on commit 6cee5a6

Please sign in to comment.