Previous 15994 Revisions Next

r9979 Monday 10th January, 2011 at 13:01:38 UTC by Miodrag Milanović
Added support for writable CHD's too
[src/emu]softlist.c

src/emu/softlist.c
r9978r9979
697697            const char *str_name = NULL;
698698            const char *str_sha1 = NULL;
699699            const char *str_status = NULL;
700            const char *str_writeable = NULL;
700701
701702            for ( ; attributes[0]; attributes += 2 )
702703            {
r9978r9979
705706               if ( !strcmp( attributes[0], "sha1" ) )
706707                  str_sha1 = attributes[1];
707708               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];
709712            }
710713            if ( swlist->softinfo )
711714            {
r9978r9979
715718                  char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_sha1) + 7 + 4 ) );
716719                  int baddump = ( str_status && !strcmp(str_status, "baddump") ) ? 1 : 0;
717720                  int nodump = ( str_status && !strcmp(str_status, "nodump" ) ) ? 1 : 0;
721                  int writeable = ( str_writeable && !strcmp(str_writeable, "yes" ) ) ? 1 : 0;
718722
719723                  if ( !s_name || !hashdata )
720724                     return;
r9978r9979
722726                  strcpy( s_name, str_name );
723727                  sprintf( hashdata, "s:%s#%s", str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : "" ) ) );
724728
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 ) );
726730               }
727731            }
728732         }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team