summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emumem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/emumem.h')
-rw-r--r--src/emu/emumem.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/emu/emumem.h b/src/emu/emumem.h
index 9e5bd5fd3f6..24301da70fc 100644
--- a/src/emu/emumem.h
+++ b/src/emu/emumem.h
@@ -62,11 +62,8 @@ class address_table_write;
// offsets and addresses are 32-bit (for now...)
typedef u32 offs_t;
-// address map constructors are functions that build up an address_map
-typedef void (*address_map_constructor)(address_map &map);
-
-// submap retriever delegate
-typedef named_delegate<void (address_map &)> address_map_delegate;
+// address map constructors are delegates that build up an address_map
+using address_map_constructor = named_delegate<void (address_map &)>;
// struct with function pointers for accessors; use is generally discouraged unless necessary
struct data_accessors
@@ -188,10 +185,8 @@ class address_space_config
public:
// construction/destruction
address_space_config();
- address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift = 0, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr);
- address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, u8 logwidth, u8 pageshift, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr);
- address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate());
- address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, u8 logwidth, u8 pageshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate());
+ address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift = 0, address_map_constructor internal = address_map_constructor(), address_map_constructor defmap = address_map_constructor());
+ address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, u8 logwidth, u8 pageshift, address_map_constructor internal = address_map_constructor(), address_map_constructor defmap = address_map_constructor());
// getters
const char *name() const { return m_name; }
@@ -223,8 +218,6 @@ public:
address_map_constructor m_internal_map;
address_map_constructor m_default_map;
- address_map_delegate m_internal_map_delegate;
- address_map_delegate m_default_map_delegate;
};
@@ -369,12 +362,12 @@ public:
void install_ram(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr = nullptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::READWRITE, baseptr); }
// install device memory maps
- template <typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(address_map &map), int bits = 0, u64 unitmask = 0) {
- address_map_delegate delegate(map, "dynamic_device_install", &device);
- install_device_delegate(addrstart, addrend, device, delegate, bits, unitmask);
+ template <typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(address_map &map), u64 unitmask = 0) {
+ address_map_constructor delegate(map, "dynamic_device_install", &device);
+ install_device_delegate(addrstart, addrend, device, delegate, unitmask);
}
- void install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_delegate &map, int bits = 0, u64 unitmask = 0);
+ void install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_constructor &map, u64 unitmask = 0);
// install setoffset handler
void install_setoffset_handler(offs_t addrstart, offs_t addrend, setoffset_delegate sohandler, u64 unitmask = 0) { install_setoffset_handler(addrstart, addrend, 0, 0, 0, sohandler, unitmask); }
@@ -436,7 +429,7 @@ private:
memory_bank &bank_find_or_allocate(const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite);
memory_bank *bank_find_anonymous(offs_t bytestart, offs_t byteend) const;
address_map_entry *block_assign_intersecting(offs_t bytestart, offs_t byteend, u8 *base);
- void check_optimize_all(const char *function, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror);
+ void check_optimize_all(const char *function, int width, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror, u64 &nunitmask);
void check_optimize_mirror(const char *function, offs_t addrstart, offs_t addrend, offs_t addrmirror, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror);
void check_address(const char *function, offs_t addrstart, offs_t addrend);