summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-08-17 05:46:37 -0800
committer GitHub <noreply@github.com>2021-08-17 09:46:37 -0400
commit5c5f9ad1df7e5275ef5df80ca0bd826189225f77 (patch)
treebde2c7ede308a9e14a7e6d3001a9bf2cae3fdf52 /src/devices/bus
parent317d111f5d5d9872855ca613ae7c6a6e0f456869 (diff)
bus/nes: Improved support for various RCM multicarts. (#8453)
- Got boards gs2004 and gs2013 working and merged them into related classes (they differ solely by a fixed bank number). - Simplified tf9in1 board and fixed its graphics issues (sets mc_20a, mc_tf9). New working software list additions (nes.xml) ----------------------------------- Tetris Family 5 in 1 [NewRisingSun] Software list items promoted to working (nes.xml) --------------------------------------- Tetris Family 6 in 1 (GS-2004) Tetris Family 12 in 1 (GS-2013)
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/nes/nes_ines.hxx12
-rw-r--r--src/devices/bus/nes/rcm.cpp136
-rw-r--r--src/devices/bus/nes/rcm.h38
3 files changed, 63 insertions, 123 deletions
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index d0359f504cb..81b17a656fe 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -318,7 +318,7 @@ static const nes_mmc mmc_list[] =
// 280 Unused
// 281 seems to be mc_sh4b and many other JY multicarts not in nes.xml?
// 282 more JY multicarts not in nes.xml?
- // 283 RCM_GS2004 and RCM_GS2013 (why are these RCM?), these are in nes.xml
+ { 283, RCM_GS2004 }, // and RCM_GS2013
// 284 UNL_DRIPGAME, not in nes.xml
{ 285, BMC_A65AS },
{ 286, BMC_BENSHIENG },
@@ -896,6 +896,11 @@ void nes_cart_slot_device::call_load_ines()
m_pcb_id = UNL_DH08;
break;
+ case RCM_GS2004:
+ if (prg_size >= 0x50000)
+ m_pcb_id = RCM_GS2013;
+ break;
+
case HES_BOARD:
if (crc_hack)
m_cart->set_pcb_ctrl_mirror(true); // Mapper 113 is used for 2 diff boards
@@ -1207,6 +1212,7 @@ const char * nes_cart_slot_device::get_default_card_ines(get_default_card_softwa
if (crc_hack)
pcb_id = BTL_AISENSHINICOL; // Mapper 42 is used for 2 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;
@@ -1214,6 +1220,10 @@ const char * nes_cart_slot_device::get_default_card_ines(get_default_card_softwa
pcb_id = UNL_DH08;
break;
+ case RCM_GS2004: // Mapper 283 is used for 2 diff boards
+ if (ROM[4] >= 20)
+ pcb_id = RCM_GS2013;
+ break;
}
return nes_get_slot(pcb_id);
diff --git a/src/devices/bus/nes/rcm.cpp b/src/devices/bus/nes/rcm.cpp
index fdd07830381..f3adba8a49d 100644
--- a/src/devices/bus/nes/rcm.cpp
+++ b/src/devices/bus/nes/rcm.cpp
@@ -8,14 +8,14 @@
Here we emulate the following PCBs
+ * RCM GS2004 [mapper 283]
+ * RCM GS2013 [mapper 283 also]
* RCM GS2015 [mapper 216]
- * RCM GS2004
- * RCM GS2013
* RCM Tetris Family 9in1 [mapper 61]
- * RCM 3D Block
+ * RCM 3D Block [mapper 355]
TODO:
- - investigate why 3D Block does not work
+ - implement PIC16C54 protection for 3D Block
***********************************************************************************************************/
@@ -38,9 +38,9 @@
// constructor
//-------------------------------------------------
-DEFINE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device, "nes_g2015", "NES Cart RCM GS-2015 PCB")
-DEFINE_DEVICE_TYPE(NES_GS2004, nes_gs2004_device, "nes_g2004", "NES Cart RCM GS-2004 PCB")
-DEFINE_DEVICE_TYPE(NES_GS2013, nes_gs2013_device, "nes_g2013", "NES Cart RCM GS-2013 PCB")
+DEFINE_DEVICE_TYPE(NES_GS2004, nes_gs2004_device, "nes_gs2004", "NES Cart RCM GS-2004 PCB")
+DEFINE_DEVICE_TYPE(NES_GS2013, nes_gs2013_device, "nes_gs2013", "NES Cart RCM GS-2013 PCB")
+DEFINE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device, "nes_gs2015", "NES Cart RCM GS-2015 PCB")
DEFINE_DEVICE_TYPE(NES_TF9IN1, nes_tf9_device, "nes_tetrisfam", "NES Cart RCM Tetris Family 9 in 1 PCB")
DEFINE_DEVICE_TYPE(NES_3DBLOCK, nes_3dblock_device, "nes_3dblock", "NES Cart RCM 3D Block PCB")
@@ -50,17 +50,22 @@ nes_gs2015_device::nes_gs2015_device(const machine_config &mconfig, const char *
{
}
-nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GS2004, tag, owner, clock)
+nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int bank)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_base(bank * 0x2000)
{
}
-nes_gs2013_device::nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GS2013, tag, owner, clock)
+nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_gs2004_device(mconfig, NES_GS2004, tag, owner, clock, 0x20)
{
}
-nes_tf9_device::nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_gs2013_device::nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_gs2004_device(mconfig, NES_GS2013, tag, owner, clock, 0x1f)
+{
+}
+
+nes_tf9_device::nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_TF9IN1, tag, owner, clock)
{
}
@@ -85,42 +90,6 @@ void nes_gs2015_device::pcb_reset()
chr8(0, m_chr_source);
}
-void nes_gs2004_device::device_start()
-{
- common_start();
-}
-
-void nes_gs2004_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0xff);
- chr8(0, m_chr_source);
-}
-
-void nes_gs2013_device::device_start()
-{
- common_start();
-}
-
-void nes_gs2013_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0xff);
- chr8(0, m_chr_source);
-}
-
-void nes_tf9_device::device_start()
-{
- common_start();
-}
-
-void nes_tf9_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
void nes_3dblock_device::device_start()
{
common_start();
@@ -157,7 +126,8 @@ void nes_3dblock_device::pcb_reset()
iNES: mapper 216
- In MESS: Supported.
+ In MAME: Partially supported. Bonza games have some
+ sort of card inputs for gambling purposes.
-------------------------------------------------*/
@@ -177,41 +147,26 @@ uint8_t nes_gs2015_device::read_m(offs_t offset)
/*-------------------------------------------------
- Board BMC-GS2004
+ Boards BMC-GS2004, BMC-GS2013
+
+ Games: Tetris Family 6-in-1, 5-in-1, 12-in-1
- Games: Tetris Family 6-in-1
+ NES 2.0: mapper 283
- In MESS: Preliminary Support. It also misses WRAM handling
- (we need reads from 0x6000-0x7fff)
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_gs2004_device::write_h(offs_t offset, uint8_t data)
+u8 nes_gs2004_device::read_m(offs_t offset)
{
- LOG_MMC(("gs2004 write_h, offset: %04x, data: %02x\n", offset, data));
-
- prg32(data);
+ LOG_MMC(("gs2004 read_m, offset: %04x\n", offset));
+ return m_prg[m_base + offset]; // fixed base differs per device
}
-/*-------------------------------------------------
-
- Board BMC-GS2013
-
- Games: Tetris Family 12-in-1
-
- In MESS: Preliminary Support. It also misses WRAM handling
- (we need reads from 0x6000-0x7fff)
-
- -------------------------------------------------*/
-
-void nes_gs2013_device::write_h(offs_t offset, uint8_t data)
+void nes_gs2004_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("gs2013 write_h, offset: %04x, data: %02x\n", offset, data));
-
- if (data & 0x08)
- prg32(data & 0x09);
- else
- prg32(data & 0x07);
+ LOG_MMC(("gs2004 write_h, offset: %04x, data: %02x\n", offset, data));
+ prg32(data);
}
/*-------------------------------------------------
@@ -220,35 +175,22 @@ void nes_gs2013_device::write_h(offs_t offset, uint8_t data)
Games: Tetris Family 9 in 1, 20 in 1
- Simple Mapper: prg/chr/nt are swapped depending on the offset
- of writes in 0x8000-0xffff. offset&0x80 set NT mirroring,
- when (offset&0x30) is 0,3 prg32 is set; when it is 1,2
- two 16k prg banks are set. See below for the values used in
- these banks.
-
iNES: mapper 61
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_tf9_device::write_h(offs_t offset, uint8_t data)
+void nes_tf9_device::write_h(offs_t offset, u8 data)
{
LOG_MMC(("tetrisfam write_h, offset: %04x, data: %02x\n", offset, data));
- switch (offset & 0x30)
- {
- case 0x00:
- case 0x30:
- prg32(offset & 0x0f);
- break;
- case 0x10:
- case 0x20:
- prg16_89ab(((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
- prg16_cdef(((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
- break;
- }
- set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ u8 bank = (offset & 0x0f) << 1 | BIT(offset, 5);
+ u8 mode = !BIT(offset, 4);
+ prg16_89ab(bank & ~mode);
+ prg16_cdef(bank | mode);
+
+ set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*-------------------------------------------------
@@ -257,7 +199,7 @@ void nes_tf9_device::write_h(offs_t offset, uint8_t data)
Games: 3-D Block Hwang Shinwei version
- iNES:
+ NES 2.0: mapper 355
In MESS: Very Preliminary Support. What is the purpose
of the writes to $4800-$4900-$4a00? These writes
diff --git a/src/devices/bus/nes/rcm.h b/src/devices/bus/nes/rcm.h
index 005869fe09c..0581d299f20 100644
--- a/src/devices/bus/nes/rcm.h
+++ b/src/devices/bus/nes/rcm.h
@@ -34,33 +34,27 @@ class nes_gs2004_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_gs2004_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 pcb_reset() override;
+ virtual u8 read_m(offs_t offset) override;
+ virtual void write_h(offs_t offset, u8 data) override;
protected:
- // device-level overrides
- virtual void device_start() override;
+ // construction/destruction
+ nes_gs2004_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int bank);
+
+private:
+ u32 m_base;
};
// ======================> nes_gs2013_device
-class nes_gs2013_device : public nes_nrom_device
+class nes_gs2013_device : public nes_gs2004_device
{
public:
// construction/destruction
- nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- 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;
+ nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
@@ -70,15 +64,9 @@ class nes_tf9_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- virtual void write_h(offs_t offset, uint8_t data) override;
-
- virtual void pcb_reset() override;
+ nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
-protected:
- // device-level overrides
- virtual void device_start() override;
+ virtual void write_h(offs_t offset, u8 data) override;
};
@@ -106,9 +94,9 @@ private:
// device type definition
-DECLARE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device)
DECLARE_DEVICE_TYPE(NES_GS2004, nes_gs2004_device)
DECLARE_DEVICE_TYPE(NES_GS2013, nes_gs2013_device)
+DECLARE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device)
DECLARE_DEVICE_TYPE(NES_TF9IN1, nes_tf9_device)
DECLARE_DEVICE_TYPE(NES_3DBLOCK, nes_3dblock_device)