Rename vvv to actTile

This commit is contained in:
octorock
2024-01-06 16:14:12 +01:00
parent aced0bef69
commit 06dc158598
98 changed files with 3920 additions and 3910 deletions
+21 -13
View File
@@ -6,9 +6,8 @@
extern u32 Random(void);
extern u32 GetRandomByWeight(const u8*);
extern void CloneTile(u32, u32, u32);
extern u32 GetTileTypeByEntity(struct Entity_*);
extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer);
extern u32 GetTileType(u32 tilePos, u32 layer);
extern void SetTile(u32 tileIndex, u32 tilePos, u32 layer);
@@ -48,22 +47,28 @@ extern u32 sub_0800442E(struct Entity_*);
extern void SoundReqClipped(struct Entity_*, u32);
extern u32 sub_0800132C(struct Entity_*, struct Entity_*);
extern u32 sub_080B1A48(u32, u32, u32);
extern u32 sub_0800445C(struct Entity_*);
extern bool32 GetVvvForTileType(u32);
extern u32 CheckRectOnScreen(s32, s32, u32, u32);
extern u32 GetVvvRelativeToEntity(struct Entity_* entity, s32 xOffset, s32 yOffset);
extern u32 GetVvvAtEntity(struct Entity_* entity);
extern u32 GetVvvAtWorldCoords(u32 worldX, u32 worldY, u32 layer);
extern u32 GetVvvAtRoomCoords(u32 roomX, u32 roomY, u32 layer);
extern u32 GetVvvAtRoomTile(u32 roomTileX, u32 roomTileY, u32 layer);
extern u32 GetVvvAtTilePos(u16 tilePos, u8 layer);
extern u32 GetTileTypeRelativeToEntity(struct Entity_* entity, s32 xOffset, s32 yOffset);
extern u32 GetTileTypeAtEntity(struct Entity_* entity);
extern u32 GetTileTypeAtWorldCoords(s32 worldX, s32 worldY, u32 layer);
extern u32 GetTileTypeAtRoomCoords(u32 roomX, u32 roomY, u32 layer);
extern u32 GetTileTypeAtTilePos(u32 tilePos, u32 layer);
extern u32 GetActTileRelativeToEntity(struct Entity_* entity, s32 xOffset, s32 yOffset);
extern u32 GetActTileAtEntity(struct Entity_* entity);
extern u32 GetActTileAtWorldCoords(u32 worldX, u32 worldY, u32 layer);
extern u32 GetActTileAtRoomCoords(u32 roomX, u32 roomY, u32 layer);
extern u32 GetActTileAtRoomTile(u32 roomTileX, u32 roomTileY, u32 layer);
extern u32 GetActTileAtTilePos(u16 tilePos, u8 layer);
/**
* Sets vvv for a tilePos.
* Sets actTile for a tilePos.
*/
extern void SetVvvAtTilePos(u32 vvv, u32 tilePos, u32 layer);
extern void SetActTileAtTilePos(u32 actTile, u32 tilePos, u32 layer);
// Get CollisionData for entity (relative to entity?)
extern u32 GetCollisionDataRelativeTo(struct Entity_* entity, s32 xOffset, s32 yOffset);
@@ -91,6 +96,9 @@ extern u32 GetCollisionDataAtTilePos(u32 tilePos, u32 layer);
*/
extern void SetCollisionData(u32 collisionData, u32 tilePos, u32 layer);
extern u32 GetActTileForTileType(u32 tileType);
typedef struct {
u16 key;
u16 value;
+1 -1
View File
@@ -65,6 +65,6 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
bool32 ProcessMovementInternal(Entity*, s32, s32, u32);
u32 sub_080176E4(Entity*);
extern const u8 gMapTileTypeToVvv[]; // vvv for tileType?
extern const u8 gMapTileTypeToActTile[]; // actTile for tileType?
#endif // COLLISION_H
-1
View File
@@ -47,7 +47,6 @@ extern void ClearBgAnimations(void);
extern void SetBGDefaults(void);
// Unidentified
extern u32 sub_080B1A0C(Entity*, s32, s32);
extern s32 sub_080012DC(Entity*);
extern void sub_08001318(Entity*);
extern void LinearMoveDirectionOLD(Entity*, u32, u32);
+2 -2
View File
@@ -31,12 +31,12 @@ enum DiggingCaveEntranceType {
};
typedef struct {
u16 sourceTilePosition; /**< Tile position for the entrance in the source room. */
u16 sourceTilePos; /**< Tile position for the entrance in the source room. */
u8 sourceRoom; /**< @see RoomID */
u8 type; /**< @see DiggingCaveEntranceType */
u8 targetArea; /**< @see AreaID */
u8 targetRoom; /**< @see RoomID */
u16 targetTilePosition; /**< Tile position for the entrance in the target room. */
u16 targetTilePos; /**< Tile position for the entrance in the target room. */
} DiggingCaveEntrance;
typedef struct {
+39 -33
View File
@@ -1,17 +1,21 @@
#ifndef MAP_H
#define MAP_H
#include "global.h"
#include "screen.h"
/**
* @page TileMap TileMap
* @brief
* @brief The map consists of tiles to create the world.
*
* 16x16 tiles
* 8x8 subTiles
*
*
* tileIndex index into the tile set
* 0 to 0x800, special tiles at 0x4000 to 0x4096
* tilePos index into the current map
* tileType
* collisionData
*
*/
/**
@@ -20,38 +24,40 @@
*/
typedef struct {
/*0x0000*/ BgSettings* bgSettings;
/**
* tileIndex for each tile on the current layer.
*/
/*0x0004*/ u16 mapData[0x40 * 0x40];
/**< TileIndex for each tile on the current layer. */ // tilemap data? <-- gMapDataTop / gMapDataBottom
/*0x2004*/ u8 collisionData[0x40 * 0x40]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
/*0x3004*/ u16 mapDataOriginal[0x40 * 0x40]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
// Tileset
/**
* Collision data for each tile on the current layer.
* @see CollisionData
*/
/*0x2004*/ u8 collisionData[0x40 * 0x40];
/**
* Copy of the map data.
* @see mapData
*/
/*0x3004*/ u16 mapDataOriginal[0x40 * 0x40];
/**
* Maps from the tileIndex to the tileType.
* @see TileType
*/
/*0x5004*/ u16 tileTypes[0x800];
/**< Maps from the TileIndex to the TileType. */ // gTileTypesTop, gTileTypesBottom
/*0x6004*/ u16 unkData2[0x800];
/**< Maps from a TileType to a TileIndex. */ // gUnk_02011654,gUnk_0202BEB4 // TODO tile index for
// the tile type??
/*0x7004*/ u16 tiles[0x800 * 4];
/**< Mapping from a tile to the four tile_attrs it consists of.*/ // gTilesTop, gTilesBottom
/*
Temporarily call this vvv
VVV
vvv
Vvv
*/
/*0xb004*/ u8 vvv[0x40*0x40]; /**< Some sort of special behavior for tiles? Falling into holes or jumping off walls does not work when this is all zero.*/ // gUnk_02016654, gUnk_02030EB4
// TODO check with debugger what accesses this
// 0x637
// 0x2030eb4 + 0x637
// 0x20314eb
// e.g. GetVvvAtTilePos accesses this
// TODO check whether this also affects sound played when walking?
/*
0x10: water
0x12: ice
0x57: cloning pad
*/
/**
* Maps from a tileType to a tileIndex. Inverse of @see tileTypes.
* @see TileType
*/
/*0x6004*/ u16 tileIndices[0x800];
/**
* Maps from a tile index to the four sub tiles (with attributes) it consists of.
* @see https://www.coranac.com/tonc/text/regbg.htm#sec-map
*/
/*0x7004*/ u16 subTiles[0x800 * 4];
/**
* Some sort of special behavior for tiles? Falling into holes or jumping off walls does not work when this is all zero.
* @see ActTile
*/
/*0xb004*/ u8 actTiles[0x40*0x40];
} MapLayer;
extern MapLayer gMapTop;
+1 -1
View File
@@ -696,7 +696,7 @@ u32 sub_08079B24(void);
void sub_08079708(Entity*);
void sub_08079744(Entity*);
void PlayerUpdateSwimming(Entity*);
u32 GetVvvInFront(Entity* player);
u32 GetActTileInFront(Entity* player);
u32 sub_080797C4(void);
void CheckPlayerVelocity(void);
void sub_0807B068(Entity*);
+2 -2
View File
@@ -1,9 +1,9 @@
#ifndef ROOM_H
#define ROOM_H
#include "global.h"
#include "entity.h"
#include "droptables.h"
#include "map.h"
enum RoomTransition {
TRANSITION_DEFAULT,
@@ -56,7 +56,7 @@ typedef struct {
/*0x28*/ union SplitWord bg3OffsetX;
/*0x2C*/ union SplitWord bg3OffsetY;
/*0x30*/ Entity* camera_target;
/*0x34*/ u32 unk_34;
/*0x34*/ u32 tileset; // TODO Should be MapDataDefinition*, but then SetupTileSet does not match.
} RoomControls;
extern RoomControls gRoomControls;
+1758 -1758
View File
File diff suppressed because it is too large Load Diff