summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/neogeo/boot_kof2k2.cpp
blob: f6d602491d65fc544d2d8306368f153320e0e758 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// license:BSD-3-Clause
// copyright-holders:S. Smith,David Haywood,Fabio Priuli
/***********************************************************************************************************

 Neo Geo cart emulation
 The King of Fighers 2002 Bootleg cart type

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


#include "emu.h"
#include "boot_kof2k2.h"


static MACHINE_CONFIG_FRAGMENT( kof2k2bl_cart )
	MCFG_NEOBOOT_PROT_ADD("bootleg_prot")
	MCFG_CMC_PROT_ADD("cmc_prot")
	MCFG_PCM2_PROT_ADD("pcm2_prot")
	MCFG_KOF2002_PROT_ADD("kof2k2_prot")
MACHINE_CONFIG_END

static MACHINE_CONFIG_FRAGMENT( kof2k2mp_cart )
	MCFG_NEOBOOT_PROT_ADD("bootleg_prot")
	MCFG_CMC_PROT_ADD("cmc_prot")
	MCFG_PCM2_PROT_ADD("pcm2_prot")
MACHINE_CONFIG_END

machine_config_constructor neogeo_kof2002b_cart::device_mconfig_additions() const
{
	return MACHINE_CONFIG_NAME( kof2k2bl_cart );
}

machine_config_constructor neogeo_kf2k2mp_cart::device_mconfig_additions() const
{
	return MACHINE_CONFIG_NAME( kof2k2mp_cart );
}

machine_config_constructor neogeo_kf2k2mp2_cart::device_mconfig_additions() const
{
	return MACHINE_CONFIG_NAME( kof2k2mp_cart );
}

/*************************************************
 kof2002b
 **************************************************/

const device_type NEOGEO_KOF2002B_CART = &device_creator<neogeo_kof2002b_cart>;

neogeo_kof2002b_cart::neogeo_kof2002b_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
	neogeo_bootleg_cart(mconfig, NEOGEO_KOF2002B_CART, "Neo Geo KOF 2002 Bootleg Cart", tag, owner, clock, "neocart_kof2002b", __FILE__),
	m_cmc_prot(*this, "cmc_prot"),
	m_pcm2_prot(*this, "pcm2_prot"),
	m_kof2k2_prot(*this, "kof2k2_prot")
{}


void neogeo_kof2002b_cart::decrypt_all(DECRYPT_ALL_PARAMS)
{
	m_kof2k2_prot->kof2002_decrypt_68k(cpuregion, cpuregion_size);
	m_pcm2_prot->swap(ym_region, ym_region_size, 0);
	m_cmc_prot->cmc50_m1_decrypt(audiocrypt_region, audiocrypt_region_size, audiocpu_region, audio_region_size);
	m_prot->kof2002b_gfx_decrypt(spr_region, 0x4000000);
	m_prot->kof2002b_gfx_decrypt(fix_region, 0x20000);
}

/*************************************************
 kf2k2mp
 **************************************************/

const device_type NEOGEO_KF2K2MP_CART = &device_creator<neogeo_kf2k2mp_cart>;

neogeo_kf2k2mp_cart::neogeo_kf2k2mp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
	neogeo_bootleg_cart(mconfig, NEOGEO_KF2K2MP_CART, "Neo Geo KOF 2002 MP Cart", tag, owner, clock, "neocart_kf2k2mp", __FILE__),
	m_cmc_prot(*this, "cmc_prot"),
	m_pcm2_prot(*this, "pcm2_prot")
{}


void neogeo_kf2k2mp_cart::decrypt_all(DECRYPT_ALL_PARAMS)
{
	m_prot->kf2k2mp_decrypt(cpuregion, cpuregion_size);
	m_pcm2_prot->swap(ym_region, ym_region_size, 0);
	m_cmc_prot->cmc50_m1_decrypt(audiocrypt_region, audiocrypt_region_size, audiocpu_region, audio_region_size);
	m_prot->sx_decrypt(fix_region, fix_region_size, 2);
	m_cmc_prot->cmc50_gfx_decrypt(spr_region, spr_region_size, KOF2002_GFX_KEY);
}

/*************************************************
 kf2k2mp2
 **************************************************/

const device_type NEOGEO_KF2K2MP2_CART = &device_creator<neogeo_kf2k2mp2_cart>;

neogeo_kf2k2mp2_cart::neogeo_kf2k2mp2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
	neogeo_bootleg_cart(mconfig, NEOGEO_KF2K2MP2_CART, "Neo Geo KOF 2002 MP2 Cart", tag, owner, clock, "neocart_kf2k2mp2", __FILE__),
	m_cmc_prot(*this, "cmc_prot"),
	m_pcm2_prot(*this, "pcm2_prot")
{}


void neogeo_kf2k2mp2_cart::decrypt_all(DECRYPT_ALL_PARAMS)
{
	m_prot->kf2k2mp2_px_decrypt(cpuregion, cpuregion_size);
	m_pcm2_prot->swap(ym_region, ym_region_size, 0);
	m_cmc_prot->cmc50_m1_decrypt(audiocrypt_region, audiocrypt_region_size, audiocpu_region, audio_region_size);
	m_prot->sx_decrypt(fix_region, fix_region_size, 1);
	m_cmc_prot->cmc50_gfx_decrypt(spr_region, spr_region_size, KOF2002_GFX_KEY);
}