summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/deco222.cpp
blob: 1df8a720dd2b99011361272948dbd73a6e0399f7 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood

/* Data East encrypted CPU 222, aka C10707?
 also sometimes implemented as basic logic outside the CPU on early revs and bootlegs */


#include "deco222.h"


deco_222_device::deco_222_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
	m6502_device(mconfig, DECO_222, "DECO 222", tag, owner, clock, "deco222", __FILE__)
{
}

void deco_222_device::device_start()
{
	mintf = new mi_decrypt;
	init();
}

void deco_222_device::device_reset()
{
	m6502_device::device_reset();
	static_cast<mi_decrypt *>(mintf)->had_written = false;
}

UINT8 deco_222_device::mi_decrypt::read_sync(UINT16 adr)
{
	return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0);
}



deco_c10707_device::deco_c10707_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
	m6502_device(mconfig, DECO_C10707, "DECO C10707", tag, owner, clock, "decoc10707", __FILE__)
{
}

void deco_c10707_device::device_start()
{
	mintf = new mi_decrypt;
	init();
}

void deco_c10707_device::device_reset()
{
	m6502_device::device_reset();
	static_cast<mi_decrypt *>(mintf)->had_written = false;
}

UINT8 deco_c10707_device::mi_decrypt::read_sync(UINT16 adr)
{
	return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0);
}