diff options
Diffstat (limited to 'inc/dram.h')
-rw-r--r-- | inc/dram.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -5,6 +5,15 @@ #include <functional> #include <ostream> +// clang-format off +/** + * Ensures address is within the current memory size using a clean wrap. + * @param an address + */ +#define WRAP_ADDRESS(a) \ + ((a < 0) ? ((a % MEM_WORDS) + MEM_WORDS) % MEM_WORDS : a % MEM_WORDS) +// clang-format on + class Dram : public Storage { public: |