diff options
author | 2008-07-28 09:35:36 +0000 | |
---|---|---|
committer | 2008-07-28 09:35:36 +0000 | |
commit | 27fed1ec97c24877a1b44e114d7b9776cb776e8c (patch) | |
tree | 93eb6d00131b30c475d9d60b51f1f97c09e3b98d /src/emu/info.c | |
parent | 1b8118822915833267718cf56b24e5218b676ca4 (diff) |
Changed the way memory regions are referenced. Instead of a single
integer value, regions are now referred to by a region class and
a region tag. The class specifies the type of region (one of CPU,
gfx, sound, user, disk, prom, pld) while the tag uniquely specifies
the region. This change required updating all the ROM region
definitions in the project to specify the class/tag instead of
region number.
Updated the core memory_region_* functions to accept a class/tag
pair. Added new memory_region_next() function to allow for iteration
over all memory regions of a given class. Added new function
memory_region_class_name() to return the name for a given CPU
memory region class.
Changed the auto-binding behavior of CPU regions. Previously, the
first CPU would auto-bind to REGION_CPU1 (that is, any ROM references
would automatically assume that they lived in the corresponding
region). Now, each CPU automatically binds to the RGNCLASS_CPU region
with the same tag as the CPU itself. This behavior required ensuring
that all previous REGION_CPU* regions were changed to RGNCLASS_CPU
with the same tag as the CPU.
Introduced a new auto-binding mechanism for sound cores. This works
similarly to the CPU binding. Each sound core that requires a memory
region now auto-binds to the RGNCLASS_SOUND with the same tag as the
sound core. In almost all cases, this allowed for the removal of the
explicit region item in the sound configuration, which in turn
allowed for many sound configurations to removed altogether.
Updated the expression engine's memory reference behavior. A recent
update expanded the scope of memory references to allow for referencing
data in non-active CPU spaces, in memory regions, and in EEPROMs.
However, this previous update required an index, which is no longer
appropriate for regions and will become increasingly less appropriate
for CPUs over time. Instead, a new syntax is supported, of the form:
"[tag.][space]size@addr", where 'tag' is an optional tag for the CPU
or memory region you wish to access, followed by a period as a
separator; 'space' is the memory address space or region class you
wish to access (p/d/i for program/data/I/O spaces; o for opcode space;
r for direct RAM; c/u/g/s for CPU/user/gfx/sound regions; e for
EEPROMs); and 'size' is the usual b/w/d/q for byte/word/dword/qword.
Cleaned up ROM definition flags and removed some ugly hacks that had
existed previously. Expanded to support up to 256 BIOSes. Updated
ROM_COPY to support specifying class/tag for the source region.
Updated the address map AM_REGION macro to support specifying a
class/tag for the region.
Updated debugger windows to display the CPU and region tags where
appropriate.
Updated -listxml to output region class and tag for each ROM entry.
Diffstat (limited to 'src/emu/info.c')
-rw-r--r-- | src/emu/info.c | 64 |
1 files changed, 8 insertions, 56 deletions
diff --git a/src/emu/info.c b/src/emu/info.c index 3c7dcf1c949..b8240fd786d 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -338,8 +338,8 @@ static void print_game_bios(FILE *out, const game_driver *game) for (rom = game->rom; !ROMENTRY_ISEND(rom); rom++) if (ROMENTRY_ISSYSTEM_BIOS(rom)) { - const char *name = ROM_GETHASHDATA(rom); - const char *description = name + strlen(name) + 1; + const char *name = ROM_GETNAME(rom); + const char *description = ROM_GETHASHDATA(rom); /* output extracted name and descriptions */ fprintf(out, "\t\t<biosset"); @@ -426,7 +426,7 @@ static void print_game_rom(FILE *out, const game_driver *game) for (brom = rom - 1; brom != game->rom; brom--) if (ROMENTRY_ISSYSTEM_BIOS(brom)) { - strcpy(bios_name, ROM_GETHASHDATA(brom)); + strcpy(bios_name, ROM_GETNAME(brom)); break; } } @@ -460,57 +460,7 @@ static void print_game_rom(FILE *out, const game_driver *game) } /* append a region name */ - switch (ROMREGION_GETTYPE(region)) - { - case REGION_CPU1: fprintf(out, " region=\"cpu1\""); break; - case REGION_CPU2: fprintf(out, " region=\"cpu2\""); break; - case REGION_CPU3: fprintf(out, " region=\"cpu3\""); break; - case REGION_CPU4: fprintf(out, " region=\"cpu4\""); break; - case REGION_CPU5: fprintf(out, " region=\"cpu5\""); break; - case REGION_CPU6: fprintf(out, " region=\"cpu6\""); break; - case REGION_CPU7: fprintf(out, " region=\"cpu7\""); break; - case REGION_CPU8: fprintf(out, " region=\"cpu8\""); break; - case REGION_GFX1: fprintf(out, " region=\"gfx1\""); break; - case REGION_GFX2: fprintf(out, " region=\"gfx2\""); break; - case REGION_GFX3: fprintf(out, " region=\"gfx3\""); break; - case REGION_GFX4: fprintf(out, " region=\"gfx4\""); break; - case REGION_GFX5: fprintf(out, " region=\"gfx5\""); break; - case REGION_GFX6: fprintf(out, " region=\"gfx6\""); break; - case REGION_GFX7: fprintf(out, " region=\"gfx7\""); break; - case REGION_GFX8: fprintf(out, " region=\"gfx8\""); break; - case REGION_PROMS: fprintf(out, " region=\"proms\""); break; - case REGION_PLDS: fprintf(out, " region=\"plds\""); break; - case REGION_SOUND1: fprintf(out, " region=\"sound1\""); break; - case REGION_SOUND2: fprintf(out, " region=\"sound2\""); break; - case REGION_SOUND3: fprintf(out, " region=\"sound3\""); break; - case REGION_SOUND4: fprintf(out, " region=\"sound4\""); break; - case REGION_SOUND5: fprintf(out, " region=\"sound5\""); break; - case REGION_SOUND6: fprintf(out, " region=\"sound6\""); break; - case REGION_SOUND7: fprintf(out, " region=\"sound7\""); break; - case REGION_SOUND8: fprintf(out, " region=\"sound8\""); break; - case REGION_USER1: fprintf(out, " region=\"user1\""); break; - case REGION_USER2: fprintf(out, " region=\"user2\""); break; - case REGION_USER3: fprintf(out, " region=\"user3\""); break; - case REGION_USER4: fprintf(out, " region=\"user4\""); break; - case REGION_USER5: fprintf(out, " region=\"user5\""); break; - case REGION_USER6: fprintf(out, " region=\"user6\""); break; - case REGION_USER7: fprintf(out, " region=\"user7\""); break; - case REGION_USER8: fprintf(out, " region=\"user8\""); break; - case REGION_USER9: fprintf(out, " region=\"user9\""); break; - case REGION_USER10: fprintf(out, " region=\"user10\""); break; - case REGION_USER11: fprintf(out, " region=\"user11\""); break; - case REGION_USER12: fprintf(out, " region=\"user12\""); break; - case REGION_USER13: fprintf(out, " region=\"user13\""); break; - case REGION_USER14: fprintf(out, " region=\"user14\""); break; - case REGION_USER15: fprintf(out, " region=\"user15\""); break; - case REGION_USER16: fprintf(out, " region=\"user16\""); break; - case REGION_USER17: fprintf(out, " region=\"user17\""); break; - case REGION_USER18: fprintf(out, " region=\"user18\""); break; - case REGION_USER19: fprintf(out, " region=\"user19\""); break; - case REGION_USER20: fprintf(out, " region=\"user20\""); break; - case REGION_DISKS: fprintf(out, " region=\"disks\""); break; - default: fprintf(out, " region=\"0x%x\"", (int)ROMREGION_GETTYPE(region)); break; - } + fprintf(out, " regionclass=\"%s\" regiontag=\"%s\"", memory_region_class_name(ROMREGION_GETCLASS(region), TRUE), ROMREGION_GETTAG(region)); /* add nodump/baddump flags */ if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP)) @@ -956,7 +906,8 @@ void print_mame_xml(FILE *out, const game_driver *const games[], const char *gam "\t\t\t<!ATTLIST rom md5 CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST rom sha1 CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST rom merge CDATA #IMPLIED>\n" - "\t\t\t<!ATTLIST rom region CDATA #IMPLIED>\n" + "\t\t\t<!ATTLIST rom regionclass CDATA #IMPLIED>\n" + "\t\t\t<!ATTLIST rom regiontag CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST rom offset CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST rom status (baddump|nodump|good) \"good\">\n" "\t\t\t<!ATTLIST rom dispose (yes|no) \"no\">\n" @@ -965,7 +916,8 @@ void print_mame_xml(FILE *out, const game_driver *const games[], const char *gam "\t\t\t<!ATTLIST disk md5 CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST disk sha1 CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST disk merge CDATA #IMPLIED>\n" - "\t\t\t<!ATTLIST disk region CDATA #IMPLIED>\n" + "\t\t\t<!ATTLIST disk regionclass CDATA #IMPLIED>\n" + "\t\t\t<!ATTLIST disk regiontag CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST disk index CDATA #IMPLIED>\n" "\t\t\t<!ATTLIST disk status (baddump|nodump|good) \"good\">\n" "\t\t<!ELEMENT sample EMPTY>\n" |