src/mess/climess.c
| r7779 | r7780 | |
| 252 | 252 | { |
| 253 | 253 | fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%x\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) ); |
| 254 | 254 | |
| 255 | | for ( const rom_entry *rom = rom_first_file( region ); rom; rom = rom_next_file( rom ) ) |
| 255 | for ( const rom_entry *rom = rom_first_file( region ); !ROMENTRY_ISREGIONEND(rom); rom++ ) |
| 256 | 256 | { |
| 257 | 257 | if ( ROMENTRY_ISFILE(rom) ) |
| 258 | 258 | { |
| r7779 | r7780 | |
| 279 | 279 | |
| 280 | 280 | fprintf( out, "/>\n" ); |
| 281 | 281 | } |
| 282 | else if ( ROMENTRY_ISRELOAD(rom) ) |
| 283 | { |
| 284 | fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) ); |
| 285 | } |
| 282 | 286 | } |
| 283 | 287 | |
| 284 | 288 | fprintf( out, "\t\t\t\t</datearea>\n" ); |
src/mess/softlist.c
| r7779 | r7780 | |
| 525 | 525 | if ( !strcmp( attributes[0], "loadflag" ) ) |
| 526 | 526 | str_loadflag = attributes[1]; |
| 527 | 527 | } |
| 528 | | if ( str_name && str_size && str_crc && str_sha1 && str_offset ) |
| 528 | if ( swlist->softinfo ) |
| 529 | 529 | { |
| 530 | | if ( swlist->softinfo ) |
| 530 | if ( str_size && str_offset ) |
| 531 | 531 | { |
| 532 | 532 | UINT32 length = strtol( str_size, NULL, 10 ); |
| 533 | 533 | UINT32 offset = strtol( str_offset, NULL, 16 ); |
| 534 | | char *s_name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_name ) + 1 ) * sizeof(char) ); |
| 535 | | char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_crc) + strlen(str_sha1) + 7 ) ); |
| 536 | | int baddump = ( str_status && !strcmp(str_status,"baddump") ) ? 1 : 0; |
| 537 | | int nodump = ( str_status && !strcmp(str_status,"nodump" ) ) ? 1 : 0; |
| 538 | 534 | |
| 539 | | if ( !s_name || !hashdata ) |
| 540 | | return; |
| 535 | if ( str_loadflag && !strcmp(str_loadflag,"reload") ) |
| 536 | { |
| 537 | /* Handle 'reload' loadflag */ |
| 538 | add_rom_entry( swlist, NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS ); |
| 539 | } |
| 540 | else |
| 541 | { |
| 542 | if ( str_name && str_crc && str_sha1 ) |
| 543 | { |
| 544 | char *s_name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_name ) + 1 ) * sizeof(char) ); |
| 545 | char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_crc) + strlen(str_sha1) + 7 ) ); |
| 546 | int baddump = ( str_status && !strcmp(str_status,"baddump") ) ? 1 : 0; |
| 547 | int nodump = ( str_status && !strcmp(str_status,"nodump" ) ) ? 1 : 0; |
| 541 | 548 | |
| 542 | | strcpy( s_name, str_name ); |
| 543 | | sprintf( hashdata, "c:%s#s:%s#%s", str_crc, str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : 0 ) ) ); |
| 549 | if ( !s_name || !hashdata ) |
| 550 | return; |
| 544 | 551 | |
| 545 | | /* ROM_LOAD( name, offset, length, hash ) */ |
| 546 | | add_rom_entry( swlist, s_name, hashdata, offset, length, ROMENTRYTYPE_ROM ); |
| 552 | strcpy( s_name, str_name ); |
| 553 | sprintf( hashdata, "c:%s#s:%s#%s", str_crc, str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : 0 ) ) ); |
| 554 | |
| 555 | /* ROM_LOAD( name, offset, length, hash ) */ |
| 556 | add_rom_entry( swlist, s_name, hashdata, offset, length, ROMENTRYTYPE_ROM ); |
| 557 | } |
| 558 | } |
| 547 | 559 | } |
| 548 | 560 | } |
| 549 | 561 | else |