bus/nes: Improved NTDEC cartridge support. (#8239)

Software list items promoted to working
-----------------------------
Fighting Hero (Asia)
Fighting Hero III (Asia)
This commit is contained in:
0kmg 2021-08-09 08:55:31 -08:00 committed by GitHub
parent 192509a8c3
commit 99f0f69c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 123 additions and 65 deletions

View File

@ -53470,7 +53470,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<!-- NTDEC / Gluk Video (the latter company being a Spanish importer?) -->
<software name="fighther" supported="no">
<software name="fighther">
<description>Fighting Hero (Asia)</description>
<year>1991</year>
<publisher>Mega Soft</publisher>
@ -53708,6 +53708,25 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<!-- Dump not available. Game is also in 9in1cal.
<software name="supergun">
<description>Super Gun (Asia)</description>
<year>1992</year>
<publisher>Caltron</publisher>
<info name="serial" value="CN-12"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="ntdec_n715021" />
<feature name="mirroring" value="horizontal" />
<dataarea name="prg" size="65536">
<rom name="prg.u1" size="65536" crc="" sha1="" status="nodump" />
</dataarea>
<dataarea name="chr" size="32768">
<rom name="chr.u2" size="32768" crc="" sha1="" status="nodump" />
</dataarea>
</part>
</software>
-->
<software name="destroyr">
<description>Destroyer (Spa)</description>
<year>1992</year>
@ -53819,7 +53838,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<software name="fighthr3" supported="no">
<software name="fighthr3">
<description>Fighting Hero III (Asia)</description>
<year>1993</year>
<publisher>NTDEC</publisher>
@ -53893,6 +53912,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<feature name="slot" value="ntdec_asder" />
<feature name="pcb" value="NTDEC-112" />
<feature name="mirroring" value="vertical" />
<feature name="peripheral" value="zapper" />
<dataarea name="chr" size="32768">
<rom name="master shooter (asia) (unl).chr" size="32768" crc="b2faa272" sha1="d7c69d6fe8367b4950ca330e6892183331ffe8be" offset="00000" status="baddump" />
</dataarea>

View File

@ -196,6 +196,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("nanjing", NES_NANJING); // mapper 163
device.option_add_internal("ntdec_asder", NES_NTDEC_ASDER); // mapper 112
device.option_add_internal("ntdec_fh", NES_NTDEC_FH); // mapper 193
device.option_add_internal("ntdec_n715021", NES_NTDEC_N715021); // mapper 81
device.option_add_internal("jyc_a", NES_JY_TYPEA); // mapper 90
device.option_add_internal("jyc_b", NES_JY_TYPEB); // mapper 211
device.option_add_internal("jyc_c", NES_JY_TYPEC); // mapper 209

View File

@ -113,7 +113,7 @@ static const nes_mmc mmc_list[] =
{ 78, IREM_HOLYDIVR },
{ 79, AVE_NINA06 },
{ 80, TAITO_X1_005 },
// 81 NTDEC's Super Gun. Dump available?
{ 81, NTDEC_N715021 }, // 81 Super Gun
{ 82, TAITO_X1_017 },
{ 83, CONY_BOARD },
// 84 Pasofami hacked images?

View File

@ -110,6 +110,7 @@ static const nes_pcb pcb_list[] =
{ "nanjing", NANJING_BOARD }, // mapper 163
{ "ntdec_asder", NTDEC_ASDER }, // mapper 112
{ "ntdec_fh", NTDEC_FIGHTINGHERO }, // mapper 193
{ "ntdec_n715021", NTDEC_N715021 }, // mapper 81
{ "sa009", SACHEN_SA009 },
{ "sa0036", SACHEN_SA0036 },
{ "sa0037", SACHEN_SA0037 },

View File

@ -65,7 +65,7 @@ enum
NAMCOT_163, NAMCOT_175, NAMCOT_340,
NAMCOT_3425, NAMCOT_34X3, NAMCOT_3446,
/* NTDEC */
NTDEC_ASDER, NTDEC_FIGHTINGHERO,
NTDEC_ASDER, NTDEC_FIGHTINGHERO, NTDEC_N715021,
/* Rex Soft */
REXSOFT_SL1632, REXSOFT_DBZ5,
/* Sachen */

View File

@ -10,9 +10,10 @@
* NTDEC ASDER [mapper 112]
* NTDEC Fighting Hero [mapper 193]
* NTDEC N715021 [mapper 81]
TODO:
- why is Master Shooter not working?
- why is Master Shooter not working? (correctly aimed shots score as a hit on random targets)
***********************************************************************************************************/
@ -34,21 +35,26 @@
// constructor
//-------------------------------------------------
DEFINE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device, "nes_ntdec_asder", "NES Cart NTDEC Asder PCB")
DEFINE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device, "nes_fh_asder", "NES Cart NTDEC Fighting Hero PCB")
DEFINE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device, "nes_ntdec_asder", "NES Cart NTDEC Asder PCB")
DEFINE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device, "nes_ntdec_fh", "NES Cart NTDEC Fighting Hero PCB")
DEFINE_DEVICE_TYPE(NES_NTDEC_N715021, nes_ntdec_n715021_device, "nes_ntdec_n715021", "NES Cart NTDEC N715021 PCB")
nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_nrom_device(mconfig, NES_NTDEC_ASDER, tag, owner, clock)
, m_latch(0)
nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_NTDEC_ASDER, tag, owner, clock) , m_latch(0), m_chr_outer(0)
{
}
nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_NTDEC_FH, tag, owner, clock)
{
}
nes_ntdec_n715021_device::nes_ntdec_n715021_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_NTDEC_N715021, tag, owner, clock)
{
}
@ -56,32 +62,32 @@ void nes_ntdec_asder_device::device_start()
{
common_start();
save_item(NAME(m_latch));
save_item(NAME(m_chr_outer));
}
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);
chr8(0, CHRROM);
m_latch = 0;
}
void nes_ntdec_fh_device::device_start()
{
common_start();
m_chr_outer = 0;
}
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);
chr8(0, CHRROM);
set_nt_mirroring(PPU_MIRROR_VERT);
}
void nes_ntdec_n715021_device::pcb_reset()
{
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, CHRROM);
}
@ -96,17 +102,25 @@ void nes_ntdec_fh_device::pcb_reset()
Games: Cobra Mission, Fighting Hero III, Huang Di, Master
Shooter
This board supports swappable 8K PRG banks at 0x8000 and
0xa000 via 2 registers. 16K above is fixed. CHR ROM is
selected by 6 registers: 2x2K for the first two, and 4x1K
for the remaining 4. The former can only address 256K of
CHR while the latter combines with latch at 0xc000 to
span 512K. Registers are not directly written to but
selected at 0x8000.
iNES: mapper 112
In MESS: Supported.
In MAME: Supported.
-------------------------------------------------*/
void nes_ntdec_asder_device::write_h(offs_t offset, uint8_t data)
void nes_ntdec_asder_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("ntdec_asder write_h, offset: %04x, data: %02x\n", offset, data));
switch (offset)
switch (offset & 0x6001) // writes only at even addresses?
{
case 0x0000:
m_latch = data & 0x07;
@ -114,36 +128,21 @@ void nes_ntdec_asder_device::write_h(offs_t offset, uint8_t data)
case 0x2000:
switch (m_latch)
{
case 0:
prg8_89(data);
case 0: case 1:
prg8_x(m_latch, data);
break;
case 1:
prg8_ab(data);
case 2: case 3:
chr2_x((m_latch & 0x01) << 1, data >> 1, CHRROM);
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);
case 4: case 5: case 6: case 7:
u16 high = BIT(m_chr_outer, m_latch) << 8;
chr1_x(m_latch, high | data, CHRROM);
break;
}
break;
case 0x4000:
m_chr_outer = data;
break;
case 0x6000:
set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
@ -154,22 +153,23 @@ void nes_ntdec_asder_device::write_h(offs_t offset, uint8_t data)
Bootleg Board by NTDEC for Fighting Hero
Games: Fighting Hero
Games: Fighting Hero, War in the Gulf
Very simple mapper: writes to 0x6000-0x7fff swap PRG and
CHR banks.
CHR banks. The mirroring register at 0x6004 appears to
not be used by any known software?
iNES: mapper 193
In MESS: Supported.
In MAME: Supported.
-------------------------------------------------*/
void nes_ntdec_fh_device::write_m(offs_t offset, uint8_t data)
void nes_ntdec_fh_device::write_m(offs_t offset, u8 data)
{
LOG_MMC(("ntdec_fh write_m, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x03)
switch (offset & 0x07)
{
case 0:
chr4_0(data >> 2, CHRROM);
@ -181,7 +181,32 @@ void nes_ntdec_fh_device::write_m(offs_t offset, uint8_t data)
chr2_6(data >> 1 , CHRROM);
break;
case 3:
prg8_89(data);
prg8_89(data & 0x0f);
break;
case 4:
set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
/*-------------------------------------------------
NTDEC Board N715021
Games: Super Gun
Very simple mapper: writes to 0x8000-0xffff swap PRG and
CHR banks. PCB also has a latch at 0x6000 but it is not used.
iNES: mapper 81
In MAME: Supported.
-------------------------------------------------*/
void nes_ntdec_n715021_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("ntdec_n715021 write_m, offset: %04x, data: %02x\n", offset, data));
prg16_89ab((offset >> 2) & 0x03);
chr8(offset & 0x03, CHRROM);
}

View File

@ -14,9 +14,9 @@ class nes_ntdec_asder_device : public nes_nrom_device
{
public:
// construction/destruction
nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_h(offs_t offset, uint8_t data) override;
virtual void write_h(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
@ -25,7 +25,7 @@ protected:
virtual void device_start() override;
private:
uint8_t m_latch;
u8 m_latch, m_chr_outer;
};
@ -35,20 +35,31 @@ class nes_ntdec_fh_device : public nes_nrom_device
{
public:
// construction/destruction
nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_m(offs_t offset, uint8_t data) override;
virtual void write_m(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
};
protected:
// device-level overrides
virtual void device_start() override;
// ======================> nes_ntdec_n715021_device
class nes_ntdec_n715021_device : public nes_nrom_device
{
public:
// construction/destruction
nes_ntdec_n715021_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual void write_h(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
};
// device type definition
DECLARE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device)
DECLARE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device)
DECLARE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device)
DECLARE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device)
DECLARE_DEVICE_TYPE(NES_NTDEC_N715021, nes_ntdec_n715021_device)
#endif // MAME_BUS_NES_NTDEC_H