summaryrefslogtreecommitdiff
path: root/inc/utils.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-21 16:06:07 -0400
committerbd <bdunahu@operationnull.com>2025-03-21 16:06:07 -0400
commit75f78c215131499165101a499197313ba77ea230 (patch)
tree178eefa29cd9ac5ba88efd989364e1bbf591189e /inc/utils.h
parent7e01ac0891452dfda93c2dcfd0817a4d43871c4b (diff)
Small cleanups to up a lot of inplementation details
Diffstat (limited to 'inc/utils.h')
-rw-r--r--inc/utils.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/utils.h b/inc/utils.h
index aa8831b..df8d374 100644
--- a/inc/utils.h
+++ b/inc/utils.h
@@ -20,6 +20,20 @@ void get_bit_fields(int address, int *tag, int *index, int *offset);
*/
const std::string string_format(const char *const zcFormat, ...);
+/**
+ * Given `address`, returns an address that is within the current memory size
+ * using a clean wrap.
+ * @param an address
+ * @return an address guaranteed to be within range.
+ */
int wrap_address(int address);
+/**
+ * Given `address`, returns the line and word it is in.
+ * @param an address
+ * @param the line (row) `address` is in
+ * @param the word (column) `address` corresponds to
+ */
+void get_memory_index(int address, int &line, int &word);
+
#endif /* UTILS_H_INCLUDED */