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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***********************************************************************************************************
NES/Famicom cartridge emulation for NTDEC PCBs
Here we emulate the following PCBs
* NTDEC ASDER [mapper 112]
* NTDEC Fighting Hero [mapper 193]
TODO:
- why is Master Shooter not working?
***********************************************************************************************************/
#include "emu.h"
#include "ntdec.h"
#ifdef NES_PCB_DEBUG
#define VERBOSE 1
#else
#define VERBOSE 0
#endif
#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
//-------------------------------------------------
// constructor
//-------------------------------------------------
const device_type NES_NTDEC_ASDER = &device_creator<nes_ntdec_asder_device>;
const device_type NES_NTDEC_FH = &device_creator<nes_ntdec_fh_device>;
nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: nes_nrom_device(mconfig, NES_NTDEC_ASDER, "NES Cart NTDEC Asder PCB", tag, owner, clock, "nes_ntdec_asder", __FILE__)
{
}
nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: nes_nrom_device(mconfig, NES_NTDEC_FH, "NES Cart NTDEC Fighting Hero PCB", tag, owner, clock, "nes_ntdec_fh", __FILE__)
{
}
void nes_ntdec_asder_device::device_start()
{
common_start();
save_item(NAME(m_latch));
}
void nes_ntdec_asder_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
m_latch = 0;
}
void nes_ntdec_fh_device::device_start()
{
common_start();
}
void nes_ntdec_fh_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32((m_prg_chunks - 1) >> 1);
chr8(0, m_chr_source);
set_nt_mirroring(PPU_MIRROR_VERT);
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
/*-------------------------------------------------
NTDEC ASDER Bootleg Board
Games: Cobra Mission, Fighting Hero III, Huang Di, Master
Shooter
iNES: mapper 112
In MESS: Supported.
-------------------------------------------------*/
WRITE8_MEMBER(nes_ntdec_asder_device::write_h)
{
LOG_MMC(("ntdec_asder write_h, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x0000:
m_latch = data & 0x07;
break;
case 0x2000:
switch (m_latch)
{
case 0:
prg8_89(data);
break;
case 1:
prg8_ab(data);
break;
case 2:
data &= 0xfe;
chr1_0(data, CHRROM);
chr1_1(data + 1, CHRROM);
break;
case 3:
data &= 0xfe;
chr1_2(data, CHRROM);
chr1_3(data + 1, CHRROM);
break;
case 4:
chr1_4(data, CHRROM);
break;
case 5:
chr1_5(data, CHRROM);
break;
case 6:
chr1_6(data, CHRROM);
break;
case 7:
chr1_7(data, CHRROM);
break;
}
break;
case 0x6000:
set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
/*-------------------------------------------------
Bootleg Board by NTDEC for Fighting Hero
Games: Fighting Hero
Very simple mapper: writes to 0x6000-0x7fff swap PRG and
CHR banks.
iNES: mapper 193
In MESS: Supported.
-------------------------------------------------*/
WRITE8_MEMBER(nes_ntdec_fh_device::write_m)
{
LOG_MMC(("ntdec_fh write_m, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x03)
{
case 0:
chr4_0(data >> 2, CHRROM);
break;
case 1:
chr2_4(data >> 1, CHRROM);
break;
case 2:
chr2_6(data >> 1 , CHRROM);
break;
case 3:
prg8_89(data);
break;
}
}
|