Add pack/unpack for data masks (#2163)

This commit is contained in:
GriffinR
2025-07-23 04:28:34 -04:00
committed by GitHub
parent 20012cba6e
commit 6f8a1bbdb8
12 changed files with 98 additions and 64 deletions

View File

@@ -119,6 +119,9 @@
#define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))
#define T2_READ_PTR(ptr) (void *) T2_READ_32(ptr)
#define PACK(data, shift, mask) ( ((data) << (shift)) & (mask) )
#define UNPACK(data, shift, mask) ( ((data) & (mask)) >> (shift) )
// Macros for checking the joypad
#define TEST_BUTTON(field, button) ((field) & (button))
#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button)