bus/nes: Added support for a bootleg Sangokushi II cartridge. (#8615)

New working software list additions (nes.xml)
-----------------------------------
Sangokushi III - Haou no Tairiku (Asia, Sangokushi II pirate) [krzysiobal]
This commit is contained in:
0kmg 2021-09-25 21:12:08 -08:00 committed by GitHub
parent 2ee69b94fa
commit 2827239d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 135 additions and 5 deletions

View File

@ -64381,6 +64381,26 @@ We don't include these hacks because they were not burned into real carts nor so
</part>
</software>
<software name="sango3ht" cloneof="sango2ht">
<description>Sangokushi III - Haou no Tairiku (Asia, Sangokushi II pirate)</description>
<year>199?</year>
<publisher>&lt;pirate&gt;</publisher>
<info name="alt_title" value="三國志Ⅲ 覇王の大陸"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="l001" />
<feature name="pcb_model" value="L-001" />
<dataarea name="prg" size="262144">
<rom name="001" size="262144" crc="21491e8a" sha1="1b66d953f32d619b2c569c49ef8da5f8e96efcc6" status="baddump" />
</dataarea>
<dataarea name="chr" size="262144">
<rom name="002" size="262144" crc="1deb2eb6" sha1="76c7e47d32084b2a5a6e356ed426781292f85282" status="baddump" />
</dataarea>
<!-- 8k WRAM on cartridge -->
<dataarea name="wram" size="8192">
</dataarea>
</part>
</software>
<software name="sanguo2h">
<description>San Guo Zhi II (Chi)</description>
<year>19??</year>

View File

@ -53,6 +53,7 @@ DEFINE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device, "nes_smb2jb", "N
DEFINE_DEVICE_TYPE(NES_N32_4IN1, nes_n32_4in1_device, "nes_n32_4in1", "NES Cart N-32 4 in 1 PCB")
DEFINE_DEVICE_TYPE(NES_0353, nes_0353_device, "nes_0353", "NES Cart 0353 PCB")
DEFINE_DEVICE_TYPE(NES_09034A, nes_09034a_device, "nes_09034a", "NES Cart 09-034A PCB")
DEFINE_DEVICE_TYPE(NES_L001, nes_l001_device, "nes_l001", "NES Cart L-001 PCB")
DEFINE_DEVICE_TYPE(NES_BATMANFS, nes_batmanfs_device, "nes_batmanfs", "NES Cart Batman Pirate PCB")
DEFINE_DEVICE_TYPE(NES_PALTHENA, nes_palthena_device, "nes_palthena", "NES Cart Palthena no Kagami Pirate PCB")
DEFINE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device, "nes_tobidase", "NES Cart Tobidase Daisakusen Pirate PCB")
@ -144,6 +145,11 @@ nes_09034a_device::nes_09034a_device(const machine_config &mconfig, const char *
{
}
nes_l001_device::nes_l001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_L001, tag, owner, clock), m_irq_count(0), irq_timer(nullptr)
{
}
nes_batmanfs_device::nes_batmanfs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BATMANFS, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
{
@ -499,6 +505,23 @@ void nes_09034a_device::pcb_reset()
m_reg = 0;
}
void nes_l001_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_count));
}
void nes_l001_device::pcb_reset()
{
prg32((m_prg_chunks >> 1) - 1);
chr8(0, CHRROM);
m_irq_count = 0;
}
void nes_palthena_device::device_start()
{
common_start();
@ -1548,6 +1571,64 @@ u8 nes_09034a_device::read_m(offs_t offset)
return m_prg[(((m_reg + 4) * 0x2000) + offset) & (m_prg_size - 1)];
}
/*-------------------------------------------------
Board L-001
Games: Sangokushi III (Sangokushi II bootleg)
This board has swappable 8K PRG banks at 0x8000, 0xa000,
and 0xc000, while 0xe000 is fixed to the final bank.
CHRROM and CIRAM are also swappable in 1K banks.
The board has a 16-bit IRQ counter with the enable bit
acting as the MSB. The enhanced audio of the original
Namco 163 board is not retained.
NES 2.0: mapper 330
In MAME: Supported.
-------------------------------------------------*/
void nes_l001_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
if (id == TIMER_IRQ)
{
if (BIT(m_irq_count, 15))
{
if (++m_irq_count == 0)
set_irq_line(ASSERT_LINE);
}
}
}
void nes_l001_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("l-001 write_h, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6400)
{
case 0x0000:
case 0x2000:
chr1_x((offset >> 11) & 0x07, data, CHRROM);
break;
case 0x0400:
m_irq_count = (m_irq_count & 0xff00) | data;
break;
case 0x2400:
m_irq_count = (m_irq_count & 0x00ff) | data << 8;
set_irq_line(CLEAR_LINE);
break;
case 0x4000:
set_nt_page((offset >> 11) & 0x03, CIRAM, data & 1, 1);
break;
case 0x6000:
if (offset < 0x7800)
prg8_x((offset >> 11) & 0x03, data & 0x1f);
break;
}
}
/*-------------------------------------------------
BTL-BATMANFS
@ -2207,7 +2288,7 @@ void nes_shuiguan_device::write_h(offs_t offset, uint8_t data)
{
case 0x00: m_irq_count = (m_irq_count & 0xf0) | ((data & 0x0f) << 0); break;
case 0x04: m_irq_count = (m_irq_count & 0x0f) | ((data & 0x0f) << 4); break;
case 0x08: m_irq_enable= data; break;
case 0x08: m_irq_enable = data; break;
case 0x0c: break;
}
break;

View File

@ -320,6 +320,31 @@ private:
};
// ======================> nes_l001_device
class nes_l001_device : public nes_nrom_device
{
public:
// construction/destruction
nes_l001_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;
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
u16 m_irq_count;
static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
};
// ======================> nes_batmanfs_device
class nes_batmanfs_device : public nes_nrom_device
@ -327,6 +352,7 @@ class nes_batmanfs_device : public nes_nrom_device
public:
// construction/destruction
nes_batmanfs_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;
@ -751,6 +777,7 @@ DECLARE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device)
DECLARE_DEVICE_TYPE(NES_N32_4IN1, nes_n32_4in1_device)
DECLARE_DEVICE_TYPE(NES_0353, nes_0353_device)
DECLARE_DEVICE_TYPE(NES_09034A, nes_09034a_device)
DECLARE_DEVICE_TYPE(NES_L001, nes_l001_device)
DECLARE_DEVICE_TYPE(NES_BATMANFS, nes_batmanfs_device)
DECLARE_DEVICE_TYPE(NES_PALTHENA, nes_palthena_device)
DECLARE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device)

View File

@ -313,6 +313,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("yung08", NES_YUNG08);
device.option_add_internal("btl_0353", NES_0353); // used by Lucky (Roger) Rabbit FDS conversion
device.option_add_internal("09034a", NES_09034A);
device.option_add_internal("l001", NES_L001);
device.option_add_internal("batmanfs", NES_BATMANFS);
device.option_add_internal("palthena", NES_PALTHENA); // used by Palthena no Kagami FDS conversion
device.option_add_internal("tobidase", NES_TOBIDASE); // mapper 120

View File

@ -365,7 +365,7 @@ static const nes_mmc mmc_list[] =
// 327 BMC-10-24-C-A1 6-in-1
{ 328, UNL_RT01 }, // test cart (Russia)
{ 329, UNL_EDU2K },
// 330 Sangokushi II - Haou no Tairiku hack - N163 bootleg
{ 330, BTL_L001 }, // Sangokushi II bootleg (retitled part III)
{ 331, BMC_12IN1 },
{ 332, BMC_WS },
{ 333, BMC_8IN1 },

View File

@ -216,6 +216,7 @@ static const nes_pcb pcb_list[] =
{ "yung08", BTL_YUNG08 },
{ "btl_0353", BTL_0353 },
{ "09034a", BTL_09034A },
{ "l001", BTL_L001 },
{ "batmanfs", BTL_BATMANFS },
{ "palthena", BTL_PALTHENA },
{ "tobidase", BTL_TOBIDASE }, // mapper 120

View File

@ -116,9 +116,9 @@ enum
UNL_43272, UNL_TF1201, UNL_CITYFIGHT, UNL_NINJARYU, UNL_EH8813A, UNL_RT01,
// Bootleg boards
BTL_0353, BTL_09034A, BTL_AISENSHINICOL, BTL_BATMANFS,
BTL_CONTRAJ, BTL_DRAGONNINJA, BTL_MARIOBABY, BTL_PALTHENA,
BTL_PIKACHUY2K, BTL_SBROS11, BTL_SMB2JA, BTL_SMB2JB,
BTL_SMB3, BTL_SHUIGUAN, BTL_TOBIDASE, BTL_YUNG08,
BTL_CONTRAJ, BTL_DRAGONNINJA, BTL_L001, BTL_MARIOBABY,
BTL_PALTHENA, BTL_PIKACHUY2K, BTL_SBROS11, BTL_SHUIGUAN,
BTL_SMB2JA, BTL_SMB2JB, BTL_SMB3, BTL_TOBIDASE, BTL_YUNG08,
// Shenzhen Jncota
JNCOTA_KT1001,
// Kaiser