Previous 199869 Revisions Next

r33541 Wednesday 26th November, 2014 at 02:03:04 UTC by David Haywood
add sound (nw)
[src/mame/drivers]supduck.c

trunk/src/mame/drivers/supduck.c
r242052r242053
6262
6363   TILEMAP_MAPPER_MEMBER(supduk_tilemap_scan);
6464
65   DECLARE_WRITE8_MEMBER(okibank_w);
6566
6667protected:
6768
r242052r242053
257258WRITE16_MEMBER(supduck_state::supduck_4002_w)
258259{
259260   data &= mem_mask;
260   // soundlatch
261//   printf("supduck_4002_w %04x\n", data);
261
262   soundlatch_byte_w(space, 0, (data>>8));
263   m_audiocpu->set_input_line(0, HOLD_LINE);
264
262265}
263266
264267WRITE16_MEMBER(supduck_state::supduck_scroll_w)
r242052r242053
313316static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, supduck_state )
314317   AM_RANGE(0x0000, 0x7fff) AM_ROM
315318   AM_RANGE(0x8000, 0x87ff) AM_RAM
319   AM_RANGE(0x9000, 0x9000) AM_WRITE(okibank_w)
320   AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_device, read, write)
321   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
316322ADDRESS_MAP_END
317323
324static ADDRESS_MAP_START( oki_map, AS_0, 8, supduck_state )
325   AM_RANGE(0x00000, 0x1ffff) AM_ROM
326   AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("okibank")
327ADDRESS_MAP_END
318328
329WRITE8_MEMBER(supduck_state::okibank_w)
330{
331   // bit 0x80 is written on startup?
332
333   membank("okibank")->set_entry(data&0x03);
334}
335
336
319337static INPUT_PORTS_START( supduck )
320338   PORT_START("P1_P2")
321339   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
r242052r242053
325343   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
326344   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
327345   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
328   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
346   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
329347   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
330348   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
331349   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r242052r242053
333351   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
334352   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
335353   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
336   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
354   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
337355
338356   PORT_START("SYSTEM")
339357   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r242052r242053
463481
464482void supduck_state::machine_start()
465483{
484   membank("okibank")->configure_entries(0, 4, memregion("okibank")->base(), 0x20000);
485   membank("okibank")->set_entry(0);
466486}
467487
468488void supduck_state::machine_reset()
r242052r242053
513533
514534   MCFG_OKIM6295_ADD("oki", 8000000/8, OKIM6295_PIN7_HIGH) // pin 7 not verified
515535   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
536   MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map)
537
516538MACHINE_CONFIG_END
517539
518540


Previous 199869 Revisions Next


© 1997-2024 The MAME Team