diff options
author | 2017-07-01 12:11:28 +0200 | |
---|---|---|
committer | 2017-07-03 08:03:57 +0200 | |
commit | cbbbd07484c736eae2069b294ec666f231e64bff (patch) | |
tree | b94a690f0ab10635eb6d11837425744208c7e8a4 /src/devices/cpu/nec | |
parent | cb1930f6e6a6b460577f01207888eab402469e9f (diff) |
dimemory: Lift the cap on the number of address spaces per device [O. Galibert]
Diffstat (limited to 'src/devices/cpu/nec')
-rw-r--r-- | src/devices/cpu/nec/nec.cpp | 8 | ||||
-rw-r--r-- | src/devices/cpu/nec/nec.h | 2 | ||||
-rw-r--r-- | src/devices/cpu/nec/v25.cpp | 7 | ||||
-rw-r--r-- | src/devices/cpu/nec/v25.h | 2 | ||||
-rw-r--r-- | src/devices/cpu/nec/v53.cpp | 7 | ||||
-rw-r--r-- | src/devices/cpu/nec/v53.h | 10 |
6 files changed, 25 insertions, 11 deletions
diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp index 3b61283ce41..18dded0cdb4 100644 --- a/src/devices/cpu/nec/nec.cpp +++ b/src/devices/cpu/nec/nec.cpp @@ -145,6 +145,14 @@ v30_device::v30_device(const machine_config &mconfig, const char *tag, device_t { } +std::vector<std::pair<int, const address_space_config *>> nec_common_device::memory_space_config() const +{ + return std::vector<std::pair<int, const address_space_config *>> { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_IO, &m_io_config) + }; +} + /* FIXME: Need information about prefetch size and cycles for V33. * complete guess below, nbbatman will not work diff --git a/src/devices/cpu/nec/nec.h b/src/devices/cpu/nec/nec.h index f4f95ad6788..90e96b84f4d 100644 --- a/src/devices/cpu/nec/nec.h +++ b/src/devices/cpu/nec/nec.h @@ -40,7 +40,7 @@ protected: virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr); } + virtual std::vector<std::pair<int, const address_space_config *>> memory_space_config() const override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index 66d4e6885e8..9c3a8ad007a 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -82,6 +82,13 @@ v35_device::v35_device(const machine_config &mconfig, const char *tag, device_t { } +std::vector<std::pair<int, const address_space_config *>> v25_common_device::memory_space_config() const +{ + return std::vector<std::pair<int, const address_space_config *>> { + std::make_pair(AS_PROGRAM, &m_program_config), + std::make_pair(AS_IO, &m_io_config) + }; +} TIMER_CALLBACK_MEMBER(v25_common_device::v25_timer_callback) { diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h index 00bf192f22f..9ebbffe57e4 100644 --- a/src/devices/cpu/nec/v25.h +++ b/src/devices/cpu/nec/v25.h @@ -84,7 +84,7 @@ protected: virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr); } + virtual std::vector<std::pair<int, const address_space_config *>> memory_space_config() const override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; diff --git a/src/devices/cpu/nec/v53.cpp b/src/devices/cpu/nec/v53.cpp index 4d6aa65b08c..cb4ff9cd84b 100644 --- a/src/devices/cpu/nec/v53.cpp +++ b/src/devices/cpu/nec/v53.cpp @@ -172,6 +172,13 @@ m_DST = 0x00; m_DMK = 0x0f; */ +std::vector<std::pair<int, const address_space_config *>> v53_base_device::memory_space_config() const +{ + auto r = nec_common_device::memory_space_config(); + r.emplace_back(std::make_pair(AS_IO, &m_io_space_config)); + return r; +} + void v53_base_device::device_reset() { nec_common_device::device_reset(); diff --git a/src/devices/cpu/nec/v53.h b/src/devices/cpu/nec/v53.h index 86dfab2b829..49fa66e5134 100644 --- a/src/devices/cpu/nec/v53.h +++ b/src/devices/cpu/nec/v53.h @@ -205,15 +205,7 @@ protected: const address_space_config m_io_space_config; - const address_space_config *memory_space_config(address_spacenum spacenum) const override - { - switch (spacenum) - { - case AS_IO: return &m_io_space_config; - default: return nec_common_device::memory_space_config(spacenum); - } - } - + virtual std::vector<std::pair<int, const address_space_config *>> memory_space_config() const override; uint8_t m_SCTL; uint8_t m_OPSEL; |