Previous 199869 Revisions Next

r18084 Sunday 23rd September, 2012 at 09:13:55 UTC by Robbbert
ROTATION - Added motor simulation; added nvram; added mechanical sounds; added notes [Robbbert]
[src/mame/drivers]g627.c
[src/mame/layout]g627.lay

trunk/src/mame/layout/g627.lay
r18083r18084
1616         <color red="0.0" green="0.0" blue="0.0" />
1717      </rect>
1818   </element>
19   <element name="P0"><text string="Balls"><color red="1.0" green="1.0" blue="1.0" /></text></element>
19   <element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element>
2020   <element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element>
2121   <element name="P3"><text string="East"><color red="1.0" green="1.0" blue="1.0" /></text></element>
2222   <element name="P4"><text string="North"><color red="1.0" green="1.0" blue="1.0" /></text></element>
trunk/src/mame/drivers/g627.c
r18083r18084
1414    to start.
1515
1616    Schematic and PinMAME used as references
17    System made working in Sept 2012 [Robbbert]
1718
1819Machine Operation:
191. Press num-enter then END then .(period key)   (the displays will flash 400000)
202. Press num-enter
213. Insert a coin, credit will be registered
224. Hold X and start game. When 00 is flashing, release X
235. Press any of QWERYUIOASDFGHJKLZ-='; to simulate scoring shots (T will tilt)
246. Press and hold X to simulate losing the ball
257. When score starts flashing, release X and go to step 5 to play next ball
201. Press .(period key) (this sets up nvram and the displays will flash 400000)
212. Insert a coin, credit will be registered
223. Hold X and start game. When 00 is flashing, release X
234. Press any of QWERYUIOASDFGHJKLZ-='; to simulate scoring shots (T will tilt)
245. Press and hold X to simulate losing the ball
256. When score starts flashing, release X and go to step 5 to play next ball
2626
2727Notes: Do not play more than one player because the machine will try to
2828rotate the table, and the motor circuits are not emulated due to lack of info.
r18083r18084
3232high score, etc., with the diagnostic keyboard.
3333
3434ToDo:
35- Battery backup
36- Outputs
37- Simulate motor circuitry and sensor feedback
38- Verify labels of East, West and South on the display panel
35- Lamp outputs
3936- Possibility of a rom missing (most likely it is optional)
4037
4138*******************************************************************************/
4239
4340
44#include "emu.h"
41#include "machine/genpin.h"
4542#include "cpu/z80/z80.h"
4643#include "machine/i8155.h"
44#include "machine/nvram.h"
4745#include "sound/astrocde.h"
4846#include "g627.lh"
4947
r18083r18084
5351public:
5452   g627_state(const machine_config &mconfig, device_type type, const char *tag)
5553      : driver_device(mconfig, type, tag),
56   m_maincpu(*this, "maincpu")
54   m_maincpu(*this, "maincpu"),
55   m_samples(*this, "samples")
5756   { }
5857
5958   DECLARE_READ8_MEMBER(porta_r);
r18083r18084
6665
6766   // devices
6867   required_device<cpu_device> m_maincpu;
68   required_device<samples_device> m_samples;
6969
70   // driver_device overrides
71   virtual void machine_reset();
7270private:
7371   UINT8 m_seg[6];
7472   UINT8 m_portc;
73   UINT8 m_motor;
7574};
7675
7776
7877static ADDRESS_MAP_START( g627_map, AS_PROGRAM, 8, g627_state )
7978   AM_RANGE(0x0000, 0x1fff) AM_ROM
8079   AM_RANGE(0xc000, 0xc0ff) AM_DEVREADWRITE("i8156", i8155_device, memory_r, memory_w)
81   AM_RANGE(0xe000, 0xe0ff) AM_RAM // battery backed
80   AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_SHARE("nvram") // battery backed
8281ADDRESS_MAP_END
8382
8483static ADDRESS_MAP_START( g627_io, AS_IO, 8, g627_state )
r18083r18084
9089ADDRESS_MAP_END
9190
9291static INPUT_PORTS_START( g627 )
93   PORT_START("X0")
94   PORT_BIT(0x03, IP_ACTIVE_LOW, IPT_UNUSED) // force 3 here so game can start
92   //PORT_START("X0")
9593   //bits 0,1 : optical encoder for precise table alignment. Correct position = 3.
9694   //bit2-7   : position of table as it turns, using Gray code.
97   // code to convert a number to a Gray Code: { return (input >> 1)^input; }
9895   PORT_START("X1")
9996   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Centre TB") PORT_CODE(KEYCODE_Q)
10097   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bank Shot Outlane") PORT_CODE(KEYCODE_W)
r18083r18084
172169   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test 8") PORT_CODE(KEYCODE_STOP)
173170INPUT_PORTS_END
174171
175void g627_state::machine_reset()
176{
177172
178}
179
180173// inputs
181174READ8_MEMBER( g627_state::porta_r )
182175{
176   if (!m_portc)
177      return ((m_motor >> 1)^m_motor) | 3; // convert to Gray Code
178   else
183179   if (m_portc < 7)
184180   {
185181      char kbdrow[6];
r18083r18084
201197   return 0;
202198}
203199
204// write 6 digits
200// display digits
205201WRITE8_MEMBER( g627_state::portc_w )
206202{
207203   m_portc = data;
r18083r18084
227223// lamps and solenoids
228224WRITE8_MEMBER( g627_state::lamp_w )
229225{
226/* offset 0 together with m_portc activates the lamps.
227   offset 1 and 2 are solenoids.
228   offset 1:
229     d0   = Outhole
230     d1   = Bank shot
231     d2-4 = Bumper : centre, Bottom, Top
232     d5-7 = Sling Shot : Top, Right, Left
233   offset 2:
234     d0   = Break Shot
235     d1   = Motor clockwise*
236     d2   = Motor anti-clockwise*
237     d3   = 3 flippers
238     d4   = unknown*
239
240   * = undocumented
241
242 */
243
244   UINT16 solenoid = (offset << 8) | data;
245   switch (solenoid)
246   {
247      case 0x0101:
248      case 0x0120:
249      case 0x0140:
250      case 0x0180:
251      case 0x0201:
252         m_samples->start(0, 5);
253         break;
254      case 0x0104:
255      case 0x0108:
256      case 0x0110:
257         m_samples->start(1, 0);
258         break;
259      case 0x0202:
260      case 0x0212:
261         m_motor++;
262         break;
263      case 0x0204:
264      case 0x0214:
265         m_motor--;
266         break;
267      default:
268         break;
269   }
230270}
231271
232272static I8156_INTERFACE(i8156_intf)
r18083r18084
246286   MCFG_CPU_PROGRAM_MAP(g627_map)
247287   MCFG_CPU_IO_MAP(g627_io)
248288   MCFG_I8156_ADD("i8156", 14138000/8, i8156_intf)
249   MCFG_SPEAKER_STANDARD_MONO("mono")
289   MCFG_NVRAM_ADD_0FILL("nvram")
290
291   /* Sound */
292   MCFG_FRAGMENT_ADD( genpin_audio )
250293   MCFG_SOUND_ADD("astrocade",  ASTROCADE, 14138000/8) // 0066-117XX audio chip
251294   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
252295

Previous 199869 Revisions Next


© 1997-2024 The MAME Team