Skip to content

Commit

Permalink
Rename lib symbols (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
gamezter authored Feb 22, 2025
1 parent 3e73b09 commit df8ff7c
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 299 deletions.
6 changes: 3 additions & 3 deletions config/splat.us.stlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ segments:
- [0x23C0, .data, e_collect]
- [0x26B0, .data, e_misc_2]
- [0x2714, .data, e_bloody_zombie]
- [0x280C, .data, unk_49870]
- [0x280C, .data, e_flying_zombie]
- [0x28D4, data, e_particles]
- [0x2954, .data, e_dhuron]
- [0x2AE0, data]
Expand Down Expand Up @@ -88,7 +88,7 @@ segments:
- [0x2D9DC, .rodata, e_collect]
- [0x2DA64, .rodata, e_misc_2]
- [0x2DAB0, .rodata, e_bloody_zombie]
- [0x2DAD8, .rodata, unk_49870]
- [0x2DAD8, .rodata, e_flying_zombie]
- [0x2DB54, .rodata, e_stage_name]
- [0x2DB88, .rodata, e_dhuron]
- [0x2DBC4, .rodata, unk_4C984]
Expand Down Expand Up @@ -127,7 +127,7 @@ segments:
- [0x473EC, c, blit_char]
- [0x4769C, c, e_misc_2]
- [0x487F0, c, e_bloody_zombie]
- [0x49870, c, unk_49870]
- [0x49870, c, e_flying_zombie]
- [0x4A68C, c, e_stage_name]
- [0x4B4E0, c, e_particles]
- [0x4BD24, c, popup]
Expand Down
2 changes: 1 addition & 1 deletion config/symbols.pspeu.stlib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ D_us_8018095C = 0x092761D8;
g_EInitSkeleton = 0x09276228;
g_EInitSkeletonPieces = 0x09276238;
g_EInitSkeletonBone = 0x09276248;
D_us_801809BC = 0x09276258;
g_EInitFleaArmor = 0x09276258;
D_us_801809C8 = 0x09276268;
g_EInitFleaMan = 0x09276278;
g_Rooms = 0x092762A8;
Expand Down
16 changes: 8 additions & 8 deletions include/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,7 @@ typedef struct {
/* 0x87 */ u8 unk87;
/* 0x88 */ struct Entity* unk88;
/* 0x8C */ u16 unk8C;
} ET_801BDAE4;
} ET_LesserDemon;

typedef struct {
/* 0x7C */ struct Entity* unk7C;
Expand Down Expand Up @@ -2761,7 +2761,7 @@ typedef struct {
/* 0x94 */ u32 : 32;
/* 0x98 */ u32 : 32;
/* 0x9C */ struct Entity* unk9C;
} ET_801D064C;
} ET_Mudman;

typedef struct {
/* 0x7C */ struct Primitive* unk7C;
Expand All @@ -2787,7 +2787,7 @@ typedef struct {
/* 0xA4 */ s16 unkA4;
/* 0xA6 */ s16 unkA6;
/* 0xA8 */ s16 unkA8;
} ET_801D2274;
} ET_SpellbookMagicTome;

typedef struct {
/* 0x7C */ Primitive* prim;
Expand Down Expand Up @@ -2818,7 +2818,7 @@ typedef struct {
/* 0x7E */ u16 unk7E;
/* 0x80 */ u8 unk80;
/* 0x81 */ u8 unk81;
} ET_801C9870;
} ET_FlyingZombie;

typedef struct {
/* 0x7C */ struct Primitive* unk7C;
Expand Down Expand Up @@ -3101,7 +3101,7 @@ typedef union { // offset=0x7C
ET_801BE2C8 et_801BE2C8;
ET_801B9BE4 et_801B9BE4;
ET_Chair chair;
ET_801BDAE4 et_801BDAE4;
ET_LesserDemon lesserDemon;
ET_801D4400 et_801D4400;
ET_801D4558 et_801D4558;
ET_801BE880 et_801BE880;
Expand All @@ -3112,12 +3112,12 @@ typedef union { // offset=0x7C
ET_Marionette marionette;
ET_801B6F30 et_801B6F30;
ET_801B15C0 et_801B15C0;
ET_801D064C et_801D064C;
ET_801D2274 et_801D2274;
ET_Mudman mudman;
ET_SpellbookMagicTome spellbookMagicTome;
ET_LibrarianChair libraryChair;
ET_LibraryShadow libraryShadow;
ET_Dhuron dhuron;
ET_801C9870 et_801C9870;
ET_FlyingZombie flyingZombie;
ET_801AE8E8 et_801AE8E8;
ET_FleaArmor fleaArmor;
ET_801B56E4 et_801B56E4;
Expand Down
5 changes: 2 additions & 3 deletions src/st/lib/e_dhuron.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ static u8 unused[] = {2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 4, 2, 3, 2, 2, 0, 0};
static u8 D_us_80182ACC[] = {
3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 2, 6, 3, 7, 3, 8, -1, 0};

// Dhuron
void func_us_801CC054(Entity* self) {
void EntityDhuron(Entity* self) {
Entity* tempEntity;
s32 tempVar;
s32 i;
Expand All @@ -54,7 +53,7 @@ void func_us_801CC054(Entity* self) {
}
switch (self->step) {
case 0:
InitializeEntity(D_us_8018089C);
InitializeEntity(g_EInitDhuron);
tempEntity = self + 1;
CreateEntityFromEntity(E_ID_34, self, tempEntity);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/st/lib/e_flea_armor.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void EntityFleaArmor(Entity* self) {

switch (self->step) {
case 0:
InitializeEntity(D_us_801809BC);
InitializeEntity(g_EInitFleaArmor);
CreateEntityFromEntity(E_ID_4B, self, self + 1);
self->drawMode |= DRAW_TPAGE2 | DRAW_TPAGE;
break;
Expand Down
80 changes: 40 additions & 40 deletions src/st/lib/unk_49870.c → src/st/lib/e_flying_zombie.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ static s16 D_us_801828A0[] = {4, 3, 2, 2, 2, 1, 0, 0, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2};
STATIC_PAD_DATA(4);

void func_us_801C9870(Entity* self) {
void EntityFlyingZombie2(Entity* self) {
Entity* tempEntity;
s32 i;

if (!self->ext.et_801C9870.unk81 && (self->hitFlags & 3) &&
if (!self->ext.flyingZombie.unk81 && (self->hitFlags & 3) &&
self->step != 3) {
self->hitboxState = 0;
self->hitPoints = g_api.enemyDefs[15].hitPoints;
SetStep(3);
PlaySfxPositional(0x714);
}
if (self->flags & FLAG_DEAD) {
if (!self->ext.et_801C9870.unk81) {
if (!self->ext.flyingZombie.unk81) {
self->hitboxState = 0;
self->flags &= ~FLAG_DEAD;
self->hitPoints = g_api.enemyDefs[15].hitPoints;
Expand All @@ -43,7 +43,7 @@ void func_us_801C9870(Entity* self) {
}
switch (self->step) {
case 0:
InitializeEntity(D_us_80180878);
InitializeEntity(g_EInitFlyingZombie2);
self->zPriority -= 2;
self->hitboxOffX = 1;
self->hitboxOffY = 10;
Expand Down Expand Up @@ -76,8 +76,8 @@ void func_us_801C9870(Entity* self) {
if (CheckColliderOffsets(D_us_8018282C, self->facingLeft)) {
self->velocityX = 0;
}
if (self->ext.et_801C9870.unk7C++ > 0x80) {
self->ext.et_801C9870.unk7C = 0;
if (self->ext.flyingZombie.unk7C++ > 0x80) {
self->ext.flyingZombie.unk7C = 0;
self->step_s--;
}
if (self->animCurFrame == 7) {
Expand All @@ -101,7 +101,7 @@ void func_us_801C9870(Entity* self) {
case 3:
if (!self->step_s) {
PlaySfxPositional(0x716);
self->ext.et_801C9870.unk81 = 1;
self->ext.flyingZombie.unk81 = 1;
for (i = 0; i < 2; i++) {
tempEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
if (tempEntity != NULL) {
Expand Down Expand Up @@ -141,32 +141,32 @@ void func_us_801C9870(Entity* self) {
(self + 1)->facingLeft = self->facingLeft;
(self + 1)->zPriority -= 8;
(self + 1)->posY.i.hi = self->posY.i.hi - 0xA;
self->ext.et_801C9870.unk81 = 1;
self->ext.flyingZombie.unk81 = 1;
self->animCurFrame = 0x12;
self->ext.et_801C9870.unk7C = 8;
self->ext.et_801C9870.unk7E = 0;
self->ext.flyingZombie.unk7C = 8;
self->ext.flyingZombie.unk7E = 0;
self->step_s++;
break;

case 1:
if (!--self->ext.et_801C9870.unk7C) {
self->ext.et_801C9870.unk7E = 0;
self->ext.et_801C9870.unk7C = 2;
if (!--self->ext.flyingZombie.unk7C) {
self->ext.flyingZombie.unk7E = 0;
self->ext.flyingZombie.unk7C = 2;
self->step_s++;
}
break;

case 2:
if (!--self->ext.et_801C9870.unk7C) {
if (!--self->ext.flyingZombie.unk7C) {
tempEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
if (tempEntity != NULL) {
CreateEntityFromEntity(E_EXPLOSION, self, tempEntity);
tempEntity->params = 1;
tempEntity->posY.i.hi -= self->ext.et_801C9870.unk7E * 8;
tempEntity->posY.i.hi -= self->ext.flyingZombie.unk7E * 8;
}
self->ext.et_801C9870.unk7C = 6;
self->ext.et_801C9870.unk7E++;
if (self->ext.et_801C9870.unk7E > 1) {
self->ext.flyingZombie.unk7C = 6;
self->ext.flyingZombie.unk7E++;
if (self->ext.flyingZombie.unk7E > 1) {
PlaySfxPositional(SFX_FM_STUTTER_EXPLODE);
DestroyEntity(self + 1);
SetStep(5);
Expand All @@ -187,7 +187,7 @@ void func_us_801C9870(Entity* self) {
case 6:
switch (self->step_s) {
case 0:
self->ext.et_801C9870.unk7C = D_us_80182898[Random() & 3];
self->ext.flyingZombie.unk7C = D_us_80182898[Random() & 3];
if (self->facingLeft) {
self->velocityX = FIX(1.0 / 16);
} else {
Expand Down Expand Up @@ -216,7 +216,7 @@ void func_us_801C9870(Entity* self) {
self->velocityX -= FIX(5.0 / 2048);
}
}
if (!--self->ext.et_801C9870.unk7C) {
if (!--self->ext.flyingZombie.unk7C) {
self->animFrameIdx = 0;
self->animFrameDuration = 0;
self->step_s++;
Expand Down Expand Up @@ -249,7 +249,7 @@ void func_us_801C9870(Entity* self) {
}
}

void func_us_801CA090(Entity* self) {
void EntityFlyingZombie1(Entity* self) {
Entity* tempEntity;
s16 angle;
s32 dx, dy;
Expand All @@ -258,17 +258,17 @@ void func_us_801CA090(Entity* self) {
self->step = 5;
self->step_s = 0;
self->hitboxState = 0;
self->ext.et_801C9870.unk7E = 0;
self->ext.et_801C9870.unk80 = 0;
self->ext.flyingZombie.unk7E = 0;
self->ext.flyingZombie.unk80 = 0;
PlaySfxPositional(0x715);
PlaySfxPositional(SFX_SMALL_FLAME_IGNITE);
}
switch (self->step) {
case 0:
InitializeEntity(D_us_80180884);
InitializeEntity(g_EInitFlyingZombie1);
self->hitboxOffX = -4;
self->hitboxOffY = -14;
self->ext.et_801C9870.unk80 = 0;
self->ext.flyingZombie.unk80 = 0;
break;

case 1:
Expand Down Expand Up @@ -309,7 +309,7 @@ void func_us_801CA090(Entity* self) {
self->rotZ = angle;
self->velocityX = rsin(angle) * 40;
self->velocityY = rcos(angle) * -40;
self->ext.et_801C9870.unk7C = 2;
self->ext.flyingZombie.unk7C = 2;
self->step_s++;
break;

Expand All @@ -322,7 +322,7 @@ void func_us_801CA090(Entity* self) {
}
DestroyEntity(self);
} else {
if (!--self->ext.et_801C9870.unk7C) {
if (!--self->ext.flyingZombie.unk7C) {
tempEntity =
AllocEntity(&g_Entities[160], &g_Entities[192]);
if (tempEntity != NULL) {
Expand All @@ -331,7 +331,7 @@ void func_us_801CA090(Entity* self) {
tempEntity->drawFlags = FLAG_DRAW_ROTZ;
tempEntity->rotZ = self->rotZ;
}
self->ext.et_801C9870.unk7C = 6;
self->ext.flyingZombie.unk7C = 6;
}
}
break;
Expand All @@ -349,7 +349,7 @@ void func_us_801CA090(Entity* self) {

case 7:
if ((Random() & 0x7F) == 0) {
self->ext.et_801C9870.unk80 = 1;
self->ext.flyingZombie.unk80 = 1;
}
if ((Random() & 0x1F) == 0) {
tempEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
Expand All @@ -367,12 +367,12 @@ void func_us_801CA090(Entity* self) {
} else {
self->velocityX = FIX(-0.5);
}
self->ext.et_801C9870.unk7C = 0x60;
self->ext.flyingZombie.unk7C = 0x60;
self->step_s++;
} else {
MoveEntity();
AnimateEntity(D_us_80182848, self);
if (!--self->ext.et_801C9870.unk7C) {
if (!--self->ext.flyingZombie.unk7C) {
self->animFrameIdx = 0;
self->animFrameDuration = 0;
self->step_s = 0;
Expand All @@ -384,13 +384,13 @@ void func_us_801CA090(Entity* self) {
case 8:
tempEntity = &PLAYER;
if (!self->step_s) {
self->ext.et_801C9870.unk7C = 0x40;
self->ext.flyingZombie.unk7C = 0x40;
angle = GetAngleBetweenEntitiesShifted(self, tempEntity);
SetEntityVelocityFromAngle(angle, 6);
self->step_s++;
} else {
if ((Random() & 0x7F) == 0) {
self->ext.et_801C9870.unk80 = 1;
self->ext.flyingZombie.unk80 = 1;
}
if ((Random() & 0x1F) == 0) {
tempEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
Expand All @@ -403,7 +403,7 @@ void func_us_801CA090(Entity* self) {
}
MoveEntity();
AnimateEntity(D_us_80182848, self);
if (!--self->ext.et_801C9870.unk7C) {
if (!--self->ext.flyingZombie.unk7C) {
self->velocityY = 0;
self->animFrameIdx = 0;
self->animFrameDuration = 0;
Expand All @@ -417,12 +417,12 @@ void func_us_801CA090(Entity* self) {
self->posX.i.hi = (self - 1)->posX.i.hi;
self->posY.i.hi = (self - 1)->posY.i.hi;
}
if (self->ext.et_801C9870.unk80 && g_Timer % 3 == 0) {
self->posY.i.hi += D_us_801828A0[self->ext.et_801C9870.unk7E];
self->ext.et_801C9870.unk7E++;
if (self->ext.et_801C9870.unk7E > LEN(D_us_801828A0) - 1) {
self->ext.et_801C9870.unk7E = 0;
self->ext.et_801C9870.unk80 = 0;
if (self->ext.flyingZombie.unk80 && g_Timer % 3 == 0) {
self->posY.i.hi += D_us_801828A0[self->ext.flyingZombie.unk7E];
self->ext.flyingZombie.unk7E++;
if (self->ext.flyingZombie.unk7E > LEN(D_us_801828A0) - 1) {
self->ext.flyingZombie.unk7E = 0;
self->ext.flyingZombie.unk80 = 0;
}
}
}
Loading

0 comments on commit df8ff7c

Please sign in to comment.