From 6b0268e0c0fb98014cb72f8a918a33c0645162d2 Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Tue, 10 Jan 2017 23:15:38 -0500 Subject: finish decompiling field_control_avatar.c (#182) * start decompiling field_control_avatar.c * remove field_control_player_avatar.c * finish decompiling * cleanup * var and flag constants --- include/global.fieldmap.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 95ccf2614..de465ac95 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -80,14 +80,15 @@ 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; + u8 unk4; u8 filler_5; u16 trigger; u16 index; @@ -98,7 +99,7 @@ struct CoordEvent struct BgEvent { s16 x, y; - u8 filler_4; + u8 unk4; u8 kind; s16 filler_6; u8 *script; -- cgit v1.2.3 From cf0a4dbb86f164026fa2028ef5d0d4a5a419c9c3 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 20 Jan 2017 17:43:41 -0500 Subject: start decompiling bike.c (#203) * start decompiling bike.c * decompile more of bike.c * decompile MovePlayerOnAcroBike and CheckMovementInputAcroBike --- include/global.fieldmap.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index de465ac95..64c2e8181 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -302,7 +302,7 @@ struct MapObjectGraphicsInfo #define PLAYER_AVATAR_FLAG_6 (1 << 6) #define PLAYER_AVATAR_FLAG_DASH (1 << 7) -struct PlayerAvatar +struct PlayerAvatar /* 0x202E858 */ { /*0x00*/ u8 flags; /*0x01*/ u8 bike; @@ -312,6 +312,10 @@ struct PlayerAvatar /*0x05*/ u8 mapObjectId; /*0x06*/ u8 unk6; /*0x07*/ u8 gender; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; // TODO: rest of struct }; -- cgit v1.2.3 From 3d3ef45a8c3d4f974dac94ab49fe906d26a8edab Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Fri, 20 Jan 2017 23:20:02 -0600 Subject: decompile more of bike (#205) * start decompiling bike.c * decompile more of bike.c * decompile MovePlayerOnAcroBike and CheckMovementInputAcroBike * decompile more of bike --- include/global.fieldmap.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 64c2e8181..eac2c0cf1 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -316,6 +316,10 @@ struct PlayerAvatar /* 0x202E858 */ u8 unk9; u8 unkA; u8 unkB; + u32 unkC; + u32 unk10; + u8 unk14[8]; + u8 unk1C[8]; // TODO: rest of struct }; -- cgit v1.2.3 From ef82a98a1525f58d3a6c56194a42f7660cfc923b Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 21 Jan 2017 22:04:49 -0600 Subject: label a few things and put data in field_player_avatar.c (#212) --- include/global.fieldmap.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index eac2c0cf1..5c498de49 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -196,7 +196,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; @@ -207,7 +207,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*/ }; @@ -302,6 +302,31 @@ struct MapObjectGraphicsInfo #define PLAYER_AVATAR_FLAG_6 (1 << 6) #define PLAYER_AVATAR_FLAG_DASH (1 << 7) +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; @@ -312,9 +337,9 @@ struct PlayerAvatar /* 0x202E858 */ /*0x05*/ u8 mapObjectId; /*0x06*/ u8 unk6; /*0x07*/ u8 gender; - u8 unk8; + u8 acroBikeState; u8 unk9; - u8 unkA; + u8 bikeFrameCounter; u8 unkB; u32 unkC; u32 unk10; -- cgit v1.2.3 From a500cfc5facbc262757b902c9b0b82a4a1821d3f Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 27 Jan 2017 15:58:28 -0600 Subject: start decompiling more of field_map_obj --- include/global.fieldmap.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 5c498de49..6f9ba8a94 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -66,12 +66,17 @@ struct MapData struct MapObjectTemplate { /*0x00*/ u8 localId; - /*0x01*/ u8 filler_1[0x3]; + /*0x01*/ u8 graphicsId; + /*0x02*/ u8 filler_2[0x2]; /*0x04*/ s16 x; /*0x06*/ s16 y; /*0x08*/ u8 elevation; /*0x09*/ u8 movementType; - /*0x0A*/ u8 filler_A[0x6]; + /*0x0A*/ u16 unkA_0:4; + u16 unkA_4:4; + ///*0x0B*/ u8 fillerB[1]; + /*0x0C*/ u16 unkC; + /*0x0E*/ u16 unkE; /*0x10*/ u8 *script; /*0x14*/ u8 filler_14[0x4]; }; /*size = 0x18*/ -- cgit v1.2.3 From ed8f49d5e1418309cbc4f705a242d073258c8639 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 28 Jan 2017 13:51:14 -0800 Subject: tabs to spaces --- include/global.fieldmap.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 5c498de49..bf356fecf 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -14,16 +14,16 @@ enum // 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_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 @@ -337,10 +337,10 @@ struct PlayerAvatar /* 0x202E858 */ /*0x05*/ u8 mapObjectId; /*0x06*/ u8 unk6; /*0x07*/ u8 gender; - u8 acroBikeState; - u8 unk9; - u8 bikeFrameCounter; - u8 unkB; + u8 acroBikeState; + u8 unk9; + u8 bikeFrameCounter; + u8 unkB; u32 unkC; u32 unk10; u8 unk14[8]; -- cgit v1.2.3 From c4c0e1d7d5630987b6d5f7f4522fc49f29bcbad5 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 28 Jan 2017 21:23:50 -0600 Subject: decompile some more --- include/global.fieldmap.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 6f9ba8a94..536e08cb3 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -72,13 +72,14 @@ struct MapObjectTemplate /*0x06*/ s16 y; /*0x08*/ u8 elevation; /*0x09*/ u8 movementType; - /*0x0A*/ u16 unkA_0:4; - u16 unkA_4:4; + /*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 unk14; + /*0x16*/ u8 filler_16[2]; }; /*size = 0x18*/ struct WarpEvent -- cgit v1.2.3 From 2c66ef8ef361de78f1b6529f177e299207d2006e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Fri, 3 Feb 2017 01:04:43 -0600 Subject: decompile more code --- include/global.fieldmap.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 536e08cb3..c599e4278 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -67,7 +67,7 @@ struct MapObjectTemplate { /*0x00*/ u8 localId; /*0x01*/ u8 graphicsId; - /*0x02*/ u8 filler_2[0x2]; + /*0x02*/ u8 unk2; /*0x04*/ s16 x; /*0x06*/ s16 y; /*0x08*/ u8 elevation; @@ -281,22 +281,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*/ struct OamData *oam; + /*0x14*/ struct SubspriteTable *subspriteTables; + /*0x18*/ union AnimCmd **anims; + /*0x1C*/ struct SpriteFrameImage *images; + /*0x20*/ union AffineAnimCmd **affineAnims; }; #define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) -- cgit v1.2.3 From 2afc20150b1cf5e9bcc8008c0323ac57af353718 Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 4 Feb 2017 21:47:11 -0600 Subject: decompile more of field_map_obj (#231) * decompile more code * decompile more of field_map_obj * decompile more of field_map_obj --- include/global.fieldmap.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index e3ec39ed1..3c6f4cf4e 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -78,7 +78,7 @@ struct MapObjectTemplate /*0x0C*/ u16 unkC; /*0x0E*/ u16 unkE; /*0x10*/ u8 *script; - /*0x14*/ u16 unk14; + /*0x14*/ u16 flagId; /*0x16*/ u8 filler_16[2]; }; /*size = 0x18*/ @@ -294,9 +294,9 @@ struct MapObjectGraphicsInfo /*0x0D*/ u8 tracks; /*0x10*/ struct OamData *oam; /*0x14*/ struct SubspriteTable *subspriteTables; - /*0x18*/ union AnimCmd **anims; + /*0x18*/ const union AnimCmd *const *anims; /*0x1C*/ struct SpriteFrameImage *images; - /*0x20*/ union AffineAnimCmd **affineAnims; + /*0x20*/ const union AffineAnimCmd *const *affineAnims; }; #define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) @@ -354,6 +354,13 @@ struct PlayerAvatar /* 0x202E858 */ // 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; -- cgit v1.2.3 From 3d5864529e93265ea1711b638a4ab7b3d563086d Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 22 Mar 2017 06:04:41 +0100 Subject: label changes for clarity --- include/global.fieldmap.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3c6f4cf4e..508d7e4ed 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -107,8 +107,21 @@ struct BgEvent s16 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 + u16 secretBaseId; + + } bgUnion; }; struct MapEvents @@ -126,10 +139,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 -- cgit v1.2.3