Previous 199869 Revisions Next

r26542 Sunday 8th December, 2013 at 16:59:56 UTC by hap
midway submarine core emulation
[src/mame/drivers]mw18w.c mwsub.c
[src/mame/layout]submar.lay

trunk/src/mame/layout/submar.lay
r26541r26542
66      </led7seg>
77   </element>
88
9   <element name="digit0" defstate="63">
10      <led7seg>
11         <color red="1.0" green="0.3" blue="0.0" />
12      </led7seg>
13   </element>
14
15
916   <view name="Simple LEDs">
1017      <bounds left="0" right="256" top="0" bottom="256" />
1118
19      <!-- SCORE -->
20      <!-- x1000, x100 -->
21      <bezel name="digit2" element="digit">
22         <bounds x="0" y="0" width="10" height="15" />
23      </bezel>
24      <bezel name="digit3" element="digit">
25         <bounds x="10" y="0" width="10" height="15" />
26      </bezel>
27
28      <!-- x10, x1: stuck to 0 -->
29      <bezel name="dummy_digita" element="digit0">
30         <bounds x="20" y="0" width="10" height="15" />
31      </bezel>
32      <bezel name="dummy_digitb" element="digit0">
33         <bounds x="30" y="0" width="10" height="15" />
34      </bezel>
35
36      <!-- TIME -->
37      <bezel name="digit0" element="digit">
38         <bounds x="50" y="0" width="10" height="15" />
39      </bezel>
40      <bezel name="digit1" element="digit">
41         <bounds x="60" y="0" width="10" height="15" />
42      </bezel>
43
1244   </view>
1345</mamelayout>
trunk/src/mame/drivers/mw18w.c
r26541r26542
11// license:BSD-3-Clause
22// copyright-holders:hap
3/* Midway's 18 Wheeler hardware, game number 653
3/***************************************************************************
44
5  Midway's 18 Wheeler, game number 653
6
57driver todo:
68- discrete sound
79- hook up lamps (and sensors)
r26541r26542
1315- test accelerator:             reset with shifter in 1st gear
1416- test steering wheel:          reset with shifter in 2nd gear
1517
16*/
18***************************************************************************/
1719
1820#include "emu.h"
1921#include "cpu/z80/z80.h"
r26541r26542
3941};
4042
4143
44/***************************************************************************
45
46  I/O, Memorymap
47
48***************************************************************************/
49
4250WRITE8_MEMBER(mw18w_state::mw18w_sound0_w)
4351{
4452   // sound write (airhorn, brake, crash) plus motor speed for backdrop, and coin counter
r26541r26542
98106ADDRESS_MAP_END
99107
100108
109
110/***************************************************************************
111
112  Inputs
113
114***************************************************************************/
115
101116static const ioport_value mw18w_controller_table[] =
102117{
103118   // same encoder as sspeedr
r26541r26542
138153   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
139154   PORT_DIPSETTING(    0x03, DEF_STR( 2C_3C ) )
140155   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
141   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW:5,6")
142   PORT_DIPSETTING(    0x00, "60 seconds" )
143   PORT_DIPSETTING(    0x10, "70 seconds" )
144   PORT_DIPSETTING(    0x20, "80 seconds" )
145   PORT_DIPSETTING(    0x30, "90 seconds" )
146
147156   PORT_DIPNAME( 0x0c, 0x00, "Extended Time" ) PORT_DIPLOCATION("SW:3,4")
148157   PORT_DIPSETTING(    0x00, "20 seconds at 4000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x00) // @ 60 seconds
149158   PORT_DIPSETTING(    0x04, "30 seconds at 8000" )  PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
r26541r26542
161170   PORT_DIPSETTING(    0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
162171   PORT_DIPSETTING(    0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
163172   PORT_DIPSETTING(    0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
164
173   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW:5,6")
174   PORT_DIPSETTING(    0x00, "60 seconds" )
175   PORT_DIPSETTING(    0x10, "70 seconds" )
176   PORT_DIPSETTING(    0x20, "80 seconds" )
177   PORT_DIPSETTING(    0x30, "90 seconds" )
165178   PORT_DIPNAME( 0x40, 0x40, "I/O Test" ) PORT_DIPLOCATION("SW:7")
166179   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
167180   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r26541r26542
176189INPUT_PORTS_END
177190
178191
192
193/***************************************************************************
194
195  Machine Config
196
197***************************************************************************/
198
179199static MACHINE_CONFIG_START( mw18w, mw18w_state )
180200
181201   /* basic machine hardware */
r26541r26542
191211MACHINE_CONFIG_END
192212
193213
214
215/***************************************************************************
216
217  Game drivers
218
219***************************************************************************/
220
194221ROM_START( 18w )
195222   ROM_REGION( 0x10000, "maincpu", 0 )
196223   ROM_LOAD( "18w_b1.rom1", 0x0000, 0x0800, CRC(200c5beb) SHA1(994d67a89f18df9716c5dd4dd60f6e7eeb880f1b) )
trunk/src/mame/drivers/mwsub.c
r26541r26542
11// license:BSD-3-Clause
22// copyright-holders:hap
3/* Midway's Submarine hardware, game number 760
3/***************************************************************************
44
5  Midway's Submarine, game number 760
56
6*/
7TODO:
8- needs extensive artwork
9- discrete sound
10- identify sensors
711
12***************************************************************************/
13
814#include "emu.h"
915#include "cpu/z80/z80.h"
1016
r26541r26542
2026   { }
2127
2228   required_device<cpu_device> m_maincpu;
29
30   DECLARE_READ8_MEMBER(submar_sensor0_r);
31   DECLARE_READ8_MEMBER(submar_sensor1_r);
32   DECLARE_WRITE8_MEMBER(submar_motor_w);
33   DECLARE_WRITE8_MEMBER(submar_lamp_w);
34   DECLARE_WRITE8_MEMBER(submar_solenoid_w);
35   DECLARE_WRITE8_MEMBER(submar_sound_w);
36   DECLARE_WRITE8_MEMBER(submar_led_w);
37   DECLARE_WRITE8_MEMBER(submar_irq_clear_w);
2338};
2439
2540
41/***************************************************************************
2642
43  I/O, Memorymap
2744
45***************************************************************************/
2846
47READ8_MEMBER(submar_state::submar_sensor0_r)
48{
49   // ?
50   return 0;
51}
2952
53READ8_MEMBER(submar_state::submar_sensor1_r)
54{
55   // ?
56   return (ioport("IN1")->read() & 0x70) | 0x8f;
57}
58
59WRITE8_MEMBER(submar_state::submar_motor_w)
60{
61   // d0: torpedo follow
62   // d1: ship movement
63   // d2: n/c
64   // d3: torpedo timing
65   // d4: torpedo timing
66   // d5: target shipsink
67   // d6: stir water
68   // d7: n/c
69   for (int i = 0; i < 8; i++)
70      output_set_indexed_value("motor", i, data >> i & 1);
71}
72
73WRITE8_MEMBER(submar_state::submar_lamp_w)
74{
75   // d0: torpedo
76   // d1: target ship on water
77   // d2: target ship under water
78   // d3: explosion
79   // d4: game over
80   // d5: extended play
81   // d6: front ship hit
82   // d7: scenery
83   for (int i = 0; i < 8; i++)
84      output_set_lamp_value(i, data >> i & 1);
85}
86
87WRITE8_MEMBER(submar_state::submar_solenoid_w)
88{
89   // d0-d4: ship1-5
90   // d5-d7: n/c
91   for (int i = 0; i < 8; i++)
92      output_set_indexed_value("solenoid", i, data >> i & 1);
93}
94
95WRITE8_MEMBER(submar_state::submar_sound_w)
96{
97   // d0: torpedo
98   // d1: summer
99   // d2: ship hit
100   // d3: target ship hit
101   // d4: sonar circuit
102   // d5: sonar circuit
103   // d6: n/c
104   // d7: n/c
105}
106
107WRITE8_MEMBER(submar_state::submar_led_w)
108{
109   // 7447 (BCD to LED segment)
110   const UINT8 led_map[16] =
111      { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
112
113   // 2 digits per write. port 4: time, port 5: score
114   output_set_digit_value((offset << 1 & 2) | 0, led_map[data >> 4]);
115   output_set_digit_value((offset << 1 & 2) | 1, led_map[data & 0x0f]);
116}
117
118WRITE8_MEMBER(submar_state::submar_irq_clear_w)
119{
120   m_maincpu->set_input_line(0, CLEAR_LINE);
121}
122
123
30124static ADDRESS_MAP_START( submar_map, AS_PROGRAM, 8, submar_state )
125   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
31126   AM_RANGE(0x0000, 0x1fff) AM_ROM
32127   AM_RANGE(0x2000, 0x207f) AM_RAM
33128ADDRESS_MAP_END
34129
35130static ADDRESS_MAP_START( submar_portmap, AS_IO, 8, submar_state )
36   ADDRESS_MAP_UNMAP_HIGH
37131   ADDRESS_MAP_GLOBAL_MASK(0xff)
132   AM_RANGE(0x00, 0x00) AM_READWRITE(submar_sensor0_r, submar_motor_w)
133   AM_RANGE(0x01, 0x01) AM_READWRITE(submar_sensor1_r, submar_lamp_w)
134   AM_RANGE(0x02, 0x02) AM_WRITE(submar_solenoid_w)
135   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(submar_sound_w)
136   AM_RANGE(0x04, 0x05) AM_WRITE(submar_led_w)
137   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
138   AM_RANGE(0x07, 0x07) AM_WRITE(submar_irq_clear_w)
38139ADDRESS_MAP_END
39140
40141
41142
143/***************************************************************************
144
145  Inputs
146
147***************************************************************************/
148
42149static 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" )
150   PORT_START("IN1")
151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
154
155   PORT_START("DSW")
156   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:1")
157   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
158   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
159   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW:2")
48160   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
49161   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 )
162   PORT_DIPNAME( 0x0c, 0x00, "Extended Time" ) PORT_DIPLOCATION("SW:3,4")
163   PORT_DIPSETTING(    0x00, "15 seconds at 1000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00) // @ 60 seconds
164   PORT_DIPSETTING(    0x04, "15 seconds at 2000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
165   PORT_DIPSETTING(    0x08, "30 seconds at 2000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
166   PORT_DIPSETTING(    0x0c, "30 seconds at 3000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
167   PORT_DIPSETTING(    0x00, "15 seconds at 2000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10) // @ 70 seconds
168   PORT_DIPSETTING(    0x04, "15 seconds at 3000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
169   PORT_DIPSETTING(    0x08, "30 seconds at 3000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
170   PORT_DIPSETTING(    0x0c, "30 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
171   PORT_DIPSETTING(    0x00, "15 seconds at 3000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20) // @ 80 seconds
172   PORT_DIPSETTING(    0x04, "15 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
173   PORT_DIPSETTING(    0x08, "30 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
174   PORT_DIPSETTING(    0x0c, "30 seconds at 5000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
175   PORT_DIPSETTING(    0x00, "15 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30) // @ 90 seconds
176   PORT_DIPSETTING(    0x04, "15 seconds at 5000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
177   PORT_DIPSETTING(    0x08, "30 seconds at 5000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
178   PORT_DIPSETTING(    0x0c, "30 seconds at 6000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
179   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW:5,6")
180   PORT_DIPSETTING(    0x00, "60 seconds" )
181   PORT_DIPSETTING(    0x10, "70 seconds" )
182   PORT_DIPSETTING(    0x20, "80 seconds" )
183   PORT_DIPSETTING(    0x30, "90 seconds" )
184   PORT_DIPNAME( 0x40, 0x00, "Alignment Mode" ) PORT_DIPLOCATION("SW:7")
185   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
186   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
187   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_HIGH, "SW:8" )
78188INPUT_PORTS_END
79189
80190
81191
192/***************************************************************************
82193
194  Machine Config
195
196***************************************************************************/
197
83198static MACHINE_CONFIG_START( submar, submar_state )
84199
85200   /* basic machine hardware */
86201   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?
202   MCFG_CPU_PERIODIC_INT_DRIVER(submar_state, irq0_line_assert, 124.675) // 555 IC
88203   MCFG_CPU_PROGRAM_MAP(submar_map)
89204   MCFG_CPU_IO_MAP(submar_portmap)
90205
r26541r26542
95210MACHINE_CONFIG_END
96211
97212
213
214/***************************************************************************
215
216  Game drivers
217
218***************************************************************************/
219
98220ROM_START( submar )
99221   ROM_REGION( 0x10000, "maincpu", 0 )
100222   ROM_LOAD( "sub.a1", 0x0000, 0x0800, CRC(bcef5db4) SHA1(8ae5099672fbdb7bcdc617e1f8cbc5435fbb738a) )
r26541r26542
102224ROM_END
103225
104226
105
106227GAMEL( 1979, submar, 0, submar, submar, driver_device, 0, ROT0, "Midway", "Submarine (Midway)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_MECHANICAL, layout_submar )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team