trunk/src/mame/drivers/mwsub.c
| r0 | r26522 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:hap |
| 3 | /* Midway's Submarine hardware, game number 760 |
| 4 | |
| 5 | |
| 6 | */ |
| 7 | |
| 8 | #include "emu.h" |
| 9 | #include "cpu/z80/z80.h" |
| 10 | |
| 11 | #include "submar.lh" |
| 12 | |
| 13 | |
| 14 | class submar_state : public driver_device |
| 15 | { |
| 16 | public: |
| 17 | submar_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | : driver_device(mconfig, type, tag), |
| 19 | m_maincpu(*this, "maincpu") |
| 20 | { } |
| 21 | |
| 22 | required_device<cpu_device> m_maincpu; |
| 23 | }; |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | static ADDRESS_MAP_START( submar_map, AS_PROGRAM, 8, submar_state ) |
| 31 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 32 | AM_RANGE(0x2000, 0x207f) AM_RAM |
| 33 | ADDRESS_MAP_END |
| 34 | |
| 35 | static ADDRESS_MAP_START( submar_portmap, AS_IO, 8, submar_state ) |
| 36 | ADDRESS_MAP_UNMAP_HIGH |
| 37 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 38 | ADDRESS_MAP_END |
| 39 | |
| 40 | |
| 41 | |
| 42 | static INPUT_PORTS_START( submar ) |
| 43 | PORT_START("IN0") |
| 44 | PORT_DIPNAME( 0x01, 0x01, "01" ) |
| 45 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 46 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 47 | PORT_DIPNAME( 0x02, 0x02, "02" ) |
| 48 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 49 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 50 | PORT_DIPNAME( 0x04, 0x04, "04" ) |
| 51 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 52 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 53 | PORT_DIPNAME( 0x08, 0x08, "08" ) |
| 54 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 55 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 56 | PORT_DIPNAME( 0x10, 0x10, "10" ) |
| 57 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 58 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 59 | PORT_DIPNAME( 0x20, 0x20, "20" ) |
| 60 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 61 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 62 | PORT_DIPNAME( 0x40, 0x40, "40" ) |
| 63 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 64 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 65 | PORT_DIPNAME( 0x80, 0x80, "80" ) |
| 66 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 67 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 68 | |
| 69 | PORT_START("IN1") |
| 70 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 71 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 72 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 73 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 74 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 75 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 76 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 77 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 78 | INPUT_PORTS_END |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | static MACHINE_CONFIG_START( submar, submar_state ) |
| 84 | |
| 85 | /* basic machine hardware */ |
| 86 | MCFG_CPU_ADD("maincpu", Z80, XTAL_19_968MHz/8) |
| 87 | MCFG_CPU_PERIODIC_INT_DRIVER(submar_state, irq0_line_hold, 960.516) // 555 IC - where is irqack? |
| 88 | MCFG_CPU_PROGRAM_MAP(submar_map) |
| 89 | MCFG_CPU_IO_MAP(submar_portmap) |
| 90 | |
| 91 | /* no video! */ |
| 92 | |
| 93 | /* sound hardware */ |
| 94 | //... |
| 95 | MACHINE_CONFIG_END |
| 96 | |
| 97 | |
| 98 | ROM_START( submar ) |
| 99 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 100 | ROM_LOAD( "sub.a1", 0x0000, 0x0800, CRC(bcef5db4) SHA1(8ae5099672fbdb7bcdc617e1f8cbc5435fbb738a) ) |
| 101 | ROM_LOAD( "sub.a2", 0x0800, 0x0800, CRC(f5780dd0) SHA1(f775dd6f64a730a2fb6c9baf5787698434150bc5) ) |
| 102 | ROM_END |
| 103 | |
| 104 | |
| 105 | |
| 106 | GAMEL( 1979, submar, 0, submar, submar, driver_device, 0, ROT0, "Midway", "Submarine (Midway)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_MECHANICAL, layout_submar ) |