Previous 15994 Revisions Next

r7717 Monday 5th April, 2010 at 15:27:02 UTC by Wilbert Pol
Added nodump/baddump status handling.
[src/mess]climess.c softlist.c

src/mess/climess.c
r7716r7717
194194                                                fprintf(out, " %s=\"%s\"", hash_function_name(1 << hashtype), checksum);
195195                                       }
196196
197                                       fprintf( out, " offset=\"%x\" />\n", ROM_GETOFFSET(rom) );
197                                       fprintf( out, " offset=\"%x\"", ROM_GETOFFSET(rom) );
198
199                                       if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP) )
200                                          fprintf( out, " status=\"baddump\"" );
201                                       if ( hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP) )
202                                          fprintf( out, " status=\"nodump\"" );
203
204                                       fprintf( out, "/>\n" );
198205                                    }
199206                                 }
200207
src/mess/softlist.c
r7716r7717
505505            const char *str_crc = NULL;
506506            const char *str_sha1 = NULL;
507507            const char *str_offset = NULL;
508            const char *str_status = NULL;
508509            const char *str_loadflag = NULL;
509510
510511            for ( ; attributes[0]; attributes += 2 )
r7716r7717
519520                  str_sha1 = attributes[1];
520521               if ( !strcmp( attributes[0], "offset" ) )
521522                  str_offset = attributes[1];
523               if ( !strcmp( attributes[0], "status" ) )
524                  str_status = attributes[1];
522525               if ( !strcmp( attributes[0], "loadflag" ) )
523526                  str_loadflag = attributes[1];
524527            }
r7716r7717
530533                  UINT32 offset = strtol( str_offset, NULL, 16 );
531534                  char *s_name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_name ) + 1 ) * sizeof(char) );
532535                  char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_crc) + strlen(str_sha1) + 7 ) );
536                  int baddump = ( !strcmp(str_status,"baddump") ) ? 1 : 0;
537                  int nodump = ( !strcmp(str_status,"nodump" ) ) ? 1 : 0;
533538
534539                  if ( !s_name || !hashdata )
535540                     return;
536541
537542                  strcpy( s_name, str_name );
538                  sprintf( hashdata, "c:%s#s:%s#", str_crc, str_sha1 );
543                  sprintf( hashdata, "c:%s#s:%s#%s", str_crc, str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : 0 ) ) );
539544
540545                  /* ROM_LOAD( name, offset, length, hash ) */
541546                  add_rom_entry( swlist, s_name, hashdata, offset, length, ROMENTRYTYPE_ROM );

Previous 15994 Revisions Next


© 1998-2018 The MESS Team