src/emu/softlist.c
| r9978 | r9979 | |
| 697 | 697 | const char *str_name = NULL; |
| 698 | 698 | const char *str_sha1 = NULL; |
| 699 | 699 | const char *str_status = NULL; |
| 700 | const char *str_writeable = NULL; |
| 700 | 701 | |
| 701 | 702 | for ( ; attributes[0]; attributes += 2 ) |
| 702 | 703 | { |
| r9978 | r9979 | |
| 705 | 706 | if ( !strcmp( attributes[0], "sha1" ) ) |
| 706 | 707 | str_sha1 = attributes[1]; |
| 707 | 708 | if ( !strcmp( attributes[0], "status" ) ) |
| 708 | | str_status = attributes[1]; |
| 709 | str_status = attributes[1]; |
| 710 | if ( !strcmp( attributes[0], "writeable" ) ) |
| 711 | str_writeable = attributes[1]; |
| 709 | 712 | } |
| 710 | 713 | if ( swlist->softinfo ) |
| 711 | 714 | { |
| r9978 | r9979 | |
| 715 | 718 | char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_sha1) + 7 + 4 ) ); |
| 716 | 719 | int baddump = ( str_status && !strcmp(str_status, "baddump") ) ? 1 : 0; |
| 717 | 720 | int nodump = ( str_status && !strcmp(str_status, "nodump" ) ) ? 1 : 0; |
| 721 | int writeable = ( str_writeable && !strcmp(str_writeable, "yes" ) ) ? 1 : 0; |
| 718 | 722 | |
| 719 | 723 | if ( !s_name || !hashdata ) |
| 720 | 724 | return; |
| r9978 | r9979 | |
| 722 | 726 | strcpy( s_name, str_name ); |
| 723 | 727 | sprintf( hashdata, "s:%s#%s", str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : "" ) ) ); |
| 724 | 728 | |
| 725 | | add_rom_entry( swlist, s_name, hashdata, 0, 0, ROMENTRYTYPE_ROM | DISK_READONLY ); |
| 729 | add_rom_entry( swlist, s_name, hashdata, 0, 0, ROMENTRYTYPE_ROM | (writeable ? DISK_READWRITE : DISK_READONLY ) ); |
| 726 | 730 | } |
| 727 | 731 | } |
| 728 | 732 | } |