Previous 15994 Revisions Next

r8095 Thursday 20th May, 2010 at 01:33:38 UTC by Firewave
Added "fill" and "continue" loadflags to softlists. Also handle "load32_word_swap".
[hash]softwarelist.dtd
[src/mess]softlist.c

hash/softwarelist.dtd
r8094r8095
2525<!ATTLIST rom md5 CDATA #IMPLIED>
2626<!ATTLIST rom sha1 CDATA #IMPLIED>
2727<!ATTLIST rom offset CDATA #IMPLIED>
28<!ATTLIST rom value CDATA #IMPLIED>
2829<!ATTLIST rom status (baddump|nodump|good) "good">
29<!ATTLIST rom loadflag (load16_byte|load16_word|load16_word_swap|load32_byte|load32_word|load32_word_swap|load32_dword|load64_word|load64_word_swap|reload) #IMPLIED>
30<!ATTLIST rom loadflag (load16_byte|load16_word|load16_word_swap|load32_byte|load32_word|load32_word_swap|load32_dword|load64_word|load64_word_swap|reload|fill|continue) #IMPLIED>
src/mess/softlist.c
r8094r8095
520520            const char *str_crc = NULL;
521521            const char *str_sha1 = NULL;
522522            const char *str_offset = NULL;
523            const char *str_value = NULL;
523524            const char *str_status = NULL;
524525            const char *str_loadflag = NULL;
525526
r8094r8095
535536                  str_sha1 = attributes[1];
536537               if ( !strcmp( attributes[0], "offset" ) )
537538                  str_offset = attributes[1];
539               if ( !strcmp( attributes[0], "value" ) )
540                  str_value = attributes[1];
538541               if ( !strcmp( attributes[0], "status" ) )
539542                  str_status = attributes[1];
540543               if ( !strcmp( attributes[0], "loadflag" ) )
r8094r8095
547550                  UINT32 length = strtol( str_size, NULL, 10 );
548551                  UINT32 offset = strtol( str_offset, NULL, 16 );
549552
550                  if ( str_loadflag && !strcmp(str_loadflag,"reload") )
553                  if ( str_loadflag && !strcmp(str_loadflag, "reload") )
551554                  {
552555                     /* Handle 'reload' loadflag */
553556                     add_rom_entry( swlist, NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS );
554557                  }
558                  else if ( str_loadflag && !strcmp(str_loadflag, "continue") )
559                  {
560                     /* Handle 'continue' loadflag */
561                     add_rom_entry( swlist, NULL, NULL, offset, length, ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS );
562                  }
563                  else if ( str_loadflag && !strcmp(str_loadflag, "fill") )
564                  {
565                     /* Handle 'fill' loadflag */
566                     add_rom_entry( swlist, NULL, (const char*)atoi(str_value), offset, length, ROMENTRYTYPE_FILL );
567                  }
555568                  else
556569                  {
557570                     if ( str_name && str_crc && str_sha1 )
558571                     {
559572                        char *s_name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_name ) + 1 ) * sizeof(char) );
560573                        char *hashdata = (char *)pool_malloc_lib( swlist->pool, sizeof(char) * ( strlen(str_crc) + strlen(str_sha1) + 7 + 4 ) );
561                        int baddump = ( str_status && !strcmp(str_status,"baddump") ) ? 1 : 0;
562                        int nodump = ( str_status && !strcmp(str_status,"nodump" ) ) ? 1 : 0;
574                        int baddump = ( str_status && !strcmp(str_status, "baddump") ) ? 1 : 0;
575                        int nodump = ( str_status && !strcmp(str_status, "nodump" ) ) ? 1 : 0;
563576                        int romflags = 0;
564577
565578                        if ( !s_name || !hashdata )
r8094r8095
569582                        sprintf( hashdata, "c:%s#s:%s#%s", str_crc, str_sha1, ( nodump ? NO_DUMP : ( baddump ? BAD_DUMP : "" ) ) );
570583
571584                        /* Handle loadflag attribute */
572                        if ( str_loadflag && !strcmp(str_loadflag,"load16_word_swap") )
585                        if ( str_loadflag && !strcmp(str_loadflag, "load16_word_swap") )
573586                           romflags = ROM_GROUPWORD | ROM_REVERSE;
574                        else if ( str_loadflag && !strcmp(str_loadflag,"load16_byte") )
587                        else if ( str_loadflag && !strcmp(str_loadflag, "load16_byte") )
575588                           romflags = ROM_SKIP(1);
589                        else if ( str_loadflag && !strcmp(str_loadflag, "load32_word_swap") )
590                           romflags = ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2);
576591
577592                        /* ROM_LOAD( name, offset, length, hash ) */
578593                        add_rom_entry( swlist, s_name, hashdata, offset, length, ROMENTRYTYPE_ROM | romflags );

Previous 15994 Revisions Next


© 1998-2018 The MESS Team