Skip to content

Commit 9968457

Browse files
authored
Rework create_entity.h; more PSP NO3 codeshare (Xeeynamo#2611)
I'm into a small stretch of PSP NO3 functions that are already decompiled in very high quality, so very little changes to the C are necessary. Big change: I noticed that create_entity.h was almost entirely just a big sequence of `#include` statements, which were including .h files that were not included anywhere else. I don't see any purpose to pulling code into a .h file, if it's only included in a single location. I believe this is a holdover from when we were originally doing deduping on a function-by-function basis, and not treating full files as shared units. Therefore, I have extracted all the contents of these various .h files, and placed them into the top-level create_entity.h file sequentially. Overall, this means the code is easier to follow since we don't have so many nested levels of .h files.
1 parent bf058f9 commit 9968457

21 files changed

+513
-566
lines changed

config/splat.pspeu.stno3.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ segments:
6565
- [0xB3B0, c, no3/e_background_block]
6666
- [0xB4A8, c, no3/e_unkId16]
6767
- [0xB580, c, no3_psp/cutscene]
68-
- [0xE178, c, no3_psp/working_on]
68+
- [0xE178, c, no3/e_lock_camera]
69+
- [0xE3D8, c, no3/create_entity]
70+
- [0xF380, c, no3_psp/working_on]
6971
- [0x1AA80, c, no3_psp/e_particles]
7072
- [0x1F830, c, no3_psp/e_misc]
7173
- [0x21CC8, c, no3_psp/collision]
@@ -92,7 +94,8 @@ segments:
9294
- [0x5F070, .data, no3/e_breakable]
9395
- [0x5F0C0, .data, no3/e_background_block]
9496
- [0x5F2F0, .data, no3_psp/cutscene]
95-
- [0x5F6B8, data]
97+
- [0x5F6B8, .data, no3/e_lock_camera]
98+
- [0x5F730, data]
9699
- [0x61600, .rodata, no3/e_castle_door]
97100
- [0x61618, .rodata, no3/e_outdoor_ents] # EntityPushAlucard
98101
- [0x61630, .rodata, no3/e_death]
@@ -107,5 +110,7 @@ segments:
107110
- [0x61BC8, .bss, no3/e_shutting_window]
108111
- [0x61BD8, .bss, no3/e_breakable]
109112
- [0x61BE0, .bss, no3_psp/cutscene]
110-
- [0x621F0, bss, 621F0]
113+
- [0x621F0, .bss, no3/e_lock_camera]
114+
- [0x621F8, .bss, no3/create_entity]
115+
- [0x62218, bss, 62218]
111116
- [0x62280]

config/symbols.pspeu.stno3.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ EntityWaterDrop = 0x0925EE68;
106106
EntityRoomForeground = 0x0925F7C0;
107107
DestroyEntity = 0x0925F8D8;
108108
AnimateEntity = 0x0925F9F8;
109+
GetSideToPlayer = 0x0925FC30;
109110
MoveEntity = 0x0925FCB8;
110111
AllocEntity = 0x092602D8;
111112
UnkEntityFunc0 = 0x09260348;
@@ -129,6 +130,7 @@ NO3_EInitBreakable = 0x0926B260;
129130
g_EInitParticle = 0x0926B280;
130131
g_EInitSpawner = 0x0926B290;
131132
g_EInitInteractable = 0x0926B2A0;
133+
g_EInitLockCamera = 0x0926B2C0;
132134
g_EInitCommon = 0x0926B2D0;
133135
g_EInitStInteractable = 0x0926B2F0;
134136
g_Rooms = 0x0926B528;

include/stage.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ s32 Random();
4141
#ifdef VERSION_PC
4242
void CreateEntityFromEntity(u16 entityId, Entity* source, Entity* entity);
4343
#endif
44-
void CreateEntityFromLayout(Entity* entity, LayoutEntity* initDesc);
4544
void DestroyEntity(Entity*);
4645
void DestroyEntitiesFromIndex(s16 index);
4746
void FallEntity(void);

src/st/cen/cen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ typedef enum EntityIDs {
4141
} EntityIDs;
4242

4343
void CreateEntityFromCurrentEntity(u16 entityId, Entity* entity);
44-
void CreateEntityFromLayout(Entity*, LayoutEntity*);
4544
u16 GetNormalizedAngle(u16 arg0, u16 arg1, u16 arg2);
4645
void EntityExplosionVariants(Entity* entity);
4746
void EntityGreyPuff(Entity* entity);

src/st/chi/ut_create_entity.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include "chi.h"
99
#include "../pfn_entity_update.h"
10-
// func_8019FA64: CreateEntityFromLayout
1110
// func_8019FB28: CreateEntityWhenInVerticalRange
1211
// func_8019FC40: CreateEntityWhenInHorizontalRange
1312
// func_8019FD58: FindFirstEntityToTheRight

src/st/create_entities_horizontal.h

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/st/create_entities_right.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/st/create_entities_vertical.h

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)