summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6502
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-09-18 01:07:22 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-09-18 01:07:22 +0000
commitace8c59d1afb538933892681e0a2408c8466cf3f (patch)
treeee702115a0c5c240d445dc12586f80833fdbeaf6 /src/emu/cpu/m6502
parent5dbedfbf1867e962a1e25fd551860d59bbc47663 (diff)
Memory system and Namco improvements: [Alex Jackson]
Explicit regions in address maps (AM_REGION) are now looked up relative to the device rather than as siblings when in an internal address map (similar to devices and shared pointers) Besides being more orthogonal than before, this allows internal ROMs of MCUs and similar devices to be hooked up in a nicer and more foolproof way. Updated the m37710 and m5074x (m6502 derivative) to take advantage of this. Divided the M37702/M37710 into specific models, with each model having its own internal address map containing the correct amounts of internal RAM and ROM. M37702 MCUs found on various Namco PCBs are now all unique devices and have their respective internal ROMs loaded as device ROMs. (nw) Also did some spring (fall) cleaning in addrmap.c/memory.c/dimemory.c m_devbase (the base device used for tagmap lookup when late-binding handlers and finding memory regions and shares) is now a reference rather than a pointer, since we know what it is when the address_map_entry is constructed and it doesn't change (it depends solely on whether it's an entry in an MCFG-provided address map or an internal one) And for the same reason, there's now only one m_devbase per address_map_entry rather than individual copies for read/write/setoffset/sharedptr. Removed mysterious unused address_map_entry member "m_region_string", along with a silly assert probably left over from when Aaron was replacing AM_BASE with AM_SHARE years ago. Added a comment noting that "make sure all devices exist" in device_memory_interface::interface_validity_check() actually does nothing, like the proverbial goggles. The reason there's just a comment and not a fix is I haven't figured out how to fix it yet (is it possible to extract the original device tag that was given to a proto-delegate? Sorry, the template hell in devdelegate.h and lib/util/delegate.h makes me want to run screaming like a little girl)
Diffstat (limited to 'src/emu/cpu/m6502')
-rw-r--r--src/emu/cpu/m6502/m5074x.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emu/cpu/m6502/m5074x.c b/src/emu/cpu/m6502/m5074x.c
index fb82c61a5b0..ed9d02a2174 100644
--- a/src/emu/cpu/m6502/m5074x.c
+++ b/src/emu/cpu/m6502/m5074x.c
@@ -39,7 +39,7 @@ const device_type M50741 = &device_creator<m50741_device>;
//-------------------------------------------------
m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source) :
m740_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map),
+ m_program_config("program", ENDIANNESS_LITTLE, 8, 13, 0, internal_map),
read_p0(*this),
read_p1(*this),
read_p2(*this),
@@ -470,11 +470,10 @@ WRITE8_MEMBER(m5074x_device::tmrirq_w)
/* M50740 - baseline for this familiy */
static ADDRESS_MAP_START( m50740_map, AS_PROGRAM, 8, m50740_device )
- ADDRESS_MAP_GLOBAL_MASK(0x1fff)
AM_RANGE(0x0000, 0x005f) AM_RAM
AM_RANGE(0x00e0, 0x00e9) AM_READWRITE(ports_r, ports_w)
AM_RANGE(0x00f9, 0x00ff) AM_READWRITE(tmrirq_r, tmrirq_w)
- AM_RANGE(0x1400, 0x1fff) AM_ROM AM_REGION(":m50740", 0)
+ AM_RANGE(0x1400, 0x1fff) AM_ROM AM_REGION("internal", 0)
ADDRESS_MAP_END
m50740_device::m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
@@ -489,11 +488,10 @@ m50740_device::m50740_device(const machine_config &mconfig, device_type type, co
/* M50741 - 50740 with a larger internal ROM */
static ADDRESS_MAP_START( m50741_map, AS_PROGRAM, 8, m50741_device )
- ADDRESS_MAP_GLOBAL_MASK(0x1fff)
AM_RANGE(0x0000, 0x005f) AM_RAM
AM_RANGE(0x00e0, 0x00e9) AM_READWRITE(ports_r, ports_w)
AM_RANGE(0x00f9, 0x00ff) AM_READWRITE(tmrirq_r, tmrirq_w)
- AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION(":m50741", 0)
+ AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("internal", 0)
ADDRESS_MAP_END
m50741_device::m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :