1 // license:BSD-3-Clause
2 // copyright-holders:Nigel Barnes
3 /**********************************************************************
4 
5     Morley Electronics 'AA' Master ROM Expansion Board
6 
7 **********************************************************************/
8 
9 
10 #ifndef MAME_BUS_BBC_INTERNAL_MORLEY_H
11 #define MAME_BUS_BBC_INTERNAL_MORLEY_H
12 
13 #include "internal.h"
14 
15 
16 //**************************************************************************
17 //  TYPE DEFINITIONS
18 //**************************************************************************
19 
20 class bbc_morleyaa_device :
21 	public device_t,
22 	public device_bbc_internal_interface
23 {
24 public:
25 	// construction/destruction
26 	bbc_morleyaa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
27 
28 protected:
29 	// device-level overrides
30 	virtual void device_start() override;
31 
32 	// optional information overrides
33 	virtual void device_add_mconfig(machine_config &config) override;
34 	virtual const tiny_rom_entry *device_rom_region() const override;
35 
overrides_rom()36 	virtual bool overrides_rom() override { return true; }
romsel_w(offs_t offset,uint8_t data)37 	virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
38 	virtual uint8_t paged_r(offs_t offset) override;
39 	virtual void paged_w(offs_t offset, uint8_t data) override;
40 
41 private:
42 	required_memory_region m_aa_rom;
43 	required_device_array<bbc_romslot_device, 12> m_rom;
44 
45 	uint8_t m_romsel;
46 	uint8_t m_banksel;
47 };
48 
49 
50 // device type definition
51 DECLARE_DEVICE_TYPE(BBC_MORLEYAA, bbc_morleyaa_device);
52 
53 
54 #endif /* MAME_BUS_BBC_INTERNAL_MORLEY_H */
55