summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/h8/h83006.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/h8/h83006.cpp')
-rw-r--r--src/devices/cpu/h8/h83006.cpp44
1 files changed, 30 insertions, 14 deletions
diff --git a/src/devices/cpu/h8/h83006.cpp b/src/devices/cpu/h8/h83006.cpp
index 8c38995a44f..e6be9b30bd4 100644
--- a/src/devices/cpu/h8/h83006.cpp
+++ b/src/devices/cpu/h8/h83006.cpp
@@ -7,7 +7,7 @@ DEFINE_DEVICE_TYPE(H83006, h83006_device, "h83006", "Hitachi H8/3006")
DEFINE_DEVICE_TYPE(H83007, h83007_device, "h83007", "Hitachi H8/3007")
-h83006_device::h83006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t start) :
+h83006_device::h83006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 start) :
h8h_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(h83006_device::map), this)),
m_intc(*this, "intc"),
m_adc(*this, "adc"),
@@ -32,13 +32,13 @@ h83006_device::h83006_device(const machine_config &mconfig, device_type type, co
{
}
-h83006_device::h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+h83006_device::h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83006_device(mconfig, H83006, tag, owner, clock, 0xff720)
{
}
-h83007_device::h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+h83007_device::h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
h83006_device(mconfig, H83007, tag, owner, clock, 0xfef20)
{
}
@@ -47,12 +47,12 @@ void h83006_device::map(address_map &map)
{
const offs_t base = m_mode_a20 ? 0 : 0xf00000;
- map(base | 0xee003, base | 0xee003).w(m_port4, FUNC(h8_port_device::ddr_w));
- map(base | 0xee005, base | 0xee005).w(m_port6, FUNC(h8_port_device::ddr_w));
- map(base | 0xee007, base | 0xee007).w(m_port8, FUNC(h8_port_device::ddr_w));
- map(base | 0xee008, base | 0xee008).w(m_port9, FUNC(h8_port_device::ddr_w));
- map(base | 0xee009, base | 0xee009).w(m_porta, FUNC(h8_port_device::ddr_w));
- map(base | 0xee00a, base | 0xee00a).w(m_portb, FUNC(h8_port_device::ddr_w));
+ map(base | 0xee003, base | 0xee003).rw(m_port4, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
+ map(base | 0xee005, base | 0xee005).rw(m_port6, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
+ map(base | 0xee007, base | 0xee007).rw(m_port8, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
+ map(base | 0xee008, base | 0xee008).rw(m_port9, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
+ map(base | 0xee009, base | 0xee009).rw(m_porta, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
+ map(base | 0xee00a, base | 0xee00a).rw(m_portb, FUNC(h8_port_device::ff_r), FUNC(h8_port_device::ddr_w));
map(base | 0xee012, base | 0xee012).rw(FUNC(h83006_device::syscr_r), FUNC(h83006_device::syscr_w));
map(base | 0xee014, base | 0xee014).rw(m_intc, FUNC(h8h_intc_device::iscr_r), FUNC(h8h_intc_device::iscr_w));
@@ -207,9 +207,9 @@ void h83006_device::interrupt_taken()
standard_irq_callback(m_intc->interrupt_taken(m_taken_irq_vector), m_NPC);
}
-void h83006_device::internal_update(uint64_t current_time)
+void h83006_device::internal_update(u64 current_time)
{
- uint64_t event_time = 0;
+ u64 event_time = 0;
add_event(event_time, m_adc->internal_update(current_time));
add_event(event_time, m_sci[0]->internal_update(current_time));
@@ -227,9 +227,26 @@ void h83006_device::internal_update(uint64_t current_time)
recompute_bcount(event_time);
}
+void h83006_device::notify_standby(int state)
+{
+ m_adc->notify_standby(state);
+ m_sci[0]->notify_standby(state);
+ m_sci[1]->notify_standby(state);
+ m_sci[2]->notify_standby(state);
+ m_timer8_0->notify_standby(state);
+ m_timer8_1->notify_standby(state);
+ m_timer8_2->notify_standby(state);
+ m_timer8_3->notify_standby(state);
+ m_timer16_0->notify_standby(state);
+ m_timer16_1->notify_standby(state);
+ m_timer16_2->notify_standby(state);
+ m_watchdog->notify_standby(state);
+}
+
void h83006_device::device_start()
{
h8h_device::device_start();
+ save_item(NAME(m_syscr));
}
void h83006_device::device_reset()
@@ -238,13 +255,12 @@ void h83006_device::device_reset()
m_syscr = 0x09;
}
-
-uint8_t h83006_device::syscr_r()
+u8 h83006_device::syscr_r()
{
return m_syscr;
}
-void h83006_device::syscr_w(uint8_t data)
+void h83006_device::syscr_w(u8 data)
{
m_syscr = data;
update_irq_filter();