summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/bbc/internal/we32kram.h
blob: d5fc6a0a1f5663667fc9e9d58d0efeb26cbfb4f4 (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
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************

    Watford Electronics 32K RAM card

    http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_32KRAMcard.html

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


#ifndef MAME_BUS_BBC_INTERNAL_WE32KRAM_H
#define MAME_BUS_BBC_INTERNAL_WE32KRAM_H

#include "internal.h"


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

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

protected:
	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

	// optional information overrides
	virtual const tiny_rom_entry *device_rom_region() const override;

	virtual bool overrides_ram() override { return true; }
	virtual uint8_t ram_r(offs_t offset) override;
	virtual void ram_w(offs_t offset, uint8_t data) override;

private:
	void control_w(offs_t offset, uint8_t data);

	uint8_t m_shadow;
	std::unique_ptr<uint8_t[]> m_ram;
};


// device type definition
DECLARE_DEVICE_TYPE(BBC_WE32KRAM, bbc_we32kram_device);



#endif /* MAME_BUS_BBC_INTERNAL_WE32KRAM_H */