Previous 15994 Revisions Next

r6979 Friday 8th January, 2010 at 19:50:57 UTC by Wilbert Pol
Added function needed to perform -romident against software lists.
[src/mess]climess.c climess.h

src/mess/climess.c
r6978r6979
99#include "driver.h"
1010#include "climess.h"
1111#include "output.h"
12#include "hash.h"
1213
1314
1415/*-------------------------------------------------
r6978r6979
175176
176177   return (count > 0) ? MAMERR_NONE : MAMERR_NO_SUCH_GAME;
177178}
179
180
181/*-------------------------------------------------
182    match_roms - scan for a matching software ROM by hash
183-------------------------------------------------*/
184void mess_match_roms(const char *hash, int length, int *found)
185{
186   int listnum;
187
188   for ( listnum = 0; software_lists[listnum] != NULL; listnum++ )
189   {
190      const software_list *swlist = software_lists[listnum];
191      int j;
192
193      for ( j = 0; swlist->entries[j].name != NULL; j++ )
194      {
195         const software_entry *sw = &swlist->entries[j];
196         const rom_entry *region, *rom;
197
198         for (region = &sw->rom_info[0]; region; region = rom_next_region(region))
199         {
200            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
201            {
202               if (hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0))
203               {
204                  int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP);
205
206                  /* output information about the match */
207                  if (*found != 0)
208                     mame_printf_info("                    ");
209                  mame_printf_info("= %s%-20s  %-10s %s [%s]\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), sw->name, sw->fullname, swlist->name);
210                  (*found)++;
211               }
212            }
213         }
214      }
215   }
216}
217
218
src/mess/climess.h
r6978r6979
1818
1919void mess_display_help(void);
2020int info_listdevices(core_options *opts, const char *gamename);
21void mess_match_roms(const char *hash, int length, int *found);
2122
2223
2324#endif   /* __CLIMESS_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team