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

#include "slot.h"

#define MCFG_MSX_SLOT_ROM_ADD(_tag, _startpage, _numpages, _region, _offset) \
	MCFG_MSX_INTERNAL_SLOT_ADD(_tag, MSX_SLOT_ROM, _startpage, _numpages) \
	msx_slot_rom_device::set_rom_start(*device, _region, _offset);

class msx_slot_rom_device : public device_t,
							public msx_internal_slot_interface
{
public:
	msx_slot_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
	msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

	// static configuration helpers
	static void set_rom_start(device_t &device, const char *region, UINT32 offset);

	virtual void device_start() override;

	virtual DECLARE_READ8_MEMBER(read);

private:
	const char *m_region;
	UINT32 m_region_offset;
	const UINT8 *m_rom;
};

extern const device_type MSX_SLOT_ROM;

#endif