-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decompiled and merged func_us_801BB200/func_psp_0926D5E0
Decompiled func_us_801BB53C/func_psp_09254288 and pseudo merged it
- Loading branch information
ProjectOblivion
authored and
ProjectOblivion
committed
Feb 20, 2025
1 parent
ffce97b
commit 62945c1
Showing
13 changed files
with
300 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
#include "lib.h" | ||
|
||
#ifdef VERSION_PSP | ||
extern s32 D_psp_092A5578; | ||
#endif | ||
extern u16 D_us_8018095C; | ||
extern u16 D_us_80181AA8[][2]; | ||
extern s32 D_us_80181AC8; | ||
|
||
// This seems to be related to the Lesser Demon boss fight somehow, but not the | ||
// Lesser Demon itself. | ||
void func_us_801BB200(Entity* self) { | ||
s32 i; | ||
s32 params; | ||
s32 adjustedY; | ||
s32 upperParams; | ||
s32 tilePos; | ||
Entity* newEntity; | ||
|
||
switch (self->step) { | ||
case 0: | ||
InitializeEntity(&D_us_8018095C); | ||
params = self->params & 0xFF; | ||
self->animCurFrame = params + 0xF; | ||
self->zPriority = 0x69; | ||
if (self->params & 0x100) { | ||
self->facingLeft = 1; | ||
} | ||
self->ext.et_801BB200.unk84 = 0; | ||
if (!self->params) { | ||
newEntity = self + 1; | ||
for (i = 1; i < 4; i++, newEntity++) { | ||
#ifdef VERSION_PSP | ||
CreateEntityFromCurrentEntity(D_psp_092A5578, newEntity); | ||
#else | ||
CreateEntityFromCurrentEntity(E_ID_40, newEntity); | ||
#endif | ||
newEntity->params = i; | ||
} | ||
for (i = 0; i < 4; i++, newEntity++) { | ||
#ifdef VERSION_PSP | ||
CreateEntityFromCurrentEntity(D_psp_092A5578, newEntity); | ||
#else | ||
CreateEntityFromCurrentEntity(E_ID_40, newEntity); | ||
#endif | ||
newEntity->params = i + 0x100; | ||
} | ||
} | ||
self->posY.i.hi = 0x258 - g_Tilemap.scrollY.i.hi; | ||
if (self->params & 0x100) { | ||
self->posX.i.hi = 0x2E0 - g_Tilemap.scrollX.i.hi; | ||
} else { | ||
self->posX.i.hi = 0x120 - g_Tilemap.scrollX.i.hi; | ||
} | ||
break; | ||
case 1: | ||
if ((D_us_80181AC8) && (!(self->params & 0xFF))) { | ||
self->step = 2; | ||
} | ||
if (self->ext.et_801BB200.unk84) { | ||
self->step = 2; | ||
} | ||
break; | ||
case 2: | ||
self->velocityY = FIX(4.0); | ||
self->step++; | ||
/* fallthrough */ | ||
case 3: | ||
MoveEntity(); | ||
self->velocityY += FIX(0.125); | ||
params = self->params & 0xFF; | ||
upperParams = self->params >> 8; | ||
adjustedY = ((3 - params) * 16) + 0x268 - (g_Tilemap.scrollY.i.hi); | ||
if (adjustedY < self->posY.i.hi) { | ||
if (params != 4) { | ||
newEntity = self + 1; | ||
newEntity->ext.et_801BB200.unk84 = 1; | ||
} | ||
self->posY.i.hi = adjustedY; | ||
tilePos = 0xBF2; | ||
if (self->params & 0x100) { | ||
g_api.PlaySfx(SFX_DOOR_CLOSE_B); | ||
tilePos = 0xC0D; | ||
} | ||
tilePos += ((3 - params) * 0x50); | ||
g_Tilemap.fg[tilePos] = D_us_80181AA8[7 - params][upperParams]; | ||
self->velocityY = 0; | ||
self->step++; | ||
} | ||
break; | ||
case 4: | ||
if (!D_us_80181AC8) { | ||
self->step++; | ||
} | ||
break; | ||
case 5: | ||
tilePos = 0xBF2; | ||
params = self->params & 0xFF; | ||
upperParams = self->params >> 8; | ||
if (self->params & 0x100) { | ||
tilePos = 0xC0D; | ||
} | ||
tilePos += ((3 - params) * 0x50); | ||
g_Tilemap.fg[tilePos] = D_us_80181AA8[3 - params][upperParams]; | ||
newEntity = AllocEntity(&g_Entities[224], &g_Entities[256]); | ||
if (newEntity != NULL) { | ||
CreateEntityFromEntity(2, self, newEntity); | ||
newEntity->params = 3; | ||
} | ||
self->animCurFrame = 0; | ||
self->step++; | ||
case 6: | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
#include "lib.h" | ||
|
||
// Using an include to consolidate the code because it doesn't seem that PSP can | ||
// be split in a way to allow merging at this time. | ||
#include "unk_3B53C.h" |
Oops, something went wrong.