2023-01-23 07:22:35 +00:00
|
|
|
g_SpriteBanks = 0x80180040;
|
Rename Stage Layout Functions and Vars Uniformly (#1162)
This change renames functions and global stage variables uniformly
across the stages so that these functions can be pulled out and shared
across all of the stages. Based on some other tests there are 12 or so
functions that this will allow to be pulled out of each stage. Since
these implementations are shared, an additional 12 asm functions can be
eliminated in a subsequent pass.
**Vars**
* `g_pStObjLayoutHorizontal` - a horizontally sorted array of stage
entities
* `g_pStObjLayoutVertical` - a vertically sorted array of stage entities
* `g_LayoutObjHorizontal` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutHorizontal`
* `g_LayoutObjVertical` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutVertical`
* `g_LayoutObjPosHorizontal` - the direction last traversed in
`g_LayoutObjHorizontal`
* `g_LayoutObjPosVertical` - the direction last traversed in
`g_pStObjLayoutVertical `
**Functions**
* `FindFirstEntityToTheRight` - given an `x` position, update
`g_LayoutObjHorizontal` with the first entity to the right of `x`
* `FindFirstEntityToTheLeft` - given a `x` position, update
`g_LayoutObjHorizontal` with the first entity to the left of `x`
(backwards)
* `CreateEntitiesToTheRight` - given an `x` position, create all
entities to the right (mutates `g_LayoutObjHorizontal`)
* `CreateEntitiesToTheLeft` - given an `x` position, create all entities
to the left (mutates `g_LayoutObjHorizontal`)
* `FindFirstEntityAbove` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the above of `y`
* `FindFirstEntityBelow` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the below of `y`
* `CreateEntitiesAbove` - given an `y` position, create all entities
above (mutates `g_LayoutObjVertical`)
* `CreateEntitiesBelow` - given an `y` position, create all entities
beneath (mutates `g_LayoutObjVertical`)
* `UpdateRoomPosition` - look at the current game loop scroll delta and
create any entities given the room layout
I believe all of these implementations are shared across all stages
(including `InitRoomEntities`, and two more `CreateEntity` functions)
(in my initial tests I had a small difference in `DER`, but I believe
that had to do with an incorrect symbol table change).
Co-authored-by: Jonathan Hohle <jon@ttkb.co>
2024-05-22 22:34:41 +00:00
|
|
|
g_pStObjLayoutHorizontal = 0x8018077C;
|
|
|
|
g_pStObjLayoutVertical = 0x80180850;
|
2023-07-09 20:29:10 +00:00
|
|
|
PfnEntityUpdates = 0x80180924;
|
2022-10-29 00:33:04 +00:00
|
|
|
g_eBreakableInit = 0x80180AAC;
|
2023-08-20 20:35:01 +00:00
|
|
|
g_InitializeData0 = 0x80180AB8;
|
2023-08-18 23:37:55 +00:00
|
|
|
g_InitializeEntityData0 = 0x80180AC4;
|
2024-01-19 03:07:13 +00:00
|
|
|
g_EInitGeneric = 0x80180ADC;
|
2024-05-22 20:24:42 +00:00
|
|
|
g_eDamageDisplayInit = 0x80180B0C;
|
2022-10-29 00:33:04 +00:00
|
|
|
g_eBreakableAnimations = 0x80180E50;
|
|
|
|
g_eBreakableHitboxes = 0x80180E70;
|
|
|
|
g_eBreakableExplosionTypes = 0x80180E78;
|
2023-02-12 01:00:23 +00:00
|
|
|
g_eBreakableanimSets = 0x80180E80;
|
2024-01-20 21:16:03 +00:00
|
|
|
g_eBreakableDrawModes = 0x80180E90;
|
2023-05-06 01:16:56 +00:00
|
|
|
g_TrapDoorFlag = 0x8018123C;
|
2023-08-07 23:33:22 +00:00
|
|
|
UNK_Invincibility0 = 0x80181CC0;
|
2024-05-22 20:24:42 +00:00
|
|
|
g_eDamageDisplayClut = 0x8018209C;
|
2023-01-24 22:56:36 +00:00
|
|
|
c_GoldPrizes = 0x80182460;
|
2024-01-13 11:40:56 +00:00
|
|
|
c_HeartPrizes = 0x801824F0;
|
2023-03-13 20:56:36 +00:00
|
|
|
g_Rooms = 0x80183CC4;
|
2023-11-23 20:04:41 +00:00
|
|
|
g_UnkPrimHelperRot = 0x801B77CC;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityCavernDoorVase = 0x801B77D4;
|
|
|
|
EntityUnkId12 = 0x801B78A8;
|
2022-10-29 00:13:38 +00:00
|
|
|
EntityBreakable = 0x801B7A64;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityUnkId16 = 0x801B7B98;
|
|
|
|
EntityBackgroundLightning = 0x801B7C4C;
|
|
|
|
EntityShuttingWindow = 0x801B8254;
|
|
|
|
EntityCastleDoor = 0x801B8564;
|
|
|
|
EntityBackgroundBushes = 0x801B8A74;
|
|
|
|
EntityUnkId1C = 0x801B8ED0;
|
|
|
|
EntityTransparentWater = 0x801B9198;
|
|
|
|
EntityCavernDoorLever = 0x801B9650;
|
|
|
|
EntityCavernDoorPlatform = 0x801B97D0;
|
|
|
|
EntityCavernDoor = 0x801B989C;
|
|
|
|
EntityClickSwitch = 0x801B9CE8;
|
|
|
|
EntityPathBlockSmallWeight = 0x801B9E10;
|
|
|
|
EntityPathBlockTallWeight = 0x801BA0A0;
|
|
|
|
EntityTrapDoor = 0x801BA348;
|
|
|
|
EntityMermanRockLeftSide = 0x801BA4C0;
|
|
|
|
EntityMermanRockRightSide = 0x801BA868;
|
|
|
|
EntityUnkId26 = 0x801BABE8;
|
|
|
|
EntityFallingRock2 = 0x801BAD6C;
|
2023-08-26 02:00:12 +00:00
|
|
|
EntityStairwayPiece = 0x801BAEF0;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityFallingRock = 0x801BB3BC;
|
|
|
|
EntityDeathSkySwirl = 0x801BBB8C;
|
|
|
|
EntityUnkId29 = 0x801BBDC0;
|
|
|
|
EntityUnkId2A = 0x801BBE70;
|
|
|
|
EntitySwitch = 0x801BBF38;
|
|
|
|
EntityHeartRoomGoldDoor = 0x801BC05C;
|
|
|
|
EntityUnkId49 = 0x801BC3FC;
|
|
|
|
EntityPushAlucard = 0x801BC4EC;
|
2023-08-27 21:23:07 +00:00
|
|
|
EntityCastleDoorTransition = 0x801BC780;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityForegroundTree = 0x801BC93C;
|
|
|
|
EntityUnkId50 = 0x801BCC4C;
|
|
|
|
EntityBackgroundPineTrees = 0x801BCE08;
|
|
|
|
EntityUnkId52 = 0x801BD564;
|
2023-08-27 21:23:07 +00:00
|
|
|
EntityCastleBridge = 0x801BD71C;
|
2023-08-27 18:24:14 +00:00
|
|
|
EntityBackgroundTrees = 0x801BDEB0;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityBackgroundCastleWall = 0x801BE080;
|
|
|
|
EntityFlyingOwlAndLeaves = 0x801BE134;
|
|
|
|
EntityFallingLeaf = 0x801BE444;
|
|
|
|
EntityRoomTransition1 = 0x801BEEB0;
|
|
|
|
EntityRoomTransition2 = 0x801BFF00;
|
|
|
|
EntityDeathStolenItem = 0x801C033C;
|
2023-08-28 21:41:32 +00:00
|
|
|
EntityDeath = 0x801C083C;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityUnkId5B = 0x801C11A4;
|
|
|
|
EntityUnkId5E = 0x801C12E8;
|
2023-01-27 20:21:38 +00:00
|
|
|
EntityWargExplosionPuffOpaque = 0x801C14B8;
|
2022-08-23 22:43:05 +00:00
|
|
|
Random = 0x801C184C;
|
2023-01-23 07:22:35 +00:00
|
|
|
Update = 0x801C187C;
|
2023-08-08 19:12:12 +00:00
|
|
|
UpdateStageEntities = 0x801C1B78;
|
2023-08-08 19:55:12 +00:00
|
|
|
TestCollisions = 0x801C1C80;
|
2024-05-22 20:24:42 +00:00
|
|
|
EntityDamageDisplay = 0x801C2D98;
|
2023-01-23 07:22:35 +00:00
|
|
|
InitRoomEntities = 0x801C3C98;
|
Rename Stage Layout Functions and Vars Uniformly (#1162)
This change renames functions and global stage variables uniformly
across the stages so that these functions can be pulled out and shared
across all of the stages. Based on some other tests there are 12 or so
functions that this will allow to be pulled out of each stage. Since
these implementations are shared, an additional 12 asm functions can be
eliminated in a subsequent pass.
**Vars**
* `g_pStObjLayoutHorizontal` - a horizontally sorted array of stage
entities
* `g_pStObjLayoutVertical` - a vertically sorted array of stage entities
* `g_LayoutObjHorizontal` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutHorizontal`
* `g_LayoutObjVertical` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutVertical`
* `g_LayoutObjPosHorizontal` - the direction last traversed in
`g_LayoutObjHorizontal`
* `g_LayoutObjPosVertical` - the direction last traversed in
`g_pStObjLayoutVertical `
**Functions**
* `FindFirstEntityToTheRight` - given an `x` position, update
`g_LayoutObjHorizontal` with the first entity to the right of `x`
* `FindFirstEntityToTheLeft` - given a `x` position, update
`g_LayoutObjHorizontal` with the first entity to the left of `x`
(backwards)
* `CreateEntitiesToTheRight` - given an `x` position, create all
entities to the right (mutates `g_LayoutObjHorizontal`)
* `CreateEntitiesToTheLeft` - given an `x` position, create all entities
to the left (mutates `g_LayoutObjHorizontal`)
* `FindFirstEntityAbove` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the above of `y`
* `FindFirstEntityBelow` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the below of `y`
* `CreateEntitiesAbove` - given an `y` position, create all entities
above (mutates `g_LayoutObjVertical`)
* `CreateEntitiesBelow` - given an `y` position, create all entities
beneath (mutates `g_LayoutObjVertical`)
* `UpdateRoomPosition` - look at the current game loop scroll delta and
create any entities given the room layout
I believe all of these implementations are shared across all stages
(including `InitRoomEntities`, and two more `CreateEntity` functions)
(in my initial tests I had a small difference in `DER`, but I believe
that had to do with an incorrect symbol table change).
Co-authored-by: Jonathan Hohle <jon@ttkb.co>
2024-05-22 22:34:41 +00:00
|
|
|
UpdateRoomPosition = 0x801C3E10;
|
2023-01-28 02:47:59 +00:00
|
|
|
CreateEntityFromCurrentEntity = 0x801C3EC4;
|
|
|
|
CreateEntityFromEntity = 0x801C3F38;
|
2024-01-13 11:40:56 +00:00
|
|
|
EntityIsNearPlayer = 0x801C3FB4;
|
2022-11-05 21:00:42 +00:00
|
|
|
EntityRedDoor = 0x801C402C;
|
2022-11-05 20:53:40 +00:00
|
|
|
DestroyEntity = 0x801C4C64;
|
|
|
|
PreventEntityFromRespawning = 0x801C4D4C;
|
2022-02-06 16:35:17 +00:00
|
|
|
AnimateEntity = 0x801C4D94;
|
2023-07-12 07:18:59 +00:00
|
|
|
GetDistanceToPlayerX = 0x801C4F64;
|
|
|
|
GetDistanceToPlayerY = 0x801C4FA0;
|
|
|
|
GetSideToPlayer = 0x801C4FD4;
|
2022-03-03 23:38:38 +00:00
|
|
|
MoveEntity = 0x801C5018;
|
|
|
|
FallEntity = 0x801C5048;
|
2022-02-06 16:35:17 +00:00
|
|
|
AllocEntity = 0x801C54D4;
|
2023-07-07 16:25:55 +00:00
|
|
|
SetStep = 0x801C58A4;
|
2022-02-06 16:35:17 +00:00
|
|
|
InitializeEntity = 0x801C5974;
|
2022-11-05 20:53:40 +00:00
|
|
|
EntityDummy = 0x801C5A70;
|
2023-03-25 20:37:41 +00:00
|
|
|
EntityPrizeDrop = 0x801C6684;
|
2022-11-05 20:53:40 +00:00
|
|
|
EntityExplosion = 0x801C6EF8;
|
2023-03-26 15:25:05 +00:00
|
|
|
EntityEquipItemDrop = 0x801C7098;
|
2023-01-05 19:35:01 +00:00
|
|
|
EntityRelicOrb = 0x801C7930;
|
|
|
|
EntityHeartDrop = 0x801C8400;
|
2023-09-01 09:08:20 +00:00
|
|
|
EntityMessageBox = 0x801C8528;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityUnkId13 = 0x801C8B74;
|
|
|
|
EntityUnkId14 = 0x801C8E9C;
|
|
|
|
EntityUnkId15 = 0x801C8F8C;
|
2022-11-05 21:09:21 +00:00
|
|
|
EntityIntenseExplosion = 0x801C992C;
|
2022-11-05 20:53:40 +00:00
|
|
|
EntityStageNamePopup = 0x801CAFF0;
|
2023-06-10 16:44:16 +00:00
|
|
|
EntitySoulStealOrb = 0x801CBC74;
|
2022-11-05 21:04:00 +00:00
|
|
|
EntityEnemyBlood = 0x801CC008;
|
2022-11-05 20:53:40 +00:00
|
|
|
EntityRoomForeground = 0x801CC4B8;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityStrongWarg = 0x801CC974;
|
|
|
|
EntityUnkId30 = 0x801CDD80;
|
|
|
|
EntityUnkId31 = 0x801CDF10;
|
|
|
|
EntityExplosion3 = 0x801CE2F4;
|
|
|
|
EntityStrongWargWaveAttack = 0x801CE98C;
|
|
|
|
EntityUnkId2F = 0x801CED60;
|
|
|
|
EntityStrongWargDeathBeams = 0x801CEF88;
|
2022-02-05 21:07:33 +00:00
|
|
|
EntityWarg = 0x801CF740;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityUnkId4B = 0x801D04A4;
|
2023-01-27 20:21:38 +00:00
|
|
|
EntityWargExplosionPuffTransparent = 0x801D0624;
|
Decompile ST0 func_801BA7D8 (#515)
This is an unknown function. I don't know what it does. It is duplicated
across most overlays. It is called in CollectGold, EntityEquipItemDrop,
and TestCollisions.
It seems to take in a string, and then do a bunch of things with
primitives, but I don't know what. We don't directly reference that
array, we only read and write to it based on a pointer which moves
through the array. I tried to remove the pointer but didn't get
anywhere.
Fully-matching scratch is here: https://decomp.me/scratch/UV2K2
I am starting with only this one version of the function, so that if
changes need to be made (variable names, control flow, etc), I can
update them once here, and then copy them to the other places, instead
of making changes in every place. Once we are happy with the state of
this function, I will add the duplicates to this PR prior to merging.
---------
Co-authored-by: bismurphy <bismurphy@users.noreply.github.com>
2023-08-27 01:30:57 +00:00
|
|
|
BottomCornerText = 0x801D06FC;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityAlucardWaterEffect = 0x801D0B34;
|
2023-08-21 01:38:18 +00:00
|
|
|
EntitySplashWater = 0x801D16B4;
|
|
|
|
EntitySurfacingWater = 0x801D1FC0;
|
|
|
|
EntitySideWaterSplash = 0x801D24AC;
|
|
|
|
EntitySmallWaterDrop = 0x801D2840;
|
|
|
|
EntityWaterDrop = 0x801D2A9C;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityMerman3 = 0x801D2E4C;
|
|
|
|
EntityExplosion2 = 0x801D3F38;
|
|
|
|
EntityMediumWaterSplash = 0x801D4168;
|
2023-08-22 22:05:16 +00:00
|
|
|
EntityMermanWaterSplash = 0x801D423C;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityFallingObject2 = 0x801D4668;
|
|
|
|
EntityUnkId3D = 0x801D4700;
|
|
|
|
EntityLargeFallingObject = 0x801D48F8;
|
2023-06-13 12:44:32 +00:00
|
|
|
EntityMermanSpawner = 0x801D49C4;
|
2022-02-05 21:07:33 +00:00
|
|
|
EntityMerman = 0x801D4B20;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityMermanFireball = 0x801D56D8;
|
|
|
|
EntityFallingObject = 0x801D583C;
|
|
|
|
EntityMermanExplosion = 0x801D58D4;
|
2022-11-05 20:53:40 +00:00
|
|
|
EntityBoneScimitar = 0x801D5AAC;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityBoneScimitarParts = 0x801D615C;
|
2022-02-05 21:07:33 +00:00
|
|
|
EntityBat = 0x801D6264;
|
|
|
|
EntityZombie = 0x801D64B0;
|
2023-05-22 20:43:36 +00:00
|
|
|
EntityZombieSpawner = 0x801D6710;
|
2023-11-23 20:04:41 +00:00
|
|
|
UnkPrimHelper = 0x801D6880;
|
2024-01-18 19:04:04 +00:00
|
|
|
UnkPolyFunc2 = 0x801D6FCC;
|
Rename Stage Layout Functions and Vars Uniformly (#1162)
This change renames functions and global stage variables uniformly
across the stages so that these functions can be pulled out and shared
across all of the stages. Based on some other tests there are 12 or so
functions that this will allow to be pulled out of each stage. Since
these implementations are shared, an additional 12 asm functions can be
eliminated in a subsequent pass.
**Vars**
* `g_pStObjLayoutHorizontal` - a horizontally sorted array of stage
entities
* `g_pStObjLayoutVertical` - a vertically sorted array of stage entities
* `g_LayoutObjHorizontal` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutHorizontal`
* `g_LayoutObjVertical` - a pointer to a `LayoutEntity` in
`g_pStObjLayoutVertical`
* `g_LayoutObjPosHorizontal` - the direction last traversed in
`g_LayoutObjHorizontal`
* `g_LayoutObjPosVertical` - the direction last traversed in
`g_pStObjLayoutVertical `
**Functions**
* `FindFirstEntityToTheRight` - given an `x` position, update
`g_LayoutObjHorizontal` with the first entity to the right of `x`
* `FindFirstEntityToTheLeft` - given a `x` position, update
`g_LayoutObjHorizontal` with the first entity to the left of `x`
(backwards)
* `CreateEntitiesToTheRight` - given an `x` position, create all
entities to the right (mutates `g_LayoutObjHorizontal`)
* `CreateEntitiesToTheLeft` - given an `x` position, create all entities
to the left (mutates `g_LayoutObjHorizontal`)
* `FindFirstEntityAbove` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the above of `y`
* `FindFirstEntityBelow` - given an `y` position, update
`g_LayoutObjVertical ` with the first entity to the below of `y`
* `CreateEntitiesAbove` - given an `y` position, create all entities
above (mutates `g_LayoutObjVertical`)
* `CreateEntitiesBelow` - given an `y` position, create all entities
beneath (mutates `g_LayoutObjVertical`)
* `UpdateRoomPosition` - look at the current game loop scroll delta and
create any entities given the room layout
I believe all of these implementations are shared across all stages
(including `InitRoomEntities`, and two more `CreateEntity` functions)
(in my initial tests I had a small difference in `DER`, but I believe
that had to do with an incorrect symbol table change).
Co-authored-by: Jonathan Hohle <jon@ttkb.co>
2024-05-22 22:34:41 +00:00
|
|
|
g_LayoutObjHorizontal = 0x801D7110;
|
|
|
|
g_LayoutObjVertical = 0x801D7114;
|
|
|
|
g_LayoutObjPosHorizontal = 0x801D7118;
|
|
|
|
g_LayoutObjPosVertical = 0x801D711C;
|
2023-09-07 13:09:31 +00:00
|
|
|
g_Dialogue = 0x801D7D24;
|
|
|
|
g_ItemIconSlots = 0x801D7DD8;
|