comparison util.c @ 768:2f48a3c187c6

Add support for reading cartridge memory map from ROM database, though without EEPROM support for now
author Michael Pavone <pavone@retrodev.com>
date Tue, 07 Jul 2015 19:33:33 -0700
parents 206c449eaa81
children 13d3744b170e
comparison
equal deleted inserted replaced
767:ea525f600b1d 768:2f48a3c187c6
1 #include <string.h> 1 #include <string.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <stdio.h> 3 #include <stdio.h>
4 #include <ctype.h> 4 #include <ctype.h>
5 #include <stdint.h>
5 6
6 #include <sys/types.h> 7 #include <sys/types.h>
7 #include <sys/stat.h> 8 #include <sys/stat.h>
8 #include <unistd.h> 9 #include <unistd.h>
9 10
64 if (!*text) { 65 if (!*text) {
65 return text; 66 return text;
66 } 67 }
67 *text = 0; 68 *text = 0;
68 return text+1; 69 return text+1;
70 }
71
72 uint32_t nearest_pow2(uint32_t val)
73 {
74 uint32_t ret = 1;
75 while (ret < val)
76 {
77 ret = ret << 1;
78 }
79 return ret;
69 } 80 }
70 81
71 static char * exe_str; 82 static char * exe_str;
72 83
73 void set_exe_str(char * str) 84 void set_exe_str(char * str)