Skip to content

Commit

Permalink
NZ0 data import and code refactor (Xeeynamo#1494)
Browse files Browse the repository at this point in the history
plus some minor edits to link the stage
  • Loading branch information
Xeeynamo authored Aug 9, 2024
1 parent e2ca7ee commit 551f3c8
Show file tree
Hide file tree
Showing 37 changed files with 2,324 additions and 2,006 deletions.
72 changes: 40 additions & 32 deletions config/splat.us.stnz0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,27 @@ segments:
- [0x164, .data, header] # layers
- [0x47C, data]
- [0x8EC, .data, e_laydef] # layout entries header
- [0xA94, data]
- [0xA94, .data, e_init]
- [0xDBC, data]
- [0xDE4, .data, e_breakable]
- [0xE54, data]
- [0x1574, .data, st_update]
- [0x15A0, .data, collision]
- [0x1960, .data, e_red_door]
- [0x1978, data]
- [0x1978, .data, st_common]
- [0x1B78, .data, e_collect]
- [0x1E68, .data, entity_relic_orb]
- [0x1ECC, data]
- [0x1F80, .data, e_particles]
- [0x2000, .data, e_room_fg]
- [0x208C, data]
- [0x20B0, data]
- [0x2220, data]
- [0x2600, data]
- [0x2710, data]
- [0x208C, .data, e_bone_scimitar]
- [0x2180, .data, e_axe_knight]
- [0x22D4, .data, e_bloody_zombie]
- [0x23DC, .data, e_skeleton]
- [0x24CC, data] # spittle bone
- [0x2584, data] # subweapon container
- [0x2610, data] # bloody skeleton
- [0x26B8, data] # magically sealed door
- [0x272C, .data, rooms]
- [0x2830, data, D_80182830]
- [0x2884, .data, e_layout] # layout entries data
Expand All @@ -59,46 +66,47 @@ segments:
- [0x20A5C, .data, tile_data] # tile definitions
- [0x26E8C, .data, sprites]
- [0x3058C, rodata]
- [0x305A4, .rodata, 30958] # func_801B3C38
- [0x305A4, .rodata, 311C0] # EntityWargExplosionPuffOpaque
- [0x305B8, .rodata, bossfight] # EntityBossFightManager
- [0x305E8, .rodata, bossfight] # EntityBossRoomBlock
- [0x305FC, .rodata, slogra] # EntitySlogra
- [0x30618, .rodata, gaibon] # EntityGaibon .rodata, 33FCC
- [0x3063C, .rodata, 36DE4] # func_801B7034
- [0x3063C, .rodata, e_elevator] # func_801B7034
- [0x3064C, rodata]
- [0x30664, .rodata, mariacutscene]
- [0x306E8, .rodata, maria]
- [0x30728, .rodata, e_red_door] # EntityRedDoor
- [0x30728, .rodata, e_red_door]
- [0x30740, .rodata, e_collect] # CollectGold text
- [0x30790, .rodata, e_collect] # EntityPrizeDrop
- [0x307B0, .rodata, e_collect] # EntityEquipItemDrop
- [0x307C8, .rodata, entity_relic_orb]
- [0x30800, .rodata, entity_message_box]
- [0x30814, .rodata, 43708] # EntityBoneScimitar
- [0x30834, .rodata, 43F9C] # EntityAxeKnight
- [0x30858, .rodata, 44EAC] # EntityBloodyZombie
- [0x30880, .rodata, 45F2C] # EntitySkeleton
- [0x3089C, .rodata, 4672C] # EntitySpittleBone
- [0x308C8, .rodata, 47048] # EntitySubWeaponContainer
- [0x308D4, .rodata, 47958] # EntityBloodSkeleton
- [0x308E8, .rodata, 47CF0] # EntityMagicallySealedDoor
- [0x30900, .rodata, e_stage_name] # EntityStageNamePopup
- [0x30814, .rodata, e_bone_scimitar]
- [0x30834, .rodata, e_axe_knight]
- [0x30858, .rodata, e_bloody_zombie]
- [0x30880, .rodata, e_skeleton]
- [0x3089C, .rodata, e_spittle_bone]
- [0x308C8, .rodata, e_subweapon_container]
- [0x308D4, .rodata, e_bloody_skeleton]
- [0x308E8, .rodata, e_magically_sealed_door]
- [0x30900, .rodata, e_stage_name]
- [0x30934, .rodata, prim_helpers]
- [0x3093C, .rodata, lifeupspawn]
- [0x30958, c]
- [0x30EEC, c, e_breakable]
- [0x311C0, c]
- [0x33FCC, c, bossfight] # Slogra & Gaibon Boss
- [0x34690, c, slogra]
- [0x35778, c, gaibon]
- [0x36DE4, c]
- [0x37034, c, e_elevator]
- [0x374CC, c, mariacutscene]
- [0x38E0C, c, maria]
- [0x394D4, c, random]
- [0x39504, c, update]
- [0x39800, c, update_stage_entities]
- [0x394D4, c, st_update]
- [0x39908, c, collision]
- [0x3B0C4, c, create_entity]
- [0x3BC3C, c, e_red_door]
- [0x3C8EC, c, 3C8EC]
- [0x3C8EC, c, st_common]
- [0x3D848, c, e_collect]
- [0x3F308, c, blit_char]
- [0x3F5B8, c, entity_relic_orb]
Expand All @@ -108,15 +116,15 @@ segments:
- [0x42AA8, c, e_particles]
- [0x432EC, c, e_room_fg]
- [0x433d8, c, popup]
- [0x43708, c] # EntityBoneScimitar
- [0x43F9C, c] # EntityAxeKnight
- [0x44EAC, c] # EntityBloodyZombie
- [0x45F2C, c] # EntitySkeleton
- [0x4672C, c] # EntitySpittleBone
- [0x47048, c] # EntitySubWeaponContainer
- [0x47958, c] # EntityBloodSkeleton
- [0x47CF0, c] # EntityMagicallySealedDoor
- [0x48ADC, c, e_stage_name] # EntityStageNamePopup
- [0x43708, c, e_bone_scimitar]
- [0x43F9C, c, e_axe_knight]
- [0x44EAC, c, e_bloody_zombie]
- [0x45F2C, c, e_skeleton]
- [0x4672C, c, e_spittle_bone]
- [0x47048, c, e_subweapon_container]
- [0x47958, c, e_bloody_skeleton]
- [0x47CF0, c, e_magically_sealed_door]
- [0x48ADC, c, e_stage_name]
- [0x49930, c, prim_helpers]
- [0x4A160, c, lifeupspawn]
- [0x4AA14, .bss, bss]
Expand Down
58 changes: 0 additions & 58 deletions config/symbols.us.stnz0.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
g_EntityGfxs = 0x80180888;
PfnEntityUpdates = 0x80180A94;
g_InitializeData0 = 0x80180BD4;
g_InitializeEntityData0 = 0x80180BE0;
g_EInitGeneric = 0x80180BF8;
g_InitDataEnt13 = 0x80180C04;
g_eInitGeneric2 = 0x80180C1C;
g_eDamageDisplayInit = 0x80180C28;
g_eRedDoorTiles = 0x80180D8C;
g_CallElevator = 0x80180EEC;
g_BossFlag = 0x80181010;
g_ElevatorTarget = 0x801813A4;
g_ElevatorTargetPos = 0x801813A8;
UNK_Invincibility0 = 0x80181574;
g_eUnk14SpawnRots = 0x80181ECC;
unk15_rot = 0x80181EDC;
unk15_yVel = 0x80181EEC;
Expand All @@ -23,59 +14,10 @@ g_UnkRecursPrimVecOrder = 0x80181F40;
g_UnkRecursPrim2Inds = 0x80181F60;
g_eBlueDoorUV = 0x801826B8;
g_eBlueDoorTiles = 0x801826D0;
EntityBreakable = 0x801B0EEC;
EntityRedEyeBust = 0x801B11C0;
EntityPurpleBrickScrollingBackground = 0x801B12E8;
EntityLeftSecretRoomWall = 0x801B14C4;
EntityBottomSecretRoomFloor = 0x801B1770;
EntityMoveableBox = 0x801B20CC;
EntityCannonLever = 0x801B23B4;
EntityCannon = 0x801B25C4;
EntityCannonShot = 0x801B2874;
EntityCannonWall = 0x801B2978;
EntityElevator2 = 0x801B2D08;
EntityFloorSpikes = 0x801B3294;
EntityTableWithGlobe = 0x801B3534;
EntityWargExplosionPuffOpaque = 0x801B3C38;
EntityBossFightManager = 0x801B3FCC;
EntityBossRoomBlock = 0x801B4518;
EntitySlogra = 0x801B4778;
EntitySlograSpear = 0x801B54A8;
EntitySlograSpearProjectile = 0x801B5654;
EntityGaibon = 0x801B5778;
EntitySmallGaibonProjectile = 0x801B6AAC;
EntityLargeGaibonProjectile = 0x801B6BBC;
EntityElevator = 0x801B7034;
EntityMariaCutscene = 0x801B7D58;
EntityMaria = 0x801B8F94;
EntityDamageDisplay = 0x801BAA20;
EntityRedDoor = 0x801BBCB4;
EntityDummy = 0x801BD6F8;
EntityPrizeDrop = 0x801BE30C;
EntityExplosion = 0x801BEB80;
EntityEquipItemDrop = 0x801BED20;
EntityRelicOrb = 0x801BF5B8;
EntityHeartDrop = 0x801C0088;
EntityMessageBox = 0x801C01B0;
EntityUnkId13 = 0x801C07FC;
EntityUnkId14 = 0x801C0B24;
EntityUnkId15 = 0x801C0C14;
EntityIntenseExplosion = 0x801C15B4;
EntitySoulStealOrb = 0x801C2AA8;
EntityEnemyBlood = 0x801C2E3C;
EntityRoomForeground = 0x801C32EC;
EntityBoneScimitar = 0x801C37E4;
EntityBoneScimitarParts = 0x801C3E94;
EntityAxeKnight = 0x801C45BC;
EntityAxeKnightThrowingAxe = 0x801C4D18;
EntityBloodSplatter = 0x801C4EAC;
EntityBloodyZombie = 0x801C5568;
EntitySkeleton = 0x801C5FC4;
EntitySpittleBone = 0x801C672C;
EntityRotateSpittlebone = 0x801C6B24;
EntitySpittleBoneSpit = 0x801C6C6C;
EntitySubWeaponContainer = 0x801C7048;
EntityBloodSkeleton = 0x801C7958;
EntityMagicallySealedDoor = 0x801C7D68;
EntityStageNamePopup = 0x801C8CAC;
EntityLifeUpSpawn = 0x801CA160;
7 changes: 5 additions & 2 deletions src/st/cen/14264.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "cen.h"

#include "../entity.h"
#include "sfx.h"

#include "../../destroy_entity.h"
#include "../../destroy_entities_from_index.h"
#include "../prevent_entity_from_respawning.h"
#include "../animate_entity.h"

u8 func_8019444C(u8 frames[], Entity* self, u8 arg2) {
u16 animFrameStart = self->animFrameIdx * 2;
u8* var_s1 = &frames[animFrameStart];
Expand Down
35 changes: 4 additions & 31 deletions src/st/cen/entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,37 +147,10 @@ ObjInit2 D_80180490 = {
.unk10 = &D_8018048C,
};

u16 g_eRedDoorTiles[3][8] = {
{
0x039C,
0x039B,
0x039C,
0x039B,
0x010D,
0x010B,
0x010D,
0x010B,
},
{
0x03A3,
0x03A4,
0x03A5,
0x03A6,
0x02F4,
0x0309,
0x0305,
0x0307,
},
{
0x03A3,
0x03A7,
0x03A8,
0x03A3,
0x02F4,
0x030F,
0x0310,
0x02F4,
},
u16 g_eRedDoorTiles[][8] = {
{0x039C, 0x039B, 0x039C, 0x039B, 0x010D, 0x010B, 0x010D, 0x010B},
{0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x02F4, 0x0309, 0x0305, 0x0307},
{0x03A3, 0x03A7, 0x03A8, 0x03A3, 0x02F4, 0x030F, 0x0310, 0x02F4},
};

u8 D_801804D4[] = {32, 32, 32, 32, 32, 32, 80, 32};
Expand Down
7 changes: 5 additions & 2 deletions src/st/dre/1A3A8.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "dre.h"

#include "../entity.h"
#include "sfx.h"

#include "../../destroy_entity.h"
#include "../../destroy_entities_from_index.h"
#include "../prevent_entity_from_respawning.h"
#include "../animate_entity.h"

u8 func_8019A590(u8 frames[], Entity* self, u8 arg2) {
u16 animFrameStart = self->animFrameIdx * 2;
u8* var_s1 = &frames[animFrameStart];
Expand Down
19 changes: 6 additions & 13 deletions src/st/e_breakable.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@
static u8 D_801805A8[] = {4, 1, 4, 2, 0, 0, 0, 0};
static u8 D_801805B0[] = {4, 0, 4, 0, 0, 0, 0, 0};
static u8* g_eBreakableAnimations[] = {
D_801805A8, D_801805B0, NULL, NULL, NULL, NULL, NULL, NULL,
};
static u8 g_eBreakableHitboxes[] = {
8, 8, 0, 0, 0, 0, 0, 0,
};
D_801805A8, D_801805B0, NULL, NULL, NULL, NULL, NULL, NULL};
static u8 g_eBreakableHitboxes[] = {8, 8, 0, 0, 0, 0, 0, 0};

#ifndef VERSION_PSP // on PSP this is in the BSS section, not data
static u8 g_eBreakableExplosionTypes[] = {
0, 0, 0, 0, 0, 0, 0, 0,
};
static u8 g_eBreakableExplosionTypes[] = {0, 0, 0, 0, 0, 0, 0, 0};
#else
extern u8 g_eBreakableExplosionTypes[];
#endif

static u16 g_eBreakableanimSets[] = {
3, 3, 0, 0, 0, 0, 0, 0,
};
ANIMSET_DRA(3), ANIMSET_DRA(3), 0, 0, 0, 0, 0, 0};
static u8 g_eBreakableDrawModes[] = {
DRAW_TPAGE | DRAW_TPAGE2 | DRAW_UNK_40,
DRAW_TPAGE | DRAW_TPAGE2,
Expand All @@ -29,8 +23,7 @@ static u8 g_eBreakableDrawModes[] = {
DRAW_DEFAULT,
DRAW_DEFAULT,
DRAW_DEFAULT,
DRAW_DEFAULT,
};
DRAW_DEFAULT};

#ifndef VERSION_PSP
// on PSP this might be either optimised out to BSS or completely removed
Expand Down Expand Up @@ -60,7 +53,7 @@ void EntityBreakable(Entity* entity) {
}
} else {
InitializeEntity(g_eBreakableInit);
entity->zPriority = g_unkGraphicsStruct.g_zEntityCenter.unk - 0x14;
entity->zPriority = g_unkGraphicsStruct.g_zEntityCenter.unk - 20;
entity->drawMode = g_eBreakableDrawModes[breakableType];
entity->hitboxHeight = g_eBreakableHitboxes[breakableType];
entity->animSet = g_eBreakableanimSets[breakableType];
Expand Down
5 changes: 0 additions & 5 deletions src/st/entity.h

This file was deleted.

7 changes: 5 additions & 2 deletions src/st/mad/11D3C.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "mad.h"

#include "../entity.h"
#include "sfx.h"

#include "../../destroy_entity.h"
#include "../../destroy_entities_from_index.h"
#include "../prevent_entity_from_respawning.h"
#include "../animate_entity.h"

u8 func_80191F24(u8 frames[], Entity* self, u8 arg2) {
u16 animFrameStart = self->animFrameIdx * 2;
u8* var_s1 = &frames[animFrameStart];
Expand Down
7 changes: 5 additions & 2 deletions src/st/no3/44C64.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "no3.h"

#include "../entity.h"
#include "sfx.h"

#include "../../destroy_entity.h"
#include "../../destroy_entities_from_index.h"
#include "../prevent_entity_from_respawning.h"
#include "../animate_entity.h"

u8 func_801C4E4C(u8 frames[], Entity* self, u8 arg2) {
u16 animFrameStart = self->animFrameIdx * 2;
u8* var_s1 = &frames[animFrameStart];
Expand Down
2 changes: 1 addition & 1 deletion src/st/np3/e_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ ObjInit2 D_80180C10[] = {
{0x8001, 0x0039, 0x0000, 0x0000, 0x00, 0x00, 0x00000000, D_80180C04},
};

u16 g_eRedDoorTiles[2][8] = {
u16 g_eRedDoorTiles[][8] = {
{0x06C7, 0x04FA, 0x04FA, 0x04FA, 0x030F, 0x0000, 0x0000, 0x0000},
{0x04FA, 0x04FA, 0x04FA, 0x04FA, 0x0000, 0x0000, 0x0000, 0x0000},
};
5 changes: 4 additions & 1 deletion src/st/np3/st_common.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "np3.h"

#include "../entity.h"
#include "../../destroy_entity.h"
#include "../../destroy_entities_from_index.h"
#include "../prevent_entity_from_respawning.h"
#include "../animate_entity.h"

u8 func_801BC6BC(u8 frames[], Entity* self, u8 arg2) {
u16 animFrameStart = self->animFrameIdx * 2;
Expand Down
Loading

0 comments on commit 551f3c8

Please sign in to comment.