mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
bus/nes: Rewrote CONY/YOKO boards. (#9143)
- Consolidated all common functionality into base class. - Split off variants based on CHR banking size (CONY) and address line changes (YOKO). - Properly handle backup RAM for Dragon Ball Party multicart. - Removed deprecated hold_irq_line. New working software list additions (nes.xml) ----------------------------------- Street Blaster IV Pro 10 (Asia) [anonymous]
This commit is contained in:
parent
a30ac9e746
commit
63a372ddf5
61
hash/nes.xml
61
hash/nes.xml
@ -63515,7 +63515,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
|
||||
<publisher><unknown></publisher>
|
||||
<info name="alt_title" value="Dragon Ball Party?"/>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="1048576">
|
||||
<rom name="dragon ball party [p1].chr" size="1048576" crc="1f817045" sha1="5a66a033046ceec9f98a3b6fef5f108e840e6fc8" offset="00000" status="baddump" />
|
||||
@ -63523,9 +63523,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
|
||||
<dataarea name="prg" size="1048576">
|
||||
<rom name="dragon ball party [p1].prg" size="1048576" crc="5721089a" sha1="af8df8dd9449d512c34deddee2a758ca46677bd5" offset="00000" status="baddump" />
|
||||
</dataarea>
|
||||
<!-- 8k WRAM on cartridge, battery backed up -->
|
||||
<dataarea name="bwram" size="8192">
|
||||
<rom value="0x00" size="8192" offset="0" loadflag="fill" />
|
||||
<!-- 32k WRAM on cartridge, battery backed up -->
|
||||
<dataarea name="bwram" size="32768">
|
||||
<rom value="0x00" size="32768" offset="0" loadflag="fill" />
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
@ -77409,12 +77409,12 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="garou2" cloneof="fatfury2" supported="partial">
|
||||
<software name="garou2" cloneof="fatfury2">
|
||||
<description>Garou Densetsu 2 (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="fatal fury 2 (unl) [a1].chr" size="262144" crc="4d37e840" sha1="692e8929ef7bc6356b518f4150f3453c2bfe5223" offset="00000" status="baddump" />
|
||||
@ -77425,12 +77425,12 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="fatfury2" supported="partial">
|
||||
<software name="fatfury2">
|
||||
<description>Fatal Fury 2 (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="fatal fury 2 (unl).chr" size="262144" crc="d0aa6ce8" sha1="d78b8f163a452bae5e2e9fdcc513a80a4b6b3e71" offset="00000" status="baddump" />
|
||||
@ -77445,12 +77445,12 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="fatfury2a" cloneof="fatfury2" supported="partial">
|
||||
<software name="fatfury2a" cloneof="fatfury2">
|
||||
<description>Fatal Fury 2' (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="fatal fury 2' (unl).chr" size="262144" crc="58acf414" sha1="d5a2eb44b0f50554cd5daa39a82eaaf95f3ae53d" offset="00000" status="baddump" />
|
||||
@ -77655,7 +77655,7 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="mstrfgt6" supported="partial">
|
||||
<software name="mstrfgt6">
|
||||
<description>Master Fighter VI' (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Yoko</publisher>
|
||||
@ -78050,7 +78050,7 @@ be better to redump them properly. -->
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="street blaster ii pro (unl).chr" size="262144" crc="0f4ec1ae" sha1="f500133af4ae4988a5f2b2859f46afca97df43ea" offset="00000" status="baddump" />
|
||||
@ -78061,12 +78061,29 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="strblst4">
|
||||
<description>Street Blaster IV Pro 10 (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="prg" size="131072">
|
||||
<rom name="street blaster iv pro 10 (ymh-sn2) (unl).prg" size="131072" crc="0af8c9fd" sha1="184af79064c078101de8c09b3d76d0babf182818" status="baddump" />
|
||||
</dataarea>
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="street blaster iv pro 10 (ymh-sn2) (unl).chr" size="262144" crc="73c30ae1" sha1="da0c88cf43da96812949820ee3e7315ab5aa4b1e" status="baddump" />
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<!-- FIXME: Title screen gfx corruption is due to unimplemented jumper setting -->
|
||||
<software name="strblst5" supported="partial">
|
||||
<description>Street Blaster V Turbo 20 (Asia, 20 characters)</description>
|
||||
<year>19??</year>
|
||||
<publisher><unknown></publisher>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="street blaster v turbo 20 (unl).chr" size="262144" crc="27a81888" sha1="5cdb53c0f88032895157a61b53fa7a658062207f" offset="00000" status="baddump" />
|
||||
@ -78257,9 +78274,9 @@ be better to redump them properly. -->
|
||||
<software name="sfxt">
|
||||
<description>Street Fighter X Turbo 40 (Asia)</description>
|
||||
<year>1993</year>
|
||||
<publisher>Cony</publisher>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="slot" value="cony1k" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
<dataarea name="chr" size="262144">
|
||||
<rom name="street fighter x turbo 40 (unl).chr" size="262144" crc="8b7a77fc" sha1="bbe096be5e65fb16252c2e16973fbe1d4e3c6e48" offset="00000" status="baddump" />
|
||||
@ -78305,8 +78322,8 @@ be better to redump them properly. -->
|
||||
|
||||
<software name="supblst7">
|
||||
<description>Super Blaster VII Turbo 28 (Asia)</description>
|
||||
<year>19??</year>
|
||||
<publisher><unknown></publisher>
|
||||
<year>1993</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
<feature name="pcb" value="UNL-CONY" />
|
||||
@ -78717,7 +78734,7 @@ be better to redump them properly. -->
|
||||
|
||||
<software name="wh2">
|
||||
<description>World Heroes 2 (Asia)</description>
|
||||
<year>19??</year>
|
||||
<year>1994</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
@ -78735,9 +78752,9 @@ be better to redump them properly. -->
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="wh2pro">
|
||||
<software name="wh2pro" cloneof="wh2">
|
||||
<description>World Heroes 2 Pro (Asia)</description>
|
||||
<year>19??</year>
|
||||
<year>1994</year>
|
||||
<publisher>Cony Soft</publisher>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="cony" />
|
||||
|
@ -9,9 +9,7 @@
|
||||
Here we emulate the following PCBs
|
||||
|
||||
* UNL-CONY [mapper 83]
|
||||
* UNL-YOKO
|
||||
|
||||
TODO: fix glitches and emulate properly the variants
|
||||
* UNL-YOKO [mapper 264]
|
||||
|
||||
***********************************************************************************************************/
|
||||
|
||||
@ -33,28 +31,35 @@
|
||||
// constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
DEFINE_DEVICE_TYPE(NES_CONY, nes_cony_device, "nes_cony", "NES Cart Cony PCB")
|
||||
DEFINE_DEVICE_TYPE(NES_YOKO, nes_yoko_device, "nes_yoko", "NES Cart Yoko PCB")
|
||||
DEFINE_DEVICE_TYPE(NES_CONY, nes_cony_device, "nes_cony", "NES Cart Cony PCB")
|
||||
DEFINE_DEVICE_TYPE(NES_CONY1K, nes_cony1k_device, "nes_cony1k", "NES Cart Cony 1K PCB")
|
||||
DEFINE_DEVICE_TYPE(NES_YOKO, nes_yoko_device, "nes_yoko", "NES Cart Yoko PCB")
|
||||
|
||||
|
||||
nes_cony_device::nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
nes_cony_device::nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
|
||||
: nes_nrom_device(mconfig, type, tag, owner, clock)
|
||||
, m_irq_count(0)
|
||||
, m_irq_enable(0)
|
||||
, irq_timer(nullptr)
|
||||
, m_latch1(0)
|
||||
, m_latch2(0)
|
||||
, m_extra1(0)
|
||||
, m_extra_addr(type == NES_YOKO ? 0x1400 : 0x1100)
|
||||
, m_mask(type == NES_YOKO ? 0x0f : 0x1f)
|
||||
, m_mode_reg(0)
|
||||
, m_outer_reg(0)
|
||||
{
|
||||
}
|
||||
|
||||
nes_cony_device::nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
nes_cony_device::nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: nes_cony_device(mconfig, NES_CONY, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
nes_yoko_device::nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: nes_cony_device(mconfig, NES_YOKO, tag, owner, clock), m_extra2(0)
|
||||
nes_cony1k_device::nes_cony1k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: nes_cony_device(mconfig, NES_CONY1K, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
nes_yoko_device::nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: nes_cony_device(mconfig, NES_YOKO, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
@ -70,72 +75,30 @@ void nes_cony_device::device_start()
|
||||
save_item(NAME(m_irq_enable));
|
||||
save_item(NAME(m_irq_count));
|
||||
|
||||
save_item(NAME(m_low_reg));
|
||||
save_item(NAME(m_reg));
|
||||
save_item(NAME(m_extra1));
|
||||
save_item(NAME(m_latch1));
|
||||
save_item(NAME(m_latch2));
|
||||
save_item(NAME(m_mmc_prg_bank));
|
||||
save_item(NAME(m_mmc_vrom_bank));
|
||||
save_item(NAME(m_extra_ram));
|
||||
save_item(NAME(m_mode_reg));
|
||||
save_item(NAME(m_outer_reg));
|
||||
}
|
||||
|
||||
void nes_cony_device::pcb_reset()
|
||||
{
|
||||
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
|
||||
prg16_89ab(0);
|
||||
prg8_cd(0x1e);
|
||||
prg8_ef(0x1f);
|
||||
chr8(0, m_chr_source);
|
||||
prg16_cdef(m_prg_chunks - 1);
|
||||
chr8(0, CHRROM);
|
||||
|
||||
m_irq_enable = 0;
|
||||
m_irq_count = 0;
|
||||
|
||||
m_latch1 = 0;
|
||||
m_latch2 = 0;
|
||||
m_extra1 = 0;
|
||||
m_mode_reg = 0;
|
||||
m_outer_reg = 0;
|
||||
|
||||
memset(m_low_reg, 0, sizeof(m_low_reg));
|
||||
memset(m_reg, 0, sizeof(m_reg));
|
||||
m_reg[9] = 0x0f;
|
||||
std::fill(std::begin(m_extra_ram), std::end(m_extra_ram), 0x00);
|
||||
std::fill(std::begin(m_mmc_prg_bank), std::end(m_mmc_prg_bank), 0x00);
|
||||
std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00);
|
||||
}
|
||||
|
||||
void nes_yoko_device::device_start()
|
||||
{
|
||||
common_start();
|
||||
irq_timer = timer_alloc(TIMER_IRQ);
|
||||
irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1));
|
||||
|
||||
save_item(NAME(m_irq_enable));
|
||||
save_item(NAME(m_irq_count));
|
||||
|
||||
save_item(NAME(m_low_reg));
|
||||
save_item(NAME(m_reg));
|
||||
save_item(NAME(m_extra1));
|
||||
save_item(NAME(m_extra2));
|
||||
save_item(NAME(m_latch1));
|
||||
save_item(NAME(m_latch2));
|
||||
}
|
||||
|
||||
void nes_yoko_device::pcb_reset()
|
||||
{
|
||||
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
|
||||
prg16_89ab(0);
|
||||
prg8_cd(0x1e);
|
||||
prg8_ef(0x1f);
|
||||
chr8(0, m_chr_source);
|
||||
|
||||
m_irq_enable = 0;
|
||||
m_irq_count = 0;
|
||||
|
||||
m_latch1 = 0;
|
||||
m_latch2 = 0;
|
||||
m_extra1 = 0;
|
||||
m_extra2 = 0;
|
||||
|
||||
memset(m_low_reg, 0, sizeof(m_low_reg));
|
||||
memset(m_reg, 0, sizeof(m_reg));
|
||||
m_reg[9] = 0x0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -162,150 +125,162 @@ void nes_cony_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
{
|
||||
if (m_irq_enable)
|
||||
{
|
||||
m_irq_count += BIT(m_mode_reg, 6) ? -1 : 1;
|
||||
if (!m_irq_count)
|
||||
{
|
||||
hold_irq_line();
|
||||
set_irq_line(ASSERT_LINE);
|
||||
m_irq_enable = 0;
|
||||
m_irq_count = 0xffff;
|
||||
}
|
||||
else
|
||||
m_irq_count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nes_cony_device::write_l(offs_t offset, uint8_t data)
|
||||
void nes_cony_device::write_l(offs_t offset, u8 data)
|
||||
{
|
||||
LOG_MMC(("cony write_l, offset: %04x, data: %02x\n", offset, data));
|
||||
|
||||
if (offset >= 0x1000 && offset < 0x1103) // from 0x5100-0x51ff
|
||||
m_low_reg[offset & 0x03] = data;
|
||||
offset += 0x100;
|
||||
if (offset >= m_extra_addr) // scratch ram from 0x5100 or 0x5400
|
||||
m_extra_ram[offset & 0x03] = data;
|
||||
}
|
||||
|
||||
uint8_t nes_cony_device::read_l(offs_t offset)
|
||||
u8 nes_cony_device::read_l(offs_t offset)
|
||||
{
|
||||
LOG_MMC(("cony read_l, offset: %04x\n", offset));
|
||||
|
||||
if (offset == 0x0f00) // 0x5000
|
||||
{
|
||||
// read dipswitch bit! - currently unimplemented
|
||||
}
|
||||
if (offset >= 0x1000 && offset < 0x1103) // from 0x5100-0x51ff
|
||||
return m_low_reg[offset & 0x03];
|
||||
offset += 0x100;
|
||||
if (offset >= m_extra_addr) // scratch ram from 0x5100 or 0x5400
|
||||
return m_extra_ram[offset & 0x03];
|
||||
else if (offset >= 0x1000) // 0x5000
|
||||
return m_extra_addr >> 10; // FIXME: this should be 2-bit jumper settings; certain games glitch with certain values here
|
||||
else
|
||||
return 0x00;
|
||||
return get_open_bus();
|
||||
}
|
||||
|
||||
void nes_cony_device::write_m(offs_t offset, u8 data)
|
||||
{
|
||||
LOG_MMC(("cony write_m, offset: %04x, data: %02x\n", offset, data));
|
||||
|
||||
if (!m_battery.empty())
|
||||
m_battery[((m_outer_reg >> 6) * 0x2000 + offset) & (m_battery.size() - 1)] = data;
|
||||
}
|
||||
|
||||
u8 nes_cony_device::read_m(offs_t offset)
|
||||
{
|
||||
LOG_MMC(("cony read_m, offset: %04x\n", offset));
|
||||
|
||||
if (!m_battery.empty())
|
||||
return m_battery[((m_outer_reg >> 6) * 0x2000 + offset) & (m_battery.size() - 1)];
|
||||
else if (BIT(m_mode_reg, 5))
|
||||
return m_prg[(m_mmc_prg_bank[3] * 0x2000 + offset) & (m_prg_size - 1)];
|
||||
else
|
||||
return get_open_bus();
|
||||
}
|
||||
|
||||
void nes_cony_device::set_prg()
|
||||
{
|
||||
prg16_89ab(m_reg[8] & 0x3f);
|
||||
prg16_cdef((m_reg[8] & 0x30) | 0x0f);
|
||||
switch (m_mode_reg & 0x18)
|
||||
{
|
||||
case 0x00:
|
||||
prg16_89ab(m_outer_reg);
|
||||
prg16_cdef(m_outer_reg | m_mask >> 1);
|
||||
break;
|
||||
case 0x08:
|
||||
prg32(m_outer_reg >> 1);
|
||||
break;
|
||||
case 0x10:
|
||||
case 0x18:
|
||||
{
|
||||
int base = (m_outer_reg << 1) & ~m_mask;
|
||||
prg8_89(base | (m_mmc_prg_bank[0] & m_mask));
|
||||
prg8_ab(base | (m_mmc_prg_bank[1] & m_mask));
|
||||
prg8_cd(base | (m_mmc_prg_bank[2] & m_mask));
|
||||
prg8_ef(base | m_mask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nes_cony_device::set_chr()
|
||||
{
|
||||
// FIXME: here we emulate at least 3 different boards!!!
|
||||
// one board switches 1k VROM banks only
|
||||
// one writes to 0x8000 and then switches 2k VROM banks only
|
||||
// one writes to 0x831n (n=2,3,4,5) and then switches 2k VROM banks only
|
||||
// we should split them and possibly document the proper behavior of each variant
|
||||
if (m_latch1 && !m_latch2)
|
||||
{
|
||||
chr2_0(m_reg[0], CHRROM);
|
||||
chr2_2(m_reg[1], CHRROM);
|
||||
chr2_4(m_reg[6], CHRROM);
|
||||
chr2_6(m_reg[7], CHRROM);
|
||||
}
|
||||
else
|
||||
{
|
||||
chr1_0(m_reg[0] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_1(m_reg[1] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_2(m_reg[2] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_3(m_reg[3] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_4(m_reg[4] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_5(m_reg[5] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_6(m_reg[6] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
chr1_7(m_reg[7] | ((m_reg[8] & 0x30) << 4), CHRROM);
|
||||
}
|
||||
chr2_0(m_mmc_vrom_bank[0], CHRROM);
|
||||
chr2_2(m_mmc_vrom_bank[1], CHRROM);
|
||||
chr2_4(m_mmc_vrom_bank[6], CHRROM);
|
||||
chr2_6(m_mmc_vrom_bank[7], CHRROM);
|
||||
}
|
||||
|
||||
void nes_cony_device::write_h(offs_t offset, uint8_t data)
|
||||
void nes_cony_device::write_h(offs_t offset, u8 data)
|
||||
{
|
||||
LOG_MMC(("cony write_h, offset: %04x, data: %02x\n", offset, data));
|
||||
|
||||
switch (offset)
|
||||
switch (offset & 0x0300)
|
||||
{
|
||||
case 0x0000:
|
||||
m_latch1 = 1;
|
||||
[[fallthrough]];
|
||||
case 0x3000:
|
||||
case 0x30ff:
|
||||
case 0x31ff:
|
||||
m_reg[8] = data;
|
||||
m_outer_reg = data;
|
||||
set_prg();
|
||||
set_chr();
|
||||
break;
|
||||
case 0x0100:
|
||||
m_extra1 = data & 0x80;
|
||||
m_mode_reg = data;
|
||||
set_prg();
|
||||
switch (data & 0x03)
|
||||
{
|
||||
case 0:
|
||||
set_nt_mirroring(PPU_MIRROR_VERT);
|
||||
break;
|
||||
case 1:
|
||||
set_nt_mirroring(PPU_MIRROR_HORZ);
|
||||
break;
|
||||
case 2:
|
||||
set_nt_mirroring(PPU_MIRROR_LOW);
|
||||
break;
|
||||
case 3:
|
||||
set_nt_mirroring(PPU_MIRROR_HIGH);
|
||||
break;
|
||||
case 0: set_nt_mirroring(PPU_MIRROR_VERT); break;
|
||||
case 1: set_nt_mirroring(PPU_MIRROR_HORZ); break;
|
||||
case 2: set_nt_mirroring(PPU_MIRROR_LOW); break;
|
||||
case 3: set_nt_mirroring(PPU_MIRROR_HIGH); break;
|
||||
}
|
||||
break;
|
||||
case 0x0200:
|
||||
m_irq_count = (m_irq_count & 0xff00) | data;
|
||||
break;
|
||||
case 0x0201:
|
||||
m_irq_enable = m_extra1;
|
||||
m_irq_count = (data << 8) | (m_irq_count & 0xff);
|
||||
if (offset & 1)
|
||||
{
|
||||
m_irq_enable = BIT(m_mode_reg, 7);
|
||||
m_irq_count = data << 8 | (m_irq_count & 0x00ff);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_irq_count = (m_irq_count & 0xff00) | data;
|
||||
set_irq_line(CLEAR_LINE);
|
||||
}
|
||||
break;
|
||||
case 0x0300:
|
||||
prg8_89(data);
|
||||
break;
|
||||
case 0x0301:
|
||||
prg8_ab(data);
|
||||
break;
|
||||
case 0x0302:
|
||||
prg8_cd(data);
|
||||
break;
|
||||
case 0x0312:
|
||||
case 0x0313:
|
||||
case 0x0314:
|
||||
case 0x0315:
|
||||
m_latch2 = 1;
|
||||
[[fallthrough]];
|
||||
case 0x0310:
|
||||
case 0x0311:
|
||||
case 0x0316:
|
||||
case 0x0317:
|
||||
m_reg[offset - 0x0310] = data;
|
||||
set_chr();
|
||||
break;
|
||||
case 0x0318:
|
||||
m_reg[9] = data; // unused?
|
||||
set_prg();
|
||||
switch (offset & 0x18)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x08:
|
||||
m_mmc_prg_bank[offset & 3] = data;
|
||||
set_prg();
|
||||
break;
|
||||
case 0x10:
|
||||
m_mmc_vrom_bank[offset & 7] = data;
|
||||
set_chr();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
||||
Cony Bootleg Board alternate 1K CHR banking
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
void nes_cony1k_device::set_chr()
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
chr1_x(i, m_mmc_vrom_bank[i] | (m_outer_reg & 0x30) << 4, CHRROM);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
||||
Yoko Bootleg Board
|
||||
|
||||
Games: Mortal Kombat II, Master Figther VI'
|
||||
Games: Mortal Kombat II, Master Fighter VI'
|
||||
|
||||
Very similar to Cony board
|
||||
Seems to be the same as the Cony board (2K CHR
|
||||
banking version) but with address lines A10/A11
|
||||
swapped in for Cony address lines A8/A9.
|
||||
|
||||
NES 2.0: mapper 264
|
||||
|
||||
@ -313,92 +288,10 @@ void nes_cony_device::write_h(offs_t offset, uint8_t data)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
void nes_yoko_device::write_l(offs_t offset, uint8_t data)
|
||||
{
|
||||
LOG_MMC(("yoko write_l, offset: %04x, data: %02x\n", offset, data));
|
||||
|
||||
if (offset >= 0x1300) // from 0x5400
|
||||
m_low_reg[offset & 0x03] = data;
|
||||
}
|
||||
|
||||
uint8_t nes_yoko_device::read_l(offs_t offset)
|
||||
{
|
||||
LOG_MMC(("yoko read_l, offset: %04x\n", offset));
|
||||
|
||||
if (offset >= 0x0f00 && offset < 0x1300) // 0x5000
|
||||
{
|
||||
// read dipswitch bit! - currently unimplemented
|
||||
}
|
||||
if (offset >= 0x1300) // from 0x5400
|
||||
return m_low_reg[offset & 0x03];
|
||||
else
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
void nes_yoko_device::set_prg()
|
||||
{
|
||||
if (m_extra1 & 0x10)
|
||||
{
|
||||
int base = (m_extra2 & 0x08) << 1;
|
||||
prg8_89(base | (m_reg[0] & 0x0f));
|
||||
prg8_ab(base | (m_reg[1] & 0x0f));
|
||||
prg8_cd(base | (m_reg[2] & 0x0f));
|
||||
prg8_ef(base | 0x0f);
|
||||
}
|
||||
else if (m_extra1 & 0x08)
|
||||
prg32(m_extra2 >> 1);
|
||||
else
|
||||
{
|
||||
prg16_89ab(m_extra2);
|
||||
prg16_cdef(0xff);
|
||||
}
|
||||
}
|
||||
|
||||
void nes_yoko_device::set_chr()
|
||||
{
|
||||
chr2_0(m_reg[4], CHRROM);
|
||||
chr2_2(m_reg[5], CHRROM);
|
||||
chr2_4(m_reg[6], CHRROM);
|
||||
chr2_6(m_reg[7], CHRROM);
|
||||
}
|
||||
|
||||
void nes_yoko_device::write_h(offs_t offset, uint8_t data)
|
||||
void nes_yoko_device::write_h(offs_t offset, u8 data)
|
||||
{
|
||||
LOG_MMC(("yoko write_h, offset: %04x, data: %02x\n", offset, data));
|
||||
|
||||
switch (offset & 0x0c17)
|
||||
{
|
||||
case 0x0000:
|
||||
m_extra2 = data;
|
||||
set_prg();
|
||||
break;
|
||||
case 0x400:
|
||||
m_extra1 = data;
|
||||
if (data & 1)
|
||||
set_nt_mirroring(PPU_MIRROR_HORZ);
|
||||
else
|
||||
set_nt_mirroring(PPU_MIRROR_VERT);
|
||||
set_prg();
|
||||
break;
|
||||
case 0x0800:
|
||||
m_irq_count = (m_irq_count & 0xff00) | data;
|
||||
break;
|
||||
case 0x0801:
|
||||
m_irq_enable = m_extra1 & 0x80;
|
||||
m_irq_count = (data << 8) | (m_irq_count & 0xff);
|
||||
break;
|
||||
case 0x0c00:
|
||||
case 0x0c01:
|
||||
case 0x0c02:
|
||||
m_reg[offset & 3] = data;
|
||||
set_prg();
|
||||
break;
|
||||
case 0x0c10:
|
||||
case 0x0c11:
|
||||
case 0x0c16:
|
||||
case 0x0c17:
|
||||
m_reg[4 + (offset & 3)] = data;
|
||||
set_chr();
|
||||
break;
|
||||
}
|
||||
offset = (offset & 0xf0ff) | (offset & 0x0c00) >> 2;
|
||||
nes_cony_device::write_h(offset, data);
|
||||
}
|
||||
|
@ -14,18 +14,19 @@ class nes_cony_device : public nes_nrom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual uint8_t read_l(offs_t offset) override;
|
||||
virtual void write_l(offs_t offset, uint8_t data) override;
|
||||
virtual void write_h(offs_t offset, uint8_t data) override;
|
||||
virtual u8 read_l(offs_t offset) override;
|
||||
virtual u8 read_m(offs_t offset) override;
|
||||
virtual void write_l(offs_t offset, u8 data) override;
|
||||
virtual void write_m(offs_t offset, u8 data) override;
|
||||
virtual void write_h(offs_t offset, u8 data) override;
|
||||
|
||||
virtual void pcb_reset() override;
|
||||
|
||||
protected:
|
||||
static constexpr device_timer_id TIMER_IRQ = 0;
|
||||
|
||||
nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
// construction/destruction
|
||||
nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -34,15 +35,31 @@ protected:
|
||||
virtual void set_prg();
|
||||
virtual void set_chr();
|
||||
|
||||
uint16_t m_irq_count;
|
||||
u16 m_irq_count;
|
||||
int m_irq_enable;
|
||||
|
||||
static constexpr device_timer_id TIMER_IRQ = 0;
|
||||
emu_timer *irq_timer;
|
||||
|
||||
uint8_t m_latch1, m_latch2;
|
||||
uint8_t m_low_reg[4];
|
||||
uint8_t m_reg[10];
|
||||
uint8_t m_extra1;
|
||||
u8 m_mmc_prg_bank[4];
|
||||
u8 m_mmc_vrom_bank[8];
|
||||
u8 m_extra_ram[4];
|
||||
u16 m_extra_addr;
|
||||
u8 m_mask;
|
||||
u8 m_mode_reg;
|
||||
u8 m_outer_reg;
|
||||
};
|
||||
|
||||
|
||||
// ======================> nes_cony1k_device
|
||||
|
||||
class nes_cony1k_device : public nes_cony_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nes_cony1k_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual void set_chr() override;
|
||||
};
|
||||
|
||||
|
||||
@ -52,28 +69,15 @@ class nes_yoko_device : public nes_cony_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual uint8_t read_l(offs_t offset) override;
|
||||
virtual void write_l(offs_t offset, uint8_t data) override;
|
||||
virtual void write_h(offs_t offset, uint8_t data) override;
|
||||
|
||||
virtual void pcb_reset() override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
virtual void set_prg() override;
|
||||
virtual void set_chr() override;
|
||||
|
||||
uint8_t m_extra2;
|
||||
virtual void write_h(offs_t offset, u8 data) override;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NES_CONY, nes_cony_device)
|
||||
DECLARE_DEVICE_TYPE(NES_YOKO, nes_yoko_device)
|
||||
DECLARE_DEVICE_TYPE(NES_CONY, nes_cony_device)
|
||||
DECLARE_DEVICE_TYPE(NES_CONY1K, nes_cony1k_device)
|
||||
DECLARE_DEVICE_TYPE(NES_YOKO, nes_yoko_device)
|
||||
|
||||
#endif // MAME_BUS_NES_CONY_H
|
||||
|
@ -251,6 +251,7 @@ void nes_cart(device_slot_interface &device)
|
||||
device.option_add_internal("waixing_sh2", NES_WAIXING_SH2);
|
||||
device.option_add_internal("fs304", NES_WAIXING_FS304); // used in Zelda 3 by Waixing
|
||||
device.option_add_internal("cony", NES_CONY);
|
||||
device.option_add_internal("cony1k", NES_CONY1K);
|
||||
device.option_add_internal("yoko", NES_YOKO);
|
||||
device.option_add_internal("hengg_srich", NES_HENGG_SRICH);
|
||||
device.option_add_internal("hengg_xhzs", NES_HENGG_XHZS);
|
||||
|
@ -961,6 +961,11 @@ void nes_cart_slot_device::call_load_ines()
|
||||
m_cart->set_pcb_ctrl_mirror(true);
|
||||
break;
|
||||
|
||||
case CONY_BOARD:
|
||||
if (submapper == 0 || submapper == 2)
|
||||
pcb_id = CONY1K_BOARD;
|
||||
break;
|
||||
|
||||
case UNL_LH28_LH54:
|
||||
if (vrom_size)
|
||||
m_pcb_id = (vrom_size == 0x4000) ? UNL_LE05 : UNL_LH31;
|
||||
@ -1309,6 +1314,11 @@ const char * nes_cart_slot_device::get_default_card_ines(get_default_card_softwa
|
||||
pcb_id = BTL_AISENSHINICOL; // Mapper 42 is used for 2 diff boards
|
||||
break;
|
||||
|
||||
case CONY_BOARD:
|
||||
if (submapper == 0 || submapper == 2)
|
||||
pcb_id = CONY1K_BOARD; // Mapper 83 is used for 3 diff boards
|
||||
break;
|
||||
|
||||
case UNL_LH28_LH54: // Mapper 108 is used for 4 diff boards
|
||||
if (ROM[5])
|
||||
pcb_id = (ROM[5] == 2) ? UNL_LE05 : UNL_LH31;
|
||||
|
@ -159,6 +159,7 @@ static const nes_pcb pcb_list[] =
|
||||
{ "waixing_sh2", WAIXING_SH2 },
|
||||
{ "fs304", WAIXING_FS304 }, // used in Zelda 3 by Waixing
|
||||
{ "cony", CONY_BOARD },
|
||||
{ "cony1k", CONY1K_BOARD },
|
||||
{ "yoko", YOKO_BOARD },
|
||||
{ "hengg_srich", HENGG_SRICH },
|
||||
{ "hengg_xhzs", HENGG_XHZS },
|
||||
|
@ -136,7 +136,7 @@ enum
|
||||
OPENCORP_DAOU306, HES_BOARD, SVISION16_BOARD, RUMBLESTATION_BOARD, JYCOMPANY_A, JYCOMPANY_B, JYCOMPANY_C,
|
||||
MAGICSERIES_MD, KASING_BOARD, FUTUREMEDIA_BOARD, FUKUTAKE_BOARD, SOMARI_SL12, SOMARI_HUANG2,
|
||||
HENGG_SRICH, HENGG_XHZS, HENGG_SHJY3, SUBOR_TYPE0, SUBOR_TYPE1, SUBOR_TYPE2,
|
||||
CNE_DECATHLON, CNE_FSB, CNE_SHLZ, COCOMA_BOARD, CONY_BOARD, SMD133_BOARD, YOKO_BOARD,
|
||||
CNE_DECATHLON, CNE_FSB, CNE_SHLZ, COCOMA_BOARD, CONY_BOARD, CONY1K_BOARD, SMD133_BOARD, YOKO_BOARD,
|
||||
RCM_GS2015, RCM_GS2004, RCM_GS2013, RCM_TF9IN1, RCM_3DBLOCK,
|
||||
WAIXING_TYPE_A, WAIXING_TYPE_A1, WAIXING_TYPE_B, WAIXING_TYPE_C, WAIXING_TYPE_D,
|
||||
WAIXING_TYPE_E, WAIXING_TYPE_F, WAIXING_TYPE_G, WAIXING_TYPE_H, WAIXING_TYPE_H1,
|
||||
|
Loading…
Reference in New Issue
Block a user