summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/a7800/hiscore.cpp
blob: 62630842e5c62a231a25b16092e56d26f54f301b (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
63
64
65
66
67
68
69
70
71
72
73
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***********************************************************************************************************

 A7800 HighScore passthrough cart emulation


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


#include "emu.h"
#include "hiscore.h"
#include "a78_carts.h"


//-------------------------------------------------
//  constructor
//-------------------------------------------------

DEFINE_DEVICE_TYPE(A78_HISCORE, a78_hiscore_device, "a78_hiscore", "Atari 7800 High Score Cart")


a78_hiscore_device::a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
	: a78_rom_device(mconfig, A78_HISCORE, tag, owner, clock)
	, m_hscslot(*this, "hsc_slot")
{
}


void a78_hiscore_device::device_add_mconfig(machine_config &config)
{
	A78_CART_SLOT(config, "hsc_slot", a7800_cart, nullptr);
}


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

READ8_MEMBER(a78_hiscore_device::read_10xx)
{
	return m_nvram[offset];
}

WRITE8_MEMBER(a78_hiscore_device::write_10xx)
{
	m_nvram[offset] = data;
}

READ8_MEMBER(a78_hiscore_device::read_30xx)
{
	return m_rom[offset];
}

READ8_MEMBER(a78_hiscore_device::read_04xx)
{
	return m_hscslot->read_04xx(space, offset);
}

WRITE8_MEMBER(a78_hiscore_device::write_04xx)
{
	m_hscslot->write_04xx(space, offset, data);
}

READ8_MEMBER(a78_hiscore_device::read_40xx)
{
	return m_hscslot->read_40xx(space, offset);
}

WRITE8_MEMBER(a78_hiscore_device::write_40xx)
{
	m_hscslot->write_40xx(space, offset, data);
}