diff options
Diffstat (limited to 'src/devices/machine/ds2404.cpp')
-rw-r--r-- | src/devices/machine/ds2404.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp index 4a28b7f7d38..4f92a844a45 100644 --- a/src/devices/machine/ds2404.cpp +++ b/src/devices/machine/ds2404.cpp @@ -10,7 +10,9 @@ #include "emu.h" #include "ds2404.h" -#include <time.h> + +#include <algorithm> +#include <time.h> // FIXME: re-write in terms of device_rtc_interface and remove this //************************************************************************** @@ -34,7 +36,7 @@ ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, dev m_a2(0), m_state_ptr(0) { - memset(m_ram, 0, sizeof(m_ram)); + std::fill(std::begin(m_ram), std::end(m_ram), 0); } @@ -315,23 +317,17 @@ void ds2404_device::device_timer(emu_timer &timer, device_timer_id id, int param switch(id) { case 0: - { // tick - for(auto & elem : m_rtc) + for(auto &elem : m_rtc) { elem++; if(elem != 0) - { break; - } } - break; - } default: - assert_always(false, "Unknown id in ds2404_device::device_timer"); - break; + throw emu_fatalerror("Unknown id in ds2404_device::device_timer"); } } |