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
|
// license:BSD-3-Clause
// copyright-holders: kmg, Fabio Priuli
/***********************************************************************************************************
NES/Famicom cartridge emulation for Sealie Computing and related PCBs
Here we emulate the following homebrew PCBs
* SEALIE RET-CUFROM [mapper 29]
* SEALIE UNROM 512 [mapper 30]
***********************************************************************************************************/
#include "emu.h"
#include "sealie.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_CUFROM, nes_cufrom_device, "nes_cufrom", "NES Cart Sealie RET-CUFROM PCB")
DEFINE_DEVICE_TYPE(NES_UNROM512, nes_unrom512_device, "nes_unrom512", "NES Cart Sealie UNROM 512 PCB")
nes_cufrom_device::nes_cufrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_CUFROM, tag, owner, clock)
{
}
nes_unrom512_device::nes_unrom512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_UNROM512, tag, owner, clock)
{
}
void nes_cufrom_device::pcb_reset()
{
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, CHRRAM);
}
void nes_unrom512_device::pcb_reset()
{
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, CHRRAM);
if (m_pcb_ctrl_mirror)
set_nt_mirroring(PPU_MIRROR_LOW);
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
/*-------------------------------------------------
Sealie RET-CUFROM board
Games: Glider (only?)
This homebrew mapper supports 8x16k PRG banks at 0x8000,
8k WRAM at 0x6000, and 4x8k VRAM banks. PRG is stored on
flash ROM, though unlike mapper 30 it doesn't appear to
be self-flashable, only through an external tool.
iNES: mapper 29
In MAME: Supported.
-------------------------------------------------*/
void nes_cufrom_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("cufrom write_h, offset: %04x, data: %02x\n", offset, data));
prg16_89ab((data >> 2) & 0x07);
chr8(data & 0x03, CHRRAM);
}
/*-------------------------------------------------
Sealie UNROM 512 board
Games: Battle Kid 1 & 2, E.T., many more
This board has several variations and jumper configurations.
Currently we only support the Sealie nonflashable config
with 32x16k PRG banks at 0x8000, 4x8k VRAM, and three
mirroring configs (H, V, or PCB selected 1-screen modes).
iNES: mapper 30
In MAME: Preliminary partial support.
-------------------------------------------------*/
void nes_unrom512_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("unrom512 write_h, offset: %04x, data: %02x\n", offset, data));
// this pcb is subject to bus conflict in its nonflashable configuration
data = account_bus_conflict(offset, data);
if (m_pcb_ctrl_mirror)
set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
prg16_89ab(data & 0x1f);
chr8((data >> 5) & 0x03, CHRRAM);
}
|