trunk/src/mame/drivers/peyper.c
| r32220 | r32221 | |
| 1 | | #include "emu.h" |
| 1 | /******************************************************************************************************** |
| 2 | |
| 3 | PINBALL |
| 4 | Peyper |
| 5 | |
| 6 | *********************************************************************************************************/ |
| 7 | |
| 8 | #include "machine/genpin.h" |
| 2 | 9 | #include "cpu/z80/z80.h" |
| 10 | #include "sound/ay8910.h" |
| 3 | 11 | #include "peyper.lh" |
| 4 | 12 | |
| 5 | | class peyper_state : public driver_device |
| 13 | class peyper_state : public genpin_class |
| 6 | 14 | { |
| 7 | 15 | public: |
| 8 | 16 | 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 | { } |
| 11 | 20 | |
| 12 | | UINT8 irq_state; |
| 13 | | |
| 14 | | UINT8 display_block; |
| 15 | | UINT8 display[16]; |
| 16 | 21 | DECLARE_READ8_MEMBER(sw_r); |
| 17 | 22 | DECLARE_WRITE8_MEMBER(col_w); |
| 18 | 23 | DECLARE_WRITE8_MEMBER(disp_w); |
| r32220 | r32221 | |
| 21 | 26 | DECLARE_WRITE8_MEMBER(sol_w); |
| 22 | 27 | DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r); |
| 23 | 28 | DECLARE_DRIVER_INIT(peyper); |
| 29 | private: |
| 30 | UINT8 irq_state; |
| 31 | UINT8 display_block; |
| 32 | UINT8 display[16]; |
| 24 | 33 | virtual void machine_reset(); |
| 25 | 34 | required_device<cpu_device> m_maincpu; |
| 26 | 35 | }; |
| r32220 | r32221 | |
| 38 | 47 | |
| 39 | 48 | static const UINT8 hex_to_7seg[16] = |
| 40 | 49 | {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 |
| 44 | 53 | |
| 45 | 54 | /* seems to only work correctly for 'solarwap', 'poleposn' and 'sonstwar' (look at how high-scores are displayed for example) - or shall layout be changed ? */ |
| 46 | 55 | WRITE8_MEMBER(peyper_state::disp_w) |
| r32220 | r32221 | |
| 188 | 197 | |
| 189 | 198 | |
| 190 | 199 | static ADDRESS_MAP_START( peyper_map, AS_PROGRAM, 8, peyper_state ) |
| 191 | | // AM_RANGE(0x0000, 0xffff) AM_NOP |
| 192 | 200 | ADDRESS_MAP_UNMAP_HIGH |
| 193 | 201 | 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") |
| 195 | 203 | ADDRESS_MAP_END |
| 196 | 204 | |
| 197 | 205 | static ADDRESS_MAP_START( peyper_io, AS_IO, 8, peyper_state ) |
| 198 | | // AM_RANGE(0x0000, 0xffff) AM_NOP |
| 199 | 206 | ADDRESS_MAP_UNMAP_HIGH |
| 200 | 207 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 201 | 208 | AM_RANGE(0x00, 0x00) AM_READWRITE(sw_r,disp_w) |
| 202 | 209 | 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) |
| 207 | 214 | AM_RANGE(0x0c, 0x0c) AM_WRITE(sol_w) |
| 208 | 215 | AM_RANGE(0x10, 0x18) AM_WRITE(lamp_w) |
| 209 | 216 | AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW0") |
| r32220 | r32221 | |
| 479 | 486 | PORT_DIPSETTING( 0x41, "1000k and 1400k and 8000k / 1610k" ) // manual says "1000k and 1400k / 1600k" |
| 480 | 487 | PORT_DIPSETTING( 0x42, "1200k and 1600k and 8000k / 1810k" ) // manual says "1200k and 1600k / 1800k" |
| 481 | 488 | 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") |
| 483 | 490 | INPUT_PORTS_END |
| 484 | 491 | |
| 485 | 492 | /* verified from Z80 code - NO manual found ! */ |
| r32220 | r32221 | |
| 539 | 546 | MCFG_CPU_PROGRAM_MAP(peyper_map) |
| 540 | 547 | MCFG_CPU_IO_MAP(peyper_io) |
| 541 | 548 | MCFG_CPU_PERIODIC_INT_DRIVER(peyper_state, irq0_line_hold, 1250 * 2) |
| 549 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 542 | 550 | |
| 543 | | |
| 544 | 551 | /* video hardware */ |
| 545 | 552 | 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) |
| 546 | 565 | MACHINE_CONFIG_END |
| 547 | 566 | |
| 548 | 567 | |
| r32220 | r32221 | |
| 653 | 672 | ROM_END |
| 654 | 673 | |
| 655 | 674 | |
| 656 | | GAME( 1985, odin, 0, peyper, odin_dlx, peyper_state, peyper, ROT0, "Sonic", "Odin", GAME_IS_SKELETON_MECHANICAL) |
| 657 | | GAME( 1985, odin_dlx, 0, peyper, odin_dlx, peyper_state, peyper, ROT0, "Sonic", "Odin De Luxe", GAME_IS_SKELETON_MECHANICAL) |
| 658 | | GAME( 1986, solarwap, 0, peyper, solarwap, peyper_state, peyper, ROT0, "Sonic", "Solar Wars (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 659 | | GAME( 1986, gamatros, 0, peyper, solarwap, peyper_state, peyper, ROT0, "Sonic", "Gamatron (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 660 | | GAME( 1987, poleposn, 0, peyper, poleposn, peyper_state, peyper, ROT0, "Sonic", "Pole Position (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 661 | | GAME( 1987, sonstwar, 0, peyper, sonstwar, peyper_state, peyper, ROT0, "Sonic", "Star Wars (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 662 | | GAME( 1987, sonstwr2, sonstwar, peyper, sonstwar, peyper_state, peyper, ROT0, "Sonic", "Star Wars (Sonic, alternate set)", GAME_IS_SKELETON_MECHANICAL) |
| 675 | GAME( 1985, odin, 0, peyper, odin_dlx, peyper_state, peyper, ROT0, "Sonic", "Odin", GAME_IS_SKELETON_MECHANICAL) |
| 676 | GAME( 1985, odin_dlx, 0, peyper, odin_dlx, peyper_state, peyper, ROT0, "Sonic", "Odin De Luxe", GAME_IS_SKELETON_MECHANICAL) |
| 677 | GAME( 1986, solarwap, 0, peyper, solarwap, peyper_state, peyper, ROT0, "Sonic", "Solar Wars (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 678 | GAME( 1986, gamatros, 0, peyper, solarwap, peyper_state, peyper, ROT0, "Sonic", "Gamatron (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 679 | GAME( 1987, poleposn, 0, peyper, poleposn, peyper_state, peyper, ROT0, "Sonic", "Pole Position (Sonic)", GAME_IS_SKELETON_MECHANICAL) |
| 680 | GAME( 1987, sonstwar, 0, peyper, sonstwar, peyper_state, peyper, ROT0, "Sonic", "Star Wars (Sonic, set 1)", GAME_IS_SKELETON_MECHANICAL) |
| 681 | GAME( 1987, sonstwr2, sonstwar, peyper, sonstwar, peyper_state, peyper, ROT0, "Sonic", "Star Wars (Sonic, set 2)", GAME_IS_SKELETON_MECHANICAL) |
| 663 | 682 | |
| 664 | | GAME( 1987, wolfman, 0, peyper, wolfman, peyper_state, peyper, ROT0, "Peyper", "Wolf Man", GAME_IS_SKELETON_MECHANICAL) |
| 665 | | GAME( 1986, nemesisp, 0, peyper, wolfman, peyper_state, peyper, ROT0, "Peyper", "Nemesis", GAME_IS_SKELETON_MECHANICAL) |
| 666 | | GAME( 1987, odisea, 0, peyper, odisea, peyper_state, peyper, ROT0, "Peyper", "Odisea Paris-Dakar", GAME_IS_SKELETON_MECHANICAL) |
| 683 | GAME( 1987, wolfman, 0, peyper, wolfman, peyper_state, peyper, ROT0, "Peyper", "Wolf Man", GAME_IS_SKELETON_MECHANICAL) |
| 684 | GAME( 1986, nemesisp, 0, peyper, wolfman, peyper_state, peyper, ROT0, "Peyper", "Nemesis", GAME_IS_SKELETON_MECHANICAL) |
| 685 | GAME( 1987, odisea, 0, peyper, odisea, peyper_state, peyper, ROT0, "Peyper", "Odisea Paris-Dakar", GAME_IS_SKELETON_MECHANICAL) |