Previous 15994 Revisions Next

r8346 Tuesday 29th June, 2010 at 13:46:55 UTC by Miodrag Milanović
All tools compiles now.
[src/emu]diimage.c diimage.h
[src/mess/tools]tools.mak
[src/mess/tools/messtest]testmess.c tststubs.c

src/emu/diimage.c
r8345r8346
122122   return (info != NULL) ? info->m_shortname : NULL;
123123}
124124
125//-------------------------------------------------
126//  device_typeid - retrieves device type id
127//-------------------------------------------------
128
129iodevice_t device_config_image_interface::device_typeid(const char *name)
130{
131   int i;
132   for (i = 0; i < ARRAY_LENGTH(device_config_image_interface::m_device_info_array); i++)
133   {
134      if (!mame_stricmp(name, m_device_info_array[i].m_name) || !mame_stricmp(name, m_device_info_array[i].m_shortname))
135         return m_device_info_array[i].m_type;
136   }
137   return (iodevice_t)-1;
138}
139
125140/*-------------------------------------------------
126141    device_compute_hash - compute a hash,
127142    using this device's partial hash if appropriate
src/emu/diimage.h
r8345r8346
174174   
175175   static const char *device_typename(iodevice_t type);
176176   static const char *device_brieftypename(iodevice_t type);   
177   static iodevice_t device_typeid(const char *name);
177178
178179   virtual device_image_partialhash_func get_partial_hash() const = 0;
179180   virtual void device_compute_hash(char *dest, const void *data, size_t length, unsigned int functions) const;   
src/mess/tools/messtest/testmess.c
r8345r8346
356356      /* get the path */
357357      fullpath = assemble_software_path(astring_alloc(), driver, current_command->u.image_args.filename);
358358
359      /* get the option name */
360      device_opt = device_typename(current_command->u.image_args.device_ident.type);
359      /* get the option name */     
360      device_opt = device_config_image_interface::device_typename(current_command->u.image_args.device_ident.type);
361361
362362      /* set the option */
363363      options_set_string(opts, device_opt, astring_c(fullpath), OPTION_PRIORITY_CMDLINE);
r8345r8346
493493
494494   /* find switch with the name */
495495   found = FALSE;
496   for (port = machine->portlist.first(); !found && (port != NULL); port = port->next)
496   for (port = machine->portlist.first(); !found && (port != NULL); port = port->next())
497497   {
498498      for (field = port->fieldlist; !found && (field != NULL); field = field->next)
499499      {
r8345r8346
701701
702702
703703
704static running_device *find_device_by_identity(running_machine *machine, const messtest_device_identity *ident)
704static device_image_interface *find_device_by_identity(running_machine *machine, const messtest_device_identity *ident)
705705{
706   running_device *device = NULL;
706   device_image_interface *device = NULL;
707707
708708   /* look up the image slot */
709709   if (ident->type == IO_UNKNOWN)
710710   {
711711      /* no device_type was specified; use the new preferred mechanism */
712      device = devtag_get_device(machine, ident->tag);
712      device = dynamic_cast<device_image_interface *>(devtag_get_device(machine, ident->tag));
713713   }
714714
715715   /* did the image slot lookup fail? */
r8345r8346
717717   {
718718      state = STATE_ABORTED;
719719      report_message(MSG_FAILURE, "Device '%s %i' does not exist",
720         device_typename(ident->type), ident->slot);
720         device_config_image_interface::device_typename(ident->type), ident->slot);
721721   }
722722
723723   return device;
r8345r8346
727727
728728static void command_image_loadcreate(running_machine *machine)
729729{
730   running_device *image;
730   device_image_interface *image;
731731   const char *filename;
732732   const char *format_name;
733733   char buf[128];
734   image_device_info info;
735734   const char *file_extensions;
736735   astring *filepath;
737736   int success;
r8345r8346
743742   if (image == NULL)
744743      return;
745744
746   info = image_device_getinfo(machine->config, image);
747   file_extensions = info.file_extensions;
745   file_extensions = image->image_config().file_extensions();
748746
749747   /* is an image format specified? */
750748   format_name = current_command->u.image_args.format;
r8345r8346
758756      }
759757
760758      /* look up the format name */
761      format = image_device_get_named_creatable_format(image, format_name);
759      format = image->device_get_named_creatable_format(format_name);
762760      if (format == NULL)
763761      {
764762         state = STATE_ABORTED;
r8345r8346
787785      switch(current_command->command_type)
788786      {
789787         case MESSTEST_COMMAND_IMAGE_CREATE:
790            success = (image_create(image, astring_c(filepath), format, NULL) == IMAGE_INIT_PASS);
788            success = (image->create(astring_c(filepath), format, NULL) == IMAGE_INIT_PASS);
791789            break;
792790
793791         case MESSTEST_COMMAND_IMAGE_LOAD:
794            success = (image_load(image, astring_c(filepath)) == IMAGE_INIT_PASS);
792            success = (image->load(astring_c(filepath)) == IMAGE_INIT_PASS);
795793            break;
796794
797795         default:
r8345r8346
803801   if (!success)
804802   {
805803      state = STATE_ABORTED;
806      report_message(MSG_FAILURE, "Failed to load/create image '%s': %s", filename, image_error(image));
804      report_message(MSG_FAILURE, "Failed to load/create image '%s': %s", filename, image->error());
807805      return;
808806   }
809807}
r8345r8346
879877   size_t verify_data_size;
880878   size_t offset, offset_start, offset_end;
881879   const char *filename;
882   running_device *image;
880   device_image_interface *image;
883881   FILE *f;
884882   UINT8 c;
885883   char filename_buf[512];
r8345r8346
892890   if (image == NULL)
893891      return;
894892
895   filename = image_filename(image);
893   filename = image->filename();
896894   if (filename == NULL)
897895   {
898896      state = STATE_ABORTED;
r8345r8346
903901   /* very dirty hack - we unload the image because we cannot access it
904902     * because the file is locked */
905903   strcpy(filename_buf, filename);
906   image_unload(image);
904   image->unload();
907905   filename = filename_buf;
908906
909907   f = fopen(filename, "r");
r8345r8346
12481246   {
12491247      s2 = attr_node->value;
12501248
1251      ident->type = device_typeid(s2);
1249      ident->type = device_config_image_interface::device_typeid(s2);
12521250      if (ident->type <= IO_UNKNOWN)
12531251      {
12541252         error_baddevicetype(s2);
src/mess/tools/messtest/tststubs.c
r8345r8346
11#ifdef WIN32
2#define WIN32_LEAN_AND_MEAN
23#include <windows.h>
34#endif
45
src/mess/tools/tools.mak
r8345r8346
2424TOOLS += $(CASTOOL)
2525endif
2626
27#ifdef BUILD_MESSTEST
28#include $(MESSSRC)/tools/messtest/messtest.mak
29#TOOLS += $(MESSTEST)
30#endif
27ifdef BUILD_MESSTEST
28include $(MESSSRC)/tools/messtest/messtest.mak
29TOOLS += $(MESSTEST)
30endif
3131
3232ifdef BUILD_DAT2HTML
3333include $(MESSSRC)/tools/dat2html/dat2html.mak

Previous 15994 Revisions Next


© 1998-2018 The MESS Team