diff options
author | U-User-PC\User <golemgalvanize@github.com> | 2017-10-03 15:54:19 -0400 |
---|---|---|
committer | U-User-PC\User <golemgalvanize@github.com> | 2017-10-03 15:54:19 -0400 |
commit | 1ae3d9b57b0f4ad506a1bd7323e46d2fa768b6b7 (patch) | |
tree | fca8b14b2e5e3a2390c1b890db2f56f6f8cff744 /include/global.h | |
parent | 0a88d1042a80bcc703d05f1cf19527272424a03f (diff) | |
parent | d32ec8bf7246468625ab68a2d62835d70b7ac98c (diff) |
I hope this fixes merge conflicts
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/include/global.h b/include/global.h index e694a5974..4014c6dde 100644 --- a/include/global.h +++ b/include/global.h @@ -9,9 +9,23 @@ // to help in decompiling #define asm_comment(x) asm volatile("@ -- " x " -- ") +#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided") + +#if defined (__APPLE__) || defined (__CYGWIN__) +void memset(void *, int, size_t); +void memcpy(void *, const void *, size_t); +#endif // __APPLE__ #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) +// useful math macros + +// Converts a number to Q8.8 fixed-point format +#define Q_8_8(n) ((s16)((n) * 256)) + +// Converts a number to Q4.12 fixed-point format +#define Q_4_12(n) ((s16)((n) * 4096)) + #define POKEMON_NAME_LENGTH 10 #define OT_NAME_LENGTH 7 @@ -639,7 +653,8 @@ struct DaycareMon struct MailStruct mail; u8 OT_name[OT_NAME_LENGTH + 1]; u8 monName[11]; - u8 language; + u8 language_maybe : 4; + u8 unknown : 4; u32 stepsTaken; }; @@ -655,6 +670,61 @@ struct DaycareData #define FLAGS_COUNT 300 #define VARS_COUNT 256 +enum { + LILYCOVE_LADY_QUIZ, + LILYCOVE_LADY_FAVOUR, + LILYCOVE_LADY_CONTEST +}; + +struct LilycoveLadyQuiz +{ + /*0x000*/ u8 id; + /*0x001*/ u8 phase; + /*0x002*/ u16 unk_002[9]; + /*0x014*/ u16 unk_014; + /*0x016*/ u16 unk_016; + /*0x018*/ u8 playerName[8]; + /*0x020*/ u16 playerTrainerId[4]; + /*0x028*/ u16 itemId; + /*0x02a*/ u8 unk_02a; + /*0x02b*/ u8 unk_02b; + /*0x02c*/ u8 unk_02c; + /*0x02d*/ u8 language; +}; + +struct LilycoveLadyFavour +{ + /*0x000*/ u8 id; + /*0x001*/ u8 phase; + /*0x002*/ u8 unk_002; + /*0x003*/ u8 unk_003; + /*0x004*/ u8 playerName[8]; + /*0x00c*/ u8 unk_00c; + /*0x00e*/ u16 itemId; + /*0x010*/ u16 unk_010; + /*0x012*/ u8 language; +}; + +struct LilycoveLadyContest +{ + /*0x000*/ u8 id; + /*0x001*/ u8 phase; + /*0x002*/ u8 fave_pkblk; + /*0x003*/ u8 other_pkblk; + /*0x004*/ u8 playerName[8]; + /*0x00c*/ u8 max_sheen; + /*0x00d*/ u8 category; + /*0x00e*/ u8 language; +}; + +typedef union // TODO +{ + struct LilycoveLadyQuiz quiz; + struct LilycoveLadyFavour favour; + struct LilycoveLadyContest contest; + u8 id; +} LilycoveLady; + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -738,7 +808,8 @@ struct SaveBlock1 /*0x3728*/ struct RamScript ramScript; /*0x3B14*/ struct RecordMixingGift recordMixingGift; /*0x3B24*/ u8 seen2[52]; - /*0x3B58*/ u8 lilycoveLady[536]; // TODO: convert to a union + /*0x3B58*/ LilycoveLady lilycoveLady; + /*0x3B88*/ u8 filler_3B88[0x1E8]; /*0x3D70*/ u8 babyPhrase[24]; // TODO: convert to a struct // sizeof: 0x3D88 }; @@ -752,4 +823,6 @@ struct Bitmap // TODO: Find a better spot for this u32 height:16; }; +extern u8 gReservedSpritePaletteCount; + #endif // GUARD_GLOBAL_H |