summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/arcadia/rom.cpp
blob: 8009b229a6862d9b3b7f284b65377d42c9ebc223 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***********************************************************************************************************


 Emerson Arcadia 2001 cart emulation

 Golf carts have the "extra_rom" handler installed at $4000 instead of $2000

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


#include "emu.h"
#include "rom.h"


//-------------------------------------------------
//  arcadia_rom_device - constructor
//-------------------------------------------------

const device_type ARCADIA_ROM_STD = &device_creator<arcadia_rom_device>;
const device_type ARCADIA_ROM_GOLF = &device_creator<arcadia_golf_device>;


arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
					: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
						device_arcadia_cart_interface( mconfig, *this )
{
}

arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
					: device_t(mconfig, ARCADIA_ROM_STD, "Emerson Arcadia Standard Carts", tag, owner, clock, "arcadia_rom", __FILE__),
						device_arcadia_cart_interface( mconfig, *this )
{
}

arcadia_golf_device::arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
					: arcadia_rom_device(mconfig, ARCADIA_ROM_GOLF, "Emerson Arcadia Golf Cart", tag, owner, clock, "arcadia_golf", __FILE__)
{
}


/*-------------------------------------------------
 mapper specific handlers
 -------------------------------------------------*/

READ8_MEMBER(arcadia_rom_device::read_rom)
{
	if (offset < m_rom_size)
		return m_rom[offset];
	else
		return 0xff;
}


READ8_MEMBER(arcadia_rom_device::extra_rom)
{
	if (offset + 0x1000 < m_rom_size)
		return m_rom[offset + 0x1000];
	else
		return 0xff;
}