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
|
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***********************************************************************************************************
NES/Famicom cartridge emulation for HES PCBs
Here we emulate the HES PCBs (both the one with hardwired mirroring and the one with mapper-controlled
mirroring used by HES 6 in 1) [mapper 113]
***********************************************************************************************************/
#include "emu.h"
#include "hes.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
//-------------------------------------------------
DEFINE_DEVICE_TYPE(NES_HES, nes_hes_device, "nes_hes", "NES Cart HES PCB")
nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_HES, tag, owner, clock)
{
}
void nes_hes_device::device_start()
{
common_start();
}
void nes_hes_device::pcb_reset()
{
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32(0);
chr8(0, m_chr_source);
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
/*-------------------------------------------------
Bootleg Board by HES (also used by others)
Games: AV Hanafuda Club, AV Soccer, Papillon, Sidewinder,
Total Funpack
Actually, two variant: one for HES 6-in-1 with mirroring control
and one for AV Soccer and others with hardwired mirroring
iNES: mapper 113
In MESS: Supported.
-------------------------------------------------*/
WRITE8_MEMBER(nes_hes_device::write_l)
{
LOG_MMC(("hes write_l, offset: %04x, data: %02x\n", offset, data));
if (!(offset & 0x100))
{
prg32((data & 0x38) >> 3);
chr8((data & 0x07) | ((data & 0x40) >> 3), CHRROM);
if (m_pcb_ctrl_mirror)
set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}
|