Previous 199869 Revisions Next

r33059 Wednesday 29th October, 2014 at 19:13:05 UTC by hap
ufomini works
[src/mame/drivers]segaufo.c

trunk/src/mame/drivers/segaufo.c
r241570r241571
7373   ufo_state(const machine_config &mconfig, device_type type, const char *tag)
7474      : driver_device(mconfig, type, tag),
7575      m_maincpu(*this, "maincpu"),
76      m_io1(*this, "io1"),
77      m_io2(*this, "io2"),
7678      m_upd(*this, "upd")
7779   { }
7880
7981   required_device<cpu_device> m_maincpu;
82   required_device<sega_315_5296_device> m_io1;
83   required_device<sega_315_5296_device> m_io2;
8084   optional_device<upd7759_device> m_upd;
8185   
8286   struct Player
r241570r241571
113117
114118
115119
116
117120void ufo_state::motor_tick(int p, int m)
118121{
119122   float delta = m_player[p].motor[m].speed;
r241570r241571
139142
140143TIMER_DEVICE_CALLBACK_MEMBER(ufo_state::update_info)
141144{
142   ;
145#if 0
146   char msg1[0x100]={0};
147   char msg2[0x100]={0};
148   for (int i = 0; i < 8; i++)
149   {
150      sprintf(msg2, "%02X ", m_io2->debug_peek_output(i));
151      strcat(msg1, msg2);
152   }
153   for (int i = 0; i < 4; i++)
154   {
155      sprintf(msg2, "\n%d %05f", i, m_player[0].motor[i].position);
156      strcat(msg1, msg2);
157   }
158   popmessage("%s", msg1);
159#endif
143160}
144161
145162
163
146164/***************************************************************************
147165
148166  I/O
r241570r241571
246264READ8_MEMBER(ufo_state::crane_limits_r)
247265{
248266   int p = offset & 1;
249   UINT8 ret = 0xff;
267   UINT8 ret = 0x7f;
250268
251269   // d0: left limit sw (right for p2)
252270   // d1: right limit sw (left for p2)
r241570r241571
264282   if (m_player[p].motor[3].position >= 0.97)
265283      ret ^= 0x40;
266284   
267   // d7: ?
285   // d7: prize sensor (mirror?)
286   ret |= (ioport(p ? "P2" : "P1")->read() & 0x80);
268287
269288   return ret;
270289}
271290
272291
273292
274
275293static ADDRESS_MAP_START( ufo_map, AS_PROGRAM, 8, ufo_state )
276294   AM_RANGE(0x0000, 0xbfff) AM_ROM
277295   AM_RANGE(0xe000, 0xffff) AM_RAM
r241570r241571
294312
295313***************************************************************************/
296314
297static INPUT_PORTS_START( ufo )
315static INPUT_PORTS_START( newufo )
298316   PORT_START("P1")
299317   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("P1 Coin 1")
300318   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("P1 Coin 2")
r241570r241571
354372   PORT_DIPNAME( 0x08, 0x08, "UNK2-08" )
355373   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
356374   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
357   PORT_DIPNAME( 0x10, 0x10, "UNK2-10 Enable Prize Sensor" )
375   PORT_DIPNAME( 0x10, 0x10, "UNK2-10 Disable Prize Sensor" )
358376   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
359377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
360378   PORT_DIPNAME( 0x20, 0x20, "UNK2-20" )
r241570r241571
368386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
369387INPUT_PORTS_END
370388
389static INPUT_PORTS_START( ufomini )
390   PORT_INCLUDE( newufo )
371391
392   PORT_MODIFY("P2")
393   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
394INPUT_PORTS_END
372395
396
397
373398/***************************************************************************
374399
375400  Machine Config
r241570r241571
414439   m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
415440}
416441
417static MACHINE_CONFIG_START( ufo, ufo_state )
442static MACHINE_CONFIG_START( newufo, ufo_state )
418443
419444   /* basic machine hardware */
420445   MCFG_CPU_ADD("maincpu", Z80, 8000000)
r241570r241571
428453   // all ports set to input
429454   MCFG_315_5296_IN_PORTA_CB(READ8(ufo_state, crane_limits_r))
430455   MCFG_315_5296_IN_PORTB_CB(READ8(ufo_state, crane_limits_r))
431//   MCFG_315_5296_IN_PORTC_CB(NOOP)
432//   MCFG_315_5296_IN_PORTD_CB(NOOP)
433456   MCFG_315_5296_IN_PORTE_CB(IOPORT("P1"))
434457   MCFG_315_5296_IN_PORTF_CB(IOPORT("DSW1"))
435458   MCFG_315_5296_IN_PORTG_CB(IOPORT("DSW2"))
r241570r241571
444467   MCFG_315_5296_OUT_PORTE_CB(WRITE8(ufo_state, crane_xyz_w))
445468   MCFG_315_5296_OUT_PORTF_CB(WRITE8(ufo_state, crane_xyz_w))
446469   MCFG_315_5296_OUT_PORTG_CB(WRITE8(ufo_state, ufo_lamps_w))
447//   MCFG_315_5296_OUT_PORTH_CB(NOOP)
448470
449471   MCFG_DEVICE_ADD("pit", PIT8254, 0) // uPD71054C, configuration is unknown
450472   MCFG_PIT8253_CLK0(8000000/256)
r241570r241571
465487   MCFG_SOUND_ROUTE(1, "mono", 0.40)
466488MACHINE_CONFIG_END
467489
490static MACHINE_CONFIG_DERIVED( ufomini, newufo )
468491
492   /* basic machine hardware */
493   MCFG_DEVICE_MODIFY("io1")
494   MCFG_315_5296_IN_PORTC_CB(IOPORT("P1"))
495   MCFG_315_5296_IN_PORTE_CB(NOOP)
496   MCFG_315_5296_IN_PORTH_CB(NOOP)
497MACHINE_CONFIG_END
469498
499
500
470501/***************************************************************************
471502
472503  Game drivers
r241570r241571
514545ROM_END
515546
516547
517GAMEL( 1991, newufo,       0,      ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (standard)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
518GAMEL( 1991, newufo_sonic, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Sonic The Hedgehog)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
519GAMEL( 1991, newufo_nfl,   newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Team NFL)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
520GAMEL( 1991, newufo_xmas,  newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Christmas season ROM kit)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
521GAMEL( 1991, ufomini,      0,      ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher Mini", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
522GAMEL( 1996, ufo21,        0,      ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 21", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
523GAMEL( 1998, ufo800,       0,      ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 800", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
548GAMEL( 1991, newufo,       0,      newufo,  newufo,  driver_device, 0, ROT0, "Sega", "New UFO Catcher (standard)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
549GAMEL( 1991, newufo_sonic, newufo, newufo,  newufo,  driver_device, 0, ROT0, "Sega", "New UFO Catcher (Sonic The Hedgehog)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
550GAMEL( 1991, newufo_nfl,   newufo, newufo,  newufo,  driver_device, 0, ROT0, "Sega", "New UFO Catcher (Team NFL)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
551GAMEL( 1991, newufo_xmas,  newufo, newufo,  newufo,  driver_device, 0, ROT0, "Sega", "New UFO Catcher (Christmas season ROM kit)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
552GAMEL( 1991, ufomini,      0,      ufomini, ufomini, driver_device, 0, ROT0, "Sega", "UFO Catcher Mini", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
553GAMEL( 1996, ufo21,        0,      newufo,  newufo,  driver_device, 0, ROT0, "Sega", "UFO Catcher 21", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )
554GAMEL( 1998, ufo800,       0,      newufo,  newufo,  driver_device, 0, ROT0, "Sega", "UFO Catcher 800", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team