diff options
| author | bd <bdunahu@operationnull.com> | 2025-03-21 16:06:07 -0400 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-03-21 16:06:07 -0400 |
| commit | 431cba9a4bcef0e0ae047d45a7f3d98e601e30ed (patch) | |
| tree | 178eefa29cd9ac5ba88efd989364e1bbf591189e /inc/utils.h | |
| parent | 41a6a317964c7ff09a98e9bbdb1995ac46937ff3 (diff) | |
Small cleanups to up a lot of inplementation details
Diffstat (limited to 'inc/utils.h')
| -rw-r--r-- | inc/utils.h | 14 |
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 */ |
