summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/msx_cart/korean.h
blob: 76062632923e85879f593bbcd911c23adc80ffe9 (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
#ifndef __MSX_CART_KOREAN_H
#define __MSX_CART_KOREAN_H

#include "bus/msx_cart/cartridge.h"


extern const device_type MSX_CART_KOREAN_80IN1;
extern const device_type MSX_CART_KOREAN_90IN1;
extern const device_type MSX_CART_KOREAN_126IN1;


class msx_cart_korean_80in1 : public device_t
						, public msx_cart_interface
{
public:
	msx_cart_korean_80in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

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

	virtual void initialize_cartridge();

	virtual DECLARE_READ8_MEMBER(read_cart);
	virtual DECLARE_WRITE8_MEMBER(write_cart);

	void restore_banks();

private:
	UINT8 m_bank_mask;
	UINT8 m_selected_bank[4];
	UINT8 *m_bank_base[4];

	void setup_bank(UINT8 bank);
};


class msx_cart_korean_90in1 : public device_t
						, public msx_cart_interface
{
public:
	msx_cart_korean_90in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

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

	virtual void initialize_cartridge();

	virtual DECLARE_READ8_MEMBER(read_cart);

	DECLARE_WRITE8_MEMBER(banking);

	void restore_banks();

private:
	UINT8 m_bank_mask;
	UINT8 m_selected_bank;
	UINT8 *m_bank_base[4];
};


class msx_cart_korean_126in1 : public device_t
						, public msx_cart_interface
{
public:
	msx_cart_korean_126in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

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

	virtual void initialize_cartridge();

	virtual DECLARE_READ8_MEMBER(read_cart);
	virtual DECLARE_WRITE8_MEMBER(write_cart);

	void restore_banks();

private:
	UINT8 m_bank_mask;
	UINT8 m_selected_bank[2];
	UINT8 *m_bank_base[2];

	void setup_bank(UINT8 bank);
};


#endif