From 092528e18a3f233d376fb98c6e44ee56097d1316 Mon Sep 17 00:00:00 2001 From: happppp Date: Wed, 29 Oct 2014 16:59:32 +0100 Subject: [PATCH] segaufo layout file placeholder --- src/mame/drivers/segaufo.c | 56 ++++++++++++++++++++++++++----------- src/mame/layout/segaufo.lay | 30 ++++++++++++++++++++ src/mame/machine/315_5296.h | 2 ++ src/mame/mame.mak | 2 ++ 4 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 src/mame/layout/segaufo.lay diff --git a/src/mame/drivers/segaufo.c b/src/mame/drivers/segaufo.c index 63e41ea4029..a82911d1e34 100644 --- a/src/mame/drivers/segaufo.c +++ b/src/mame/drivers/segaufo.c @@ -47,6 +47,9 @@ #include "machine/pit8253.h" #include "machine/315_5296.h" #include "sound/2612intf.h" +#include "sound/upd7759.h" + +#include "segaufo.lh" /* simulation parameters */ @@ -69,10 +72,12 @@ class ufo_state : public driver_device public: ufo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + m_maincpu(*this, "maincpu"), + m_upd(*this, "upd") { } required_device m_maincpu; + optional_device m_upd; struct Player { @@ -103,6 +108,7 @@ public: virtual void machine_reset(); virtual void machine_start(); TIMER_DEVICE_CALLBACK_MEMBER(simulate_xyz); + TIMER_DEVICE_CALLBACK_MEMBER(update_info); }; @@ -123,7 +129,6 @@ void ufo_state::motor_tick(int p, int m) m_player[p].motor[m].position = 1; } - TIMER_DEVICE_CALLBACK_MEMBER(ufo_state::simulate_xyz) { for (int p = 0; p < 2; p++) @@ -131,6 +136,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(ufo_state::simulate_xyz) motor_tick(p, m); } + +TIMER_DEVICE_CALLBACK_MEMBER(ufo_state::update_info) +{ + ; +} + + /*************************************************************************** I/O @@ -144,14 +156,14 @@ WRITE_LINE_MEMBER(ufo_state::pit_out0) WRITE_LINE_MEMBER(ufo_state::pit_out1) { - // ? + // NMI? + if (state) + m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } WRITE_LINE_MEMBER(ufo_state::pit_out2) { - // NMI? - if (state) - m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); + // ? } @@ -370,20 +382,31 @@ void ufo_state::machine_reset() void ufo_state::machine_start() { - // init/zerofill + // init/zerofill/register for savestates static const float motor_speeds[4] = { 1.0f/CABINET_WIDTH, 1.0f/CABINET_DEPTH, 1.0f/CABINET_HEIGHT, 1.0f/CRANE_SIZE }; - for (int p = 0; p < 2; p++) + for (int m = 0; m < 4; m++) { - for (int m = 0; m < 4; m++) + for (int p = 0; p < 2; p++) { m_player[p].motor[m].running = 0; m_player[p].motor[m].direction = 0; m_player[p].motor[m].position = 0.5; m_player[p].motor[m].speed = motor_speeds[m]; } + + save_item(NAME(m_player[0].motor[m].running), m); + save_item(NAME(m_player[0].motor[m].direction), m); + save_item(NAME(m_player[0].motor[m].position), m); + + save_item(NAME(m_player[1].motor[m].running), m); + save_item(NAME(m_player[1].motor[m].direction), m); + save_item(NAME(m_player[1].motor[m].position), m); } + + m_stepper = 0; + save_item(NAME(m_stepper)); } WRITE_LINE_MEMBER(ufo_state::ym3438_irq) @@ -399,6 +422,7 @@ static MACHINE_CONFIG_START( ufo, ufo_state ) MCFG_CPU_IO_MAP(ufo_portmap) MCFG_TIMER_DRIVER_ADD_PERIODIC("motor_timer", ufo_state, simulate_xyz, attotime::from_hz(MOTOR_SPEED)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("update_timer", ufo_state, update_info, attotime::from_hz(60)) MCFG_DEVICE_ADD("io1", SEGA_315_5296, 16000000) // all ports set to input @@ -490,10 +514,10 @@ ROM_START( ufo800 ) ROM_END -GAME (1991, newufo, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (standard)", GAME_MECHANICAL ) -GAME (1991, newufo_sonic, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Sonic The Hedgehog)", GAME_MECHANICAL ) -GAME (1991, newufo_nfl, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Team NFL)", GAME_MECHANICAL ) -GAME (1991, newufo_xmas, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Christmas season ROM kit)", GAME_MECHANICAL ) -GAME (1991, ufomini, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher Mini", GAME_NOT_WORKING | GAME_MECHANICAL ) -GAME (1996, ufo21, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 21", GAME_NOT_WORKING | GAME_MECHANICAL ) -GAME (1998, ufo800, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 800", GAME_NOT_WORKING | GAME_MECHANICAL ) +GAMEL( 1991, newufo, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (standard)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) +GAMEL( 1991, newufo_sonic, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Sonic The Hedgehog)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) +GAMEL( 1991, newufo_nfl, newufo, ufo, ufo, driver_device, 0, ROT0, "Sega", "New UFO Catcher (Team NFL)", GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) +GAMEL( 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 ) +GAMEL( 1991, ufomini, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher Mini", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) +GAMEL( 1996, ufo21, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 21", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) +GAMEL( 1998, ufo800, 0, ufo, ufo, driver_device, 0, ROT0, "Sega", "UFO Catcher 800", GAME_NOT_WORKING | GAME_MECHANICAL | GAME_SUPPORTS_SAVE, layout_segaufo ) diff --git a/src/mame/layout/segaufo.lay b/src/mame/layout/segaufo.lay new file mode 100644 index 00000000000..e9289dbdb36 --- /dev/null +++ b/src/mame/layout/segaufo.lay @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/machine/315_5296.h b/src/mame/machine/315_5296.h index a3882475db6..d9c43a01118 100644 --- a/src/mame/machine/315_5296.h +++ b/src/mame/machine/315_5296.h @@ -100,6 +100,8 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); + + UINT8 debug_peek_output(offs_t offset) { return m_output_latch[offset & 7]; } protected: // device-level overrides diff --git a/src/mame/mame.mak b/src/mame/mame.mak index 397751bd24b..f8c1ec2ddd6 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -2833,6 +2833,8 @@ $(DRIVERS)/segaorun.o: $(LAYOUT)/outrun.lh $(DRIVERS)/segas32.o: $(LAYOUT)/radr.lh +$(DRIVERS)/segaufo.o: $(LAYOUT)/segaufo.lh + $(DRIVERS)/segaybd.o: $(LAYOUT)/pdrift.lh $(DRIVERS)/sigmab52.o: $(LAYOUT)/sigmab52.lh