// license:BSD-3-Clause // copyright-holders:David Haywood /* Ping Pong Masters '93 Electronic Devices, 1993 PCB Layout ---------- |----------------------------------------------| | | | 2018 | | 1.UE7 YM2413 | | |----------| | | Z80 |Unknown | 24MHz PROM1| | |PLCC84 | | |J DSW2 | | PROM2| |A 2.UP7 | | PAL | |M | | PAL PROM3| |M DSW1 2018 |----------| | |A 2018 | | PAL 2018 | | 5MHz | | | | | | | | Z80 3.UG16 4.UG15 | |----------------------------------------------| Notes: Z80 clock : 5.000MHz (both) YM2413 clock : 2.500MHz (5/2) VSync : 55Hz Dip Switch Settings ------------------- SW1 1 2 3 4 5 6 7 8 |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| |Coin1 | 1C 1P | OFF | OFF | OFF | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 2P | ON | OFF | OFF | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 3P | OFF | ON | OFF | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 4P | ON | ON | OFF | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 5P | OFF | OFF | ON | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 1P | ON | OFF | ON | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 3P | OFF | ON | ON | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 5P | ON | ON | ON | OFF | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 1P | OFF | OFF | OFF | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 2P | ON | OFF | OFF | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 5P | OFF | ON | OFF | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 1P | ON | ON | OFF | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 3P | OFF | OFF | ON | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 5P | ON | OFF | ON | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 5C 1P | OFF | ON | ON | ON | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 5C 2P | ON | ON | ON | ON | | | | | |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| |Coin2 | 1C 1P | | | | | OFF | OFF | OFF | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 2P | | | | | ON | OFF | OFF | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 3P | | | | | OFF | ON | OFF | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 4P | | | | | ON | ON | OFF | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 1C 5P | | | | | OFF | OFF | ON | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 1P | | | | | ON | OFF | ON | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 3P | | | | | OFF | ON | ON | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 2C 5P | | | | | ON | ON | ON | OFF | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 1P | | | | | OFF | OFF | OFF | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 2P | | | | | ON | OFF | OFF | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 3C 5P | | | | | OFF | ON | OFF | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 1P | | | | | ON | ON | OFF | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 3P | | | | | OFF | OFF | ON | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 4C 5P | | | | | ON | OFF | ON | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 5C 1P | | | | | OFF | ON | ON | ON | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | 5C 2P | | | | | ON | ON | ON | ON | |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| SW2 1 2 3 4 5 6 7 8 |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| |Diffic-| Easy | OFF | OFF | | | | | | | |ulty |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | Normal| ON | OFF | | | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | Hard | OFF | ON | | | | | | | | |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | V.Hard| ON | ON | | | | | | | |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| |Demo |Without| | | OFF | | | | | | |Sound |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | With | | | ON | | | | | | |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| |Test | No | | | | OFF | | | | | |Mode |-------|-----|-----|-----|-----|-----|-----|-----|-----| | | Yes | | | | ON | | | | | |-------|-------|-----|-----|-----|-----|-----|-----|-----|-----| The DIP sheet also seems to suggest the use of a 4-way joystick and 2 buttons, one for shoot and one for select. 2008-08 Dip locations added based on the notes above. */ #include "emu.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/dac.h" #include "sound/ymopl.h" #include "emupal.h" #include "screen.h" #include "speaker.h" #include "tilemap.h" namespace { class ppmast93_state : public driver_device { public: ppmast93_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_bgram(*this, "bgram"), m_fgram(*this, "fgram"), m_cpubank(*this, "cpubank") { } void ppmast93(machine_config &config); protected: virtual void machine_start() override; virtual void video_start() override; private: required_device m_maincpu; required_device m_gfxdecode; required_shared_ptr m_bgram; required_shared_ptr m_fgram; required_memory_bank m_cpubank; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; void fgram_w(offs_t offset, uint8_t data); void bgram_w(offs_t offset, uint8_t data); void port4_w(uint8_t data); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cpu1_io(address_map &map); void cpu1_map(address_map &map); void cpu2_io(address_map &map); void cpu2_map(address_map &map); }; void ppmast93_state::machine_start() { m_cpubank->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000); } void ppmast93_state::fgram_w(offs_t offset, uint8_t data) { m_fgram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset / 2); } void ppmast93_state::bgram_w(offs_t offset, uint8_t data) { m_bgram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset / 2); } void ppmast93_state::port4_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, data & 0x08); machine().bookkeeping().coin_counter_w(1, data & 0x10); m_cpubank->set_entry(data & 0x07); } void ppmast93_state::cpu1_map(address_map &map) { map(0x0000, 0x7fff).rom().nopw(); map(0x8000, 0xbfff).bankr(m_cpubank); map(0xd000, 0xd7ff).ram().w(FUNC(ppmast93_state::bgram_w)).share(m_bgram); map(0xd800, 0xdfff).nopw(); map(0xf000, 0xf7ff).ram().w(FUNC(ppmast93_state::fgram_w)).share(m_fgram); map(0xf800, 0xffff).ram(); } void ppmast93_state::cpu1_io(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).portr("P1").w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x02, 0x02).portr("P2"); map(0x04, 0x04).portr("SYSTEM").w(FUNC(ppmast93_state::port4_w)); map(0x06, 0x06).portr("DSW1"); map(0x08, 0x08).portr("DSW2"); } void ppmast93_state::cpu2_map(address_map &map) { map(0x0000, 0xfbff).rom().region("sub", 0x00000); map(0xfc00, 0xfc00).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0xfd00, 0xffff).ram(); } void ppmast93_state::cpu2_io(address_map &map) { map(0x0000, 0xffff).rom().region("sub", 0x10000); map(0x0000, 0x0001).mirror(0xff00).w("ymsnd", FUNC(ym2413_device::write)); map(0x0002, 0x0002).mirror(0xff00).w("dac", FUNC(dac_byte_interface::data_w)); } static INPUT_PORTS_START( ppmast93 ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // nothing? PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_START("P2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // nothing? PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) // or it always goes to test mode PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_DIPSETTING( 0x01, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00, "5 Coins/2 Credits" ) PORT_DIPSETTING( 0x0a, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 4C_5C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x05, "3 Coins/5 Credits" ) PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00, "5 Coins/2 Credits" ) PORT_DIPSETTING( 0xa0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 4C_5C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x50, "3 Coins/5 Credits" ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:4" ) PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) INPUT_PORTS_END static const gfx_layout tiles8x8_layout = { 8,8, RGN_FRAC(1,1), 4, { 0, 2, 4, 6 }, { 1, 0, 9, 8, 17, 16, 25, 24 }, { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, 32*8 }; static GFXDECODE_START( gfx_ppmast93 ) GFXDECODE_ENTRY( "tiles", 0, tiles8x8_layout, 0, 16 ) GFXDECODE_END TILE_GET_INFO_MEMBER(ppmast93_state::get_bg_tile_info) { int code = (m_bgram[tile_index * 2 + 1] << 8) | m_bgram[tile_index * 2]; tileinfo.set(0, code & 0x0fff, (code & 0xf000) >> 12, 0); } TILE_GET_INFO_MEMBER(ppmast93_state::get_fg_tile_info) { int code = (m_fgram[tile_index * 2 + 1] << 8) | m_fgram[tile_index * 2]; tileinfo.set(0, (code & 0x0fff) + 0x1000, (code & 0xf000) >> 12, 0); } void ppmast93_state::video_start() { m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ppmast93_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ppmast93_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(0); } uint32_t ppmast93_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; } void ppmast93_state::ppmast93(machine_config &config) { // basic machine hardware Z80(config, m_maincpu, 5_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &ppmast93_state::cpu1_map); m_maincpu->set_addrmap(AS_IO, &ppmast93_state::cpu1_io); m_maincpu->set_vblank_int("screen", FUNC(ppmast93_state::irq0_line_hold)); z80_device &sub(Z80(config, "sub", 5_MHz_XTAL)); sub.set_addrmap(AS_PROGRAM, &ppmast93_state::cpu2_map); sub.set_addrmap(AS_IO, &ppmast93_state::cpu2_io); sub.set_periodic_int(FUNC(ppmast93_state::irq0_line_hold), attotime::from_hz(8000)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(55); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(256, 256); screen.set_visarea_full(); screen.set_screen_update(FUNC(ppmast93_state::screen_update)); screen.set_palette("palette"); GFXDECODE(config, m_gfxdecode, "palette", gfx_ppmast93); PALETTE(config, "palette", palette_device::RGB_444_PROMS, "proms", 0x100); // sound hardware SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, "soundlatch"); YM2413(config, "ymsnd", 5_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "speaker", 1.0); DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.3); // unknown DAC } ROM_START( ppmast93 ) ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "2.up7", 0x00000, 0x20000, CRC(8854d8db) SHA1(9d93ddfb44d533772af6519747a6cb50b42065cd) ) ROM_REGION( 0x20000, "sub", 0 ) ROM_LOAD( "1.ue7", 0x00000, 0x20000, CRC(8e26939e) SHA1(e62441e523f5be6a3889064cc5e0f44545260e93) ) ROM_REGION( 0x40000, "tiles", 0 ) ROM_LOAD( "3.ug16", 0x00000, 0x20000, CRC(8ab24641) SHA1(c0ebee90bf3fe208947ae5ea56f31469ed24d198) ) ROM_LOAD( "4.ug15", 0x20000, 0x20000, CRC(b16e9fb6) SHA1(53aa962c63319cd649e0c8cf0c26e2308598e1aa) ) ROM_REGION( 0x300, "proms", 0 ) ROM_LOAD( "prom3.ug24", 0x000, 0x100, CRC(b1a4415a) SHA1(1dd22260f7dbdc9c812a2349069ed5f3c9c92826) ) ROM_LOAD( "prom2.ug25", 0x100, 0x100, CRC(4b5055ba) SHA1(6213e79492d35593c643ef5c01ce6a58a77866aa) ) ROM_LOAD( "prom1.ug26", 0x200, 0x100, CRC(d979c64e) SHA1(172c9579013d58e35a5b4f732e360811ac36295e) ) ROM_END } // Anonymous namespace GAME( 1993, ppmast93, 0, ppmast93, ppmast93, ppmast93_state, empty_init, ROT0, "Electronic Devices S.R.L.", "Ping Pong Masters '93", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )