Previous 199869 Revisions Next

r18058 Friday 21st September, 2012 at 11:56:21 UTC by Robbbert
Added generic set of pinball mechanical sounds [Robbbert]
zac_1 : added outhole and knocker sounds
[src/mame]mame.mak
[src/mame/drivers]zac_1.c
[src/mame/machine]genpin.c genpin.h

trunk/src/mame/machine/genpin.c
r18057r18058
88
99#include "genpin.h"
1010
11// nothing yet
11MACHINE_CONFIG_FRAGMENT( genpin_audio )
12   MCFG_SPEAKER_STANDARD_MONO("mono")
13   MCFG_SAMPLES_ADD("samples", genpin_samples_intf)
14   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
15MACHINE_CONFIG_END
1216
1317
trunk/src/mame/machine/genpin.h
r18057r18058
2626   genpin_sample_names
2727};
2828
29MACHINE_CONFIG_FRAGMENT( genpin_audio )
30   MCFG_SPEAKER_STANDARD_MONO("mono")
31   MCFG_SAMPLES_ADD("samples", genpin_samples_intf)
32   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
33MACHINE_CONFIG_END
3429
30MACHINE_CONFIG_EXTERN( genpin_audio );
3531
32
3633#endif /* GENPIN_H_ */
No newline at end of file
trunk/src/mame/mame.mak
r18057r18058
16411641   $(DRIVERS)/flicker.o  \
16421642   $(DRIVERS)/g627.o  \
16431643   $(DRIVERS)/gp_1.o  \
1644   $(MACHINE)/genpin.o  \
16441645   $(DRIVERS)/gp_2.o  \
16451646   $(DRIVERS)/gts1.o  \
16461647   $(DRIVERS)/gts3.o  \
trunk/src/mame/drivers/zac_1.c
r18057r18058
1414     and off independently. Some games come with a NE555 and SN76477 with switchable
1515     sounds (achieved with 21 switching diodes and 8 data bits).
1616
17    Each game has its own map of inputs and outputs, although fortunately some
18    of them happen to be fairly common. For example the outhole is always on the
19    same output line, while the knocker is the same except for 'strapids'.
20
1721ToDo:
1822- Outputs
1923- Sound
r18057r18058
2327**************************************************************************************/
2428
2529
26#include "emu.h"
30#include "machine/genpin.h"
2731#include "cpu/s2650/s2650.h"
2832#include "zac_1.lh"
2933
r18057r18058
3337   zac_1_state(const machine_config &mconfig, device_type type, const char *tag)
3438      : driver_device(mconfig, type, tag),
3539   m_maincpu(*this, "maincpu"),
36   m_p_ram(*this, "ram")
40   m_p_ram(*this, "ram"),
41   m_samples(*this, "samples")
3742   { }
3843
3944   DECLARE_READ8_MEMBER(ctrl_r);
r18057r18058
4651   UINT8 m_out_offs;
4752   required_device<cpu_device> m_maincpu;
4853   required_shared_ptr<UINT8> m_p_ram;
54   required_device<samples_device> m_samples;
4955protected:
5056
5157   // devices
r18057r18058
9197   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
9298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Burn Test")
9399
100   // from here there are variations per game
94101   PORT_START("ROW2")
95102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_X)
96103   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("LH Flap") PORT_CODE(KEYCODE_Q)
r18057r18058
181188{
182189   m_t_c = 0;
183190// init system if invalid (from pinmame)
184   if (m_p_ram[0xf7] == 5 && m_p_ram[0xf8] == 0x0a)
191   if (m_p_ram[0xf7] == 5 || m_p_ram[0xf8] == 0x0a)
185192   {}
186193   else
187194   {
r18057r18058
205212      state->m_t_c++;
206213}
207214
215/* scores = 1800-182D; solenoids = 1840-1853;
216   lamps = 1880-18BF; bookkeeping=18C0-18FF. 4-tone osc=1854-1857.
217   182E-183F is a storage area for inputs. */
208218static TIMER_DEVICE_CALLBACK( zac_1_outtimer )
209219{
210220   static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 };
211221   zac_1_state *state = timer.machine().driver_data<zac_1_state>();
212222   state->m_out_offs++;
213// displays, solenoids, lamps
214223
215224   if (state->m_out_offs < 0x40)
216225   {
r18057r18058
218227      UINT8 digit = state->m_out_offs & 7;
219228      output_set_digit_value(display * 10 + digit, patterns[state->m_p_ram[state->m_out_offs]&15]);
220229   }
221// seems scores = 1800-182D; solenoids = 1840-187F;
222// lamps = 1880-18BF; bookkeeping=18C0-18FF. 4-tone osc=1850-1853.
223// 182E-183F is a storage area for inputs.
230   else
231   if (state->m_out_offs == 0x4a) // outhole
232   {
233      if (BIT(state->m_p_ram[state->m_out_offs], 0))
234         state->m_samples->start(0, 5);
235   }
236   else
237   if (state->m_out_offs == 0x4b) // knocker (not strapids)
238   {
239      if (BIT(state->m_p_ram[state->m_out_offs], 0))
240         state->m_samples->start(0, 6);
241   }
224242}
225243
226244static MACHINE_CONFIG_START( zac_1, zac_1_state )
r18057r18058
233251
234252   /* Video */
235253   MCFG_DEFAULT_LAYOUT(layout_zac_1)
254
255   /* Sound */
256   MCFG_FRAGMENT_ADD( genpin_audio )
236257MACHINE_CONFIG_END
237258
238259/*************************** LOCOMOTION ********************************/

Previous 199869 Revisions Next


© 1997-2024 The MAME Team