Originally Posted by
FPK
Originally Posted by
Legolas
translate 1:1, like bit fields inside a struct, but I'll provide some bit masking functions, if needed
You can. FPC 2.1.1 supports bit packed records.
Nice! So if I have something like
Code:
typedef struct tPERSONAL_DATA {
u8 RESERVED0[2]; //!< ??? (0x05 0x00).
u8 theme; //!< The user's theme color (0-15).
u8 birthMonth; //!< The user's birth month (1-12).
u8 birthDay; //!< The user's birth day (1-31).
u8 RESERVED1[1]; //!< ???
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
packed_struct {
unsigned language : 3; //!< User's language.
unsigned gbaScreen : 1; //!< GBA screen selection (lower screen if set, otherwise upper screen).
unsigned RESERVED3 : 2; //!< ???
unsigned autoMode : 1; //!< The DS should boot from the DS cart or GBA cart automatically if one is inserted.
unsigned RESERVED4 : 1; //!< ???
};
} PACKED PERSONAL_DATA ;
how should I convert that packed_struct part? :think:
Bookmarks