2023-03-31 07:42:12 +00:00
|
|
|
g_SpriteBanks = 0x8018002C;
|
|
|
|
g_Cluts = 0x80180160;
|
|
|
|
g_TileLayers = 0x80180394;
|
|
|
|
g_EntityGfxs = 0x80180888;
|
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 = 0x801808EC;
|
|
|
|
g_pStObjLayoutVertical = 0x801809C0;
|
2023-08-09 18:59:29 +00:00
|
|
|
PfnEntityUpdates = 0x80180A94;
|
2023-08-20 20:35:01 +00:00
|
|
|
g_InitializeData0 = 0x80180BD4;
|
2023-08-18 23:37:55 +00:00
|
|
|
g_InitializeEntityData0 = 0x80180BE0;
|
2024-01-19 03:07:13 +00:00
|
|
|
g_EInitGeneric = 0x80180BF8;
|
2024-05-24 18:41:07 +00:00
|
|
|
g_eInitGeneric2 = 0x80180C1C;
|
2024-05-22 20:24:42 +00:00
|
|
|
g_eDamageDisplayInit = 0x80180C28;
|
2024-05-24 18:41:07 +00:00
|
|
|
g_eRedDoorTiles = 0x80180D8C;
|
2023-08-13 14:42:37 +00:00
|
|
|
g_CallElevator = 0x80180EEC;
|
NZ0 & NP3 - Slogra & Gaibon Boss decompiled and documented (#230)
It's been a wild ride with this one, but i'm proud to present the first
Boss decompilation of the project.
![image](https://github.com/Xeeynamo/sotn-decomp/assets/96613413/d0ed35a9-7032-42b8-b237-3cdc2a4d5db6)
However, this contribution doesn't come without problems. I managed to
match EntitySlogra 100% but the local assembler is skipping a NOP, so
this makes it a NON_MATCHING until the compiler combo is fixed.
As for EntityGaibon, i couldn't get a perfect match, some regalloc and
instruction reordering persist in the assembler output, nevertheless the
behaviour has been extensively tested in-game for days using two
emulators simultaneously side by side to ensure it's equivalent.
If you want to try the functions, you'd have to change
splat.us.stnz0.yaml to exclude rodata extraction like this:
- [0x305FC, .rodata, 33FCC] # EntitySlogra
- [0x30618, .rodata, 33FCC] # EntityGaibon
and remember to change the #ifndef to #ifdef to be able to compile them.
Scratches:
NZ0_EntitySlogra: https://decomp.me/scratch/vaRJR
NZ0_EntityGaibon: https://decomp.me/scratch/QGtpG
NP3_EntitySlogra: https://decomp.me/scratch/DGetH
NP3_EntityGaibon: https://decomp.me/scratch/wUo18
Co-authored by the great @MottZilla, who actively provided his
dynamic-analysis and code interpretation skills to achieve the perfect
behaviour and documentation of the code.
2023-05-27 09:25:44 +00:00
|
|
|
g_BossFlag = 0x80181010;
|
2023-08-13 14:42:37 +00:00
|
|
|
g_ElevatorTarget = 0x801813A4;
|
|
|
|
g_ElevatorTargetPos = 0x801813A8;
|
2023-08-07 23:33:22 +00:00
|
|
|
UNK_Invincibility0 = 0x80181574;
|
2024-05-27 09:04:31 +00:00
|
|
|
g_testCollEnemyLookup = 0x801815A0;
|
|
|
|
g_testCollLuckCutoff = 0x801818C0;
|
|
|
|
g_testColluCoords = 0x801818C4;
|
|
|
|
g_testCollvCoords = 0x801818CC;
|
|
|
|
g_testCollElementLookup = 0x801818D4;
|
|
|
|
g_testColliFrames = 0x801818E8;
|
|
|
|
g_testCollPrizeTable = 0x801818F4;
|
|
|
|
g_testCollRandTable = 0x80181934;
|
2024-05-22 20:24:42 +00:00
|
|
|
g_eDamageDisplayClut = 0x80181950;
|
2024-05-24 18:41:07 +00:00
|
|
|
g_eRedDoorUV = 0x80181960;
|
2024-05-30 16:42:24 +00:00
|
|
|
g_goldCollectTexts = 0x80181CEC;
|
2023-01-21 14:13:45 +00:00
|
|
|
c_GoldPrizes = 0x80181D14;
|
|
|
|
c_HeartPrizes = 0x80181DA4;
|
2024-05-29 03:29:41 +00:00
|
|
|
g_bigRedFireballAnim = 0x80181DD0;
|
2024-05-28 17:31:01 +00:00
|
|
|
g_eUnk14SpawnRots = 0x80181ECC;
|
2024-05-28 01:24:59 +00:00
|
|
|
unk14_yVel = 0x80181F04;
|
|
|
|
unk14_startFrame = 0x80181F1C;
|
|
|
|
unk14_lifetime = 0x80181F20;
|
2024-05-29 00:42:15 +00:00
|
|
|
g_olroxDroolCollOffsets = 0x80181F28;
|
2024-06-01 19:32:59 +00:00
|
|
|
g_ESoulStealOrbAngles = 0x80181F80;
|
|
|
|
g_ESoulStealOrbSprt = 0x80181F90;
|
|
|
|
g_ESoulStealOrbAnim = 0x80181FF0;
|
2023-03-13 20:56:36 +00:00
|
|
|
g_Rooms = 0x8018272C;
|
2023-11-23 20:04:41 +00:00
|
|
|
g_UnkPrimHelperRot = 0x801B0934;
|
2023-01-27 21:07:01 +00:00
|
|
|
EntityBreakable = 0x801B0EEC;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityRedEyeBust = 0x801B11C0;
|
|
|
|
EntityPurpleBrickScrollingBackground = 0x801B12E8;
|
|
|
|
EntityLeftSecretRoomWall = 0x801B14C4;
|
|
|
|
EntityBottomSecretRoomFloor = 0x801B1770;
|
|
|
|
EntityMoveableBox = 0x801B20CC;
|
|
|
|
EntityCannonLever = 0x801B23B4;
|
|
|
|
EntityCannon = 0x801B25C4;
|
|
|
|
EntityCannonShot = 0x801B2874;
|
|
|
|
EntityCannonWall = 0x801B2978;
|
2023-08-13 14:42:37 +00:00
|
|
|
EntityElevator2 = 0x801B2D08;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityFloorSpikes = 0x801B3294;
|
|
|
|
EntityTableWithGlobe = 0x801B3534;
|
|
|
|
EntityCloseBossRoom = 0x801B3FCC;
|
|
|
|
EntityBossRoomBlock = 0x801B4518;
|
|
|
|
EntitySlogra = 0x801B4778;
|
NZ0 & NP3 - Slogra & Gaibon Boss decompiled and documented (#230)
It's been a wild ride with this one, but i'm proud to present the first
Boss decompilation of the project.
![image](https://github.com/Xeeynamo/sotn-decomp/assets/96613413/d0ed35a9-7032-42b8-b237-3cdc2a4d5db6)
However, this contribution doesn't come without problems. I managed to
match EntitySlogra 100% but the local assembler is skipping a NOP, so
this makes it a NON_MATCHING until the compiler combo is fixed.
As for EntityGaibon, i couldn't get a perfect match, some regalloc and
instruction reordering persist in the assembler output, nevertheless the
behaviour has been extensively tested in-game for days using two
emulators simultaneously side by side to ensure it's equivalent.
If you want to try the functions, you'd have to change
splat.us.stnz0.yaml to exclude rodata extraction like this:
- [0x305FC, .rodata, 33FCC] # EntitySlogra
- [0x30618, .rodata, 33FCC] # EntityGaibon
and remember to change the #ifndef to #ifdef to be able to compile them.
Scratches:
NZ0_EntitySlogra: https://decomp.me/scratch/vaRJR
NZ0_EntityGaibon: https://decomp.me/scratch/QGtpG
NP3_EntitySlogra: https://decomp.me/scratch/DGetH
NP3_EntityGaibon: https://decomp.me/scratch/wUo18
Co-authored by the great @MottZilla, who actively provided his
dynamic-analysis and code interpretation skills to achieve the perfect
behaviour and documentation of the code.
2023-05-27 09:25:44 +00:00
|
|
|
EntitySlograSpear = 0x801B54A8;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntitySlograSpearProjectile = 0x801B5654;
|
|
|
|
EntityGaibon = 0x801B5778;
|
|
|
|
EntitySmallGaibonProjectile = 0x801B6AAC;
|
|
|
|
EntityLargeGaibonProjectile = 0x801B6BBC;
|
2023-08-13 14:42:37 +00:00
|
|
|
EntityElevator = 0x801B7034;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityMariaCutscene = 0x801B7D58;
|
2023-01-21 14:13:45 +00:00
|
|
|
Random = 0x801B94D4;
|
2023-01-27 21:07:01 +00:00
|
|
|
Update = 0x801B9504;
|
2023-08-08 19:12:12 +00:00
|
|
|
UpdateStageEntities = 0x801B9800;
|
2024-05-27 17:01:30 +00:00
|
|
|
HitDetection = 0x801B9908;
|
2024-05-22 20:24:42 +00:00
|
|
|
EntityDamageDisplay = 0x801BAA20;
|
2023-06-29 22:55:22 +00:00
|
|
|
InitRoomEntities = 0x801BB920;
|
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 = 0x801BBA98;
|
2023-01-28 02:47:59 +00:00
|
|
|
CreateEntityFromCurrentEntity = 0x801BBB4C;
|
|
|
|
CreateEntityFromEntity = 0x801BBBC0;
|
2023-01-05 19:35:01 +00:00
|
|
|
EntityRedDoor = 0x801BBCB4;
|
2022-11-15 23:36:02 +00:00
|
|
|
DestroyEntity = 0x801BC8EC;
|
|
|
|
AnimateEntity = 0x801BCA1C;
|
2023-07-12 07:18:59 +00:00
|
|
|
GetSideToPlayer = 0x801BCC5C;
|
2022-11-15 23:36:02 +00:00
|
|
|
MoveEntity = 0x801BCCA0;
|
|
|
|
AllocEntity = 0x801BD15C;
|
NZ0 & NP3 - Slogra & Gaibon Boss decompiled and documented (#230)
It's been a wild ride with this one, but i'm proud to present the first
Boss decompilation of the project.
![image](https://github.com/Xeeynamo/sotn-decomp/assets/96613413/d0ed35a9-7032-42b8-b237-3cdc2a4d5db6)
However, this contribution doesn't come without problems. I managed to
match EntitySlogra 100% but the local assembler is skipping a NOP, so
this makes it a NON_MATCHING until the compiler combo is fixed.
As for EntityGaibon, i couldn't get a perfect match, some regalloc and
instruction reordering persist in the assembler output, nevertheless the
behaviour has been extensively tested in-game for days using two
emulators simultaneously side by side to ensure it's equivalent.
If you want to try the functions, you'd have to change
splat.us.stnz0.yaml to exclude rodata extraction like this:
- [0x305FC, .rodata, 33FCC] # EntitySlogra
- [0x30618, .rodata, 33FCC] # EntityGaibon
and remember to change the #ifndef to #ifdef to be able to compile them.
Scratches:
NZ0_EntitySlogra: https://decomp.me/scratch/vaRJR
NZ0_EntityGaibon: https://decomp.me/scratch/QGtpG
NP3_EntitySlogra: https://decomp.me/scratch/DGetH
NP3_EntityGaibon: https://decomp.me/scratch/wUo18
Co-authored by the great @MottZilla, who actively provided his
dynamic-analysis and code interpretation skills to achieve the perfect
behaviour and documentation of the code.
2023-05-27 09:25:44 +00:00
|
|
|
SetStep = 0x801BD52C;
|
|
|
|
SetSubStep = 0x801BD54C;
|
2022-11-15 23:36:02 +00:00
|
|
|
InitializeEntity = 0x801BD5FC;
|
2023-01-27 21:07:01 +00:00
|
|
|
EntityDummy = 0x801BD6F8;
|
2024-05-27 18:21:44 +00:00
|
|
|
GetPlayerCollisionWith = 0x801BD9A0;
|
2023-03-25 20:37:41 +00:00
|
|
|
EntityPrizeDrop = 0x801BE30C;
|
2023-01-21 14:13:45 +00:00
|
|
|
EntityExplosion = 0x801BEB80;
|
2023-03-26 15:25:05 +00:00
|
|
|
EntityEquipItemDrop = 0x801BED20;
|
2023-01-27 21:07:01 +00:00
|
|
|
EntityRelicOrb = 0x801BF5B8;
|
|
|
|
EntityHeartDrop = 0x801C0088;
|
2023-09-01 09:08:20 +00:00
|
|
|
EntityMessageBox = 0x801C01B0;
|
2024-05-28 01:24:59 +00:00
|
|
|
EntityUnkId14 = 0x801C0B24;
|
2024-01-02 16:08:30 +00:00
|
|
|
EntityUnkId15 = 0x801C0C14;
|
2023-01-27 21:07:01 +00:00
|
|
|
EntityIntenseExplosion = 0x801C15B4;
|
2023-06-10 16:44:16 +00:00
|
|
|
EntitySoulStealOrb = 0x801C2AA8;
|
2023-01-27 21:07:01 +00:00
|
|
|
EntityEnemyBlood = 0x801C2E3C;
|
2022-11-15 23:36:02 +00:00
|
|
|
EntityRoomForeground = 0x801C32EC;
|
|
|
|
EntityBoneScimitar = 0x801C37E4;
|
2023-04-30 20:04:00 +00:00
|
|
|
EntityBoneScimitarParts = 0x801C3E94;
|
2023-02-18 22:01:39 +00:00
|
|
|
EntityAxeKnight = 0x801C45BC;
|
|
|
|
EntityAxeKnightThrowingAxe = 0x801C4D18;
|
|
|
|
EntityBloodSplatter = 0x801C4EAC;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityBloodyZombie = 0x801C5568;
|
2023-02-18 22:01:39 +00:00
|
|
|
EntitySkeleton = 0x801C5FC4;
|
|
|
|
EntitySpittleBone = 0x801C672C;
|
2023-08-31 16:31:55 +00:00
|
|
|
EntityRotateSpittlebone = 0x801C6B24;
|
2023-02-18 22:01:39 +00:00
|
|
|
EntitySpittleBoneSpit = 0x801C6C6C;
|
2023-04-12 22:20:57 +00:00
|
|
|
EntitySubWeaponContainer = 0x801C7048;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityBloodSkeleton = 0x801C7958;
|
2024-01-13 11:40:56 +00:00
|
|
|
EntityIsNearPlayer2 = 0x801C7CF0;
|
2023-02-18 22:01:39 +00:00
|
|
|
EntityMagicallySealedDoor = 0x801C7D68;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityStageNamePopup = 0x801C8CAC;
|
2024-01-18 19:04:04 +00:00
|
|
|
UnkPolyFunc2 = 0x801CA07C;
|
2023-05-06 01:16:56 +00:00
|
|
|
EntityLifeUpSpawn = 0x801CA160;
|
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 = 0x801CAA74;
|
|
|
|
g_LayoutObjVertical = 0x801CAA78;
|
|
|
|
g_LayoutObjPosHorizontal = 0x801CAA7C;
|
|
|
|
g_LayoutObjPosVertical = 0x801CAA80;
|
2023-08-30 20:20:02 +00:00
|
|
|
g_Dialogue = 0x801CB688;
|
2023-08-28 22:53:45 +00:00
|
|
|
g_ItemIconSlots = 0x801CB740;
|