From 2ea363744427c6957a5f1f61915f65fc67f22d95 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sat, 19 Apr 2014 22:03:23 +0000 Subject: [PATCH] next: Setup the time [O. Galibert] --- src/emu/machine/mccs1850.c | 14 +++++++++++++- src/emu/machine/mccs1850.h | 3 +++ src/mess/drivers/next.c | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/emu/machine/mccs1850.c b/src/emu/machine/mccs1850.c index f29f8f76e03..40b2892803d 100644 --- a/src/emu/machine/mccs1850.c +++ b/src/emu/machine/mccs1850.c @@ -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; } diff --git a/src/emu/machine/mccs1850.h b/src/emu/machine/mccs1850.h index 8b142e14b22..ee94deef977 100644 --- a/src/emu/machine/mccs1850.h +++ b/src/emu/machine/mccs1850.h @@ -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(); diff --git a/src/mess/drivers/next.c b/src/mess/drivers/next.c index ef25f271e25..e26d665911f 100644 --- a/src/mess/drivers/next.c +++ b/src/mess/drivers/next.c @@ -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()