Previous 199869 Revisions Next

r32221 Saturday 20th September, 2014 at 01:01:17 UTC by Robbbert
peyper.c : added sound
[src/mame/drivers]peyper.c spinb.c

trunk/src/mame/drivers/spinb.c
r32220r32221
3232#include "cpu/z80/z80.h"
3333#include "cpu/mcs51/mcs51.h"
3434#include "machine/i8255.h"
35#include "sound/ay8910.h"
3635#include "sound/msm5205.h"
3736#include "machine/7474.h"
3837
trunk/src/mame/drivers/peyper.c
r32220r32221
1#include "emu.h"
1/********************************************************************************************************
2
3  PINBALL
4  Peyper
5
6*********************************************************************************************************/
7
8#include "machine/genpin.h"
29#include "cpu/z80/z80.h"
10#include "sound/ay8910.h"
311#include "peyper.lh"
412
5class peyper_state : public driver_device
13class peyper_state : public genpin_class
614{
715public:
816   peyper_state(const machine_config &mconfig, device_type type, const char *tag)
9      : driver_device(mconfig, type, tag),
10      m_maincpu(*this, "maincpu") { }
17      : genpin_class(mconfig, type, tag)
18      , m_maincpu(*this, "maincpu")
19   { }
1120
12   UINT8 irq_state;
13
14   UINT8 display_block;
15   UINT8 display[16];
1621   DECLARE_READ8_MEMBER(sw_r);
1722   DECLARE_WRITE8_MEMBER(col_w);
1823   DECLARE_WRITE8_MEMBER(disp_w);
r32220r32221
2126   DECLARE_WRITE8_MEMBER(sol_w);
2227   DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r);
2328   DECLARE_DRIVER_INIT(peyper);
29private:
30   UINT8 irq_state;
31   UINT8 display_block;
32   UINT8 display[16];
2433   virtual void machine_reset();
2534   required_device<cpu_device> m_maincpu;
2635};
r32220r32221
3847
3948static const UINT8 hex_to_7seg[16] =
4049   {0x3F, 0x06, 0x5B, 0x4F,
41      0x66, 0x6D, 0x7D, 0x07,
42      0x7F, 0x6F, 0x00, 0x00,
43      0x00, 0x00, 0x00, 0x00 };
50      0x66, 0x6D, 0x7c, 0x07,
51      0x7F, 0x67, 0x00, 0x00,
52      0x00, 0x00, 0x00, 0x00 }; // 4511
4453
4554/* seems to only work correctly for 'solarwap', 'poleposn' and 'sonstwar' (look at how high-scores are displayed for example) - or shall layout be changed ? */
4655WRITE8_MEMBER(peyper_state::disp_w)
r32220r32221
188197
189198
190199static ADDRESS_MAP_START( peyper_map, AS_PROGRAM, 8, peyper_state )
191//  AM_RANGE(0x0000, 0xffff) AM_NOP
192200   ADDRESS_MAP_UNMAP_HIGH
193201   AM_RANGE(0x0000, 0x5FFF) AM_ROM
194   AM_RANGE(0x6000, 0x67FF) AM_RAM //AM_BASE_GENERIC(nvram)
202   AM_RANGE(0x6000, 0x67FF) AM_RAM AM_SHARE("nvram")
195203ADDRESS_MAP_END
196204
197205static ADDRESS_MAP_START( peyper_io, AS_IO, 8, peyper_state )
198//  AM_RANGE(0x0000, 0xffff) AM_NOP
199206   ADDRESS_MAP_UNMAP_HIGH
200207   ADDRESS_MAP_GLOBAL_MASK(0xff)
201208   AM_RANGE(0x00, 0x00) AM_READWRITE(sw_r,disp_w)
202209   AM_RANGE(0x01, 0x01) AM_WRITE(col_w)
203//  AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay8910_0", ay8910_device, address_w)
204//  AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay8910_0", ay8910_device, data_w)
205//  AM_RANGE(0x08, 0x08) AM_DEVWRITE("ay8910_1", ay8910_device, address_w)
206//  AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("ay8910_1", ay8910_device, data_w)
210   AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay1", ay8910_device, address_w)
211   AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay1", ay8910_device, data_w)
212   AM_RANGE(0x08, 0x08) AM_DEVWRITE("ay2", ay8910_device, address_w)
213   AM_RANGE(0x0a, 0x0a) AM_DEVWRITE("ay2", ay8910_device, data_w)
207214   AM_RANGE(0x0c, 0x0c) AM_WRITE(sol_w)
208215   AM_RANGE(0x10, 0x18) AM_WRITE(lamp_w)
209216   AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW0")
r32220r32221
479486   PORT_DIPSETTING(    0x41, "1000k and 1400k and 8000k / 1610k" )   // manual says "1000k and 1400k / 1600k"
480487   PORT_DIPSETTING(    0x42, "1200k and 1600k and 8000k / 1810k" )   // manual says "1200k and 1600k / 1800k"
481488   PORT_DIPSETTING(    0x43, "1400k and 1800k and 8000k / 2010k" )   // manual says "1400k and 1800k / 2000k"
482   PORT_DIPSETTING(    0x00, "2400k and 2800k and 6800k / 3610k" )   // not mentionned in the manual where it is "conenecte" to DSW1-3 ("Clear RAM on Reset")
489   PORT_DIPSETTING(    0x00, "2400k and 2800k and 6800k / 3610k" )   // not mentioned in the manual where it is "conenecte" to DSW1-3 ("Clear RAM on Reset")
483490INPUT_PORTS_END
484491
485492/* verified from Z80 code - NO manual found ! */
r32220r32221
539546   MCFG_CPU_PROGRAM_MAP(peyper_map)
540547   MCFG_CPU_IO_MAP(peyper_io)
541548   MCFG_CPU_PERIODIC_INT_DRIVER(peyper_state, irq0_line_hold,  1250 * 2)
549   MCFG_NVRAM_ADD_0FILL("nvram")
542550
543
544551   /* video hardware */
545552   MCFG_DEFAULT_LAYOUT(layout_peyper)
553
554   /* Sound */
555   MCFG_FRAGMENT_ADD( genpin_audio )
556   MCFG_SPEAKER_STANDARD_MONO("ayvol")
557   MCFG_SOUND_ADD("ay1", AY8910, 2500000)
558   //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(peyper_state, p1a_w))
559   //MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(peyper_state, p1b_w))
560   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0)
561   MCFG_SOUND_ADD("ay2", AY8910, 2500000)
562   //MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(peyper_state, p2a_w))
563   //MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(peyper_state, p2b_w))
564   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "ayvol", 1.0)
546565MACHINE_CONFIG_END
547566
548567
r32220r32221
653672ROM_END
654673
655674
656GAME( 1985, odin,     0, peyper,   odin_dlx, peyper_state, peyper,   ROT0, "Sonic",  "Odin",                  GAME_IS_SKELETON_MECHANICAL)
657GAME( 1985, odin_dlx, 0, peyper,   odin_dlx, peyper_state, peyper,   ROT0, "Sonic",  "Odin De Luxe",          GAME_IS_SKELETON_MECHANICAL)
658GAME( 1986, solarwap, 0, peyper,   solarwap, peyper_state, peyper,   ROT0, "Sonic",  "Solar Wars (Sonic)",    GAME_IS_SKELETON_MECHANICAL)
659GAME( 1986, gamatros, 0, peyper,   solarwap, peyper_state, peyper,   ROT0, "Sonic",  "Gamatron (Sonic)",    GAME_IS_SKELETON_MECHANICAL)
660GAME( 1987, poleposn, 0, peyper,   poleposn, peyper_state, peyper,   ROT0, "Sonic",  "Pole Position (Sonic)", GAME_IS_SKELETON_MECHANICAL)
661GAME( 1987, sonstwar, 0, peyper,   sonstwar, peyper_state, peyper,   ROT0, "Sonic",  "Star Wars (Sonic)",     GAME_IS_SKELETON_MECHANICAL)
662GAME( 1987, sonstwr2, sonstwar, peyper,   sonstwar, peyper_state, peyper,   ROT0, "Sonic",  "Star Wars (Sonic, alternate set)",     GAME_IS_SKELETON_MECHANICAL)
675GAME( 1985, odin,     0,        peyper,   odin_dlx, peyper_state, peyper,   ROT0, "Sonic",  "Odin",                  GAME_IS_SKELETON_MECHANICAL)
676GAME( 1985, odin_dlx, 0,        peyper,   odin_dlx, peyper_state, peyper,   ROT0, "Sonic",  "Odin De Luxe",          GAME_IS_SKELETON_MECHANICAL)
677GAME( 1986, solarwap, 0,        peyper,   solarwap, peyper_state, peyper,   ROT0, "Sonic",  "Solar Wars (Sonic)",    GAME_IS_SKELETON_MECHANICAL)
678GAME( 1986, gamatros, 0,        peyper,   solarwap, peyper_state, peyper,   ROT0, "Sonic",  "Gamatron (Sonic)",    GAME_IS_SKELETON_MECHANICAL)
679GAME( 1987, poleposn, 0,        peyper,   poleposn, peyper_state, peyper,   ROT0, "Sonic",  "Pole Position (Sonic)", GAME_IS_SKELETON_MECHANICAL)
680GAME( 1987, sonstwar, 0,        peyper,   sonstwar, peyper_state, peyper,   ROT0, "Sonic",  "Star Wars (Sonic, set 1)", GAME_IS_SKELETON_MECHANICAL)
681GAME( 1987, sonstwr2, sonstwar, peyper,   sonstwar, peyper_state, peyper,   ROT0, "Sonic",  "Star Wars (Sonic, set 2)", GAME_IS_SKELETON_MECHANICAL)
663682
664GAME( 1987, wolfman,  0, peyper,   wolfman, peyper_state,  peyper,   ROT0, "Peyper", "Wolf Man",              GAME_IS_SKELETON_MECHANICAL)
665GAME( 1986, nemesisp, 0, peyper,   wolfman, peyper_state,  peyper,   ROT0, "Peyper", "Nemesis",               GAME_IS_SKELETON_MECHANICAL)
666GAME( 1987, odisea,   0, peyper,   odisea, peyper_state,   peyper,   ROT0, "Peyper", "Odisea Paris-Dakar",    GAME_IS_SKELETON_MECHANICAL)
683GAME( 1987, wolfman,  0,        peyper,   wolfman,  peyper_state, peyper,   ROT0, "Peyper", "Wolf Man",              GAME_IS_SKELETON_MECHANICAL)
684GAME( 1986, nemesisp, 0,        peyper,   wolfman,  peyper_state, peyper,   ROT0, "Peyper", "Nemesis",               GAME_IS_SKELETON_MECHANICAL)
685GAME( 1987, odisea,   0,        peyper,   odisea,   peyper_state, peyper,   ROT0, "Peyper", "Odisea Paris-Dakar",    GAME_IS_SKELETON_MECHANICAL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team