summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/msx_switched.c
blob: 9b416c7df7d7cefa983ce4ca06efd9bc0f6a8a98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "emu.h"
#include "msx_switched.h"


msx_switched_device::msx_switched_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)
	: device_t(mconfig, type, name, tag, owner, clock, shortname, source)
{
}


void msx_switched_device::device_start()
{
	address_space &space = dynamic_cast<device_memory_interface*>(owner())->space();

	// Install IO read/write handlers
	UINT16 start = ( get_id() << 8 ) | 0x00;
	UINT16 end = ( get_id() << 8 ) | 0x0f;
	space.install_read_handler(start, end, read8_delegate(FUNC(msx_switched_device::io_read), this));
	space.install_write_handler(start, end, write8_delegate(FUNC(msx_switched_device::io_write), this));
}