From cf37fe0087ee8885841f91f62686db855d1cd489 Mon Sep 17 00:00:00 2001 From: Jonathan Hohle Date: Fri, 10 Jan 2025 09:21:25 -0700 Subject: [PATCH 1/3] Remove Unncessary Symbols (#2049) Cleans up symbols that are now determined at compile or link time and no longer references from ASM. --- config/symbols.hd.dra.txt | 1 - config/symbols.us.bomar.txt | 2 - config/symbols.us.borbo3.txt | 110 -------------------- config/symbols.us.dra.txt | 1 - config/symbols.us.stcen.txt | 9 -- config/symbols.us.stdre.txt | 1 - config/symbols.us.stno0.txt | 195 ----------------------------------- config/symbols.us.stno1.txt | 127 ----------------------- config/symbols.us.stno3.txt | 101 ------------------ config/symbols.us.stnp3.txt | 6 -- config/symbols.us.stnz0.txt | 10 -- config/symbols.us.strwrp.txt | 20 ---- config/symbols.us.stst0.txt | 42 -------- config/symbols.us.tt_000.txt | 5 - config/symbols.us.tt_001.txt | 17 --- config/symbols.us.tt_002.txt | 42 -------- config/symbols.us.tt_003.txt | 54 ---------- config/symbols.us.tt_004.txt | 21 ---- config/undefined_syms.hd.txt | 2 + config/undefined_syms.us.txt | 2 + 20 files changed, 4 insertions(+), 764 deletions(-) diff --git a/config/symbols.hd.dra.txt b/config/symbols.hd.dra.txt index 2dca32f5b7..8bcd7eb229 100644 --- a/config/symbols.hd.dra.txt +++ b/config/symbols.hd.dra.txt @@ -27,7 +27,6 @@ g_PlOvlAluBatSpritesheet = 0x8013C004; g_PlOvlSpritesheet = 0x8013C020; g_imgUnk8013C200 = 0x8013C200; g_imgUnk8013C270 = 0x8013C270; -g_ServantDesc = 0x80170000; D_8017D350 = 0x8017CF1C; D_8018B4E0 = 0x8018B0EC; D_801A9C80 = 0x801A978C; diff --git a/config/symbols.us.bomar.txt b/config/symbols.us.bomar.txt index 7cad24bb08..c4217e08fe 100644 --- a/config/symbols.us.bomar.txt +++ b/config/symbols.us.bomar.txt @@ -1,5 +1,3 @@ -actor_names = 0x80180680; -MAR_PrizeDrops = 0x80180744; bird_cage_pos_x = 0x80181280; bird_cage_pos_y = 0x80181284; statue_pos_x_1 = 0x80181288; diff --git a/config/symbols.us.borbo3.txt b/config/symbols.us.borbo3.txt index a516d40f1f..7c56abc1ce 100644 --- a/config/symbols.us.borbo3.txt +++ b/config/symbols.us.borbo3.txt @@ -15,143 +15,33 @@ g_eBreakableHitboxes = 0x801805C0; g_eBreakableExplosionTypes = 0x801805C8; g_eBreakableanimSets = 0x801805D0; g_eBreakableDrawModes = 0x801805E0; -RBO3_PrizeDrops = 0x801805F0; -g_SineTable = 0x80180B54; -aluric_subweapons_idx = 0x80180EA0; -aluric_subweapons_id = 0x80180EB4; -g_goldCollectTexts = 0x80180EC8; -c_GoldPrizes = 0x80180EF0; -g_SubweaponAnimPrizeDrop = 0x80180F18; -D_80180EB8 = 0x80180F78; -c_HeartPrizes = 0x80180F80; -g_ExplosionYVelocities = 0x80180F84; -g_bigRedFireballAnim = 0x80180FAC; -g_ExplosionAnimations = 0x80181030; -greyPuff_rot = 0x801810B8; -greyPuff_yVel = 0x801810C8; -explode_yVel = 0x801810E0; -explode_startFrame = 0x801810F8; -explode_lifetime = 0x801810FC; -g_olroxDroolCollOffsets = 0x80181104; -g_UnkEntityAnimData = 0x8018110C; -g_UnkRecursPrimVecOrder = 0x8018111C; -g_UnkRecursPrim2Inds = 0x8018113C; -g_ESoulStealOrbAngles = 0x80181160; -g_ESoulStealOrbSprt = 0x80181170; -g_ESoulStealOrbAnim = 0x801811D0; -eRoomForegroundInit = 0x801811F4; explosionVariantSizes = 0x80181BA0; func_801A7D64 = 0x80191080; EntityUnkId12 = 0x80191148; EntityBreakable = 0x80191304; EntityMedusa = 0x8019179C; -Random = 0x80193198; Update = 0x801931C8; UpdateStageEntities = 0x801934C4; HitDetection = 0x801935CC; EntityDamageDisplay = 0x801946E4; -CreateEntityFromLayout = 0x80194D88; -CreateEntityWhenInVerticalRange = 0x80194E4C; -CreateEntityWhenInHorizontalRange = 0x80194F64; -FindFirstEntityToTheRight = 0x8019507C; -FindFirstEntityToTheLeft = 0x801950C8; -CreateEntitiesToTheRight = 0x80195120; -CreateEntitiesToTheLeft = 0x8019521C; -FindFirstEntityAbove = 0x80195330; -FindFirstEntityBelow = 0x8019537C; -CreateEntitiesAbove = 0x801953D4; -CreateEntitiesBelow = 0x801954D0; InitRoomEntities = 0x801955E4; UpdateRoomPosition = 0x8019575C; -CreateEntityFromCurrentEntity = 0x80195810; -CreateEntityFromEntity = 0x80195884; -EntityIsNearPlayer = 0x80195900; RBO3_EntityRedDoor = 0x80195978; DestroyEntity = 0x801965B0; -DestroyEntitiesFromIndex = 0x8019661C; -PreventEntityFromRespawning = 0x80196698; -AnimateEntity = 0x801966E0; -UnkAnimFunc = 0x80196798; -GetDistanceToPlayerX = 0x801968B0; -GetDistanceToPlayerY = 0x801968EC; -GetSideToPlayer = 0x80196920; -MoveEntity = 0x80196964; -FallEntity = 0x80196994; -UnkCollisionFunc3 = 0x801969C0; -UnkCollisionFunc2 = 0x80196C38; -AllocEntity = 0x80196E20; -GetSineScaled = 0x80196E80; -GetSine = 0x80196EAC; -SetEntityVelocityFromAngle = 0x80196EC8; -Ratan2Shifted = 0x80196F34; -GetAngleBetweenEntitiesShifted = 0x80196F6C; -GetAnglePointToEntity = 0x80196FB4; -AdjustValueWithinThreshold = 0x80196FFC; -UnkEntityFunc0 = 0x80197054; -Ratan2 = 0x801970E0; -GetAngleBetweenEntities = 0x80197110; -GetNormalizedAngle = 0x80197190; -SetStep = 0x801971F0; -SetSubStep = 0x80197210; -EntityExplosionSpawn = 0x8019722C; InitializeEntity = 0x801972C0; EntityDummy = 0x801973BC; -UnkCollisionFunc = 0x801973E4; -CheckFieldCollision = 0x8019750C; -GetPlayerCollisionWith = 0x80197664; -ReplaceBreakableWithItemDrop = 0x801979A8; -PrizeDropFall = 0x80197A60; -PrizeDropFall2 = 0x80197AE4; -CollectHeart = 0x80197C40; -CollectGold = 0x80197CC0; -CollectSubweapon = 0x80197D9C; -CollectHeartVessel = 0x80197EB4; -CollectLifeVessel = 0x80197F58; -DestroyCurrentEntity = 0x80197FA8; EntityPrizeDrop = 0x80197FD0; EntityExplosion = 0x80198844; -BlinkItem = 0x80198940; EntityEquipItemDrop = 0x801989E4; -BlitChar = 0x80198FCC; EntityRelicOrb = 0x8019927C; EntityHeartDrop = 0x80199D4C; EntityMessageBox = 0x80199E68; -CheckColliderOffsets = 0x8019A3C4; EntityUnkId13 = 0x8019A4B4; -EntityExplosionVariantsSpawner = 0x8019A5C4; -EntityGreyPuffSpawner = 0x8019A6F4; EntityExplosionVariants = 0x8019A7DC; EntityGreyPuff = 0x8019A8CC; -EntityOlroxDrool = 0x8019A9C0; -UnkCollisionFunc5 = 0x8019ABF0; -UnkCollisionFunc4 = 0x8019ACEC; EntityIntenseExplosion = 0x8019B26C; -InitializeUnkEntity = 0x8019B36C; -MakeEntityFromId = 0x8019B438; -MakeExplosions = 0x8019B500; -EntityBigRedFireball = 0x8019B5B8; -UnkRecursivePrimFunc1 = 0x8019B790; -UnkRecursivePrimFunc2 = 0x8019BD70; -ClutLerp = 0x8019C470; -PlaySfxPositional = 0x8019C668; -StageNamePopupHelper = 0x8019C760; EntityStageNamePopup = 0x8019C930; EntitySoulStealOrb = 0x8019D5B4; EntityEnemyBlood = 0x8019D948; EntityRoomForeground = 0x8019DDF8; -BottomCornerText = 0x8019DEE4; -UnkPrimHelper = 0x8019E214; -UpdateAnimation = 0x8019E5FC; -FindFirstUnkPrim = 0x8019E74C; -FindFirstUnkPrim2 = 0x8019E77C; -PrimToggleVisibility = 0x8019E7F8; -PrimResetNext = 0x8019E880; -UnkPolyFunc2 = 0x8019E960; -UnkPolyFunc0 = 0x8019E9B4; -PrimDecreaseBrightness = 0x8019E9E0; EntityLifeUpSpawn = 0x8019EA44; -g_LayoutObjHorizontal = 0x8019F978; -g_LayoutObjVertical = 0x8019F97C; -g_LayoutObjPosHorizontal = 0x8019F980; -g_LayoutObjPosVertical = 0x8019F984; -g_ItemIconSlots = 0x801A05F0; diff --git a/config/symbols.us.dra.txt b/config/symbols.us.dra.txt index 0a289efda6..003e5daff9 100644 --- a/config/symbols.us.dra.txt +++ b/config/symbols.us.dra.txt @@ -11,5 +11,4 @@ g_PlOvlAluBatSpritesheet = 0x8013C004; g_PlOvlSpritesheet = 0x8013C020; g_imgUnk8013C200 = 0x8013C200; g_imgUnk8013C270 = 0x8013C270; -g_ServantDesc = 0x80170000; g_StageOverlay = 0x80180000; diff --git a/config/symbols.us.stcen.txt b/config/symbols.us.stcen.txt index 825b10ae8a..e69de29bb2 100644 --- a/config/symbols.us.stcen.txt +++ b/config/symbols.us.stcen.txt @@ -1,9 +0,0 @@ -D_80181658 = 0x80181658; -D_8018199C = 0x8018199C; -D_80183A40 = 0x80183A40; -D_80184B70 = 0x80184B70; -D_80185830 = 0x80185830; -CEN_EntityRedDoor = 0x8019362C; -EntityPrizeDrop = 0x80195C84; -EntityEquipItemDrop = 0x80196698; -EntityStageNamePopup = 0x8019A5F0; diff --git a/config/symbols.us.stdre.txt b/config/symbols.us.stdre.txt index e0dbcd2231..002cf56c5a 100644 --- a/config/symbols.us.stdre.txt +++ b/config/symbols.us.stdre.txt @@ -1,4 +1,3 @@ -DRE_gfxBanks = 0x801801D0; DRE_EntityUpdates = 0x801803C8; DRE_EInitBreakable = 0x80180458; g_EInitObtainable = 0x80180464; diff --git a/config/symbols.us.stno0.txt b/config/symbols.us.stno0.txt index cc0b4a248b..3a47babd57 100644 --- a/config/symbols.us.stno0.txt +++ b/config/symbols.us.stno0.txt @@ -1,66 +1,8 @@ NO0_pStObjLayoutHorizontal = 0x80180778; NO0_pStObjLayoutVertical = 0x8018084C; -NO0_EntityUpdates = 0x80180920; -NO0_EInitBreakable = 0x80180A64; -g_EInitObtainable = 0x80180A70; -g_EInitParticle = 0x80180A7C; -g_EInitInteractable = 0x80180A94; -g_EInitUnkId13 = 0x80180AD0; -g_EInitCommon = 0x80180AE8; -g_EInitDamageNum = 0x80180B18; -g_EInitElevator = 0x80180B60; -g_EInitPlateLord = 0x80180B84; -g_EInitGhostEnemy = 0x80180B9C; -g_EInitSlinger = 0x80180BB4; -g_EInitSlingerPieces = 0x80180BC0; -g_EInitSlingerRib = 0x80180BCC; -g_EInitAxeKnight = 0x80180BFC; -D_80180C6A = 0x80180C02; -g_EInitAxeKnightAxe = 0x80180C08; -g_EInitOuijaTable = 0x80180C14; -g_EInitOuijaTableComponent = 0x80180C20; -g_EInitFleaMan = 0x80180C2C; -g_EInitSkeleton = 0x80180C38; -g_EInitSkeletonPieces = 0x80180C44; -g_EInitSkeletonBone = 0x80180C50; -NO0_RedDoorTiles = 0x80180C5C; -g_eBreakableAnimations = 0x80180F58; -g_eBreakableHitboxes = 0x80180F7C; -g_eBreakableExplosionTypes = 0x80180F88; -g_eBreakableanimSets = 0x80180F94; -g_eBreakableDrawModes = 0x80180FA8; D_80180FE0 = 0x801810D0; -NO0_PrizeDrops = 0x80181100; UNK_Invincibility0 = 0x8018113C; -g_testCollEnemyLookup = 0x80181168; -g_testCollLuckCutoff = 0x80181488; -g_testColluCoords = 0x8018148C; -g_testCollvCoords = 0x80181494; -g_testCollElementLookup = 0x8018149C; -g_testColliFrames = 0x801814B0; -g_testCollPrizeTable = 0x801814BC; -g_testCollRandTable = 0x801814FC; -g_eDamageDisplayClut = 0x80181518; -eRoomForegroundInit = 0x80181554; -g_ESoulStealOrbAngles = 0x801815CC; -g_ESoulStealOrbSprt = 0x801815DC; -g_ESoulStealOrbAnim = 0x8018163C; g_SineTable = 0x8018164C; -D_80181CA8 = 0x8018197C; -aluric_subweapons_id = 0x801819AC; -g_goldCollectTexts = 0x801819C0; -c_GoldPrizes = 0x801819E8; -c_HeartPrizes = 0x80181A78; -g_ExplosionYVelocities = 0x80181A7C; -g_ExplosionAnimations = 0x80181B28; -explosionVariantSizes = 0x80181BA0; -greyPuff_rot = 0x80181BB0; -greyPuff_yVel = 0x80181BC0; -explode_yVel = 0x80181BD8; -explode_startFrame = 0x80181BF0; -explode_lifetime = 0x80181BF4; -g_olroxDroolCollOffsets = 0x80181BFC; -g_UnkEntityAnimData = 0x80181C04; bird_cage_pos_x = 0x80181C34; bird_cage_pos_y = 0x80181C38; statue_pos_x_1 = 0x80181C3C; @@ -73,159 +15,22 @@ anim_bird_cage = 0x80181C5C; anim_gear_1 = 0x80181C78; anim_gear_2 = 0x80181C84; g_StoneDoorTiles = 0x80181C90; -steps = 0x801825AC; -init_velocity_x = 0x801825B4; -init_velocity_y = 0x801825C0; -bone_projectile_velocity_x = 0x8018272C; -sensors_special = 0x8018275C; sprites_nz0_3 = 0x801BEBB0; ctulhu_shockwave_uvs = 0x801C11B0; -g_UnkPrimHelperRot = 0x801C184C; -PlayerIsWithinHitbox = 0x801C1968; -func_801B0AA4 = 0x801C19EC; -EntityBreakable = 0x801C1E48; -EntityExplosionPuffOpaque = 0x801C33F4; Random = 0x801C3788; Update = 0x801C37B8; UpdateStageEntities = 0x801C3AB4; HitDetection = 0x801C3BBC; -EntityDamageDisplay = 0x801C4CD4; -CreateEntityFromLayout = 0x801C5378; -CreateEntityWhenInVerticalRange = 0x801C543C; -CreateEntityWhenInHorizontalRange = 0x801C5554; -FindFirstEntityToTheRight = 0x801C566C; -FindFirstEntityToTheLeft = 0x801C56B8; -CreateEntitiesToTheRight = 0x801C5710; -CreateEntitiesToTheLeft = 0x801C580C; -FindFirstEntityAbove = 0x801C5920; -FindFirstEntityBelow = 0x801C596C; -CreateEntitiesAbove = 0x801C59C4; -CreateEntitiesBelow = 0x801C5AC0; InitRoomEntities = 0x801C5BD4; UpdateRoomPosition = 0x801C5D4C; -CreateEntityFromCurrentEntity = 0x801C5E00; -CreateEntityFromEntity = 0x801C5E74; -EntityIsNearPlayer = 0x801C5EF0; -NO0_EntityRedDoor = 0x801C5F68; -EntityRoomForeground = 0x801C6BA0; -BottomCornerText = 0x801C6C8C; -EntitySoulStealOrb = 0x801C6FBC; -EntityEnemyBlood = 0x801C7350; DestroyEntity = 0x801C7800; -DestroyEntitiesFromIndex = 0x801C786C; -PreventEntityFromRespawning = 0x801C78E8; AnimateEntity = 0x801C7930; -UnkAnimFunc = 0x801C79E8; GetDistanceToPlayerX = 0x801C7B00; -GetDistanceToPlayerY = 0x801C7B3C; GetSideToPlayer = 0x801C7B70; -MoveEntity = 0x801C7BB4; -FallEntity = 0x801C7BE4; UnkCollisionFunc3 = 0x801C7C10; -UnkCollisionFunc2 = 0x801C7E88; -AllocEntity = 0x801C8070; -GetSineScaled = 0x801C80D0; -GetSine = 0x801C80FC; -SetEntityVelocityFromAngle = 0x801C8118; -Ratan2Shifted = 0x801C8184; -GetAngleBetweenEntitiesShifted = 0x801C81BC; -GetAnglePointToEntityShifted = 0x801C8204; -AdjustValueWithinThreshold = 0x801C824C; -UnkEntityFunc0 = 0x801C82A4; -Ratan2 = 0x801C8330; -GetAngleBetweenEntities = 0x801C8360; -GetNormalizedAngle = 0x801C83E0; SetStep = 0x801C8440; SetSubStep = 0x801C8460; -EntityExplosionSpawn = 0x801C847C; InitializeEntity = 0x801C8510; -EntityDummy = 0x801C860C; -UnkCollisionFunc = 0x801C8634; -CheckFieldCollision = 0x801C875C; -GetPlayerCollisionWith = 0x801C88B4; -ReplaceBreakableWithItemDrop = 0x801C8BF8; -PrizeDropFall = 0x801C8CB0; -PrizeDropFall2 = 0x801C8D34; -CollectHeart = 0x801C8E90; -CollectGold = 0x801C8F10; -CollectSubweapon = 0x801C8FEC; -CollectHeartVessel = 0x801C9104; -CollectLifeVessel = 0x801C91A8; -DestroyCurrentEntity = 0x801C91F8; -EntityPrizeDrop = 0x801C9220; -EntityExplosion = 0x801C9A94; -BlinkItem = 0x801C9B90; -EntityEquipItemDrop = 0x801C9C34; -BlitChar = 0x801CA21C; -EntityRelicOrb = 0x801CA4CC; -EntityHeartDrop = 0x801CAF9C; -EntityMessageBox = 0x801CB0B8; -CheckColliderOffsets = 0x801CB614; -EntityUnkId13 = 0x801CB704; -EntityExplosionVariantsSpawner = 0x801CB814; -EntityGreyPuffSpawner = 0x801CB944; -EntityExplosionVariants = 0x801CBA2C; -EntityGreyPuff = 0x801CBB1C; -EntityOlroxDrool = 0x801CBC10; -UnkCollisionFunc5 = 0x801CBE40; -EntityIntenseExplosion = 0x801CBF3C; -InitializeUnkEntity = 0x801CC03C; -MakeEntityFromId = 0x801CC108; -MakeExplosions = 0x801CC1D0; -EntityBigRedFireball = 0x801CC288; -ClutLerp = 0x801CC460; PlaySfxPositional = 0x801CC658; -UpdateBirdcages = 0x801CCBE4; -UpdateClockHands = 0x801CCC2C; -EntityClockHands = 0x801CD750; -EntityBirdcageDoor = 0x801CD864; -UpdateStatueTiles = 0x801CDAD4; -EntityStatue = 0x801CDB20; -EntityStatueGear = 0x801CDE48; -UpdateStoneDoorTiles = 0x801CE058; -EntityStoneDoor = 0x801CE0F8; -EntityClockRoomUnused = 0x801CE2D8; -StageNamePopupHelper = 0x801CE654; -EntityStageNamePopup = 0x801CE824; -EntityDiplocephalusFoot = 0x801CF670; -EntitySkelerang = 0x801D191C; -EntitySkelerangBoomerang = 0x801D20A4; -EntitySkelerangUnknown = 0x801D2318; -func_801CD78C = 0x801D2374; -StepTowards = 0x801D29F8; -EntityPlateLord = 0x801D2A64; -EntityGhostEnemy = 0x801D5E4C; -EntityGhostEnemySpawner = 0x801D606C; -EntitySlinger = 0x801D7670; -EntitySlingerPieces = 0x801D7B40; -EntitySlingerRib = 0x801D7C20; -AxeKnightUnkFunc1 = 0x801DAEBC; -func_801C4198 = 0x801DB0B8; -func_801C4550 = 0x801DB470; -EntityAxeKnight = 0x801DB4DC; -EntityAxeKnightRotateAxe = 0x801DBBE0; -EntityAxeKnightThrowingAxe = 0x801DBC38; -EntityOuijaTable = 0x801DBDCC; -EntityOuijaTableComponent = 0x801DC194; -EntityFleaMan = 0x801DC788; -SkeletonAttackCheck = 0x801DCAB0; -EntitySkeleton = 0x801DCB48; -EntitySkeletonPieces = 0x801DD018; -EntitySkeletonThrownBone = 0x801DD0F8; -UnusedSkeletonEntity = 0x801DD1FC; -EntityMagicallySealedDoor = 0x801DD328; -UnkPrimHelper = 0x801DE09C; -UpdateAnimation = 0x801DE484; -FindFirstUnkPrim = 0x801DE5D4; -FindFirstUnkPrim2 = 0x801DE604; -PrimToggleVisibility = 0x801DE680; -PrimResetNext = 0x801DE708; UnkPolyFunc2 = 0x801DE7E8; -UnkPolyFunc0 = 0x801DE83C; -PrimDecreaseBrightness = 0x801DE868; -g_LayoutObjHorizontal = 0x801DE8CC; -g_LayoutObjVertical = 0x801DE8D0; -g_LayoutObjPosHorizontal = 0x801DE8D4; -g_LayoutObjPosVertical = 0x801DE8D8; g_Statues = 0x801DF548; -g_ItemIconSlots = 0x801DF54C; diff --git a/config/symbols.us.stno1.txt b/config/symbols.us.stno1.txt index ba424da12c..ae29fbfb90 100644 --- a/config/symbols.us.stno1.txt +++ b/config/symbols.us.stno1.txt @@ -1,172 +1,45 @@ NO1_pStObjLayoutHorizontal = 0x80180618; NO1_pStObjLayoutVertical = 0x801806EC; -NO1_EntityUpdates = 0x801807C0; -g_EInitObtainable = 0x80180944; g_EInitParticle = 0x80180950; g_EInitInteractable = 0x80180968; -g_EInitUnkId13 = 0x80180998; -g_EInitUnkId12 = 0x801809A4; g_EInitCommon = 0x801809B0; -g_EInitDamageNum = 0x801809BC; -g_EInitAxeKnight = 0x801809E0; -g_EInitAxeKnightAxe = 0x801809EC; -g_EInitSkeleton = 0x80180A58; -g_EInitSkeletonPieces = 0x80180A64; -g_EInitSkeletonBone = 0x80180A70; NO1_RedDoorTiles = 0x80180C9C; g_testCollRandTable = 0x801814FC; -NO1_PrizeDrops = 0x80181A2C; -UNK_Invincibility0 = 0x80181A5C; -g_testCollEnemyLookup = 0x80181A88; -g_testCollLuckCutoff = 0x80181DA8; -g_testColluCoords = 0x80181DAC; -g_testCollvCoords = 0x80181DB4; -g_testCollElementLookup = 0x80181DBC; -g_testColliFrames = 0x80181DD0; -g_testCollPrizeTable = 0x80181DDC; -g_eDamageDisplayClut = 0x80181E38; -g_SineTable = 0x80181E48; -aluric_subweapons_id = 0x801821A8; -g_goldCollectTexts = 0x801821BC; -c_GoldPrizes = 0x801821E4; -c_HeartPrizes = 0x80182274; -g_ExplosionYVelocities = 0x80182278; -g_bigRedFireballAnim = 0x801822A0; -g_ExplosionAnimations = 0x80182324; -explosionVariantSizes = 0x8018239C; -greyPuff_rot = 0x801823AC; -greyPuff_yVel = 0x801823BC; -explode_yVel = 0x801823D4; -explode_startFrame = 0x801823EC; -explode_lifetime = 0x801823F0; -g_olroxDroolCollOffsets = 0x801823F8; -g_UnkEntityAnimData = 0x80182400; -g_ESoulStealOrbAngles = 0x80182610; -g_ESoulStealOrbSprt = 0x80182620; -g_ESoulStealOrbAnim = 0x80182680; -eRoomForegroundInit = 0x801826A4; -D_80182424 = 0x80182774; -D_80182488 = 0x801827D8; -D_801824B8 = 0x80182808; -D_801824C0 = 0x80182810; D_80182A4C = 0x80182A4C; sprites_3 = 0x801A86BC; -EntityIsNearPlayer = 0x801B4E6C; -NO1_EntityRedDoor = 0x801B4EE4; -EntityUnkId12 = 0x801B5C64; Random = 0x801C19F0; Update = 0x801C1A20; UpdateStageEntities = 0x801C1D1C; HitDetection = 0x801C1E24; -EntityDamageDisplay = 0x801C2F3C; -CreateEntityFromLayout = 0x801C35E0; -CreateEntityWhenInVerticalRange = 0x801C36A4; -CreateEntityWhenInHorizontalRange = 0x801C37BC; -FindFirstEntityToTheRight = 0x801C38D4; -FindFirstEntityToTheLeft = 0x801C3920; -CreateEntitiesToTheRight = 0x801C3978; -CreateEntitiesToTheLeft = 0x801C3A74; -FindFirstEntityAbove = 0x801C3B88; -FindFirstEntityBelow = 0x801C3BD4; -CreateEntitiesAbove = 0x801C3C2C; -CreateEntitiesBelow = 0x801C3D28; InitRoomEntities = 0x801C3E3C; UpdateRoomPosition = 0x801C3FB4; CreateEntityFromCurrentEntity = 0x801C4068; CreateEntityFromEntity = 0x801C40DC; DestroyEntity = 0x801C4158; -DestroyEntitiesFromIndex = 0x801C41C4; PreventEntityFromRespawning = 0x801C4240; AnimateEntity = 0x801C4288; -UnkAnimFunc = 0x801C4340; GetDistanceToPlayerX = 0x801C4458; GetDistanceToPlayerY = 0x801C4494; GetSideToPlayer = 0x801C44C8; MoveEntity = 0x801C450C; -FallEntity = 0x801C453C; UnkCollisionFunc3 = 0x801C4568; UnkCollisionFunc2 = 0x801C47E0; AllocEntity = 0x801C49C8; -GetSineScaled = 0x801C4A28; -GetSine = 0x801C4A54; SetEntityVelocityFromAngle = 0x801C4A70; -Ratan2Shifted = 0x801C4ADC; GetAngleBetweenEntitiesShifted = 0x801C4B14; GetAnglePointToEntityShifted = 0x801C4B5C; AdjustValueWithinThreshold = 0x801C4BA4; -UnkEntityFunc0 = 0x801C4BFC; -Ratan2 = 0x801C4C88; -GetAngleBetweenEntities = 0x801C4CB8; -GetAnglePointToEntity = 0x801C4CF0; -GetNormalizedAngle = 0x801C4D38; SetStep = 0x801C4D98; SetSubStep = 0x801C4DB8; EntityExplosionSpawn = 0x801C4DD4; InitializeEntity = 0x801C4E68; -EntityDummy = 0x801C4F64; UnkCollisionFunc = 0x801C4F8C; -CheckFieldCollision = 0x801C50B4; GetPlayerCollisionWith = 0x801C520C; ReplaceBreakableWithItemDrop = 0x801C5550; -PrizeDropFall = 0x801C5608; -PrizeDropFall2 = 0x801C568C; -CollectHeart = 0x801C57E8; -CollectGold = 0x801C5868; -CollectSubweapon = 0x801C5944; -CollectHeartVessel = 0x801C5A5C; -CollectLifeVessel = 0x801C5B00; -DestroyCurrentEntity = 0x801C5B50; -EntityPrizeDrop = 0x801C5B78; -EntityExplosion = 0x801C63EC; -BlinkItem = 0x801C64E8; -EntityEquipItemDrop = 0x801C658C; -BlitChar = 0x801C6B74; -EntityRelicOrb = 0x801C6E24; -EntityHeartDrop = 0x801C78F4; -EntityMessageBox = 0x801C7A1C; -CheckColliderOffsets = 0x801C7F78; -EntityUnkId13 = 0x801C8068; -EntityExplosionVariantsSpawner = 0x801C8178; -EntityGreyPuffSpawner = 0x801C82A8; -EntityExplosionVariants = 0x801C8390; -EntityGreyPuff = 0x801C8480; -EntityOlroxDrool = 0x801C8574; UnkCollisionFunc5 = 0x801C87A4; -UnkCollisionFunc4 = 0x801C88A0; -EntityIntenseExplosion = 0x801C8E20; -InitializeUnkEntity = 0x801C8F20; -MakeEntityFromId = 0x801C8FEC; -MakeExplosions = 0x801C90B4; -EntityBigRedFireball = 0x801C916C; -UnkRecursivePrimFunc1 = 0x801C9344; -UnkRecursivePrimFunc2 = 0x801C9924; -ClutLerp = 0x801CA024; PlaySfxPositional = 0x801CA21C; -AxeKnightUnkFunc1 = 0x801CA314; -EntityAxeKnightRotateAxe = 0x801CB848; -EntityAxeKnightThrowingAxe = 0x801CB8A0; -StageNamePopupHelper = 0x801CBB24; -EntityStageNamePopup = 0x801CBCF4; -EntitySoulStealOrb = 0x801CC978; -EntityEnemyBlood = 0x801CCD0C; -EntityRoomForeground = 0x801CD1BC; -BottomCornerText = 0x801CD2A8; -SkeletonAttackCheck = 0x801CD5D8; -EntitySkeleton = 0x801CD670; -EntitySkeletonPieces = 0x801CDB40; -EntitySkeletonThrownBone = 0x801CDC20; -UnusedSkeletonEntity = 0x801CDD24; UnkPrimHelper = 0x801D5AF8; UpdateAnimation = 0x801D5EE0; -FindFirstUnkPrim = 0x801D6030; FindFirstUnkPrim2 = 0x801D6060; -PrimToggleVisibility = 0x801D60DC; -PrimResetNext = 0x801D6164; UnkPolyFunc2 = 0x801D6244; UnkPolyFunc0 = 0x801D6298; -PrimDecreaseBrightness = 0x801D62C4; -g_LayoutObjHorizontal = 0x801D6384; -g_LayoutObjVertical = 0x801D6388; -g_LayoutObjPosHorizontal = 0x801D638C; -g_LayoutObjPosVertical = 0x801D6390; -g_ItemIconSlots = 0x801D7024; diff --git a/config/symbols.us.stno3.txt b/config/symbols.us.stno3.txt index ab44c9a735..71679b93f4 100644 --- a/config/symbols.us.stno3.txt +++ b/config/symbols.us.stno3.txt @@ -1,4 +1,3 @@ -NO3_EntityUpdates = 0x80180924; NO3_EInitBreakable = 0x80180AAC; g_EInitObtainable = 0x80180AB8; g_EInitParticle = 0x80180AC4; @@ -20,7 +19,6 @@ g_eBreakableHitboxes = 0x80180E70; g_eBreakableExplosionTypes = 0x80180E78; g_eBreakableanimSets = 0x80180E80; g_eBreakableDrawModes = 0x80180E90; -g_TrapDoorFlag = 0x8018123C; g_SplashSfx = 0x801813A8; g_SurfacingSfx = 0x801813AA; g_WaterXTbl = 0x801813AC; @@ -28,9 +26,7 @@ g_EntityCastleBridgeUVs = 0x80181940; g_EntityCastleBridgeUVOffsets = 0x80181958; g_EntityCastleBridgePages = 0x80181988; g_EntityCastleBridgePriorities = 0x801819A0; -actor_names = 0x80181ACC; D_80180FE0 = 0x80181C5C; -NO3_PrizeDrops = 0x80181C8C; g_ESoulStealOrbAngles = 0x801826D0; g_ESoulStealOrbSprt = 0x801826E0; g_ESoulStealOrbAnim = 0x80182740; @@ -59,115 +55,18 @@ g_HighWaterSplashParams = 0x801839F4; g_Merman2posPtr = 0x801839FC; g_Merman2velPtr = 0x80183A0C; g_CastleDoorVector = 0x801B73E0; -EntityCavernDoorVase = 0x801B77D4; -EntityUnkId12 = 0x801B78A8; -EntityBreakable = 0x801B7A64; -EntityUnkId16 = 0x801B7B98; -EntityBackgroundLightning = 0x801B7C4C; -EntityShuttingWindow = 0x801B8254; EntityCastleDoor = 0x801B8564; -EntityBackgroundBushes = 0x801B8A74; -EntityBackgroundTrees = 0x801B8ED0; -EntityTransparentWater = 0x801B9198; -EntityCavernDoorLever = 0x801B9650; -EntityCavernDoorPlatform = 0x801B97D0; -EntityCavernDoor = 0x801B989C; -EntityWeightsSwitch = 0x801B9CE8; -EntityPathBlockSmallWeight = 0x801B9E10; -EntityPathBlockTallWeight = 0x801BA0A0; -EntityTrapDoor = 0x801BA348; -EntityMermanRockLeftSide = 0x801BA4C0; -EntityMermanRockRightSide = 0x801BA868; -EntityUnkId26 = 0x801BABE8; -EntityFallingRock2 = 0x801BAD6C; EntityStairwayPiece = 0x801BAEF0; -EntityFallingRock = 0x801BB3BC; -EntityDeathSkySwirl = 0x801BBB8C; -EntityLightningThunder = 0x801BBDC0; -EntityLightningCloud = 0x801BBE70; -EntitySwitch = 0x801BBF38; -EntityHeartRoomGoldDoor = 0x801BC05C; -EntityUnkId49 = 0x801BC3FC; -EntityPushAlucard = 0x801BC4EC; -EntityCastleDoorTransition = 0x801BC780; -EntityForegroundTree = 0x801BC93C; -EntityUnkId50 = 0x801BCC4C; -EntityBackgroundPineTrees = 0x801BCE08; -EntityUnkId52 = 0x801BD564; -EntityCastleBridge = 0x801BD71C; -EntityDistantBackgroundTrees = 0x801BDEB0; -EntityBackgroundCastleWall = 0x801BE080; EntityFlyingOwlAndLeaves = 0x801BE134; -EntityFallingLeaf = 0x801BE444; NO3_EntityCutscene = 0x801BEEB0; EntityRoomTransition2 = 0x801BFF00; -EntityDeathStolenItem = 0x801C033C; EntityDeath = 0x801C083C; -EntityDeathScythe = 0x801C11A4; -EntityDeathScytheShadow = 0x801C12E8; -CreateExplosionPuff = 0x801C13F8; -Random = 0x801C184C; -EntityDamageDisplay = 0x801C2D98; -CreateEntityFromCurrentEntity = 0x801C3EC4; -NO3_EntityRedDoor = 0x801C402C; -DestroyEntity = 0x801C4C64; -AnimateEntity = 0x801C4D94; -GetDistanceToPlayerX = 0x801C4F64; -GetSideToPlayer = 0x801C4FD4; -UnkCollisionFunc3 = 0x801C5074; -UnkCollisionFunc2 = 0x801C52EC; -AllocEntity = 0x801C54D4; -SetStep = 0x801C58A4; -SetSubStep = 0x801C58C4; -InitializeEntity = 0x801C5974; -EntityDummy = 0x801C5A70; EntityPrizeDrop = 0x801C6684; -EntityExplosion = 0x801C6EF8; EntityEquipItemDrop = 0x801C7098; -EntityRelicOrb = 0x801C7930; -EntityHeartDrop = 0x801C8400; -EntityMessageBox = 0x801C8528; -EntityUnkId13 = 0x801C8B74; -EntityExplosionVariantsSpawner = 0x801C8C84; -EntityExplosionVariants = 0x801C8E9C; -EntityGreyPuff = 0x801C8F8C; -EntityIntenseExplosion = 0x801C992C; -PlaySfxPositional = 0x801CAD28; EntityStageNamePopup = 0x801CAFF0; -EntitySoulStealOrb = 0x801CBC74; -EntityEnemyBlood = 0x801CC008; -EntityRoomForeground = 0x801CC4B8; EntityFireWarg = 0x801CC974; -EntityUnkId30 = 0x801CDD80; -EntityUnkId31 = 0x801CDF10; -EntityExplosion3 = 0x801CE2F4; EntityFireWargWaveAttack = 0x801CE98C; EntityUnkId2F = 0x801CED60; -EntityFireWargDeathBeams = 0x801CEF88; EntityWarg = 0x801CF740; -EntityUnkId4B = 0x801D04A4; -EntityWargExplosionPuffTransparent = 0x801D0624; -EntityAlucardWaterEffect = 0x801D0B34; -EntitySplashWater = 0x801D16B4; -EntitySurfacingWater = 0x801D1FC0; -EntitySideWaterSplash = 0x801D24AC; -EntitySmallWaterDrop = 0x801D2840; -EntityWaterDrop = 0x801D2A9C; -CheckMermanEnteringWater = 0x801D2D40; -EntityMerman2 = 0x801D2E4C; -EntityExplosion2 = 0x801D3F38; -EntityMediumWaterSplash = 0x801D4168; -EntityMermanWaterSplash = 0x801D423C; -EntityFallingObject2 = 0x801D4668; -EntityHighWaterSplash = 0x801D4700; -EntityDeadMerman = 0x801D48F8; -EntityMermanSpawner = 0x801D49C4; -EntityMerman = 0x801D4B20; -EntityMermanFireball = 0x801D56D8; -EntityFallingObject = 0x801D583C; -EntityMermanExplosion = 0x801D58D4; -EntityBoneScimitar = 0x801D5AAC; -EntityBoneScimitarParts = 0x801D615C; EntityBat = 0x801D6264; EntityZombie = 0x801D64B0; -EntityZombieSpawner = 0x801D6710; diff --git a/config/symbols.us.stnp3.txt b/config/symbols.us.stnp3.txt index 48d09fffa6..4c4cceab84 100644 --- a/config/symbols.us.stnp3.txt +++ b/config/symbols.us.stnp3.txt @@ -1,6 +1,3 @@ -NP3_gfxBanks = 0x801806DC; -g_EInitSpawner = 0x80180A60; -g_TrapDoorFlag = 0x80181104; g_SplashSfx = 0x8018122C; g_SurfacingSfx = 0x8018122E; g_WaterXTbl = 0x80181230; @@ -36,13 +33,10 @@ g_Merman2velPtr = 0x8018231C; D_801828C8 = 0x801828C8; g_CastleDoorVector = 0x801B1EA0; EntityStairwayPiece = 0x801B5790; -CreateExplosionPuff = 0x801B653C; EntitySlogra = 0x801B6990; EntityGaibon = 0x801B78BC; -NP3_EntityRedDoor = 0x801BB89C; EntityMessageBox = 0x801BFD98; EntityStageNamePopup = 0x801C2860; -CheckMermanEnteringWater = 0x801C6458; EntityMerman2 = 0x801C6564; EntityMerman = 0x801C8238; EntityBoneScimitar = 0x801C91C4; diff --git a/config/symbols.us.stnz0.txt b/config/symbols.us.stnz0.txt index 9aee4a8f0f..259b105cc0 100644 --- a/config/symbols.us.stnz0.txt +++ b/config/symbols.us.stnz0.txt @@ -1,13 +1,3 @@ -g_EntityGfxs = 0x80180888; -g_CallElevator = 0x80180EEC; -g_BossFlag = 0x80181010; -g_ElevatorTarget = 0x801813A4; -g_ElevatorTargetPos = 0x801813A8; -NZ0_PrizeDrops = 0x801813B0; -actor_names = 0x8018146C; -g_eBlueDoorUV = 0x801826B8; -g_eBlueDoorTiles = 0x801826D0; -PlayerIsWithinHitbox = 0x801B0A20; EntityBossFightManager = 0x801B3FCC; EntityBossRoomBlock = 0x801B4518; EntitySlogra = 0x801B4778; diff --git a/config/symbols.us.strwrp.txt b/config/symbols.us.strwrp.txt index f707175240..e69de29bb2 100644 --- a/config/symbols.us.strwrp.txt +++ b/config/symbols.us.strwrp.txt @@ -1,20 +0,0 @@ -g_EInitSmallRocks = 0x801804C4; -WarpRoomCoords = 0x8018065C; -EntityRWarpRoom = 0x801891C0; -EntityWarpSmallRocks = 0x80189E9C; -GetDistanceToPlayerX = 0x8018D880; -InitializeEntity = 0x8018E290; -GetPlayerCollisionWith = 0x8018E634; -CollectGold = 0x8018EC90; -EntityPrizeDrop = 0x8018EFA0; -EntityEquipItemDrop = 0x8018F9B4; -EntityStageNamePopup = 0x8019390C; -DestinationWarpRoom = 0x80195A20; -WarpBackgroundAmplitiude = 0x80195A24; -WarpBackgroundPhase = 0x80195A28; -WarpBackgroundBrightness = 0x80195A2C; -g_LayoutObjHorizontal = 0x80195A30; -g_LayoutObjVertical = 0x80195A34; -g_LayoutObjPosHorizontal = 0x80195A38; -g_LayoutObjPosVertical = 0x80195A3C; -g_ItemIconSlots = 0x801966A8; diff --git a/config/symbols.us.stst0.txt b/config/symbols.us.stst0.txt index 97bcdc18d3..306530a937 100644 --- a/config/symbols.us.stst0.txt +++ b/config/symbols.us.stst0.txt @@ -1,60 +1,18 @@ -ST0_EntityUpdates = 0x801804BC; -ST0_EInitBreakable = 0x80180574; -g_EInitObtainable = 0x80180580; -g_EInitParticle = 0x8018058C; -g_EInitUnkId13 = 0x801805A4; -g_EInitCommon = 0x801805BC; -g_EInitDamageNum = 0x801805C8; g_EInit3DObject = 0x801805D4; -ST0_RedDoorTiles = 0x8018064C; -g_isSecretStairsButtonPressed = 0x8018089C; -g_isDraculaFirstFormDefeated = 0x8018090C; g_collectVelocity = 0x80181E3C; -g_ESoulStealOrbAngles = 0x80181F54; -g_ESoulStealOrbSprt = 0x80181F64; -g_ESoulStealOrbAnim = 0x80181FC4; -D_80183D1C = 0x80183D1C; -D_80197F80 = 0x80197F80; -D_8019A40C = 0x8019A40C; c_HeartPrizes = 0x801A7C84; -PlayerIsWithinHitbox = 0x801A7E2C; -EntityLockCamera = 0x801A7EB0; ST0_EntityCutscene = 0x801A9210; EntityCutscene = 0x801AA290; EntitySecretButton = 0x801AA8DC; -EntitySecretStairsCeiling = 0x801AABA4; EntitySecretStairs = 0x801AACB4; EntityStageTitleFadeout = 0x801AB0C8; EntityStageTitleCard = 0x801AB5E4; EntityDracula = 0x801AC564; -EntityDraculaBody = 0x801AD430; -EntityDraculaFireball = 0x801AD530; -EntityDraculaMeteorball = 0x801AD658; -EntityDraculaGlass = 0x801AD8C0; EntityDraculaFinalForm = 0x801ADD60; -EntityDraculaMegaFireball = 0x801AEFD8; -EntityDraculaRainAttack = 0x801AF154; PrologueScroll = 0x801B0464; -EntityDamageDisplay = 0x801B2A3C; -CreateEntityFromCurrentEntity = 0x801B3B68; -ST0_EntityRedDoor = 0x801B3CD0; DestroyEntity = 0x801B4908; -AllocEntity = 0x801B53CC; -SetStep = 0x801B5794; InitializeEntity = 0x801B584C; -EntityDummy = 0x801B5948; -EntityPrizeDrop = 0x801B6358; -EntityExplosion = 0x801B6B60; EntityEquipItemDrop = 0x801B6D34; -EntityUnkId13 = 0x801B7BFC; -EntityExplosionVariants = 0x801B7F24; -EntityGreyPuff = 0x801B8014; -EntityIntenseExplosion = 0x801B89B4; -EntitySoulStealOrb = 0x801B9EA8; -EntityRoomForeground = 0x801BA6EC; EntityClouds = 0x801BAB08; EntityClockTower3D = 0x801BB2AC; EntityCutscenePhotograph = 0x801BB764; -EntityCutscenePhotographFire = 0x801BC4D0; -EntityBackgroundVortex = 0x801BE1B4; -g_Dialogue = 0x801c24cc; // type:s32 size:0x44 diff --git a/config/symbols.us.tt_000.txt b/config/symbols.us.tt_000.txt index 4ad02e3396..e69de29bb2 100644 --- a/config/symbols.us.tt_000.txt +++ b/config/symbols.us.tt_000.txt @@ -1,5 +0,0 @@ -g_PlaySfxStep = 0x80171090; -CheckEntityValid = 0x801713C8; -CalculateAngleToEntity = 0x80173F30; -GetTargetPositionWithDistanceBuffer = 0x80173F74; -s_IsServantDestroyed = 0x80174D3C; diff --git a/config/symbols.us.tt_001.txt b/config/symbols.us.tt_001.txt index c00af2f000..e69de29bb2 100644 --- a/config/symbols.us.tt_001.txt +++ b/config/symbols.us.tt_001.txt @@ -1,17 +0,0 @@ -g_ServantSpriteParts = 0x80170040; -g_Events = 0x801705B0; -g_PlaySfxStep = 0x80170EE0; -g_EntityRanges = 0x80170EE4; -g_EventQueue = 0x80170EEC; -g_CurrentServant = 0x80170EF0; -g_CurrentRoomX = 0x80170EF4; -g_CurrentRoomY = 0x80170EF8; -SetEntityAnimation = 0x80170F60; -UpdateEntityVelocityTowardsTarget = 0x80170F84; -CheckEntityValid = 0x801714F4; -DestroyServantEntity = 0x80172904; -DestroyEntity = 0x80172AE4; -CalculateAngleToEntity = 0x80172C08; -GetTargetPositionWithDistanceBuffer = 0x80172C4C; -ServantUnk0 = 0x8017353C; -s_IsServantDestroyed = 0x8017381C; diff --git a/config/symbols.us.tt_002.txt b/config/symbols.us.tt_002.txt index f9b4b66706..e69de29bb2 100644 --- a/config/symbols.us.tt_002.txt +++ b/config/symbols.us.tt_002.txt @@ -1,42 +0,0 @@ -thisFamiliar = 0x800736C8; -g_FaerieSpriteParts = 0x80170040; -g_FaerieClut = 0x801722E8; -g_FaerieAnimationFrames = 0x80172B14; -g_Events = 0x80172D2C; -g_PlaySfxStep = 0x8017365C; -g_EntityRanges = 0x80173660; -g_EventQueue = 0x80173668; -g_CurrentServant = 0x8017366C; -g_CurrentRoomX = 0x80173670; -g_CurrentRoomY = 0x80173674; -SetAnimationFrame = 0x80173994; -unused_39C8 = 0x801739C8; -CreateEventEntity_Dupe = 0x80173B14; -ServantInit = 0x801746E8; -ServantUpdateAnim = 0x8017865C; -DestroyEntity = 0x80178804; -AccumulateTowardZero = 0x80178870; -SearchForEntityInRange = 0x801788A8; -CalculateAngleToEntity = 0x80178928; -GetTargetPositionWithDistanceBuffer = 0x8017896C; -CalculateDistance = 0x801789E0; -ProcessSfxState = 0x80178A30; -ProcessEvent = 0x80178C08; -CreateEventEntity = 0x80178FDC; -IsMovementAllowed = 0x80179098; -CheckAllEntitiesValid = 0x801791B0; -ServantUnk0 = 0x8017925C; -s_ServantId = 0x801792DC; -s_zPriority = 0x801792E0; -s_FaerieStats = 0x801792E4; -D_us_80179310 = 0x80179310; -D_us_80179314 = 0x80179314; -D_us_80179318 = 0x80179318; -s_TargetLocationX = 0x80179324; -s_TargetLocationY = 0x80179328; -s_TargetLocationX_calc = 0x8017932C; -s_TargetLocationY_calc = 0x80179330; -s_AngleToTarget = 0x80179334; -s_AllowedAngle = 0x80179338; -s_DistToTargetLocation = 0x8017933C; -s_TargetLocOffset_calc = 0x80179340; diff --git a/config/symbols.us.tt_003.txt b/config/symbols.us.tt_003.txt index 2f866f0922..e69de29bb2 100644 --- a/config/symbols.us.tt_003.txt +++ b/config/symbols.us.tt_003.txt @@ -1,54 +0,0 @@ -g_DemonSpriteParts = 0x80170040; -g_ServantClut = 0x80171990; -g_DemonAttackSelector = 0x801719F0; -g_DemonAbilityStats = 0x80171A68; -g_DemonAttackIdSfxLookup = 0x80171B08; -g_DemonClut = 0x80171C24; -g_AttackFunctions = 0x80171CC4; -g_DemonSfxMap = 0x80171D2C; -g_DemonAnimationFrames = 0x80172010; -g_SfxDemonSwitchRandomizer = 0x80172080; -g_Events = 0x80172090; -g_PlaySfxStep = 0x801729C0; -g_EntityRanges = 0x801729C4; -g_EventQueue = 0x801729CC; -g_CurrentServant = 0x801729D0; -g_CurrentRoomX = 0x801729D4; -g_CurrentRoomY = 0x801729D8; -SetAnimationFrame = 0x80172A68; -FindValidTarget = 0x80172A9C; -CheckEntityValid = 0x80172D50; -unused_2DBC = 0x80172DBC; -DestroyEntityPassthrough = 0x80172ED8; -ServantInit = 0x801744CC; -UpdateServantDefault = 0x8017472C; -UpdateServantSfxPassthrough = 0x80176544; -UpdateEventAttack = 0x80176564; -ServantUpdateAnim = 0x80177750; -DestroyEntity = 0x801778F8; -AccumulateTowardZero = 0x80177964; -SearchForEntityInRange = 0x8017799C; -CalculateAngleToEntity = 0x80177A1C; -GetTargetPositionWithDistanceBuffer = 0x80177A60; -CalculateDistance = 0x80177AD4; -ProcessSfxState = 0x80177B24; -ProcessEvent = 0x80177CFC; -CreateEventEntity = 0x801780D0; -IsMovementAllowed = 0x8017818C; -CheckAllEntitiesValid = 0x801782A4; -ServantUnk0 = 0x80178350; -s_TargetMatch = 0x801783C4; -s_TargetLocationX = 0x801785C4; -s_TargetLocationY = 0x801785C8; -s_TargetLocationX_calc = 0x801785CC; -s_TargetLocationY_calc = 0x801785D0; -s_AngleToTarget = 0x801785D4; -s_AllowedAngle = 0x801785D8; -s_DistToTargetLocation = 0x801785DC; -s_TargetLocOffset_calc = 0x801785E0; -s_DeltaX = 0x801785E4; -s_DeltaY = 0x801785E8; -s_DistToTargetLocation2 = 0x801785EC; -s_ServantId = 0x80178690; -s_DemonStats = 0x80178694; -s_LastTargetedEntityIndex = 0x801786E0; diff --git a/config/symbols.us.tt_004.txt b/config/symbols.us.tt_004.txt index ff89998d7f..58c4e3a6ed 100644 --- a/config/symbols.us.tt_004.txt +++ b/config/symbols.us.tt_004.txt @@ -1,34 +1,13 @@ -g_ServantClut = 0x80170040; D_us_80170080_y = 0x80170084; D_us_80170080_z = 0x80170088; -g_SwordClut = 0x801701D8; -g_Events = 0x801719E4; -g_PlaySfxStep = 0x80172314; -g_EntityRanges = 0x80172318; -g_EventQueue = 0x80172320; -g_CurrentServant = 0x80172324; -g_CurrentRoomX = 0x80172328; -g_CurrentRoomY = 0x8017232C; Max3 = 0x80172B8C; -Min3 = 0x80172C0C; CheckEntityValid = 0x80173C4C; CheckSwordLevel = 0x80173CB8; ServantInit = 0x80173E38; UpdateServantDefault = 0x80174170; -func_us_80177F64 = 0x80177460; -ServantUpdateAnim = 0x8017763C; DestroyEntity = 0x801777E4; -AccumulateTowardZero = 0x80177850; -SearchForEntityInRange = 0x80177888; -CalculateAngleToEntity = 0x80177908; GetTargetPositionWithDistanceBuffer = 0x8017794C; CalculateDistance = 0x801779C0; -ProcessSfxState = 0x80177A10; ProcessEvent = 0x80177BE8; -CreateEventEntity = 0x80177FBC; -IsMovementAllowed = 0x80178078; -CheckAllEntitiesValid = 0x80178190; ServantUnk0 = 0x8017823C; s_SwordStats = 0x8017864C; -s_SwordStats_unk8 = 0x80178654; -s_SwordCurrentLevel = 0x80178658; diff --git a/config/undefined_syms.hd.txt b/config/undefined_syms.hd.txt index bc266b66e7..19c47cff56 100644 --- a/config/undefined_syms.hd.txt +++ b/config/undefined_syms.hd.txt @@ -26,6 +26,8 @@ g_pads = 0x80097490; g_Status = 0x80097964; D_80097C98 = 0x80097C98; +g_ServantDesc = 0x80170000; + D_801A0E5C = 0x801A0E5C; D_801A4E6C = 0x801A4E6C; D_801A6E7C = 0x801A6E7C; diff --git a/config/undefined_syms.us.txt b/config/undefined_syms.us.txt index 96c64cd05f..cfeb13760e 100644 --- a/config/undefined_syms.us.txt +++ b/config/undefined_syms.us.txt @@ -24,6 +24,8 @@ g_pads = 0x80097490; g_Status = 0x80097964; D_80097C98 = 0x80097C98; +g_ServantDesc = 0x80170000; + D_801A0E5C = 0x801A0E5C; D_801A4E6C = 0x801A4E6C; D_801A6E7C = 0x801A6E7C; From 13234eb47da28651211ce43d7050a7d62454dc91 Mon Sep 17 00:00:00 2001 From: AlChar Date: Fri, 10 Jan 2025 11:54:01 -0500 Subject: [PATCH 2/3] Decompile `no1` func_us_801BBD90 (#2051) PSX: https://decomp.me/scratch/MFutm PSP: https://decomp.me/scratch/A1EOb --- include/entity.h | 16 ++- src/st/no1/unk_35E20.c | 278 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 292 insertions(+), 2 deletions(-) diff --git a/include/entity.h b/include/entity.h index 7772a152e6..83ddada2a5 100644 --- a/include/entity.h +++ b/include/entity.h @@ -2329,7 +2329,7 @@ typedef struct { /* 0x86 */ u8 unk86; /* 0x87 */ u8 unk87; /* 0x88 */ s16 unk88; - /* 0x88 */ s16 : 16; + /* 0x8A */ s16 : 16; /* 0x8C */ s16 unk8C; /* 0x8E */ s16 : 16; /* 0x90 */ struct Primitive* unk90; @@ -2390,6 +2390,19 @@ typedef struct { /* 0x80 */ struct Primitive* unk80; } ET_801B7188; +typedef struct { + /* 0x7C */ struct Primitive* unk7C; + /* 0x80 */ s32 : 32; + /* 0x84 */ u8 : 8; + /* 0x85 */ u8 : 8; + /* 0x86 */ u8 : 8; + /* 0x87 */ u8 unk87; + /* 0x88 */ s16 unk88; + /* 0x8A */ s16 : 16; + /* 0x8C */ s16 unk8C; + /* 0x8E */ s16 : 16; +} ET_801BBD90; + typedef struct { /* 0x7C */ s16 unk0; /* 0x7E */ s16 : 16; @@ -2597,6 +2610,7 @@ typedef union { // offset=0x7C ET_MedusaHead medusaHead; ET_801B9304 et_801B9304; ET_801B7188 et_801B7188; + ET_801BBD90 et_801BBD90; } Ext; #define SYNC_FIELD(struct1, struct2, field) \ diff --git a/src/st/no1/unk_35E20.c b/src/st/no1/unk_35E20.c index 56f2192ca6..7d0acff4a1 100644 --- a/src/st/no1/unk_35E20.c +++ b/src/st/no1/unk_35E20.c @@ -1580,7 +1580,283 @@ INCLUDE_ASM("st/no1/nonmatchings/unk_35E20", func_us_801BB7B8); INCLUDE_ASM("st/no1/nonmatchings/unk_35E20", func_us_801BB984); -INCLUDE_ASM("st/no1/nonmatchings/unk_35E20", func_us_801BBD90); +extern u16 D_us_801809F8[]; +extern RECT D_us_801B47B0; +extern s32 D_psp_08C62AA4; + +void func_us_801BBD90(Entity* self) { + s16 dx, dy; + s16 var9a; + s32 primIndex; + s32 dx2; + Entity* tempEntity; + DRAWENV drawEnv; + DR_ENV* dr_env; + s16 dAngle; + s16 posX, posY; + s16 angle; + s32 i; + s16 magnitude; + s16 temp; + Primitive* prim; + s32 dy2; + RECT unused; + u8 padding[4]; + + unused = D_us_801B47B0; + tempEntity = self - 1; + self->posX.i.hi = tempEntity->posX.i.hi; + self->posY.i.hi = tempEntity->posY.i.hi - 0x22; + magnitude = 8; + switch (self->step) { + case 0: + InitializeEntity(D_us_801809F8); + self->animCurFrame = 0; + break; + + case 1: + primIndex = g_api.func_800EDB58(PRIM_GT4, 0x20); + if (primIndex != -1) { + self->flags |= FLAG_HAS_PRIMS; + self->primIndex = primIndex; + prim = &g_PrimBuf[primIndex]; + dr_env = g_api.func_800EDB08((POLY_GT4*)prim); + if (dr_env == NULL) { + DestroyEntity(self); + return; + } + prim->type = PRIM_ENV; + drawEnv = g_CurrentBuffer->draw; + drawEnv.isbg = 1; + drawEnv.r0 = 0; + drawEnv.g0 = 0; + drawEnv.b0 = 0; + drawEnv.clip.x = 0; + drawEnv.clip.w = 0x20; + drawEnv.clip.y = 0x100; + drawEnv.clip.h = 0x100; + drawEnv.ofs[0] = 0; + drawEnv.ofs[1] = 0x100; + SetDrawEnv(dr_env, &drawEnv); + prim->priority = 0x11F; + prim->drawMode = DRAW_HIDE; + prim = prim->next; + dr_env = g_api.func_800EDB08((POLY_GT4*)prim); + if (dr_env == NULL) { + DestroyEntity(self); + return; + } + prim->type = PRIM_ENV; + prim->priority = 0x121; + prim->drawMode = DRAW_UNK_800 | DRAW_HIDE; + prim = prim->next; + + self->ext.et_801BBD90.unk7C = prim; +#ifdef VERSION_PSP + prim->tpage = 0x8010; +#else + prim->tpage = 0x10; +#endif + prim->clut = 0x2F; + prim->u0 = 0; + prim->u1 = prim->u0 + 0x10; + prim->u2 = prim->u0; + prim->u3 = prim->u1; + prim->v0 = 0; + prim->v1 = prim->v0; + prim->v2 = 0xFF; + prim->v3 = prim->v2; + prim->priority = 0x69; + prim = prim->next; + + while (prim != NULL) { + prim->tpage = 0x10E; + prim->clut = 0x2F; + prim->u0 = 0x3E; + prim->u1 = prim->u0 + 2; + prim->u2 = prim->u0; + prim->u3 = prim->u1; + prim->v0 = 0xC0; + prim->v1 = prim->v0; + prim->v2 = prim->v0 + 0x10; + prim->v3 = prim->v2; + prim->priority = 0x120; + prim->drawMode = DRAW_DEFAULT; + prim = prim->next; + } + } else { + DestroyEntity(self); + return; + } + + self->step++; + break; + + case 2: + prim = &g_PrimBuf[self->primIndex]; + prim->drawMode = DRAW_DEFAULT; + prim = prim->next; + prim->drawMode = DRAW_UNK_800; + prim = prim->next; + prim = self->ext.et_801BBD90.unk7C; + prim = prim->next; + posX = 0; + posY = 0; + while (prim != NULL) { + prim->tpage = 0x10E; + prim->x0 = prim->x2 = posX; + prim->y0 = prim->y1 = posY; + prim->x1 = prim->x3 = prim->x2 + 2; + posY = prim->y2 = prim->y3 = prim->y0 + 0x10; + prim = prim->next; + } + self->step_s = 0; + self->step++; + break; + + case 3: + if (!self->step_s) { + prim = &g_PrimBuf[self->primIndex]; + prim->drawMode = DRAW_HIDE; + prim = prim->next; + prim->drawMode = DRAW_HIDE; + prim = prim->next; + prim = self->ext.et_801BBD90.unk7C; + prim = prim->next; + while (prim != NULL) { + prim->v0 = prim->v1 = 0xC0; + prim->v2 = prim->v3 = 0xC8; + prim = prim->next; + } + self->step_s++; +#ifdef VERSION_PSP + D_psp_08C62AA4 = 1; +#endif + } + if ((self->posX.i.hi & 0x100) || (self->posY.i.hi < 0)) { + prim = self->ext.et_801BBD90.unk7C; + while (prim != NULL) { + prim->drawMode = DRAW_HIDE; + prim = prim->next; + } + } else { + i = 0; + dAngle = 0; + posX = self->posX.i.hi; + posY = self->posY.i.hi; + posX -= 4; + if (posY > 0xF0) { + posY = (self->posY.i.hi & 0xF) + 0xF0; + } + tempEntity = self - 1; + if (tempEntity->ext.et_801BBD90.unk87) { + if (tempEntity->velocityY < 0) { + self->ext.et_801BBD90.unk8C += 0x60; + } else { + if (self->ext.et_801BBD90.unk8C > 0) { + self->ext.et_801BBD90.unk8C -= 0x30; + } else { + self->ext.et_801BBD90.unk8C += 0x30; + } + } + } else if (self->ext.et_801BBD90.unk8C) { + if (self->ext.et_801BBD90.unk8C > 0) { + self->ext.et_801BBD90.unk8C -= 0x30; + } else { + self->ext.et_801BBD90.unk8C += 0x30; + } + } + prim = self->ext.et_801BBD90.unk7C; + if (!self->ext.et_801BBD90.unk8C) { + prim->drawMode = DRAW_UNK02; + prim->priority = 0x69; + prim->x0 = prim->x2 = posX; + prim->y2 = prim->y3 = posY; + prim->x1 = prim->x0 + 0x10; + prim->x3 = prim->x2 + 0x10; + prim->y0 = prim->y1 = prim->y2 - 0xF0; + prim->v2 = prim->v3 = 0xFF; + temp = g_Tilemap.scrollY.i.hi + prim->y0; + if (temp < 0x300) { + prim->y0 = 0x300 - g_Tilemap.scrollY.i.hi; + prim->y1 = prim->y0; + } + prim->v0 = prim->v1 = prim->v2 - (prim->y2 - prim->y0); + prim = prim->next; + while (prim != NULL) { + prim->drawMode = DRAW_HIDE; + prim = prim->next; + } + } else { + prim->drawMode = DRAW_HIDE; + prim = prim->next; + angle = self->ext.et_801BBD90.unk8C; + angle &= 0xFFF; + while (prim != NULL) { +#ifdef VERSION_PSP + prim->tpage = 0x10; + prim->u0 = prim->u2 = 0; + prim->u1 = prim->u3 = 4; + prim->v0 = prim->v1 = 0; + prim->v2 = prim->v3 = 0x10; +#else + prim->tpage = 0xE; + prim->u0 = -6; + prim->u3 = prim->u1 = -2; + prim->u2 = -6; +#endif + prim->priority = 0x69; + prim->x2 = posX; + prim->y2 = posY; + dx = -(magnitude * rsin(angle)) >> 0xC; + dy = -(magnitude * rcos(angle)) >> 0xC; + prim->x0 = posX + dx; + prim->y0 = posY + dy; + prim->x1 = prim->x0 + 4; + prim->x3 = prim->x2 + 4; + prim->y1 = prim->y0; + prim->y3 = prim->y2; + if (i == 0) { + i = 4; + dx2 = self->posX.i.hi - 4 - prim->x0; + dy2 = 0x10; + var9a = ratan2(-dx2, dy2); + dAngle = var9a - angle; + if (dAngle > 0x800) { + dAngle = 0x1000 - dAngle; + } + if (dAngle < -0x800) { + dAngle = dAngle + 0x1000; + } + dAngle /= 4; + } + angle += dAngle; + angle &= 0xFFF; + posX = prim->x0; + posY = prim->y0; + prim->drawMode = DRAW_UNK02; + if (prim->y2 < -0x10) { + break; + } + temp = g_Tilemap.scrollY.i.hi + prim->y0; + if (temp < 0x300) { + prim->y0 = 0x300 - g_Tilemap.scrollY.i.hi; + prim->y1 = prim->y0; + break; + } + i--; + prim = prim->next; + } + + while (prim != NULL) { + prim->drawMode = DRAW_HIDE; + prim = prim->next; + } + } + } + break; + } +} INCLUDE_ASM("st/no1/nonmatchings/unk_35E20", func_us_801BC598); From 7830dae08a66fae1378b2107581621d0bf2deac2 Mon Sep 17 00:00:00 2001 From: Josh Schreuder <681706+JoshSchreuder@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:12:20 +1100 Subject: [PATCH 3/3] Update `create_entity` funcs for PSP (#2052) Matched with codesharing for WRP and ST0 --- Makefile.psp.mk | 4 +- config/splat.pspeu.stst0.yaml | 6 ++- config/splat.pspeu.stwrp.yaml | 4 +- config/symbols.pspeu.stst0.txt | 2 + config/symbols.pspeu.txt | 3 +- config/undefined_syms.pspeu.txt | 3 +- src/st/create_entities_horizontal.h | 37 +++++++++++---- src/st/create_entities_right.h | 32 +++++++++---- src/st/create_entities_vertical.h | 70 +++++++++++++++++++++-------- src/st/find_entity_horizontal.h | 14 +++--- src/st/find_entity_vertical.h | 5 +-- src/st/init_room_entities.h | 46 ++++++++++--------- src/st/st0_psp/create_entity.c | 33 -------------- src/st/wrp_psp/create_entity.c | 32 ------------- src/st/wrp_psp/st_init_wrp.c | 5 +-- 15 files changed, 151 insertions(+), 145 deletions(-) delete mode 100644 src/st/st0_psp/create_entity.c delete mode 100644 src/st/wrp_psp/create_entity.c diff --git a/Makefile.psp.mk b/Makefile.psp.mk index e2811c062d..cda488b9a2 100644 --- a/Makefile.psp.mk +++ b/Makefile.psp.mk @@ -91,10 +91,10 @@ $(BUILD_DIR)/dra.elf: $(BUILD_DIR)/dra.ld $(addprefix $(BUILD_DIR)/src/dra/,$(ad $(BUILD_DIR)/tt_%.elf: $(BUILD_DIR)/tt_%.ld $$(call list_o_files_psp,servant/tt_$$*) $(BUILD_DIR)/assets/servant/tt_%/mwo_header.bin.o $(call link_with_deadstrip,tt_$*,$@) -ST_ST0_MERGE = title_card popup e_room_fg st_common collision e_lock_camera st_update e_red_door +ST_ST0_MERGE = title_card popup e_room_fg st_common collision e_lock_camera st_update e_red_door create_entity $(BUILD_DIR)/stst0.elf: $(BUILD_DIR)/stst0.ld $(addprefix $(BUILD_DIR)/src/st/st0/,$(addsuffix .c.o,$(ST_ST0_MERGE))) $$(call list_o_files_psp,st/st0_psp) $(BUILD_DIR)/assets/st/st0/mwo_header.bin.o $(call link_with_deadstrip,stst0,$@) -ST_WRP_MERGE = st_update e_particles e_room_fg st_common st_debug e_breakable popup warp e_red_door +ST_WRP_MERGE = st_update e_particles e_room_fg st_common st_debug e_breakable popup warp e_red_door create_entity $(BUILD_DIR)/stwrp.elf: $(BUILD_DIR)/stwrp.ld $(addprefix $(BUILD_DIR)/src/st/wrp/,$(addsuffix .c.o,$(ST_WRP_MERGE))) $$(call list_o_files_psp,st/wrp_psp) $(BUILD_DIR)/assets/st/wrp/mwo_header.bin.o $(call link_with_deadstrip,stwrp,$@) diff --git a/config/splat.pspeu.stst0.yaml b/config/splat.pspeu.stst0.yaml index c2292f50a0..f3ff245cf6 100644 --- a/config/splat.pspeu.stst0.yaml +++ b/config/splat.pspeu.stst0.yaml @@ -58,7 +58,7 @@ segments: - [0xFD18, c, st0_psp/st_debug] - [0xFDF8, c, st0_psp/2A218] - [0x10678, c, st0/e_lock_camera] - - [0x10A00, c, st0_psp/create_entity] + - [0x10A00, c, st0/create_entity] - [0x119A8, c, st0/e_red_door] - [0x12CB0, c, st0/st_update] - [0x131E8, c, st0_psp/e_particles_maria1] @@ -94,5 +94,7 @@ segments: - [0x42650, .rodata, st0/e_red_door] - [0x42668, .rodata, st0_psp/e_collect] - [0x426A0, .rodata, st0_psp/3D8F0] - - { type: bss, vram: 0x9279D80 } + - [0x42700, bss, 42700] + - [0x44460, .bss, st0/create_entity] + - [0x44480, bss, 44480] - [0x42700] diff --git a/config/splat.pspeu.stwrp.yaml b/config/splat.pspeu.stwrp.yaml index 6c906524cd..42d3b46257 100644 --- a/config/splat.pspeu.stwrp.yaml +++ b/config/splat.pspeu.stwrp.yaml @@ -42,7 +42,7 @@ segments: align: 128 subalign: 8 subsegments: - - [0x80, c, wrp_psp/create_entity] + - [0x80, c, wrp/create_entity] - [0x1028, c, wrp_psp/e_stage_name] - [0x1EA8, c, wrp/e_red_door] - [0x31B0, c, wrp/st_update] @@ -133,7 +133,7 @@ segments: - [0x14498, .rodata, wrp_psp/e_collect] - [0x144D0, .rodata, wrp_psp/e_misc] - [0x144F8, .rodata, wrp/warp] - - [0x14500, .bss, wrp_psp/create_entity] + - [0x14500, .bss, wrp/create_entity] - [0x14520, .bss, wrp_psp/e_collect] - [0x14560, .bss, wrp_psp/bss] - [0x14580] diff --git a/config/symbols.pspeu.stst0.txt b/config/symbols.pspeu.stst0.txt index d68843058b..6f621e20f5 100644 --- a/config/symbols.pspeu.stst0.txt +++ b/config/symbols.pspeu.stst0.txt @@ -143,6 +143,8 @@ g_eDamageDisplayClut = 0x09279978; eRoomForegroundInit = 0x092799B0; D_80180908 = 0x09279DA0; D_80180660 = 0x0927BAD8; +g_LayoutObjPosVertical = 0x0927BAE0; +g_LayoutObjPosHorizontal = 0x0927BAE8; g_LayoutObjVertical = 0x0927BAF0; g_LayoutObjHorizontal = 0x0927BAF8; g_ItemIconSlots = 0x0927BB00; diff --git a/config/symbols.pspeu.txt b/config/symbols.pspeu.txt index 561c2631d7..f5258c0be4 100644 --- a/config/symbols.pspeu.txt +++ b/config/symbols.pspeu.txt @@ -38,9 +38,8 @@ gte_stszotz = 0x89294B4; SsUtSetVVol = 0x0892F75C; D_psp_08B42060 = 0x08B42060; D_08C6BC30 = 0x08C6BC30; -D_08C6BC34 = 0x08C6BC34; +g_pStObjLayoutVertical = 0x08C6BC34; g_pStObjLayoutHorizontal = 0x08C6BC38; -g_pStObjLayoutVertical = 0x08C6BC3C; g_StageId = 0x091CE5B8; g_unkGraphicsStruct = 0x091CE5F8; g_randomNext = 0x091CE6B0; diff --git a/config/undefined_syms.pspeu.txt b/config/undefined_syms.pspeu.txt index 067e6205fe..e1156c0308 100644 --- a/config/undefined_syms.pspeu.txt +++ b/config/undefined_syms.pspeu.txt @@ -1,8 +1,7 @@ D_psp_08B42060 = 0x08B42060; D_08C6BC30 = 0x08C6BC30; -D_08C6BC34 = 0x08C6BC34; +g_pStObjLayoutVertical = 0x08C6BC34; g_pStObjLayoutHorizontal = 0x08C6BC38; -g_pStObjLayoutVertical = 0x08C6BC3C; g_StageId = 0x091CE5B8; g_unkGraphicsStruct = 0x091CE5F8; g_ScrollDeltaX = 0x091CE698; diff --git a/src/st/create_entities_horizontal.h b/src/st/create_entities_horizontal.h index 56369bd9e1..fb6f26bcd5 100644 --- a/src/st/create_entities_horizontal.h +++ b/src/st/create_entities_horizontal.h @@ -8,15 +8,16 @@ * - Parameters: * - posX - the new left extent */ -void CreateEntitiesToTheLeft(s16 posX) { - u8 flag; +static void CreateEntitiesToTheLeft(s16 posX) { + u16* layoutObjHorizontal; s32 expected; + u8 flag; if (posX < 0) { posX = 0; } - if (g_LayoutObjPosHorizontal == LAYOUT_OBJ_POSITION_FORWARD) { + if (!g_LayoutObjPosHorizontal) { FindFirstEntityToTheLeft(posX - g_ScrollDeltaX); g_LayoutObjPosHorizontal = LAYOUT_OBJ_POSITION_BACKWARD; } @@ -26,17 +27,35 @@ void CreateEntitiesToTheLeft(s16 posX) { #else if (true) { #endif - if (g_LayoutObjHorizontal[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_START || - posX > g_LayoutObjHorizontal[LAYOUT_OBJ_POS_X]) { + layoutObjHorizontal = g_LayoutObjHorizontal; + if (layoutObjHorizontal[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_START) { + return; + } + + if (posX > layoutObjHorizontal[LAYOUT_OBJ_POS_X]) { return; } + flag = (layoutObjHorizontal[LAYOUT_OBJ_SLOT] >> 8); +#ifdef VERSION_PSP + if (flag--) { + if (!(g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F)))) { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); + } + } else { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); + } +#else expected = 0; - flag = (g_LayoutObjHorizontal[LAYOUT_OBJ_SLOT] >> 8) + 0xFF; - if (flag == 0xFF || - (g_entityDestroyed[flag >> 5] & (1 << (flag & 0x1F))) == expected) { - CreateEntityWhenInVerticalRange(g_LayoutObjHorizontal); + if (--flag == 0xFF || (g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F))) == expected) { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); } +#endif g_LayoutObjHorizontal -= sizeof(LayoutEntity) / sizeof(u16); } } diff --git a/src/st/create_entities_right.h b/src/st/create_entities_right.h index 362ec55434..15caa5cf16 100644 --- a/src/st/create_entities_right.h +++ b/src/st/create_entities_right.h @@ -6,30 +6,46 @@ * - Parameters: * - posX - the new right extent */ -void CreateEntitiesToTheRight(s16 posX) { +static void CreateEntitiesToTheRight(s16 posX) { + u16* layoutObjHorizontal; s32 expected; u8 flag; // if previously scrolling left, scan right to the // previous x delta and start traversal from there // otherwise keep going from the current position. - if (g_LayoutObjPosHorizontal != LAYOUT_OBJ_POSITION_FORWARD) { + if (g_LayoutObjPosHorizontal) { FindFirstEntityToTheRight(posX - g_ScrollDeltaX); g_LayoutObjPosHorizontal = LAYOUT_OBJ_POSITION_FORWARD; } while (true) { - if (g_LayoutObjHorizontal[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_END || - posX < g_LayoutObjHorizontal[LAYOUT_OBJ_POS_X]) { + layoutObjHorizontal = g_LayoutObjHorizontal; + if (layoutObjHorizontal[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_END || + posX < layoutObjHorizontal[LAYOUT_OBJ_POS_X]) { break; } + flag = (layoutObjHorizontal[LAYOUT_OBJ_SLOT] >> 8); +#ifdef VERSION_PSP + if (flag--) { + if (!(g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F)))) { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); + } + } else { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); + } +#else expected = 0; - flag = (g_LayoutObjHorizontal[LAYOUT_OBJ_SLOT] >> 8) + 0xFF; - if (flag == 0xFF || (g_unkGraphicsStruct.D_80097428[flag >> 5] & - (1 << (flag & 0x1F))) == expected) { - CreateEntityWhenInVerticalRange(g_LayoutObjHorizontal); + if (--flag == 0xFF || (g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F))) == expected) { + CreateEntityWhenInVerticalRange( + (LayoutEntity*)g_LayoutObjHorizontal); } +#endif g_LayoutObjHorizontal += sizeof(LayoutEntity) / sizeof(u16); } } diff --git a/src/st/create_entities_vertical.h b/src/st/create_entities_vertical.h index f429b3b96e..cfbd87f0d4 100644 --- a/src/st/create_entities_vertical.h +++ b/src/st/create_entities_vertical.h @@ -6,27 +6,44 @@ * - Parameters: * - posY - the new top extent */ -void CreateEntitiesAbove(s16 posY) { - u8 flag; +static void CreateEntitiesAbove(s16 posY) { + u16* layout; s32 expected; + u8 flag; - if (g_LayoutObjPosVertical != LAYOUT_OBJ_POSITION_FORWARD) { + if (g_LayoutObjPosVertical) { FindFirstEntityAbove(posY - g_ScrollDeltaY); g_LayoutObjPosVertical = LAYOUT_OBJ_POSITION_FORWARD; } while (true) { - if (g_LayoutObjVertical[LAYOUT_OBJ_POS_Y] == LAYOUT_OBJ_END || - posY < g_LayoutObjVertical[LAYOUT_OBJ_POS_Y]) { + layout = &g_LayoutObjVertical[LAYOUT_OBJ_POS_Y]; + + if (layout[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_END || + posY < layout[LAYOUT_OBJ_POS_X]) { break; } + flag = layout[LAYOUT_OBJ_ID] >> 8; +#ifdef VERSION_PSP + if (flag--) { + if (!(g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F)))) { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); + } + } else { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); + } +#else expected = 0; - flag = (g_LayoutObjVertical[LAYOUT_OBJ_SLOT] >> 8) + 0xFF; - if (flag == 0xFF || - (g_entityDestroyed[flag >> 5] & (1 << (flag & 0x1F))) == expected) { - CreateEntityWhenInHorizontalRange(g_LayoutObjVertical); + if (--flag == 0xFF || (g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F))) == expected) { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); } +#endif g_LayoutObjVertical += sizeof(LayoutEntity) / sizeof(u16); } } @@ -38,31 +55,46 @@ void CreateEntitiesAbove(s16 posY) { * - Parameters: * - posY - the new top extent */ -void CreateEntitiesBelow(s16 posY) { - u8 flag; +static void CreateEntitiesBelow(s16 posY) { + u16* layout; s32 expected; + u8 flag; if (posY < 0) { posY = 0; } - if (g_LayoutObjPosVertical == LAYOUT_OBJ_POSITION_FORWARD) { + if (!g_LayoutObjPosVertical) { FindFirstEntityBelow(posY - g_ScrollDeltaY); g_LayoutObjPosVertical = LAYOUT_OBJ_POSITION_BACKWARD; } while (true) { - if (g_LayoutObjVertical[LAYOUT_OBJ_POS_Y] == LAYOUT_OBJ_START || - (posY > g_LayoutObjVertical[LAYOUT_OBJ_POS_Y])) { + layout = &g_LayoutObjVertical[LAYOUT_OBJ_POS_Y]; + if (layout[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_START || + (posY > layout[LAYOUT_OBJ_POS_X])) { break; } - + flag = layout[LAYOUT_OBJ_ID] >> 8; +#ifdef VERSION_PSP + if (flag--) { + if (!(g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F)))) { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); + } + } else { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); + } +#else expected = 0; - flag = (g_LayoutObjVertical[LAYOUT_OBJ_SLOT] >> 8) + 0xFF; - if (flag == 0xFF || - (g_entityDestroyed[flag >> 5] & (1 << (flag & 0x1F))) == expected) { - CreateEntityWhenInHorizontalRange(g_LayoutObjVertical); + if (--flag == 0xFF || (g_unkGraphicsStruct.D_80097428[flag >> 5] & + (1 << (flag & 0x1F))) == expected) { + CreateEntityWhenInHorizontalRange( + (LayoutEntity*)g_LayoutObjVertical); } +#endif g_LayoutObjVertical -= sizeof(LayoutEntity) / sizeof(u16); } } diff --git a/src/st/find_entity_horizontal.h b/src/st/find_entity_horizontal.h index dce7a598bd..275b0f8ad9 100644 --- a/src/st/find_entity_horizontal.h +++ b/src/st/find_entity_horizontal.h @@ -11,10 +11,11 @@ * `g_LayoutObjHorizontal` will be positioned at an element with a * x position larger than `posX` or the tail eleement. */ -void FindFirstEntityToTheRight(s16 posX) { +static void FindFirstEntityToTheRight(s16 posX) { while (1) { u16* layoutEntity = g_LayoutObjHorizontal; - if (layoutEntity[0] != LAYOUT_OBJ_START && layoutEntity[0] >= posX) { + if (layoutEntity[LAYOUT_OBJ_POS_X] != LAYOUT_OBJ_START && + layoutEntity[LAYOUT_OBJ_POS_X] >= posX) { break; } @@ -33,11 +34,12 @@ void FindFirstEntityToTheRight(s16 posX) { * `g_LayoutObjVertical` will be positioned at an element with an * x position smaller than `posX` or the head element. */ -void FindFirstEntityToTheLeft(s16 posX) { +static void FindFirstEntityToTheLeft(s16 posX) { while (true) { - u16* layoutObject = g_LayoutObjHorizontal; - if (layoutObject[0] != LAYOUT_OBJ_END && - (layoutObject[0] <= posX || layoutObject[0] == LAYOUT_OBJ_START)) { + u16* layoutEntity = g_LayoutObjHorizontal; + if (layoutEntity[LAYOUT_OBJ_POS_X] != LAYOUT_OBJ_END && + (layoutEntity[LAYOUT_OBJ_POS_X] <= posX || + layoutEntity[LAYOUT_OBJ_POS_X] == LAYOUT_OBJ_START)) { break; } g_LayoutObjHorizontal -= sizeof(LayoutEntity) / sizeof(u16); diff --git a/src/st/find_entity_vertical.h b/src/st/find_entity_vertical.h index c32e3df41a..efe45e8e23 100644 --- a/src/st/find_entity_vertical.h +++ b/src/st/find_entity_vertical.h @@ -10,7 +10,7 @@ * `g_LayoutObjVertical` will be positioned at an element with a * y position larger than `posY` or the tail eleement. */ -void FindFirstEntityAbove(s16 posY) { +static void FindFirstEntityAbove(s16 posY) { while (true) { u16* ptr = &g_LayoutObjVertical[LAYOUT_OBJ_POS_Y]; if (*ptr != LAYOUT_OBJ_START && *ptr >= posY) { @@ -31,10 +31,9 @@ void FindFirstEntityAbove(s16 posY) { * `g_LayoutObjVertical` will be positioned at an element with a * y position smaller than `posY` or the head element. */ -void FindFirstEntityBelow(s16 posY) { +static void FindFirstEntityBelow(s16 posY) { while (true) { u16* ptr = &g_LayoutObjVertical[LAYOUT_OBJ_POS_Y]; - if (*ptr != LAYOUT_OBJ_END && (*ptr <= posY || *ptr == LAYOUT_OBJ_START)) { break; diff --git a/src/st/init_room_entities.h b/src/st/init_room_entities.h index 514a4e48d2..b436809379 100644 --- a/src/st/init_room_entities.h +++ b/src/st/init_room_entities.h @@ -7,36 +7,36 @@ * - objLayoutId - the room to initialize */ void InitRoomEntities(s32 objLayoutId) { - u16* pObjLayoutStart = OBJ_LAYOUT_HORIZONTAL[objLayoutId]; Tilemap* tilemap = &g_Tilemap; - s16 temp_s0; - s16 arg0; + s16 rightEdge; + s16 temp; s16 i; - u16* temp_v1; - g_LayoutObjHorizontal = pObjLayoutStart; - g_LayoutObjVertical = OBJ_LAYOUT_VERTICAL[objLayoutId]; + g_LayoutObjHorizontal = (u16*)OBJ_LAYOUT_HORIZONTAL[objLayoutId]; + g_LayoutObjVertical = (u16*)OBJ_LAYOUT_VERTICAL[objLayoutId]; - if (*pObjLayoutStart != 0xFFFE) { - g_LayoutObjHorizontal = pObjLayoutStart + 1; - arg0 = Random() & 0xFF; + if (*g_LayoutObjHorizontal != LAYOUT_OBJ_START) { + g_LayoutObjHorizontal++; + temp = Random() & 0xFF; for (i = 0; true; i++) { - temp_v1 = g_LayoutObjHorizontal; - g_LayoutObjHorizontal = temp_v1 + 1; - arg0 -= temp_v1[0]; - if (arg0 < 0) { + temp -= *g_LayoutObjHorizontal++; + if (temp < 0) { + g_LayoutObjHorizontal = + (u16*)((g_LayoutObjHorizontal[LAYOUT_OBJ_POS_Y] << 16) + + g_LayoutObjHorizontal[LAYOUT_OBJ_POS_X]); break; } - g_LayoutObjHorizontal = temp_v1 + 3; + g_LayoutObjHorizontal += 2; } - g_LayoutObjHorizontal = (temp_v1[2] << 0x10) + temp_v1[1]; g_LayoutObjVertical += i * 2 + 2; - g_LayoutObjVertical = (g_LayoutObjVertical[LAYOUT_OBJ_POS_Y] << 0x10) + - g_LayoutObjVertical[LAYOUT_OBJ_POS_X]; + g_LayoutObjVertical = + (u16*)((g_LayoutObjVertical[LAYOUT_OBJ_POS_Y] << 0x10) + + g_LayoutObjVertical[LAYOUT_OBJ_POS_X]); } - arg0 = tilemap->scrollX.i.hi; - temp_s0 = arg0 + 320; - i = arg0 - 64; + temp = tilemap->scrollX.i.hi; + i = temp - 64; + rightEdge = temp + 320; + if (i < 0) { i = 0; } @@ -44,6 +44,8 @@ void InitRoomEntities(s32 objLayoutId) { g_LayoutObjPosHorizontal = LAYOUT_OBJ_POSITION_FORWARD; g_LayoutObjPosVertical = LAYOUT_OBJ_POSITION_FORWARD; FindFirstEntityToTheRight(i); - CreateEntitiesToTheRight(temp_s0); - FindFirstEntityAbove(tilemap->scrollY.i.hi + 288); + CreateEntitiesToTheRight(rightEdge); + temp = tilemap->scrollY.i.hi; + i = temp + 288; + FindFirstEntityAbove(i); } diff --git a/src/st/st0_psp/create_entity.c b/src/st/st0_psp/create_entity.c deleted file mode 100644 index 493de5a921..0000000000 --- a/src/st/st0_psp/create_entity.c +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -#include "../st0/st0.h" -#include "../pfn_entity_update.h" - -extern u16* g_LayoutObjHorizontal; -extern u16* g_LayoutObjVertical; -extern u8 g_LayoutObjPosHorizontal; -extern u8 g_LayoutObjPosVertical; - -#include "../st_private.h" -#include "../create_entity_from_layout.h" -#include "../create_entity_in_range.h" -#include "../find_entity_horizontal.h" -NOP; - -void CreateEntitiesToTheRight(s16); -INCLUDE_ASM("st/st0_psp/psp/st0_psp/create_entity", CreateEntitiesToTheRight); - -void CreateEntitiesToTheLeft(s16); -INCLUDE_ASM("st/st0_psp/psp/st0_psp/create_entity", CreateEntitiesToTheLeft); - -#include "../find_entity_vertical.h" - -void CreateEntitiesAbove(s16); -INCLUDE_ASM("st/st0_psp/psp/st0_psp/create_entity", CreateEntitiesAbove); - -void CreateEntitiesBelow(s16); -INCLUDE_ASM("st/st0_psp/psp/st0_psp/create_entity", CreateEntitiesBelow); - -INCLUDE_ASM("st/st0_psp/psp/st0_psp/create_entity", InitRoomEntities); - -#include "../update_room_position.h" -#include "../create_entity_from_entity.h" diff --git a/src/st/wrp_psp/create_entity.c b/src/st/wrp_psp/create_entity.c deleted file mode 100644 index 87b6d9570a..0000000000 --- a/src/st/wrp_psp/create_entity.c +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -#include "../wrp/wrp.h" -#include "../pfn_entity_update.h" - -static u16* g_LayoutObjHorizontal; -static u16* g_LayoutObjVertical; -static u8 g_LayoutObjPosHorizontal; -static u8 g_LayoutObjPosVertical; - -#include "../st_private.h" -#include "../create_entity_from_layout.h" -#include "../create_entity_in_range.h" -#include "../find_entity_horizontal.h" - -void CreateEntitiesToTheRight(s16); -INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/create_entity", CreateEntitiesToTheRight); - -void CreateEntitiesToTheLeft(s16); -INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/create_entity", CreateEntitiesToTheLeft); - -#include "../find_entity_vertical.h" - -void CreateEntitiesAbove(s16); -INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/create_entity", CreateEntitiesAbove); - -void CreateEntitiesBelow(s16); -INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/create_entity", CreateEntitiesBelow); - -INCLUDE_ASM("st/wrp_psp/psp/wrp_psp/create_entity", InitRoomEntities); - -#include "../update_room_position.h" -#include "../create_entity_from_entity.h" diff --git a/src/st/wrp_psp/st_init_wrp.c b/src/st/wrp_psp/st_init_wrp.c index c0763e9fd0..36285b4627 100644 --- a/src/st/wrp_psp/st_init_wrp.c +++ b/src/st/wrp_psp/st_init_wrp.c @@ -5,9 +5,8 @@ // entity table to allocate new entities extern PfnEntityUpdate* D_08C6BC30; -extern u_long* D_08C6BC34; extern LayoutEntity* D_8D2DE7C; -extern u_long* D_8D2DF50; +extern LayoutEntity* D_8D2DF50; // entity table to allocate new entities extern PfnEntityUpdate D_psp_09246E30[]; @@ -34,7 +33,7 @@ void func_psp_092447C0(void) { func_psp_09244760(); D_08C6BC30 = (PfnEntityUpdate*)&D_psp_09246E30; g_pStObjLayoutHorizontal = &D_8D2DE7C; - D_08C6BC34 = (u_long*)&D_8D2DF50; + g_pStObjLayoutVertical = &D_8D2DF50; func_892A018(); memcpy((u8*)&g_api, (u8*)&g_StageOverlay, sizeof(Overlay)); }