summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m6502/deco16.cpp
blob: 0b16a6db8b3d39af621fb54f86e2947b4d4c15a4 (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
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert
/***************************************************************************

    deco16.c

    6502, reverse-engineered DECO variant

    Note that the "DECO CPU16" is not in fact a CPU in itself, but a custom
    bus controller with protection features used with a standard 6502.

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

#include "emu.h"
#include "deco16.h"
#include "deco16d.h"

#define DECO16_VERBOSE 1

DEFINE_DEVICE_TYPE(DECO16, deco16_device, "deco16", "Data East DECO16")

deco16_device::deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
	m6502_device(mconfig, DECO16, tag, owner, clock),
	io(nullptr),
	io_config("io", ENDIANNESS_LITTLE, 8, 16)
{
}

std::unique_ptr<util::disasm_interface> deco16_device::create_disassembler()
{
	return std::make_unique<deco16_disassembler>();
}

void deco16_device::device_start()
{
	mintf = std::make_unique<mi_default>();

	init();

	io = &space(AS_IO);
}

device_memory_interface::space_config_vector deco16_device::memory_space_config() const
{
	if(has_configured_map(AS_OPCODES))
		return space_config_vector {
			std::make_pair(AS_PROGRAM, &program_config),
			std::make_pair(AS_OPCODES, &sprogram_config),
			std::make_pair(AS_IO,      &io_config)
		};
	else
		return space_config_vector {
			std::make_pair(AS_PROGRAM, &program_config),
			std::make_pair(AS_IO,      &io_config)
		};
}

#include "cpu/m6502/deco16.hxx"