Sync fieldmap

This commit is contained in:
GriffinR
2022-09-02 19:14:44 -04:00
parent feccd302d7
commit dcdf31f020
16 changed files with 191 additions and 188 deletions
+18 -7
View File
@@ -1,13 +1,23 @@
#ifndef GUARD_GLOBAL_FIELDMAP_H
#define GUARD_GLOBAL_FIELDMAP_H
#define METATILE_BEHAVIOR_MASK 0x00FF
#define METATILE_COLLISION_MASK 0x0C00
#define METATILE_ID_MASK 0x03FF
#define METATILE_ID_UNDEFINED 0x03FF
#define METATILE_ELEVATION_SHIFT 12
#define METATILE_COLLISION_SHIFT 10
#define METATILE_ELEVATION_MASK 0xF000
// Masks/shifts for blocks in the map grid
// Map grid blocks consist of a 10 bit metatile id, a 2 bit collision value, and a 4 bit elevation value
// This is the data stored in each data/layouts/*/map.bin file
#define MAPGRID_METATILE_ID_MASK 0x03FF // Bits 0-9
#define MAPGRID_COLLISION_MASK 0x0C00 // Bits 10-11
#define MAPGRID_ELEVATION_MASK 0xF000 // Bits 12-15
#define MAPGRID_COLLISION_SHIFT 10
#define MAPGRID_ELEVATION_SHIFT 12
// An undefined map grid block has all metatile id bits set and nothing else
#define MAPGRID_UNDEFINED MAPGRID_METATILE_ID_MASK
enum {
METATILE_LAYER_TYPE_NORMAL, // Metatile uses middle and top bg layers
METATILE_LAYER_TYPE_COVERED, // Metatile uses bottom and middle bg layers
METATILE_LAYER_TYPE_SPLIT, // Metatile uses bottom and top bg layers
};
#define METATILE_ID(tileset, name) (METATILE_##tileset##_##name)
@@ -22,6 +32,7 @@ enum
METATILE_ATTRIBUTE_LAYER_TYPE,
METATILE_ATTRIBUTE_7,
METATILE_ATTRIBUTE_COUNT,
METATILE_ATTRIBUTES_ALL = 255 // Special id to get the full attributes value
};
enum