summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/rom/rtc.h
blob: 0cdb98193522698ea1ec5c7315eb3bcc10f3b93a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/***************************************************************************

    Solidisk Real Time Clock emulation

    PMS Genie Watch (RTC for the BBC)

***************************************************************************/

#ifndef MAME_BUS_BBC_ROM_RTC_H
#define MAME_BUS_BBC_ROM_RTC_H

#pragma once

#include "slot.h"
#include "machine/mc146818.h"
#include "machine/ds1315.h"

//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// ======================> bbc_stlrtc_device

class bbc_stlrtc_device : public device_t,
							public device_bbc_rom_interface
{
public:
	// construction/destruction
	bbc_stlrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);

protected:
	// device-level overrides
	virtual void device_add_mconfig(machine_config &config) override;

	virtual void device_start() override;

	// device_bbc_rom_interface overrides
	virtual uint8_t read(offs_t offset) override;

private:
	required_device<mc146818_device> m_rtc;
};

// ======================> bbc_pmsrtc_device

class bbc_pmsrtc_device : public device_t,
	public device_bbc_rom_interface
{
public:
	// construction/destruction
	bbc_pmsrtc_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);

protected:
	// device-level overrides
	virtual void device_add_mconfig(machine_config &config) override;

	virtual void device_start() override;

	// device_bbc_rom_interface overrides
	virtual uint8_t read(offs_t offset) override;

private:
	required_device<ds1315_device> m_rtc;
};

// device type definition
DECLARE_DEVICE_TYPE(BBC_STLRTC, bbc_stlrtc_device)
DECLARE_DEVICE_TYPE(BBC_PMSRTC, bbc_pmsrtc_device)

#endif // MAME_BUS_BBC_ROM_RTC_H