diff options
| author | Theo <65437533+notyourav@users.noreply.github.com> | 2023-12-31 17:36:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 17:36:15 -0800 |
| commit | 48fdf9d8277d2bd2e071cb30fc6284c58645e343 (patch) | |
| tree | f5364bb3cdb41fe41512d767c1de44f73963e498 /include | |
| parent | 72c27b5393372081f558a4c610bab7d5c88d3e89 (diff) | |
| parent | 37ac9cb0fb2d9ccb64286bab2cdf648e6f2541c5 (diff) | |
Merge pull request #684 from notyourav/tiles
Tiles documentation
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm.h | 8 | ||||
| -rw-r--r-- | include/collision.h | 10 | ||||
| -rw-r--r-- | include/enemy.h | 1 | ||||
| -rw-r--r-- | include/entity.h | 2 | ||||
| -rw-r--r-- | include/functions.h | 14 | ||||
| -rw-r--r-- | include/map.h | 16 | ||||
| -rw-r--r-- | include/player.h | 2 | ||||
| -rw-r--r-- | include/tiles.h | 17 |
8 files changed, 49 insertions, 21 deletions
diff --git a/include/asm.h b/include/asm.h index bb768be3..a6c7db62 100644 --- a/include/asm.h +++ b/include/asm.h @@ -9,7 +9,7 @@ extern void CloneTile(u32, u32, u32); extern u32 GetTileTypeByEntity(struct Entity_*); extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer); extern u32 GetTileType(u32 position, u32 layer); -extern void SetTile(u32 index, u32 position, u32 layer); +extern void SetBottomTile(u32 index, u32 position, u32 layer); extern void UpdateScrollVram(void); extern u32 sub_080B1B0C(struct Entity_*); extern u32 sub_080B1BA4(u32, u32, u32); @@ -29,7 +29,7 @@ u32 BounceUpdate(struct Entity_*, u32 acceleration); extern u32 CheckOnScreen(struct Entity_*); extern bool32 EntityInRectRadius(struct Entity_*, struct Entity_*, u32, u32); extern void UpdateAnimationVariableFrames(struct Entity_*, u32); -extern u32 sub_080043E8(struct Entity_*); +extern u32 GetTileHazardType(struct Entity_*); /** * Basic collision, only used between player and dazed enemies. * (Probablity leftover from Four Swords) @@ -44,7 +44,7 @@ extern u32 sub_080086B4(u32, u32, const u8*); extern u32 ResolveCollisionLayer(struct Entity_*); extern void sub_0800417E(struct Entity_*, u32); extern u32 sub_0800442E(struct Entity_*); -extern u32 sub_08007DD6(u32, const u16*); +extern u32 ActTileToTile(u32, const u16*); extern void SoundReqClipped(struct Entity_*, u32); extern u32 sub_0800132C(struct Entity_*, struct Entity_*); extern u32 sub_080B1B44(u32, u32); @@ -54,7 +54,7 @@ extern u32 sub_080B1AE0(u16, u8); extern u32 GetActTile(struct Entity_*); extern u32 sub_0800445C(struct Entity_*); extern u32 sub_080B1AF0(struct Entity_*, s32, s32); -extern u32 GetRelativeCollisionTile(struct Entity_*, u32, u32); +extern u32 GetActTileRelative(struct Entity_*, u32, u32); extern bool32 sub_080B1B54(u32); extern u32 CheckRectOnScreen(s32, s32, u32, u32); diff --git a/include/collision.h b/include/collision.h index af8ba984..465d3e9f 100644 --- a/include/collision.h +++ b/include/collision.h @@ -6,6 +6,16 @@ /** Collisions. */ +enum { + COL_LANTERN = 0x7, + COL_SMALL_GUST = 0x13, + COL_BOOMERANG = 0x14, + COL_ARROW = 0x15, + COL_BIG_GUST = 0x1b, + COL_PACCI = 0x1d, + COL_SWORD_BEAM = 0x21, +}; + typedef enum { COL_NONE = 0x0, COL_NORTH_WEST = 0x2, diff --git a/include/enemy.h b/include/enemy.h index 28a236ab..c799f058 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -62,7 +62,6 @@ void EnemySetFXOffset(Entity*, s32, s32, s32); Entity* EnemyCreateProjectile(Entity*, u32, u32); void GenericDeath(Entity*); -void sub_08002724(void*, u8*); void sub_080026C4(u8*, u8*, u8*, u32); void sub_080026F2(u8*, void*, u8*, u32); bool32 sub_08049FA0(Entity*); diff --git a/include/entity.h b/include/entity.h index 315e94db..8a66283c 100644 --- a/include/entity.h +++ b/include/entity.h @@ -79,6 +79,8 @@ typedef enum { DirectionNorthWest = 0x1c, /**< North West. */ } Direction; +#define CONTACT_TAKE_DAMAGE 0x80 + typedef struct { void* entity1; void* entity2; diff --git a/include/functions.h b/include/functions.h index 2d843967..5d4b01fe 100644 --- a/include/functions.h +++ b/include/functions.h @@ -14,10 +14,10 @@ // Identified - to be sorted into header files extern u32 CheckRegionOnScreen(u32, u32, u32, u32); extern void CopyOAM(void); -extern void CreateChestSpawner(Entity*); +extern void CreateLavaDrownFX(Entity*); extern Entity* CreateGroundItem(Entity*, u32, u32); extern Entity* CreateGroundItemWithFlags(Entity*, u32, u32, u32); -extern void CreateItemOnGround(Entity*); +extern void CreatePitFallFX(Entity*); extern void CreateMagicSparkles(u32, u32, u32); extern void CreateMinishEntrance(u32 tile); extern u32 CreateRandomItemDrop(Entity*, u32); @@ -25,7 +25,7 @@ extern void DrawDirect(u32 spriteIndex, u32 frameIndex); extern void DrawEntities(void); extern bool32 EntityWithinDistance(Entity*, s32, s32, s32); extern void FlushSprites(void); -extern LayerStruct* GetLayerByIndex(u32); +extern LayerStruct* GetTileBuffer(u32); extern u32 GetTileIndex(u32 tilePos, u32 layer); extern u32 GiveItem(u32, u32); extern bool32 LoadFixedGFX(Entity*, u32); @@ -57,7 +57,7 @@ extern u32 sub_080B1B18(s32, s32, u32); extern u32 sub_080B1B44(u32, u32); extern s32 sub_080012DC(Entity*); extern void sub_08001318(Entity*); -extern void sub_080027EA(Entity*, u32, u32); +extern void LinearMoveDirectionOLD(Entity*, u32, u32); extern void sub_080028E0(Entity*); extern u32 sub_080040A2(Entity*); extern u32 sub_080040D8(Entity*, u8*, s32, s32); @@ -66,15 +66,15 @@ extern u32 sub_0800419C(Entity*, Entity*, u32, u32); extern u32 sub_080041DC(Entity*, u32, u32); extern void sub_080042BA(Entity*, u32); extern void sub_080042D0(Entity*, u32, u16); -extern void sub_080043A8(Entity*); +extern void CreateDrownFX(Entity*); extern u32 sub_0800445C(Entity*); extern void sub_080044AE(Entity*, u32, u32); extern u32 BounceUpdate(Entity*, u32); extern void sub_0800451C(Entity*); extern void sub_08004542(Entity*); extern void sub_080085B0(Entity*); -extern u16* sub_08008796(Entity*, u32, u32, u32); -extern void sub_08016AD2(Entity*); +extern u16* DoTileInteraction(Entity*, u32, u32, u32); +extern void UpdateCollisionLayer(Entity*); extern u32 sub_0801766C(Entity*); extern void sub_0801AFE4(void); extern void UpdateUIElements(void); diff --git a/include/map.h b/include/map.h index b943ca2e..9859fa39 100644 --- a/include/map.h +++ b/include/map.h @@ -6,18 +6,18 @@ typedef struct { /*0x0000*/ BgSettings* bgSettings; - /*0x0004*/ u16 mapData[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom - /*0x2004*/ u8 collisionData[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4 - /*0x3004*/ u16 mapDataClone[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4 - /*0x5004*/ u16 metatileTypes[0x800]; // gMetatileTypesTop, gMetatileTypesBottom - /*0x6004*/ u16 unkData2[0x800]; // gUnk_02011654,gUnk_0202BEB4 - /*0x7004*/ u16 metatiles[0x2000]; // gMetatilesTop, gMetatilesBottom - /*0xb004*/ u8 unkData3[0x1000]; // gUnk_02016654, gUnk_02030EB4 + /*0x0004*/ u16 mapData[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom + /*0x2004*/ u8 collisionData[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4 + /*0x3004*/ u16 mapDataOriginal[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4 + /*0x5004*/ u16 metatileTypes[0x800]; // gMetatileTypesTop, gMetatileTypesBottom + /*0x6004*/ u16 unkData2[0x800]; // gUnk_02011654,gUnk_0202BEB4 + /*0x7004*/ u16 metatiles[0x2000]; // gMetatilesTop, gMetatilesBottom + /*0xb004*/ u8 unkData3[0x1000]; // gUnk_02016654, gUnk_02030EB4 } LayerStruct; extern LayerStruct gMapTop; extern LayerStruct gMapBottom; -LayerStruct* GetLayerByIndex(u32); +LayerStruct* GetTileBuffer(u32); #endif // MAP_H diff --git a/include/player.h b/include/player.h index d22b8968..0f0aa027 100644 --- a/include/player.h +++ b/include/player.h @@ -762,7 +762,7 @@ void PlayerShrinkByRay(void); // player.s extern u32 PlayerCheckNEastTile(); -extern u32* sub_08008790(Entity*, u32); +extern u32* DoTileInteractionHere(Entity*, u32); extern void UpdateIcePlayerVelocity(Entity*); extern void sub_08008AC6(Entity*); extern void sub_08008926(Entity*); diff --git a/include/tiles.h b/include/tiles.h index 1d3cac90..2dd6783a 100644 --- a/include/tiles.h +++ b/include/tiles.h @@ -2,6 +2,23 @@ #define TILES_H typedef enum { + TILE_ACT_CUT = 0x0, + TILE_ACT_ROCKBREAKER = 0x1, + TILE_ACT_BOOMERANG = 0x2, + TILE_ACT_BOMB = 0x3, + TILE_ACT_ARROW = 0x4, + TILE_ACT_GUST = 0x5, + TILE_ACT_LIFT = 0x6, + TILE_ACT_FIRE = 0x7, + TILE_ACT_PLAYER_WALK = 0x8, + TILE_ACT_ENEMY_WALK = 0x9, + TILE_ACT_PACCI = 0xA, + TILE_ACT_SWORDBEAM = 0xC, + TILE_ACT_DIG = 0xD, + TILE_ACT_MINIGUST = 0xE, +} TileInteraction; + +typedef enum { CUT_BUSH = 0x1C, CUT_GRASS = 0x1D, CUT_SIGNPOST = 0x1E, |
