diff options
Diffstat (limited to 'include/global.fieldmap.h')
-rw-r--r-- | include/global.fieldmap.h | 211 |
1 files changed, 154 insertions, 57 deletions
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 9bcd9c3e7..7589de029 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -11,54 +11,98 @@ enum CONNECTION_EMERGE }; +// map types +enum +{ + MAP_TYPE_0, + MAP_TYPE_TOWN, + MAP_TYPE_CITY, + MAP_TYPE_ROUTE, + MAP_TYPE_UNDERGROUND, + MAP_TYPE_UNDERWATER, + MAP_TYPE_6, + MAP_TYPE_7, + MAP_TYPE_INDOOR, + MAP_TYPE_SECRET_BASE +}; + +// map battle scenes +enum +{ + MAP_BATTLE_SCENE_NORMAL, // 0 + MAP_BATTLE_SCENE_GYM, // 1 + MAP_BATTLE_SCENE_MAGMA, // 2 + MAP_BATTLE_SCENE_AQUA, // 3 + MAP_BATTLE_SCENE_SIDNEY, // 4 + MAP_BATTLE_SCENE_PHOEBE, // 5 + MAP_BATTLE_SCENE_GLACIA, // 6 + MAP_BATTLE_SCENE_DRAKE, // 7 + MAP_BATTLE_SCENE_BATTLE_TOWER, // 8 +}; + typedef void (*TilesetCB)(void); struct Tileset { - bool8 isCompressed; - bool8 isSecondary; - void *tiles; - void *palettes; - void *metatiles; - void *metatileAttributes; - TilesetCB callback; + /*0x00*/ bool8 isCompressed; + /*0x01*/ bool8 isSecondary; + /*0x04*/ void *tiles; + /*0x08*/ void *palettes; + /*0x0c*/ void *metatiles; + /*0x10*/ void *metatileAttributes; + /*0x14*/ TilesetCB callback; }; struct MapData { + /*0x00*/ s32 width; + /*0x04*/ s32 height; + /*0x08*/ u16 *border; + /*0x0c*/ u16 *map; + /*0x10*/ struct Tileset *primaryTileset; + /*0x14*/ struct Tileset *secondaryTileset; +}; + +struct BackupMapData +{ s32 width; s32 height; - u16 *border; u16 *map; - struct Tileset *primaryTileset; - struct Tileset *secondaryTileset; }; struct MapObjectTemplate { /*0x00*/ u8 localId; - /*0x01*/ u8 filler_1[0x3]; + /*0x01*/ u8 graphicsId; + /*0x02*/ u8 unk2; /*0x04*/ s16 x; /*0x06*/ s16 y; /*0x08*/ u8 elevation; /*0x09*/ u8 movementType; - /*0x0A*/ u8 filler_A[0x6]; + /*0x0A*/ u8 unkA_0:4; + u8 unkA_4:4; + ///*0x0B*/ u8 fillerB[1]; + /*0x0C*/ u16 unkC; + /*0x0E*/ u16 unkE; /*0x10*/ u8 *script; - /*0x14*/ u8 filler_14[0x4]; + /*0x14*/ u16 flagId; + /*0x16*/ u8 filler_16[2]; }; /*size = 0x18*/ struct WarpEvent { s16 x, y; s8 warpId; - s8 mapGroup; - s8 mapNum; + u8 mapGroup; + u8 mapNum; + u8 unk7; }; struct CoordEvent { s16 x, y; - u8 filler_4[0x2]; + u8 unk4; + u8 filler_5; u16 trigger; u16 index; u8 filler_A[0x2]; @@ -67,11 +111,24 @@ struct CoordEvent struct BgEvent { - s16 x, y; - u8 filler_4; + u16 x, y; + u8 unk4; u8 kind; - s16 filler_6; - u8 *script; + // 0x2 padding for the union beginning. + union { // carried over from diego's FR/LG work, seems to be the same struct + // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. + u8 *script; + + // hidden item type probably + struct { + u8 filler6[0x2]; + u16 hiddenItemId; // flag offset to determine flag lookup + } hiddenItem; + + // secret base type + u32 secretBaseId; + + } bgUnion; }; struct MapEvents @@ -89,10 +146,10 @@ struct MapEvents struct MapConnection { - u8 direction; - u32 offset; - u8 mapGroup; - u8 mapNum; + /*0x00*/ u8 direction; + /*0x01*/ u32 offset; + /*0x05*/ u8 mapGroup; + /*0x06*/ u8 mapNum; }; struct MapConnections @@ -103,20 +160,20 @@ struct MapConnections struct MapHeader { - struct MapData *mapData; - struct MapEvents *events; - u8 *mapScripts; - struct MapConnections *connections; - u16 music; - u16 mapDataId; - u8 name; - u8 cave; - u8 weather; - /* 0x17 */ u8 light; - u8 filler_18; - u8 escapeRope; - u8 flags; - u8 battleType; + /* 0x00 */ struct MapData *mapData; + /* 0x04 */ struct MapEvents *events; + /* 0x08 */ u8 *mapScripts; + /* 0x0C */ struct MapConnections *connections; + /* 0x10 */ u16 music; + /* 0x12 */ u16 mapDataId; + /* 0x14 */ u8 name; + /* 0x15 */ u8 cave; + /* 0x16 */ u8 weather; + /* 0x17 */ u8 mapType; + /* 0x18 */ u8 filler_18; + /* 0x19 */ u8 escapeRope; + /* 0x1A */ u8 flags; + /* 0x1B */ u8 battleType; }; struct MapObject @@ -165,7 +222,7 @@ struct MapObject /*0x0C*/ struct Coords16 coords1; /*0x10*/ struct Coords16 coords2; /*0x14*/ struct Coords16 coords3; - /*0x18*/ u8 mapobj_unk_18:4; + /*0x18*/ u8 mapobj_unk_18:4; //current direction? /*0x18*/ u8 placeholder18:4; /*0x19*/ u8 mapobj_unk_19; /*0x1A*/ u8 mapobj_unk_1A; @@ -176,7 +233,7 @@ struct MapObject /*0x1F*/ u8 mapobj_unk_1F; /*0x20*/ u8 mapobj_unk_20; /*0x21*/ u8 mapobj_unk_21; - /*0x22*/ u8 mapobj_unk_22; + /*0x22*/ u8 animId; /*size = 0x24*/ }; @@ -244,22 +301,22 @@ struct MapObject2 struct MapObjectGraphicsInfo { - u16 tileTag; - u16 paletteTag1; - u16 paletteTag2; - u16 size; - s16 width; - s16 height; - u8 paletteSlot:4; - u8 shadowSize:2; - u8 inanimate:1; - u8 disableReflectionPaletteLoad:1; - u8 tracks; - struct OamData *oam; - struct SubspriteTable *subspriteTables; - union AnimCmd **anims; - struct SpriteFrameImage *images; - union AffineAnimCmd **affineAnims; + /*0x00*/ u16 tileTag; + /*0x02*/ u16 paletteTag1; + /*0x04*/ u16 paletteTag2; + /*0x06*/ u16 size; + /*0x08*/ s16 width; + /*0x0A*/ s16 height; + /*0x0C*/ u8 paletteSlot:4; + u8 shadowSize:2; + u8 inanimate:1; + u8 disableReflectionPaletteLoad:1; + /*0x0D*/ u8 tracks; + /*0x10*/ const struct OamData *oam; + /*0x14*/ const struct SubspriteTable *subspriteTables; + /*0x18*/ const union AnimCmd *const *anims; + /*0x1C*/ const struct SpriteFrameImage *images; + /*0x20*/ const union AffineAnimCmd *const *affineAnims; }; #define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) @@ -271,7 +328,32 @@ struct MapObjectGraphicsInfo #define PLAYER_AVATAR_FLAG_6 (1 << 6) #define PLAYER_AVATAR_FLAG_DASH (1 << 7) -struct PlayerAvatar +enum +{ + ACRO_BIKE_NORMAL, + ACRO_BIKE_TURNING, + ACRO_BIKE_WHEELIE_STANDING, + ACRO_BIKE_BUNNY_HOP, + ACRO_BIKE_WHEELIE_MOVING, + ACRO_BIKE_STATE5, + ACRO_BIKE_STATE6, +}; + +enum +{ + DIR_NONE, + DIR_SOUTH, + DIR_NORTH, + DIR_WEST, + DIR_EAST, +}; + +enum +{ + COLLISION_LEDGE_JUMP = 6 +}; + +struct PlayerAvatar /* 0x202E858 */ { /*0x00*/ u8 flags; /*0x01*/ u8 bike; @@ -281,9 +363,24 @@ struct PlayerAvatar /*0x05*/ u8 mapObjectId; /*0x06*/ u8 unk6; /*0x07*/ u8 gender; + u8 acroBikeState; + u8 unk9; + u8 bikeFrameCounter; + u8 unkB; + u32 unkC; + u32 unk10; + u8 unk14[8]; + u8 unk1C[8]; // TODO: rest of struct }; +struct Camera +{ + bool8 field_0:1; + s32 x; + s32 y; +}; + extern struct MapObject gMapObjects[]; extern u8 gSelectedMapObject; extern struct MapHeader gMapHeader; |