summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/neogeo/pvc.h
blob: 00be5322f59087d4be77c34099dc1fcda31cc05b (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
109
// license:BSD-3-Clause
// copyright-holders:S. Smith,David Haywood,Fabio Priuli
#ifndef MAME_BUS_NEOGEO_PVC_H
#define MAME_BUS_NEOGEO_PVC_H

#pragma once

#include "slot.h"
#include "rom.h"
#include "prot_pcm2.h"
#include "prot_cmc.h"
#include "prot_pvc.h"

// ======================> neogeo_pvc_cart_device

class neogeo_pvc_cart_device : public neogeo_rom_device
{
public:
	// construction/destruction
	neogeo_pvc_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock);

	// reading and writing
	virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); }
	virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(offset); }
	virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(offset, data, mem_mask); }

	virtual void decrypt_all(DECRYPT_ALL_PARAMS) override { }
	virtual int get_fixed_bank_type() override { return 0; }

protected:
	neogeo_pvc_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint16_t clock);

	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

	virtual void device_add_mconfig(machine_config &config) override;

	required_device<cmc_prot_device> m_cmc_prot;
	required_device<pcm2_prot_device> m_pcm2_prot;
	required_device<pvc_prot_device> m_pvc_prot;

};

// device type definition
DECLARE_DEVICE_TYPE(NEOGEO_PVC_CART, neogeo_pvc_cart_device)


/*************************************************
 mslug5
**************************************************/

class neogeo_pvc_mslug5_cart_device : public neogeo_pvc_cart_device
{
public:
	neogeo_pvc_mslug5_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual void decrypt_all(DECRYPT_ALL_PARAMS) override;
	virtual int get_fixed_bank_type() override { return 1; }
};

DECLARE_DEVICE_TYPE(NEOGEO_PVC_MSLUG5_CART, neogeo_pvc_mslug5_cart_device)


/*************************************************
 svc
**************************************************/

class neogeo_pvc_svc_cart_device : public neogeo_pvc_cart_device
{
public:
	neogeo_pvc_svc_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual void decrypt_all(DECRYPT_ALL_PARAMS) override;
	virtual int get_fixed_bank_type() override { return 2; }
};

DECLARE_DEVICE_TYPE(NEOGEO_PVC_SVC_CART, neogeo_pvc_svc_cart_device)


/*************************************************
 kof2003
**************************************************/

class neogeo_pvc_kof2003_cart_device : public neogeo_pvc_cart_device
{
public:
	neogeo_pvc_kof2003_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual void decrypt_all(DECRYPT_ALL_PARAMS) override;
	virtual int get_fixed_bank_type() override { return 2; }
};

DECLARE_DEVICE_TYPE(NEOGEO_PVC_KOF2003_CART, neogeo_pvc_kof2003_cart_device)


/*************************************************
 kof2003h
**************************************************/

class neogeo_pvc_kof2003h_cart_device : public neogeo_pvc_cart_device
{
public:
	neogeo_pvc_kof2003h_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual void decrypt_all(DECRYPT_ALL_PARAMS) override;
	virtual int get_fixed_bank_type() override { return 2; }
};

DECLARE_DEVICE_TYPE(NEOGEO_PVC_KOF2003H_CART, neogeo_pvc_kof2003h_cart_device)


#endif // MAME_BUS_NEOGEO_PVC_H