diff options
| author | 2025-08-20 17:11:28 +0100 | |
|---|---|---|
| committer | 2025-08-20 18:11:28 +0200 | |
| commit | a5db795452a68a03940ff9388f0ff52bfdd74736 (patch) | |
| tree | 8458c69a3c71fbadfd98299b0e00a64e9374b6e0 | |
| parent | 173e2a8a8b529fb39504b53a59d56cca567ab711 (diff) | |
current Plug and Play PR (1 system, PDC Japan) (#14058)
New working systems
-------------------
PDC - Pocket Dream Console (Japan) [David Haywood, TeamEurope]
| -rw-r--r-- | src/mame/mame.lst | 1 | ||||
| -rw-r--r-- | src/mame/tvgames/spg2xx.cpp | 72 | ||||
| -rw-r--r-- | src/mame/tvgames/spg2xx.h | 23 |
3 files changed, 95 insertions, 1 deletions
diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 2d4649d549b..91a83f3c4bb 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -47024,6 +47024,7 @@ mpntbalt mylpony ordentv pballpup +pdcj prail rad_crik rad_fb2 diff --git a/src/mame/tvgames/spg2xx.cpp b/src/mame/tvgames/spg2xx.cpp index 86199c3e1a7..cf12b5b9399 100644 --- a/src/mame/tvgames/spg2xx.cpp +++ b/src/mame/tvgames/spg2xx.cpp @@ -331,6 +331,11 @@ void spg2xx_game_lexiart_state::mem_map_lexiart(address_map &map) map(0x3f0000, 0x3f7fff).ram(); // 2 * 32Kb RAMs on PCB } +void spg2xx_game_pdcj_state::mem_map_upperbank(address_map &map) +{ + map(0x000000, 0x1fffff).bankr("cartbank"); + map(0x200000, 0x3fffff).bankr("upperbank"); +} static INPUT_PORTS_START( spg2xx ) // base structure for easy debugging / figuring out of inputs @@ -1690,6 +1695,27 @@ static INPUT_PORTS_START( ddr33v ) INPUT_PORTS_END +static INPUT_PORTS_START( pdcj ) + PORT_INCLUDE( spg2xx ) + + PORT_MODIFY("P1") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_MODIFY("P2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Pause") + PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_MODIFY("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + static const ioport_value handle_table[3] = { 0x00, 0x01, 0x03, @@ -2656,6 +2682,41 @@ void spg2xx_game_smartcycle_state::smartcycle(machine_config &config) SOFTWARE_LIST(config, "smartcycle_cart").set_original("smartcycle_cart"); } +void spg2xx_game_pdcj_state::portc_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if ((data & mem_mask) & 0x0800) + m_upperbank->set_entry(2); + else + m_upperbank->set_entry(1); + + m_maincpu->invalidate_cache(); +} + +void spg2xx_game_pdcj_state::machine_start() +{ + m_upperbank->configure_entries(0, memregion("maincpu")->bytes() / 0x400000, memregion("maincpu")->base(), 0x400000); + m_upperbank->set_entry(1); + spg2xx_game_state::machine_start(); +} + +void spg2xx_game_pdcj_state::machine_reset() +{ + m_upperbank->set_entry(1); + spg2xx_game_state::machine_reset(); +} + +void spg2xx_game_pdcj_state::pdcj(machine_config &config) +{ + SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen); + m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_pdcj_state::mem_map_upperbank); + + spg2xx_base(config); + + m_maincpu->porta_in().set_ioport("P1"); + m_maincpu->portb_in().set_ioport("P2"); + m_maincpu->portc_in().set_ioport("P3"); +} + void spg2xx_game_ddr33v_state::init_ddr33v() { @@ -3064,6 +3125,12 @@ ROM_START( dinothun ) ROM_LOAD16_WORD_SWAP( "dinothunder.bin", 0x000000, 0x400000, CRC(03e82604) SHA1(c39d72aa8a0750ee38ab01b317e77a46e1d6004e) ) ROM_END +ROM_START( pdcj ) + ROM_REGION( 0xc00000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "chip1.u2", 0x000000, 0x800000, CRC(ba4f2279) SHA1(cd6bc20f21e096251ca43b539c46cb51c790769c) ) + ROM_LOAD16_WORD_SWAP( "chip2.u3", 0x800000, 0x400000, CRC(4fb335ac) SHA1(d6499816acb3da5c4f6a582bd3104c707422eb34) ) +ROM_END + void spg2xx_game_state::init_crc() { // several games have a byte sum checksum listed at the start of ROM, this little helper function logs what it should match. @@ -3300,4 +3367,7 @@ CONS( 200?, smartcyc, 0, 0, smartcycle, smartcyc, spg2xx_game_smartcycl CONS( 2004, spidm2, 0, 0, spg2xx, spidm2, spg2xx_game_state, empty_init, "N-Vision", "Spider-Man 2 Web Action", MACHINE_IMPERFECT_SOUND ) -CONS( 2004, dinothun, 0, 0, spg2xx, spg2xx, spg2xx_game_state, empty_init, "N-Vision / Toy Quest", "Power Rangers Dino Thunder: Thunder Action", MACHINE_NOT_WORKING ) +CONS( 2004, dinothun, 0, 0, spg2xx, spg2xx, spg2xx_game_state, empty_init, "N-Vision / Toy Quest", "Power Rangers Dino Thunder: Thunder Action", MACHINE_NOT_WORKING ) + +// this Japan version uses different banking to spg2xx_pdc.cpp so is in here instead +CONS( 2006, pdcj, 0, 0, pdcj, pdcj, spg2xx_game_pdcj_state, empty_init, "Conny / Takara", "PDC - Pocket Dream Console (Japan)", MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/tvgames/spg2xx.h b/src/mame/tvgames/spg2xx.h index 191392c39c6..88809071c5a 100644 --- a/src/mame/tvgames/spg2xx.h +++ b/src/mame/tvgames/spg2xx.h @@ -486,4 +486,27 @@ private: memory_region *m_cart_region; }; +class spg2xx_game_pdcj_state : public spg2xx_game_state +{ +public: + spg2xx_game_pdcj_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_state(mconfig, type, tag), + m_upperbank(*this, "upperbank") + { } + + void pdcj(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + virtual void portc_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; + + required_memory_bank m_upperbank; + +private: + + void mem_map_upperbank(address_map &map) ATTR_COLD; +}; + #endif // MAME_TVGAMES_SPG2XX_H |
