More dedupes (#1556)

This commit is contained in:
sozud 2024-08-20 20:57:18 -07:00 committed by GitHub
parent 283538a313
commit 6b4254b2fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 85 additions and 190 deletions

View File

@ -103,7 +103,7 @@ g_InitializeData0 = 0x09246EA0;
g_InitializeEntityData0 = 0x09246EB0;
g_EInitGeneric = 0x09246EC0;
g_InitDataEnt13 = 0x09246ED0;
D_80180488 = 0x09246EE0;
g_EntityUnkId12Init = 0x09246EE0;
g_eInitGeneric2 = 0x09246EF0;
g_eDamageDisplayInit = 0x09246F00;
g_EInitSmallRocks = 0x09246F10;
@ -114,8 +114,8 @@ g_eBreakableanimSets = 0x09246FD8;
g_eBreakableDrawModes = 0x09246FE8;
g_StageOverlay = 0x0924B960;
D_801804E0 = 0x0924B9B8;
D_80180528 = 0x0924B9E0;
D_80180538 = 0x0924B9E8;
g_EntityUnkId12Hitbox = 0x0924B9E0;
g_EntityUnkId12TilemapProps = 0x0924B9E8;
D_80180608_wrp = 0x0924BA58;
WarpRoomCoords = 0x0924BA98;
D_80186E30 = 0x0924BAB0;
@ -128,7 +128,7 @@ g_LayoutObjVertical = 0x0924BC10;
g_LayoutObjHorizontal = 0x0924BC18;
g_eBreakableExplosionTypes = 0x0924BCC8;
D_80180608 = 0x0924CCD0;
D_80180530 = 0x0924CCD8;
g_EntityUnkId12Data = 0x0924CCD8;
D_80180648 = 0x0924CCE0;
WarpBackgroundBrightness = 0x0924CCE8;
WarpBackgroundPhase = 0x0924CCF0;

View File

@ -33,67 +33,12 @@ void EntityBackgroundBlock(Entity* self) {
AnimateEntity(obj->unk10, self);
}
extern u16 D_801804E4[];
extern u16 D_8018044C[];
extern u8 D_801804DC[];
extern u8 D_801804D4[];
extern u16 g_EntityUnkId12TilemapProps[];
extern u16 g_EntityUnkId12Init[];
extern u8 g_EntityUnkId12Data[];
extern u8 g_EntityUnkId12Hitbox[];
void EntityUnkId12(Entity* entity) {
s32 ret;
u16* temp_v0_2;
u16 temp_s1 = entity->params;
u16 phi_v1;
u16 unk;
entity->unk6D[0] = 0;
if (entity->step != 0) {
switch (temp_s1) {
case 4:
case 5:
if (g_Tilemap.x != 0) {
return;
}
break;
case 6:
if (g_pads->pressed & PAD_TRIANGLE) {
g_Tilemap.x = 0;
g_Tilemap.width = 1280;
entity->step++;
return;
}
break;
}
if (entity->unk44 != 0) {
ret = GetSideToPlayer();
phi_v1 = entity->ext.generic.unk7C.s;
if (phi_v1 != 0) {
phi_v1 = (ret & 2) * 2;
} else {
phi_v1 = (ret & 1) * 4;
}
unk = 8;
temp_s1 = (temp_s1 * unk) + phi_v1;
temp_v0_2 = &D_801804E4[temp_s1];
g_Tilemap.x = *(temp_v0_2++);
g_Tilemap.y = *(temp_v0_2++);
g_Tilemap.width = *(temp_v0_2++);
g_Tilemap.height = *(temp_v0_2++);
}
} else {
InitializeEntity(D_8018044C);
entity->ext.generic.unk7C.s = D_801804DC[temp_s1];
if (entity->ext.generic.unk7C.s != 0) {
entity->hitboxWidth = D_801804D4[temp_s1];
entity->hitboxHeight = 16;
} else {
entity->hitboxWidth = 16;
entity->hitboxHeight = D_801804D4[temp_s1];
}
}
}
#include "../entity_unk_id12.h"
void EntityUnkId01(Entity* self) {
Entity* newEntity;

View File

@ -94,7 +94,7 @@ EntityInit g_InitDataEnt13 = {
.enemyId = 2,
};
EntityInit D_8018044C = {
EntityInit g_EntityUnkId12Init = {
.animSet = ANIMSET_DRA(0),
.animCurFrame = 0,
.unk5A = 0,
@ -153,10 +153,10 @@ u16 g_eRedDoorTiles[][8] = {
{0x03A3, 0x03A7, 0x03A8, 0x03A3, 0x02F4, 0x030F, 0x0310, 0x02F4},
};
u8 D_801804D4[] = {32, 32, 32, 32, 32, 32, 80, 32};
u8 D_801804DC[] = {0, 0, 0, 0, 0, 0, 0, 0};
u8 g_EntityUnkId12Hitbox[] = {32, 32, 32, 32, 32, 32, 80, 32};
u8 g_EntityUnkId12Data[] = {0, 0, 0, 0, 0, 0, 0, 0};
u16 D_801804E4[] = {
u16 g_EntityUnkId12TilemapProps[] = {
0x0000, 0x0000, 0x0600, 0x0100, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x01FC, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x0300, 0x0000, 0x00FC, 0x0600, 0x01FC,

53
src/st/entity_unk_id12.h Normal file
View File

@ -0,0 +1,53 @@
void EntityUnkId12(Entity* entity) {
u16 var_s0;
u16 params;
u16* tilemapProps;
entity->unk6D[0] = 0;
params = entity->params;
if (entity->step) {
switch (params) {
case 4:
case 5:
if (g_Tilemap.x) {
return;
}
break;
case 6:
if (g_pads->pressed & PAD_TRIANGLE) {
g_Tilemap.x = 0;
g_Tilemap.width = 1280;
entity->step++;
return;
}
break;
}
if (entity->unk44) {
var_s0 = GetSideToPlayer();
if (entity->ext.generic.unk7C.u) {
var_s0 &= 2;
var_s0 *= 2;
} else {
var_s0 &= 1;
var_s0 *= 4;
}
params = (params << 3) + var_s0;
tilemapProps = &g_EntityUnkId12TilemapProps[params];
g_Tilemap.x = *tilemapProps++;
g_Tilemap.y = *tilemapProps++;
g_Tilemap.width = *tilemapProps++;
g_Tilemap.height = *tilemapProps;
}
} else {
InitializeEntity(g_EntityUnkId12Init);
var_s0 = entity->ext.generic.unk7C.u = g_EntityUnkId12Data[params];
if (var_s0) {
entity->hitboxWidth = g_EntityUnkId12Hitbox[params];
entity->hitboxHeight = 16;
} else {
entity->hitboxWidth = 16;
entity->hitboxHeight = g_EntityUnkId12Hitbox[params];
}
}
}

View File

@ -192,7 +192,7 @@ u16 g_InitializeEntityData0[] = {0x0003, 0x0000, 0x0000, 0x0000, 0x0002};
u16 D_80180A60[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0004};
u16 g_EInitGeneric[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0005};
u16 g_InitDataEnt13[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0002};
u16 D_80180A84[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0001};
u16 g_EntityUnkId12Init[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0001};
u16 g_eInitGeneric2[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0003};
u16 g_eDamageDisplayInit[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0003};
u16 D_80180AA8[] = {0x8001, 0x0000, 0x0000, 0x0000, 0x0005};

View File

@ -100,7 +100,7 @@ extern u16 g_InitializeData0[];
extern u16 g_InitializeEntityData0[];
extern u16 D_80180A60[];
extern u16 g_EInitGeneric[];
extern u16 D_80180A84[];
extern u16 g_EntityUnkId12Init[];
extern u16 g_eInitGeneric2[];
extern u16 D_80180AB4[];
extern u16 D_80180AC0[];

View File

@ -20,9 +20,11 @@ void func_801B246C(Entity* self) {
AnimateEntity(objInit->unk10, self);
}
static u8 D_80180D98[] = {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x20};
static u8 D_80180DA0[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static u16 D_80180DA8[] = {
static u8 g_EntityUnkId12Hitbox[] = {
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x20};
static u8 g_EntityUnkId12Data[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static u16 g_EntityUnkId12TilemapProps[] = {
0x0000, 0x0000, 0x0600, 0x0100, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x01FC, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x0300, 0x0000, 0x00FC, 0x0600, 0x01FC,
@ -32,59 +34,4 @@ static u16 D_80180DA8[] = {
0x00F0, 0x01FC, 0x0310, 0x02FC, 0x00F0, 0x01FC, 0x0310, 0x02FC,
};
void EntityUnkId12(Entity* entity) {
s32 ret;
u16* temp_v0_2;
u16 temp_s1 = entity->params;
u16 phi_v1;
u16 unk;
entity->unk6D[0] = 0;
if (entity->step != 0) {
switch (temp_s1) {
case 4:
case 5:
if (g_Tilemap.x != 0) {
return;
}
break;
case 6:
if (g_pads->pressed & PAD_TRIANGLE) {
g_Tilemap.x = 0;
g_Tilemap.width = 1280;
entity->step++;
return;
}
break;
}
if (entity->unk44 != 0) {
ret = GetSideToPlayer();
phi_v1 = entity->ext.generic.unk7C.s;
if (phi_v1 != 0) {
phi_v1 = (ret & 2) * 2;
} else {
phi_v1 = (ret & 1) * 4;
}
unk = 8;
temp_s1 = (temp_s1 * unk) + phi_v1;
temp_v0_2 = &D_80180DA8[temp_s1];
g_Tilemap.x = *(temp_v0_2++);
g_Tilemap.y = *(temp_v0_2++);
g_Tilemap.width = *(temp_v0_2++);
g_Tilemap.height = *(temp_v0_2++);
}
} else {
InitializeEntity(D_80180A84);
entity->ext.generic.unk7C.s = D_80180DA0[temp_s1];
if (entity->ext.generic.unk7C.s != 0) {
entity->hitboxWidth = D_80180D98[temp_s1];
entity->hitboxHeight = 16;
} else {
entity->hitboxWidth = 16;
entity->hitboxHeight = D_80180D98[temp_s1];
}
}
}
#include "../entity_unk_id12.h"

View File

@ -52,7 +52,7 @@ u16 g_EInitGeneric[] = {
u16 g_InitDataEnt13[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000,
};
u16 D_80180488[] = {
u16 g_EntityUnkId12Init[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000,
};
u16 g_eInitGeneric2[] = {

View File

@ -53,7 +53,7 @@ u16 g_EInitGeneric[] = {
u16 g_InitDataEnt13[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000,
};
u16 D_80180488[] = {
u16 g_EntityUnkId12Init[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000,
};
u16 g_eInitGeneric2[] = {

View File

@ -1,14 +1,16 @@
#include "wrp.h"
static u8 D_80180528[] = {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x20};
static u8 g_EntityUnkId12Hitbox[] = {
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x20};
#ifndef VERSION_PSP // moved to BSS
static u8 D_80180530[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static u8 g_EntityUnkId12Data[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#else
extern u8 D_80180530[];
extern u8 g_EntityUnkId12Data[];
#endif
static u16 D_80180538[] = {
static u16 g_EntityUnkId12TilemapProps[] = {
0x0000, 0x0000, 0x0600, 0x0100, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x01FC, 0x0000, 0x0000, 0x0600, 0x01FC,
0x0000, 0x00FC, 0x0600, 0x0300, 0x0000, 0x00FC, 0x0600, 0x01FC,
@ -20,7 +22,7 @@ static u16 D_80180538[] = {
extern ObjInit D_801804E0[];
extern u16 g_eInitGeneric2[];
extern u16 D_80180488[];
extern u16 g_EntityUnkId12Init[];
void func_80186FD0(Entity* self) {
ObjInit* objInit = &D_801804E0[self->params];
@ -45,56 +47,4 @@ void func_80186FD0(Entity* self) {
AnimateEntity(objInit->unk10, self);
}
void EntityUnkId12(Entity* entity) {
u16 var_s0;
u16 params;
u16* tilemapProps;
entity->unk6D[0] = 0;
params = entity->params;
if (entity->step) {
switch (params) {
case 4:
case 5:
if (g_Tilemap.x) {
return;
}
break;
case 6:
if (g_pads->pressed & PAD_TRIANGLE) {
g_Tilemap.x = 0;
g_Tilemap.width = 1280;
entity->step++;
return;
}
break;
}
if (entity->unk44) {
var_s0 = GetSideToPlayer();
if (entity->ext.generic.unk7C.u) {
var_s0 &= 2;
var_s0 *= 2;
} else {
var_s0 &= 1;
var_s0 *= 4;
}
params = (params << 3) + var_s0;
tilemapProps = &D_80180538[params];
g_Tilemap.x = *tilemapProps++;
g_Tilemap.y = *tilemapProps++;
g_Tilemap.width = *tilemapProps++;
g_Tilemap.height = *tilemapProps;
}
} else {
InitializeEntity(D_80180488);
var_s0 = entity->ext.generic.unk7C.u = D_80180530[params];
if (var_s0) {
entity->hitboxWidth = D_80180528[params];
entity->hitboxHeight = 16;
} else {
entity->hitboxWidth = 16;
entity->hitboxHeight = D_80180528[params];
}
}
}
#include "../entity_unk_id12.h"

View File

@ -8,7 +8,7 @@ s32 WarpBackgroundBrightness;
s32 D_80180648;
// st_debug.c
u8 D_80180530[8];
u8 g_EntityUnkId12Data[8];
// e_misc.c
u8 D_80180608[8]; // different than the D_80180608 in warp.c ???