From 36b2301fd262adc70fc89ecdd3a7a97549b5a6c9 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 2 Dec 2019 13:34:11 -0500 Subject: mostly standardize to object event to prep for disassembly --- include/global.fieldmap.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 186185104..72970f28a 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -26,7 +26,7 @@ struct Tileset /*0x14*/ void *metatileAttributes; }; -struct MapData +struct MapLayout { /*0x00*/ s32 width; /*0x04*/ s32 height; @@ -38,14 +38,14 @@ struct MapData /*0x19*/ u8 unk19; }; -struct BackupMapData +struct BackupMapLayout { s32 Xsize; s32 Ysize; u16 *map; }; -union __attribute__((packed)) MapObjectRange { +union __attribute__((packed)) ObjectEventRange { u8 as_byte; struct __attribute__((packed)) { u8 x:4; @@ -53,7 +53,7 @@ union __attribute__((packed)) MapObjectRange { } __attribute__((aligned (1))) as_nybbles; } __attribute__((aligned (1))); -struct MapObjectTemplate +struct ObjectEventTemplate { /*0x00*/ u8 localId; /*0x01*/ u8 graphicsId; @@ -123,12 +123,12 @@ struct BgEvent struct MapEvents { - u8 mapObjectCount; + u8 objectEventCount; u8 warpCount; u8 coordEventCount; u8 bgEventCount; - struct MapObjectTemplate *mapObjects; + struct ObjectEventTemplate *objectEvents; struct WarpEvent *warps; struct CoordEvent *coordEvents; struct BgEvent *bgEvents; @@ -150,12 +150,12 @@ struct MapConnections struct MapHeader { - /* 0x00 */ struct MapData *mapData; + /* 0x00 */ struct MapLayout *mapLayout; /* 0x04 */ struct MapEvents *events; /* 0x08 */ u8 *mapScripts; /* 0x0C */ struct MapConnections *connections; /* 0x10 */ u16 music; - /* 0x12 */ u16 mapDataId; + /* 0x12 */ u16 mapLayoutId; /* 0x14 */ u8 regionMapSectionId; /* 0x15 */ u8 cave; /* 0x16 */ u8 weather; @@ -166,7 +166,7 @@ struct MapHeader /* 0x1B */ u8 battleType; }; -struct MapObject +struct ObjectEvent { /*0x00*/ u32 active:1; u32 mapobj_bit_1:1; @@ -214,7 +214,7 @@ struct MapObject /*0x14*/ struct Coords16 coords3; /*0x18*/ u8 facingDirection:4; //current direction? /*0x18*/ u8 placeholder18:4; - /*0x19*/ union MapObjectRange range; + /*0x19*/ union ObjectEventRange range; /*0x1A*/ u8 mapobj_unk_1A; /*0x1B*/ u8 mapobj_unk_1B; /*0x1C*/ u8 mapobj_unk_1C; @@ -227,7 +227,7 @@ struct MapObject /*size = 0x24*/ }; -struct MapObjectGraphicsInfo +struct ObjectEventGraphicsInfo { /*0x00*/ u16 tileTag; /*0x02*/ u16 paletteTag1; @@ -309,8 +309,8 @@ struct Camera s32 y; }; -extern struct MapObject gMapObjects[NUM_FIELD_OBJECTS]; -extern u8 gSelectedEventObject; +extern struct ObjectEvent gObjectEvents[NUM_FIELD_OBJECTS]; +extern u8 gSelectedObjectEvent; extern struct MapHeader gMapHeader; extern struct PlayerAvatar gPlayerAvatar; extern struct Camera gCamera; -- cgit v1.2.3 From 46a8b0fb29e4b6ba0535350f7eb0b4681b026749 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 2 Dec 2019 16:51:24 -0500 Subject: finish object event rename --- include/global.fieldmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 72970f28a..8d1097017 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -1,7 +1,7 @@ #ifndef GUARD_GLOBAL_FIELDMAP_H #define GUARD_GLOBAL_FIELDMAP_H -#define NUM_FIELD_OBJECTS 16 +#define OBJECT_EVENTS_COUNT 16 enum { @@ -309,7 +309,7 @@ struct Camera s32 y; }; -extern struct ObjectEvent gObjectEvents[NUM_FIELD_OBJECTS]; +extern struct ObjectEvent gObjectEvents[OBJECT_EVENTS_COUNT]; extern u8 gSelectedObjectEvent; extern struct MapHeader gMapHeader; extern struct PlayerAvatar gPlayerAvatar; -- cgit v1.2.3 From fabe354c015e0d587353093debafff6f44d6ab07 Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 17 Dec 2019 20:16:40 -0500 Subject: final pass at unifying on object event --- include/global.fieldmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 8d1097017..e567c6d5f 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -288,7 +288,7 @@ struct PlayerAvatar /* 0x202E858 */ /*0x02*/ u8 running2; /*0x03*/ u8 running1; /*0x04*/ u8 spriteId; - /*0x05*/ u8 mapObjectId; + /*0x05*/ u8 objectEventId; /*0x06*/ u8 unk6; /*0x07*/ u8 gender; u8 acroBikeState; -- cgit v1.2.3