summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mn10200/mn10200.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/mn10200/mn10200.cpp')
-rw-r--r--src/devices/cpu/mn10200/mn10200.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp
index e7ce80e751e..2e825978bf8 100644
--- a/src/devices/cpu/mn10200/mn10200.cpp
+++ b/src/devices/cpu/mn10200/mn10200.cpp
@@ -9,7 +9,6 @@
*/
#include "emu.h"
-#include "debugger.h"
#include "mn10200.h"
#include "mn102dis.h"
@@ -49,8 +48,8 @@ void mn10200_device::mn1020012a_internal_map(address_map &map)
mn10200_device::mn10200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program), m_program(nullptr)
- , m_read_port{{*this}, {*this}, {*this}, {*this}, {*this}}
- , m_write_port{{*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_read_port(*this, 0xff)
+ , m_write_port(*this)
, m_cycles(0), m_pc(0), m_psw(0), m_mdr(0), m_nmicr(0), m_iagr(0)
, m_extmdl(0), m_extmdh(0), m_possible_irq(false), m_pplul(0), m_ppluh(0), m_p3md(0), m_p4(0)
{ }
@@ -123,13 +122,6 @@ void mn10200_device::device_start()
{
m_program = &space(AS_PROGRAM);
- // resolve callbacks
- for (int i = 0; i < 5; i++)
- {
- m_read_port[i].resolve_safe(0xff);
- m_write_port[i].resolve_safe();
- }
-
// init and register for savestates
save_item(NAME(m_pc));
save_item(NAME(m_d));
@@ -154,7 +146,7 @@ void mn10200_device::device_start()
for (int tmr = 0; tmr < MN10200_NUM_TIMERS_8BIT; tmr++)
{
- m_timer_timers[tmr] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mn10200_device::simple_timer_cb), this));
+ m_timer_timers[tmr] = timer_alloc(FUNC(mn10200_device::simple_timer_cb), this);
m_timer_timers[tmr]->adjust(attotime::never, tmr);
}
@@ -229,6 +221,17 @@ void mn10200_device::device_start()
save_item(NAME(m_port[i].dir), i);
}
+ // registering reads the value, so clear it before
+ m_pc = 0;
+ m_mdr = 0;
+ m_nmicr = 0;
+ m_iagr = 0;
+ for (int i=0; i != 4; i++)
+ {
+ m_d[i] = 0;
+ m_a[i] = 0;
+ }
+
// register for debugger
state_add( MN10200_PC, "PC", m_pc ).mask(0xffffff).formatstr("%06X");
state_add( MN10200_MDR, "MDR", m_mdr).formatstr("%04X");
@@ -1709,7 +1712,7 @@ void mn10200_device::execute_run()
// internal i/o
//-------------------------------------------------
-WRITE8_MEMBER(mn10200_device::io_control_w)
+void mn10200_device::io_control_w(offs_t offset, uint8_t data)
{
switch (offset)
{
@@ -2112,7 +2115,7 @@ WRITE8_MEMBER(mn10200_device::io_control_w)
}
-READ8_MEMBER(mn10200_device::io_control_r)
+uint8_t mn10200_device::io_control_r(offs_t offset)
{
switch (offset)
{