summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-07-07 19:33:33 -0700
committerMichael Pavone <pavone@retrodev.com>2015-07-07 19:33:33 -0700
commit8af1d14863bb6ffad2c50b5275a848240c68c62e (patch)
tree0dc5406aafc64451f594ace900d3847e6559d9e1 /util.c
parent358991e7fef42ae206231aabfeee045e5214dbe4 (diff)
Add support for reading cartridge memory map from ROM database, though without EEPROM support for now
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.c b/util.c
index 20aa2ee..361d26b 100644
--- a/util.c
+++ b/util.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -68,6 +69,16 @@ char * split_keyval(char * text)
return text+1;
}
+uint32_t nearest_pow2(uint32_t val)
+{
+ uint32_t ret = 1;
+ while (ret < val)
+ {
+ ret = ret << 1;
+ }
+ return ret;
+}
+
static char * exe_str;
void set_exe_str(char * str)