summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/cop400
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/cop400')
-rw-r--r--src/devices/cpu/cop400/cop400.cpp15
-rw-r--r--src/devices/cpu/cop400/cop400.h7
2 files changed, 10 insertions, 12 deletions
diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp
index 5c8d2c61be6..22495ff2c92 100644
--- a/src/devices/cpu/cop400/cop400.cpp
+++ b/src/devices/cpu/cop400/cop400.cpp
@@ -96,9 +96,9 @@ DEFINE_DEVICE_TYPE(COP446C, cop446c_cpu_device, "cop446c", "National Semiconduct
MACROS
***************************************************************************/
-#define ROM(a) m_cache->read_byte(a)
-#define RAM_R(a) m_data->read_byte(a)
-#define RAM_W(a, v) m_data->write_byte(a, v)
+#define ROM(a) m_program.read_byte(a)
+#define RAM_R(a) m_data.read_byte(a)
+#define RAM_W(a, v) m_data.write_byte(a, v)
#define IN_G() (m_read_g(0, 0xff) & m_g_mask)
#define IN_L() m_read_l(0, 0xff)
@@ -1073,9 +1073,8 @@ void cop400_cpu_device::device_timer(emu_timer &timer, device_timer_id id, int p
void cop400_cpu_device::device_start()
{
/* find address spaces */
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<0, 0, ENDIANNESS_LITTLE>();
- m_data = &space(AS_DATA);
+ space(AS_PROGRAM).cache(m_program);
+ space(AS_DATA).specific(m_data);
/* find i/o handlers */
m_read_l.resolve_safe(0);
@@ -1125,7 +1124,7 @@ void cop400_cpu_device::device_start()
save_item(NAME(m_second_byte));
// setup debugger state display
- offs_t pc_mask = m_program->addrmask();
+ offs_t pc_mask = m_program.space().addrmask();
using namespace std::placeholders;
state_add(STATE_GENPC, "GENPC", m_pc).mask(pc_mask).noshow();
@@ -1330,7 +1329,7 @@ void cop400_cpu_device::set_flags(uint8_t flags)
m_skl = BIT(flags, 0);
}
-uint8_t cop400_cpu_device::get_m() const
+uint8_t cop400_cpu_device::get_m()
{
auto dis = machine().disable_side_effects();
return RAM_R(B);
diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h
index 1427463a9cf..b51732fecf8 100644
--- a/src/devices/cpu/cop400/cop400.h
+++ b/src/devices/cpu/cop400/cop400.h
@@ -184,9 +184,8 @@ protected:
bool m_has_counter;
bool m_has_inil;
- address_space *m_program;
- memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache;
- address_space *m_data;
+ memory_access<11, 0, 0, ENDIANNESS_LITTLE>::cache m_program;
+ memory_access< 7, 0, 0, ENDIANNESS_LITTLE>::specific m_data;
uint8_t m_featuremask;
@@ -265,7 +264,7 @@ protected:
uint8_t get_flags() const;
void set_flags(uint8_t flags);
- uint8_t get_m() const;
+ uint8_t get_m();
void set_m(uint8_t m);
void illegal(uint8_t operand);