summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2011-06-26 17:55:49 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2011-06-26 17:55:49 +0000
commitda3d817133efbcde3b2a735d8fad20210d5c3bf6 (patch) (github)
tree114e15cd10456aa31149ee2669dc94ae1b3c0256
parent2efa40c70317247c74237248b95c5190d57573b8 (diff)
downloadmame-da3d817133efbcde3b2a735d8fad20210d5c3bf6.tar.bz2
mame-da3d817133efbcde3b2a735d8fad20210d5c3bf6.zip
Making cart romload tags relative to device (no whatsnew)
-rw-r--r--src/emu/imagedev/cartslot.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/emu/imagedev/cartslot.c b/src/emu/imagedev/cartslot.c
index 32a39628fb1..4f699066724 100644
--- a/src/emu/imagedev/cartslot.c
+++ b/src/emu/imagedev/cartslot.c
@@ -62,7 +62,9 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
int datawidth, littleendian, i, j;
device_t *cpu;
- region = ROMREGION_GETTAG(romrgn);
+ astring regiontag;
+ image->device().siblingtag(regiontag, ROMREGION_GETTAG(romrgn));
+ region = regiontag.cstr();
offset = ROM_GETOFFSET(roment);
length = ROM_GETLENGTH(roment);
flags = ROM_GETFLAGS(roment);
@@ -112,7 +114,7 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
}
/* postprocess this region */
- type = ROMREGION_GETTAG(romrgn);
+ type = regiontag.cstr();
littleendian = ROMREGION_ISLITTLEENDIAN(romrgn);
datawidth = ROMREGION_GETWIDTH(romrgn) / 8;
@@ -171,8 +173,11 @@ static int process_cartridge(device_image_interface *image, process_mode mode)
while(!ROMENTRY_ISREGIONEND(roment))
{
if (ROMENTRY_GETTYPE(roment) == ROMENTRYTYPE_CARTRIDGE)
- {
- if (strcmp(roment->_hashdata,image->device().tag())==0)
+ {
+ astring regiontag;
+ image->device().siblingtag(regiontag, roment->_hashdata);
+
+ if (strcmp(regiontag.cstr(),image->device().tag())==0)
{
result |= load_cartridge(image, romrgn, roment, mode);