mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-23 21:19:55 +00:00
Simplify g_Entities access, get rid of D_800762D8
This commit is contained in:
parent
f88e3c62b9
commit
bdf60feae6
@ -50,7 +50,7 @@ g_CurrentRoom_x = 0x80072B70;
|
||||
g_CurrentRoom_y = 0x80072B74;
|
||||
g_CurrentRoom_width = 0x80072B78;
|
||||
g_CurrentRoom_height = 0x80072B7C;
|
||||
g_EntityArray = 0x80072E88;
|
||||
g_Entities = 0x80072E88;
|
||||
D_800733DA = 0x80072E8A;
|
||||
D_800733DC = 0x80072E8C;
|
||||
D_800733DE = 0x80072E8E;
|
||||
@ -61,7 +61,7 @@ D_80073420 = 0x80072ED0;
|
||||
D_80073490 = 0x80072F40;
|
||||
D_80073494 = 0x80072F44;
|
||||
D_80075718 = 0x800751C8;
|
||||
D_800762D8 = 0x80075D88;
|
||||
g_Entities_STAGE_ENTITY_START = 0x80075D88;
|
||||
D_8007A958 = 0x8007A408;
|
||||
D_8007C0D8 = 0x8007BB88;
|
||||
D_8007D858 = 0x8007D308;
|
||||
|
@ -793,7 +793,7 @@ g_CurrentRoom_bg_0_h = 0x800730FC;
|
||||
g_CurrentRoom_bg_0_D_80073100 = 0x80073100;
|
||||
g_CurrentRoom_bg_0_flags = 0x80073104;
|
||||
D_8007331C = 0x8007331C;
|
||||
g_EntityArray = 0x800733D8;
|
||||
g_Entities = 0x800733D8;
|
||||
D_80073490 = 0x80073490;
|
||||
D_80073494 = 0x80073494;
|
||||
D_800734BA = 0x800734BA;
|
||||
@ -837,7 +837,7 @@ D_80074A06 = 0x80074A06;
|
||||
D_80074B58 = 0x80074B58;
|
||||
D_80074C08 = 0x80074C08;
|
||||
D_80075D88 = 0x80075D88;
|
||||
D_800762D8 = 0x800762D8;
|
||||
g_Entities_STAGE_ENTITY_START = 0x800762D8;
|
||||
D_80076ED6 = 0x80076ED6;
|
||||
D_80077282 = 0x80077282;
|
||||
D_8007D858 = 0x8007D858;
|
||||
|
@ -793,7 +793,7 @@ g_CurrentRoom_bg_0_h = 0x800730FC;
|
||||
g_CurrentRoom_bg_0_D_80073100 = 0x80073100;
|
||||
g_CurrentRoom_bg_0_flags = 0x80073104;
|
||||
D_8007331C = 0x8007331C;
|
||||
g_EntityArray = 0x800733D8;
|
||||
g_Entities = 0x800733D8;
|
||||
D_80073490 = 0x80073490;
|
||||
D_80073494 = 0x80073494;
|
||||
D_800734BA = 0x800734BA;
|
||||
@ -837,7 +837,7 @@ D_80074A06 = 0x80074A06;
|
||||
D_80074B58 = 0x80074B58;
|
||||
D_80074C08 = 0x80074C08;
|
||||
D_80075D88 = 0x80075D88;
|
||||
D_800762D8 = 0x800762D8;
|
||||
g_Entities_STAGE_ENTITY_START = 0x800762D8;
|
||||
D_80076ED6 = 0x80076ED6;
|
||||
D_80077282 = 0x80077282;
|
||||
D_8007D858 = 0x8007D858;
|
||||
|
@ -97,6 +97,7 @@ typedef struct Primitive {
|
||||
#define FALL_TERMINAL_VELOCITY 0x60000
|
||||
|
||||
#define TOTAL_ENTITY_COUNT 256
|
||||
#define STAGE_ENTITY_START 64
|
||||
#define MaxEntityCount 32
|
||||
#define EQUIP_TYPE_COUNT 11
|
||||
|
||||
@ -928,9 +929,9 @@ extern RoomDimensions g_CurrentRoom;
|
||||
extern s32 g_CurrentRoom_vSize; // g_CurrentRoom.vSize
|
||||
|
||||
// Beginning of Player Character offset = 0x800733D8
|
||||
extern Entity g_EntityArray[TOTAL_ENTITY_COUNT];
|
||||
extern Entity g_Entities[TOTAL_ENTITY_COUNT];
|
||||
// dictionary of direct accesses
|
||||
// g_EntityArray PLAYER
|
||||
// g_Entities PLAYER
|
||||
extern s16 D_800733DA; // PLAYER.posX.i.hi
|
||||
extern s16 D_800733DC; // PLAYER.posY.val
|
||||
extern s16 D_800733DE; // PLAYER.posY.i.hi
|
||||
@ -960,37 +961,36 @@ extern s16 D_8007347C; // PLAYER.unkA4
|
||||
extern u8 D_80073484; // PLAYER.ext.generic.unkAC
|
||||
// End of Player Character offset = 0x80073494
|
||||
|
||||
// D_80073494 g_EntityArray[1]
|
||||
extern s32 D_800734F8; // g_EntityArray[1].firstPolygonIndex
|
||||
extern s16 D_800734EA; // g_EntityArray[1].animCurFrame
|
||||
extern s8 D_80073510; // g_EntityArray[1].unk7C.S8.unk0
|
||||
extern s8 D_80073511; // g_EntityArray[1].unk7C.S8.unk1
|
||||
extern s8 D_80073512; // g_EntityArray[1].unk7E.modeU8.unk0
|
||||
// D_80073494 g_Entities[1]
|
||||
extern s32 D_800734F8; // g_Entities[1].firstPolygonIndex
|
||||
extern s16 D_800734EA; // g_Entities[1].animCurFrame
|
||||
extern s8 D_80073510; // g_Entities[1].unk7C.S8.unk0
|
||||
extern s8 D_80073511; // g_Entities[1].unk7C.S8.unk1
|
||||
extern s8 D_80073512; // g_Entities[1].unk7E.modeU8.unk0
|
||||
|
||||
// D_80073550 g_EntityArray[2]
|
||||
extern u16 D_8007357C; // g_EntityArray[2].step
|
||||
extern s32 D_80073584; // g_EntityArray[2].unk34
|
||||
extern s32 D_800735B4; // g_EntityArray[2].firstPolygonIndex
|
||||
extern POLY_GT4* D_800735CC; // *(s32*)g_EntityArray[2].unk7C
|
||||
// D_80073550 g_Entities[2]
|
||||
extern u16 D_8007357C; // g_Entities[2].step
|
||||
extern s32 D_80073584; // g_Entities[2].unk34
|
||||
extern s32 D_800735B4; // g_Entities[2].firstPolygonIndex
|
||||
extern POLY_GT4* D_800735CC; // *(s32*)g_Entities[2].unk7C
|
||||
|
||||
// D_80073550 g_EntityArray[2]
|
||||
extern s16 D_800735A6; // g_EntityArray[2].animCurFrame
|
||||
// D_80073550 g_Entities[2]
|
||||
extern s16 D_800735A6; // g_Entities[2].animCurFrame
|
||||
|
||||
// D_8007360C g_EntityArray[3]
|
||||
extern s16 D_80073662; // g_EntityArray[3].animCurFrame
|
||||
// D_8007360C g_Entities[3]
|
||||
extern s16 D_80073662; // g_Entities[3].animCurFrame
|
||||
|
||||
// D_800736C8 g_EntityArray[4]
|
||||
// D_80073784 g_EntityArray[5]
|
||||
// D_800739B8 g_EntityArray[8]
|
||||
// D_80073F98 g_EntityArray[16]
|
||||
// D_800741CC g_EntityArray[19]
|
||||
// D_80074C08 g_EntityArray[20]
|
||||
// D_800736C8 g_Entities[4]
|
||||
// D_80073784 g_Entities[5]
|
||||
// D_800739B8 g_Entities[8]
|
||||
// D_80073F98 g_Entities[16]
|
||||
// D_800741CC g_Entities[19]
|
||||
// D_80074C08 g_Entities[20]
|
||||
|
||||
// *** ENTITY DIRECT ACCESS PROPERTIES START ***
|
||||
extern Entity D_80074C08[];
|
||||
// *** ENTITY DIRECT ACCESS PROPERTIES END ***
|
||||
|
||||
extern Entity D_800762D8[]; // g_EntityArray[64]
|
||||
extern Unkstruct8 g_CurrentRoomTileLayout;
|
||||
extern Entity D_8007A958[];
|
||||
extern Entity D_8007C0D8[];
|
||||
|
@ -14,7 +14,7 @@ typedef enum {
|
||||
UNK_ENTITY_100 = 0x100
|
||||
} EntityTypes;
|
||||
|
||||
#define PLAYER g_EntityArray[PLAYER_CHARACTER]
|
||||
#define PLAYER g_Entities[PLAYER_CHARACTER]
|
||||
|
||||
#define SQ(x) ((x) * (x))
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
|
@ -1097,11 +1097,11 @@ INCLUDE_ASM("asm/us/dra/nonmatchings/47BB8", func_800EB758);
|
||||
// clears out each entity struct 1 byte at a time
|
||||
void func_800EBB70(void) {
|
||||
s8* byte;
|
||||
Entity* entity = &g_EntityArray[0];
|
||||
Entity* entity = &g_Entities[0];
|
||||
s32 i;
|
||||
u32 j;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(g_EntityArray); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(g_Entities); i++) {
|
||||
byte = (s8*)entity;
|
||||
for (j = 0; j < 188; j++) {
|
||||
byte[0] = 0;
|
||||
|
@ -533,10 +533,10 @@ s32 func_800F0CD8(s32 arg0) {
|
||||
if (D_80097418 == 0) {
|
||||
if (D_80097C98 == 2) {
|
||||
var_v0 = SetNextRoomToLoad(
|
||||
(g_EntityArray[0].posX.i.hi >> 8) + g_CurrentRoom.left,
|
||||
(g_EntityArray[0].posY.i.hi >> 8) + g_CurrentRoom.top);
|
||||
D_801375C0 = (u8)g_EntityArray[0].posX.i.hi;
|
||||
D_801375C4 = (u8)g_EntityArray[0].posY.i.hi;
|
||||
(g_Entities[0].posX.i.hi >> 8) + g_CurrentRoom.left,
|
||||
(g_Entities[0].posY.i.hi >> 8) + g_CurrentRoom.top);
|
||||
D_801375C0 = (u8)g_Entities[0].posX.i.hi;
|
||||
D_801375C4 = (u8)g_Entities[0].posY.i.hi;
|
||||
return var_v0;
|
||||
}
|
||||
if (arg0 == 0) {
|
||||
@ -547,11 +547,11 @@ s32 func_800F0CD8(s32 arg0) {
|
||||
(playerY >> 8) + g_CurrentRoom.top);
|
||||
if (var_v0) {
|
||||
D_80072F98 = 1;
|
||||
D_801375C0 = g_EntityArray[0].posX.i.hi + 0x100;
|
||||
D_801375C4 = g_EntityArray[0].posY.i.hi;
|
||||
D_801375C0 = g_Entities[0].posX.i.hi + 0x100;
|
||||
D_801375C4 = g_Entities[0].posY.i.hi;
|
||||
return var_v0;
|
||||
}
|
||||
g_EntityArray[0].posX.i.hi = 0;
|
||||
g_Entities[0].posX.i.hi = 0;
|
||||
playerX = g_CurrentRoom.x;
|
||||
}
|
||||
if (playerX >= g_CurrentRoom.width) {
|
||||
@ -559,11 +559,11 @@ s32 func_800F0CD8(s32 arg0) {
|
||||
(playerY >> 8) + g_CurrentRoom.top);
|
||||
if (var_v0) {
|
||||
D_80072F98 = 1;
|
||||
D_801375C0 = g_EntityArray[0].posX.i.hi - 0x100;
|
||||
D_801375C4 = g_EntityArray[0].posY.i.hi;
|
||||
D_801375C0 = g_Entities[0].posX.i.hi - 0x100;
|
||||
D_801375C4 = g_Entities[0].posY.i.hi;
|
||||
return var_v0;
|
||||
}
|
||||
g_EntityArray[0].posX.i.hi = 0xFF;
|
||||
g_Entities[0].posX.i.hi = 0xFF;
|
||||
playerX = g_CurrentRoom.width - 1;
|
||||
}
|
||||
}
|
||||
@ -573,12 +573,12 @@ s32 func_800F0CD8(s32 arg0) {
|
||||
g_CurrentRoom.top - 1);
|
||||
if (temp_v0 != false) {
|
||||
D_80072F98 = 2;
|
||||
D_801375C0 = g_EntityArray[0].posX.i.hi;
|
||||
D_801375C4 = g_EntityArray[0].posY.i.hi + 0xD0;
|
||||
D_801375C0 = g_Entities[0].posX.i.hi;
|
||||
D_801375C4 = g_Entities[0].posY.i.hi + 0xD0;
|
||||
playerY -= 0x80;
|
||||
return temp_v0;
|
||||
}
|
||||
g_EntityArray[0].posY.i.hi = 0;
|
||||
g_Entities[0].posY.i.hi = 0;
|
||||
playerY = g_CurrentRoom.y + 4;
|
||||
}
|
||||
var_s0 = 0x30;
|
||||
@ -590,13 +590,13 @@ s32 func_800F0CD8(s32 arg0) {
|
||||
g_CurrentRoom.bottom + 1);
|
||||
if (temp_v0 != false) {
|
||||
D_80072F98 = 2;
|
||||
D_801375C0 = g_EntityArray[0].posX.i.hi;
|
||||
D_801375C4 = g_EntityArray[0].posY.i.hi - 0x100;
|
||||
D_801375C0 = g_Entities[0].posX.i.hi;
|
||||
D_801375C4 = g_Entities[0].posY.i.hi - 0x100;
|
||||
D_801375C4 = D_801375C4 + var_s0;
|
||||
playerY += 0x80;
|
||||
return temp_v0;
|
||||
}
|
||||
g_EntityArray[0].posY.i.hi = 0x10F - var_s0;
|
||||
g_Entities[0].posY.i.hi = 0x10F - var_s0;
|
||||
playerY = g_CurrentRoom.height - var_s0 + 0x13;
|
||||
}
|
||||
}
|
||||
@ -606,8 +606,8 @@ block_25:
|
||||
if (playerX < temp_a1) {
|
||||
if (arg0 != 0 && g_CurrentRoom.hSize != 1 &&
|
||||
temp_a1 < playerX + D_801375A4) {
|
||||
g_EntityArray[0].posX.i.hi =
|
||||
(u16)g_EntityArray[0].posX.i.hi +
|
||||
g_Entities[0].posX.i.hi =
|
||||
(u16)g_Entities[0].posX.i.hi +
|
||||
(playerX + D_801375A4 - (g_CurrentRoom.x + *D_8009740C));
|
||||
}
|
||||
g_Camera.posX.i.hi = g_CurrentRoom.x;
|
||||
@ -616,26 +616,26 @@ block_25:
|
||||
if (temp_a1_2 < playerX) {
|
||||
if (arg0 != 0 && g_CurrentRoom.hSize != 1 &&
|
||||
playerX + D_801375A4 < temp_a1_2) {
|
||||
g_EntityArray[0].posX.i.hi =
|
||||
((u16)g_EntityArray[0].posX.i.hi) +
|
||||
g_Entities[0].posX.i.hi =
|
||||
((u16)g_Entities[0].posX.i.hi) +
|
||||
(((playerX + D_801375A4) + 0x100) -
|
||||
(g_CurrentRoom.width + (*D_8009740C)));
|
||||
}
|
||||
g_Camera.posX.i.hi = g_CurrentRoom.width - 0x100;
|
||||
} else {
|
||||
g_Camera.posX.i.hi = playerX - (*D_8009740C);
|
||||
g_EntityArray[0].posX.i.hi = *D_8009740C;
|
||||
g_Entities[0].posX.i.hi = *D_8009740C;
|
||||
}
|
||||
}
|
||||
if (D_8009741C != 0) {
|
||||
if (playerY < g_CurrentRoom.y + 0x8C) {
|
||||
g_Camera.posY.i.hi = g_CurrentRoom.y + 4;
|
||||
g_EntityArray[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
g_Entities[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
} else if (g_CurrentRoom.height - 0x74 < playerY) {
|
||||
g_Camera.posY.i.hi = g_CurrentRoom.height - 0xFC;
|
||||
g_EntityArray[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
g_Entities[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
} else {
|
||||
g_EntityArray[0].posY.i.hi = 0x88;
|
||||
g_Entities[0].posY.i.hi = 0x88;
|
||||
g_Camera.posY.i.hi = playerY - 0x88;
|
||||
}
|
||||
} else {
|
||||
@ -644,25 +644,25 @@ block_25:
|
||||
if (g_Camera.posY.i.hi + new_var2 - playerY >= 4 &&
|
||||
g_CurrentRoom.y + 8 < g_Camera.posY.i.hi) {
|
||||
g_Camera.posY.i.hi -= 4;
|
||||
g_EntityArray[0].posY.i.hi += 4;
|
||||
g_Entities[0].posY.i.hi += 4;
|
||||
} else if (g_Camera.posY.i.hi < g_CurrentRoom.y &&
|
||||
g_CurrentRoom.y != 0) {
|
||||
g_Camera.posY.i.hi += 4;
|
||||
g_EntityArray[0].posY.i.hi -= 4;
|
||||
g_Entities[0].posY.i.hi -= 4;
|
||||
} else {
|
||||
g_Camera.posY.i.hi = g_CurrentRoom.y + 4;
|
||||
g_EntityArray[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
g_Entities[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
}
|
||||
} else {
|
||||
g_EntityArray[0].posY.i.hi = g_Camera.posY.i.hi;
|
||||
g_Entities[0].posY.i.hi = g_Camera.posY.i.hi;
|
||||
if (g_CurrentRoom.height - 0x74 < playerY) {
|
||||
g_Camera.posY.i.hi = g_CurrentRoom.height - 0xFC;
|
||||
g_EntityArray[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
g_Entities[0].posY.i.hi = playerY - g_Camera.posY.i.hi;
|
||||
} else if (g_Camera.posY.i.hi + new_var2 - playerY >= 4) {
|
||||
g_Camera.posY.i.hi -= 4;
|
||||
g_EntityArray[0].posY.i.hi += 4;
|
||||
g_Entities[0].posY.i.hi += 4;
|
||||
} else {
|
||||
g_EntityArray[0].posY.i.hi = 0x88;
|
||||
g_Entities[0].posY.i.hi = 0x88;
|
||||
g_Camera.posY.i.hi = playerY - 0x88;
|
||||
}
|
||||
}
|
||||
|
@ -1021,7 +1021,7 @@ INCLUDE_ASM("asm/us/dra/nonmatchings/5298C", func_800FA8C4);
|
||||
INCLUDE_ASM("asm/us/dra/nonmatchings/5298C", func_800FA9DC);
|
||||
|
||||
void func_800FAB1C(void) {
|
||||
Entity* entity = &g_EntityArray[UNK_ENTITY_4];
|
||||
Entity* entity = &g_Entities[UNK_ENTITY_4];
|
||||
s32 i;
|
||||
|
||||
for (i = 4; i < 64; i++) {
|
||||
|
@ -351,7 +351,7 @@ void AddHearts(s32 value) {
|
||||
if (g_Status.heartsMax < g_Status.hearts) {
|
||||
g_Status.hearts = g_Status.heartsMax;
|
||||
}
|
||||
func_8011AAFC(g_EntityArray, 99, 0);
|
||||
func_8011AAFC(g_Entities, 99, 0);
|
||||
PlaySfx(NA_SE_PL_COLLECT_HEART);
|
||||
}
|
||||
}
|
||||
|
@ -201,8 +201,8 @@ void DestroyEntity(Entity* entity) {
|
||||
void func_801065F4(s16 startIndex) {
|
||||
Entity* pItem;
|
||||
|
||||
for (pItem = &g_EntityArray[startIndex];
|
||||
pItem < &g_EntityArray[TOTAL_ENTITY_COUNT]; pItem++)
|
||||
for (pItem = &g_Entities[startIndex];
|
||||
pItem < &g_Entities[TOTAL_ENTITY_COUNT]; pItem++)
|
||||
DestroyEntity(pItem);
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ void DrawEntitiesHitbox(s32 blendMode) {
|
||||
tile = &D_8006C37C->tiles[g_GpuUsage.tile];
|
||||
drawMode = &D_8006C37C->drawModes[g_GpuUsage.drawModes];
|
||||
orderIdx = 0x1F0;
|
||||
for (polyCount = 0, entity = g_EntityArray; polyCount < 0x40;
|
||||
for (polyCount = 0, entity = g_Entities; polyCount < 0x40;
|
||||
polyCount++, entity++) {
|
||||
if (entity->unk3C == 0)
|
||||
continue;
|
||||
@ -529,7 +529,7 @@ INCLUDE_ASM("asm/us/dra/nonmatchings/62D70", func_8010A234);
|
||||
#else
|
||||
void func_8010A234(s32 arg0) {
|
||||
s32 temp;
|
||||
g_CurrentEntity = g_EntityArray;
|
||||
g_CurrentEntity = g_Entities;
|
||||
temp = D_8017A000.func_8017A018();
|
||||
|
||||
do { // !FAKE
|
||||
@ -548,14 +548,14 @@ void func_8010A234(s32 arg0) {
|
||||
}
|
||||
}
|
||||
} else if (*(s32*)&D_80072F2C & 0x01000000) {
|
||||
g_EntityArray[PLAYER_CHARACTER].palette = 0x8100;
|
||||
g_EntityArray[PLAYER_CHARACTER].animSet = 1;
|
||||
g_EntityArray[PLAYER_CHARACTER].unk5A = 0;
|
||||
g_EntityArray[PLAYER_CHARACTER].unk1E = 0;
|
||||
g_EntityArray[PLAYER_CHARACTER].unk19 &= 0xF3;
|
||||
g_Entities[PLAYER_CHARACTER].palette = 0x8100;
|
||||
g_Entities[PLAYER_CHARACTER].animSet = 1;
|
||||
g_Entities[PLAYER_CHARACTER].unk5A = 0;
|
||||
g_Entities[PLAYER_CHARACTER].unk1E = 0;
|
||||
g_Entities[PLAYER_CHARACTER].unk19 &= 0xF3;
|
||||
func_8010FAF4();
|
||||
g_EntityArray[PLAYER_CHARACTER].unk22 = 0;
|
||||
g_EntityArray[PLAYER_CHARACTER].unk20 = 0;
|
||||
g_Entities[PLAYER_CHARACTER].unk22 = 0;
|
||||
g_Entities[PLAYER_CHARACTER].unk20 = 0;
|
||||
if (D_80072F20.pl_vram_flag & 1) {
|
||||
func_8010E570(0);
|
||||
} else {
|
||||
@ -717,11 +717,11 @@ void func_8010DFF0(s32 arg0, s32 arg1) {
|
||||
s32 i;
|
||||
|
||||
if (arg0 != 0) {
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.U8.unk1 = 1;
|
||||
g_EntityArray[UNK_ENTITY_3].animCurFrame = 0;
|
||||
g_EntityArray[UNK_ENTITY_2].animCurFrame = 0;
|
||||
g_EntityArray[UNK_ENTITY_1].animCurFrame = 0;
|
||||
poly = &g_PrimBuf[g_EntityArray[UNK_ENTITY_1].firstPolygonIndex];
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.U8.unk1 = 1;
|
||||
g_Entities[UNK_ENTITY_3].animCurFrame = 0;
|
||||
g_Entities[UNK_ENTITY_2].animCurFrame = 0;
|
||||
g_Entities[UNK_ENTITY_1].animCurFrame = 0;
|
||||
poly = &g_PrimBuf[g_Entities[UNK_ENTITY_1].firstPolygonIndex];
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
poly->x1 = 0;
|
||||
@ -729,8 +729,8 @@ void func_8010DFF0(s32 arg0, s32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.U8.unk0 = 1;
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7E.modeU8.unk0 = 10;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.U8.unk0 = 1;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7E.modeU8.unk0 = 10;
|
||||
|
||||
if (arg1 != 0) {
|
||||
if (arg1 < 4) {
|
||||
@ -742,13 +742,13 @@ void func_8010DFF0(s32 arg0, s32 arg1) {
|
||||
}
|
||||
|
||||
void func_8010E0A8(void) {
|
||||
Entity* entity = &g_EntityArray[UNK_ENTITY_1];
|
||||
Entity* entity = &g_Entities[UNK_ENTITY_1];
|
||||
|
||||
entity->ext.generic.unk7E.modeU8.unk0 = 0;
|
||||
}
|
||||
|
||||
void func_8010E0B8(void) {
|
||||
Entity* entity = &g_EntityArray[UNK_ENTITY_1];
|
||||
Entity* entity = &g_Entities[UNK_ENTITY_1];
|
||||
|
||||
entity->ext.generic.unk7C.U8.unk1 = 0;
|
||||
entity->ext.generic.unk7C.U8.unk0 = 0;
|
||||
@ -758,13 +758,13 @@ void func_8010E0D0(s32 arg0) {
|
||||
Entity* entity;
|
||||
|
||||
if (arg0 == 1) {
|
||||
entity = func_8011AAFC(g_EntityArray, 0x47002C, 0);
|
||||
entity = func_8011AAFC(g_Entities, 0x47002C, 0);
|
||||
|
||||
if (entity != NULL) {
|
||||
entity->flags |= FLAG_UNK_10000;
|
||||
}
|
||||
|
||||
entity = func_8011AAFC(g_EntityArray, 0x40002C, 0);
|
||||
entity = func_8011AAFC(g_Entities, 0x40002C, 0);
|
||||
|
||||
if (entity != NULL) {
|
||||
entity->flags |= FLAG_UNK_10000;
|
||||
@ -866,7 +866,7 @@ void func_8010E3B8(s32 accelerationX) {
|
||||
|
||||
void func_8010E3E0(void) {
|
||||
if (D_80072F20.unk48 != 0) {
|
||||
DestroyEntity(&g_EntityArray[16]);
|
||||
DestroyEntity(&g_Entities[16]);
|
||||
D_80072F20.unk48 = 0;
|
||||
}
|
||||
}
|
||||
@ -1042,7 +1042,7 @@ void func_8010EA54(s32 arg0) {
|
||||
#endif
|
||||
|
||||
s32 func_8010EADC(s16 arg0, s16 arg1) {
|
||||
Entity* entity = &g_EntityArray[0x20];
|
||||
Entity* entity = &g_Entities[0x20];
|
||||
s32 i;
|
||||
s32 var_a2;
|
||||
s32 ret;
|
||||
@ -1084,7 +1084,7 @@ void func_8010ED54(u8 arg0) {
|
||||
INCLUDE_ASM("asm/us/dra/nonmatchings/62D70", func_8010EDB8);
|
||||
|
||||
void func_8010FAF4(void) {
|
||||
DestroyEntity(&g_EntityArray[UNK_ENTITY_10]);
|
||||
DestroyEntity(&g_Entities[UNK_ENTITY_10]);
|
||||
D_80072F66 = 0;
|
||||
}
|
||||
|
||||
|
@ -112,16 +112,16 @@ INCLUDE_ASM("asm/us/dra/nonmatchings/71830", func_80111DE8);
|
||||
bool func_8011203C(void) {
|
||||
s32 collision = func_80111D24();
|
||||
|
||||
if (g_EntityArray[UNK_ENTITY_10].step == 5) {
|
||||
if (g_Entities[UNK_ENTITY_10].step == 5) {
|
||||
if (collision == false) {
|
||||
DestroyEntity(&g_EntityArray[UNK_ENTITY_10]);
|
||||
DestroyEntity(&g_Entities[UNK_ENTITY_10]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else if (g_EntityArray[UNK_ENTITY_10].step <= 2) {
|
||||
if (g_EntityArray[UNK_ENTITY_10].step != 0) {
|
||||
} else if (g_Entities[UNK_ENTITY_10].step <= 2) {
|
||||
if (g_Entities[UNK_ENTITY_10].step != 0) {
|
||||
D_80072F66 = 0;
|
||||
g_EntityArray[UNK_ENTITY_10].step = 3;
|
||||
g_Entities[UNK_ENTITY_10].step = 3;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -137,7 +137,7 @@ void func_80113EE0(void) {
|
||||
D_80072F66 = 0;
|
||||
PLAYER.unk1E = 0;
|
||||
PLAYER.zPriority = g_zEntityCenter.S16.unk0;
|
||||
if (g_EntityArray[UNK_ENTITY_10].objectId == 0x22) {
|
||||
if (g_Entities[UNK_ENTITY_10].objectId == 0x22) {
|
||||
func_8010FAF4();
|
||||
}
|
||||
}
|
||||
|
@ -59,16 +59,16 @@ void func_801167D0(void) {
|
||||
}
|
||||
|
||||
bool func_80116838(void) {
|
||||
if ((g_EntityArray->step_s != 0) &&
|
||||
if ((g_Entities->step_s != 0) &&
|
||||
((D_8009744C != 0) || (D_80072EEC & 8) || (func_800FEEA4(0, 1) < 0))) {
|
||||
func_8010D584(9);
|
||||
func_8010DA48(0xCA);
|
||||
D_800AFDA6 = 6;
|
||||
g_EntityArray->palette = 0x810D;
|
||||
g_Entities->palette = 0x810D;
|
||||
D_80072F86 = 0;
|
||||
D_80072F88 = 0;
|
||||
func_8011AAFC(g_CurrentEntity, 0x21002C, 0);
|
||||
g_EntityArray->accelerationY = g_EntityArray->accelerationY >> 1;
|
||||
g_Entities->accelerationY = g_Entities->accelerationY >> 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -132,7 +132,7 @@ void func_80118670(void) {
|
||||
|
||||
void func_801186EC(void) {
|
||||
if (PLAYER.step_s == 0) {
|
||||
if (g_EntityArray[UNK_ENTITY_10].objectId == 0) {
|
||||
if (g_Entities[UNK_ENTITY_10].objectId == 0) {
|
||||
D_80138008 = 0x10;
|
||||
func_8011AAFC(g_CurrentEntity, 0x15003D, 0);
|
||||
PLAYER.step_s++;
|
||||
@ -144,7 +144,7 @@ void func_801186EC(void) {
|
||||
}
|
||||
|
||||
Entity* GetFreeDraEntity(s16 start, s16 end) {
|
||||
Entity* entity = &g_EntityArray[start];
|
||||
Entity* entity = &g_Entities[start];
|
||||
s16 i;
|
||||
|
||||
for (i = start; i < end; i++, entity++) {
|
||||
@ -335,7 +335,7 @@ void func_8011A4C8(Entity* entity) {}
|
||||
INCLUDE_ASM("asm/us/dra/nonmatchings/75F54", func_8011A4D0);
|
||||
|
||||
void func_8011A870(void) {
|
||||
Entity* entity = g_CurrentEntity = &g_EntityArray[UNK_ENTITY_4];
|
||||
Entity* entity = g_CurrentEntity = &g_Entities[UNK_ENTITY_4];
|
||||
u16 objectId;
|
||||
s32 i = 4;
|
||||
|
||||
@ -482,7 +482,7 @@ bool func_8011BD48(Entity* entity) {
|
||||
s32 i = 0x10;
|
||||
s16 objId = entity->objectId;
|
||||
s16 subId = entity->subId;
|
||||
Entity* e = &g_EntityArray[i];
|
||||
Entity* e = &g_Entities[i];
|
||||
for (; i < 0x40; i++, e++) {
|
||||
if (objId == (s32)e->objectId && subId == (s32)e->subId &&
|
||||
e != entity) {
|
||||
@ -1375,11 +1375,11 @@ bool func_8012C88C(void) {
|
||||
}
|
||||
|
||||
void func_8012C97C(void) {
|
||||
if (g_EntityArray[PLAYER_CHARACTER].step_s == 0) {
|
||||
if (g_Entities[PLAYER_CHARACTER].step_s == 0) {
|
||||
return;
|
||||
}
|
||||
if (g_EntityArray[PLAYER_CHARACTER].step_s >= 8 &&
|
||||
g_EntityArray[PLAYER_CHARACTER].step_s < 10) {
|
||||
if (g_Entities[PLAYER_CHARACTER].step_s >= 8 &&
|
||||
g_Entities[PLAYER_CHARACTER].step_s < 10) {
|
||||
return;
|
||||
}
|
||||
if (D_8009744C < 13) {
|
||||
@ -1591,8 +1591,8 @@ void func_8013136C(Entity* entity) {
|
||||
}
|
||||
entity->animCurFrame = 80;
|
||||
entity->facing = PLAYER.facing;
|
||||
entity->posX.val = g_EntityArray[UNK_ENTITY_13].posX.val; // D_800741CC
|
||||
entity->posY.val = g_EntityArray[UNK_ENTITY_13].posY.val; // D_800741D0
|
||||
entity->posX.val = g_Entities[UNK_ENTITY_13].posX.val; // D_800741CC
|
||||
entity->posY.val = g_Entities[UNK_ENTITY_13].posY.val; // D_800741D0
|
||||
if (PLAYER.facing == 0) {
|
||||
entity->zPriority = PLAYER.zPriority - 5;
|
||||
entity->posX.i.hi += 8;
|
||||
@ -1601,7 +1601,7 @@ void func_8013136C(Entity* entity) {
|
||||
entity->posX.i.hi -= 8;
|
||||
}
|
||||
entity->posY.i.hi += 3;
|
||||
entity->unk1E = g_EntityArray[UNK_ENTITY_13].unk1E;
|
||||
entity->unk1E = g_Entities[UNK_ENTITY_13].unk1E;
|
||||
switch (PLAYER.step_s - 1) {
|
||||
case 1:
|
||||
case 3:
|
||||
|
@ -54,6 +54,7 @@ typedef struct {
|
||||
} WeaponOvl;
|
||||
|
||||
extern void (*D_800A0004)(); // TODO pointer to 0x50 array of functions
|
||||
extern s32 D_800A0144[];
|
||||
extern u32 D_800A0158;
|
||||
extern s32 D_800A015C;
|
||||
extern s16 D_800A0160[];
|
||||
|
@ -91,26 +91,26 @@ void func_8015CB58(s32 arg0, s32 arg1) {
|
||||
|
||||
FntPrint("op disable\n");
|
||||
if (arg0 != 0) {
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.S8.unk1 = 1;
|
||||
g_EntityArray[UNK_ENTITY_3].animCurFrame = 0;
|
||||
g_EntityArray[UNK_ENTITY_2].animCurFrame = 0;
|
||||
g_EntityArray[UNK_ENTITY_1].animCurFrame = 0;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.S8.unk1 = 1;
|
||||
g_Entities[UNK_ENTITY_3].animCurFrame = 0;
|
||||
g_Entities[UNK_ENTITY_2].animCurFrame = 0;
|
||||
g_Entities[UNK_ENTITY_1].animCurFrame = 0;
|
||||
|
||||
poly = &g_PrimBuf[g_EntityArray[UNK_ENTITY_1].firstPolygonIndex];
|
||||
poly = &g_PrimBuf[g_Entities[UNK_ENTITY_1].firstPolygonIndex];
|
||||
while (poly != NULL) {
|
||||
poly->x1 = 0;
|
||||
poly = (POLY_GT4*)poly->tag;
|
||||
}
|
||||
}
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 1;
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7E.modeU8.unk0 = 0xA;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 1;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7E.modeU8.unk0 = 0xA;
|
||||
if (arg1 != 0) {
|
||||
D_80072F1E = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8015CC28(void) {
|
||||
Entity* entity = &g_EntityArray[UNK_ENTITY_1];
|
||||
Entity* entity = &g_Entities[UNK_ENTITY_1];
|
||||
|
||||
entity->ext.generic.unk7E.modeU8.unk1 = 0;
|
||||
entity->ext.generic.unk7E.modeU8.unk0 = 0;
|
||||
|
@ -41,7 +41,7 @@ INCLUDE_ASM("asm/us/ric/nonmatchings/22380", func_8015F414);
|
||||
INCLUDE_ASM("asm/us/ric/nonmatchings/22380", func_8015F680);
|
||||
|
||||
Entity* func_8015F8F8(s16 entityIndex, s16 arg1) {
|
||||
Entity* entity = &g_EntityArray[entityIndex];
|
||||
Entity* entity = &g_Entities[entityIndex];
|
||||
s16 var_a0 = entityIndex;
|
||||
|
||||
if (entityIndex < arg1) {
|
||||
@ -302,7 +302,7 @@ void func_801623E0(Entity* entity) {
|
||||
POLY_GT4* poly;
|
||||
s16 firstPolygonIndex;
|
||||
|
||||
entity->posX.val = g_EntityArray->posX.val;
|
||||
entity->posX.val = g_Entities->posX.val;
|
||||
entity->posY.val = PLAYER.posY.val;
|
||||
switch (entity->step) {
|
||||
case 0:
|
||||
@ -364,7 +364,7 @@ void func_80162604(Entity* entity) {
|
||||
POLY_GT4* poly;
|
||||
s16 firstPolygonIndex;
|
||||
|
||||
entity->posX.val = g_EntityArray->posX.val;
|
||||
entity->posX.val = g_Entities->posX.val;
|
||||
entity->posY.val = PLAYER.posY.val;
|
||||
switch (entity->step) {
|
||||
case 0:
|
||||
@ -518,7 +518,7 @@ bool func_80162E9C(Entity* entity) {
|
||||
s32 i = 0x10;
|
||||
s16 objId = entity->objectId;
|
||||
s16 subId = entity->subId;
|
||||
Entity* e = &g_EntityArray[i];
|
||||
Entity* e = &g_Entities[i];
|
||||
for (; i < 0x40; i++, e++) {
|
||||
if (objId == (s32)e->objectId && subId == (s32)e->subId &&
|
||||
e != entity) {
|
||||
@ -760,7 +760,7 @@ void func_8016779C(Entity* entity) {
|
||||
entity->animCurFrame = D_80155D08[D_80175080];
|
||||
}
|
||||
|
||||
entity->posX.val = g_EntityArray->posX.val;
|
||||
entity->posX.val = g_Entities->posX.val;
|
||||
entity->posY.val = PLAYER.posY.val;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ void func_80171568(Entity* self) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
entity = &g_EntityArray[5 + i];
|
||||
entity = &g_Entities[5 + i];
|
||||
if (entity->objectId == 0) {
|
||||
goto init_entity;
|
||||
}
|
||||
@ -121,7 +121,7 @@ void func_8017160C(s32 amount, s32 objectId) {
|
||||
}
|
||||
|
||||
for (i = 0; i < amount; i++) {
|
||||
entity = &g_EntityArray[5 + i];
|
||||
entity = &g_Entities[5 + i];
|
||||
if (entity->objectId == objectId) {
|
||||
entity->step = 0;
|
||||
} else {
|
||||
@ -130,8 +130,8 @@ void func_8017160C(s32 amount, s32 objectId) {
|
||||
entity->palette = 0x140;
|
||||
entity->objectId = objectId;
|
||||
entity->animSet = 0x8014;
|
||||
entity->zPriority = g_EntityArray[0].zPriority - 2;
|
||||
facing = (g_EntityArray[0].facing + 1) & 1;
|
||||
entity->zPriority = g_Entities[0].zPriority - 2;
|
||||
facing = (g_Entities[0].facing + 1) & 1;
|
||||
entity->subId = i + 1;
|
||||
entity->facing = facing;
|
||||
}
|
||||
@ -242,7 +242,7 @@ void func_80171ED4(s32 arg0) {
|
||||
spriteBanks = D_80170040;
|
||||
g_api.o.spriteBanks[0x14] = spriteBanks;
|
||||
|
||||
e = &g_EntityArray[4];
|
||||
e = &g_Entities[4];
|
||||
DestroyEntity(e);
|
||||
e->unk5A = 0x6C;
|
||||
e->palette = 0x140;
|
||||
@ -408,7 +408,7 @@ Entity* func_80173EB0(s32 rangeIndex, s32 objectId) {
|
||||
volatile u32 pad; // fake?
|
||||
s16 start = D_80171094[rangeIndex].start;
|
||||
s16 end = D_80171094[rangeIndex].end;
|
||||
Entity* entity = &g_EntityArray[start];
|
||||
Entity* entity = &g_Entities[start];
|
||||
s32 i;
|
||||
|
||||
for (i = start; end >= i; i++, entity++) {
|
||||
@ -658,7 +658,7 @@ void func_801745E4(Entity* entityParent, s32 objectId, s32 subId) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
entity = &g_EntityArray[5 + i];
|
||||
entity = &g_Entities[5 + i];
|
||||
if (entity->objectId == 0) {
|
||||
goto init_entity;
|
||||
}
|
||||
@ -721,7 +721,7 @@ s32 func_801747B8(void) {
|
||||
Entity* entity;
|
||||
s32 i;
|
||||
|
||||
entity = &D_800762D8;
|
||||
entity = &g_Entities[STAGE_ENTITY_START];
|
||||
for (i = 0; i < 0x80; i++, entity++) {
|
||||
if (entity->objectId == 0)
|
||||
continue;
|
||||
|
@ -190,7 +190,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
func_80192A3C(entity, layoutObj);
|
||||
}
|
||||
@ -198,7 +199,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
func_80192A3C(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -228,7 +230,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
func_80192A3C(entity, layoutObj);
|
||||
}
|
||||
@ -236,7 +239,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
func_80192A3C(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -414,7 +418,7 @@ void DestroyEntity(Entity* entity) {
|
||||
}
|
||||
|
||||
void func_801942D0(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -47,7 +47,7 @@ void EntityPinkBallProjectile(Entity* self) {
|
||||
case 3:
|
||||
AnimateEntity(D_80180794, self);
|
||||
MoveEntity();
|
||||
temp_v0 = func_8019AF08(self, g_EntityArray);
|
||||
temp_v0 = func_8019AF08(self, g_Entities);
|
||||
temp_s0 = func_8019AF88(0x10, self->ext.generic.unkA2, temp_v0);
|
||||
self->accelerationX = rcos(temp_s0) * 0x38;
|
||||
self->accelerationY = rsin(temp_s0) * 0x38;
|
||||
@ -240,7 +240,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -344,7 +345,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -352,7 +354,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -382,7 +385,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -390,7 +394,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -519,7 +524,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -174,7 +174,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -280,7 +281,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -288,7 +290,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -318,7 +321,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -326,7 +330,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -525,7 +530,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -19,12 +19,11 @@ void func_8019344C(void);
|
||||
// OFFSET FIXED
|
||||
extern u8 D_8003BEE8[];
|
||||
extern Entity* g_CurrentEntity;
|
||||
extern Entity g_EntityArray[];
|
||||
extern Entity g_Entities[];
|
||||
extern Entity D_8007D858[];
|
||||
extern Entity D_8007EF1C;
|
||||
extern s32 D_80097410;
|
||||
extern s32 D_80097414;
|
||||
extern Entity D_800762D8[];
|
||||
extern s32 D_800973FC;
|
||||
|
||||
// TODO FIX
|
||||
|
@ -8,7 +8,7 @@ void EntityPushAlucard(Entity* entity) {
|
||||
switch (entity->step) {
|
||||
case 0:
|
||||
InitializeEntity(&D_80180AD0);
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 1;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 1;
|
||||
*D_80072EF4 = 0;
|
||||
D_80072EFC = 255;
|
||||
player->posX.i.hi = 0;
|
||||
@ -20,7 +20,7 @@ void EntityPushAlucard(Entity* entity) {
|
||||
case 1:
|
||||
player->posX.val += 0x60000;
|
||||
if (roomLayout->unkA > 0x800) {
|
||||
g_EntityArray[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 0;
|
||||
g_Entities[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 0;
|
||||
*D_80072EF4 = 0x2000;
|
||||
entity->step++;
|
||||
}
|
||||
@ -97,7 +97,7 @@ void EntityUnkId53(Entity* entity) {
|
||||
return;
|
||||
}
|
||||
InitializeEntity(&D_80180AD0);
|
||||
g_EntityArray[1].unk7C.S8.unk0 = 1;
|
||||
g_Entities[1].unk7C.S8.unk0 = 1;
|
||||
*D_80072EF4 = 0x2000;
|
||||
D_80072EFC = 0xFF;
|
||||
player->posX.i.hi = 8;
|
||||
|
@ -329,7 +329,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -433,7 +434,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -441,7 +443,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -471,7 +474,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -479,7 +483,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -662,7 +667,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -1149,7 +1149,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -1253,7 +1254,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1261,7 +1263,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -1291,7 +1294,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1299,7 +1303,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -1401,7 +1406,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -1081,8 +1081,7 @@ void EntityMerman2(Entity* self) {
|
||||
temp_s0 = temp_s0_2 - 64;
|
||||
if (temp_s0 <= 0x280) {
|
||||
temp2 = 496;
|
||||
newEntity =
|
||||
AllocEntity(&g_EntityArray[160], &g_EntityArray[170]);
|
||||
newEntity = AllocEntity(&g_Entities[160], &g_Entities[170]);
|
||||
if (newEntity != 0) {
|
||||
if (Random() & 1) {
|
||||
CreateEntityFromCurrentEntity(0x32, newEntity);
|
||||
|
@ -188,7 +188,7 @@ void EntityLeftSecretRoomWall(Entity* self, u16* tileLayoutPtr, s32 tilePos) {
|
||||
tilePos += 0x10;
|
||||
}
|
||||
|
||||
newEntity = AllocEntity(&g_EntityArray[224], &g_EntityArray[256]);
|
||||
newEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
|
||||
if (newEntity != NULL) {
|
||||
CreateEntityFromEntity(2, self, newEntity);
|
||||
newEntity->subId = 0x13;
|
||||
@ -201,8 +201,7 @@ void EntityLeftSecretRoomWall(Entity* self, u16* tileLayoutPtr, s32 tilePos) {
|
||||
g_api.func_800F1FC4(0x81);
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
newEntity =
|
||||
AllocEntity(&g_EntityArray[224], &g_EntityArray[256]);
|
||||
newEntity = AllocEntity(&g_Entities[224], &g_Entities[256]);
|
||||
if (newEntity != NULL) {
|
||||
CreateEntityFromEntity(0x22, self, newEntity);
|
||||
newEntity->posX.i.hi += (Random() & 0xF);
|
||||
@ -1669,7 +1668,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -1734,7 +1734,8 @@ void Update(void) {
|
||||
|
||||
void func_801B9800(void) {
|
||||
Entity* entity;
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -1798,7 +1799,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1806,7 +1808,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -1836,7 +1839,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1844,7 +1848,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -2065,7 +2070,7 @@ void DestroyEntity(Entity* self) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -98,8 +98,8 @@ void EntitySubWeaponContainer(Entity* self) {
|
||||
}
|
||||
|
||||
for (i = 0; i < 96; i++) { // Spawn falling liquid
|
||||
newEntity = AllocEntity(&g_EntityArray[UNK_ENTITY_51],
|
||||
&g_EntityArray[UNK_ENTITY_100]);
|
||||
newEntity = AllocEntity(&g_Entities[UNK_ENTITY_51],
|
||||
&g_Entities[UNK_ENTITY_100]);
|
||||
if (newEntity != NULL) {
|
||||
CreateEntityFromEntity(0x3B, self, newEntity);
|
||||
rndPosX = (Random() & 0x1F) - 16;
|
||||
|
@ -55,7 +55,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
func_8018BD58(entity, layoutObj);
|
||||
}
|
||||
@ -63,7 +64,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
func_8018BD58(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -93,7 +95,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
func_8018BD58(entity, layoutObj);
|
||||
}
|
||||
@ -101,7 +104,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
func_8018BD58(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@ s32 AnimateEntity(const u8 frames[], Entity* entity) {
|
||||
INCLUDE_ASM("asm/us/st/sel/nonmatchings/2D260", func_801B4C68);
|
||||
|
||||
void func_801B4D78(void) {
|
||||
Entity* e = &g_EntityArray[UNK_ENTITY_3];
|
||||
Entity* e = &g_Entities[UNK_ENTITY_3];
|
||||
|
||||
if (e->step == 0) {
|
||||
e->animSet = -0x7FFF;
|
||||
@ -1045,7 +1045,7 @@ void func_801B4D78(void) {
|
||||
}
|
||||
|
||||
void func_801B4DE0(void) {
|
||||
Entity* unkEntity = &g_EntityArray[UNK_ENTITY_2];
|
||||
Entity* unkEntity = &g_Entities[UNK_ENTITY_2];
|
||||
s16 firstPolygonIndex;
|
||||
POLY_GT4* poly;
|
||||
|
||||
@ -1102,7 +1102,7 @@ void func_801B4DE0(void) {
|
||||
}
|
||||
|
||||
void func_801B4FFC(void) {
|
||||
Entity* unkEntity = &g_EntityArray[UNK_ENTITY_2];
|
||||
Entity* unkEntity = &g_Entities[UNK_ENTITY_2];
|
||||
s16 firstPolygonIndex;
|
||||
POLY_GT4* poly;
|
||||
|
||||
@ -1150,7 +1150,7 @@ void func_801B4FFC(void) {
|
||||
INCLUDE_ASM("asm/us/st/sel/nonmatchings/2D260", func_801B519C);
|
||||
|
||||
void func_801B5350(void) {
|
||||
Entity* entity = &g_EntityArray[UNK_ENTITY_5];
|
||||
Entity* entity = &g_Entities[UNK_ENTITY_5];
|
||||
|
||||
switch (entity->step) {
|
||||
case 0:
|
||||
@ -1186,7 +1186,7 @@ void func_801B5350(void) {
|
||||
}
|
||||
|
||||
void func_801B54C8(void) {
|
||||
Entity* e = &g_EntityArray[UNK_ENTITY_7];
|
||||
Entity* e = &g_Entities[UNK_ENTITY_7];
|
||||
|
||||
if (e->step == 0) {
|
||||
e->animSet = -0x7FFE;
|
||||
@ -1202,7 +1202,7 @@ void func_801B54C8(void) {
|
||||
}
|
||||
|
||||
void func_801B5548(void) {
|
||||
Entity* e = &g_EntityArray[UNK_ENTITY_7];
|
||||
Entity* e = &g_Entities[UNK_ENTITY_7];
|
||||
|
||||
if (e->step == 0) {
|
||||
e->animSet = -0x7FFE;
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "sel.h"
|
||||
|
||||
void func_801B4B9C(Entity* entity, s16 step);
|
||||
extern u16 D_800737B0; // g_EntityArray[5].step
|
||||
extern u16 D_800737D4; // g_EntityArray[5].animFrameIdx
|
||||
extern u16 D_800737B0; // g_Entities[5].step
|
||||
extern u16 D_800737D4; // g_Entities[5].animFrameIdx
|
||||
extern u8 D_80180538[]; // animation frames
|
||||
extern u8 D_80180554[]; // more animation frames
|
||||
extern s32 D_801BC3E8;
|
||||
|
||||
void func_801B585C(u16 arg0) {
|
||||
Entity* e = &g_EntityArray[UNK_ENTITY_5];
|
||||
Entity* e = &g_Entities[UNK_ENTITY_5];
|
||||
|
||||
switch (e->step) {
|
||||
case 0:
|
||||
@ -78,7 +78,7 @@ extern s8 D_8018BC4A;
|
||||
extern s8 D_8018BC50;
|
||||
|
||||
void func_801B5A7C(void) {
|
||||
Entity* e = &g_EntityArray[8];
|
||||
Entity* e = &g_Entities[8];
|
||||
|
||||
switch (e->subId) {
|
||||
case 0:
|
||||
@ -112,8 +112,8 @@ void func_801B5A7C(void) {
|
||||
D_800737B0 = 2;
|
||||
D_800737D4 = 0;
|
||||
} while (0);
|
||||
g_EntityArray[5].animFrameDuration = 0;
|
||||
g_EntityArray[5].facing = 1;
|
||||
g_Entities[5].animFrameDuration = 0;
|
||||
g_Entities[5].facing = 1;
|
||||
e->step++;
|
||||
break;
|
||||
|
||||
@ -367,7 +367,7 @@ void func_801B60D4(void) {
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ent = g_EntityArray;
|
||||
ent = g_Entities;
|
||||
for (i = 0; i < 9; i++) {
|
||||
DestroyEntity(ent);
|
||||
ent++;
|
||||
@ -375,7 +375,7 @@ void func_801B60D4(void) {
|
||||
|
||||
D_801D6B24 = 0;
|
||||
D_801BD030 = 0;
|
||||
g_EntityArray[8].subId = D_800978B4 - 1;
|
||||
g_Entities[8].subId = D_800978B4 - 1;
|
||||
g_api.func_800EA5E4(0x16);
|
||||
g_api.func_800EA5E4(0);
|
||||
g_api.func_800EA5E4(0x8005);
|
||||
@ -384,7 +384,7 @@ void func_801B60D4(void) {
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ent4 = &g_EntityArray[4];
|
||||
ent4 = &g_Entities[4];
|
||||
func_801B5A7C();
|
||||
func_801B69F8(ent4);
|
||||
func_801B4C68();
|
||||
@ -403,7 +403,7 @@ void func_801B60D4(void) {
|
||||
}
|
||||
|
||||
if (D_801BD030 != 0) {
|
||||
ent = g_EntityArray;
|
||||
ent = g_Entities;
|
||||
for (i = 0; i < 9; i++) {
|
||||
DestroyEntity(ent);
|
||||
ent++;
|
||||
@ -434,9 +434,9 @@ void func_801B60D4(void) {
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ent4 = &g_EntityArray[4];
|
||||
ent4 = &g_Entities[4];
|
||||
if (func_801B79D4(ent4) != 0) {
|
||||
g_EntityArray[1].step = 0;
|
||||
g_Entities[1].step = 0;
|
||||
D_801BC3E4 = 1;
|
||||
D_8003C9A4++;
|
||||
}
|
||||
|
@ -671,7 +671,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -775,7 +776,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -783,7 +785,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -813,7 +816,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -821,7 +825,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -945,7 +950,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
@ -1818,7 +1818,8 @@ void Update(void) {
|
||||
}
|
||||
}
|
||||
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -1883,7 +1884,8 @@ void Update(void) {
|
||||
|
||||
void func_80188514(void) {
|
||||
Entity* entity;
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
for (entity = &g_Entities[STAGE_ENTITY_START];
|
||||
entity < &g_Entities[TOTAL_ENTITY_COUNT]; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
@ -1949,7 +1951,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1957,7 +1960,8 @@ void CreateEntityWhenInVerticalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -1987,7 +1991,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
|
||||
switch (layoutObj->objectId & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
if (entity->objectId == 0) {
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
}
|
||||
@ -1995,7 +2000,8 @@ void CreateEntityWhenInHorizontalRange(LayoutObject* layoutObj) {
|
||||
case 0x8000:
|
||||
break;
|
||||
case 0xA000:
|
||||
entity = &D_800762D8[(u8)layoutObj->objectRoomIndex];
|
||||
entity =
|
||||
&g_Entities[STAGE_ENTITY_START + (u8)layoutObj->objectRoomIndex];
|
||||
CreateEntityFromLayout(entity, layoutObj);
|
||||
break;
|
||||
}
|
||||
@ -2223,7 +2229,7 @@ void DestroyEntity(Entity* item) {
|
||||
}
|
||||
|
||||
void DestroyEntityFromIndex(s16 index) {
|
||||
Entity* entity = &g_EntityArray[index];
|
||||
Entity* entity = &g_Entities[index];
|
||||
|
||||
while (entity < &D_8007EF1C) {
|
||||
DestroyEntity(entity);
|
||||
|
Loading…
Reference in New Issue
Block a user