summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/memory.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-01-30 13:25:32 -0500
committer AJR <ajrhacker@users.noreply.github.com>2016-01-30 13:25:32 -0500
commit83e6738a0a26282606b21848a027963d63ef8f78 (patch)
tree313ce111894087682675cc4b6559d94baa1af9e6 /src/emu/memory.h
parent37adee5d3eaf57ef1a7554781349eb6724326776 (diff)
Add macros for alignment checking (nw)
Diffstat (limited to 'src/emu/memory.h')
-rw-r--r--src/emu/memory.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 3b46ac33449..34a060a51b6 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -866,6 +866,12 @@ private:
#define DWORD_XOR_LE(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(0,4))
+// helpers for checking address alignment
+#define WORD_ALIGNED(a) (((a) & 1) == 0)
+#define DWORD_ALIGNED(a) (((a) & 3) == 0)
+#define QWORD_ALIGNED(a) (((a) & 7) == 0)
+
+
//**************************************************************************
// INLINE FUNCTIONS