src/mess/devices/messram.c
| r7813 | r7814 | |
| 191 | 191 | { |
| 192 | 192 | int j; |
| 193 | 193 | int size = strlen(config->extra_options); |
| 194 | | char *s = mame_strdup(config->extra_options); |
| 194 | char * const s = mame_strdup(config->extra_options); |
| 195 | char * const e = s + size; |
| 196 | char *p = s; |
| 195 | 197 | for (j=0;j<size;j++) { |
| 196 | | if (s[j]==',') s[j]=0; |
| 198 | if (p[j]==',') p[j]=0; |
| 197 | 199 | } |
| 198 | 200 | |
| 199 | 201 | /* try to parse each option */ |
| 200 | | while(*s != '\0') |
| 202 | while(p <= e) |
| 201 | 203 | { |
| 202 | | UINT32 option_ram_size = messram_parse_string(s); |
| 204 | UINT32 option_ram_size = messram_parse_string(p); |
| 203 | 205 | |
| 204 | 206 | if (option_ram_size == 0) |
| 205 | 207 | { |
| 206 | | mame_printf_error("%s: '%s' has an invalid RAM option: %s\n", driver->source_file, driver->name, s); |
| 208 | mame_printf_error("%s: '%s' has an invalid RAM option: %s\n", driver->source_file, driver->name, p); |
| 207 | 209 | error = TRUE; |
| 208 | 210 | } |
| 209 | 211 | |
| 210 | 212 | if (option_ram_size == specified_ram) |
| 211 | 213 | is_valid = TRUE; |
| 212 | 214 | |
| 213 | | s += strlen(s) + 1; |
| 215 | p += strlen(p); |
| 216 | if (p == e) |
| 217 | break; |
| 218 | p += 1; |
| 214 | 219 | } |
| 220 | |
| 221 | osd_free(s); |
| 215 | 222 | } |
| 216 | 223 | |
| 217 | 224 | } else { |
src/mess/infomess.c
| r7813 | r7814 | |
| 103 | 103 | { |
| 104 | 104 | int j; |
| 105 | 105 | int size = strlen(ram->extra_options); |
| 106 | | char *s = mame_strdup(ram->extra_options); |
| 106 | char * const s = mame_strdup(ram->extra_options); |
| 107 | char * const e = s + size; |
| 108 | char *p = s; |
| 107 | 109 | for (j=0;j<size;j++) { |
| 108 | | if (s[j]==',') s[j]=0; |
| 110 | if (p[j]==',') p[j]=0; |
| 109 | 111 | } |
| 110 | 112 | /* try to parse each option */ |
| 111 | | while(*s != '\0') |
| 113 | while(p <= e) |
| 112 | 114 | { |
| 113 | | fprintf(out, "\t\t<ramoption>%u</ramoption>\n", messram_parse_string(s)); |
| 114 | | s += strlen(s) + 1; |
| 115 | fprintf(out, "\t\t<ramoption>%u</ramoption>\n", messram_parse_string(p)); |
| 116 | p += strlen(p); |
| 117 | if (p == e) |
| 118 | break; |
| 119 | p += 1; |
| 115 | 120 | } |
| 121 | |
| 122 | osd_free(s); |
| 116 | 123 | } |
| 117 | 124 | } |
| 118 | 125 | } |