summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/msx_slot/ram.h
blob: 17bff978148e82b7392959a142f54905b7338533 (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
// license:BSD-3-Clause
// copyright-holders:Wilbert Pol
#ifndef MAME_BUS_MSX_SLOT_RAM_H
#define MAME_BUS_MSX_SLOT_RAM_H

#include "slot.h"

#define MCFG_MSX_SLOT_RAM_ADD(_tag, _startpage, _numpages) \
	MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_RAM, _startpage, _numpages)

#define MCFG_MSX_SLOT_RAM_8KB \
	downcast<msx_slot_ram_device &>(*device).force_start_address(0xe000);


class msx_slot_ram_device : public device_t,
							public msx_internal_slot_interface
{
public:
	msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	void force_start_address(uint16_t start) { m_start_address = start; }

	virtual DECLARE_READ8_MEMBER(read) override;
	virtual DECLARE_WRITE8_MEMBER(write) override;

protected:
	virtual void device_start() override;

private:
	std::vector<uint8_t> m_ram;
};


DECLARE_DEVICE_TYPE(MSX_SLOT_RAM, msx_slot_ram_device)


#endif // MAME_BUS_MSX_SLOT_RAM_H