Previous 15994 Revisions Next

r6365 Thursday 12th November, 2009 at 12:54:16 UTC by Fabio Priuli
Modified cartslot device to allow for more than one ROM_CART_LOAD region
[src/mess/devices]cartslot.c

src/mess/devices/cartslot.c
r6364r6365
8080      /* read the ROM */
8181      pos = read_length = image_fread(device, ptr, length);
8282
83      /* reset the ROM to the initial point. */
84      /* eventually, we could add a flag to allow the ROM to continue instead of restarting whenever a new cart region is present */
85      image_fseek(device, 0, SEEK_SET);
86
8387      /* do we need to mirror the ROM? */
8488      if (flags & ROM_MIRROR)
8589      {
r6364r6365
140144{
141145   const rom_source *source;
142146   const rom_entry *romrgn, *roment;
143   int result;
147   int result = 0;
144148
145149   for (source = rom_first_source(image->machine->gamedrv, image->machine->config); source != NULL; source = rom_next_source(image->machine->gamedrv, image->machine->config, source))
146150   {
r6364r6365
153157            {
154158               if (strcmp(roment->_hashdata,image->tag)==0)
155159               {
156                  result = load_cartridge(image, romrgn, roment, mode);
157                  if (!result)
160                  result |= load_cartridge(image, romrgn, roment, mode);
161
162                  /* if loading failed in any cart region, stop loading */
163                  if (result)
158164                     return result;
159165               }
160166            }
r6364r6365
162168         }
163169      }
164170   }
171
165172   return INIT_PASS;
166173}
167174

Previous 15994 Revisions Next


© 1998-2018 The MESS Team