Previous 199869 Revisions Next

r34993 Friday 13th February, 2015 at 01:09:37 UTC by hap
(MESS)New Working Game Added
----------------------
Tomy Tennis [hap, Kevin Horton]
[src/mess/drivers]tmtennis.c

trunk/src/mess/drivers/tmtennis.c
r243504r243505
99 
1010  The initial release of this game was in 1979, known as Pro-Tennis,
1111  it is unknown if the hardware and/or ROM contents differ.
12
13  This is an early VFD simple electronic tennis game. Player 1 is on the right
14  side, player 2 or CPU on the left. Each player has six possible positions
15  where to hit the ball. A backdrop behind the VFD shows a tennis court.
1216 
17  NOTE!: MESS external artwork is required to be able to play
1318
14  TODO:
15  - 2-player mode doesn't work: the guys auto-serve and the left player
16    always hits the net, mcu emulation bug?
17  - difficulty switch changes mcu freq
18
1919***************************************************************************/
2020
2121#include "emu.h"
r243504r243505
2424
2525#include "tmtennis.lh" // this is a test layout, external artwork is necessary
2626
27// master clock is from an LC circuit oscillating by default at 360kHz,
28// the difficulty switch puts a capacitor across it to slow it down to 260kHz
29#define MASTER_CLOCK_PRO1 (260000)
30#define MASTER_CLOCK_PRO2 (360000)
3127
32
3328class tmtennis_state : public driver_device
3429{
3530public:
r243504r243505
5348   DECLARE_WRITE8_MEMBER(plate_w);
5449   DECLARE_WRITE8_MEMBER(grid_w);
5550
51   DECLARE_INPUT_CHANGED_MEMBER(difficulty_switch);
52   void update_clock();
53
5654   UINT16 m_vfd_state[0x10];
5755   void update_vfd();
5856
57   virtual void machine_reset();
5958   virtual void machine_start();
6059};
6160
61// master clock is from an LC circuit oscillating by default at 360kHz, but...
62#define MASTER_CLOCK (360000)
6263
64void tmtennis_state::update_clock()
65{
66   // ...on PRO1, the difficulty switch puts a capacitor across the LC circuit
67   // to slow it down to approx. 260kHz (28%)
68   m_maincpu->set_clock_scale(m_button_matrix[1]->read() & 0x100 ? 0.72 : 1);
69}
6370
71
72
6473/***************************************************************************
6574
6675  Display
r243504r243505
95104
96105   // read selected button rows
97106   for (int i = 0; i < 2; i++)
98      if (~m_input_mux >> i & 1)
107      if (m_input_mux >> i & 1)
99108         inp &= m_button_matrix[i]->read();
100109
101110   return inp >> (offset*4);
r243504r243505
137146
138147***************************************************************************/
139148
149INPUT_CHANGED_MEMBER(tmtennis_state::difficulty_switch)
150{
151   update_clock();
152}
153
140154/* Pro-Tennis physical button layout and labels is like this:
141155
142156    [SERVE] [1] [2] [3]       [3] [2] [1] [SERVE]
r243504r243505
146160*/
147161
148162static INPUT_PORTS_START( tmtennis )
149   PORT_START("IN.0") // E0 port A/B (left side)
150   PORT_CONFNAME( 0x101, 0x001, DEF_STR( Difficulty ) )
163   PORT_START("IN.0") // E0 port A/B
164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Serve")
165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Serve")
166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
168   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
169   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 )
170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 )
172
173   PORT_START("IN.1") // E1 port A/B
174   PORT_CONFNAME( 0x101, 0x101, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, tmtennis_state, difficulty_switch, NULL)
151175   PORT_CONFSETTING(     0x000, "Practice" )
152   PORT_CONFSETTING(     0x001, "Pro 1" )
153   PORT_CONFSETTING(     0x101, "Pro 2" )
154   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) // P2 serve
176   PORT_CONFSETTING(     0x101, "Pro 1" ) // -> difficulty_switch
177   PORT_CONFSETTING(     0x001, "Pro 2" )
178   PORT_CONFNAME( 0x02, 0x02, "Players" )
179   PORT_CONFSETTING(    0x02, "1" )
180   PORT_CONFSETTING(    0x00, "2" )
155181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
156182   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
157183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
158184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
159185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
160186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
161
162   PORT_START("IN.1") // E1 port A/B (right side)
163   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) // P1 serve
164   PORT_CONFNAME( 0x02, 0x02, "Players" )
165   PORT_CONFSETTING(    0x02, "1" )
166   PORT_CONFSETTING(    0x00, "2" )
167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
170   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 )
171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
172   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 )
173187INPUT_PORTS_END
174188
175189
r243504r243505
180194
181195***************************************************************************/
182196
197void tmtennis_state::machine_reset()
198{
199   update_clock();
200}
201
183202void tmtennis_state::machine_start()
184203{
185204   // zerofill
r243504r243505
199218static MACHINE_CONFIG_START( tmtennis, tmtennis_state )
200219
201220   /* basic machine hardware */
202   MCFG_CPU_ADD("maincpu", NEC_D552, MASTER_CLOCK_PRO2)
221   MCFG_CPU_ADD("maincpu", NEC_D552, MASTER_CLOCK)
203222   MCFG_UCOM4_READ_A_CB(READ8(tmtennis_state, input_r))
204223   MCFG_UCOM4_READ_B_CB(READ8(tmtennis_state, input_r))
205224   MCFG_UCOM4_WRITE_C_CB(WRITE8(tmtennis_state, plate_w))
r243504r243505
234253ROM_END
235254
236255
237CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomytronic)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
256CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomytronic)", GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team