diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-07-07 19:33:33 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-07-07 19:33:33 -0700 |
commit | 8af1d14863bb6ffad2c50b5275a848240c68c62e (patch) | |
tree | 0dc5406aafc64451f594ace900d3847e6559d9e1 /util.c | |
parent | 358991e7fef42ae206231aabfeee045e5214dbe4 (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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) |