Merge pull request #55 from PikalaxALT/unk_8159F40

Some more decomp and porting
This commit is contained in:
PikalaxALT
2019-05-14 16:20:43 -04:00
committed by GitHub
24 changed files with 1981 additions and 3032 deletions
+1
View File
@@ -36,5 +36,6 @@ void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src
u32 sub_8034974(const u8 *ptr);
void sub_800F034(const struct CompressedSpriteSheet *src);
u32 GetDecompressedDataSize(const u8 *ptr);
#endif // GUARD_DECOMPRESS_H
+10 -9
View File
@@ -74,6 +74,14 @@ struct BackupMapData
u16 *map;
};
union __attribute__((packed)) MapObjectRange {
u8 as_byte;
struct __attribute__((packed)) {
u8 x:4;
u8 y:4;
} __attribute__((aligned (1))) as_nybbles;
} __attribute__((aligned (1)));
struct MapObjectTemplate
{
/*0x00*/ u8 localId;
@@ -83,8 +91,7 @@ struct MapObjectTemplate
/*0x06*/ s16 y;
/*0x08*/ u8 elevation;
/*0x09*/ u8 movementType;
/*0x0A*/ u8 unkA_0:4;
u8 unkA_4:4;
/*0x0A*/ union MapObjectRange range;
///*0x0B*/ u8 fillerB[1];
/*0x0C*/ u16 unkC;
/*0x0E*/ u16 unkE;
@@ -228,13 +235,7 @@ struct MapObject
/*0x14*/ struct Coords16 coords3;
/*0x18*/ u8 mapobj_unk_18:4; //current direction?
/*0x18*/ u8 placeholder18:4;
/*0x19*/ union __attribute__((packed)) {
u8 as_byte;
struct __attribute__((packed)) {
u8 x:4;
u8 y:4;
} __attribute__((aligned (1))) as_nybbles;
} __attribute__((aligned (1))) range;
/*0x19*/ union MapObjectRange range;
/*0x1A*/ u8 mapobj_unk_1A;
/*0x1B*/ u8 mapobj_unk_1B;
/*0x1C*/ u8 mapobj_unk_1C;
+44 -7
View File
@@ -565,6 +565,12 @@ typedef union QuestLogScene QuestLogScene;
// This name is a complete guess and may change.
#define MAP_OBJECTS_COUNT 16
#define BERRY_TREES_COUNT 128
#define FLAGS_COUNT 288 // 300
#define VARS_COUNT 256
#define MAIL_COUNT 16
// Declare here so that it can be recursively referenced.
union QuestLogMovement;
@@ -578,6 +584,43 @@ union QuestLogMovement
} ident_struct;
};
struct QuestLogMapObject
{
/*0x00*/ u8 active:1;
/*0x00*/ u8 mapobj_bit_3:1;
/*0x00*/ u8 mapobj_bit_4:1;
/*0x00*/ u8 mapobj_bit_5:1;
/*0x00*/ u8 mapobj_bit_8:1;
/*0x00*/ u8 mapobj_bit_9:1;
/*0x00*/ u8 mapobj_bit_10:1;
/*0x00*/ u8 mapobj_bit_11:1;
/*0x01*/ u8 mapobj_bit_12:1;
/*0x01*/ u8 mapobj_bit_13:1;
/*0x01*/ u8 mapobj_bit_14:1;
/*0x01*/ u8 mapobj_bit_15:1;
/*0x01*/ u8 mapobj_bit_16:1;
/*0x01*/ u8 mapobj_bit_23:1;
/*0x01*/ u8 mapobj_bit_24:1;
/*0x01*/ u8 mapobj_bit_25:1;
/*0x02*/ u8 mapobj_bit_26:1;
/*0x02*/ u8 mapobj_unk_18:4;
/*0x02*/ u8 unused_02_5:3;
/*0x03*/ u8 mapobj_unk_0B_0:4;
/*0x03*/ u8 elevation:4;
/*0x04*/ u8 graphicsId;
/*0x05*/ u8 animPattern;
/*0x06*/ u8 trainerType;
/*0x07*/ u8 localId;
/*0x08*/ u8 mapNum;
/*0x09*/ u8 mapGroup;
/*0x0a*/ s16 x;
/*0x0c*/ s16 y;
/*0x0e*/ u8 trainerRange_berryTreeId;
/*0x0f*/ u8 mapobj_unk_1F;
/*0x10*/ u8 mapobj_unk_21;
/*0x11*/ u8 animId;
};
struct QuestLog
{
/*0x0000*/ u8 unk_000;
@@ -586,7 +629,7 @@ struct QuestLog
/*0x0003*/ s8 unk_003;
/*0x0004*/ s16 unk_004;
/*0x0006*/ s16 unk_006;
/*0x0008*/ u8 filler_008[0x140];
/*0x0008*/ struct QuestLogMapObject unk_008[MAP_OBJECTS_COUNT];
// These arrays hold the game state for
// playing back the quest log
@@ -606,12 +649,6 @@ struct FameCheckerSaveData
u16 unk_0_E:2;
};
#define MAP_OBJECTS_COUNT 16
#define BERRY_TREES_COUNT 128
#define FLAGS_COUNT 288 // 300
#define VARS_COUNT 256
#define MAIL_COUNT 16
#define NUM_EASY_CHAT_EXTRA_PHRASES 33
#define EASY_CHAT_EXTRA_PHRASES_SIZE ((NUM_EASY_CHAT_EXTRA_PHRASES >> 3) + (NUM_EASY_CHAT_EXTRA_PHRASES % 8 ? 1 : 0))
+6
View File
@@ -1,6 +1,11 @@
#ifndef GUARD_LINK_RFU_H
#define GUARD_LINK_RFU_H
struct Padded_U8
{
u8 value;
};
void AddTextPrinterToWindow1(const u8 *str);
bool32 MG_PrintTextOnWindow1AndWaitButton(u8 * cmdPtr, const u8 * src);
void sub_80FA190(void);
@@ -11,5 +16,6 @@ void DestroyWirelessStatusIndicatorSprite(void);
void MEvent_CreateTask_CardOrNewsWithFriend(u8);
void MEvent_CreateTask_CardOrNewsOverWireless(u8);
void MEvent_CreateTask_Leader(u8);
void sub_80F9E2C(void * data);
#endif //GUARD_LINK_RFU_H
+24
View File
@@ -0,0 +1,24 @@
#ifndef GUARD_UNK_815C980_H
#define GUARD_UNK_815C980_H
struct UnkStruct3
{
u8 field_0_0:2;
u8 shape:2;
u8 size:2;
u8 priority:2;
u8 field_1;
u8 xDelta;
s16 x;
s16 y;
const struct SpriteSheet *spriteSheet;
const struct SpritePalette *spritePal;
};
void sub_815C9F4(void);
void sub_815D108(u32 id);
void sub_815CD70(u32 id, s32 arg1);
u8 sub_815D324(u32 shape, u32 size);
bool32 sub_815CA40(u32 id, s32 arg1, const struct UnkStruct3 *arg2);
#endif //GUARD_UNK_815C980_H