Previous 199869 Revisions Next

r17819 Wednesday 12th September, 2012 at 08:46:56 UTC by hap
improved dpoker coin and hopper
[src/mame/drivers]mcr.c
[src/mame/includes]mcr.h

trunk/src/mame/includes/mcr.h
r17818r17819
2727      m_chip_squeak_deluxe(*this, "csd"),
2828      m_sounds_good(*this, "sg"),
2929      m_turbo_chip_squeak(*this, "tcs"),
30      m_squawk_n_talk(*this, "snt")
30      m_squawk_n_talk(*this, "snt"),
31      m_dpoker_coin_in_timer(*this, "dp_coinin"),
32      m_dpoker_hopper_timer(*this, "dp_hopper")
3133   { }
3234
3335   // these should be required but can't because mcr68 shares with us
r17818r17819
4143   optional_device<midway_sounds_good_device> m_sounds_good;
4244   optional_device<midway_turbo_chip_squeak_device> m_turbo_chip_squeak;
4345   optional_device<midway_squawk_n_talk_device> m_squawk_n_talk;
46   optional_device<timer_device> m_dpoker_coin_in_timer;
47   optional_device<timer_device> m_dpoker_hopper_timer;
4448
4549   DECLARE_WRITE8_MEMBER(mcr_control_port_w);
4650   DECLARE_WRITE8_MEMBER(mcr_ipu_laserdisk_w);
r17818r17819
5458   DECLARE_WRITE8_MEMBER(mcr_91490_videoram_w);
5559   DECLARE_READ8_MEMBER(solarfox_ip0_r);
5660   DECLARE_READ8_MEMBER(solarfox_ip1_r);
61   DECLARE_READ8_MEMBER(dpoker_ip0_r);
62   DECLARE_WRITE8_MEMBER(dpoker_p2c_w);
63   DECLARE_WRITE8_MEMBER(dpoker_p30_w);
64   DECLARE_WRITE8_MEMBER(dpoker_p34_w);
5765   DECLARE_READ8_MEMBER(kick_ip1_r);
5866   DECLARE_WRITE8_MEMBER(wacko_op4_w);
5967   DECLARE_READ8_MEMBER(wacko_ip1_r);
r17818r17819
6977   DECLARE_READ8_MEMBER(demoderb_ip2_r);
7078   DECLARE_WRITE8_MEMBER(demoderb_op4_w);
7179
80   DECLARE_INPUT_CHANGED_MEMBER(dpoker_coin_in_hit);
81
7282   DECLARE_DRIVER_INIT(mcr_91490);
7383   DECLARE_DRIVER_INIT(kroozr);
84   DECLARE_DRIVER_INIT(solarfox);
7485   DECLARE_DRIVER_INIT(kick);
86   DECLARE_DRIVER_INIT(dpoker);
7587   DECLARE_DRIVER_INIT(twotiger);
7688   DECLARE_DRIVER_INIT(demoderb);
7789   DECLARE_DRIVER_INIT(wacko);
r17818r17819
7991   DECLARE_DRIVER_INIT(dotrone);
8092   DECLARE_DRIVER_INIT(nflfoot);
8193   DECLARE_DRIVER_INIT(journey);
82   DECLARE_DRIVER_INIT(solarfox);
83   DECLARE_DRIVER_INIT(dpoker);
8494
8595   TILE_GET_INFO_MEMBER(mcr_90009_get_tile_info);
8696   TILE_GET_INFO_MEMBER(mcr_90010_get_tile_info);
trunk/src/mame/drivers/mcr.c
r17818r17819
2121        * Demolition Derby (Turbo Chip Squeak)
2222        * Draw Poker
2323
24    Known bugs:
25        * dpoker needs coincounters and hopper
26
2724****************************************************************************
2825
2926    Early MCR systems have three PCBs, which can be intermixed to a certain
r17818r17819
294291static UINT8 input_mux;
295292static UINT8 last_op4;
296293
294static UINT8 dpoker_coin_status;
295static UINT8 dpoker_output_34;
296
297297static UINT8 nflfoot_serial_out_active;
298298static UINT8 nflfoot_serial_out_bits;
299299static UINT8 nflfoot_serial_out_numbits;
r17818r17819
327327
328328/*************************************
329329 *
330 *  Solar Fox input ports
330 *  Solar Fox I/O ports
331331 *
332332 *************************************/
333333
r17818r17819
358358
359359/*************************************
360360 *
361 *  Kick input ports
361 *  Kick I/O ports
362362 *
363363 *************************************/
364364
r17818r17819
371371
372372/*************************************
373373 *
374 *  Wacko input ports
374 *  Draw Poker I/O ports
375375 *
376376 *************************************/
377377
378TIMER_DEVICE_CALLBACK( dpoker_hopper_callback )
379{
380   mcr_state *state = timer.machine().driver_data<mcr_state>();
381
382   if (dpoker_output_34 & 0x40)
383   {
384      // hopper timing is a guesstimate
385      dpoker_coin_status ^= 8;
386      state->m_dpoker_hopper_timer->adjust(attotime::from_msec((dpoker_coin_status & 8) ? 100 : 250));
387   }
388   else
389   {
390      dpoker_coin_status &= ~8;
391   }
392   
393   coin_counter_w(timer.machine(), 0, dpoker_output_34 & 8);
394}
395
396TIMER_DEVICE_CALLBACK( dpoker_coin_in_callback )
397{
398   dpoker_coin_status &= ~2;
399}
400
401INPUT_CHANGED_MEMBER(mcr_state::dpoker_coin_in_hit)
402{
403   if (newval)
404   {
405      // The game waits for coin release before it accepts another.
406      // It probably does this to prevent tampering, good old coin-on-a-string won't work here.
407      dpoker_coin_status |= 2;
408      m_dpoker_coin_in_timer->adjust(attotime::from_msec(100));
409   }
410}
411
412READ8_MEMBER(mcr_state::dpoker_ip0_r)
413{
414   // d0: Coin-in Hit
415   // d1: Coin-in Release
416   // d2: Coin-out Up
417   // d3: Coin-out Down
418   // d6: Coin-drop Hit
419   // d7: Coin-drop Release
420   UINT8 p0 = ioport("ssio:IP0")->read();
421   p0 |= (dpoker_coin_status >> 1 & 1);
422   p0 ^= (p0 << 1 & 0x80) | dpoker_coin_status;
423   return p0;
424}
425
426
427WRITE8_MEMBER(mcr_state::dpoker_p2c_w)
428{
429   // cpanel button lamps
430   output_set_lamp_value(0, data >> 0 & 1); // hold 0
431   output_set_lamp_value(1, data >> 4 & 1); // hold 1
432   output_set_lamp_value(2, data >> 5 & 1); // hold 2
433   output_set_lamp_value(3, data >> 6 & 1); // hold 3
434   output_set_lamp_value(4, data >> 7 & 1); // hold 4
435   output_set_lamp_value(5, data >> 1 & 1); // deal
436   output_set_lamp_value(6, data >> 2 & 1); // cancel
437   output_set_lamp_value(7, data >> 3 & 1); // stand
438}
439
440WRITE8_MEMBER(mcr_state::dpoker_p30_w)
441{
442   // d5: button lamp: service or change
443   output_set_lamp_value(8, data >> 1 & 1);
444   
445   // d0-d4: marquee lamps: coin 1 to 5 --> output lamps 9 to 13
446   for (int i = 0; i < 5; i++)
447      output_set_lamp_value(9 + i, data >> i & 1);
448   
449   // d6, d7: unused?
450}
451
452WRITE8_MEMBER(mcr_state::dpoker_p34_w)
453{
454   // d0: ? coin return
455   // d1: ? divertor (active low)
456   // d3: coin counter?
457   
458   // d6: assume hopper coin flow
459   // d7: assume hopper motor
460   if (data & 0x40 & ~dpoker_output_34)
461      m_dpoker_hopper_timer->adjust(attotime::from_msec(500));
462   
463   // other bits: unused?
464}
465
466
467
468/*************************************
469 *
470 *  Wacko I/O ports
471 *
472 *************************************/
473
378474WRITE8_MEMBER(mcr_state::wacko_op4_w)
379475{
380476   input_mux = data & 1;
r17818r17819
402498
403499/*************************************
404500 *
405 *  Kozmik Krooz'r input ports
501 *  Kozmik Krooz'r I/O ports
406502 *
407503 *************************************/
408504
r17818r17819
897993
898994static INPUT_PORTS_START( dpoker )
899995   PORT_START("ssio:IP0")
900   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin-in Hit - cursor down in testmode
901   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // Coin-in Release (to register a coin for now, press 5 and 6 is succession)
902   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) // Coin-out Up
903   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // Coin-out Down
996   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, mcr_state, dpoker_coin_in_hit, NULL)
997   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) // see dpoker_ip0_r
998   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) // "
999   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // "
9041000   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
9051001   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
906   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // Coin-drop Hit - select item in testmode
907   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) // Coin-drop Release
1002   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Coin-drop")
1003   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) // "
9081004
9091005   PORT_START("ssio:IP1")
9101006   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
r17818r17819
9171013   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_STAND )
9181014
9191015   PORT_START("ssio:IP2")
920   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1016   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // only in test mode input test
9211017
9221018   // 10-position DIP switch on the sound pcb
923   // settings and defaults are from a sticker inside the cabinet, I don't know where 9 or 10 are connected
1019   // settings and defaults are verified from a sticker inside the cabinet, I don't know where 9 or 10 are connected
9241020   PORT_START("ssio:IP3")
9251021   PORT_DIPNAME( 0x01, 0x01, "Hopper" )         PORT_DIPLOCATION("B3:1")
9261022   PORT_DIPSETTING(    0x01, "Relay Pulse" )
r17818r17819
9571053   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
9581054
9591055   PORT_START("ssio:DIP")
960   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
1056   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // only in test mode input test
9611057
9621058   PORT_START("P24")
963   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) // Hopper Full
1059   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) // Hopper Full (not implemented)
9641060   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
965   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) // Coin Return
1061   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // Coin Return
9661062   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
9671063   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Door 1 Open") PORT_CODE(KEYCODE_A) // CAM OPEN
9681064   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Door 1 Lock") PORT_CODE(KEYCODE_S) // CAM LOCK
r17818r17819
9701066   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Door 2 Lock") PORT_CODE(KEYCODE_F) // HNG LOCK
9711067
9721068   PORT_START("P28")
973   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1069   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
9741070
9751071   PORT_START("P2C")
9761072   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ? ARM HIT
r17818r17819
17541850MACHINE_CONFIG_END
17551851
17561852
1853/* as above, but in a casino cabinet */
1854static MACHINE_CONFIG_DERIVED( mcr_90009_dp, mcr_90009 )
1855
1856   /* basic machine hardware */
1857   MCFG_TIMER_ADD("dp_coinin", dpoker_coin_in_callback)
1858   MCFG_TIMER_ADD("dp_hopper", dpoker_hopper_callback)
1859MACHINE_CONFIG_END
1860
1861
17571862/* 90010 CPU board plus 90908/90913/91483 sound board */
17581863static MACHINE_CONFIG_DERIVED( mcr_90010, mcr_90009 )
17591864
r17818r17819
26622767DRIVER_INIT_MEMBER(mcr_state,solarfox)
26632768{
26642769   mcr_init(machine(), 90009, 91399, 90908);
2770   mcr12_sprite_xoffs = 16;
26652771
26662772   machine().device<midway_ssio_device>("ssio")->set_custom_input(0, 0x1c, read8_delegate(FUNC(mcr_state::solarfox_ip0_r),this));
26672773   machine().device<midway_ssio_device>("ssio")->set_custom_input(1, 0xff, read8_delegate(FUNC(mcr_state::solarfox_ip1_r),this));
2668
2669   mcr12_sprite_xoffs = 16;
26702774}
26712775
26722776
26732777DRIVER_INIT_MEMBER(mcr_state,kick)
26742778{
26752779   mcr_init(machine(), 90009, 91399, 90908);
2780   mcr12_sprite_xoffs_flip = 16;
26762781
26772782   machine().device<midway_ssio_device>("ssio")->set_custom_input(1, 0xf0, read8_delegate(FUNC(mcr_state::kick_ip1_r),this));
2678
2679   mcr12_sprite_xoffs_flip = 16;
26802783}
26812784
26822785
26832786DRIVER_INIT_MEMBER(mcr_state,dpoker)
26842787{
26852788   mcr_init(machine(), 90009, 91399, 90908);
2789   mcr12_sprite_xoffs_flip = 16;
26862790
2791   machine().device<midway_ssio_device>("ssio")->set_custom_input(0, 0x8e, read8_delegate(FUNC(mcr_state::dpoker_ip0_r),this));
2792
26872793   machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x24, 0x24, "P24");
26882794   machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x28, 0x28, "P28");
26892795   machine().device("maincpu")->memory().space(AS_IO)->install_read_port(0x2c, 0x2c, "P2C");
26902796
2691   mcr12_sprite_xoffs_flip = 16;
2797   machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x2c, 0x2c, write8_delegate(FUNC(mcr_state::dpoker_p2c_w),this));
2798   machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x30, 0x30, write8_delegate(FUNC(mcr_state::dpoker_p30_w),this));
2799   machine().device("maincpu")->memory().space(AS_IO)->install_write_handler(0x34, 0x34, write8_delegate(FUNC(mcr_state::dpoker_p34_w),this));
2800   
2801   dpoker_coin_status = 0;
2802   dpoker_output_34 = 0;
2803
2804   state_save_register_global(machine(), dpoker_coin_status);
2805   state_save_register_global(machine(), dpoker_output_34);
26922806}
26932807
26942808
r17818r17819
27922906GAME( 1981, kick,     0,        mcr_90009,     kick, mcr_state,     kick,      ORIENTATION_SWAP_XY,        "Midway", "Kick (upright)", GAME_SUPPORTS_SAVE )
27932907GAME( 1981, kickman,  kick,     mcr_90009,     kick, mcr_state,     kick,      ORIENTATION_SWAP_XY,        "Midway", "Kickman (upright)", GAME_SUPPORTS_SAVE )
27942908GAME( 1981, kickc,    kick,     mcr_90009,     kickc, mcr_state,    kick,      ROT90,                      "Midway", "Kick (cocktail)", GAME_SUPPORTS_SAVE )
2795GAME( 1985, dpoker,   0,        mcr_90009   dpoker, mcr_state,   dpoker,    0,                          "Bally",  "Draw Poker (Bally, 03-20)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2909GAME( 1985, dpoker,   0,        mcr_90009_dpdpoker, mcr_state,   dpoker,    ROT0,                       "Bally",  "Draw Poker (Bally, 03-20)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
27962910
27972911/* 90010 CPU board + 91399 video gen + 90913 sound I/O */
27982912GAME( 1981, shollow,  0,        mcr_90010,     shollow, mcr_state,  mcr_90010, ROT90, "Bally Midway", "Satan's Hollow (set 1)", GAME_SUPPORTS_SAVE )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team