From 11631e1475691c68acacedd452c666a7364bd1ea Mon Sep 17 00:00:00 2001 From: Jonathan Hohle Date: Tue, 1 Oct 2024 22:31:18 -0700 Subject: [PATCH] Add CEN Overlay to HD (#1705) Adds the CEN overaly to the HD version of the game. Resolves #1638. This uses most, but not all, matching functions. Some were excluded because due to symbols mapping that has not bee completed yet. Not all data has been imported, and mapping symbols, and data should make many of the remaining functions easy to import. --- Makefile | 3 +- Makefile.psx.mk | 4 +- config/check.hd.sha | 3 + config/splat.hd.stcen.yaml | 90 ++++++++++++++++++++++++++++++ config/splat.us.stcen.yaml | 4 +- config/symbols.hd.stcen.txt | 106 ++++++++++++++++++++++++++++++++++++ src/st/cen/F890.c | 16 ++++-- src/st/cen/cen.h | 4 +- src/st/cen/create_entity.c | 33 +++++++++++ src/st/cen/cutscene.c | 36 ++++++++++++ src/st/cen/cutscene_data.c | 5 ++ src/st/cen/e_collect.c | 57 +++++++++++++++++++ src/st/cen/e_init.c | 4 +- src/st/cen/e_misc.c | 52 ++++++++++++++++++ src/st/cen/e_particles.c | 15 +++++ src/st/cen/e_stage_name.c | 8 +++ src/st/cen/popup.c | 2 - src/st/cen/prim_helpers.c | 1 - src/st/cen/tile_data.c | 8 +++ 19 files changed, 436 insertions(+), 15 deletions(-) create mode 100644 config/splat.hd.stcen.yaml create mode 100644 config/symbols.hd.stcen.txt diff --git a/Makefile b/Makefile index c1cf8b642..62cdacaa3 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ extract: extract_$(VERSION) build: ##@ build game files build: build_$(VERSION) build_us: main dra weapon ric cen dre mad no0 no3 np3 nz0 sel st0 wrp rwrp mar rbo3 tt_000 tt_001 -build_hd: dra $(BUILD_DIR)/WRP.BIN tt_000 +build_hd: dra cen wrp tt_000 clean: ##@ clean extracted files, assets, and build artifacts git clean -fdx assets/ git clean -fdx asm/$(VERSION)/ @@ -208,6 +208,7 @@ format-symbols: ./tools/symbols.py remove-orphans config/splat.us.ric.yaml ./tools/symbols.py remove-orphans config/splat.hd.ric.yaml ./tools/symbols.py remove-orphans config/splat.us.stcen.yaml + ./tools/symbols.py remove-orphans config/splat.hd.stcen.yaml ./tools/symbols.py remove-orphans config/splat.us.stdre.yaml ./tools/symbols.py remove-orphans config/splat.us.stno0.yaml ./tools/symbols.py remove-orphans config/splat.us.stno3.yaml diff --git a/Makefile.psx.mk b/Makefile.psx.mk index 123048e21..9017e66cb 100644 --- a/Makefile.psx.mk +++ b/Makefile.psx.mk @@ -11,7 +11,7 @@ PSX_RBOSTAGES := rbo3 PSX_ALLSTAGES := $(addprefix st,$(PSX_KSTAGES)) $(addprefix st,$(PSX_RSTAGES)) $(addprefix bo,$(PSX_BOSTAGES)) $(addprefix bo,$(PSX_RBOSTAGES)) PSX_SERVANTS := tt_000 tt_001 PSX_US_TARGETS := main $(PSX_OVLS) $(PSX_ALLSTAGES) $(PSX_SERVANTS) -PSX_HD_TARGETS := dra ric tt_000 stwrp +PSX_HD_TARGETS := dra ric tt_000 stcen stwrp # immovable PSX_BASE_SYMS := $(CONFIG_DIR)/symbols.$(VERSION).txt @@ -98,6 +98,7 @@ extract_assets: $(SOTNASSETS) $(SOTNASSETS) config extract config/assets.us.weapon.yaml extract_assets_hd: $(SOTNASSETS) cd tools/sotn-assets; $(GO) install + $(SOTNASSETS) stage extract -stage_ovl disks/pspeu/PSP_GAME/USRDIR/res/ps/hdbin/cen.bin -o assets/st/cen $(SOTNASSETS) stage extract -stage_ovl disks/pspeu/PSP_GAME/USRDIR/res/ps/hdbin/wrp.bin -o assets/st/wrp build_assets: $(SOTNASSETS) $(SOTNASSETS) stage build_all -i assets/st/cen -o src/st/cen/ @@ -111,6 +112,7 @@ build_assets: $(SOTNASSETS) $(SOTNASSETS) stage build_all -i assets/boss/mar -o src/boss/mar/ $(SOTNASSETS) config build config/assets.$(VERSION).weapon.yaml build_assets_hd: $(SOTNASSETS) + $(SOTNASSETS) stage build_all -i assets/st/cen -o src/st/cen/ $(SOTNASSETS) stage build_all -i assets/st/wrp -o src/st/wrp/ $(BUILD_DIR)/assets/dra/memcard_%.png.o: assets/dra/memcard_%.png diff --git a/config/check.hd.sha b/config/check.hd.sha index 41c6f904e..7b976dc7e 100644 --- a/config/check.hd.sha +++ b/config/check.hd.sha @@ -1,4 +1,7 @@ +32698a322586d2fd4249467c99f5102faff44f30 build/hd/CEN.BIN +f9f4833355d776b377db5adb62d16eae24975160 build/hd/F_CEN.BIN ea268a06a7eb7cd99928ba40e774577c4a1c504d build/hd/DRA.BIN 1dcd6b881e2c0906854c3d53839dfb4ae0d359d6 build/hd/RIC.BIN 3ae1425d694b0e4d65c6bb71d5a91f1769aec30c build/hd/WRP.BIN +c1284f0c662f3c8fdb8a7c17cebf8e5cf1d96c1b build/hd/F_WRP.BIN 2253aee1338fff85351887b4473fb0b02798222b build/hd/tt_000_raw.bin diff --git a/config/splat.hd.stcen.yaml b/config/splat.hd.stcen.yaml new file mode 100644 index 000000000..8d25ff83b --- /dev/null +++ b/config/splat.hd.stcen.yaml @@ -0,0 +1,90 @@ +options: + platform: psx + basename: stcen + base_path: .. + build_path: build/hd + target_path: disks/pspeu/PSP_GAME/USRDIR/res/ps/hdbin/cen.bin + asm_path: asm/hd/st/cen + asset_path: assets/st/cen + src_path: src/st/cen + ld_script_path: build/hd/stcen.ld + compiler: GCC + symbol_addrs_path: + - config/symbols.hd.txt + - config/symbols.hd.stcen.txt + undefined_funcs_auto_path: config/undefined_funcs_auto.hd.stcen.txt + undefined_syms_auto_path: config/undefined_syms_auto.hd.stcen.txt + find_file_boundaries: true + use_legacy_include_asm: false + migrate_rodata_to_functions: true + asm_jtbl_label_macro: jlabel + symbol_name_format: hd_$VRAM + section_order: + - .data + - .rodata + - .text + - .bss + - .sbss + ld_bss_is_noload: false + disasm_unknown: true + include_macro_inc: false +sha1: 32698a322586d2fd4249467c99f5102faff44f30 +segments: + - name: stcen + type: code + start: 0 + vram: 0x80180000 + align: 4 + subalign: 4 + subsegments: + - [0x0, .data, header] + - [0x1EC, .data, e_laydef] + - [0x394, .data, e_init] + - [0x4D4, .data, st_debug] + - [0x554, .data, e_breakable] + - [0x5D8, .data, cutscene] + - [0x684, data, cutscene] + - [0x6BC, .data, F890] + - [0x7E8, .data, st_update] + - [0x814, .data, collision] + - [0xBD4, .data, e_red_door] + - [0xBEC, .data, st_common] + - [0xDEC, data, e_collect] + - [0x1140, data, e_misc] + - [0x11FC, data, e_particles] + - [0x127C, .data, e_room_fg] + - [0x1308, .data, rooms] + - [0x1334, .data, e_layout] + - [0x1424, data] + - [0x6A0C, .data, tile_data] + - [0xC62C, .data, sprites] + - [0xD434, .rodata, cutscene] + - [0xD4B8, .rodata, F890] + - [0xD4E0, .rodata, e_red_door] + - [0xD4F8, .rodata, e_collect] + - [0xD580, .rodata, e_misc] + - [0xD5CC, .rodata, e_stage_name] + - [0xD5E0, .rodata, prim_helpers] + - [0xD5E8, c, st_debug] + - [0xD884, c, e_breakable] + - [0xDB00, c, DB18] + - [0xDEF4, c, cutscene] + - [0xF818, c, F890] + - [0x10DA0, c, st_update] + - [0x111D4, c, collision] + - [0x12990, c, create_entity] + - [0x13508, c, e_red_door] + - [0x141B8, c, st_common] + - [0x15668, c, e_collect] + # no blit_char + - [0x16BD8, c, e_misc] + - [0x1A140, c, e_stage_name] + - [0x1A868, c, e_particles] + - [0x1B0AC, c, e_room_fg] + - [0x1B240, c, popup] + - [0x1B570, c, prim_helpers] + - [0x1BDA0, sbss, header] + - [0x1BE00, sbss, create_entity] + - [0x1CA10, sbss, cutscene] + - [0x1CAC4, sbss, e_collect] + - [0x1CB04] diff --git a/config/splat.us.stcen.yaml b/config/splat.us.stcen.yaml index d1311a0d9..118b40b28 100644 --- a/config/splat.us.stcen.yaml +++ b/config/splat.us.stcen.yaml @@ -91,8 +91,8 @@ segments: - [0x135B4, c, e_red_door] - [0x14264, c, st_common] - [0x15714, c, e_collect] - - [0x16C90, c, blit_char] - - [0x16F30, c, e_misc] + - [0x16C90, c, blit_char] + - [0x16F30, c, e_misc] - [0x1A5F0, c, e_stage_name] - [0x1B274, c, e_particles] - [0x1BAB8, c, e_room_fg] diff --git a/config/symbols.hd.stcen.txt b/config/symbols.hd.stcen.txt new file mode 100644 index 000000000..5d2060b75 --- /dev/null +++ b/config/symbols.hd.stcen.txt @@ -0,0 +1,106 @@ +g_pStObjLayoutHorizontal = 0x801801EC; +g_pStObjLayoutVertical = 0x801802C0; +g_InitializeData0 = 0x80180410; +g_InitializeEntityData0 = 0x8018041C; +g_eMariaInit = 0x80180428; +g_EInitGeneric = 0x80180434; +g_eElevatorInit = 0x8018047C; +g_HeartDropArray = 0x801805D8; +D_801805DC = 0x801805DC; +D_801805E0 = 0x801805E0; +D_801805E8 = 0x801805E8; +D_801805EC = 0x801805EC; +D_801805F4 = 0x801805F4; +actor_names = 0x801806B4; +D_8018068C = 0x801806BC; +D_80180768 = 0x80180798; +D_80180780 = 0x801807B0; +g_eDamageDisplayClut = 0x80180BC4; +D_80180C94 = 0x80180DEC; +g_bigRedFireballAnim = 0x80181044; +g_ESoulStealOrbAngles = 0x801811FC; +g_ESoulStealOrbSprt = 0x8018120C; +g_ESoulStealOrbAnim = 0x8018126C; +D_80181658 = 0x80181678; +D_8018199C = 0x801819BC; +D_80183A40 = 0x80183A60; +D_80184B70 = 0x80184B90; +D_80185830 = 0x80185850; +D_8018658C = 0x801865AC; +D_8018678C = 0x801867AC; +D_8018698C = 0x801869AC; +D_801869AC = 0x801869CC; +g_RelicOrbTexts = 0x8018D580; +CutsceneUnk1 = 0x8018DEF4; +SetCutsceneScript = 0x8018DF44; +CutsceneUnk3 = 0x8018E0F8; +CutsceneUnk4 = 0x8018E148; +DrawCutsceneActorName = 0x8018E1F4; +SetCutsceneEnd = 0x8018E3B8; +CutsceneRun = 0x8018E3E4; +CEN_EntityCutscene = 0x8018E6C0; +func_8018F8EC = 0x8018F874; +EntityMaria = 0x801902FC; +func_801904B8 = 0x8019041C; +EntityElevatorStationary = 0x801904A4; +EntityUnkId1B = 0x801909CC; +Random = 0x80190DA0; +HitDetection = 0x801911D4; +EntityDamageDisplay = 0x801922EC; +CreateEntityWhenInVerticalRange = 0x80192A54; +CreateEntityWhenInHorizontalRange = 0x80192B6C; +FindFirstEntityToTheRight = 0x80192C84; +FindFirstEntityToTheLeft = 0x80192CD0; +CreateEntitiesToTheLeft = 0x80192D28; +CreateEntitiesToTheRight = 0x80192E24; +FindFirstEntityAbove = 0x80192F38; +FindFirstEntityBelow = 0x80192F84; +CreateEntitiesAbove = 0x80192FDC; +CreateEntitiesBelow = 0x801930D8; +InitRoomEntities = 0x801931EC; +UpdateRoomPosition = 0x80193364; +CreateEntityFromCurrentEntity = 0x80193418; +CreateEntityFromEntity = 0x8019348C; +DestroyEntity = 0x801941B8; +PreventEntityFromRespawning = 0x801942A0; +AnimateEntity = 0x801942E8; +MoveEntity = 0x8019456C; +FallEntity = 0x8019459C; +AllocEntity = 0x80194A28; +SetStep = 0x80194DF8; +InitializeEntity = 0x80194EC8; +CheckFieldCollision = 0x80195114; +GetPlayerCollisionWith = 0x8019526C; +func_8018CAB0 = 0x80195668; +func_8018CB34 = 0x801956EC; +CollectHeart = 0x80195848; +CollectGold = 0x801958C8; +CollectSubweapon = 0x801959A4; +CollectHeartVessel = 0x80195ABC; +CollectLifeVessel = 0x80195B60; +DestroyCurrentEntity = 0x80195BB0; +EntityPrizeDrop = 0x80195BD8; +EntityExplosion = 0x8019644C; +BlinkItem = 0x80196548; +EntityEquipItemDrop = 0x801965EC; +EntityRelicOrb = 0x80196BD8; +CheckColliderOffsets = 0x80197DA4; +EntityUnkId14Spawner = 0x80197FA4; +EntityUnkId14 = 0x801981BC; +EntityUnkId15 = 0x801982AC; +EntityOlroxDrool = 0x801983A0; +InitializeUnkEntity = 0x80198D4C; +UnkRecursivePrimFunc1 = 0x80199170; +UnkRecursivePrimFunc2 = 0x80199750; +PlaySfxPositional = 0x8019A048; +EntityStageNamePopup = 0x8019A140; +BottomCornerText = 0x8019B198; +UnkPrimHelper = 0x8019B570; +UnkPolyFunc2 = 0x8019BCBC; +PrimDecreaseBrightness = 0x8019BD3C; +msgBoxTpage = 0x8019BE10; +g_Dialogue = 0x8019CA10; +D_8019D374 = 0x8019CA4C; +g_CutsceneFlags = 0x8019CABC; +D_8019D428 = 0x8019CAC0; +g_ItemIconSlots = 0x8019CAC4; diff --git a/src/st/cen/F890.c b/src/st/cen/F890.c index 45ab89e7b..373c4f52e 100644 --- a/src/st/cen/F890.c +++ b/src/st/cen/F890.c @@ -344,6 +344,7 @@ void EntityRoomDarkness(Entity* self) { } } +#if !defined(VERSION_HD) void EntityMaria(Entity* self) { if (self->step == 0) { /* Has player seen Maria Holy Glasses Cutscene? */ @@ -351,7 +352,7 @@ void EntityMaria(Entity* self) { DestroyEntity(self); return; } - InitializeEntity(D_80180428); + InitializeEntity(g_eMariaInit); self->flags = FLAG_POS_CAMERA_LOCKED; self->animSet = ANIMSET_OVL(1); self->animCurFrame = 10; @@ -360,6 +361,9 @@ void EntityMaria(Entity* self) { self->zPriority = 0x80; } } +#else +INCLUDE_ASM("st/cen/nonmatchings/F890", EntityMaria); +#endif s16 func_8019040C(Primitive* prim, s16 arg1) { s16 ret = arg1; @@ -401,6 +405,7 @@ s16 func_801904B8(Primitive* prim, s16 arg1) { return arg1; } +#if !defined(VERSION_HD) // Elevator when not moving (ID 1A) void EntityElevatorStationary(Entity* self) { Entity* player = &PLAYER; @@ -411,7 +416,7 @@ void EntityElevatorStationary(Entity* self) { switch (self->step) { case 0: - InitializeEntity(D_8018047C); + InitializeEntity(g_eElevatorInit); self->animCurFrame = 3; self->zPriority = player->zPriority + 2; CreateEntityFromCurrentEntity(E_ELEVATOR_STATIONARY, &self[-1]); @@ -560,6 +565,9 @@ void EntityElevatorStationary(Entity* self) { DestroyEntity(self); } } +#else +INCLUDE_ASM("st/cen/nonmatchings/F890", EntityElevatorStationary); +#endif void EntityUnkId1B(Entity* self) { Entity* entity = &self[self->params]; @@ -567,7 +575,7 @@ void EntityUnkId1B(Entity* self) { switch (self->step) { case 0: - InitializeEntity(D_8018047C); + InitializeEntity(g_eElevatorInit); if (self->params & 16) { self->animCurFrame = self->params & 15; self->zPriority = 0x6A; @@ -603,7 +611,7 @@ void EntityMovingElevator(Entity* self) { switch (self->step) { case 0: - InitializeEntity(D_8018047C); + InitializeEntity(g_eElevatorInit); self->animCurFrame = 3; self->zPriority = player->zPriority + 2; primIndex = g_api.AllocPrimitives(PRIM_GT4, 12); diff --git a/src/st/cen/cen.h b/src/st/cen/cen.h index 96d9e33ca..a0d11942d 100644 --- a/src/st/cen/cen.h +++ b/src/st/cen/cen.h @@ -53,11 +53,11 @@ extern PfnEntityUpdate PfnEntityUpdates[]; /*** Initializers ***/ extern u16 D_80180404[]; extern u16 g_InitializeData0[]; -extern u16 D_80180428[]; +extern u16 g_eMariaInit[]; extern u16 g_EInitGeneric[]; extern u16 g_eInitGeneric2[]; extern u16 g_InitializeEntityData0[]; -extern u16 D_8018047C[]; // EntityElevator +extern u16 g_eElevatorInit[]; // EntityElevator extern ObjInit g_eBackgroundBlockInit[]; extern u16* D_80180574[]; diff --git a/src/st/cen/create_entity.c b/src/st/cen/create_entity.c index 6159c30f1..3d6a294c0 100644 --- a/src/st/cen/create_entity.c +++ b/src/st/cen/create_entity.c @@ -1,2 +1,35 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +#include "cen.h" + +#if !defined(VERSION_HD) + #include "../create_entity.h" + +#else + +#include "../create_entity_from_layout.h" +#include "../create_entity_in_range.h" + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", FindFirstEntityToTheRight); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", FindFirstEntityToTheLeft); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", CreateEntitiesToTheLeft); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", CreateEntitiesToTheRight); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", FindFirstEntityAbove); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", FindFirstEntityBelow); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", CreateEntitiesAbove); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", CreateEntitiesBelow); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", InitRoomEntities); + +INCLUDE_ASM("st/cen/nonmatchings/create_entity", UpdateRoomPosition); + +#include "../create_entity_from_entity.h" + +#endif diff --git a/src/st/cen/cutscene.c b/src/st/cen/cutscene.c index 40e33b426..263fd81ad 100644 --- a/src/st/cen/cutscene.c +++ b/src/st/cen/cutscene.c @@ -34,19 +34,49 @@ static s16 D_801805F4[] = { 0x1B, 0x34, 0x41, 0x35, 0x08, 0x0E, 0x4D, 0x11, 0x34, 0x41, 0x29, 0x48, }; +#if !defined(VERSION_HD) + static const char* actor_names[] = {_S("Alucard"), _S("Maria")}; static const char _pad[4] = ""; +#endif + +extern s32 D_8019D374; +extern Dialogue g_Dialogue; + +extern u32 g_CutsceneFlags; +extern u32 D_8019D428; + +#if !defined(VERSION_HD) #include "../cutscene_unk1.h" +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", CutsceneUnk1); +#endif +#if !defined(VERSION_HD) #include "../set_cutscene_script.h" +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", SetCutsceneScript); +#endif +#if !defined(VERSION_HD) #include "../cutscene_unk3.h" +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", CutsceneUnk3); +#endif +#if !defined(VERSION_HD) #include "../cutscene_unk4.h" +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", CutsceneUnk4); +#endif +#if !defined(VERSION_HD) #include "../cutscene_actor_name.h" +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", DrawCutsceneActorName); +#endif #include "../set_cutscene_end.h" @@ -102,8 +132,11 @@ static void CutsceneRun(void) { } } +#ifndef VERSION_HD #include "../cutscene_scale_avatar.h" +#endif +#if !defined(VERSION_HD) extern u8 OVL_EXPORT(cutscene_data)[]; void OVL_EXPORT(EntityCutscene)(Entity* self) { RECT rect; @@ -580,3 +613,6 @@ void OVL_EXPORT(EntityCutscene)(Entity* self) { break; } } +#else +INCLUDE_ASM("st/cen/nonmatchings/cutscene", CEN_EntityCutscene); +#endif diff --git a/src/st/cen/cutscene_data.c b/src/st/cen/cutscene_data.c index d883d9e46..4aed6e9c0 100644 --- a/src/st/cen/cutscene_data.c +++ b/src/st/cen/cutscene_data.c @@ -1,7 +1,12 @@ // SPDX-License-Identifier: AGPL-3.0-or-later #include "cen.h" + +#if !defined(VERSION_HD) + #include u8 OVL_EXPORT(cutscene_data)[] = { #include "cutscene_data.h" }; + +#endif diff --git a/src/st/cen/e_collect.c b/src/st/cen/e_collect.c index 950b85640..3aeccbb2b 100644 --- a/src/st/cen/e_collect.c +++ b/src/st/cen/e_collect.c @@ -1,2 +1,59 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +#include "cen.h" + +#if !defined(VERSION_HD) + #include "../e_collect.h" + +#else + +// e_collect + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", func_8018CAB0); + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", func_8018CB34); + +// TODO: needs c_HeartPrizes +INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectHeart); + +// TODO: needs c_GoldPrizes, g_goldCollectTexts +INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectGold); + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectSubweapon); + +#include "../collect_heart_vessel.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectLifeVessel); + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", DestroyCurrentEntity); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D4F8); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D500); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D508); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D510); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D518); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D520); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D528); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D530); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D538); + +INCLUDE_RODATA("st/cen/nonmatchings/e_collect", D_hd_8018D540); + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", EntityPrizeDrop); + +// TODO: needs g_ExplosionYVelocities, g_ExplosionAnimations +INCLUDE_ASM("st/cen/nonmatchings/e_collect", EntityExplosion); + +#include "../blink_item.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_collect", EntityEquipItemDrop); + +#endif diff --git a/src/st/cen/e_init.c b/src/st/cen/e_init.c index b86f7eaa4..a54ef98f7 100644 --- a/src/st/cen/e_init.c +++ b/src/st/cen/e_init.c @@ -72,7 +72,7 @@ EntityInit g_InitializeEntityData0 = { .enemyId = 2, }; -EntityInit D_80180428 = { +EntityInit g_eMariaInit = { .animSet = ANIMSET_DRA(0), .animCurFrame = 0, .unk5A = 0, @@ -128,7 +128,7 @@ EntityInit D_80180470 = { .enemyId = 3, }; -EntityInit D_8018047C = { +EntityInit g_eElevatorInit = { .animSet = ANIMSET_OVL(11), .animCurFrame = 1, .unk5A = 72, diff --git a/src/st/cen/e_misc.c b/src/st/cen/e_misc.c index cac119e53..da7593a54 100644 --- a/src/st/cen/e_misc.c +++ b/src/st/cen/e_misc.c @@ -2,4 +2,56 @@ #include "cen.h" #define HEART_DROP_CASTLE_FLAG 0xC0 + +#if !defined(VERSION_HD) + #include "../e_misc.h" + +#else + +INCLUDE_RODATA("st/cen/nonmatchings/e_misc", g_RelicOrbTexts); + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", EntityRelicOrb); + +#include "../entity_heart_drop.h" + +extern u16 msgBoxTpage[0x600]; +#include "../entity_message_box.h" + +#include "../check_coll_offsets.h" + +#include "../entity_unkId13.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", EntityUnkId14Spawner); + +#include "../entity_unkId15_spawner.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", EntityUnkId14); + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", EntityUnkId15); + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", EntityOlroxDrool); + +#include "../unk_collision_func5.h" + +#include "../unk_collision_func4.h" + +#include "../entity_intense_explosion.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", InitializeUnkEntity); + +#include "../make_entity_from_id.h" + +#include "../make_explosions.h" + +#include "../entity_big_red_fireball.h" + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", UnkRecursivePrimFunc1); + +INCLUDE_ASM("st/cen/nonmatchings/e_misc", UnkRecursivePrimFunc2); + +#include "../clut_lerp.h" + +#include "../play_sfx_positional.h" + +#endif diff --git a/src/st/cen/e_particles.c b/src/st/cen/e_particles.c index d66f017f1..391993395 100644 --- a/src/st/cen/e_particles.c +++ b/src/st/cen/e_particles.c @@ -1,2 +1,17 @@ // SPDX-License-Identifier: AGPL-3.0-or-later + +#include "cen.h" + +#if !defined(VERSION_HD) + #include "../e_particles.h" + +#else + +// data differs + +#include "../entity_soul_steal_orb.h" + +#include "../entity_enemy_blood.h" + +#endif diff --git a/src/st/cen/e_stage_name.c b/src/st/cen/e_stage_name.c index ecd9ea11e..107c17404 100644 --- a/src/st/cen/e_stage_name.c +++ b/src/st/cen/e_stage_name.c @@ -1,4 +1,12 @@ // SPDX-License-Identifier: AGPL-3.0-or-later #include "cen.h" +#if !defined(VERSION_HD) + #include "../e_stage_name.h" + +#else + +INCLUDE_ASM("st/cen/nonmatchings/e_stage_name", EntityStageNamePopup); + +#endif diff --git a/src/st/cen/popup.c b/src/st/cen/popup.c index b2de609ad..182d6fdae 100644 --- a/src/st/cen/popup.c +++ b/src/st/cen/popup.c @@ -1,4 +1,2 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -#include "cen.h" - #include "../popup.h" diff --git a/src/st/cen/prim_helpers.c b/src/st/cen/prim_helpers.c index 54fc9a0c6..d196ba7ab 100644 --- a/src/st/cen/prim_helpers.c +++ b/src/st/cen/prim_helpers.c @@ -1,3 +1,2 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -#include #include "../prim_helpers.h" diff --git a/src/st/cen/tile_data.c b/src/st/cen/tile_data.c index a1fbade93..71cbc7f1a 100644 --- a/src/st/cen/tile_data.c +++ b/src/st/cen/tile_data.c @@ -1,8 +1,16 @@ // SPDX-License-Identifier: AGPL-3.0-or-later #include +#ifdef VERSION_HD +#include "tilemap_06A0C.h" +#include "tilemap_06E0C.h" +#include "tilemap_0800C.h" +#include "tiledef_0860C.h" +#include "tiledef_0C61C.h" +#else #include "tilemap_069EC.h" #include "tilemap_06DEC.h" #include "tilemap_07FEC.h" #include "tiledef_085EC.h" #include "tiledef_0C5FC.h" +#endif