next: Setup the time [O. Galibert]

This commit is contained in:
Olivier Galibert 2014-04-19 22:03:23 +00:00
parent c0f68e4d6b
commit 2ea3637444
3 changed files with 20 additions and 1 deletions

View File

@ -301,6 +301,15 @@ mccs1850_device::mccs1850_device(const machine_config &mconfig, const char *tag,
}
//-------------------------------------------------
// set_counter - set the counter at startup time
//-------------------------------------------------
void mccs1850_device::set_counter(UINT32 value)
{
m_counter = value;
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@ -336,7 +345,10 @@ void mccs1850_device::device_start()
void mccs1850_device::device_reset()
{
m_ram[REGISTER_STATUS] = 0x80 | STATUS_FTU;
if(!m_counter)
m_ram[REGISTER_STATUS] = 0x80 | STATUS_FTU;
else
m_ram[REGISTER_STATUS] = 0x80;
m_ram[REGISTER_CONTROL] = 0x00;
}

View File

@ -70,6 +70,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( por_w );
DECLARE_WRITE_LINE_MEMBER( test_w );
// For setting the time at startup
void set_counter(UINT32 value);
protected:
// device-level overrides
virtual void device_start();

View File

@ -842,6 +842,10 @@ void next_state::machine_start()
}
timer_tm = timer_alloc(0);
system_time systime;
machine().base_datetime(systime);
rtc->set_counter(systime.time);
}
void next_state::machine_reset()