Create enums for Vvvs and MetaTiles

This commit is contained in:
octorock
2023-06-24 00:19:33 +02:00
parent f9da634427
commit f89bb66911
168 changed files with 5007 additions and 1629 deletions
+4 -4
View File
@@ -6,11 +6,11 @@
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 position, u32 layer);
extern u32 GetMetaTileTypeByEntity(struct Entity_*);
extern u32 GetMetaTileTypeByPos(s32 x, s32 y, u32 layer);
extern u32 GetMetaTileType(u32 metaTilePos, u32 layer);
extern void SetTile(u32 metaTile, u32 metaTilePos, u32 layer);
extern void SetMetaTile(u32 metaTile, u32 metaTilePos, u32 layer);
extern void UpdateScrollVram(void);
extern u32 sub_080B1BA4(u32, u32, u32);
+1 -1
View File
@@ -3,7 +3,7 @@
#include "global.h"
enum {
typedef enum {
BG_ANIM_DEFAULT = 0,
BG_ANIM_PALETTE = 16,
BG_ANIM_MULTIPLE = 128,
+13 -6
View File
@@ -6,13 +6,13 @@
/*
tiles 0x4000 and above create an entry here
*/
#define MAX_0200B240 0x100
*/
#define MAX_SPECIAL_TILES 0x100
typedef struct {
u16 position; // (layer << 0xc) | position
u16 data;
} struct_0200B240;
extern struct_0200B240 gUnk_0200B240[MAX_0200B240];
u16 metaTilePosAndLayer; // (layer << 12) | position
u16 metaTileIndex;
} SpecialTileEntry;
extern SpecialTileEntry gMetaTilesForSpecialTiles[MAX_SPECIAL_TILES];
typedef struct {
u16 collision;
@@ -21,4 +21,11 @@ typedef struct {
void LoadMapData(MapDataDefinition* dataDefinition);
/**
* Renders a metaTleMap with 16x16 meta tiles into a tilemap with 8x8 tiles.
*
* Takes into account the special meta tiles >= 0x4000 using GetMetaTileSetIndexForSpecialTile.
*/
void RenderMapLayerToTileMap(u16* tileMap, MapLayer* mapLayer);
#endif // BEANSTALKSUBTASK_H
-2
View File
@@ -66,8 +66,6 @@ extern void CreateDialogBox(u32, u32);
extern const Font gUnk_080FC844;
extern const u16 gUnk_080FC85C[][3];
extern void (*const gUnk_080FC908[])(void);
extern const u8 gGlobalGfxAndPalettes[];
extern u32 gUsedPalettes;
extern u8 gTextGfxBuffer[];
#endif // FILESELECT_H
+1 -2
View File
@@ -24,8 +24,7 @@ extern u32 CreateRandomItemDrop(Entity*, u32);
extern void DrawDirect(u32 spriteIndex, u32 frameIndex);
extern void DrawEntities(void);
extern void FlushSprites(void);
extern LayerStruct* GetLayerByIndex(u32);
extern u32 GetTileIndex(u32 tilePos, u32 layer);
extern u32 GetMetaTileIndex(u32 metaTilePos, u32 layer);
extern u32 GiveItem(u32, u32);
extern bool32 LoadFixedGFX(Entity*, u32);
extern void LoadResources(void);
+3 -3
View File
@@ -6,13 +6,13 @@
typedef struct {
Manager base;
u8 field_0x20[0x15];
u8 field_0x35;
u8 layer;
u8 field_0x36;
u8 field_0x37;
s16 x;
u16 y;
u16 tile;
u16 field_0x3e;
u16 metaTilePos;
u16 flag;
} BombableWallManager;
#endif // BOMBABLEWALLMANAGER_H
+19 -7
View File
@@ -4,6 +4,16 @@
#include "global.h"
#include "screen.h"
/**
* @page TileMap TileMap
* @brief
*
*/
/**
* @brief Layer of the MetaTileMap.
* @ingroup TileMap
*/
typedef struct {
/*0x0000*/ BgSettings* bgSettings;
/*0x0004*/ u16 mapData[0x40 * 0x40];
@@ -38,16 +48,13 @@ typedef struct {
0x12: ice
0x57: cloning pad
*/
} LayerStruct;
} MapLayer;
extern LayerStruct gMapTop;
extern LayerStruct gMapBottom;
extern MapLayer gMapTop;
extern MapLayer gMapBottom;
// Rendered tilemaps https://www.coranac.com/tonc/text/regbg.htm#sec-map
// extern u16 gMapDataTopSpecial[0x4000];
// extern u16 gMapDataBottomSpecial[0x4000];
LayerStruct* GetLayerByIndex(u32);
extern MapLayer* GetLayerByIndex(u32 layer);
/*
Definition where some map data is found and where it should be copied to.
@@ -64,4 +71,9 @@ typedef struct {
// The src is compressed.
#define MAP_COMPRESSED 0x80000000
typedef enum {
LAYER_BOTTOM = 1,
LAYER_TOP = 2,
} LayerIndex;
#endif // MAP_H
+1 -1
View File
@@ -231,7 +231,7 @@ typedef struct {
typedef struct {
u16 flags;
u16 keys;
u16 keys; /**< GBA keys bitmask, see io_reg.h */
} PlayerMacroEntry ALIGNED(2);
typedef enum {
+3 -3
View File
@@ -34,7 +34,7 @@ typedef struct {
/*0x0A*/ s16 scroll_x;
/*0x0C*/ s16 scroll_y;
/*0x0E*/ u8 scrollSpeed; /**< Pixels per frame that the camera can scroll. */
/*0x0F*/ u8 scroll_flags; // 0x2 = ?? (apply collision value on bottom map no matter the layer SetTileType is called
/*0x0F*/ u8 scroll_flags; // 0x2 = ?? (apply collision value on bottom map no matter the layer SetMetaTileType is called
// for), 0x4 = camera scrolling
/*0x10*/ u8 scroll_direction;
/*0x11*/ s8 oam_offset_x;
@@ -74,7 +74,7 @@ typedef struct {
/* 0x0a */ u8 unk2;
/* 0x0b */ u8 filler2;
/* 0x0c */ s16 lightLevel;
/* 0x0e */ u16 unk_0e; // Number of previous values for special tiles stored in gUnk_0200B240
/* 0x0e */ u16 specialTileCount; // Number of previous values for special tiles stored in gMetaTilesForSpecialTiles
/* 0x10 */ u8 unk_10[4];
/* 0x14 */ u32 flags;
/* 0x18 */ u32 unk3;
@@ -225,7 +225,7 @@ typedef enum {
extern void** gCurrentRoomProperties;
void SetTileType(u32 tileType, u32 position, u32 layer);
void SetMetaTileType(u32 metaTileType, u32 metaTilePos, u32 layer);
void InitScreenShake(u32 time, u32 magnitude);
void CallRoomProp5And7(void);
+3
View File
@@ -392,4 +392,7 @@ typedef struct {
u8 gfxGroup;
} PACKED StaffrollGfxEntry;
extern const u8 gGlobalGfxAndPalettes[];
extern u32 gUsedPalettes;
#endif // STRUCTURES_H
+13
View File
@@ -0,0 +1,13 @@
#ifndef TILEMAP_H
#define TILEMAP_H
#include "global.h"
// gMapDataTopSpecial and gMapDataBottomSpecial are tilemaps of 8x8 pixels. But they are also reused for other data in other parts of the game.
// Rendered tilemaps https://www.coranac.com/tonc/text/regbg.htm#sec-map
extern u16 gMapDataTopSpecial[0x4000];
extern u16 gMapDataBottomSpecial[0x4000];
#endif // TILEMAP_H
+1691
View File
File diff suppressed because it is too large Load Diff