1 // license:BSD-3-Clause
2 // copyright-holders:Sergey Svishchev
3 /***************************************************************************
4 
5     Toshiba 1000 Backup RAM
6 
7     Simulation of interface provided by 80C50 keyboard controller.
8 
9 ***************************************************************************/
10 
11 #ifndef MAME_MACHINE_TOSH1000_BRAM_H
12 #define MAME_MACHINE_TOSH1000_BRAM_H
13 
14 #pragma once
15 
16 
17 // ======================> tosh1000_bram_device
18 
19 class tosh1000_bram_device : public device_t, public device_nvram_interface
20 {
21 public:
22 	// construction/destruction
23 	tosh1000_bram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
24 
25 	uint8_t read(offs_t offset);
26 	void write(offs_t offset, uint8_t data);
27 
28 protected:
29 	// device-level overrides
30 	virtual void device_start() override;
31 	virtual void device_reset() override;
32 
33 	// device_nvram_interface overrides
34 	virtual void nvram_default() override;
35 	virtual void nvram_read(emu_file &file) override;
36 	virtual void nvram_write(emu_file &file) override;
37 
38 private:
39 	enum { BRAM_SIZE = 160 };
40 
41 	uint8_t m_bram[BRAM_SIZE];
42 };
43 
44 // device type definition
45 DECLARE_DEVICE_TYPE(TOSH1000_BRAM, tosh1000_bram_device)
46 
47 #endif // MAME_MACHINE_TOSH1000_BRAM_H
48