summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/odyssey2/chess.cpp
blob: 44890a394cea842a40490ed2bc53b9a08c4b8708 (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
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***********************************************************************************************************


 Videopac Chess Module emulation

 TODO:
   - this code is just a stub... hence, almost everything is still to do!

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


#include "emu.h"
#include "chess.h"


//-------------------------------------------------
//  o2_chess_device - constructor
//-------------------------------------------------

DEFINE_DEVICE_TYPE(O2_ROM_CHESS, o2_chess_device, "o2_chess", "Odyssey 2 Videopac Chess Module")


o2_chess_device::o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
	: o2_rom_device(mconfig, O2_ROM_CHESS, tag, owner, clock)
	, m_cpu(*this, "subcpu")
{
}


void o2_chess_device::chess_mem(address_map &map)
{
	map(0x0000, 0x07ff).r(FUNC(o2_chess_device::read_rom04));
}

void o2_chess_device::chess_io(address_map &map)
{
	map.unmap_value_high();
	map.global_mask(0xff);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void o2_chess_device::device_add_mconfig(machine_config &config)
{
	NSC800(config, m_cpu, XTAL(4'000'000));
	m_cpu->set_addrmap(AS_PROGRAM, &o2_chess_device::chess_mem);
	m_cpu->set_addrmap(AS_IO, &o2_chess_device::chess_io);
}