diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2016-07-04 11:48:00 +0100 |
|---|---|---|
| committer | iCatButler <i.am.catbutler@gmail.com> | 2016-07-04 11:48:00 +0100 |
| commit | 97105b26f2194dcfb50addf0a421db9debd797d5 (patch) | |
| tree | c8a5b710d10c3568d754d54c07b8fc80711cbc44 /libpcsxcore/pgxp_value.h | |
| parent | 03cfe9e6c22044c5b6e333b90c2b0021842fffad (diff) | |
| download | pcsxr-97105b26f2194dcfb50addf0a421db9debd797d5.tar.gz | |
Change "valid" flag to multiple bit flags
Validity of a pgxp value can now be set for any of four components using individual bit flags. This also allows the potential expansion of more flag data for each component.
Diffstat (limited to 'libpcsxcore/pgxp_value.h')
| -rw-r--r-- | libpcsxcore/pgxp_value.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libpcsxcore/pgxp_value.h b/libpcsxcore/pgxp_value.h index 4dad4d20..e92f5f4a 100644 --- a/libpcsxcore/pgxp_value.h +++ b/libpcsxcore/pgxp_value.h @@ -51,7 +51,12 @@ typedef struct PGXP_value_Tag float x; float y; float z; - unsigned int valid; + union + { + unsigned int flags; + unsigned char compFlags[4]; + unsigned short halfFlags[2]; + }; unsigned int count; unsigned int value; @@ -76,12 +81,26 @@ typedef enum VALID_HALF = (1 << 0) } PGXP_half_flags; +//typedef enum +//{ +#define NONE 0 +#define ALL 0xFFFFFFFF +#define VALID 1 +#define VALID_0 (VALID << 0) +#define VALID_1 (VALID << 8) +#define VALID_2 (VALID << 16) +#define VALID_3 (VALID << 24) +#define VALID_01 (VALID_0 | VALID_1) +#define VALID_ALL (VALID_0 | VALID_1 | VALID_2 | VALID_3) +#define INV_VALID_ALL (ALL ^ VALID_ALL) +//} PGXP_value_flags; + static const PGXP_value PGXP_value_invalid_address = { 0.f, 0.f, 0.f, 0, 0, 0, INVALID_ADDRESS, 0, 0 }; -static const PGXP_value PGXP_value_zero = { 0.f, 0.f, 0.f, 0, 0, 1, 0, 0, 0 }; +static const PGXP_value PGXP_value_zero = { 0.f, 0.f, 0.f, 0, 0, VALID_ALL, 0, 0, 0 }; void MakeValid(PGXP_value *pV, u32 psxV); void Validate(PGXP_value *pV, u32 psxV); -void MaskValidate(PGXP_value *pV, u32 psxV, u32 mask); +void MaskValidate(PGXP_value *pV, u32 psxV, u32 mask, u32 validMask); typedef union |
