summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/hphybrid/hphybrid.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:42 +0200
committer Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:57 +0200
commit22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch)
tree3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/hphybrid/hphybrid.cpp
parente42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (diff)
emumem: A little more speedup. cache and specific change syntax, and are not pointers anymore [O. Galibert]
The last(?) two changes are: - Add a template parameter to everything (theoretically the address space width, in practice a level derived from it to keep as much compatibility between widths as possible) so that the shift size becomes a constant. - Change the syntax of declaring and initializing the caches and specifics so that they're embedded in the owner device. Solves lifetime issues and also removes one indirection (looking up the base dispatch pointer through the cache/specific pointer).
Diffstat (limited to 'src/devices/cpu/hphybrid/hphybrid.cpp')
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp
index 0c03210ea04..fae3b8474c7 100644
--- a/src/devices/cpu/hphybrid/hphybrid.cpp
+++ b/src/devices/cpu/hphybrid/hphybrid.cpp
@@ -219,9 +219,9 @@ void hp_hybrid_cpu_device::device_start()
state_add(HPHYBRID_I, "I", m_reg_I).noshow();
}
- m_program = &space(AS_PROGRAM);
- m_cache = m_program->cache<1, -1, ENDIANNESS_BIG>();
- m_io = &space(AS_IO);
+ space(AS_PROGRAM).cache(m_cache);
+ space(AS_PROGRAM).specific(m_program);
+ space(AS_IO).specific(m_io);
save_item(NAME(m_reg_A));
save_item(NAME(m_reg_B));
@@ -1029,7 +1029,7 @@ uint16_t hp_hybrid_cpu_device::RM(uint32_t addr)
m_stm_func(m_curr_cycle | CYCLE_RD_MASK);
m_curr_cycle = 0;
}
- return m_cache->read_word(addr);
+ return m_cache.read_word(addr);
}
}
@@ -1152,7 +1152,7 @@ void hp_hybrid_cpu_device::WM(uint32_t addr , uint16_t v)
m_stm_func(m_curr_cycle | CYCLE_WR_MASK);
m_curr_cycle = 0;
}
- m_program->write_word(addr , v);
+ m_program.write_word(addr , v);
}
}
@@ -1375,13 +1375,13 @@ void hp_hybrid_cpu_device::enter_isr()
uint16_t hp_hybrid_cpu_device::RIO(uint8_t pa , uint8_t ic)
{
m_icount -= IO_RW_CYCLES;
- return m_io->read_word(HP_MAKE_IOADDR(pa, ic));
+ return m_io.read_word(HP_MAKE_IOADDR(pa, ic));
}
void hp_hybrid_cpu_device::WIO(uint8_t pa , uint8_t ic , uint16_t v)
{
m_icount -= IO_RW_CYCLES;
- m_io->write_word(HP_MAKE_IOADDR(pa, ic) , v);
+ m_io.write_word(HP_MAKE_IOADDR(pa, ic) , v);
}
uint8_t hp_hybrid_cpu_device::do_dec_shift_r(uint8_t d1 , uint64_t& mantissa)
@@ -1625,7 +1625,7 @@ bool hp_5061_3011_cpu_device::execute_no_bpc(uint16_t opcode , uint16_t& next_pc
// Extend address, form byte address
uint16_t mask = BIT(tmp_addr , 0) ? 0x00ff : 0xff00;
tmp_addr = add_mae(AEC_CASE_C , tmp_addr >> 1);
- m_program->write_word(tmp_addr , tmp , mask);
+ m_program.write_word(tmp_addr , tmp , mask);
m_icount -= m_w_cycles;
}
} else {
@@ -1992,7 +1992,7 @@ bool hp_09825_67907_cpu_device::execute_no_bpc(uint16_t opcode , uint16_t& next_
m_curr_cycle = 0;
}
uint16_t mask = BIT(*ptr_reg , 15) ? 0xff00 : 0x00ff;
- m_program->write_word(tmp_addr , tmp , mask);
+ m_program.write_word(tmp_addr , tmp , mask);
m_icount -= m_w_cycles;
}
} else {