summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/peb/memex.h
blob: 114e61d4cae8e06ad46a3b6602913d20888d6243 (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
// license:LGPL-2.1+
// copyright-holders:Michael Zapf
/****************************************************************************

    Geneve "Memex" memory expansion
    See memex.c for documentation

    Michael Zapf, February 2011
    February 2012: Rewritten as class

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

#ifndef MAME_BUS_TI99_PEB_MEMEX_H
#define MAME_BUS_TI99_PEB_MEMEX_H

#pragma once

#include "peribox.h"
#include "machine/ram.h"

namespace bus::ti99::peb {

class geneve_memex_device : public device_t, public device_ti99_peribox_card_interface
{
public:
	geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);
	void readz(offs_t offset, uint8_t *value) override;
	void write(offs_t offset, uint8_t data) override;

	void crureadz(offs_t offset, uint8_t *value) override { }
	void cruwrite(offs_t offset, uint8_t data) override { }

protected:
	void device_start() override;
	void device_reset() override;
	virtual void device_add_mconfig(machine_config &config) override;
	virtual ioport_constructor device_input_ports() const override;

private:
	bool    access_enabled(offs_t offset);
	required_device<ram_device> m_ram;
	uint8_t   m_switches;
};

} // end namespace bus::ti99::peb

DECLARE_DEVICE_TYPE_NS(TI99_MEMEX, bus::ti99::peb, geneve_memex_device)

#endif // MAME_BUS_TI99_PEB_MEMEX_H