mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00

device_rtc_interface: Cleanups and refinements (nw) - Give RTCs their own phase of machine initialization, right after NVRAM loading - Make RTC feature flag overrides const, including one new one - Make rtc_clock_updated a required override
74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
// license:BSD-3-Clause
|
|
// copyright-holders:Angelo Salese
|
|
/***************************************************************************
|
|
|
|
Template for skeleton device
|
|
|
|
***************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#ifndef __AICARTCDEV_H__
|
|
#define __AICARTCDEV_H__
|
|
|
|
#include "dirtc.h"
|
|
|
|
|
|
//**************************************************************************
|
|
// INTERFACE CONFIGURATION MACROS
|
|
//**************************************************************************
|
|
|
|
#define MCFG_AICARTC_ADD(_tag,_freq) \
|
|
MCFG_DEVICE_ADD(_tag, AICARTC, _freq)
|
|
|
|
//**************************************************************************
|
|
// TYPE DEFINITIONS
|
|
//**************************************************************************
|
|
|
|
// ======================> aicartc_device
|
|
|
|
class aicartc_device : public device_t,
|
|
public device_rtc_interface
|
|
{
|
|
public:
|
|
// construction/destruction
|
|
aicartc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
|
|
|
// I/O operations
|
|
DECLARE_WRITE16_MEMBER( write );
|
|
DECLARE_READ16_MEMBER( read );
|
|
|
|
UINT16 m_rtc_reg_lo,m_rtc_reg_hi;
|
|
UINT16 m_rtc_tick;
|
|
UINT8 m_we;
|
|
|
|
protected:
|
|
// device-level overrides
|
|
virtual void device_validity_check(validity_checker &valid) const override;
|
|
virtual void device_start() override;
|
|
virtual void device_reset() override;
|
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
|
|
|
// device_rtc_interface overrides
|
|
virtual bool rtc_feature_y2k() const override { return true; }
|
|
virtual bool rtc_feature_leap_year() const override { return true; }
|
|
virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override;
|
|
|
|
private:
|
|
emu_timer *m_clock_timer;
|
|
};
|
|
|
|
|
|
// device type definition
|
|
extern const device_type AICARTC;
|
|
|
|
|
|
|
|
//**************************************************************************
|
|
// GLOBAL VARIABLES
|
|
//**************************************************************************
|
|
|
|
|
|
|
|
#endif
|