1 // license:LGPL-2.1+
2 // copyright-holders:Michael Zapf
3 /****************************************************************************
4 
5     TI-99 Myarc memory expansion
6     See myarcmem.c for documentation
7 
8     Michael Zapf, September 2010
9     February 2012: Rewritten as class
10 
11 *****************************************************************************/
12 
13 #ifndef MAME_BUS_TI99_PEB_MYARCMEM_H
14 #define MAME_BUS_TI99_PEB_MYARCMEM_H
15 
16 #pragma once
17 
18 #include "peribox.h"
19 #include "machine/ram.h"
20 
21 namespace bus { namespace ti99 { namespace peb {
22 
23 class myarc_memory_expansion_device : public device_t, public device_ti99_peribox_card_interface
24 {
25 public:
26 	myarc_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
27 	void readz(offs_t offset, uint8_t *value) override;
28 	void write(offs_t offset, uint8_t data) override;
29 
30 	void crureadz(offs_t offset, uint8_t *value) override;
31 	void cruwrite(offs_t offset, uint8_t data) override;
32 
33 protected:
34 	void device_start() override;
35 	void device_reset() override;
36 	const tiny_rom_entry *device_rom_region() const override;
37 	ioport_constructor device_input_ports() const override;
38 	virtual void device_add_mconfig(machine_config &config) override;
39 
40 private:
41 	int     get_base(int offset);
42 	required_device<ram_device> m_ram;
43 	uint8_t*  m_dsrrom;
44 	int     m_bank;
45 	int     m_size;
46 };
47 
48 } } } // end namespace bus::ti99::peb
49 
50 DECLARE_DEVICE_TYPE_NS(TI99_MYARCMEM, bus::ti99::peb, myarc_memory_expansion_device)
51 
52 #endif // MAME_BUS_TI99_PEB_MYARCMEM_H
53