Previous 15994 Revisions Next

r9713 Friday 3rd December, 2010 at 14:24:11 UTC by Curt Coder
Enabled loading ROMs from software lists to ROM_CART_LOAD entries.
[src/mess/devices]cartslot.c

src/mess/devices/cartslot.c
r9712r9713
7676
7777   if (mode == PROCESS_LOAD)
7878   {
79      /* must this be full size */
80      if (flags & ROM_FULLSIZE)
79      if (image->software_entry() == NULL)
8180      {
82         if (image->length() != length)
83            return IMAGE_INIT_FAIL;
81         /* must this be full size */
82         if (flags & ROM_FULLSIZE)
83         {
84            if (image->length() != length)
85               return IMAGE_INIT_FAIL;
86         }
87
88         /* read the ROM */
89         pos = read_length = image->fread(ptr, length);
90
91         /* reset the ROM to the initial point. */
92         /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */
93         image->fseek(0, SEEK_SET);
8494      }
95      else
96      {
97         /* must this be full size */
98         if (flags & ROM_FULLSIZE)
99         {
100            if (image->get_software_region_length("rom") != length)
101               return IMAGE_INIT_FAIL;
102         }
85103
86      /* read the ROM */
87      pos = read_length = image->fread(ptr, length);
104         /* read the ROM */
105         pos = read_length = image->get_software_region_length("rom");
106         memcpy(ptr, image->get_software_region("rom"), read_length);
107      }
88108
89      /* reset the ROM to the initial point. */
90      /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */
91      image->fseek(0, SEEK_SET);
92
93109      /* do we need to mirror the ROM? */
94110      if (flags & ROM_MIRROR)
95111      {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team