summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/hphybrid/hphybrid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/hphybrid/hphybrid.cpp')
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.cpp59
1 files changed, 28 insertions, 31 deletions
diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp
index d68cc8f9ea4..4b913f0d69d 100644
--- a/src/devices/cpu/hphybrid/hphybrid.cpp
+++ b/src/devices/cpu/hphybrid/hphybrid.cpp
@@ -34,7 +34,6 @@
#include "emu.h"
#include "hphybrid.h"
#include "hphybrid_dasm.h"
-#include "debugger.h"
#include "hphybrid_defs.h"
@@ -135,7 +134,7 @@ DEFINE_DEVICE_TYPE(HP_5061_3001, hp_5061_3001_cpu_device, "5061_3001", "Hewlett-
DEFINE_DEVICE_TYPE(HP_5061_3011, hp_5061_3011_cpu_device, "5061_3011", "Hewlett-Packard HP-5061-3011")
DEFINE_DEVICE_TYPE(HP_09825_67907, hp_09825_67907_cpu_device, "09825_67907", "Hewlett-Packard HP-09825-67907")
-WRITE_LINE_MEMBER(hp_hybrid_cpu_device::dmar_w)
+void hp_hybrid_cpu_device::dmar_w(int state)
{
if (state)
BIT_SET(m_flags, HPHYBRID_DMAR_BIT);
@@ -143,7 +142,7 @@ WRITE_LINE_MEMBER(hp_hybrid_cpu_device::dmar_w)
BIT_CLR(m_flags, HPHYBRID_DMAR_BIT);
}
-WRITE_LINE_MEMBER(hp_hybrid_cpu_device::halt_w)
+void hp_hybrid_cpu_device::halt_w(int state)
{
if (state)
BIT_SET(m_flags, HPHYBRID_HALT_BIT);
@@ -151,7 +150,7 @@ WRITE_LINE_MEMBER(hp_hybrid_cpu_device::halt_w)
BIT_CLR(m_flags, HPHYBRID_HALT_BIT);
}
-WRITE_LINE_MEMBER(hp_hybrid_cpu_device::status_w)
+void hp_hybrid_cpu_device::status_w(int state)
{
if (state)
BIT_SET(m_flags, HPHYBRID_STS_BIT);
@@ -159,7 +158,7 @@ WRITE_LINE_MEMBER(hp_hybrid_cpu_device::status_w)
BIT_CLR(m_flags, HPHYBRID_STS_BIT);
}
-WRITE_LINE_MEMBER(hp_hybrid_cpu_device::flag_w)
+void hp_hybrid_cpu_device::flag_w(int state)
{
if (state)
BIT_SET(m_flags, HPHYBRID_FLG_BIT);
@@ -167,16 +166,12 @@ WRITE_LINE_MEMBER(hp_hybrid_cpu_device::flag_w)
BIT_CLR(m_flags, HPHYBRID_FLG_BIT);
}
-uint8_t hp_hybrid_cpu_device::pa_r() const
-{
- return CURRENT_PA;
-}
-
hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t addrwidth)
: cpu_device(mconfig, type, tag, owner, clock)
, m_pa_changed_func(*this)
, m_opcode_func(*this)
, m_stm_func(*this)
+ , m_int_func(*this)
, m_addr_mask((1U << addrwidth) - 1)
, m_relative_mode(true)
, m_r_cycles(DEF_MEM_R_CYCLES)
@@ -207,7 +202,6 @@ void hp_hybrid_cpu_device::device_start()
state_add(STATE_GENPC, "GENPC", m_genpc).noshow();
state_add(STATE_GENPCBASE, "CURPC", m_genpc).noshow();
state_add(HPHYBRID_R, "R", m_reg_R);
- state_add(STATE_GENSP, "GENSP", m_reg_R).noshow();
state_add(HPHYBRID_IV, "IV", m_reg_IV);
state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]);
state_add(HPHYBRID_W, "W", m_reg_W).noshow();
@@ -218,9 +212,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));
@@ -242,9 +236,9 @@ void hp_hybrid_cpu_device::device_start()
set_icountptr(m_icount);
- m_pa_changed_func.resolve_safe();
- m_opcode_func.resolve_safe();
+ m_opcode_func.resolve();
m_stm_func.resolve();
+ m_int_func.resolve();
}
void hp_hybrid_cpu_device::device_reset()
@@ -954,7 +948,7 @@ uint16_t hp_hybrid_cpu_device::RM(uint32_t addr)
// Any access to internal registers removes forcing of BSC 2x
m_forced_bsc_25 = false;
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
m_stm_func(m_curr_cycle | CYCLE_RAL_MASK | CYCLE_RD_MASK);
m_curr_cycle = 0;
}
@@ -1023,11 +1017,11 @@ uint16_t hp_hybrid_cpu_device::RM(uint32_t addr)
return tmp;
} else {
m_icount -= m_r_cycles;
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
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);
}
}
@@ -1076,7 +1070,7 @@ void hp_hybrid_cpu_device::WM(uint32_t addr , uint16_t v)
// Any access to internal registers removes forcing of BSC 2x
m_forced_bsc_25 = false;
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
m_stm_func(m_curr_cycle | CYCLE_RAL_MASK | CYCLE_WR_MASK);
m_curr_cycle = 0;
}
@@ -1146,11 +1140,11 @@ void hp_hybrid_cpu_device::WM(uint32_t addr , uint16_t v)
m_icount -= REGISTER_RW_CYCLES;
} else {
m_icount -= m_w_cycles;
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
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);
}
}
@@ -1195,7 +1189,8 @@ uint16_t hp_hybrid_cpu_device::fetch_at(uint32_t addr)
{
m_curr_cycle |= CYCLE_IFETCH_MASK;
uint16_t opcode = RM(addr);
- m_opcode_func(opcode);
+ if (!m_opcode_func.isnull())
+ m_opcode_func(opcode);
return opcode;
}
@@ -1322,8 +1317,10 @@ void hp_hybrid_cpu_device::check_for_interrupts()
return;
}
- // Get interrupt vector in low byte
- uint8_t vector = uint8_t(standard_irq_callback(irqline));
+ standard_irq_callback(irqline , add_mae(AEC_CASE_A , m_reg_P));
+
+ // Get interrupt vector in low byte (level is available on PA3)
+ uint8_t vector = !m_int_func.isnull() ? m_int_func(BIT(m_flags , HPHYBRID_IRH_BIT) ? 1 : 0) : 0xff;
uint8_t new_PA;
// Get highest numbered 1
@@ -1371,13 +1368,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)
@@ -1614,14 +1611,14 @@ bool hp_5061_3011_cpu_device::execute_no_bpc(uint16_t opcode , uint16_t& next_pc
// 16 bits units.
WM(tmp_addr >> 1 , tmp);
} else {
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
m_stm_func(m_curr_cycle | CYCLE_WR_MASK);
m_curr_cycle = 0;
}
// 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 {
@@ -1983,12 +1980,12 @@ bool hp_09825_67907_cpu_device::execute_no_bpc(uint16_t opcode , uint16_t& next_
// 16 bits units.
WM(tmp_addr , tmp);
} else {
- if (m_stm_func) {
+ if (!m_stm_func.isnull()) {
m_stm_func(m_curr_cycle | CYCLE_WR_MASK);
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 {